Dashboard sipadu mbip
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "/";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = 0);
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
  89. /*!**********************************************************************!*\
  90. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  91. \**********************************************************************/
  92. /*! no static exports found */
  93. /***/ (function(module, exports) {
  94. function _assertThisInitialized(self) {
  95. if (self === void 0) {
  96. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  97. }
  98. return self;
  99. }
  100. module.exports = _assertThisInitialized;
  101. /***/ }),
  102. /***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
  103. /*!***************************************************************!*\
  104. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  105. \***************************************************************/
  106. /*! no static exports found */
  107. /***/ (function(module, exports) {
  108. function _defineProperty(obj, key, value) {
  109. if (key in obj) {
  110. Object.defineProperty(obj, key, {
  111. value: value,
  112. enumerable: true,
  113. configurable: true,
  114. writable: true
  115. });
  116. } else {
  117. obj[key] = value;
  118. }
  119. return obj;
  120. }
  121. module.exports = _defineProperty;
  122. /***/ }),
  123. /***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
  124. /*!************************************************************!*\
  125. !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
  126. \************************************************************/
  127. /*! exports provided: default */
  128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  129. "use strict";
  130. __webpack_require__.r(__webpack_exports__);
  131. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; });
  132. function _extends() {
  133. _extends = Object.assign || function (target) {
  134. for (var i = 1; i < arguments.length; i++) {
  135. var source = arguments[i];
  136. for (var key in source) {
  137. if (Object.prototype.hasOwnProperty.call(source, key)) {
  138. target[key] = source[key];
  139. }
  140. }
  141. }
  142. return target;
  143. };
  144. return _extends.apply(this, arguments);
  145. }
  146. /***/ }),
  147. /***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js":
  148. /*!******************************************************************!*\
  149. !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***!
  150. \******************************************************************/
  151. /*! exports provided: default */
  152. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  153. "use strict";
  154. __webpack_require__.r(__webpack_exports__);
  155. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inheritsLoose; });
  156. function _inheritsLoose(subClass, superClass) {
  157. subClass.prototype = Object.create(superClass.prototype);
  158. subClass.prototype.constructor = subClass;
  159. subClass.__proto__ = superClass;
  160. }
  161. /***/ }),
  162. /***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":
  163. /*!*********************************************************************************!*\
  164. !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
  165. \*********************************************************************************/
  166. /*! exports provided: default */
  167. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  168. "use strict";
  169. __webpack_require__.r(__webpack_exports__);
  170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; });
  171. function _objectWithoutPropertiesLoose(source, excluded) {
  172. if (source == null) return {};
  173. var target = {};
  174. var sourceKeys = Object.keys(source);
  175. var key, i;
  176. for (i = 0; i < sourceKeys.length; i++) {
  177. key = sourceKeys[i];
  178. if (excluded.indexOf(key) >= 0) continue;
  179. target[key] = source[key];
  180. }
  181. return target;
  182. }
  183. /***/ }),
  184. /***/ "./node_modules/@babel/runtime/helpers/extends.js":
  185. /*!********************************************************!*\
  186. !*** ./node_modules/@babel/runtime/helpers/extends.js ***!
  187. \********************************************************/
  188. /*! no static exports found */
  189. /***/ (function(module, exports) {
  190. function _extends() {
  191. module.exports = _extends = Object.assign || function (target) {
  192. for (var i = 1; i < arguments.length; i++) {
  193. var source = arguments[i];
  194. for (var key in source) {
  195. if (Object.prototype.hasOwnProperty.call(source, key)) {
  196. target[key] = source[key];
  197. }
  198. }
  199. }
  200. return target;
  201. };
  202. return _extends.apply(this, arguments);
  203. }
  204. module.exports = _extends;
  205. /***/ }),
  206. /***/ "./node_modules/@babel/runtime/helpers/inheritsLoose.js":
  207. /*!**************************************************************!*\
  208. !*** ./node_modules/@babel/runtime/helpers/inheritsLoose.js ***!
  209. \**************************************************************/
  210. /*! no static exports found */
  211. /***/ (function(module, exports) {
  212. function _inheritsLoose(subClass, superClass) {
  213. subClass.prototype = Object.create(superClass.prototype);
  214. subClass.prototype.constructor = subClass;
  215. subClass.__proto__ = superClass;
  216. }
  217. module.exports = _inheritsLoose;
  218. /***/ }),
  219. /***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js":
  220. /*!**********************************************************************!*\
  221. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  222. \**********************************************************************/
  223. /*! no static exports found */
  224. /***/ (function(module, exports) {
  225. function _interopRequireDefault(obj) {
  226. return obj && obj.__esModule ? obj : {
  227. "default": obj
  228. };
  229. }
  230. module.exports = _interopRequireDefault;
  231. /***/ }),
  232. /***/ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
  233. /*!*****************************************************************************!*\
  234. !*** ./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
  235. \*****************************************************************************/
  236. /*! no static exports found */
  237. /***/ (function(module, exports) {
  238. function _objectWithoutPropertiesLoose(source, excluded) {
  239. if (source == null) return {};
  240. var target = {};
  241. var sourceKeys = Object.keys(source);
  242. var key, i;
  243. for (i = 0; i < sourceKeys.length; i++) {
  244. key = sourceKeys[i];
  245. if (excluded.indexOf(key) >= 0) continue;
  246. target[key] = source[key];
  247. }
  248. return target;
  249. }
  250. module.exports = _objectWithoutPropertiesLoose;
  251. /***/ }),
  252. /***/ "./node_modules/@emotion/cache/dist/cache.browser.esm.js":
  253. /*!***************************************************************!*\
  254. !*** ./node_modules/@emotion/cache/dist/cache.browser.esm.js ***!
  255. \***************************************************************/
  256. /*! exports provided: default */
  257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  258. "use strict";
  259. __webpack_require__.r(__webpack_exports__);
  260. /* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/sheet */ "./node_modules/@emotion/sheet/dist/sheet.browser.esm.js");
  261. /* harmony import */ var _emotion_stylis__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/stylis */ "./node_modules/@emotion/stylis/dist/stylis.browser.esm.js");
  262. /* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js");
  263. // https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet
  264. // inlined to avoid umd wrapper and peerDep warnings/installing stylis
  265. // since we use stylis after closure compiler
  266. var delimiter = '/*|*/';
  267. var needle = delimiter + '}';
  268. function toSheet(block) {
  269. if (block) {
  270. Sheet.current.insert(block + '}');
  271. }
  272. }
  273. var Sheet = {
  274. current: null
  275. };
  276. var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {
  277. switch (context) {
  278. // property
  279. case 1:
  280. {
  281. switch (content.charCodeAt(0)) {
  282. case 64:
  283. {
  284. // @import
  285. Sheet.current.insert(content + ';');
  286. return '';
  287. }
  288. // charcode for l
  289. case 108:
  290. {
  291. // charcode for b
  292. // this ignores label
  293. if (content.charCodeAt(2) === 98) {
  294. return '';
  295. }
  296. }
  297. }
  298. break;
  299. }
  300. // selector
  301. case 2:
  302. {
  303. if (ns === 0) return content + delimiter;
  304. break;
  305. }
  306. // at-rule
  307. case 3:
  308. {
  309. switch (ns) {
  310. // @font-face, @page
  311. case 102:
  312. case 112:
  313. {
  314. Sheet.current.insert(selectors[0] + content);
  315. return '';
  316. }
  317. default:
  318. {
  319. return content + (at === 0 ? delimiter : '');
  320. }
  321. }
  322. }
  323. case -2:
  324. {
  325. content.split(needle).forEach(toSheet);
  326. }
  327. }
  328. };
  329. var createCache = function createCache(options) {
  330. if (options === undefined) options = {};
  331. var key = options.key || 'css';
  332. var stylisOptions;
  333. if (options.prefix !== undefined) {
  334. stylisOptions = {
  335. prefix: options.prefix
  336. };
  337. }
  338. var stylis = new _emotion_stylis__WEBPACK_IMPORTED_MODULE_1__["default"](stylisOptions);
  339. if (true) {
  340. // $FlowFixMe
  341. if (/[^a-z-]/.test(key)) {
  342. throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
  343. }
  344. }
  345. var inserted = {}; // $FlowFixMe
  346. var container;
  347. {
  348. container = options.container || document.head;
  349. var nodes = document.querySelectorAll("style[data-emotion-" + key + "]");
  350. Array.prototype.forEach.call(nodes, function (node) {
  351. var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe
  352. attrib.split(' ').forEach(function (id) {
  353. inserted[id] = true;
  354. });
  355. if (node.parentNode !== container) {
  356. container.appendChild(node);
  357. }
  358. });
  359. }
  360. var _insert;
  361. {
  362. stylis.use(options.stylisPlugins)(ruleSheet);
  363. _insert = function insert(selector, serialized, sheet, shouldCache) {
  364. var name = serialized.name;
  365. Sheet.current = sheet;
  366. if ( true && serialized.map !== undefined) {
  367. var map = serialized.map;
  368. Sheet.current = {
  369. insert: function insert(rule) {
  370. sheet.insert(rule + map);
  371. }
  372. };
  373. }
  374. stylis(selector, serialized.styles);
  375. if (shouldCache) {
  376. cache.inserted[name] = true;
  377. }
  378. };
  379. }
  380. if (true) {
  381. // https://esbench.com/bench/5bf7371a4cd7e6009ef61d0a
  382. var commentStart = /\/\*/g;
  383. var commentEnd = /\*\//g;
  384. stylis.use(function (context, content) {
  385. switch (context) {
  386. case -1:
  387. {
  388. while (commentStart.test(content)) {
  389. commentEnd.lastIndex = commentStart.lastIndex;
  390. if (commentEnd.test(content)) {
  391. commentStart.lastIndex = commentEnd.lastIndex;
  392. continue;
  393. }
  394. throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');
  395. }
  396. commentStart.lastIndex = 0;
  397. break;
  398. }
  399. }
  400. });
  401. stylis.use(function (context, content, selectors) {
  402. switch (context) {
  403. case -1:
  404. {
  405. var flag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
  406. var unsafePseudoClasses = content.match(/(:first|:nth|:nth-last)-child/g);
  407. if (unsafePseudoClasses && cache.compat !== true) {
  408. unsafePseudoClasses.forEach(function (unsafePseudoClass) {
  409. var ignoreRegExp = new RegExp(unsafePseudoClass + ".*\\/\\* " + flag + " \\*\\/");
  410. var ignore = ignoreRegExp.test(content);
  411. if (unsafePseudoClass && !ignore) {
  412. console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
  413. }
  414. });
  415. }
  416. break;
  417. }
  418. }
  419. });
  420. }
  421. var cache = {
  422. key: key,
  423. sheet: new _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__["StyleSheet"]({
  424. key: key,
  425. container: container,
  426. nonce: options.nonce,
  427. speedy: options.speedy
  428. }),
  429. nonce: options.nonce,
  430. inserted: inserted,
  431. registered: {},
  432. insert: _insert
  433. };
  434. return cache;
  435. };
  436. /* harmony default export */ __webpack_exports__["default"] = (createCache);
  437. /***/ }),
  438. /***/ "./node_modules/@emotion/core/dist/core.browser.esm.js":
  439. /*!*************************************************************!*\
  440. !*** ./node_modules/@emotion/core/dist/core.browser.esm.js ***!
  441. \*************************************************************/
  442. /*! exports provided: css, CacheProvider, ClassNames, Global, ThemeContext, jsx, keyframes, withEmotionCache */
  443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  444. "use strict";
  445. __webpack_require__.r(__webpack_exports__);
  446. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CacheProvider", function() { return CacheProvider; });
  447. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassNames", function() { return ClassNames; });
  448. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Global", function() { return Global; });
  449. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeContext", function() { return ThemeContext; });
  450. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsx", function() { return jsx; });
  451. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyframes", function() { return keyframes; });
  452. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withEmotionCache", function() { return withEmotionCache; });
  453. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
  454. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__);
  455. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  456. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  457. /* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/cache */ "./node_modules/@emotion/cache/dist/cache.browser.esm.js");
  458. /* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/utils.browser.esm.js");
  459. /* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/serialize.browser.esm.js");
  460. /* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/sheet */ "./node_modules/@emotion/sheet/dist/sheet.browser.esm.js");
  461. /* harmony import */ var _emotion_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @emotion/css */ "./node_modules/@emotion/css/dist/css.browser.esm.js");
  462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "css", function() { return _emotion_css__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  463. var EmotionCacheContext = Object(react__WEBPACK_IMPORTED_MODULE_1__["createContext"])( // we're doing this to avoid preconstruct's dead code elimination in this one case
  464. // because this module is primarily intended for the browser and node
  465. // but it's also required in react native and similar environments sometimes
  466. // and we could have a special build just for that
  467. // but this is much easier and the native packages
  468. // might use a different theme context in the future anyway
  469. typeof HTMLElement !== 'undefined' ? Object(_emotion_cache__WEBPACK_IMPORTED_MODULE_2__["default"])() : null);
  470. var ThemeContext = Object(react__WEBPACK_IMPORTED_MODULE_1__["createContext"])({});
  471. var CacheProvider = EmotionCacheContext.Provider;
  472. var withEmotionCache = function withEmotionCache(func) {
  473. var render = function render(props, ref) {
  474. return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(EmotionCacheContext.Consumer, null, function (cache) {
  475. return func(props, cache, ref);
  476. });
  477. }; // $FlowFixMe
  478. return Object(react__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(render);
  479. };
  480. // thus we only need to replace what is a valid character for JS, but not for CSS
  481. var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
  482. return identifier.replace(/\$/g, '-');
  483. };
  484. var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
  485. var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
  486. var hasOwnProperty = Object.prototype.hasOwnProperty;
  487. var render = function render(cache, props, theme, ref) {
  488. var cssProp = theme === null ? props.css : props.css(theme); // so that using `css` from `emotion` and passing the result to the css prop works
  489. // not passing the registered cache to serializeStyles because it would
  490. // make certain babel optimisations not possible
  491. if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
  492. cssProp = cache.registered[cssProp];
  493. }
  494. var type = props[typePropName];
  495. var registeredStyles = [cssProp];
  496. var className = '';
  497. if (typeof props.className === 'string') {
  498. className = Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["getRegisteredStyles"])(cache.registered, registeredStyles, props.className);
  499. } else if (props.className != null) {
  500. className = props.className + " ";
  501. }
  502. var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])(registeredStyles);
  503. if ( true && serialized.name.indexOf('-') === -1) {
  504. var labelFromStack = props[labelPropName];
  505. if (labelFromStack) {
  506. serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])([serialized, 'label:' + labelFromStack + ';']);
  507. }
  508. }
  509. var rules = Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["insertStyles"])(cache, serialized, typeof type === 'string');
  510. className += cache.key + "-" + serialized.name;
  511. var newProps = {};
  512. for (var key in props) {
  513. if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( false || key !== labelPropName)) {
  514. newProps[key] = props[key];
  515. }
  516. }
  517. newProps.ref = ref;
  518. newProps.className = className;
  519. var ele = Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(type, newProps);
  520. return ele;
  521. };
  522. var Emotion =
  523. /* #__PURE__ */
  524. withEmotionCache(function (props, cache, ref) {
  525. // use Context.read for the theme when it's stable
  526. if (typeof props.css === 'function') {
  527. return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ThemeContext.Consumer, null, function (theme) {
  528. return render(cache, props, theme, ref);
  529. });
  530. }
  531. return render(cache, props, null, ref);
  532. });
  533. if (true) {
  534. Emotion.displayName = 'EmotionCssPropInternal';
  535. } // $FlowFixMe
  536. var jsx = function jsx(type, props) {
  537. var args = arguments;
  538. if (props == null || !hasOwnProperty.call(props, 'css')) {
  539. // $FlowFixMe
  540. return react__WEBPACK_IMPORTED_MODULE_1__["createElement"].apply(undefined, args);
  541. }
  542. if ( true && typeof props.css === 'string' && // check if there is a css declaration
  543. props.css.indexOf(':') !== -1) {
  544. throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/css' like this: css`" + props.css + "`");
  545. }
  546. var argsLength = args.length;
  547. var createElementArgArray = new Array(argsLength);
  548. createElementArgArray[0] = Emotion;
  549. var newProps = {};
  550. for (var key in props) {
  551. if (hasOwnProperty.call(props, key)) {
  552. newProps[key] = props[key];
  553. }
  554. }
  555. newProps[typePropName] = type;
  556. if (true) {
  557. var error = new Error();
  558. if (error.stack) {
  559. // chrome
  560. var match = error.stack.match(/at (?:Object\.|)jsx.*\n\s+at ([A-Z][A-Za-z$]+) /);
  561. if (!match) {
  562. // safari and firefox
  563. match = error.stack.match(/^.*\n([A-Z][A-Za-z$]+)@/);
  564. }
  565. if (match) {
  566. newProps[labelPropName] = sanitizeIdentifier(match[1]);
  567. }
  568. }
  569. }
  570. createElementArgArray[1] = newProps;
  571. for (var i = 2; i < argsLength; i++) {
  572. createElementArgArray[i] = args[i];
  573. } // $FlowFixMe
  574. return react__WEBPACK_IMPORTED_MODULE_1__["createElement"].apply(null, createElementArgArray);
  575. };
  576. var warnedAboutCssPropForGlobal = false;
  577. var Global =
  578. /* #__PURE__ */
  579. withEmotionCache(function (props, cache) {
  580. if ( true && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
  581. // probably using the custom createElement which
  582. // means it will be turned into a className prop
  583. // $FlowFixMe I don't really want to add it to the type since it shouldn't be used
  584. props.className || props.css)) {
  585. console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
  586. warnedAboutCssPropForGlobal = true;
  587. }
  588. var styles = props.styles;
  589. if (typeof styles === 'function') {
  590. return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ThemeContext.Consumer, null, function (theme) {
  591. var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])([styles(theme)]);
  592. return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(InnerGlobal, {
  593. serialized: serialized,
  594. cache: cache
  595. });
  596. });
  597. }
  598. var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])([styles]);
  599. return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(InnerGlobal, {
  600. serialized: serialized,
  601. cache: cache
  602. });
  603. });
  604. // maintain place over rerenders.
  605. // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
  606. // initial client-side render from SSR, use place of hydrating tag
  607. var InnerGlobal =
  608. /*#__PURE__*/
  609. function (_React$Component) {
  610. _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default()(InnerGlobal, _React$Component);
  611. function InnerGlobal(props, context, updater) {
  612. return _React$Component.call(this, props, context, updater) || this;
  613. }
  614. var _proto = InnerGlobal.prototype;
  615. _proto.componentDidMount = function componentDidMount() {
  616. this.sheet = new _emotion_sheet__WEBPACK_IMPORTED_MODULE_5__["StyleSheet"]({
  617. key: this.props.cache.key + "-global",
  618. nonce: this.props.cache.sheet.nonce,
  619. container: this.props.cache.sheet.container
  620. }); // $FlowFixMe
  621. var node = document.querySelector("style[data-emotion-" + this.props.cache.key + "=\"" + this.props.serialized.name + "\"]");
  622. if (node !== null) {
  623. this.sheet.tags.push(node);
  624. }
  625. if (this.props.cache.sheet.tags.length) {
  626. this.sheet.before = this.props.cache.sheet.tags[0];
  627. }
  628. this.insertStyles();
  629. };
  630. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  631. if (prevProps.serialized.name !== this.props.serialized.name) {
  632. this.insertStyles();
  633. }
  634. };
  635. _proto.insertStyles = function insertStyles$1() {
  636. if (this.props.serialized.next !== undefined) {
  637. // insert keyframes
  638. Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["insertStyles"])(this.props.cache, this.props.serialized.next, true);
  639. }
  640. if (this.sheet.tags.length) {
  641. // if this doesn't exist then it will be null so the style element will be appended
  642. var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling;
  643. this.sheet.before = element;
  644. this.sheet.flush();
  645. }
  646. this.props.cache.insert("", this.props.serialized, this.sheet, false);
  647. };
  648. _proto.componentWillUnmount = function componentWillUnmount() {
  649. this.sheet.flush();
  650. };
  651. _proto.render = function render() {
  652. return null;
  653. };
  654. return InnerGlobal;
  655. }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]);
  656. var keyframes = function keyframes() {
  657. var insertable = _emotion_css__WEBPACK_IMPORTED_MODULE_6__["default"].apply(void 0, arguments);
  658. var name = "animation-" + insertable.name; // $FlowFixMe
  659. return {
  660. name: name,
  661. styles: "@keyframes " + name + "{" + insertable.styles + "}",
  662. anim: 1,
  663. toString: function toString() {
  664. return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
  665. }
  666. };
  667. };
  668. var classnames = function classnames(args) {
  669. var len = args.length;
  670. var i = 0;
  671. var cls = '';
  672. for (; i < len; i++) {
  673. var arg = args[i];
  674. if (arg == null) continue;
  675. var toAdd = void 0;
  676. switch (typeof arg) {
  677. case 'boolean':
  678. break;
  679. case 'object':
  680. {
  681. if (Array.isArray(arg)) {
  682. toAdd = classnames(arg);
  683. } else {
  684. toAdd = '';
  685. for (var k in arg) {
  686. if (arg[k] && k) {
  687. toAdd && (toAdd += ' ');
  688. toAdd += k;
  689. }
  690. }
  691. }
  692. break;
  693. }
  694. default:
  695. {
  696. toAdd = arg;
  697. }
  698. }
  699. if (toAdd) {
  700. cls && (cls += ' ');
  701. cls += toAdd;
  702. }
  703. }
  704. return cls;
  705. };
  706. function merge(registered, css, className) {
  707. var registeredStyles = [];
  708. var rawClassName = Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["getRegisteredStyles"])(registered, registeredStyles, className);
  709. if (registeredStyles.length < 2) {
  710. return className;
  711. }
  712. return rawClassName + css(registeredStyles);
  713. }
  714. var ClassNames = withEmotionCache(function (props, context) {
  715. return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ThemeContext.Consumer, null, function (theme) {
  716. var hasRendered = false;
  717. var css = function css() {
  718. if (hasRendered && "development" !== 'production') {
  719. throw new Error('css can only be used during render');
  720. }
  721. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  722. args[_key] = arguments[_key];
  723. }
  724. var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])(args, context.registered);
  725. {
  726. Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["insertStyles"])(context, serialized, false);
  727. }
  728. return context.key + "-" + serialized.name;
  729. };
  730. var cx = function cx() {
  731. if (hasRendered && "development" !== 'production') {
  732. throw new Error('cx can only be used during render');
  733. }
  734. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  735. args[_key2] = arguments[_key2];
  736. }
  737. return merge(context.registered, css, classnames(args));
  738. };
  739. var content = {
  740. css: css,
  741. cx: cx,
  742. theme: theme
  743. };
  744. var ele = props.children(content);
  745. hasRendered = true;
  746. return ele;
  747. });
  748. });
  749. /***/ }),
  750. /***/ "./node_modules/@emotion/css/dist/css.browser.esm.js":
  751. /*!***********************************************************!*\
  752. !*** ./node_modules/@emotion/css/dist/css.browser.esm.js ***!
  753. \***********************************************************/
  754. /*! exports provided: default */
  755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  756. "use strict";
  757. __webpack_require__.r(__webpack_exports__);
  758. /* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/serialize.browser.esm.js");
  759. function css() {
  760. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  761. args[_key] = arguments[_key];
  762. }
  763. return Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_0__["serializeStyles"])(args);
  764. }
  765. /* harmony default export */ __webpack_exports__["default"] = (css);
  766. /***/ }),
  767. /***/ "./node_modules/@emotion/hash/dist/hash.browser.esm.js":
  768. /*!*************************************************************!*\
  769. !*** ./node_modules/@emotion/hash/dist/hash.browser.esm.js ***!
  770. \*************************************************************/
  771. /*! exports provided: default */
  772. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  773. "use strict";
  774. __webpack_require__.r(__webpack_exports__);
  775. /* eslint-disable */
  776. // murmurhash2 via https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
  777. function murmurhash2_32_gc(str) {
  778. var l = str.length,
  779. h = l ^ l,
  780. i = 0,
  781. k;
  782. while (l >= 4) {
  783. k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
  784. k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  785. k ^= k >>> 24;
  786. k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  787. h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;
  788. l -= 4;
  789. ++i;
  790. }
  791. switch (l) {
  792. case 3:
  793. h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
  794. case 2:
  795. h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
  796. case 1:
  797. h ^= str.charCodeAt(i) & 0xff;
  798. h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  799. }
  800. h ^= h >>> 13;
  801. h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  802. h ^= h >>> 15;
  803. return (h >>> 0).toString(36);
  804. }
  805. /* harmony default export */ __webpack_exports__["default"] = (murmurhash2_32_gc);
  806. /***/ }),
  807. /***/ "./node_modules/@emotion/memoize/dist/memoize.browser.esm.js":
  808. /*!*******************************************************************!*\
  809. !*** ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***!
  810. \*******************************************************************/
  811. /*! exports provided: default */
  812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  813. "use strict";
  814. __webpack_require__.r(__webpack_exports__);
  815. function memoize(fn) {
  816. var cache = {};
  817. return function (arg) {
  818. if (cache[arg] === undefined) cache[arg] = fn(arg);
  819. return cache[arg];
  820. };
  821. }
  822. /* harmony default export */ __webpack_exports__["default"] = (memoize);
  823. /***/ }),
  824. /***/ "./node_modules/@emotion/serialize/dist/serialize.browser.esm.js":
  825. /*!***********************************************************************!*\
  826. !*** ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js ***!
  827. \***********************************************************************/
  828. /*! exports provided: serializeStyles */
  829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  830. "use strict";
  831. __webpack_require__.r(__webpack_exports__);
  832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serializeStyles", function() { return serializeStyles; });
  833. /* harmony import */ var _emotion_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/hash */ "./node_modules/@emotion/hash/dist/hash.browser.esm.js");
  834. /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js");
  835. /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/memoize.browser.esm.js");
  836. var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
  837. var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
  838. var hyphenateRegex = /[A-Z]|^ms/g;
  839. var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
  840. var isCustomProperty = function isCustomProperty(property) {
  841. return property.charCodeAt(1) === 45;
  842. };
  843. var isProcessableValue = function isProcessableValue(value) {
  844. return value != null && typeof value !== 'boolean';
  845. };
  846. var processStyleName = Object(_emotion_memoize__WEBPACK_IMPORTED_MODULE_2__["default"])(function (styleName) {
  847. return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
  848. });
  849. var processStyleValue = function processStyleValue(key, value) {
  850. switch (key) {
  851. case 'animation':
  852. case 'animationName':
  853. {
  854. if (typeof value === 'string') {
  855. return value.replace(animationRegex, function (match, p1, p2) {
  856. cursor = {
  857. name: p1,
  858. styles: p2,
  859. next: cursor
  860. };
  861. return p1;
  862. });
  863. }
  864. }
  865. }
  866. if (_emotion_unitless__WEBPACK_IMPORTED_MODULE_1__["default"][key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
  867. return value + 'px';
  868. }
  869. return value;
  870. };
  871. if (true) {
  872. var contentValuePattern = /(attr|calc|counters?|url)\(/;
  873. var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit', 'unset'];
  874. var oldProcessStyleValue = processStyleValue;
  875. var msPattern = /^-ms-/;
  876. var hyphenPattern = /-(.)/g;
  877. var hyphenatedCache = {};
  878. processStyleValue = function processStyleValue(key, value) {
  879. if (key === 'content') {
  880. if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
  881. console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
  882. }
  883. }
  884. var processed = oldProcessStyleValue(key, value);
  885. if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
  886. hyphenatedCache[key] = true;
  887. console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
  888. return _char.toUpperCase();
  889. }) + "?");
  890. }
  891. return processed;
  892. };
  893. }
  894. var shouldWarnAboutInterpolatingClassNameFromCss = true;
  895. function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {
  896. if (interpolation == null) {
  897. return '';
  898. }
  899. if (interpolation.__emotion_styles !== undefined) {
  900. if ( true && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
  901. throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
  902. }
  903. return interpolation;
  904. }
  905. switch (typeof interpolation) {
  906. case 'boolean':
  907. {
  908. return '';
  909. }
  910. case 'object':
  911. {
  912. if (interpolation.anim === 1) {
  913. cursor = {
  914. name: interpolation.name,
  915. styles: interpolation.styles,
  916. next: cursor
  917. };
  918. return interpolation.name;
  919. }
  920. if (interpolation.styles !== undefined) {
  921. var next = interpolation.next;
  922. if (next !== undefined) {
  923. // not the most efficient thing ever but this is a pretty rare case
  924. // and there will be very few iterations of this generally
  925. while (next !== undefined) {
  926. cursor = {
  927. name: next.name,
  928. styles: next.styles,
  929. next: cursor
  930. };
  931. next = next.next;
  932. }
  933. }
  934. var styles = interpolation.styles + ";";
  935. if ( true && interpolation.map !== undefined) {
  936. styles += interpolation.map;
  937. }
  938. return styles;
  939. }
  940. return createStringFromObject(mergedProps, registered, interpolation);
  941. }
  942. case 'function':
  943. {
  944. if (mergedProps !== undefined) {
  945. var previousCursor = cursor;
  946. var result = interpolation(mergedProps);
  947. cursor = previousCursor;
  948. return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);
  949. } else if (true) {
  950. console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
  951. }
  952. break;
  953. }
  954. case 'string':
  955. if (true) {
  956. var matched = [];
  957. var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
  958. var fakeVarName = "animation" + matched.length;
  959. matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
  960. return "${" + fakeVarName + "}";
  961. });
  962. if (matched.length) {
  963. console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
  964. }
  965. }
  966. break;
  967. } // finalize string values (regular strings and functions interpolated into css calls)
  968. if (registered == null) {
  969. return interpolation;
  970. }
  971. var cached = registered[interpolation];
  972. if ( true && couldBeSelectorInterpolation && shouldWarnAboutInterpolatingClassNameFromCss && cached !== undefined) {
  973. console.error('Interpolating a className from css`` is not recommended and will cause problems with composition.\n' + 'Interpolating a className from css`` will be completely unsupported in a future major version of Emotion');
  974. shouldWarnAboutInterpolatingClassNameFromCss = false;
  975. }
  976. return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;
  977. }
  978. function createStringFromObject(mergedProps, registered, obj) {
  979. var string = '';
  980. if (Array.isArray(obj)) {
  981. for (var i = 0; i < obj.length; i++) {
  982. string += handleInterpolation(mergedProps, registered, obj[i], false);
  983. }
  984. } else {
  985. for (var _key in obj) {
  986. var value = obj[_key];
  987. if (typeof value !== 'object') {
  988. if (registered != null && registered[value] !== undefined) {
  989. string += _key + "{" + registered[value] + "}";
  990. } else if (isProcessableValue(value)) {
  991. string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
  992. }
  993. } else {
  994. if (_key === 'NO_COMPONENT_SELECTOR' && "development" !== 'production') {
  995. throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
  996. }
  997. if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
  998. for (var _i = 0; _i < value.length; _i++) {
  999. if (isProcessableValue(value[_i])) {
  1000. string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
  1001. }
  1002. }
  1003. } else {
  1004. var interpolated = handleInterpolation(mergedProps, registered, value, false);
  1005. switch (_key) {
  1006. case 'animation':
  1007. case 'animationName':
  1008. {
  1009. string += processStyleName(_key) + ":" + interpolated + ";";
  1010. break;
  1011. }
  1012. default:
  1013. {
  1014. if ( true && _key === 'undefined') {
  1015. console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
  1016. }
  1017. string += _key + "{" + interpolated + "}";
  1018. }
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. return string;
  1025. }
  1026. var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g;
  1027. var sourceMapPattern;
  1028. if (true) {
  1029. sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//;
  1030. } // this is the cursor for keyframes
  1031. // keyframes are stored on the SerializedStyles object as a linked list
  1032. var cursor;
  1033. var serializeStyles = function serializeStyles(args, registered, mergedProps) {
  1034. if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
  1035. return args[0];
  1036. }
  1037. var stringMode = true;
  1038. var styles = '';
  1039. cursor = undefined;
  1040. var strings = args[0];
  1041. if (strings == null || strings.raw === undefined) {
  1042. stringMode = false;
  1043. styles += handleInterpolation(mergedProps, registered, strings, false);
  1044. } else {
  1045. if ( true && strings[0] === undefined) {
  1046. console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
  1047. }
  1048. styles += strings[0];
  1049. } // we start at 1 since we've already handled the first arg
  1050. for (var i = 1; i < args.length; i++) {
  1051. styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);
  1052. if (stringMode) {
  1053. if ( true && strings[i] === undefined) {
  1054. console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
  1055. }
  1056. styles += strings[i];
  1057. }
  1058. }
  1059. var sourceMap;
  1060. if (true) {
  1061. styles = styles.replace(sourceMapPattern, function (match) {
  1062. sourceMap = match;
  1063. return '';
  1064. });
  1065. } // using a global regex with .exec is stateful so lastIndex has to be reset each time
  1066. labelPattern.lastIndex = 0;
  1067. var identifierName = '';
  1068. var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
  1069. while ((match = labelPattern.exec(styles)) !== null) {
  1070. identifierName += '-' + // $FlowFixMe we know it's not null
  1071. match[1];
  1072. }
  1073. var name = Object(_emotion_hash__WEBPACK_IMPORTED_MODULE_0__["default"])(styles) + identifierName;
  1074. if (true) {
  1075. // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
  1076. return {
  1077. name: name,
  1078. styles: styles,
  1079. map: sourceMap,
  1080. next: cursor,
  1081. toString: function toString() {
  1082. return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
  1083. }
  1084. };
  1085. }
  1086. return {
  1087. name: name,
  1088. styles: styles,
  1089. next: cursor
  1090. };
  1091. };
  1092. /***/ }),
  1093. /***/ "./node_modules/@emotion/sheet/dist/sheet.browser.esm.js":
  1094. /*!***************************************************************!*\
  1095. !*** ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js ***!
  1096. \***************************************************************/
  1097. /*! exports provided: StyleSheet */
  1098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1099. "use strict";
  1100. __webpack_require__.r(__webpack_exports__);
  1101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleSheet", function() { return StyleSheet; });
  1102. /*
  1103. Based off glamor's StyleSheet, thanks Sunil ❤️
  1104. high performance StyleSheet for css-in-js systems
  1105. - uses multiple style tags behind the scenes for millions of rules
  1106. - uses `insertRule` for appending in production for *much* faster performance
  1107. // usage
  1108. import { StyleSheet } from '@emotion/sheet'
  1109. let styleSheet = new StyleSheet({ key: '', container: document.head })
  1110. styleSheet.insert('#box { border: 1px solid red; }')
  1111. - appends a css rule into the stylesheet
  1112. styleSheet.flush()
  1113. - empties the stylesheet of all its contents
  1114. */
  1115. // $FlowFixMe
  1116. function sheetForTag(tag) {
  1117. if (tag.sheet) {
  1118. // $FlowFixMe
  1119. return tag.sheet;
  1120. } // this weirdness brought to you by firefox
  1121. /* istanbul ignore next */
  1122. for (var i = 0; i < document.styleSheets.length; i++) {
  1123. if (document.styleSheets[i].ownerNode === tag) {
  1124. // $FlowFixMe
  1125. return document.styleSheets[i];
  1126. }
  1127. }
  1128. }
  1129. function createStyleElement(options) {
  1130. var tag = document.createElement('style');
  1131. tag.setAttribute('data-emotion', options.key);
  1132. if (options.nonce !== undefined) {
  1133. tag.setAttribute('nonce', options.nonce);
  1134. }
  1135. tag.appendChild(document.createTextNode(''));
  1136. return tag;
  1137. }
  1138. var StyleSheet =
  1139. /*#__PURE__*/
  1140. function () {
  1141. function StyleSheet(options) {
  1142. this.isSpeedy = options.speedy === undefined ? "development" === 'production' : options.speedy;
  1143. this.tags = [];
  1144. this.ctr = 0;
  1145. this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
  1146. this.key = options.key;
  1147. this.container = options.container;
  1148. this.before = null;
  1149. }
  1150. var _proto = StyleSheet.prototype;
  1151. _proto.insert = function insert(rule) {
  1152. // the max length is how many rules we have per style tag, it's 65000 in speedy mode
  1153. // it's 1 in dev because we insert source maps that map a single rule to a location
  1154. // and you can only have one source map per style tag
  1155. if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
  1156. var _tag = createStyleElement(this);
  1157. var before;
  1158. if (this.tags.length === 0) {
  1159. before = this.before;
  1160. } else {
  1161. before = this.tags[this.tags.length - 1].nextSibling;
  1162. }
  1163. this.container.insertBefore(_tag, before);
  1164. this.tags.push(_tag);
  1165. }
  1166. var tag = this.tags[this.tags.length - 1];
  1167. if (this.isSpeedy) {
  1168. var sheet = sheetForTag(tag);
  1169. try {
  1170. // this is a really hot path
  1171. // we check the second character first because having "i"
  1172. // as the second character will happen less often than
  1173. // having "@" as the first character
  1174. var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers
  1175. // the big drawback is that the css won't be editable in devtools
  1176. sheet.insertRule(rule, // we need to insert @import rules before anything else
  1177. // otherwise there will be an error
  1178. // technically this means that the @import rules will
  1179. // _usually_(not always since there could be multiple style tags)
  1180. // be the first ones in prod and generally later in dev
  1181. // this shouldn't really matter in the real world though
  1182. // @import is generally only used for font faces from google fonts and etc.
  1183. // so while this could be technically correct then it would be slower and larger
  1184. // for a tiny bit of correctness that won't matter in the real world
  1185. isImportRule ? 0 : sheet.cssRules.length);
  1186. } catch (e) {
  1187. if (true) {
  1188. console.warn("There was a problem inserting the following rule: \"" + rule + "\"", e);
  1189. }
  1190. }
  1191. } else {
  1192. tag.appendChild(document.createTextNode(rule));
  1193. }
  1194. this.ctr++;
  1195. };
  1196. _proto.flush = function flush() {
  1197. // $FlowFixMe
  1198. this.tags.forEach(function (tag) {
  1199. return tag.parentNode.removeChild(tag);
  1200. });
  1201. this.tags = [];
  1202. this.ctr = 0;
  1203. };
  1204. return StyleSheet;
  1205. }();
  1206. /***/ }),
  1207. /***/ "./node_modules/@emotion/stylis/dist/stylis.browser.esm.js":
  1208. /*!*****************************************************************!*\
  1209. !*** ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js ***!
  1210. \*****************************************************************/
  1211. /*! exports provided: default */
  1212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1213. "use strict";
  1214. __webpack_require__.r(__webpack_exports__);
  1215. function stylis_min (W) {
  1216. function M(d, c, e, h, a) {
  1217. for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
  1218. g = e.charCodeAt(l);
  1219. l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
  1220. if (0 === b + n + v + m) {
  1221. if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
  1222. switch (g) {
  1223. case 32:
  1224. case 9:
  1225. case 59:
  1226. case 13:
  1227. case 10:
  1228. break;
  1229. default:
  1230. f += e.charAt(l);
  1231. }
  1232. g = 59;
  1233. }
  1234. switch (g) {
  1235. case 123:
  1236. f = f.trim();
  1237. q = f.charCodeAt(0);
  1238. k = 1;
  1239. for (t = ++l; l < B;) {
  1240. switch (g = e.charCodeAt(l)) {
  1241. case 123:
  1242. k++;
  1243. break;
  1244. case 125:
  1245. k--;
  1246. break;
  1247. case 47:
  1248. switch (g = e.charCodeAt(l + 1)) {
  1249. case 42:
  1250. case 47:
  1251. a: {
  1252. for (u = l + 1; u < J; ++u) {
  1253. switch (e.charCodeAt(u)) {
  1254. case 47:
  1255. if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
  1256. l = u + 1;
  1257. break a;
  1258. }
  1259. break;
  1260. case 10:
  1261. if (47 === g) {
  1262. l = u + 1;
  1263. break a;
  1264. }
  1265. }
  1266. }
  1267. l = u;
  1268. }
  1269. }
  1270. break;
  1271. case 91:
  1272. g++;
  1273. case 40:
  1274. g++;
  1275. case 34:
  1276. case 39:
  1277. for (; l++ < J && e.charCodeAt(l) !== g;) {
  1278. }
  1279. }
  1280. if (0 === k) break;
  1281. l++;
  1282. }
  1283. k = e.substring(t, l);
  1284. 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));
  1285. switch (q) {
  1286. case 64:
  1287. 0 < r && (f = f.replace(N, ''));
  1288. g = f.charCodeAt(1);
  1289. switch (g) {
  1290. case 100:
  1291. case 109:
  1292. case 115:
  1293. case 45:
  1294. r = c;
  1295. break;
  1296. default:
  1297. r = O;
  1298. }
  1299. k = M(c, r, k, g, a + 1);
  1300. t = k.length;
  1301. 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
  1302. if (0 < t) switch (g) {
  1303. case 115:
  1304. f = f.replace(da, ea);
  1305. case 100:
  1306. case 109:
  1307. case 45:
  1308. k = f + '{' + k + '}';
  1309. break;
  1310. case 107:
  1311. f = f.replace(fa, '$1 $2');
  1312. k = f + '{' + k + '}';
  1313. k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
  1314. break;
  1315. default:
  1316. k = f + k, 112 === h && (k = (p += k, ''));
  1317. } else k = '';
  1318. break;
  1319. default:
  1320. k = M(c, X(c, f, I), k, h, a + 1);
  1321. }
  1322. F += k;
  1323. k = I = r = u = q = 0;
  1324. f = '';
  1325. g = e.charCodeAt(++l);
  1326. break;
  1327. case 125:
  1328. case 59:
  1329. f = (0 < r ? f.replace(N, '') : f).trim();
  1330. if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
  1331. case 0:
  1332. break;
  1333. case 64:
  1334. if (105 === g || 99 === g) {
  1335. G += f + e.charAt(l);
  1336. break;
  1337. }
  1338. default:
  1339. 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
  1340. }
  1341. I = r = u = q = 0;
  1342. f = '';
  1343. g = e.charCodeAt(++l);
  1344. }
  1345. }
  1346. switch (g) {
  1347. case 13:
  1348. case 10:
  1349. 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
  1350. 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
  1351. z = 1;
  1352. D++;
  1353. break;
  1354. case 59:
  1355. case 125:
  1356. if (0 === b + n + v + m) {
  1357. z++;
  1358. break;
  1359. }
  1360. default:
  1361. z++;
  1362. y = e.charAt(l);
  1363. switch (g) {
  1364. case 9:
  1365. case 32:
  1366. if (0 === n + m + b) switch (x) {
  1367. case 44:
  1368. case 58:
  1369. case 9:
  1370. case 32:
  1371. y = '';
  1372. break;
  1373. default:
  1374. 32 !== g && (y = ' ');
  1375. }
  1376. break;
  1377. case 0:
  1378. y = '\\0';
  1379. break;
  1380. case 12:
  1381. y = '\\f';
  1382. break;
  1383. case 11:
  1384. y = '\\v';
  1385. break;
  1386. case 38:
  1387. 0 === n + b + m && (r = I = 1, y = '\f' + y);
  1388. break;
  1389. case 108:
  1390. if (0 === n + b + m + E && 0 < u) switch (l - u) {
  1391. case 2:
  1392. 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
  1393. case 8:
  1394. 111 === K && (E = K);
  1395. }
  1396. break;
  1397. case 58:
  1398. 0 === n + b + m && (u = l);
  1399. break;
  1400. case 44:
  1401. 0 === b + v + n + m && (r = 1, y += '\r');
  1402. break;
  1403. case 34:
  1404. case 39:
  1405. 0 === b && (n = n === g ? 0 : 0 === n ? g : n);
  1406. break;
  1407. case 91:
  1408. 0 === n + b + v && m++;
  1409. break;
  1410. case 93:
  1411. 0 === n + b + v && m--;
  1412. break;
  1413. case 41:
  1414. 0 === n + b + m && v--;
  1415. break;
  1416. case 40:
  1417. if (0 === n + b + m) {
  1418. if (0 === q) switch (2 * x + 3 * K) {
  1419. case 533:
  1420. break;
  1421. default:
  1422. q = 1;
  1423. }
  1424. v++;
  1425. }
  1426. break;
  1427. case 64:
  1428. 0 === b + v + n + m + u + k && (k = 1);
  1429. break;
  1430. case 42:
  1431. case 47:
  1432. if (!(0 < n + m + v)) switch (b) {
  1433. case 0:
  1434. switch (2 * g + 3 * e.charCodeAt(l + 1)) {
  1435. case 235:
  1436. b = 47;
  1437. break;
  1438. case 220:
  1439. t = l, b = 42;
  1440. }
  1441. break;
  1442. case 42:
  1443. 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
  1444. }
  1445. }
  1446. 0 === b && (f += y);
  1447. }
  1448. K = x;
  1449. x = g;
  1450. l++;
  1451. }
  1452. t = p.length;
  1453. if (0 < t) {
  1454. r = c;
  1455. if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
  1456. p = r.join(',') + '{' + p + '}';
  1457. if (0 !== w * E) {
  1458. 2 !== w || L(p, 2) || (E = 0);
  1459. switch (E) {
  1460. case 111:
  1461. p = p.replace(ha, ':-moz-$1') + p;
  1462. break;
  1463. case 112:
  1464. p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
  1465. }
  1466. E = 0;
  1467. }
  1468. }
  1469. return G + p + F;
  1470. }
  1471. function X(d, c, e) {
  1472. var h = c.trim().split(ia);
  1473. c = h;
  1474. var a = h.length,
  1475. m = d.length;
  1476. switch (m) {
  1477. case 0:
  1478. case 1:
  1479. var b = 0;
  1480. for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
  1481. c[b] = Z(d, c[b], e).trim();
  1482. }
  1483. break;
  1484. default:
  1485. var v = b = 0;
  1486. for (c = []; b < a; ++b) {
  1487. for (var n = 0; n < m; ++n) {
  1488. c[v++] = Z(d[n] + ' ', h[b], e).trim();
  1489. }
  1490. }
  1491. }
  1492. return c;
  1493. }
  1494. function Z(d, c, e) {
  1495. var h = c.charCodeAt(0);
  1496. 33 > h && (h = (c = c.trim()).charCodeAt(0));
  1497. switch (h) {
  1498. case 38:
  1499. return c.replace(F, '$1' + d.trim());
  1500. case 58:
  1501. return d.trim() + c.replace(F, '$1' + d.trim());
  1502. default:
  1503. if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
  1504. }
  1505. return d + c;
  1506. }
  1507. function P(d, c, e, h) {
  1508. var a = d + ';',
  1509. m = 2 * c + 3 * e + 4 * h;
  1510. if (944 === m) {
  1511. d = a.indexOf(':', 9) + 1;
  1512. var b = a.substring(d, a.length - 1).trim();
  1513. b = a.substring(0, d).trim() + b + ';';
  1514. return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
  1515. }
  1516. if (0 === w || 2 === w && !L(a, 1)) return a;
  1517. switch (m) {
  1518. case 1015:
  1519. return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;
  1520. case 951:
  1521. return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;
  1522. case 963:
  1523. return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;
  1524. case 1009:
  1525. if (100 !== a.charCodeAt(4)) break;
  1526. case 969:
  1527. case 942:
  1528. return '-webkit-' + a + a;
  1529. case 978:
  1530. return '-webkit-' + a + '-moz-' + a + a;
  1531. case 1019:
  1532. case 983:
  1533. return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;
  1534. case 883:
  1535. if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
  1536. if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
  1537. break;
  1538. case 932:
  1539. if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
  1540. case 103:
  1541. return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;
  1542. case 115:
  1543. return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;
  1544. case 98:
  1545. return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
  1546. }
  1547. return '-webkit-' + a + '-ms-' + a + a;
  1548. case 964:
  1549. return '-webkit-' + a + '-ms-flex-' + a + a;
  1550. case 1023:
  1551. if (99 !== a.charCodeAt(8)) break;
  1552. b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
  1553. return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;
  1554. case 1005:
  1555. return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;
  1556. case 1e3:
  1557. b = a.substring(13).trim();
  1558. c = b.indexOf('-') + 1;
  1559. switch (b.charCodeAt(0) + b.charCodeAt(c)) {
  1560. case 226:
  1561. b = a.replace(G, 'tb');
  1562. break;
  1563. case 232:
  1564. b = a.replace(G, 'tb-rl');
  1565. break;
  1566. case 220:
  1567. b = a.replace(G, 'lr');
  1568. break;
  1569. default:
  1570. return a;
  1571. }
  1572. return '-webkit-' + a + '-ms-' + b + a;
  1573. case 1017:
  1574. if (-1 === a.indexOf('sticky', 9)) break;
  1575. case 975:
  1576. c = (a = d).length - 10;
  1577. b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();
  1578. switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
  1579. case 203:
  1580. if (111 > b.charCodeAt(8)) break;
  1581. case 115:
  1582. a = a.replace(b, '-webkit-' + b) + ';' + a;
  1583. break;
  1584. case 207:
  1585. case 102:
  1586. a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
  1587. }
  1588. return a + ';';
  1589. case 938:
  1590. if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
  1591. case 105:
  1592. return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;
  1593. case 115:
  1594. return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;
  1595. default:
  1596. return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
  1597. }
  1598. break;
  1599. case 973:
  1600. case 989:
  1601. if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
  1602. case 931:
  1603. case 953:
  1604. if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
  1605. break;
  1606. case 962:
  1607. if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
  1608. }
  1609. return a;
  1610. }
  1611. function L(d, c) {
  1612. var e = d.indexOf(1 === c ? ':' : '{'),
  1613. h = d.substring(0, 3 !== c ? e : 10);
  1614. e = d.substring(e + 1, d.length - 1);
  1615. return R(2 !== c ? h : h.replace(na, '$1'), e, c);
  1616. }
  1617. function ea(d, c) {
  1618. var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
  1619. return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
  1620. }
  1621. function H(d, c, e, h, a, m, b, v, n, q) {
  1622. for (var g = 0, x = c, w; g < A; ++g) {
  1623. switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
  1624. case void 0:
  1625. case !1:
  1626. case !0:
  1627. case null:
  1628. break;
  1629. default:
  1630. x = w;
  1631. }
  1632. }
  1633. if (x !== c) return x;
  1634. }
  1635. function T(d) {
  1636. switch (d) {
  1637. case void 0:
  1638. case null:
  1639. A = S.length = 0;
  1640. break;
  1641. default:
  1642. if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
  1643. T(d[c]);
  1644. } else Y = !!d | 0;
  1645. }
  1646. return T;
  1647. }
  1648. function U(d) {
  1649. d = d.prefix;
  1650. void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
  1651. return U;
  1652. }
  1653. function B(d, c) {
  1654. var e = d;
  1655. 33 > e.charCodeAt(0) && (e = e.trim());
  1656. V = e;
  1657. e = [V];
  1658. if (0 < A) {
  1659. var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
  1660. void 0 !== h && 'string' === typeof h && (c = h);
  1661. }
  1662. var a = M(O, e, c, 0, 0);
  1663. 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
  1664. V = '';
  1665. E = 0;
  1666. z = D = 1;
  1667. return a;
  1668. }
  1669. var ca = /^\0+/g,
  1670. N = /[\0\r\f]/g,
  1671. aa = /: */g,
  1672. ka = /zoo|gra/,
  1673. ma = /([,: ])(transform)/g,
  1674. ia = /,\r+?/g,
  1675. F = /([\t\r\n ])*\f?&/g,
  1676. fa = /@(k\w+)\s*(\S*)\s*/,
  1677. Q = /::(place)/g,
  1678. ha = /:(read-only)/g,
  1679. G = /[svh]\w+-[tblr]{2}/,
  1680. da = /\(\s*(.*)\s*\)/g,
  1681. oa = /([\s\S]*?);/g,
  1682. ba = /-self|flex-/g,
  1683. na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
  1684. la = /stretch|:\s*\w+\-(?:conte|avail)/,
  1685. ja = /([^-])(image-set\()/,
  1686. z = 1,
  1687. D = 1,
  1688. E = 0,
  1689. w = 1,
  1690. O = [],
  1691. S = [],
  1692. A = 0,
  1693. R = null,
  1694. Y = 0,
  1695. V = '';
  1696. B.use = T;
  1697. B.set = U;
  1698. void 0 !== W && U(W);
  1699. return B;
  1700. }
  1701. /* harmony default export */ __webpack_exports__["default"] = (stylis_min);
  1702. /***/ }),
  1703. /***/ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js":
  1704. /*!*********************************************************************!*\
  1705. !*** ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js ***!
  1706. \*********************************************************************/
  1707. /*! exports provided: default */
  1708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1709. "use strict";
  1710. __webpack_require__.r(__webpack_exports__);
  1711. var unitlessKeys = {
  1712. animationIterationCount: 1,
  1713. borderImageOutset: 1,
  1714. borderImageSlice: 1,
  1715. borderImageWidth: 1,
  1716. boxFlex: 1,
  1717. boxFlexGroup: 1,
  1718. boxOrdinalGroup: 1,
  1719. columnCount: 1,
  1720. columns: 1,
  1721. flex: 1,
  1722. flexGrow: 1,
  1723. flexPositive: 1,
  1724. flexShrink: 1,
  1725. flexNegative: 1,
  1726. flexOrder: 1,
  1727. gridRow: 1,
  1728. gridRowEnd: 1,
  1729. gridRowSpan: 1,
  1730. gridRowStart: 1,
  1731. gridColumn: 1,
  1732. gridColumnEnd: 1,
  1733. gridColumnSpan: 1,
  1734. gridColumnStart: 1,
  1735. msGridRow: 1,
  1736. msGridRowSpan: 1,
  1737. msGridColumn: 1,
  1738. msGridColumnSpan: 1,
  1739. fontWeight: 1,
  1740. lineHeight: 1,
  1741. opacity: 1,
  1742. order: 1,
  1743. orphans: 1,
  1744. tabSize: 1,
  1745. widows: 1,
  1746. zIndex: 1,
  1747. zoom: 1,
  1748. WebkitLineClamp: 1,
  1749. // SVG-related properties
  1750. fillOpacity: 1,
  1751. floodOpacity: 1,
  1752. stopOpacity: 1,
  1753. strokeDasharray: 1,
  1754. strokeDashoffset: 1,
  1755. strokeMiterlimit: 1,
  1756. strokeOpacity: 1,
  1757. strokeWidth: 1
  1758. };
  1759. /* harmony default export */ __webpack_exports__["default"] = (unitlessKeys);
  1760. /***/ }),
  1761. /***/ "./node_modules/@emotion/utils/dist/utils.browser.esm.js":
  1762. /*!***************************************************************!*\
  1763. !*** ./node_modules/@emotion/utils/dist/utils.browser.esm.js ***!
  1764. \***************************************************************/
  1765. /*! exports provided: getRegisteredStyles, insertStyles */
  1766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1767. "use strict";
  1768. __webpack_require__.r(__webpack_exports__);
  1769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredStyles", function() { return getRegisteredStyles; });
  1770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertStyles", function() { return insertStyles; });
  1771. var isBrowser = "object" !== 'undefined';
  1772. function getRegisteredStyles(registered, registeredStyles, classNames) {
  1773. var rawClassName = '';
  1774. classNames.split(' ').forEach(function (className) {
  1775. if (registered[className] !== undefined) {
  1776. registeredStyles.push(registered[className]);
  1777. } else {
  1778. rawClassName += className + " ";
  1779. }
  1780. });
  1781. return rawClassName;
  1782. }
  1783. var insertStyles = function insertStyles(cache, serialized, isStringTag) {
  1784. var className = cache.key + "-" + serialized.name;
  1785. if ( // we only need to add the styles to the registered cache if the
  1786. // class name could be used further down
  1787. // the tree but if it's a string tag, we know it won't
  1788. // so we don't have to add it to registered cache.
  1789. // this improves memory usage since we can avoid storing the whole style string
  1790. (isStringTag === false || // we need to always store it if we're in compat mode and
  1791. // in node since emotion-server relies on whether a style is in
  1792. // the registered cache to know whether a style is global or not
  1793. // also, note that this check will be dead code eliminated in the browser
  1794. isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
  1795. cache.registered[className] = serialized.styles;
  1796. }
  1797. if (cache.inserted[serialized.name] === undefined) {
  1798. var current = serialized;
  1799. do {
  1800. var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
  1801. current = current.next;
  1802. } while (current !== undefined);
  1803. }
  1804. };
  1805. /***/ }),
  1806. /***/ "./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js":
  1807. /*!*****************************************************************************!*\
  1808. !*** ./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js ***!
  1809. \*****************************************************************************/
  1810. /*! exports provided: default */
  1811. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1812. "use strict";
  1813. __webpack_require__.r(__webpack_exports__);
  1814. var weakMemoize = function weakMemoize(func) {
  1815. // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
  1816. var cache = new WeakMap();
  1817. return function (arg) {
  1818. if (cache.has(arg)) {
  1819. // $FlowFixMe
  1820. return cache.get(arg);
  1821. }
  1822. var ret = func(arg);
  1823. cache.set(arg, ret);
  1824. return ret;
  1825. };
  1826. };
  1827. /* harmony default export */ __webpack_exports__["default"] = (weakMemoize);
  1828. /***/ }),
  1829. /***/ "./node_modules/@restart/context/forwardRef.js":
  1830. /*!*****************************************************!*\
  1831. !*** ./node_modules/@restart/context/forwardRef.js ***!
  1832. \*****************************************************/
  1833. /*! no static exports found */
  1834. /***/ (function(module, exports, __webpack_require__) {
  1835. "use strict";
  1836. exports.__esModule = true;
  1837. exports.default = forwardRef;
  1838. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  1839. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1840. function forwardRef(renderFn, _temp) {
  1841. var _ref = _temp === void 0 ? {} : _temp,
  1842. propTypes = _ref.propTypes,
  1843. defaultProps = _ref.defaultProps,
  1844. _ref$allowFallback = _ref.allowFallback,
  1845. allowFallback = _ref$allowFallback === void 0 ? false : _ref$allowFallback,
  1846. _ref$displayName = _ref.displayName,
  1847. displayName = _ref$displayName === void 0 ? renderFn.name || renderFn.displayName : _ref$displayName;
  1848. var render = function render(props, ref) {
  1849. return renderFn(props, ref);
  1850. };
  1851. return Object.assign(_react.default.forwardRef || !allowFallback ? _react.default.forwardRef(render) : function (props) {
  1852. return render(props, null);
  1853. }, {
  1854. displayName: displayName,
  1855. propTypes: propTypes,
  1856. defaultProps: defaultProps
  1857. });
  1858. }
  1859. /***/ }),
  1860. /***/ "./node_modules/@restart/hooks/esm/useCommittedRef.js":
  1861. /*!************************************************************!*\
  1862. !*** ./node_modules/@restart/hooks/esm/useCommittedRef.js ***!
  1863. \************************************************************/
  1864. /*! exports provided: default */
  1865. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1866. "use strict";
  1867. __webpack_require__.r(__webpack_exports__);
  1868. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  1869. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  1870. /**
  1871. * Creates a `Ref` whose value is updated in an effect, ensuring the most recent
  1872. * value is the one rendered with. Generally only required for Concurrent mode usage
  1873. * where previous work in `render()` may be discarded befor being used.
  1874. *
  1875. * This is safe to access in an event handler.
  1876. *
  1877. * @param value The `Ref` value
  1878. */
  1879. function useCommittedRef(value) {
  1880. var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value);
  1881. Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
  1882. ref.current = value;
  1883. }, [value]);
  1884. return ref;
  1885. }
  1886. /* harmony default export */ __webpack_exports__["default"] = (useCommittedRef);
  1887. /***/ }),
  1888. /***/ "./node_modules/@restart/hooks/esm/useEventCallback.js":
  1889. /*!*************************************************************!*\
  1890. !*** ./node_modules/@restart/hooks/esm/useEventCallback.js ***!
  1891. \*************************************************************/
  1892. /*! exports provided: default */
  1893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1894. "use strict";
  1895. __webpack_require__.r(__webpack_exports__);
  1896. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useEventCallback; });
  1897. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  1898. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  1899. /* harmony import */ var _useCommittedRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useCommittedRef */ "./node_modules/@restart/hooks/esm/useCommittedRef.js");
  1900. function useEventCallback(fn) {
  1901. var ref = Object(_useCommittedRef__WEBPACK_IMPORTED_MODULE_1__["default"])(fn);
  1902. return Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(function () {
  1903. return ref.current && ref.current.apply(ref, arguments);
  1904. }, [ref]);
  1905. }
  1906. /***/ }),
  1907. /***/ "./node_modules/@restart/hooks/esm/useForceUpdate.js":
  1908. /*!***********************************************************!*\
  1909. !*** ./node_modules/@restart/hooks/esm/useForceUpdate.js ***!
  1910. \***********************************************************/
  1911. /*! exports provided: default */
  1912. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1913. "use strict";
  1914. __webpack_require__.r(__webpack_exports__);
  1915. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useForceUpdate; });
  1916. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  1917. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  1918. /**
  1919. * Returns a function that triggers a component update. the hook equivalent to
  1920. * `this.forceUpdate()` in a class component. In most cases using a state value directly
  1921. * is preferable but may be required in some advanced usages of refs for interop or
  1922. * when direct DOM manipulation is required.
  1923. *
  1924. * ```ts
  1925. * const forceUpdate = useForceUpdate();
  1926. *
  1927. * const updateOnClick = useCallback(() => {
  1928. * forceUpdate()
  1929. * }, [forceUpdate])
  1930. *
  1931. * return <button type="button" onClick={updateOnClick}>Hi there</button>
  1932. * ```
  1933. */
  1934. function useForceUpdate() {
  1935. // The toggling state value is designed to defeat React optimizations for skipping
  1936. var _useReducer = Object(react__WEBPACK_IMPORTED_MODULE_0__["useReducer"])(function (state) {
  1937. return !state;
  1938. }, false),
  1939. dispatch = _useReducer[1];
  1940. return dispatch;
  1941. }
  1942. /***/ }),
  1943. /***/ "./node_modules/@restart/hooks/esm/useMergedRefs.js":
  1944. /*!**********************************************************!*\
  1945. !*** ./node_modules/@restart/hooks/esm/useMergedRefs.js ***!
  1946. \**********************************************************/
  1947. /*! exports provided: mergeRefs, default */
  1948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1949. "use strict";
  1950. __webpack_require__.r(__webpack_exports__);
  1951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeRefs", function() { return mergeRefs; });
  1952. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  1953. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  1954. var toFnRef = function toFnRef(ref) {
  1955. return !ref || typeof ref === 'function' ? ref : function (value) {
  1956. ref.current = value;
  1957. };
  1958. };
  1959. function mergeRefs(refA, refB) {
  1960. var a = toFnRef(refA);
  1961. var b = toFnRef(refB);
  1962. return function (value) {
  1963. if (a) a(value);
  1964. if (b) b(value);
  1965. };
  1966. }
  1967. /**
  1968. * Create and returns a single callback ref composed from two other Refs.
  1969. *
  1970. * ```tsx
  1971. * const Button = React.forwardRef((props, ref) => {
  1972. * const [element, attachRef] = useCallbackRef<HTMLButtonElement>();
  1973. * const mergedRef = useMergedRefs(ref, attachRef);
  1974. *
  1975. * return <button ref={mergedRef} {...props}/>
  1976. * })
  1977. * ```
  1978. *
  1979. * @param refA A Callback or mutable Ref
  1980. * @param refB A Callback or mutable Ref
  1981. */
  1982. function useMergedRefs(refA, refB) {
  1983. return Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
  1984. return mergeRefs(refA, refB);
  1985. }, [refA, refB]);
  1986. }
  1987. /* harmony default export */ __webpack_exports__["default"] = (useMergedRefs);
  1988. /***/ }),
  1989. /***/ "./node_modules/@restart/hooks/esm/useMounted.js":
  1990. /*!*******************************************************!*\
  1991. !*** ./node_modules/@restart/hooks/esm/useMounted.js ***!
  1992. \*******************************************************/
  1993. /*! exports provided: default */
  1994. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1995. "use strict";
  1996. __webpack_require__.r(__webpack_exports__);
  1997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useMounted; });
  1998. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  1999. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  2000. /**
  2001. * Track whether a component is current mounted. Generally less preferable than
  2002. * properlly canceling effects so they don't run after a component is unmounted,
  2003. * but helpful in cases where that isn't feasible, such as a `Promise` resolution.
  2004. *
  2005. * @returns a function that returns the current isMounted state of the component
  2006. *
  2007. * ```ts
  2008. * const [data, setData] = useState(null)
  2009. * const isMounted = useMounted()
  2010. *
  2011. * useEffect(() => {
  2012. * fetchdata().then((newData) => {
  2013. * if (isMounted()) {
  2014. * setData(newData);
  2015. * }
  2016. * })
  2017. * })
  2018. * ```
  2019. */
  2020. function useMounted() {
  2021. var mounted = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(true);
  2022. var isMounted = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(function () {
  2023. return mounted.current;
  2024. });
  2025. Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
  2026. return function () {
  2027. mounted.current = false;
  2028. };
  2029. }, []);
  2030. return isMounted.current;
  2031. }
  2032. /***/ }),
  2033. /***/ "./node_modules/@restart/hooks/esm/useTimeout.js":
  2034. /*!*******************************************************!*\
  2035. !*** ./node_modules/@restart/hooks/esm/useTimeout.js ***!
  2036. \*******************************************************/
  2037. /*! exports provided: default */
  2038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2039. "use strict";
  2040. __webpack_require__.r(__webpack_exports__);
  2041. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useTimeout; });
  2042. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  2043. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  2044. /* harmony import */ var _useWillUnmount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useWillUnmount */ "./node_modules/@restart/hooks/esm/useWillUnmount.js");
  2045. /* harmony import */ var _useMounted__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useMounted */ "./node_modules/@restart/hooks/esm/useMounted.js");
  2046. /**
  2047. * Returns a controller object for setting a timeout that is properly cleaned up
  2048. * once the component unmounts. New timeouts cancel and replace existing ones.
  2049. */
  2050. function useTimeout() {
  2051. var isMounted = Object(_useMounted__WEBPACK_IMPORTED_MODULE_2__["default"])();
  2052. var handle = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])();
  2053. var clear = function clear() {
  2054. return clearTimeout(handle.current);
  2055. };
  2056. Object(_useWillUnmount__WEBPACK_IMPORTED_MODULE_1__["default"])(clear);
  2057. return {
  2058. set: function set(fn, ms) {
  2059. if (!isMounted()) return;
  2060. clear();
  2061. handle.current = setTimeout(fn, ms);
  2062. },
  2063. clear: clear
  2064. };
  2065. }
  2066. /***/ }),
  2067. /***/ "./node_modules/@restart/hooks/esm/useUpdatedRef.js":
  2068. /*!**********************************************************!*\
  2069. !*** ./node_modules/@restart/hooks/esm/useUpdatedRef.js ***!
  2070. \**********************************************************/
  2071. /*! exports provided: default */
  2072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2073. "use strict";
  2074. __webpack_require__.r(__webpack_exports__);
  2075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useUpdatedRef; });
  2076. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  2077. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  2078. /**
  2079. * Returns a ref that is immediately updated with the new value
  2080. *
  2081. * @param value The Ref value
  2082. */
  2083. function useUpdatedRef(value) {
  2084. var valueRef = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value);
  2085. valueRef.current = value;
  2086. return valueRef;
  2087. }
  2088. /***/ }),
  2089. /***/ "./node_modules/@restart/hooks/esm/useWillUnmount.js":
  2090. /*!***********************************************************!*\
  2091. !*** ./node_modules/@restart/hooks/esm/useWillUnmount.js ***!
  2092. \***********************************************************/
  2093. /*! exports provided: default */
  2094. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2095. "use strict";
  2096. __webpack_require__.r(__webpack_exports__);
  2097. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useWillUnmount; });
  2098. /* harmony import */ var _useUpdatedRef__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useUpdatedRef */ "./node_modules/@restart/hooks/esm/useUpdatedRef.js");
  2099. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  2100. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  2101. /**
  2102. * Attach a callback that fires when a component unmounts
  2103. *
  2104. * @param fn Handler to run when the component unmounts
  2105. */
  2106. function useWillUnmount(fn) {
  2107. var onUnmount = Object(_useUpdatedRef__WEBPACK_IMPORTED_MODULE_0__["default"])(fn);
  2108. Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
  2109. return function () {
  2110. return onUnmount.current();
  2111. };
  2112. }, []);
  2113. }
  2114. /***/ }),
  2115. /***/ "./node_modules/axios/index.js":
  2116. /*!*************************************!*\
  2117. !*** ./node_modules/axios/index.js ***!
  2118. \*************************************/
  2119. /*! no static exports found */
  2120. /***/ (function(module, exports, __webpack_require__) {
  2121. module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
  2122. /***/ }),
  2123. /***/ "./node_modules/axios/lib/adapters/xhr.js":
  2124. /*!************************************************!*\
  2125. !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  2126. \************************************************/
  2127. /*! no static exports found */
  2128. /***/ (function(module, exports, __webpack_require__) {
  2129. "use strict";
  2130. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2131. var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
  2132. var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  2133. var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
  2134. var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
  2135. var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
  2136. module.exports = function xhrAdapter(config) {
  2137. return new Promise(function dispatchXhrRequest(resolve, reject) {
  2138. var requestData = config.data;
  2139. var requestHeaders = config.headers;
  2140. if (utils.isFormData(requestData)) {
  2141. delete requestHeaders['Content-Type']; // Let the browser set it
  2142. }
  2143. var request = new XMLHttpRequest();
  2144. // HTTP basic authentication
  2145. if (config.auth) {
  2146. var username = config.auth.username || '';
  2147. var password = config.auth.password || '';
  2148. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  2149. }
  2150. request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
  2151. // Set the request timeout in MS
  2152. request.timeout = config.timeout;
  2153. // Listen for ready state
  2154. request.onreadystatechange = function handleLoad() {
  2155. if (!request || request.readyState !== 4) {
  2156. return;
  2157. }
  2158. // The request errored out and we didn't get a response, this will be
  2159. // handled by onerror instead
  2160. // With one exception: request that using file: protocol, most browsers
  2161. // will return status as 0 even though it's a successful request
  2162. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  2163. return;
  2164. }
  2165. // Prepare the response
  2166. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  2167. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  2168. var response = {
  2169. data: responseData,
  2170. status: request.status,
  2171. statusText: request.statusText,
  2172. headers: responseHeaders,
  2173. config: config,
  2174. request: request
  2175. };
  2176. settle(resolve, reject, response);
  2177. // Clean up request
  2178. request = null;
  2179. };
  2180. // Handle low level network errors
  2181. request.onerror = function handleError() {
  2182. // Real errors are hidden from us by the browser
  2183. // onerror should only fire if it's a network error
  2184. reject(createError('Network Error', config, null, request));
  2185. // Clean up request
  2186. request = null;
  2187. };
  2188. // Handle timeout
  2189. request.ontimeout = function handleTimeout() {
  2190. reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
  2191. request));
  2192. // Clean up request
  2193. request = null;
  2194. };
  2195. // Add xsrf header
  2196. // This is only done if running in a standard browser environment.
  2197. // Specifically not if we're in a web worker, or react-native.
  2198. if (utils.isStandardBrowserEnv()) {
  2199. var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
  2200. // Add xsrf header
  2201. var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
  2202. cookies.read(config.xsrfCookieName) :
  2203. undefined;
  2204. if (xsrfValue) {
  2205. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  2206. }
  2207. }
  2208. // Add headers to the request
  2209. if ('setRequestHeader' in request) {
  2210. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  2211. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  2212. // Remove Content-Type if data is undefined
  2213. delete requestHeaders[key];
  2214. } else {
  2215. // Otherwise add header to the request
  2216. request.setRequestHeader(key, val);
  2217. }
  2218. });
  2219. }
  2220. // Add withCredentials to request if needed
  2221. if (config.withCredentials) {
  2222. request.withCredentials = true;
  2223. }
  2224. // Add responseType to request if needed
  2225. if (config.responseType) {
  2226. try {
  2227. request.responseType = config.responseType;
  2228. } catch (e) {
  2229. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  2230. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  2231. if (config.responseType !== 'json') {
  2232. throw e;
  2233. }
  2234. }
  2235. }
  2236. // Handle progress if needed
  2237. if (typeof config.onDownloadProgress === 'function') {
  2238. request.addEventListener('progress', config.onDownloadProgress);
  2239. }
  2240. // Not all browsers support upload events
  2241. if (typeof config.onUploadProgress === 'function' && request.upload) {
  2242. request.upload.addEventListener('progress', config.onUploadProgress);
  2243. }
  2244. if (config.cancelToken) {
  2245. // Handle cancellation
  2246. config.cancelToken.promise.then(function onCanceled(cancel) {
  2247. if (!request) {
  2248. return;
  2249. }
  2250. request.abort();
  2251. reject(cancel);
  2252. // Clean up request
  2253. request = null;
  2254. });
  2255. }
  2256. if (requestData === undefined) {
  2257. requestData = null;
  2258. }
  2259. // Send the request
  2260. request.send(requestData);
  2261. });
  2262. };
  2263. /***/ }),
  2264. /***/ "./node_modules/axios/lib/axios.js":
  2265. /*!*****************************************!*\
  2266. !*** ./node_modules/axios/lib/axios.js ***!
  2267. \*****************************************/
  2268. /*! no static exports found */
  2269. /***/ (function(module, exports, __webpack_require__) {
  2270. "use strict";
  2271. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  2272. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  2273. var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
  2274. var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
  2275. /**
  2276. * Create an instance of Axios
  2277. *
  2278. * @param {Object} defaultConfig The default config for the instance
  2279. * @return {Axios} A new instance of Axios
  2280. */
  2281. function createInstance(defaultConfig) {
  2282. var context = new Axios(defaultConfig);
  2283. var instance = bind(Axios.prototype.request, context);
  2284. // Copy axios.prototype to instance
  2285. utils.extend(instance, Axios.prototype, context);
  2286. // Copy context to instance
  2287. utils.extend(instance, context);
  2288. return instance;
  2289. }
  2290. // Create the default instance to be exported
  2291. var axios = createInstance(defaults);
  2292. // Expose Axios class to allow class inheritance
  2293. axios.Axios = Axios;
  2294. // Factory for creating new instances
  2295. axios.create = function create(instanceConfig) {
  2296. return createInstance(utils.merge(defaults, instanceConfig));
  2297. };
  2298. // Expose Cancel & CancelToken
  2299. axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  2300. axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
  2301. axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  2302. // Expose all/spread
  2303. axios.all = function all(promises) {
  2304. return Promise.all(promises);
  2305. };
  2306. axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
  2307. module.exports = axios;
  2308. // Allow use of default import syntax in TypeScript
  2309. module.exports.default = axios;
  2310. /***/ }),
  2311. /***/ "./node_modules/axios/lib/cancel/Cancel.js":
  2312. /*!*************************************************!*\
  2313. !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
  2314. \*************************************************/
  2315. /*! no static exports found */
  2316. /***/ (function(module, exports, __webpack_require__) {
  2317. "use strict";
  2318. /**
  2319. * A `Cancel` is an object that is thrown when an operation is canceled.
  2320. *
  2321. * @class
  2322. * @param {string=} message The message.
  2323. */
  2324. function Cancel(message) {
  2325. this.message = message;
  2326. }
  2327. Cancel.prototype.toString = function toString() {
  2328. return 'Cancel' + (this.message ? ': ' + this.message : '');
  2329. };
  2330. Cancel.prototype.__CANCEL__ = true;
  2331. module.exports = Cancel;
  2332. /***/ }),
  2333. /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
  2334. /*!******************************************************!*\
  2335. !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  2336. \******************************************************/
  2337. /*! no static exports found */
  2338. /***/ (function(module, exports, __webpack_require__) {
  2339. "use strict";
  2340. var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  2341. /**
  2342. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  2343. *
  2344. * @class
  2345. * @param {Function} executor The executor function.
  2346. */
  2347. function CancelToken(executor) {
  2348. if (typeof executor !== 'function') {
  2349. throw new TypeError('executor must be a function.');
  2350. }
  2351. var resolvePromise;
  2352. this.promise = new Promise(function promiseExecutor(resolve) {
  2353. resolvePromise = resolve;
  2354. });
  2355. var token = this;
  2356. executor(function cancel(message) {
  2357. if (token.reason) {
  2358. // Cancellation has already been requested
  2359. return;
  2360. }
  2361. token.reason = new Cancel(message);
  2362. resolvePromise(token.reason);
  2363. });
  2364. }
  2365. /**
  2366. * Throws a `Cancel` if cancellation has been requested.
  2367. */
  2368. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  2369. if (this.reason) {
  2370. throw this.reason;
  2371. }
  2372. };
  2373. /**
  2374. * Returns an object that contains a new `CancelToken` and a function that, when called,
  2375. * cancels the `CancelToken`.
  2376. */
  2377. CancelToken.source = function source() {
  2378. var cancel;
  2379. var token = new CancelToken(function executor(c) {
  2380. cancel = c;
  2381. });
  2382. return {
  2383. token: token,
  2384. cancel: cancel
  2385. };
  2386. };
  2387. module.exports = CancelToken;
  2388. /***/ }),
  2389. /***/ "./node_modules/axios/lib/cancel/isCancel.js":
  2390. /*!***************************************************!*\
  2391. !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  2392. \***************************************************/
  2393. /*! no static exports found */
  2394. /***/ (function(module, exports, __webpack_require__) {
  2395. "use strict";
  2396. module.exports = function isCancel(value) {
  2397. return !!(value && value.__CANCEL__);
  2398. };
  2399. /***/ }),
  2400. /***/ "./node_modules/axios/lib/core/Axios.js":
  2401. /*!**********************************************!*\
  2402. !*** ./node_modules/axios/lib/core/Axios.js ***!
  2403. \**********************************************/
  2404. /*! no static exports found */
  2405. /***/ (function(module, exports, __webpack_require__) {
  2406. "use strict";
  2407. var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js");
  2408. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2409. var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
  2410. var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
  2411. /**
  2412. * Create a new instance of Axios
  2413. *
  2414. * @param {Object} instanceConfig The default config for the instance
  2415. */
  2416. function Axios(instanceConfig) {
  2417. this.defaults = instanceConfig;
  2418. this.interceptors = {
  2419. request: new InterceptorManager(),
  2420. response: new InterceptorManager()
  2421. };
  2422. }
  2423. /**
  2424. * Dispatch a request
  2425. *
  2426. * @param {Object} config The config specific for this request (merged with this.defaults)
  2427. */
  2428. Axios.prototype.request = function request(config) {
  2429. /*eslint no-param-reassign:0*/
  2430. // Allow for axios('example/url'[, config]) a la fetch API
  2431. if (typeof config === 'string') {
  2432. config = utils.merge({
  2433. url: arguments[0]
  2434. }, arguments[1]);
  2435. }
  2436. config = utils.merge(defaults, {method: 'get'}, this.defaults, config);
  2437. config.method = config.method.toLowerCase();
  2438. // Hook up interceptors middleware
  2439. var chain = [dispatchRequest, undefined];
  2440. var promise = Promise.resolve(config);
  2441. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  2442. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  2443. });
  2444. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  2445. chain.push(interceptor.fulfilled, interceptor.rejected);
  2446. });
  2447. while (chain.length) {
  2448. promise = promise.then(chain.shift(), chain.shift());
  2449. }
  2450. return promise;
  2451. };
  2452. // Provide aliases for supported request methods
  2453. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  2454. /*eslint func-names:0*/
  2455. Axios.prototype[method] = function(url, config) {
  2456. return this.request(utils.merge(config || {}, {
  2457. method: method,
  2458. url: url
  2459. }));
  2460. };
  2461. });
  2462. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  2463. /*eslint func-names:0*/
  2464. Axios.prototype[method] = function(url, data, config) {
  2465. return this.request(utils.merge(config || {}, {
  2466. method: method,
  2467. url: url,
  2468. data: data
  2469. }));
  2470. };
  2471. });
  2472. module.exports = Axios;
  2473. /***/ }),
  2474. /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
  2475. /*!***********************************************************!*\
  2476. !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  2477. \***********************************************************/
  2478. /*! no static exports found */
  2479. /***/ (function(module, exports, __webpack_require__) {
  2480. "use strict";
  2481. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2482. function InterceptorManager() {
  2483. this.handlers = [];
  2484. }
  2485. /**
  2486. * Add a new interceptor to the stack
  2487. *
  2488. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  2489. * @param {Function} rejected The function to handle `reject` for a `Promise`
  2490. *
  2491. * @return {Number} An ID used to remove interceptor later
  2492. */
  2493. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  2494. this.handlers.push({
  2495. fulfilled: fulfilled,
  2496. rejected: rejected
  2497. });
  2498. return this.handlers.length - 1;
  2499. };
  2500. /**
  2501. * Remove an interceptor from the stack
  2502. *
  2503. * @param {Number} id The ID that was returned by `use`
  2504. */
  2505. InterceptorManager.prototype.eject = function eject(id) {
  2506. if (this.handlers[id]) {
  2507. this.handlers[id] = null;
  2508. }
  2509. };
  2510. /**
  2511. * Iterate over all the registered interceptors
  2512. *
  2513. * This method is particularly useful for skipping over any
  2514. * interceptors that may have become `null` calling `eject`.
  2515. *
  2516. * @param {Function} fn The function to call for each interceptor
  2517. */
  2518. InterceptorManager.prototype.forEach = function forEach(fn) {
  2519. utils.forEach(this.handlers, function forEachHandler(h) {
  2520. if (h !== null) {
  2521. fn(h);
  2522. }
  2523. });
  2524. };
  2525. module.exports = InterceptorManager;
  2526. /***/ }),
  2527. /***/ "./node_modules/axios/lib/core/createError.js":
  2528. /*!****************************************************!*\
  2529. !*** ./node_modules/axios/lib/core/createError.js ***!
  2530. \****************************************************/
  2531. /*! no static exports found */
  2532. /***/ (function(module, exports, __webpack_require__) {
  2533. "use strict";
  2534. var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
  2535. /**
  2536. * Create an Error with the specified message, config, error code, request and response.
  2537. *
  2538. * @param {string} message The error message.
  2539. * @param {Object} config The config.
  2540. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  2541. * @param {Object} [request] The request.
  2542. * @param {Object} [response] The response.
  2543. * @returns {Error} The created error.
  2544. */
  2545. module.exports = function createError(message, config, code, request, response) {
  2546. var error = new Error(message);
  2547. return enhanceError(error, config, code, request, response);
  2548. };
  2549. /***/ }),
  2550. /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
  2551. /*!********************************************************!*\
  2552. !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  2553. \********************************************************/
  2554. /*! no static exports found */
  2555. /***/ (function(module, exports, __webpack_require__) {
  2556. "use strict";
  2557. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2558. var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
  2559. var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  2560. var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
  2561. var isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
  2562. var combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
  2563. /**
  2564. * Throws a `Cancel` if cancellation has been requested.
  2565. */
  2566. function throwIfCancellationRequested(config) {
  2567. if (config.cancelToken) {
  2568. config.cancelToken.throwIfRequested();
  2569. }
  2570. }
  2571. /**
  2572. * Dispatch a request to the server using the configured adapter.
  2573. *
  2574. * @param {object} config The config that is to be used for the request
  2575. * @returns {Promise} The Promise to be fulfilled
  2576. */
  2577. module.exports = function dispatchRequest(config) {
  2578. throwIfCancellationRequested(config);
  2579. // Support baseURL config
  2580. if (config.baseURL && !isAbsoluteURL(config.url)) {
  2581. config.url = combineURLs(config.baseURL, config.url);
  2582. }
  2583. // Ensure headers exist
  2584. config.headers = config.headers || {};
  2585. // Transform request data
  2586. config.data = transformData(
  2587. config.data,
  2588. config.headers,
  2589. config.transformRequest
  2590. );
  2591. // Flatten headers
  2592. config.headers = utils.merge(
  2593. config.headers.common || {},
  2594. config.headers[config.method] || {},
  2595. config.headers || {}
  2596. );
  2597. utils.forEach(
  2598. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  2599. function cleanHeaderConfig(method) {
  2600. delete config.headers[method];
  2601. }
  2602. );
  2603. var adapter = config.adapter || defaults.adapter;
  2604. return adapter(config).then(function onAdapterResolution(response) {
  2605. throwIfCancellationRequested(config);
  2606. // Transform response data
  2607. response.data = transformData(
  2608. response.data,
  2609. response.headers,
  2610. config.transformResponse
  2611. );
  2612. return response;
  2613. }, function onAdapterRejection(reason) {
  2614. if (!isCancel(reason)) {
  2615. throwIfCancellationRequested(config);
  2616. // Transform response data
  2617. if (reason && reason.response) {
  2618. reason.response.data = transformData(
  2619. reason.response.data,
  2620. reason.response.headers,
  2621. config.transformResponse
  2622. );
  2623. }
  2624. }
  2625. return Promise.reject(reason);
  2626. });
  2627. };
  2628. /***/ }),
  2629. /***/ "./node_modules/axios/lib/core/enhanceError.js":
  2630. /*!*****************************************************!*\
  2631. !*** ./node_modules/axios/lib/core/enhanceError.js ***!
  2632. \*****************************************************/
  2633. /*! no static exports found */
  2634. /***/ (function(module, exports, __webpack_require__) {
  2635. "use strict";
  2636. /**
  2637. * Update an Error with the specified config, error code, and response.
  2638. *
  2639. * @param {Error} error The error to update.
  2640. * @param {Object} config The config.
  2641. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  2642. * @param {Object} [request] The request.
  2643. * @param {Object} [response] The response.
  2644. * @returns {Error} The error.
  2645. */
  2646. module.exports = function enhanceError(error, config, code, request, response) {
  2647. error.config = config;
  2648. if (code) {
  2649. error.code = code;
  2650. }
  2651. error.request = request;
  2652. error.response = response;
  2653. return error;
  2654. };
  2655. /***/ }),
  2656. /***/ "./node_modules/axios/lib/core/settle.js":
  2657. /*!***********************************************!*\
  2658. !*** ./node_modules/axios/lib/core/settle.js ***!
  2659. \***********************************************/
  2660. /*! no static exports found */
  2661. /***/ (function(module, exports, __webpack_require__) {
  2662. "use strict";
  2663. var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
  2664. /**
  2665. * Resolve or reject a Promise based on response status.
  2666. *
  2667. * @param {Function} resolve A function that resolves the promise.
  2668. * @param {Function} reject A function that rejects the promise.
  2669. * @param {object} response The response.
  2670. */
  2671. module.exports = function settle(resolve, reject, response) {
  2672. var validateStatus = response.config.validateStatus;
  2673. // Note: status is not exposed by XDomainRequest
  2674. if (!response.status || !validateStatus || validateStatus(response.status)) {
  2675. resolve(response);
  2676. } else {
  2677. reject(createError(
  2678. 'Request failed with status code ' + response.status,
  2679. response.config,
  2680. null,
  2681. response.request,
  2682. response
  2683. ));
  2684. }
  2685. };
  2686. /***/ }),
  2687. /***/ "./node_modules/axios/lib/core/transformData.js":
  2688. /*!******************************************************!*\
  2689. !*** ./node_modules/axios/lib/core/transformData.js ***!
  2690. \******************************************************/
  2691. /*! no static exports found */
  2692. /***/ (function(module, exports, __webpack_require__) {
  2693. "use strict";
  2694. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2695. /**
  2696. * Transform the data for a request or a response
  2697. *
  2698. * @param {Object|String} data The data to be transformed
  2699. * @param {Array} headers The headers for the request or response
  2700. * @param {Array|Function} fns A single function or Array of functions
  2701. * @returns {*} The resulting transformed data
  2702. */
  2703. module.exports = function transformData(data, headers, fns) {
  2704. /*eslint no-param-reassign:0*/
  2705. utils.forEach(fns, function transform(fn) {
  2706. data = fn(data, headers);
  2707. });
  2708. return data;
  2709. };
  2710. /***/ }),
  2711. /***/ "./node_modules/axios/lib/defaults.js":
  2712. /*!********************************************!*\
  2713. !*** ./node_modules/axios/lib/defaults.js ***!
  2714. \********************************************/
  2715. /*! no static exports found */
  2716. /***/ (function(module, exports, __webpack_require__) {
  2717. "use strict";
  2718. /* WEBPACK VAR INJECTION */(function(process) {
  2719. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  2720. var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
  2721. var DEFAULT_CONTENT_TYPE = {
  2722. 'Content-Type': 'application/x-www-form-urlencoded'
  2723. };
  2724. function setContentTypeIfUnset(headers, value) {
  2725. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  2726. headers['Content-Type'] = value;
  2727. }
  2728. }
  2729. function getDefaultAdapter() {
  2730. var adapter;
  2731. if (typeof XMLHttpRequest !== 'undefined') {
  2732. // For browsers use XHR adapter
  2733. adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
  2734. } else if (typeof process !== 'undefined') {
  2735. // For node use HTTP adapter
  2736. adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
  2737. }
  2738. return adapter;
  2739. }
  2740. var defaults = {
  2741. adapter: getDefaultAdapter(),
  2742. transformRequest: [function transformRequest(data, headers) {
  2743. normalizeHeaderName(headers, 'Content-Type');
  2744. if (utils.isFormData(data) ||
  2745. utils.isArrayBuffer(data) ||
  2746. utils.isBuffer(data) ||
  2747. utils.isStream(data) ||
  2748. utils.isFile(data) ||
  2749. utils.isBlob(data)
  2750. ) {
  2751. return data;
  2752. }
  2753. if (utils.isArrayBufferView(data)) {
  2754. return data.buffer;
  2755. }
  2756. if (utils.isURLSearchParams(data)) {
  2757. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  2758. return data.toString();
  2759. }
  2760. if (utils.isObject(data)) {
  2761. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  2762. return JSON.stringify(data);
  2763. }
  2764. return data;
  2765. }],
  2766. transformResponse: [function transformResponse(data) {
  2767. /*eslint no-param-reassign:0*/
  2768. if (typeof data === 'string') {
  2769. try {
  2770. data = JSON.parse(data);
  2771. } catch (e) { /* Ignore */ }
  2772. }
  2773. return data;
  2774. }],
  2775. /**
  2776. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  2777. * timeout is not created.
  2778. */
  2779. timeout: 0,
  2780. xsrfCookieName: 'XSRF-TOKEN',
  2781. xsrfHeaderName: 'X-XSRF-TOKEN',
  2782. maxContentLength: -1,
  2783. validateStatus: function validateStatus(status) {
  2784. return status >= 200 && status < 300;
  2785. }
  2786. };
  2787. defaults.headers = {
  2788. common: {
  2789. 'Accept': 'application/json, text/plain, */*'
  2790. }
  2791. };
  2792. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  2793. defaults.headers[method] = {};
  2794. });
  2795. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  2796. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  2797. });
  2798. module.exports = defaults;
  2799. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  2800. /***/ }),
  2801. /***/ "./node_modules/axios/lib/helpers/bind.js":
  2802. /*!************************************************!*\
  2803. !*** ./node_modules/axios/lib/helpers/bind.js ***!
  2804. \************************************************/
  2805. /*! no static exports found */
  2806. /***/ (function(module, exports, __webpack_require__) {
  2807. "use strict";
  2808. module.exports = function bind(fn, thisArg) {
  2809. return function wrap() {
  2810. var args = new Array(arguments.length);
  2811. for (var i = 0; i < args.length; i++) {
  2812. args[i] = arguments[i];
  2813. }
  2814. return fn.apply(thisArg, args);
  2815. };
  2816. };
  2817. /***/ }),
  2818. /***/ "./node_modules/axios/lib/helpers/buildURL.js":
  2819. /*!****************************************************!*\
  2820. !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
  2821. \****************************************************/
  2822. /*! no static exports found */
  2823. /***/ (function(module, exports, __webpack_require__) {
  2824. "use strict";
  2825. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2826. function encode(val) {
  2827. return encodeURIComponent(val).
  2828. replace(/%40/gi, '@').
  2829. replace(/%3A/gi, ':').
  2830. replace(/%24/g, '$').
  2831. replace(/%2C/gi, ',').
  2832. replace(/%20/g, '+').
  2833. replace(/%5B/gi, '[').
  2834. replace(/%5D/gi, ']');
  2835. }
  2836. /**
  2837. * Build a URL by appending params to the end
  2838. *
  2839. * @param {string} url The base of the url (e.g., http://www.google.com)
  2840. * @param {object} [params] The params to be appended
  2841. * @returns {string} The formatted url
  2842. */
  2843. module.exports = function buildURL(url, params, paramsSerializer) {
  2844. /*eslint no-param-reassign:0*/
  2845. if (!params) {
  2846. return url;
  2847. }
  2848. var serializedParams;
  2849. if (paramsSerializer) {
  2850. serializedParams = paramsSerializer(params);
  2851. } else if (utils.isURLSearchParams(params)) {
  2852. serializedParams = params.toString();
  2853. } else {
  2854. var parts = [];
  2855. utils.forEach(params, function serialize(val, key) {
  2856. if (val === null || typeof val === 'undefined') {
  2857. return;
  2858. }
  2859. if (utils.isArray(val)) {
  2860. key = key + '[]';
  2861. } else {
  2862. val = [val];
  2863. }
  2864. utils.forEach(val, function parseValue(v) {
  2865. if (utils.isDate(v)) {
  2866. v = v.toISOString();
  2867. } else if (utils.isObject(v)) {
  2868. v = JSON.stringify(v);
  2869. }
  2870. parts.push(encode(key) + '=' + encode(v));
  2871. });
  2872. });
  2873. serializedParams = parts.join('&');
  2874. }
  2875. if (serializedParams) {
  2876. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  2877. }
  2878. return url;
  2879. };
  2880. /***/ }),
  2881. /***/ "./node_modules/axios/lib/helpers/combineURLs.js":
  2882. /*!*******************************************************!*\
  2883. !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
  2884. \*******************************************************/
  2885. /*! no static exports found */
  2886. /***/ (function(module, exports, __webpack_require__) {
  2887. "use strict";
  2888. /**
  2889. * Creates a new URL by combining the specified URLs
  2890. *
  2891. * @param {string} baseURL The base URL
  2892. * @param {string} relativeURL The relative URL
  2893. * @returns {string} The combined URL
  2894. */
  2895. module.exports = function combineURLs(baseURL, relativeURL) {
  2896. return relativeURL
  2897. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  2898. : baseURL;
  2899. };
  2900. /***/ }),
  2901. /***/ "./node_modules/axios/lib/helpers/cookies.js":
  2902. /*!***************************************************!*\
  2903. !*** ./node_modules/axios/lib/helpers/cookies.js ***!
  2904. \***************************************************/
  2905. /*! no static exports found */
  2906. /***/ (function(module, exports, __webpack_require__) {
  2907. "use strict";
  2908. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2909. module.exports = (
  2910. utils.isStandardBrowserEnv() ?
  2911. // Standard browser envs support document.cookie
  2912. (function standardBrowserEnv() {
  2913. return {
  2914. write: function write(name, value, expires, path, domain, secure) {
  2915. var cookie = [];
  2916. cookie.push(name + '=' + encodeURIComponent(value));
  2917. if (utils.isNumber(expires)) {
  2918. cookie.push('expires=' + new Date(expires).toGMTString());
  2919. }
  2920. if (utils.isString(path)) {
  2921. cookie.push('path=' + path);
  2922. }
  2923. if (utils.isString(domain)) {
  2924. cookie.push('domain=' + domain);
  2925. }
  2926. if (secure === true) {
  2927. cookie.push('secure');
  2928. }
  2929. document.cookie = cookie.join('; ');
  2930. },
  2931. read: function read(name) {
  2932. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  2933. return (match ? decodeURIComponent(match[3]) : null);
  2934. },
  2935. remove: function remove(name) {
  2936. this.write(name, '', Date.now() - 86400000);
  2937. }
  2938. };
  2939. })() :
  2940. // Non standard browser env (web workers, react-native) lack needed support.
  2941. (function nonStandardBrowserEnv() {
  2942. return {
  2943. write: function write() {},
  2944. read: function read() { return null; },
  2945. remove: function remove() {}
  2946. };
  2947. })()
  2948. );
  2949. /***/ }),
  2950. /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
  2951. /*!*********************************************************!*\
  2952. !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  2953. \*********************************************************/
  2954. /*! no static exports found */
  2955. /***/ (function(module, exports, __webpack_require__) {
  2956. "use strict";
  2957. /**
  2958. * Determines whether the specified URL is absolute
  2959. *
  2960. * @param {string} url The URL to test
  2961. * @returns {boolean} True if the specified URL is absolute, otherwise false
  2962. */
  2963. module.exports = function isAbsoluteURL(url) {
  2964. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  2965. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  2966. // by any combination of letters, digits, plus, period, or hyphen.
  2967. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  2968. };
  2969. /***/ }),
  2970. /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
  2971. /*!***********************************************************!*\
  2972. !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  2973. \***********************************************************/
  2974. /*! no static exports found */
  2975. /***/ (function(module, exports, __webpack_require__) {
  2976. "use strict";
  2977. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  2978. module.exports = (
  2979. utils.isStandardBrowserEnv() ?
  2980. // Standard browser envs have full support of the APIs needed to test
  2981. // whether the request URL is of the same origin as current location.
  2982. (function standardBrowserEnv() {
  2983. var msie = /(msie|trident)/i.test(navigator.userAgent);
  2984. var urlParsingNode = document.createElement('a');
  2985. var originURL;
  2986. /**
  2987. * Parse a URL to discover it's components
  2988. *
  2989. * @param {String} url The URL to be parsed
  2990. * @returns {Object}
  2991. */
  2992. function resolveURL(url) {
  2993. var href = url;
  2994. if (msie) {
  2995. // IE needs attribute set twice to normalize properties
  2996. urlParsingNode.setAttribute('href', href);
  2997. href = urlParsingNode.href;
  2998. }
  2999. urlParsingNode.setAttribute('href', href);
  3000. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  3001. return {
  3002. href: urlParsingNode.href,
  3003. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  3004. host: urlParsingNode.host,
  3005. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  3006. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  3007. hostname: urlParsingNode.hostname,
  3008. port: urlParsingNode.port,
  3009. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  3010. urlParsingNode.pathname :
  3011. '/' + urlParsingNode.pathname
  3012. };
  3013. }
  3014. originURL = resolveURL(window.location.href);
  3015. /**
  3016. * Determine if a URL shares the same origin as the current location
  3017. *
  3018. * @param {String} requestURL The URL to test
  3019. * @returns {boolean} True if URL shares the same origin, otherwise false
  3020. */
  3021. return function isURLSameOrigin(requestURL) {
  3022. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  3023. return (parsed.protocol === originURL.protocol &&
  3024. parsed.host === originURL.host);
  3025. };
  3026. })() :
  3027. // Non standard browser envs (web workers, react-native) lack needed support.
  3028. (function nonStandardBrowserEnv() {
  3029. return function isURLSameOrigin() {
  3030. return true;
  3031. };
  3032. })()
  3033. );
  3034. /***/ }),
  3035. /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
  3036. /*!***************************************************************!*\
  3037. !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
  3038. \***************************************************************/
  3039. /*! no static exports found */
  3040. /***/ (function(module, exports, __webpack_require__) {
  3041. "use strict";
  3042. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  3043. module.exports = function normalizeHeaderName(headers, normalizedName) {
  3044. utils.forEach(headers, function processHeader(value, name) {
  3045. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  3046. headers[normalizedName] = value;
  3047. delete headers[name];
  3048. }
  3049. });
  3050. };
  3051. /***/ }),
  3052. /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
  3053. /*!********************************************************!*\
  3054. !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
  3055. \********************************************************/
  3056. /*! no static exports found */
  3057. /***/ (function(module, exports, __webpack_require__) {
  3058. "use strict";
  3059. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  3060. // Headers whose duplicates are ignored by node
  3061. // c.f. https://nodejs.org/api/http.html#http_message_headers
  3062. var ignoreDuplicateOf = [
  3063. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  3064. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  3065. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  3066. 'referer', 'retry-after', 'user-agent'
  3067. ];
  3068. /**
  3069. * Parse headers into an object
  3070. *
  3071. * ```
  3072. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  3073. * Content-Type: application/json
  3074. * Connection: keep-alive
  3075. * Transfer-Encoding: chunked
  3076. * ```
  3077. *
  3078. * @param {String} headers Headers needing to be parsed
  3079. * @returns {Object} Headers parsed into an object
  3080. */
  3081. module.exports = function parseHeaders(headers) {
  3082. var parsed = {};
  3083. var key;
  3084. var val;
  3085. var i;
  3086. if (!headers) { return parsed; }
  3087. utils.forEach(headers.split('\n'), function parser(line) {
  3088. i = line.indexOf(':');
  3089. key = utils.trim(line.substr(0, i)).toLowerCase();
  3090. val = utils.trim(line.substr(i + 1));
  3091. if (key) {
  3092. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  3093. return;
  3094. }
  3095. if (key === 'set-cookie') {
  3096. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  3097. } else {
  3098. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  3099. }
  3100. }
  3101. });
  3102. return parsed;
  3103. };
  3104. /***/ }),
  3105. /***/ "./node_modules/axios/lib/helpers/spread.js":
  3106. /*!**************************************************!*\
  3107. !*** ./node_modules/axios/lib/helpers/spread.js ***!
  3108. \**************************************************/
  3109. /*! no static exports found */
  3110. /***/ (function(module, exports, __webpack_require__) {
  3111. "use strict";
  3112. /**
  3113. * Syntactic sugar for invoking a function and expanding an array for arguments.
  3114. *
  3115. * Common use case would be to use `Function.prototype.apply`.
  3116. *
  3117. * ```js
  3118. * function f(x, y, z) {}
  3119. * var args = [1, 2, 3];
  3120. * f.apply(null, args);
  3121. * ```
  3122. *
  3123. * With `spread` this example can be re-written.
  3124. *
  3125. * ```js
  3126. * spread(function(x, y, z) {})([1, 2, 3]);
  3127. * ```
  3128. *
  3129. * @param {Function} callback
  3130. * @returns {Function}
  3131. */
  3132. module.exports = function spread(callback) {
  3133. return function wrap(arr) {
  3134. return callback.apply(null, arr);
  3135. };
  3136. };
  3137. /***/ }),
  3138. /***/ "./node_modules/axios/lib/utils.js":
  3139. /*!*****************************************!*\
  3140. !*** ./node_modules/axios/lib/utils.js ***!
  3141. \*****************************************/
  3142. /*! no static exports found */
  3143. /***/ (function(module, exports, __webpack_require__) {
  3144. "use strict";
  3145. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  3146. var isBuffer = __webpack_require__(/*! is-buffer */ "./node_modules/is-buffer/index.js");
  3147. /*global toString:true*/
  3148. // utils is a library of generic helper functions non-specific to axios
  3149. var toString = Object.prototype.toString;
  3150. /**
  3151. * Determine if a value is an Array
  3152. *
  3153. * @param {Object} val The value to test
  3154. * @returns {boolean} True if value is an Array, otherwise false
  3155. */
  3156. function isArray(val) {
  3157. return toString.call(val) === '[object Array]';
  3158. }
  3159. /**
  3160. * Determine if a value is an ArrayBuffer
  3161. *
  3162. * @param {Object} val The value to test
  3163. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  3164. */
  3165. function isArrayBuffer(val) {
  3166. return toString.call(val) === '[object ArrayBuffer]';
  3167. }
  3168. /**
  3169. * Determine if a value is a FormData
  3170. *
  3171. * @param {Object} val The value to test
  3172. * @returns {boolean} True if value is an FormData, otherwise false
  3173. */
  3174. function isFormData(val) {
  3175. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  3176. }
  3177. /**
  3178. * Determine if a value is a view on an ArrayBuffer
  3179. *
  3180. * @param {Object} val The value to test
  3181. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  3182. */
  3183. function isArrayBufferView(val) {
  3184. var result;
  3185. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  3186. result = ArrayBuffer.isView(val);
  3187. } else {
  3188. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  3189. }
  3190. return result;
  3191. }
  3192. /**
  3193. * Determine if a value is a String
  3194. *
  3195. * @param {Object} val The value to test
  3196. * @returns {boolean} True if value is a String, otherwise false
  3197. */
  3198. function isString(val) {
  3199. return typeof val === 'string';
  3200. }
  3201. /**
  3202. * Determine if a value is a Number
  3203. *
  3204. * @param {Object} val The value to test
  3205. * @returns {boolean} True if value is a Number, otherwise false
  3206. */
  3207. function isNumber(val) {
  3208. return typeof val === 'number';
  3209. }
  3210. /**
  3211. * Determine if a value is undefined
  3212. *
  3213. * @param {Object} val The value to test
  3214. * @returns {boolean} True if the value is undefined, otherwise false
  3215. */
  3216. function isUndefined(val) {
  3217. return typeof val === 'undefined';
  3218. }
  3219. /**
  3220. * Determine if a value is an Object
  3221. *
  3222. * @param {Object} val The value to test
  3223. * @returns {boolean} True if value is an Object, otherwise false
  3224. */
  3225. function isObject(val) {
  3226. return val !== null && typeof val === 'object';
  3227. }
  3228. /**
  3229. * Determine if a value is a Date
  3230. *
  3231. * @param {Object} val The value to test
  3232. * @returns {boolean} True if value is a Date, otherwise false
  3233. */
  3234. function isDate(val) {
  3235. return toString.call(val) === '[object Date]';
  3236. }
  3237. /**
  3238. * Determine if a value is a File
  3239. *
  3240. * @param {Object} val The value to test
  3241. * @returns {boolean} True if value is a File, otherwise false
  3242. */
  3243. function isFile(val) {
  3244. return toString.call(val) === '[object File]';
  3245. }
  3246. /**
  3247. * Determine if a value is a Blob
  3248. *
  3249. * @param {Object} val The value to test
  3250. * @returns {boolean} True if value is a Blob, otherwise false
  3251. */
  3252. function isBlob(val) {
  3253. return toString.call(val) === '[object Blob]';
  3254. }
  3255. /**
  3256. * Determine if a value is a Function
  3257. *
  3258. * @param {Object} val The value to test
  3259. * @returns {boolean} True if value is a Function, otherwise false
  3260. */
  3261. function isFunction(val) {
  3262. return toString.call(val) === '[object Function]';
  3263. }
  3264. /**
  3265. * Determine if a value is a Stream
  3266. *
  3267. * @param {Object} val The value to test
  3268. * @returns {boolean} True if value is a Stream, otherwise false
  3269. */
  3270. function isStream(val) {
  3271. return isObject(val) && isFunction(val.pipe);
  3272. }
  3273. /**
  3274. * Determine if a value is a URLSearchParams object
  3275. *
  3276. * @param {Object} val The value to test
  3277. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  3278. */
  3279. function isURLSearchParams(val) {
  3280. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  3281. }
  3282. /**
  3283. * Trim excess whitespace off the beginning and end of a string
  3284. *
  3285. * @param {String} str The String to trim
  3286. * @returns {String} The String freed of excess whitespace
  3287. */
  3288. function trim(str) {
  3289. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  3290. }
  3291. /**
  3292. * Determine if we're running in a standard browser environment
  3293. *
  3294. * This allows axios to run in a web worker, and react-native.
  3295. * Both environments support XMLHttpRequest, but not fully standard globals.
  3296. *
  3297. * web workers:
  3298. * typeof window -> undefined
  3299. * typeof document -> undefined
  3300. *
  3301. * react-native:
  3302. * navigator.product -> 'ReactNative'
  3303. */
  3304. function isStandardBrowserEnv() {
  3305. if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
  3306. return false;
  3307. }
  3308. return (
  3309. typeof window !== 'undefined' &&
  3310. typeof document !== 'undefined'
  3311. );
  3312. }
  3313. /**
  3314. * Iterate over an Array or an Object invoking a function for each item.
  3315. *
  3316. * If `obj` is an Array callback will be called passing
  3317. * the value, index, and complete array for each item.
  3318. *
  3319. * If 'obj' is an Object callback will be called passing
  3320. * the value, key, and complete object for each property.
  3321. *
  3322. * @param {Object|Array} obj The object to iterate
  3323. * @param {Function} fn The callback to invoke for each item
  3324. */
  3325. function forEach(obj, fn) {
  3326. // Don't bother if no value provided
  3327. if (obj === null || typeof obj === 'undefined') {
  3328. return;
  3329. }
  3330. // Force an array if not already something iterable
  3331. if (typeof obj !== 'object') {
  3332. /*eslint no-param-reassign:0*/
  3333. obj = [obj];
  3334. }
  3335. if (isArray(obj)) {
  3336. // Iterate over array values
  3337. for (var i = 0, l = obj.length; i < l; i++) {
  3338. fn.call(null, obj[i], i, obj);
  3339. }
  3340. } else {
  3341. // Iterate over object keys
  3342. for (var key in obj) {
  3343. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  3344. fn.call(null, obj[key], key, obj);
  3345. }
  3346. }
  3347. }
  3348. }
  3349. /**
  3350. * Accepts varargs expecting each argument to be an object, then
  3351. * immutably merges the properties of each object and returns result.
  3352. *
  3353. * When multiple objects contain the same key the later object in
  3354. * the arguments list will take precedence.
  3355. *
  3356. * Example:
  3357. *
  3358. * ```js
  3359. * var result = merge({foo: 123}, {foo: 456});
  3360. * console.log(result.foo); // outputs 456
  3361. * ```
  3362. *
  3363. * @param {Object} obj1 Object to merge
  3364. * @returns {Object} Result of all merge properties
  3365. */
  3366. function merge(/* obj1, obj2, obj3, ... */) {
  3367. var result = {};
  3368. function assignValue(val, key) {
  3369. if (typeof result[key] === 'object' && typeof val === 'object') {
  3370. result[key] = merge(result[key], val);
  3371. } else {
  3372. result[key] = val;
  3373. }
  3374. }
  3375. for (var i = 0, l = arguments.length; i < l; i++) {
  3376. forEach(arguments[i], assignValue);
  3377. }
  3378. return result;
  3379. }
  3380. /**
  3381. * Extends object a by mutably adding to it the properties of object b.
  3382. *
  3383. * @param {Object} a The object to be extended
  3384. * @param {Object} b The object to copy properties from
  3385. * @param {Object} thisArg The object to bind function to
  3386. * @return {Object} The resulting value of object a
  3387. */
  3388. function extend(a, b, thisArg) {
  3389. forEach(b, function assignValue(val, key) {
  3390. if (thisArg && typeof val === 'function') {
  3391. a[key] = bind(val, thisArg);
  3392. } else {
  3393. a[key] = val;
  3394. }
  3395. });
  3396. return a;
  3397. }
  3398. module.exports = {
  3399. isArray: isArray,
  3400. isArrayBuffer: isArrayBuffer,
  3401. isBuffer: isBuffer,
  3402. isFormData: isFormData,
  3403. isArrayBufferView: isArrayBufferView,
  3404. isString: isString,
  3405. isNumber: isNumber,
  3406. isObject: isObject,
  3407. isUndefined: isUndefined,
  3408. isDate: isDate,
  3409. isFile: isFile,
  3410. isBlob: isBlob,
  3411. isFunction: isFunction,
  3412. isStream: isStream,
  3413. isURLSearchParams: isURLSearchParams,
  3414. isStandardBrowserEnv: isStandardBrowserEnv,
  3415. forEach: forEach,
  3416. merge: merge,
  3417. extend: extend,
  3418. trim: trim
  3419. };
  3420. /***/ }),
  3421. /***/ "./node_modules/base64-js/index.js":
  3422. /*!*****************************************!*\
  3423. !*** ./node_modules/base64-js/index.js ***!
  3424. \*****************************************/
  3425. /*! no static exports found */
  3426. /***/ (function(module, exports, __webpack_require__) {
  3427. "use strict";
  3428. exports.byteLength = byteLength
  3429. exports.toByteArray = toByteArray
  3430. exports.fromByteArray = fromByteArray
  3431. var lookup = []
  3432. var revLookup = []
  3433. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  3434. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  3435. for (var i = 0, len = code.length; i < len; ++i) {
  3436. lookup[i] = code[i]
  3437. revLookup[code.charCodeAt(i)] = i
  3438. }
  3439. // Support decoding URL-safe base64 strings, as Node.js does.
  3440. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  3441. revLookup['-'.charCodeAt(0)] = 62
  3442. revLookup['_'.charCodeAt(0)] = 63
  3443. function getLens (b64) {
  3444. var len = b64.length
  3445. if (len % 4 > 0) {
  3446. throw new Error('Invalid string. Length must be a multiple of 4')
  3447. }
  3448. // Trim off extra bytes after placeholder bytes are found
  3449. // See: https://github.com/beatgammit/base64-js/issues/42
  3450. var validLen = b64.indexOf('=')
  3451. if (validLen === -1) validLen = len
  3452. var placeHoldersLen = validLen === len
  3453. ? 0
  3454. : 4 - (validLen % 4)
  3455. return [validLen, placeHoldersLen]
  3456. }
  3457. // base64 is 4/3 + up to two characters of the original data
  3458. function byteLength (b64) {
  3459. var lens = getLens(b64)
  3460. var validLen = lens[0]
  3461. var placeHoldersLen = lens[1]
  3462. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  3463. }
  3464. function _byteLength (b64, validLen, placeHoldersLen) {
  3465. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  3466. }
  3467. function toByteArray (b64) {
  3468. var tmp
  3469. var lens = getLens(b64)
  3470. var validLen = lens[0]
  3471. var placeHoldersLen = lens[1]
  3472. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  3473. var curByte = 0
  3474. // if there are placeholders, only get up to the last complete 4 chars
  3475. var len = placeHoldersLen > 0
  3476. ? validLen - 4
  3477. : validLen
  3478. var i
  3479. for (i = 0; i < len; i += 4) {
  3480. tmp =
  3481. (revLookup[b64.charCodeAt(i)] << 18) |
  3482. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  3483. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  3484. revLookup[b64.charCodeAt(i + 3)]
  3485. arr[curByte++] = (tmp >> 16) & 0xFF
  3486. arr[curByte++] = (tmp >> 8) & 0xFF
  3487. arr[curByte++] = tmp & 0xFF
  3488. }
  3489. if (placeHoldersLen === 2) {
  3490. tmp =
  3491. (revLookup[b64.charCodeAt(i)] << 2) |
  3492. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  3493. arr[curByte++] = tmp & 0xFF
  3494. }
  3495. if (placeHoldersLen === 1) {
  3496. tmp =
  3497. (revLookup[b64.charCodeAt(i)] << 10) |
  3498. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  3499. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  3500. arr[curByte++] = (tmp >> 8) & 0xFF
  3501. arr[curByte++] = tmp & 0xFF
  3502. }
  3503. return arr
  3504. }
  3505. function tripletToBase64 (num) {
  3506. return lookup[num >> 18 & 0x3F] +
  3507. lookup[num >> 12 & 0x3F] +
  3508. lookup[num >> 6 & 0x3F] +
  3509. lookup[num & 0x3F]
  3510. }
  3511. function encodeChunk (uint8, start, end) {
  3512. var tmp
  3513. var output = []
  3514. for (var i = start; i < end; i += 3) {
  3515. tmp =
  3516. ((uint8[i] << 16) & 0xFF0000) +
  3517. ((uint8[i + 1] << 8) & 0xFF00) +
  3518. (uint8[i + 2] & 0xFF)
  3519. output.push(tripletToBase64(tmp))
  3520. }
  3521. return output.join('')
  3522. }
  3523. function fromByteArray (uint8) {
  3524. var tmp
  3525. var len = uint8.length
  3526. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  3527. var parts = []
  3528. var maxChunkLength = 16383 // must be multiple of 3
  3529. // go through the array every three bytes, we'll deal with trailing stuff later
  3530. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  3531. parts.push(encodeChunk(
  3532. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  3533. ))
  3534. }
  3535. // pad the end with zeros, but make sure to not forget the extra bytes
  3536. if (extraBytes === 1) {
  3537. tmp = uint8[len - 1]
  3538. parts.push(
  3539. lookup[tmp >> 2] +
  3540. lookup[(tmp << 4) & 0x3F] +
  3541. '=='
  3542. )
  3543. } else if (extraBytes === 2) {
  3544. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  3545. parts.push(
  3546. lookup[tmp >> 10] +
  3547. lookup[(tmp >> 4) & 0x3F] +
  3548. lookup[(tmp << 2) & 0x3F] +
  3549. '='
  3550. )
  3551. }
  3552. return parts.join('')
  3553. }
  3554. /***/ }),
  3555. /***/ "./node_modules/bootstrap/dist/js/bootstrap.js":
  3556. /*!*****************************************************!*\
  3557. !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***!
  3558. \*****************************************************/
  3559. /*! no static exports found */
  3560. /***/ (function(module, exports, __webpack_require__) {
  3561. /*!
  3562. * Bootstrap v4.3.1 (https://getbootstrap.com/)
  3563. * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  3564. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3565. */
  3566. (function (global, factory) {
  3567. true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) :
  3568. undefined;
  3569. }(this, function (exports, $, Popper) { 'use strict';
  3570. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  3571. Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
  3572. function _defineProperties(target, props) {
  3573. for (var i = 0; i < props.length; i++) {
  3574. var descriptor = props[i];
  3575. descriptor.enumerable = descriptor.enumerable || false;
  3576. descriptor.configurable = true;
  3577. if ("value" in descriptor) descriptor.writable = true;
  3578. Object.defineProperty(target, descriptor.key, descriptor);
  3579. }
  3580. }
  3581. function _createClass(Constructor, protoProps, staticProps) {
  3582. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3583. if (staticProps) _defineProperties(Constructor, staticProps);
  3584. return Constructor;
  3585. }
  3586. function _defineProperty(obj, key, value) {
  3587. if (key in obj) {
  3588. Object.defineProperty(obj, key, {
  3589. value: value,
  3590. enumerable: true,
  3591. configurable: true,
  3592. writable: true
  3593. });
  3594. } else {
  3595. obj[key] = value;
  3596. }
  3597. return obj;
  3598. }
  3599. function _objectSpread(target) {
  3600. for (var i = 1; i < arguments.length; i++) {
  3601. var source = arguments[i] != null ? arguments[i] : {};
  3602. var ownKeys = Object.keys(source);
  3603. if (typeof Object.getOwnPropertySymbols === 'function') {
  3604. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  3605. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  3606. }));
  3607. }
  3608. ownKeys.forEach(function (key) {
  3609. _defineProperty(target, key, source[key]);
  3610. });
  3611. }
  3612. return target;
  3613. }
  3614. function _inheritsLoose(subClass, superClass) {
  3615. subClass.prototype = Object.create(superClass.prototype);
  3616. subClass.prototype.constructor = subClass;
  3617. subClass.__proto__ = superClass;
  3618. }
  3619. /**
  3620. * --------------------------------------------------------------------------
  3621. * Bootstrap (v4.3.1): util.js
  3622. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3623. * --------------------------------------------------------------------------
  3624. */
  3625. /**
  3626. * ------------------------------------------------------------------------
  3627. * Private TransitionEnd Helpers
  3628. * ------------------------------------------------------------------------
  3629. */
  3630. var TRANSITION_END = 'transitionend';
  3631. var MAX_UID = 1000000;
  3632. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  3633. function toType(obj) {
  3634. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  3635. }
  3636. function getSpecialTransitionEndEvent() {
  3637. return {
  3638. bindType: TRANSITION_END,
  3639. delegateType: TRANSITION_END,
  3640. handle: function handle(event) {
  3641. if ($(event.target).is(this)) {
  3642. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  3643. }
  3644. return undefined; // eslint-disable-line no-undefined
  3645. }
  3646. };
  3647. }
  3648. function transitionEndEmulator(duration) {
  3649. var _this = this;
  3650. var called = false;
  3651. $(this).one(Util.TRANSITION_END, function () {
  3652. called = true;
  3653. });
  3654. setTimeout(function () {
  3655. if (!called) {
  3656. Util.triggerTransitionEnd(_this);
  3657. }
  3658. }, duration);
  3659. return this;
  3660. }
  3661. function setTransitionEndSupport() {
  3662. $.fn.emulateTransitionEnd = transitionEndEmulator;
  3663. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  3664. }
  3665. /**
  3666. * --------------------------------------------------------------------------
  3667. * Public Util Api
  3668. * --------------------------------------------------------------------------
  3669. */
  3670. var Util = {
  3671. TRANSITION_END: 'bsTransitionEnd',
  3672. getUID: function getUID(prefix) {
  3673. do {
  3674. // eslint-disable-next-line no-bitwise
  3675. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  3676. } while (document.getElementById(prefix));
  3677. return prefix;
  3678. },
  3679. getSelectorFromElement: function getSelectorFromElement(element) {
  3680. var selector = element.getAttribute('data-target');
  3681. if (!selector || selector === '#') {
  3682. var hrefAttr = element.getAttribute('href');
  3683. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  3684. }
  3685. try {
  3686. return document.querySelector(selector) ? selector : null;
  3687. } catch (err) {
  3688. return null;
  3689. }
  3690. },
  3691. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  3692. if (!element) {
  3693. return 0;
  3694. } // Get transition-duration of the element
  3695. var transitionDuration = $(element).css('transition-duration');
  3696. var transitionDelay = $(element).css('transition-delay');
  3697. var floatTransitionDuration = parseFloat(transitionDuration);
  3698. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  3699. if (!floatTransitionDuration && !floatTransitionDelay) {
  3700. return 0;
  3701. } // If multiple durations are defined, take the first
  3702. transitionDuration = transitionDuration.split(',')[0];
  3703. transitionDelay = transitionDelay.split(',')[0];
  3704. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  3705. },
  3706. reflow: function reflow(element) {
  3707. return element.offsetHeight;
  3708. },
  3709. triggerTransitionEnd: function triggerTransitionEnd(element) {
  3710. $(element).trigger(TRANSITION_END);
  3711. },
  3712. // TODO: Remove in v5
  3713. supportsTransitionEnd: function supportsTransitionEnd() {
  3714. return Boolean(TRANSITION_END);
  3715. },
  3716. isElement: function isElement(obj) {
  3717. return (obj[0] || obj).nodeType;
  3718. },
  3719. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  3720. for (var property in configTypes) {
  3721. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  3722. var expectedTypes = configTypes[property];
  3723. var value = config[property];
  3724. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  3725. if (!new RegExp(expectedTypes).test(valueType)) {
  3726. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  3727. }
  3728. }
  3729. }
  3730. },
  3731. findShadowRoot: function findShadowRoot(element) {
  3732. if (!document.documentElement.attachShadow) {
  3733. return null;
  3734. } // Can find the shadow root otherwise it'll return the document
  3735. if (typeof element.getRootNode === 'function') {
  3736. var root = element.getRootNode();
  3737. return root instanceof ShadowRoot ? root : null;
  3738. }
  3739. if (element instanceof ShadowRoot) {
  3740. return element;
  3741. } // when we don't find a shadow root
  3742. if (!element.parentNode) {
  3743. return null;
  3744. }
  3745. return Util.findShadowRoot(element.parentNode);
  3746. }
  3747. };
  3748. setTransitionEndSupport();
  3749. /**
  3750. * ------------------------------------------------------------------------
  3751. * Constants
  3752. * ------------------------------------------------------------------------
  3753. */
  3754. var NAME = 'alert';
  3755. var VERSION = '4.3.1';
  3756. var DATA_KEY = 'bs.alert';
  3757. var EVENT_KEY = "." + DATA_KEY;
  3758. var DATA_API_KEY = '.data-api';
  3759. var JQUERY_NO_CONFLICT = $.fn[NAME];
  3760. var Selector = {
  3761. DISMISS: '[data-dismiss="alert"]'
  3762. };
  3763. var Event = {
  3764. CLOSE: "close" + EVENT_KEY,
  3765. CLOSED: "closed" + EVENT_KEY,
  3766. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  3767. };
  3768. var ClassName = {
  3769. ALERT: 'alert',
  3770. FADE: 'fade',
  3771. SHOW: 'show'
  3772. /**
  3773. * ------------------------------------------------------------------------
  3774. * Class Definition
  3775. * ------------------------------------------------------------------------
  3776. */
  3777. };
  3778. var Alert =
  3779. /*#__PURE__*/
  3780. function () {
  3781. function Alert(element) {
  3782. this._element = element;
  3783. } // Getters
  3784. var _proto = Alert.prototype;
  3785. // Public
  3786. _proto.close = function close(element) {
  3787. var rootElement = this._element;
  3788. if (element) {
  3789. rootElement = this._getRootElement(element);
  3790. }
  3791. var customEvent = this._triggerCloseEvent(rootElement);
  3792. if (customEvent.isDefaultPrevented()) {
  3793. return;
  3794. }
  3795. this._removeElement(rootElement);
  3796. };
  3797. _proto.dispose = function dispose() {
  3798. $.removeData(this._element, DATA_KEY);
  3799. this._element = null;
  3800. } // Private
  3801. ;
  3802. _proto._getRootElement = function _getRootElement(element) {
  3803. var selector = Util.getSelectorFromElement(element);
  3804. var parent = false;
  3805. if (selector) {
  3806. parent = document.querySelector(selector);
  3807. }
  3808. if (!parent) {
  3809. parent = $(element).closest("." + ClassName.ALERT)[0];
  3810. }
  3811. return parent;
  3812. };
  3813. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  3814. var closeEvent = $.Event(Event.CLOSE);
  3815. $(element).trigger(closeEvent);
  3816. return closeEvent;
  3817. };
  3818. _proto._removeElement = function _removeElement(element) {
  3819. var _this = this;
  3820. $(element).removeClass(ClassName.SHOW);
  3821. if (!$(element).hasClass(ClassName.FADE)) {
  3822. this._destroyElement(element);
  3823. return;
  3824. }
  3825. var transitionDuration = Util.getTransitionDurationFromElement(element);
  3826. $(element).one(Util.TRANSITION_END, function (event) {
  3827. return _this._destroyElement(element, event);
  3828. }).emulateTransitionEnd(transitionDuration);
  3829. };
  3830. _proto._destroyElement = function _destroyElement(element) {
  3831. $(element).detach().trigger(Event.CLOSED).remove();
  3832. } // Static
  3833. ;
  3834. Alert._jQueryInterface = function _jQueryInterface(config) {
  3835. return this.each(function () {
  3836. var $element = $(this);
  3837. var data = $element.data(DATA_KEY);
  3838. if (!data) {
  3839. data = new Alert(this);
  3840. $element.data(DATA_KEY, data);
  3841. }
  3842. if (config === 'close') {
  3843. data[config](this);
  3844. }
  3845. });
  3846. };
  3847. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  3848. return function (event) {
  3849. if (event) {
  3850. event.preventDefault();
  3851. }
  3852. alertInstance.close(this);
  3853. };
  3854. };
  3855. _createClass(Alert, null, [{
  3856. key: "VERSION",
  3857. get: function get() {
  3858. return VERSION;
  3859. }
  3860. }]);
  3861. return Alert;
  3862. }();
  3863. /**
  3864. * ------------------------------------------------------------------------
  3865. * Data Api implementation
  3866. * ------------------------------------------------------------------------
  3867. */
  3868. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  3869. /**
  3870. * ------------------------------------------------------------------------
  3871. * jQuery
  3872. * ------------------------------------------------------------------------
  3873. */
  3874. $.fn[NAME] = Alert._jQueryInterface;
  3875. $.fn[NAME].Constructor = Alert;
  3876. $.fn[NAME].noConflict = function () {
  3877. $.fn[NAME] = JQUERY_NO_CONFLICT;
  3878. return Alert._jQueryInterface;
  3879. };
  3880. /**
  3881. * ------------------------------------------------------------------------
  3882. * Constants
  3883. * ------------------------------------------------------------------------
  3884. */
  3885. var NAME$1 = 'button';
  3886. var VERSION$1 = '4.3.1';
  3887. var DATA_KEY$1 = 'bs.button';
  3888. var EVENT_KEY$1 = "." + DATA_KEY$1;
  3889. var DATA_API_KEY$1 = '.data-api';
  3890. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  3891. var ClassName$1 = {
  3892. ACTIVE: 'active',
  3893. BUTTON: 'btn',
  3894. FOCUS: 'focus'
  3895. };
  3896. var Selector$1 = {
  3897. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  3898. DATA_TOGGLE: '[data-toggle="buttons"]',
  3899. INPUT: 'input:not([type="hidden"])',
  3900. ACTIVE: '.active',
  3901. BUTTON: '.btn'
  3902. };
  3903. var Event$1 = {
  3904. CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  3905. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
  3906. /**
  3907. * ------------------------------------------------------------------------
  3908. * Class Definition
  3909. * ------------------------------------------------------------------------
  3910. */
  3911. };
  3912. var Button =
  3913. /*#__PURE__*/
  3914. function () {
  3915. function Button(element) {
  3916. this._element = element;
  3917. } // Getters
  3918. var _proto = Button.prototype;
  3919. // Public
  3920. _proto.toggle = function toggle() {
  3921. var triggerChangeEvent = true;
  3922. var addAriaPressed = true;
  3923. var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];
  3924. if (rootElement) {
  3925. var input = this._element.querySelector(Selector$1.INPUT);
  3926. if (input) {
  3927. if (input.type === 'radio') {
  3928. if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
  3929. triggerChangeEvent = false;
  3930. } else {
  3931. var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
  3932. if (activeElement) {
  3933. $(activeElement).removeClass(ClassName$1.ACTIVE);
  3934. }
  3935. }
  3936. }
  3937. if (triggerChangeEvent) {
  3938. if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
  3939. return;
  3940. }
  3941. input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
  3942. $(input).trigger('change');
  3943. }
  3944. input.focus();
  3945. addAriaPressed = false;
  3946. }
  3947. }
  3948. if (addAriaPressed) {
  3949. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
  3950. }
  3951. if (triggerChangeEvent) {
  3952. $(this._element).toggleClass(ClassName$1.ACTIVE);
  3953. }
  3954. };
  3955. _proto.dispose = function dispose() {
  3956. $.removeData(this._element, DATA_KEY$1);
  3957. this._element = null;
  3958. } // Static
  3959. ;
  3960. Button._jQueryInterface = function _jQueryInterface(config) {
  3961. return this.each(function () {
  3962. var data = $(this).data(DATA_KEY$1);
  3963. if (!data) {
  3964. data = new Button(this);
  3965. $(this).data(DATA_KEY$1, data);
  3966. }
  3967. if (config === 'toggle') {
  3968. data[config]();
  3969. }
  3970. });
  3971. };
  3972. _createClass(Button, null, [{
  3973. key: "VERSION",
  3974. get: function get() {
  3975. return VERSION$1;
  3976. }
  3977. }]);
  3978. return Button;
  3979. }();
  3980. /**
  3981. * ------------------------------------------------------------------------
  3982. * Data Api implementation
  3983. * ------------------------------------------------------------------------
  3984. */
  3985. $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  3986. event.preventDefault();
  3987. var button = event.target;
  3988. if (!$(button).hasClass(ClassName$1.BUTTON)) {
  3989. button = $(button).closest(Selector$1.BUTTON);
  3990. }
  3991. Button._jQueryInterface.call($(button), 'toggle');
  3992. }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  3993. var button = $(event.target).closest(Selector$1.BUTTON)[0];
  3994. $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  3995. });
  3996. /**
  3997. * ------------------------------------------------------------------------
  3998. * jQuery
  3999. * ------------------------------------------------------------------------
  4000. */
  4001. $.fn[NAME$1] = Button._jQueryInterface;
  4002. $.fn[NAME$1].Constructor = Button;
  4003. $.fn[NAME$1].noConflict = function () {
  4004. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  4005. return Button._jQueryInterface;
  4006. };
  4007. /**
  4008. * ------------------------------------------------------------------------
  4009. * Constants
  4010. * ------------------------------------------------------------------------
  4011. */
  4012. var NAME$2 = 'carousel';
  4013. var VERSION$2 = '4.3.1';
  4014. var DATA_KEY$2 = 'bs.carousel';
  4015. var EVENT_KEY$2 = "." + DATA_KEY$2;
  4016. var DATA_API_KEY$2 = '.data-api';
  4017. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  4018. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  4019. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  4020. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  4021. var SWIPE_THRESHOLD = 40;
  4022. var Default = {
  4023. interval: 5000,
  4024. keyboard: true,
  4025. slide: false,
  4026. pause: 'hover',
  4027. wrap: true,
  4028. touch: true
  4029. };
  4030. var DefaultType = {
  4031. interval: '(number|boolean)',
  4032. keyboard: 'boolean',
  4033. slide: '(boolean|string)',
  4034. pause: '(string|boolean)',
  4035. wrap: 'boolean',
  4036. touch: 'boolean'
  4037. };
  4038. var Direction = {
  4039. NEXT: 'next',
  4040. PREV: 'prev',
  4041. LEFT: 'left',
  4042. RIGHT: 'right'
  4043. };
  4044. var Event$2 = {
  4045. SLIDE: "slide" + EVENT_KEY$2,
  4046. SLID: "slid" + EVENT_KEY$2,
  4047. KEYDOWN: "keydown" + EVENT_KEY$2,
  4048. MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  4049. MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  4050. TOUCHSTART: "touchstart" + EVENT_KEY$2,
  4051. TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  4052. TOUCHEND: "touchend" + EVENT_KEY$2,
  4053. POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  4054. POINTERUP: "pointerup" + EVENT_KEY$2,
  4055. DRAG_START: "dragstart" + EVENT_KEY$2,
  4056. LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  4057. CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  4058. };
  4059. var ClassName$2 = {
  4060. CAROUSEL: 'carousel',
  4061. ACTIVE: 'active',
  4062. SLIDE: 'slide',
  4063. RIGHT: 'carousel-item-right',
  4064. LEFT: 'carousel-item-left',
  4065. NEXT: 'carousel-item-next',
  4066. PREV: 'carousel-item-prev',
  4067. ITEM: 'carousel-item',
  4068. POINTER_EVENT: 'pointer-event'
  4069. };
  4070. var Selector$2 = {
  4071. ACTIVE: '.active',
  4072. ACTIVE_ITEM: '.active.carousel-item',
  4073. ITEM: '.carousel-item',
  4074. ITEM_IMG: '.carousel-item img',
  4075. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  4076. INDICATORS: '.carousel-indicators',
  4077. DATA_SLIDE: '[data-slide], [data-slide-to]',
  4078. DATA_RIDE: '[data-ride="carousel"]'
  4079. };
  4080. var PointerType = {
  4081. TOUCH: 'touch',
  4082. PEN: 'pen'
  4083. /**
  4084. * ------------------------------------------------------------------------
  4085. * Class Definition
  4086. * ------------------------------------------------------------------------
  4087. */
  4088. };
  4089. var Carousel =
  4090. /*#__PURE__*/
  4091. function () {
  4092. function Carousel(element, config) {
  4093. this._items = null;
  4094. this._interval = null;
  4095. this._activeElement = null;
  4096. this._isPaused = false;
  4097. this._isSliding = false;
  4098. this.touchTimeout = null;
  4099. this.touchStartX = 0;
  4100. this.touchDeltaX = 0;
  4101. this._config = this._getConfig(config);
  4102. this._element = element;
  4103. this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
  4104. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  4105. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  4106. this._addEventListeners();
  4107. } // Getters
  4108. var _proto = Carousel.prototype;
  4109. // Public
  4110. _proto.next = function next() {
  4111. if (!this._isSliding) {
  4112. this._slide(Direction.NEXT);
  4113. }
  4114. };
  4115. _proto.nextWhenVisible = function nextWhenVisible() {
  4116. // Don't call next when the page isn't visible
  4117. // or the carousel or its parent isn't visible
  4118. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  4119. this.next();
  4120. }
  4121. };
  4122. _proto.prev = function prev() {
  4123. if (!this._isSliding) {
  4124. this._slide(Direction.PREV);
  4125. }
  4126. };
  4127. _proto.pause = function pause(event) {
  4128. if (!event) {
  4129. this._isPaused = true;
  4130. }
  4131. if (this._element.querySelector(Selector$2.NEXT_PREV)) {
  4132. Util.triggerTransitionEnd(this._element);
  4133. this.cycle(true);
  4134. }
  4135. clearInterval(this._interval);
  4136. this._interval = null;
  4137. };
  4138. _proto.cycle = function cycle(event) {
  4139. if (!event) {
  4140. this._isPaused = false;
  4141. }
  4142. if (this._interval) {
  4143. clearInterval(this._interval);
  4144. this._interval = null;
  4145. }
  4146. if (this._config.interval && !this._isPaused) {
  4147. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  4148. }
  4149. };
  4150. _proto.to = function to(index) {
  4151. var _this = this;
  4152. this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  4153. var activeIndex = this._getItemIndex(this._activeElement);
  4154. if (index > this._items.length - 1 || index < 0) {
  4155. return;
  4156. }
  4157. if (this._isSliding) {
  4158. $(this._element).one(Event$2.SLID, function () {
  4159. return _this.to(index);
  4160. });
  4161. return;
  4162. }
  4163. if (activeIndex === index) {
  4164. this.pause();
  4165. this.cycle();
  4166. return;
  4167. }
  4168. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  4169. this._slide(direction, this._items[index]);
  4170. };
  4171. _proto.dispose = function dispose() {
  4172. $(this._element).off(EVENT_KEY$2);
  4173. $.removeData(this._element, DATA_KEY$2);
  4174. this._items = null;
  4175. this._config = null;
  4176. this._element = null;
  4177. this._interval = null;
  4178. this._isPaused = null;
  4179. this._isSliding = null;
  4180. this._activeElement = null;
  4181. this._indicatorsElement = null;
  4182. } // Private
  4183. ;
  4184. _proto._getConfig = function _getConfig(config) {
  4185. config = _objectSpread({}, Default, config);
  4186. Util.typeCheckConfig(NAME$2, config, DefaultType);
  4187. return config;
  4188. };
  4189. _proto._handleSwipe = function _handleSwipe() {
  4190. var absDeltax = Math.abs(this.touchDeltaX);
  4191. if (absDeltax <= SWIPE_THRESHOLD) {
  4192. return;
  4193. }
  4194. var direction = absDeltax / this.touchDeltaX; // swipe left
  4195. if (direction > 0) {
  4196. this.prev();
  4197. } // swipe right
  4198. if (direction < 0) {
  4199. this.next();
  4200. }
  4201. };
  4202. _proto._addEventListeners = function _addEventListeners() {
  4203. var _this2 = this;
  4204. if (this._config.keyboard) {
  4205. $(this._element).on(Event$2.KEYDOWN, function (event) {
  4206. return _this2._keydown(event);
  4207. });
  4208. }
  4209. if (this._config.pause === 'hover') {
  4210. $(this._element).on(Event$2.MOUSEENTER, function (event) {
  4211. return _this2.pause(event);
  4212. }).on(Event$2.MOUSELEAVE, function (event) {
  4213. return _this2.cycle(event);
  4214. });
  4215. }
  4216. if (this._config.touch) {
  4217. this._addTouchEventListeners();
  4218. }
  4219. };
  4220. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  4221. var _this3 = this;
  4222. if (!this._touchSupported) {
  4223. return;
  4224. }
  4225. var start = function start(event) {
  4226. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  4227. _this3.touchStartX = event.originalEvent.clientX;
  4228. } else if (!_this3._pointerEvent) {
  4229. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  4230. }
  4231. };
  4232. var move = function move(event) {
  4233. // ensure swiping with one touch and not pinching
  4234. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  4235. _this3.touchDeltaX = 0;
  4236. } else {
  4237. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  4238. }
  4239. };
  4240. var end = function end(event) {
  4241. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  4242. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  4243. }
  4244. _this3._handleSwipe();
  4245. if (_this3._config.pause === 'hover') {
  4246. // If it's a touch-enabled device, mouseenter/leave are fired as
  4247. // part of the mouse compatibility events on first tap - the carousel
  4248. // would stop cycling until user tapped out of it;
  4249. // here, we listen for touchend, explicitly pause the carousel
  4250. // (as if it's the second time we tap on it, mouseenter compat event
  4251. // is NOT fired) and after a timeout (to allow for mouse compatibility
  4252. // events to fire) we explicitly restart cycling
  4253. _this3.pause();
  4254. if (_this3.touchTimeout) {
  4255. clearTimeout(_this3.touchTimeout);
  4256. }
  4257. _this3.touchTimeout = setTimeout(function (event) {
  4258. return _this3.cycle(event);
  4259. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  4260. }
  4261. };
  4262. $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
  4263. return e.preventDefault();
  4264. });
  4265. if (this._pointerEvent) {
  4266. $(this._element).on(Event$2.POINTERDOWN, function (event) {
  4267. return start(event);
  4268. });
  4269. $(this._element).on(Event$2.POINTERUP, function (event) {
  4270. return end(event);
  4271. });
  4272. this._element.classList.add(ClassName$2.POINTER_EVENT);
  4273. } else {
  4274. $(this._element).on(Event$2.TOUCHSTART, function (event) {
  4275. return start(event);
  4276. });
  4277. $(this._element).on(Event$2.TOUCHMOVE, function (event) {
  4278. return move(event);
  4279. });
  4280. $(this._element).on(Event$2.TOUCHEND, function (event) {
  4281. return end(event);
  4282. });
  4283. }
  4284. };
  4285. _proto._keydown = function _keydown(event) {
  4286. if (/input|textarea/i.test(event.target.tagName)) {
  4287. return;
  4288. }
  4289. switch (event.which) {
  4290. case ARROW_LEFT_KEYCODE:
  4291. event.preventDefault();
  4292. this.prev();
  4293. break;
  4294. case ARROW_RIGHT_KEYCODE:
  4295. event.preventDefault();
  4296. this.next();
  4297. break;
  4298. default:
  4299. }
  4300. };
  4301. _proto._getItemIndex = function _getItemIndex(element) {
  4302. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
  4303. return this._items.indexOf(element);
  4304. };
  4305. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  4306. var isNextDirection = direction === Direction.NEXT;
  4307. var isPrevDirection = direction === Direction.PREV;
  4308. var activeIndex = this._getItemIndex(activeElement);
  4309. var lastItemIndex = this._items.length - 1;
  4310. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  4311. if (isGoingToWrap && !this._config.wrap) {
  4312. return activeElement;
  4313. }
  4314. var delta = direction === Direction.PREV ? -1 : 1;
  4315. var itemIndex = (activeIndex + delta) % this._items.length;
  4316. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  4317. };
  4318. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  4319. var targetIndex = this._getItemIndex(relatedTarget);
  4320. var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
  4321. var slideEvent = $.Event(Event$2.SLIDE, {
  4322. relatedTarget: relatedTarget,
  4323. direction: eventDirectionName,
  4324. from: fromIndex,
  4325. to: targetIndex
  4326. });
  4327. $(this._element).trigger(slideEvent);
  4328. return slideEvent;
  4329. };
  4330. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  4331. if (this._indicatorsElement) {
  4332. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
  4333. $(indicators).removeClass(ClassName$2.ACTIVE);
  4334. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  4335. if (nextIndicator) {
  4336. $(nextIndicator).addClass(ClassName$2.ACTIVE);
  4337. }
  4338. }
  4339. };
  4340. _proto._slide = function _slide(direction, element) {
  4341. var _this4 = this;
  4342. var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  4343. var activeElementIndex = this._getItemIndex(activeElement);
  4344. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  4345. var nextElementIndex = this._getItemIndex(nextElement);
  4346. var isCycling = Boolean(this._interval);
  4347. var directionalClassName;
  4348. var orderClassName;
  4349. var eventDirectionName;
  4350. if (direction === Direction.NEXT) {
  4351. directionalClassName = ClassName$2.LEFT;
  4352. orderClassName = ClassName$2.NEXT;
  4353. eventDirectionName = Direction.LEFT;
  4354. } else {
  4355. directionalClassName = ClassName$2.RIGHT;
  4356. orderClassName = ClassName$2.PREV;
  4357. eventDirectionName = Direction.RIGHT;
  4358. }
  4359. if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
  4360. this._isSliding = false;
  4361. return;
  4362. }
  4363. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  4364. if (slideEvent.isDefaultPrevented()) {
  4365. return;
  4366. }
  4367. if (!activeElement || !nextElement) {
  4368. // Some weirdness is happening, so we bail
  4369. return;
  4370. }
  4371. this._isSliding = true;
  4372. if (isCycling) {
  4373. this.pause();
  4374. }
  4375. this._setActiveIndicatorElement(nextElement);
  4376. var slidEvent = $.Event(Event$2.SLID, {
  4377. relatedTarget: nextElement,
  4378. direction: eventDirectionName,
  4379. from: activeElementIndex,
  4380. to: nextElementIndex
  4381. });
  4382. if ($(this._element).hasClass(ClassName$2.SLIDE)) {
  4383. $(nextElement).addClass(orderClassName);
  4384. Util.reflow(nextElement);
  4385. $(activeElement).addClass(directionalClassName);
  4386. $(nextElement).addClass(directionalClassName);
  4387. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  4388. if (nextElementInterval) {
  4389. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  4390. this._config.interval = nextElementInterval;
  4391. } else {
  4392. this._config.interval = this._config.defaultInterval || this._config.interval;
  4393. }
  4394. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  4395. $(activeElement).one(Util.TRANSITION_END, function () {
  4396. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
  4397. $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
  4398. _this4._isSliding = false;
  4399. setTimeout(function () {
  4400. return $(_this4._element).trigger(slidEvent);
  4401. }, 0);
  4402. }).emulateTransitionEnd(transitionDuration);
  4403. } else {
  4404. $(activeElement).removeClass(ClassName$2.ACTIVE);
  4405. $(nextElement).addClass(ClassName$2.ACTIVE);
  4406. this._isSliding = false;
  4407. $(this._element).trigger(slidEvent);
  4408. }
  4409. if (isCycling) {
  4410. this.cycle();
  4411. }
  4412. } // Static
  4413. ;
  4414. Carousel._jQueryInterface = function _jQueryInterface(config) {
  4415. return this.each(function () {
  4416. var data = $(this).data(DATA_KEY$2);
  4417. var _config = _objectSpread({}, Default, $(this).data());
  4418. if (typeof config === 'object') {
  4419. _config = _objectSpread({}, _config, config);
  4420. }
  4421. var action = typeof config === 'string' ? config : _config.slide;
  4422. if (!data) {
  4423. data = new Carousel(this, _config);
  4424. $(this).data(DATA_KEY$2, data);
  4425. }
  4426. if (typeof config === 'number') {
  4427. data.to(config);
  4428. } else if (typeof action === 'string') {
  4429. if (typeof data[action] === 'undefined') {
  4430. throw new TypeError("No method named \"" + action + "\"");
  4431. }
  4432. data[action]();
  4433. } else if (_config.interval && _config.ride) {
  4434. data.pause();
  4435. data.cycle();
  4436. }
  4437. });
  4438. };
  4439. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  4440. var selector = Util.getSelectorFromElement(this);
  4441. if (!selector) {
  4442. return;
  4443. }
  4444. var target = $(selector)[0];
  4445. if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
  4446. return;
  4447. }
  4448. var config = _objectSpread({}, $(target).data(), $(this).data());
  4449. var slideIndex = this.getAttribute('data-slide-to');
  4450. if (slideIndex) {
  4451. config.interval = false;
  4452. }
  4453. Carousel._jQueryInterface.call($(target), config);
  4454. if (slideIndex) {
  4455. $(target).data(DATA_KEY$2).to(slideIndex);
  4456. }
  4457. event.preventDefault();
  4458. };
  4459. _createClass(Carousel, null, [{
  4460. key: "VERSION",
  4461. get: function get() {
  4462. return VERSION$2;
  4463. }
  4464. }, {
  4465. key: "Default",
  4466. get: function get() {
  4467. return Default;
  4468. }
  4469. }]);
  4470. return Carousel;
  4471. }();
  4472. /**
  4473. * ------------------------------------------------------------------------
  4474. * Data Api implementation
  4475. * ------------------------------------------------------------------------
  4476. */
  4477. $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  4478. $(window).on(Event$2.LOAD_DATA_API, function () {
  4479. var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
  4480. for (var i = 0, len = carousels.length; i < len; i++) {
  4481. var $carousel = $(carousels[i]);
  4482. Carousel._jQueryInterface.call($carousel, $carousel.data());
  4483. }
  4484. });
  4485. /**
  4486. * ------------------------------------------------------------------------
  4487. * jQuery
  4488. * ------------------------------------------------------------------------
  4489. */
  4490. $.fn[NAME$2] = Carousel._jQueryInterface;
  4491. $.fn[NAME$2].Constructor = Carousel;
  4492. $.fn[NAME$2].noConflict = function () {
  4493. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  4494. return Carousel._jQueryInterface;
  4495. };
  4496. /**
  4497. * ------------------------------------------------------------------------
  4498. * Constants
  4499. * ------------------------------------------------------------------------
  4500. */
  4501. var NAME$3 = 'collapse';
  4502. var VERSION$3 = '4.3.1';
  4503. var DATA_KEY$3 = 'bs.collapse';
  4504. var EVENT_KEY$3 = "." + DATA_KEY$3;
  4505. var DATA_API_KEY$3 = '.data-api';
  4506. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  4507. var Default$1 = {
  4508. toggle: true,
  4509. parent: ''
  4510. };
  4511. var DefaultType$1 = {
  4512. toggle: 'boolean',
  4513. parent: '(string|element)'
  4514. };
  4515. var Event$3 = {
  4516. SHOW: "show" + EVENT_KEY$3,
  4517. SHOWN: "shown" + EVENT_KEY$3,
  4518. HIDE: "hide" + EVENT_KEY$3,
  4519. HIDDEN: "hidden" + EVENT_KEY$3,
  4520. CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  4521. };
  4522. var ClassName$3 = {
  4523. SHOW: 'show',
  4524. COLLAPSE: 'collapse',
  4525. COLLAPSING: 'collapsing',
  4526. COLLAPSED: 'collapsed'
  4527. };
  4528. var Dimension = {
  4529. WIDTH: 'width',
  4530. HEIGHT: 'height'
  4531. };
  4532. var Selector$3 = {
  4533. ACTIVES: '.show, .collapsing',
  4534. DATA_TOGGLE: '[data-toggle="collapse"]'
  4535. /**
  4536. * ------------------------------------------------------------------------
  4537. * Class Definition
  4538. * ------------------------------------------------------------------------
  4539. */
  4540. };
  4541. var Collapse =
  4542. /*#__PURE__*/
  4543. function () {
  4544. function Collapse(element, config) {
  4545. this._isTransitioning = false;
  4546. this._element = element;
  4547. this._config = this._getConfig(config);
  4548. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  4549. var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
  4550. for (var i = 0, len = toggleList.length; i < len; i++) {
  4551. var elem = toggleList[i];
  4552. var selector = Util.getSelectorFromElement(elem);
  4553. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  4554. return foundElem === element;
  4555. });
  4556. if (selector !== null && filterElement.length > 0) {
  4557. this._selector = selector;
  4558. this._triggerArray.push(elem);
  4559. }
  4560. }
  4561. this._parent = this._config.parent ? this._getParent() : null;
  4562. if (!this._config.parent) {
  4563. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  4564. }
  4565. if (this._config.toggle) {
  4566. this.toggle();
  4567. }
  4568. } // Getters
  4569. var _proto = Collapse.prototype;
  4570. // Public
  4571. _proto.toggle = function toggle() {
  4572. if ($(this._element).hasClass(ClassName$3.SHOW)) {
  4573. this.hide();
  4574. } else {
  4575. this.show();
  4576. }
  4577. };
  4578. _proto.show = function show() {
  4579. var _this = this;
  4580. if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
  4581. return;
  4582. }
  4583. var actives;
  4584. var activesData;
  4585. if (this._parent) {
  4586. actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
  4587. if (typeof _this._config.parent === 'string') {
  4588. return elem.getAttribute('data-parent') === _this._config.parent;
  4589. }
  4590. return elem.classList.contains(ClassName$3.COLLAPSE);
  4591. });
  4592. if (actives.length === 0) {
  4593. actives = null;
  4594. }
  4595. }
  4596. if (actives) {
  4597. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  4598. if (activesData && activesData._isTransitioning) {
  4599. return;
  4600. }
  4601. }
  4602. var startEvent = $.Event(Event$3.SHOW);
  4603. $(this._element).trigger(startEvent);
  4604. if (startEvent.isDefaultPrevented()) {
  4605. return;
  4606. }
  4607. if (actives) {
  4608. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  4609. if (!activesData) {
  4610. $(actives).data(DATA_KEY$3, null);
  4611. }
  4612. }
  4613. var dimension = this._getDimension();
  4614. $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
  4615. this._element.style[dimension] = 0;
  4616. if (this._triggerArray.length) {
  4617. $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
  4618. }
  4619. this.setTransitioning(true);
  4620. var complete = function complete() {
  4621. $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
  4622. _this._element.style[dimension] = '';
  4623. _this.setTransitioning(false);
  4624. $(_this._element).trigger(Event$3.SHOWN);
  4625. };
  4626. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  4627. var scrollSize = "scroll" + capitalizedDimension;
  4628. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4629. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4630. this._element.style[dimension] = this._element[scrollSize] + "px";
  4631. };
  4632. _proto.hide = function hide() {
  4633. var _this2 = this;
  4634. if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
  4635. return;
  4636. }
  4637. var startEvent = $.Event(Event$3.HIDE);
  4638. $(this._element).trigger(startEvent);
  4639. if (startEvent.isDefaultPrevented()) {
  4640. return;
  4641. }
  4642. var dimension = this._getDimension();
  4643. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  4644. Util.reflow(this._element);
  4645. $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
  4646. var triggerArrayLength = this._triggerArray.length;
  4647. if (triggerArrayLength > 0) {
  4648. for (var i = 0; i < triggerArrayLength; i++) {
  4649. var trigger = this._triggerArray[i];
  4650. var selector = Util.getSelectorFromElement(trigger);
  4651. if (selector !== null) {
  4652. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  4653. if (!$elem.hasClass(ClassName$3.SHOW)) {
  4654. $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
  4655. }
  4656. }
  4657. }
  4658. }
  4659. this.setTransitioning(true);
  4660. var complete = function complete() {
  4661. _this2.setTransitioning(false);
  4662. $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
  4663. };
  4664. this._element.style[dimension] = '';
  4665. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4666. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4667. };
  4668. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  4669. this._isTransitioning = isTransitioning;
  4670. };
  4671. _proto.dispose = function dispose() {
  4672. $.removeData(this._element, DATA_KEY$3);
  4673. this._config = null;
  4674. this._parent = null;
  4675. this._element = null;
  4676. this._triggerArray = null;
  4677. this._isTransitioning = null;
  4678. } // Private
  4679. ;
  4680. _proto._getConfig = function _getConfig(config) {
  4681. config = _objectSpread({}, Default$1, config);
  4682. config.toggle = Boolean(config.toggle); // Coerce string values
  4683. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  4684. return config;
  4685. };
  4686. _proto._getDimension = function _getDimension() {
  4687. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  4688. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  4689. };
  4690. _proto._getParent = function _getParent() {
  4691. var _this3 = this;
  4692. var parent;
  4693. if (Util.isElement(this._config.parent)) {
  4694. parent = this._config.parent; // It's a jQuery object
  4695. if (typeof this._config.parent.jquery !== 'undefined') {
  4696. parent = this._config.parent[0];
  4697. }
  4698. } else {
  4699. parent = document.querySelector(this._config.parent);
  4700. }
  4701. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  4702. var children = [].slice.call(parent.querySelectorAll(selector));
  4703. $(children).each(function (i, element) {
  4704. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  4705. });
  4706. return parent;
  4707. };
  4708. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  4709. var isOpen = $(element).hasClass(ClassName$3.SHOW);
  4710. if (triggerArray.length) {
  4711. $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  4712. }
  4713. } // Static
  4714. ;
  4715. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  4716. var selector = Util.getSelectorFromElement(element);
  4717. return selector ? document.querySelector(selector) : null;
  4718. };
  4719. Collapse._jQueryInterface = function _jQueryInterface(config) {
  4720. return this.each(function () {
  4721. var $this = $(this);
  4722. var data = $this.data(DATA_KEY$3);
  4723. var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {});
  4724. if (!data && _config.toggle && /show|hide/.test(config)) {
  4725. _config.toggle = false;
  4726. }
  4727. if (!data) {
  4728. data = new Collapse(this, _config);
  4729. $this.data(DATA_KEY$3, data);
  4730. }
  4731. if (typeof config === 'string') {
  4732. if (typeof data[config] === 'undefined') {
  4733. throw new TypeError("No method named \"" + config + "\"");
  4734. }
  4735. data[config]();
  4736. }
  4737. });
  4738. };
  4739. _createClass(Collapse, null, [{
  4740. key: "VERSION",
  4741. get: function get() {
  4742. return VERSION$3;
  4743. }
  4744. }, {
  4745. key: "Default",
  4746. get: function get() {
  4747. return Default$1;
  4748. }
  4749. }]);
  4750. return Collapse;
  4751. }();
  4752. /**
  4753. * ------------------------------------------------------------------------
  4754. * Data Api implementation
  4755. * ------------------------------------------------------------------------
  4756. */
  4757. $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  4758. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  4759. if (event.currentTarget.tagName === 'A') {
  4760. event.preventDefault();
  4761. }
  4762. var $trigger = $(this);
  4763. var selector = Util.getSelectorFromElement(this);
  4764. var selectors = [].slice.call(document.querySelectorAll(selector));
  4765. $(selectors).each(function () {
  4766. var $target = $(this);
  4767. var data = $target.data(DATA_KEY$3);
  4768. var config = data ? 'toggle' : $trigger.data();
  4769. Collapse._jQueryInterface.call($target, config);
  4770. });
  4771. });
  4772. /**
  4773. * ------------------------------------------------------------------------
  4774. * jQuery
  4775. * ------------------------------------------------------------------------
  4776. */
  4777. $.fn[NAME$3] = Collapse._jQueryInterface;
  4778. $.fn[NAME$3].Constructor = Collapse;
  4779. $.fn[NAME$3].noConflict = function () {
  4780. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  4781. return Collapse._jQueryInterface;
  4782. };
  4783. /**
  4784. * ------------------------------------------------------------------------
  4785. * Constants
  4786. * ------------------------------------------------------------------------
  4787. */
  4788. var NAME$4 = 'dropdown';
  4789. var VERSION$4 = '4.3.1';
  4790. var DATA_KEY$4 = 'bs.dropdown';
  4791. var EVENT_KEY$4 = "." + DATA_KEY$4;
  4792. var DATA_API_KEY$4 = '.data-api';
  4793. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  4794. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  4795. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  4796. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  4797. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  4798. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  4799. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  4800. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  4801. var Event$4 = {
  4802. HIDE: "hide" + EVENT_KEY$4,
  4803. HIDDEN: "hidden" + EVENT_KEY$4,
  4804. SHOW: "show" + EVENT_KEY$4,
  4805. SHOWN: "shown" + EVENT_KEY$4,
  4806. CLICK: "click" + EVENT_KEY$4,
  4807. CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  4808. KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  4809. KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  4810. };
  4811. var ClassName$4 = {
  4812. DISABLED: 'disabled',
  4813. SHOW: 'show',
  4814. DROPUP: 'dropup',
  4815. DROPRIGHT: 'dropright',
  4816. DROPLEFT: 'dropleft',
  4817. MENURIGHT: 'dropdown-menu-right',
  4818. MENULEFT: 'dropdown-menu-left',
  4819. POSITION_STATIC: 'position-static'
  4820. };
  4821. var Selector$4 = {
  4822. DATA_TOGGLE: '[data-toggle="dropdown"]',
  4823. FORM_CHILD: '.dropdown form',
  4824. MENU: '.dropdown-menu',
  4825. NAVBAR_NAV: '.navbar-nav',
  4826. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  4827. };
  4828. var AttachmentMap = {
  4829. TOP: 'top-start',
  4830. TOPEND: 'top-end',
  4831. BOTTOM: 'bottom-start',
  4832. BOTTOMEND: 'bottom-end',
  4833. RIGHT: 'right-start',
  4834. RIGHTEND: 'right-end',
  4835. LEFT: 'left-start',
  4836. LEFTEND: 'left-end'
  4837. };
  4838. var Default$2 = {
  4839. offset: 0,
  4840. flip: true,
  4841. boundary: 'scrollParent',
  4842. reference: 'toggle',
  4843. display: 'dynamic'
  4844. };
  4845. var DefaultType$2 = {
  4846. offset: '(number|string|function)',
  4847. flip: 'boolean',
  4848. boundary: '(string|element)',
  4849. reference: '(string|element)',
  4850. display: 'string'
  4851. /**
  4852. * ------------------------------------------------------------------------
  4853. * Class Definition
  4854. * ------------------------------------------------------------------------
  4855. */
  4856. };
  4857. var Dropdown =
  4858. /*#__PURE__*/
  4859. function () {
  4860. function Dropdown(element, config) {
  4861. this._element = element;
  4862. this._popper = null;
  4863. this._config = this._getConfig(config);
  4864. this._menu = this._getMenuElement();
  4865. this._inNavbar = this._detectNavbar();
  4866. this._addEventListeners();
  4867. } // Getters
  4868. var _proto = Dropdown.prototype;
  4869. // Public
  4870. _proto.toggle = function toggle() {
  4871. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
  4872. return;
  4873. }
  4874. var parent = Dropdown._getParentFromElement(this._element);
  4875. var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
  4876. Dropdown._clearMenus();
  4877. if (isActive) {
  4878. return;
  4879. }
  4880. var relatedTarget = {
  4881. relatedTarget: this._element
  4882. };
  4883. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  4884. $(parent).trigger(showEvent);
  4885. if (showEvent.isDefaultPrevented()) {
  4886. return;
  4887. } // Disable totally Popper.js for Dropdown in Navbar
  4888. if (!this._inNavbar) {
  4889. /**
  4890. * Check for Popper dependency
  4891. * Popper - https://popper.js.org
  4892. */
  4893. if (typeof Popper === 'undefined') {
  4894. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  4895. }
  4896. var referenceElement = this._element;
  4897. if (this._config.reference === 'parent') {
  4898. referenceElement = parent;
  4899. } else if (Util.isElement(this._config.reference)) {
  4900. referenceElement = this._config.reference; // Check if it's jQuery element
  4901. if (typeof this._config.reference.jquery !== 'undefined') {
  4902. referenceElement = this._config.reference[0];
  4903. }
  4904. } // If boundary is not `scrollParent`, then set position to `static`
  4905. // to allow the menu to "escape" the scroll parent's boundaries
  4906. // https://github.com/twbs/bootstrap/issues/24251
  4907. if (this._config.boundary !== 'scrollParent') {
  4908. $(parent).addClass(ClassName$4.POSITION_STATIC);
  4909. }
  4910. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  4911. } // If this is a touch-enabled device we add extra
  4912. // empty mouseover listeners to the body's immediate children;
  4913. // only needed because of broken event delegation on iOS
  4914. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4915. if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
  4916. $(document.body).children().on('mouseover', null, $.noop);
  4917. }
  4918. this._element.focus();
  4919. this._element.setAttribute('aria-expanded', true);
  4920. $(this._menu).toggleClass(ClassName$4.SHOW);
  4921. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  4922. };
  4923. _proto.show = function show() {
  4924. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
  4925. return;
  4926. }
  4927. var relatedTarget = {
  4928. relatedTarget: this._element
  4929. };
  4930. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  4931. var parent = Dropdown._getParentFromElement(this._element);
  4932. $(parent).trigger(showEvent);
  4933. if (showEvent.isDefaultPrevented()) {
  4934. return;
  4935. }
  4936. $(this._menu).toggleClass(ClassName$4.SHOW);
  4937. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  4938. };
  4939. _proto.hide = function hide() {
  4940. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
  4941. return;
  4942. }
  4943. var relatedTarget = {
  4944. relatedTarget: this._element
  4945. };
  4946. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  4947. var parent = Dropdown._getParentFromElement(this._element);
  4948. $(parent).trigger(hideEvent);
  4949. if (hideEvent.isDefaultPrevented()) {
  4950. return;
  4951. }
  4952. $(this._menu).toggleClass(ClassName$4.SHOW);
  4953. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  4954. };
  4955. _proto.dispose = function dispose() {
  4956. $.removeData(this._element, DATA_KEY$4);
  4957. $(this._element).off(EVENT_KEY$4);
  4958. this._element = null;
  4959. this._menu = null;
  4960. if (this._popper !== null) {
  4961. this._popper.destroy();
  4962. this._popper = null;
  4963. }
  4964. };
  4965. _proto.update = function update() {
  4966. this._inNavbar = this._detectNavbar();
  4967. if (this._popper !== null) {
  4968. this._popper.scheduleUpdate();
  4969. }
  4970. } // Private
  4971. ;
  4972. _proto._addEventListeners = function _addEventListeners() {
  4973. var _this = this;
  4974. $(this._element).on(Event$4.CLICK, function (event) {
  4975. event.preventDefault();
  4976. event.stopPropagation();
  4977. _this.toggle();
  4978. });
  4979. };
  4980. _proto._getConfig = function _getConfig(config) {
  4981. config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
  4982. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  4983. return config;
  4984. };
  4985. _proto._getMenuElement = function _getMenuElement() {
  4986. if (!this._menu) {
  4987. var parent = Dropdown._getParentFromElement(this._element);
  4988. if (parent) {
  4989. this._menu = parent.querySelector(Selector$4.MENU);
  4990. }
  4991. }
  4992. return this._menu;
  4993. };
  4994. _proto._getPlacement = function _getPlacement() {
  4995. var $parentDropdown = $(this._element.parentNode);
  4996. var placement = AttachmentMap.BOTTOM; // Handle dropup
  4997. if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
  4998. placement = AttachmentMap.TOP;
  4999. if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  5000. placement = AttachmentMap.TOPEND;
  5001. }
  5002. } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
  5003. placement = AttachmentMap.RIGHT;
  5004. } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
  5005. placement = AttachmentMap.LEFT;
  5006. } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  5007. placement = AttachmentMap.BOTTOMEND;
  5008. }
  5009. return placement;
  5010. };
  5011. _proto._detectNavbar = function _detectNavbar() {
  5012. return $(this._element).closest('.navbar').length > 0;
  5013. };
  5014. _proto._getOffset = function _getOffset() {
  5015. var _this2 = this;
  5016. var offset = {};
  5017. if (typeof this._config.offset === 'function') {
  5018. offset.fn = function (data) {
  5019. data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
  5020. return data;
  5021. };
  5022. } else {
  5023. offset.offset = this._config.offset;
  5024. }
  5025. return offset;
  5026. };
  5027. _proto._getPopperConfig = function _getPopperConfig() {
  5028. var popperConfig = {
  5029. placement: this._getPlacement(),
  5030. modifiers: {
  5031. offset: this._getOffset(),
  5032. flip: {
  5033. enabled: this._config.flip
  5034. },
  5035. preventOverflow: {
  5036. boundariesElement: this._config.boundary
  5037. }
  5038. } // Disable Popper.js if we have a static display
  5039. };
  5040. if (this._config.display === 'static') {
  5041. popperConfig.modifiers.applyStyle = {
  5042. enabled: false
  5043. };
  5044. }
  5045. return popperConfig;
  5046. } // Static
  5047. ;
  5048. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  5049. return this.each(function () {
  5050. var data = $(this).data(DATA_KEY$4);
  5051. var _config = typeof config === 'object' ? config : null;
  5052. if (!data) {
  5053. data = new Dropdown(this, _config);
  5054. $(this).data(DATA_KEY$4, data);
  5055. }
  5056. if (typeof config === 'string') {
  5057. if (typeof data[config] === 'undefined') {
  5058. throw new TypeError("No method named \"" + config + "\"");
  5059. }
  5060. data[config]();
  5061. }
  5062. });
  5063. };
  5064. Dropdown._clearMenus = function _clearMenus(event) {
  5065. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  5066. return;
  5067. }
  5068. var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
  5069. for (var i = 0, len = toggles.length; i < len; i++) {
  5070. var parent = Dropdown._getParentFromElement(toggles[i]);
  5071. var context = $(toggles[i]).data(DATA_KEY$4);
  5072. var relatedTarget = {
  5073. relatedTarget: toggles[i]
  5074. };
  5075. if (event && event.type === 'click') {
  5076. relatedTarget.clickEvent = event;
  5077. }
  5078. if (!context) {
  5079. continue;
  5080. }
  5081. var dropdownMenu = context._menu;
  5082. if (!$(parent).hasClass(ClassName$4.SHOW)) {
  5083. continue;
  5084. }
  5085. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  5086. continue;
  5087. }
  5088. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  5089. $(parent).trigger(hideEvent);
  5090. if (hideEvent.isDefaultPrevented()) {
  5091. continue;
  5092. } // If this is a touch-enabled device we remove the extra
  5093. // empty mouseover listeners we added for iOS support
  5094. if ('ontouchstart' in document.documentElement) {
  5095. $(document.body).children().off('mouseover', null, $.noop);
  5096. }
  5097. toggles[i].setAttribute('aria-expanded', 'false');
  5098. $(dropdownMenu).removeClass(ClassName$4.SHOW);
  5099. $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  5100. }
  5101. };
  5102. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  5103. var parent;
  5104. var selector = Util.getSelectorFromElement(element);
  5105. if (selector) {
  5106. parent = document.querySelector(selector);
  5107. }
  5108. return parent || element.parentNode;
  5109. } // eslint-disable-next-line complexity
  5110. ;
  5111. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  5112. // If not input/textarea:
  5113. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  5114. // If input/textarea:
  5115. // - If space key => not a dropdown command
  5116. // - If key is other than escape
  5117. // - If key is not up or down => not a dropdown command
  5118. // - If trigger inside the menu => not a dropdown command
  5119. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  5120. return;
  5121. }
  5122. event.preventDefault();
  5123. event.stopPropagation();
  5124. if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
  5125. return;
  5126. }
  5127. var parent = Dropdown._getParentFromElement(this);
  5128. var isActive = $(parent).hasClass(ClassName$4.SHOW);
  5129. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  5130. if (event.which === ESCAPE_KEYCODE) {
  5131. var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
  5132. $(toggle).trigger('focus');
  5133. }
  5134. $(this).trigger('click');
  5135. return;
  5136. }
  5137. var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS));
  5138. if (items.length === 0) {
  5139. return;
  5140. }
  5141. var index = items.indexOf(event.target);
  5142. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  5143. // Up
  5144. index--;
  5145. }
  5146. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  5147. // Down
  5148. index++;
  5149. }
  5150. if (index < 0) {
  5151. index = 0;
  5152. }
  5153. items[index].focus();
  5154. };
  5155. _createClass(Dropdown, null, [{
  5156. key: "VERSION",
  5157. get: function get() {
  5158. return VERSION$4;
  5159. }
  5160. }, {
  5161. key: "Default",
  5162. get: function get() {
  5163. return Default$2;
  5164. }
  5165. }, {
  5166. key: "DefaultType",
  5167. get: function get() {
  5168. return DefaultType$2;
  5169. }
  5170. }]);
  5171. return Dropdown;
  5172. }();
  5173. /**
  5174. * ------------------------------------------------------------------------
  5175. * Data Api implementation
  5176. * ------------------------------------------------------------------------
  5177. */
  5178. $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  5179. event.preventDefault();
  5180. event.stopPropagation();
  5181. Dropdown._jQueryInterface.call($(this), 'toggle');
  5182. }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  5183. e.stopPropagation();
  5184. });
  5185. /**
  5186. * ------------------------------------------------------------------------
  5187. * jQuery
  5188. * ------------------------------------------------------------------------
  5189. */
  5190. $.fn[NAME$4] = Dropdown._jQueryInterface;
  5191. $.fn[NAME$4].Constructor = Dropdown;
  5192. $.fn[NAME$4].noConflict = function () {
  5193. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  5194. return Dropdown._jQueryInterface;
  5195. };
  5196. /**
  5197. * ------------------------------------------------------------------------
  5198. * Constants
  5199. * ------------------------------------------------------------------------
  5200. */
  5201. var NAME$5 = 'modal';
  5202. var VERSION$5 = '4.3.1';
  5203. var DATA_KEY$5 = 'bs.modal';
  5204. var EVENT_KEY$5 = "." + DATA_KEY$5;
  5205. var DATA_API_KEY$5 = '.data-api';
  5206. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  5207. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  5208. var Default$3 = {
  5209. backdrop: true,
  5210. keyboard: true,
  5211. focus: true,
  5212. show: true
  5213. };
  5214. var DefaultType$3 = {
  5215. backdrop: '(boolean|string)',
  5216. keyboard: 'boolean',
  5217. focus: 'boolean',
  5218. show: 'boolean'
  5219. };
  5220. var Event$5 = {
  5221. HIDE: "hide" + EVENT_KEY$5,
  5222. HIDDEN: "hidden" + EVENT_KEY$5,
  5223. SHOW: "show" + EVENT_KEY$5,
  5224. SHOWN: "shown" + EVENT_KEY$5,
  5225. FOCUSIN: "focusin" + EVENT_KEY$5,
  5226. RESIZE: "resize" + EVENT_KEY$5,
  5227. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  5228. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  5229. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  5230. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  5231. CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  5232. };
  5233. var ClassName$5 = {
  5234. SCROLLABLE: 'modal-dialog-scrollable',
  5235. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  5236. BACKDROP: 'modal-backdrop',
  5237. OPEN: 'modal-open',
  5238. FADE: 'fade',
  5239. SHOW: 'show'
  5240. };
  5241. var Selector$5 = {
  5242. DIALOG: '.modal-dialog',
  5243. MODAL_BODY: '.modal-body',
  5244. DATA_TOGGLE: '[data-toggle="modal"]',
  5245. DATA_DISMISS: '[data-dismiss="modal"]',
  5246. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  5247. STICKY_CONTENT: '.sticky-top'
  5248. /**
  5249. * ------------------------------------------------------------------------
  5250. * Class Definition
  5251. * ------------------------------------------------------------------------
  5252. */
  5253. };
  5254. var Modal =
  5255. /*#__PURE__*/
  5256. function () {
  5257. function Modal(element, config) {
  5258. this._config = this._getConfig(config);
  5259. this._element = element;
  5260. this._dialog = element.querySelector(Selector$5.DIALOG);
  5261. this._backdrop = null;
  5262. this._isShown = false;
  5263. this._isBodyOverflowing = false;
  5264. this._ignoreBackdropClick = false;
  5265. this._isTransitioning = false;
  5266. this._scrollbarWidth = 0;
  5267. } // Getters
  5268. var _proto = Modal.prototype;
  5269. // Public
  5270. _proto.toggle = function toggle(relatedTarget) {
  5271. return this._isShown ? this.hide() : this.show(relatedTarget);
  5272. };
  5273. _proto.show = function show(relatedTarget) {
  5274. var _this = this;
  5275. if (this._isShown || this._isTransitioning) {
  5276. return;
  5277. }
  5278. if ($(this._element).hasClass(ClassName$5.FADE)) {
  5279. this._isTransitioning = true;
  5280. }
  5281. var showEvent = $.Event(Event$5.SHOW, {
  5282. relatedTarget: relatedTarget
  5283. });
  5284. $(this._element).trigger(showEvent);
  5285. if (this._isShown || showEvent.isDefaultPrevented()) {
  5286. return;
  5287. }
  5288. this._isShown = true;
  5289. this._checkScrollbar();
  5290. this._setScrollbar();
  5291. this._adjustDialog();
  5292. this._setEscapeEvent();
  5293. this._setResizeEvent();
  5294. $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
  5295. return _this.hide(event);
  5296. });
  5297. $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
  5298. $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
  5299. if ($(event.target).is(_this._element)) {
  5300. _this._ignoreBackdropClick = true;
  5301. }
  5302. });
  5303. });
  5304. this._showBackdrop(function () {
  5305. return _this._showElement(relatedTarget);
  5306. });
  5307. };
  5308. _proto.hide = function hide(event) {
  5309. var _this2 = this;
  5310. if (event) {
  5311. event.preventDefault();
  5312. }
  5313. if (!this._isShown || this._isTransitioning) {
  5314. return;
  5315. }
  5316. var hideEvent = $.Event(Event$5.HIDE);
  5317. $(this._element).trigger(hideEvent);
  5318. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  5319. return;
  5320. }
  5321. this._isShown = false;
  5322. var transition = $(this._element).hasClass(ClassName$5.FADE);
  5323. if (transition) {
  5324. this._isTransitioning = true;
  5325. }
  5326. this._setEscapeEvent();
  5327. this._setResizeEvent();
  5328. $(document).off(Event$5.FOCUSIN);
  5329. $(this._element).removeClass(ClassName$5.SHOW);
  5330. $(this._element).off(Event$5.CLICK_DISMISS);
  5331. $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
  5332. if (transition) {
  5333. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5334. $(this._element).one(Util.TRANSITION_END, function (event) {
  5335. return _this2._hideModal(event);
  5336. }).emulateTransitionEnd(transitionDuration);
  5337. } else {
  5338. this._hideModal();
  5339. }
  5340. };
  5341. _proto.dispose = function dispose() {
  5342. [window, this._element, this._dialog].forEach(function (htmlElement) {
  5343. return $(htmlElement).off(EVENT_KEY$5);
  5344. });
  5345. /**
  5346. * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
  5347. * Do not move `document` in `htmlElements` array
  5348. * It will remove `Event.CLICK_DATA_API` event that should remain
  5349. */
  5350. $(document).off(Event$5.FOCUSIN);
  5351. $.removeData(this._element, DATA_KEY$5);
  5352. this._config = null;
  5353. this._element = null;
  5354. this._dialog = null;
  5355. this._backdrop = null;
  5356. this._isShown = null;
  5357. this._isBodyOverflowing = null;
  5358. this._ignoreBackdropClick = null;
  5359. this._isTransitioning = null;
  5360. this._scrollbarWidth = null;
  5361. };
  5362. _proto.handleUpdate = function handleUpdate() {
  5363. this._adjustDialog();
  5364. } // Private
  5365. ;
  5366. _proto._getConfig = function _getConfig(config) {
  5367. config = _objectSpread({}, Default$3, config);
  5368. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  5369. return config;
  5370. };
  5371. _proto._showElement = function _showElement(relatedTarget) {
  5372. var _this3 = this;
  5373. var transition = $(this._element).hasClass(ClassName$5.FADE);
  5374. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  5375. // Don't move modal's DOM position
  5376. document.body.appendChild(this._element);
  5377. }
  5378. this._element.style.display = 'block';
  5379. this._element.removeAttribute('aria-hidden');
  5380. this._element.setAttribute('aria-modal', true);
  5381. if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) {
  5382. this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0;
  5383. } else {
  5384. this._element.scrollTop = 0;
  5385. }
  5386. if (transition) {
  5387. Util.reflow(this._element);
  5388. }
  5389. $(this._element).addClass(ClassName$5.SHOW);
  5390. if (this._config.focus) {
  5391. this._enforceFocus();
  5392. }
  5393. var shownEvent = $.Event(Event$5.SHOWN, {
  5394. relatedTarget: relatedTarget
  5395. });
  5396. var transitionComplete = function transitionComplete() {
  5397. if (_this3._config.focus) {
  5398. _this3._element.focus();
  5399. }
  5400. _this3._isTransitioning = false;
  5401. $(_this3._element).trigger(shownEvent);
  5402. };
  5403. if (transition) {
  5404. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  5405. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  5406. } else {
  5407. transitionComplete();
  5408. }
  5409. };
  5410. _proto._enforceFocus = function _enforceFocus() {
  5411. var _this4 = this;
  5412. $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
  5413. .on(Event$5.FOCUSIN, function (event) {
  5414. if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
  5415. _this4._element.focus();
  5416. }
  5417. });
  5418. };
  5419. _proto._setEscapeEvent = function _setEscapeEvent() {
  5420. var _this5 = this;
  5421. if (this._isShown && this._config.keyboard) {
  5422. $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
  5423. if (event.which === ESCAPE_KEYCODE$1) {
  5424. event.preventDefault();
  5425. _this5.hide();
  5426. }
  5427. });
  5428. } else if (!this._isShown) {
  5429. $(this._element).off(Event$5.KEYDOWN_DISMISS);
  5430. }
  5431. };
  5432. _proto._setResizeEvent = function _setResizeEvent() {
  5433. var _this6 = this;
  5434. if (this._isShown) {
  5435. $(window).on(Event$5.RESIZE, function (event) {
  5436. return _this6.handleUpdate(event);
  5437. });
  5438. } else {
  5439. $(window).off(Event$5.RESIZE);
  5440. }
  5441. };
  5442. _proto._hideModal = function _hideModal() {
  5443. var _this7 = this;
  5444. this._element.style.display = 'none';
  5445. this._element.setAttribute('aria-hidden', true);
  5446. this._element.removeAttribute('aria-modal');
  5447. this._isTransitioning = false;
  5448. this._showBackdrop(function () {
  5449. $(document.body).removeClass(ClassName$5.OPEN);
  5450. _this7._resetAdjustments();
  5451. _this7._resetScrollbar();
  5452. $(_this7._element).trigger(Event$5.HIDDEN);
  5453. });
  5454. };
  5455. _proto._removeBackdrop = function _removeBackdrop() {
  5456. if (this._backdrop) {
  5457. $(this._backdrop).remove();
  5458. this._backdrop = null;
  5459. }
  5460. };
  5461. _proto._showBackdrop = function _showBackdrop(callback) {
  5462. var _this8 = this;
  5463. var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
  5464. if (this._isShown && this._config.backdrop) {
  5465. this._backdrop = document.createElement('div');
  5466. this._backdrop.className = ClassName$5.BACKDROP;
  5467. if (animate) {
  5468. this._backdrop.classList.add(animate);
  5469. }
  5470. $(this._backdrop).appendTo(document.body);
  5471. $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
  5472. if (_this8._ignoreBackdropClick) {
  5473. _this8._ignoreBackdropClick = false;
  5474. return;
  5475. }
  5476. if (event.target !== event.currentTarget) {
  5477. return;
  5478. }
  5479. if (_this8._config.backdrop === 'static') {
  5480. _this8._element.focus();
  5481. } else {
  5482. _this8.hide();
  5483. }
  5484. });
  5485. if (animate) {
  5486. Util.reflow(this._backdrop);
  5487. }
  5488. $(this._backdrop).addClass(ClassName$5.SHOW);
  5489. if (!callback) {
  5490. return;
  5491. }
  5492. if (!animate) {
  5493. callback();
  5494. return;
  5495. }
  5496. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  5497. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  5498. } else if (!this._isShown && this._backdrop) {
  5499. $(this._backdrop).removeClass(ClassName$5.SHOW);
  5500. var callbackRemove = function callbackRemove() {
  5501. _this8._removeBackdrop();
  5502. if (callback) {
  5503. callback();
  5504. }
  5505. };
  5506. if ($(this._element).hasClass(ClassName$5.FADE)) {
  5507. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  5508. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  5509. } else {
  5510. callbackRemove();
  5511. }
  5512. } else if (callback) {
  5513. callback();
  5514. }
  5515. } // ----------------------------------------------------------------------
  5516. // the following methods are used to handle overflowing modals
  5517. // todo (fat): these should probably be refactored out of modal.js
  5518. // ----------------------------------------------------------------------
  5519. ;
  5520. _proto._adjustDialog = function _adjustDialog() {
  5521. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  5522. if (!this._isBodyOverflowing && isModalOverflowing) {
  5523. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  5524. }
  5525. if (this._isBodyOverflowing && !isModalOverflowing) {
  5526. this._element.style.paddingRight = this._scrollbarWidth + "px";
  5527. }
  5528. };
  5529. _proto._resetAdjustments = function _resetAdjustments() {
  5530. this._element.style.paddingLeft = '';
  5531. this._element.style.paddingRight = '';
  5532. };
  5533. _proto._checkScrollbar = function _checkScrollbar() {
  5534. var rect = document.body.getBoundingClientRect();
  5535. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  5536. this._scrollbarWidth = this._getScrollbarWidth();
  5537. };
  5538. _proto._setScrollbar = function _setScrollbar() {
  5539. var _this9 = this;
  5540. if (this._isBodyOverflowing) {
  5541. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  5542. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  5543. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  5544. var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
  5545. $(fixedContent).each(function (index, element) {
  5546. var actualPadding = element.style.paddingRight;
  5547. var calculatedPadding = $(element).css('padding-right');
  5548. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
  5549. }); // Adjust sticky content margin
  5550. $(stickyContent).each(function (index, element) {
  5551. var actualMargin = element.style.marginRight;
  5552. var calculatedMargin = $(element).css('margin-right');
  5553. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
  5554. }); // Adjust body padding
  5555. var actualPadding = document.body.style.paddingRight;
  5556. var calculatedPadding = $(document.body).css('padding-right');
  5557. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  5558. }
  5559. $(document.body).addClass(ClassName$5.OPEN);
  5560. };
  5561. _proto._resetScrollbar = function _resetScrollbar() {
  5562. // Restore fixed content padding
  5563. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  5564. $(fixedContent).each(function (index, element) {
  5565. var padding = $(element).data('padding-right');
  5566. $(element).removeData('padding-right');
  5567. element.style.paddingRight = padding ? padding : '';
  5568. }); // Restore sticky content
  5569. var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
  5570. $(elements).each(function (index, element) {
  5571. var margin = $(element).data('margin-right');
  5572. if (typeof margin !== 'undefined') {
  5573. $(element).css('margin-right', margin).removeData('margin-right');
  5574. }
  5575. }); // Restore body padding
  5576. var padding = $(document.body).data('padding-right');
  5577. $(document.body).removeData('padding-right');
  5578. document.body.style.paddingRight = padding ? padding : '';
  5579. };
  5580. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  5581. // thx d.walsh
  5582. var scrollDiv = document.createElement('div');
  5583. scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
  5584. document.body.appendChild(scrollDiv);
  5585. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  5586. document.body.removeChild(scrollDiv);
  5587. return scrollbarWidth;
  5588. } // Static
  5589. ;
  5590. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  5591. return this.each(function () {
  5592. var data = $(this).data(DATA_KEY$5);
  5593. var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {});
  5594. if (!data) {
  5595. data = new Modal(this, _config);
  5596. $(this).data(DATA_KEY$5, data);
  5597. }
  5598. if (typeof config === 'string') {
  5599. if (typeof data[config] === 'undefined') {
  5600. throw new TypeError("No method named \"" + config + "\"");
  5601. }
  5602. data[config](relatedTarget);
  5603. } else if (_config.show) {
  5604. data.show(relatedTarget);
  5605. }
  5606. });
  5607. };
  5608. _createClass(Modal, null, [{
  5609. key: "VERSION",
  5610. get: function get() {
  5611. return VERSION$5;
  5612. }
  5613. }, {
  5614. key: "Default",
  5615. get: function get() {
  5616. return Default$3;
  5617. }
  5618. }]);
  5619. return Modal;
  5620. }();
  5621. /**
  5622. * ------------------------------------------------------------------------
  5623. * Data Api implementation
  5624. * ------------------------------------------------------------------------
  5625. */
  5626. $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
  5627. var _this10 = this;
  5628. var target;
  5629. var selector = Util.getSelectorFromElement(this);
  5630. if (selector) {
  5631. target = document.querySelector(selector);
  5632. }
  5633. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
  5634. if (this.tagName === 'A' || this.tagName === 'AREA') {
  5635. event.preventDefault();
  5636. }
  5637. var $target = $(target).one(Event$5.SHOW, function (showEvent) {
  5638. if (showEvent.isDefaultPrevented()) {
  5639. // Only register focus restorer if modal will actually get shown
  5640. return;
  5641. }
  5642. $target.one(Event$5.HIDDEN, function () {
  5643. if ($(_this10).is(':visible')) {
  5644. _this10.focus();
  5645. }
  5646. });
  5647. });
  5648. Modal._jQueryInterface.call($(target), config, this);
  5649. });
  5650. /**
  5651. * ------------------------------------------------------------------------
  5652. * jQuery
  5653. * ------------------------------------------------------------------------
  5654. */
  5655. $.fn[NAME$5] = Modal._jQueryInterface;
  5656. $.fn[NAME$5].Constructor = Modal;
  5657. $.fn[NAME$5].noConflict = function () {
  5658. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  5659. return Modal._jQueryInterface;
  5660. };
  5661. /**
  5662. * --------------------------------------------------------------------------
  5663. * Bootstrap (v4.3.1): tools/sanitizer.js
  5664. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5665. * --------------------------------------------------------------------------
  5666. */
  5667. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  5668. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  5669. var DefaultWhitelist = {
  5670. // Global attributes allowed on any supplied element below.
  5671. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  5672. a: ['target', 'href', 'title', 'rel'],
  5673. area: [],
  5674. b: [],
  5675. br: [],
  5676. col: [],
  5677. code: [],
  5678. div: [],
  5679. em: [],
  5680. hr: [],
  5681. h1: [],
  5682. h2: [],
  5683. h3: [],
  5684. h4: [],
  5685. h5: [],
  5686. h6: [],
  5687. i: [],
  5688. img: ['src', 'alt', 'title', 'width', 'height'],
  5689. li: [],
  5690. ol: [],
  5691. p: [],
  5692. pre: [],
  5693. s: [],
  5694. small: [],
  5695. span: [],
  5696. sub: [],
  5697. sup: [],
  5698. strong: [],
  5699. u: [],
  5700. ul: []
  5701. /**
  5702. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  5703. *
  5704. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  5705. */
  5706. };
  5707. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  5708. /**
  5709. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  5710. *
  5711. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  5712. */
  5713. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
  5714. function allowedAttribute(attr, allowedAttributeList) {
  5715. var attrName = attr.nodeName.toLowerCase();
  5716. if (allowedAttributeList.indexOf(attrName) !== -1) {
  5717. if (uriAttrs.indexOf(attrName) !== -1) {
  5718. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  5719. }
  5720. return true;
  5721. }
  5722. var regExp = allowedAttributeList.filter(function (attrRegex) {
  5723. return attrRegex instanceof RegExp;
  5724. }); // Check if a regular expression validates the attribute.
  5725. for (var i = 0, l = regExp.length; i < l; i++) {
  5726. if (attrName.match(regExp[i])) {
  5727. return true;
  5728. }
  5729. }
  5730. return false;
  5731. }
  5732. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  5733. if (unsafeHtml.length === 0) {
  5734. return unsafeHtml;
  5735. }
  5736. if (sanitizeFn && typeof sanitizeFn === 'function') {
  5737. return sanitizeFn(unsafeHtml);
  5738. }
  5739. var domParser = new window.DOMParser();
  5740. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  5741. var whitelistKeys = Object.keys(whiteList);
  5742. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  5743. var _loop = function _loop(i, len) {
  5744. var el = elements[i];
  5745. var elName = el.nodeName.toLowerCase();
  5746. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  5747. el.parentNode.removeChild(el);
  5748. return "continue";
  5749. }
  5750. var attributeList = [].slice.call(el.attributes);
  5751. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  5752. attributeList.forEach(function (attr) {
  5753. if (!allowedAttribute(attr, whitelistedAttributes)) {
  5754. el.removeAttribute(attr.nodeName);
  5755. }
  5756. });
  5757. };
  5758. for (var i = 0, len = elements.length; i < len; i++) {
  5759. var _ret = _loop(i, len);
  5760. if (_ret === "continue") continue;
  5761. }
  5762. return createdDocument.body.innerHTML;
  5763. }
  5764. /**
  5765. * ------------------------------------------------------------------------
  5766. * Constants
  5767. * ------------------------------------------------------------------------
  5768. */
  5769. var NAME$6 = 'tooltip';
  5770. var VERSION$6 = '4.3.1';
  5771. var DATA_KEY$6 = 'bs.tooltip';
  5772. var EVENT_KEY$6 = "." + DATA_KEY$6;
  5773. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  5774. var CLASS_PREFIX = 'bs-tooltip';
  5775. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  5776. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  5777. var DefaultType$4 = {
  5778. animation: 'boolean',
  5779. template: 'string',
  5780. title: '(string|element|function)',
  5781. trigger: 'string',
  5782. delay: '(number|object)',
  5783. html: 'boolean',
  5784. selector: '(string|boolean)',
  5785. placement: '(string|function)',
  5786. offset: '(number|string|function)',
  5787. container: '(string|element|boolean)',
  5788. fallbackPlacement: '(string|array)',
  5789. boundary: '(string|element)',
  5790. sanitize: 'boolean',
  5791. sanitizeFn: '(null|function)',
  5792. whiteList: 'object'
  5793. };
  5794. var AttachmentMap$1 = {
  5795. AUTO: 'auto',
  5796. TOP: 'top',
  5797. RIGHT: 'right',
  5798. BOTTOM: 'bottom',
  5799. LEFT: 'left'
  5800. };
  5801. var Default$4 = {
  5802. animation: true,
  5803. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  5804. trigger: 'hover focus',
  5805. title: '',
  5806. delay: 0,
  5807. html: false,
  5808. selector: false,
  5809. placement: 'top',
  5810. offset: 0,
  5811. container: false,
  5812. fallbackPlacement: 'flip',
  5813. boundary: 'scrollParent',
  5814. sanitize: true,
  5815. sanitizeFn: null,
  5816. whiteList: DefaultWhitelist
  5817. };
  5818. var HoverState = {
  5819. SHOW: 'show',
  5820. OUT: 'out'
  5821. };
  5822. var Event$6 = {
  5823. HIDE: "hide" + EVENT_KEY$6,
  5824. HIDDEN: "hidden" + EVENT_KEY$6,
  5825. SHOW: "show" + EVENT_KEY$6,
  5826. SHOWN: "shown" + EVENT_KEY$6,
  5827. INSERTED: "inserted" + EVENT_KEY$6,
  5828. CLICK: "click" + EVENT_KEY$6,
  5829. FOCUSIN: "focusin" + EVENT_KEY$6,
  5830. FOCUSOUT: "focusout" + EVENT_KEY$6,
  5831. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  5832. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  5833. };
  5834. var ClassName$6 = {
  5835. FADE: 'fade',
  5836. SHOW: 'show'
  5837. };
  5838. var Selector$6 = {
  5839. TOOLTIP: '.tooltip',
  5840. TOOLTIP_INNER: '.tooltip-inner',
  5841. ARROW: '.arrow'
  5842. };
  5843. var Trigger = {
  5844. HOVER: 'hover',
  5845. FOCUS: 'focus',
  5846. CLICK: 'click',
  5847. MANUAL: 'manual'
  5848. /**
  5849. * ------------------------------------------------------------------------
  5850. * Class Definition
  5851. * ------------------------------------------------------------------------
  5852. */
  5853. };
  5854. var Tooltip =
  5855. /*#__PURE__*/
  5856. function () {
  5857. function Tooltip(element, config) {
  5858. /**
  5859. * Check for Popper dependency
  5860. * Popper - https://popper.js.org
  5861. */
  5862. if (typeof Popper === 'undefined') {
  5863. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  5864. } // private
  5865. this._isEnabled = true;
  5866. this._timeout = 0;
  5867. this._hoverState = '';
  5868. this._activeTrigger = {};
  5869. this._popper = null; // Protected
  5870. this.element = element;
  5871. this.config = this._getConfig(config);
  5872. this.tip = null;
  5873. this._setListeners();
  5874. } // Getters
  5875. var _proto = Tooltip.prototype;
  5876. // Public
  5877. _proto.enable = function enable() {
  5878. this._isEnabled = true;
  5879. };
  5880. _proto.disable = function disable() {
  5881. this._isEnabled = false;
  5882. };
  5883. _proto.toggleEnabled = function toggleEnabled() {
  5884. this._isEnabled = !this._isEnabled;
  5885. };
  5886. _proto.toggle = function toggle(event) {
  5887. if (!this._isEnabled) {
  5888. return;
  5889. }
  5890. if (event) {
  5891. var dataKey = this.constructor.DATA_KEY;
  5892. var context = $(event.currentTarget).data(dataKey);
  5893. if (!context) {
  5894. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  5895. $(event.currentTarget).data(dataKey, context);
  5896. }
  5897. context._activeTrigger.click = !context._activeTrigger.click;
  5898. if (context._isWithActiveTrigger()) {
  5899. context._enter(null, context);
  5900. } else {
  5901. context._leave(null, context);
  5902. }
  5903. } else {
  5904. if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
  5905. this._leave(null, this);
  5906. return;
  5907. }
  5908. this._enter(null, this);
  5909. }
  5910. };
  5911. _proto.dispose = function dispose() {
  5912. clearTimeout(this._timeout);
  5913. $.removeData(this.element, this.constructor.DATA_KEY);
  5914. $(this.element).off(this.constructor.EVENT_KEY);
  5915. $(this.element).closest('.modal').off('hide.bs.modal');
  5916. if (this.tip) {
  5917. $(this.tip).remove();
  5918. }
  5919. this._isEnabled = null;
  5920. this._timeout = null;
  5921. this._hoverState = null;
  5922. this._activeTrigger = null;
  5923. if (this._popper !== null) {
  5924. this._popper.destroy();
  5925. }
  5926. this._popper = null;
  5927. this.element = null;
  5928. this.config = null;
  5929. this.tip = null;
  5930. };
  5931. _proto.show = function show() {
  5932. var _this = this;
  5933. if ($(this.element).css('display') === 'none') {
  5934. throw new Error('Please use show on visible elements');
  5935. }
  5936. var showEvent = $.Event(this.constructor.Event.SHOW);
  5937. if (this.isWithContent() && this._isEnabled) {
  5938. $(this.element).trigger(showEvent);
  5939. var shadowRoot = Util.findShadowRoot(this.element);
  5940. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  5941. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  5942. return;
  5943. }
  5944. var tip = this.getTipElement();
  5945. var tipId = Util.getUID(this.constructor.NAME);
  5946. tip.setAttribute('id', tipId);
  5947. this.element.setAttribute('aria-describedby', tipId);
  5948. this.setContent();
  5949. if (this.config.animation) {
  5950. $(tip).addClass(ClassName$6.FADE);
  5951. }
  5952. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  5953. var attachment = this._getAttachment(placement);
  5954. this.addAttachmentClass(attachment);
  5955. var container = this._getContainer();
  5956. $(tip).data(this.constructor.DATA_KEY, this);
  5957. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  5958. $(tip).appendTo(container);
  5959. }
  5960. $(this.element).trigger(this.constructor.Event.INSERTED);
  5961. this._popper = new Popper(this.element, tip, {
  5962. placement: attachment,
  5963. modifiers: {
  5964. offset: this._getOffset(),
  5965. flip: {
  5966. behavior: this.config.fallbackPlacement
  5967. },
  5968. arrow: {
  5969. element: Selector$6.ARROW
  5970. },
  5971. preventOverflow: {
  5972. boundariesElement: this.config.boundary
  5973. }
  5974. },
  5975. onCreate: function onCreate(data) {
  5976. if (data.originalPlacement !== data.placement) {
  5977. _this._handlePopperPlacementChange(data);
  5978. }
  5979. },
  5980. onUpdate: function onUpdate(data) {
  5981. return _this._handlePopperPlacementChange(data);
  5982. }
  5983. });
  5984. $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
  5985. // empty mouseover listeners to the body's immediate children;
  5986. // only needed because of broken event delegation on iOS
  5987. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  5988. if ('ontouchstart' in document.documentElement) {
  5989. $(document.body).children().on('mouseover', null, $.noop);
  5990. }
  5991. var complete = function complete() {
  5992. if (_this.config.animation) {
  5993. _this._fixTransition();
  5994. }
  5995. var prevHoverState = _this._hoverState;
  5996. _this._hoverState = null;
  5997. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  5998. if (prevHoverState === HoverState.OUT) {
  5999. _this._leave(null, _this);
  6000. }
  6001. };
  6002. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  6003. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  6004. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6005. } else {
  6006. complete();
  6007. }
  6008. }
  6009. };
  6010. _proto.hide = function hide(callback) {
  6011. var _this2 = this;
  6012. var tip = this.getTipElement();
  6013. var hideEvent = $.Event(this.constructor.Event.HIDE);
  6014. var complete = function complete() {
  6015. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  6016. tip.parentNode.removeChild(tip);
  6017. }
  6018. _this2._cleanTipClass();
  6019. _this2.element.removeAttribute('aria-describedby');
  6020. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  6021. if (_this2._popper !== null) {
  6022. _this2._popper.destroy();
  6023. }
  6024. if (callback) {
  6025. callback();
  6026. }
  6027. };
  6028. $(this.element).trigger(hideEvent);
  6029. if (hideEvent.isDefaultPrevented()) {
  6030. return;
  6031. }
  6032. $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
  6033. // empty mouseover listeners we added for iOS support
  6034. if ('ontouchstart' in document.documentElement) {
  6035. $(document.body).children().off('mouseover', null, $.noop);
  6036. }
  6037. this._activeTrigger[Trigger.CLICK] = false;
  6038. this._activeTrigger[Trigger.FOCUS] = false;
  6039. this._activeTrigger[Trigger.HOVER] = false;
  6040. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  6041. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  6042. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6043. } else {
  6044. complete();
  6045. }
  6046. this._hoverState = '';
  6047. };
  6048. _proto.update = function update() {
  6049. if (this._popper !== null) {
  6050. this._popper.scheduleUpdate();
  6051. }
  6052. } // Protected
  6053. ;
  6054. _proto.isWithContent = function isWithContent() {
  6055. return Boolean(this.getTitle());
  6056. };
  6057. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  6058. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  6059. };
  6060. _proto.getTipElement = function getTipElement() {
  6061. this.tip = this.tip || $(this.config.template)[0];
  6062. return this.tip;
  6063. };
  6064. _proto.setContent = function setContent() {
  6065. var tip = this.getTipElement();
  6066. this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
  6067. $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
  6068. };
  6069. _proto.setElementContent = function setElementContent($element, content) {
  6070. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  6071. // Content is a DOM node or a jQuery
  6072. if (this.config.html) {
  6073. if (!$(content).parent().is($element)) {
  6074. $element.empty().append(content);
  6075. }
  6076. } else {
  6077. $element.text($(content).text());
  6078. }
  6079. return;
  6080. }
  6081. if (this.config.html) {
  6082. if (this.config.sanitize) {
  6083. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  6084. }
  6085. $element.html(content);
  6086. } else {
  6087. $element.text(content);
  6088. }
  6089. };
  6090. _proto.getTitle = function getTitle() {
  6091. var title = this.element.getAttribute('data-original-title');
  6092. if (!title) {
  6093. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  6094. }
  6095. return title;
  6096. } // Private
  6097. ;
  6098. _proto._getOffset = function _getOffset() {
  6099. var _this3 = this;
  6100. var offset = {};
  6101. if (typeof this.config.offset === 'function') {
  6102. offset.fn = function (data) {
  6103. data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
  6104. return data;
  6105. };
  6106. } else {
  6107. offset.offset = this.config.offset;
  6108. }
  6109. return offset;
  6110. };
  6111. _proto._getContainer = function _getContainer() {
  6112. if (this.config.container === false) {
  6113. return document.body;
  6114. }
  6115. if (Util.isElement(this.config.container)) {
  6116. return $(this.config.container);
  6117. }
  6118. return $(document).find(this.config.container);
  6119. };
  6120. _proto._getAttachment = function _getAttachment(placement) {
  6121. return AttachmentMap$1[placement.toUpperCase()];
  6122. };
  6123. _proto._setListeners = function _setListeners() {
  6124. var _this4 = this;
  6125. var triggers = this.config.trigger.split(' ');
  6126. triggers.forEach(function (trigger) {
  6127. if (trigger === 'click') {
  6128. $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
  6129. return _this4.toggle(event);
  6130. });
  6131. } else if (trigger !== Trigger.MANUAL) {
  6132. var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
  6133. var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
  6134. $(_this4.element).on(eventIn, _this4.config.selector, function (event) {
  6135. return _this4._enter(event);
  6136. }).on(eventOut, _this4.config.selector, function (event) {
  6137. return _this4._leave(event);
  6138. });
  6139. }
  6140. });
  6141. $(this.element).closest('.modal').on('hide.bs.modal', function () {
  6142. if (_this4.element) {
  6143. _this4.hide();
  6144. }
  6145. });
  6146. if (this.config.selector) {
  6147. this.config = _objectSpread({}, this.config, {
  6148. trigger: 'manual',
  6149. selector: ''
  6150. });
  6151. } else {
  6152. this._fixTitle();
  6153. }
  6154. };
  6155. _proto._fixTitle = function _fixTitle() {
  6156. var titleType = typeof this.element.getAttribute('data-original-title');
  6157. if (this.element.getAttribute('title') || titleType !== 'string') {
  6158. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  6159. this.element.setAttribute('title', '');
  6160. }
  6161. };
  6162. _proto._enter = function _enter(event, context) {
  6163. var dataKey = this.constructor.DATA_KEY;
  6164. context = context || $(event.currentTarget).data(dataKey);
  6165. if (!context) {
  6166. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  6167. $(event.currentTarget).data(dataKey, context);
  6168. }
  6169. if (event) {
  6170. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  6171. }
  6172. if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
  6173. context._hoverState = HoverState.SHOW;
  6174. return;
  6175. }
  6176. clearTimeout(context._timeout);
  6177. context._hoverState = HoverState.SHOW;
  6178. if (!context.config.delay || !context.config.delay.show) {
  6179. context.show();
  6180. return;
  6181. }
  6182. context._timeout = setTimeout(function () {
  6183. if (context._hoverState === HoverState.SHOW) {
  6184. context.show();
  6185. }
  6186. }, context.config.delay.show);
  6187. };
  6188. _proto._leave = function _leave(event, context) {
  6189. var dataKey = this.constructor.DATA_KEY;
  6190. context = context || $(event.currentTarget).data(dataKey);
  6191. if (!context) {
  6192. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  6193. $(event.currentTarget).data(dataKey, context);
  6194. }
  6195. if (event) {
  6196. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  6197. }
  6198. if (context._isWithActiveTrigger()) {
  6199. return;
  6200. }
  6201. clearTimeout(context._timeout);
  6202. context._hoverState = HoverState.OUT;
  6203. if (!context.config.delay || !context.config.delay.hide) {
  6204. context.hide();
  6205. return;
  6206. }
  6207. context._timeout = setTimeout(function () {
  6208. if (context._hoverState === HoverState.OUT) {
  6209. context.hide();
  6210. }
  6211. }, context.config.delay.hide);
  6212. };
  6213. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  6214. for (var trigger in this._activeTrigger) {
  6215. if (this._activeTrigger[trigger]) {
  6216. return true;
  6217. }
  6218. }
  6219. return false;
  6220. };
  6221. _proto._getConfig = function _getConfig(config) {
  6222. var dataAttributes = $(this.element).data();
  6223. Object.keys(dataAttributes).forEach(function (dataAttr) {
  6224. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  6225. delete dataAttributes[dataAttr];
  6226. }
  6227. });
  6228. config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
  6229. if (typeof config.delay === 'number') {
  6230. config.delay = {
  6231. show: config.delay,
  6232. hide: config.delay
  6233. };
  6234. }
  6235. if (typeof config.title === 'number') {
  6236. config.title = config.title.toString();
  6237. }
  6238. if (typeof config.content === 'number') {
  6239. config.content = config.content.toString();
  6240. }
  6241. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  6242. if (config.sanitize) {
  6243. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  6244. }
  6245. return config;
  6246. };
  6247. _proto._getDelegateConfig = function _getDelegateConfig() {
  6248. var config = {};
  6249. if (this.config) {
  6250. for (var key in this.config) {
  6251. if (this.constructor.Default[key] !== this.config[key]) {
  6252. config[key] = this.config[key];
  6253. }
  6254. }
  6255. }
  6256. return config;
  6257. };
  6258. _proto._cleanTipClass = function _cleanTipClass() {
  6259. var $tip = $(this.getTipElement());
  6260. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  6261. if (tabClass !== null && tabClass.length) {
  6262. $tip.removeClass(tabClass.join(''));
  6263. }
  6264. };
  6265. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  6266. var popperInstance = popperData.instance;
  6267. this.tip = popperInstance.popper;
  6268. this._cleanTipClass();
  6269. this.addAttachmentClass(this._getAttachment(popperData.placement));
  6270. };
  6271. _proto._fixTransition = function _fixTransition() {
  6272. var tip = this.getTipElement();
  6273. var initConfigAnimation = this.config.animation;
  6274. if (tip.getAttribute('x-placement') !== null) {
  6275. return;
  6276. }
  6277. $(tip).removeClass(ClassName$6.FADE);
  6278. this.config.animation = false;
  6279. this.hide();
  6280. this.show();
  6281. this.config.animation = initConfigAnimation;
  6282. } // Static
  6283. ;
  6284. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  6285. return this.each(function () {
  6286. var data = $(this).data(DATA_KEY$6);
  6287. var _config = typeof config === 'object' && config;
  6288. if (!data && /dispose|hide/.test(config)) {
  6289. return;
  6290. }
  6291. if (!data) {
  6292. data = new Tooltip(this, _config);
  6293. $(this).data(DATA_KEY$6, data);
  6294. }
  6295. if (typeof config === 'string') {
  6296. if (typeof data[config] === 'undefined') {
  6297. throw new TypeError("No method named \"" + config + "\"");
  6298. }
  6299. data[config]();
  6300. }
  6301. });
  6302. };
  6303. _createClass(Tooltip, null, [{
  6304. key: "VERSION",
  6305. get: function get() {
  6306. return VERSION$6;
  6307. }
  6308. }, {
  6309. key: "Default",
  6310. get: function get() {
  6311. return Default$4;
  6312. }
  6313. }, {
  6314. key: "NAME",
  6315. get: function get() {
  6316. return NAME$6;
  6317. }
  6318. }, {
  6319. key: "DATA_KEY",
  6320. get: function get() {
  6321. return DATA_KEY$6;
  6322. }
  6323. }, {
  6324. key: "Event",
  6325. get: function get() {
  6326. return Event$6;
  6327. }
  6328. }, {
  6329. key: "EVENT_KEY",
  6330. get: function get() {
  6331. return EVENT_KEY$6;
  6332. }
  6333. }, {
  6334. key: "DefaultType",
  6335. get: function get() {
  6336. return DefaultType$4;
  6337. }
  6338. }]);
  6339. return Tooltip;
  6340. }();
  6341. /**
  6342. * ------------------------------------------------------------------------
  6343. * jQuery
  6344. * ------------------------------------------------------------------------
  6345. */
  6346. $.fn[NAME$6] = Tooltip._jQueryInterface;
  6347. $.fn[NAME$6].Constructor = Tooltip;
  6348. $.fn[NAME$6].noConflict = function () {
  6349. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  6350. return Tooltip._jQueryInterface;
  6351. };
  6352. /**
  6353. * ------------------------------------------------------------------------
  6354. * Constants
  6355. * ------------------------------------------------------------------------
  6356. */
  6357. var NAME$7 = 'popover';
  6358. var VERSION$7 = '4.3.1';
  6359. var DATA_KEY$7 = 'bs.popover';
  6360. var EVENT_KEY$7 = "." + DATA_KEY$7;
  6361. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  6362. var CLASS_PREFIX$1 = 'bs-popover';
  6363. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  6364. var Default$5 = _objectSpread({}, Tooltip.Default, {
  6365. placement: 'right',
  6366. trigger: 'click',
  6367. content: '',
  6368. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  6369. });
  6370. var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {
  6371. content: '(string|element|function)'
  6372. });
  6373. var ClassName$7 = {
  6374. FADE: 'fade',
  6375. SHOW: 'show'
  6376. };
  6377. var Selector$7 = {
  6378. TITLE: '.popover-header',
  6379. CONTENT: '.popover-body'
  6380. };
  6381. var Event$7 = {
  6382. HIDE: "hide" + EVENT_KEY$7,
  6383. HIDDEN: "hidden" + EVENT_KEY$7,
  6384. SHOW: "show" + EVENT_KEY$7,
  6385. SHOWN: "shown" + EVENT_KEY$7,
  6386. INSERTED: "inserted" + EVENT_KEY$7,
  6387. CLICK: "click" + EVENT_KEY$7,
  6388. FOCUSIN: "focusin" + EVENT_KEY$7,
  6389. FOCUSOUT: "focusout" + EVENT_KEY$7,
  6390. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  6391. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  6392. /**
  6393. * ------------------------------------------------------------------------
  6394. * Class Definition
  6395. * ------------------------------------------------------------------------
  6396. */
  6397. };
  6398. var Popover =
  6399. /*#__PURE__*/
  6400. function (_Tooltip) {
  6401. _inheritsLoose(Popover, _Tooltip);
  6402. function Popover() {
  6403. return _Tooltip.apply(this, arguments) || this;
  6404. }
  6405. var _proto = Popover.prototype;
  6406. // Overrides
  6407. _proto.isWithContent = function isWithContent() {
  6408. return this.getTitle() || this._getContent();
  6409. };
  6410. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  6411. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  6412. };
  6413. _proto.getTipElement = function getTipElement() {
  6414. this.tip = this.tip || $(this.config.template)[0];
  6415. return this.tip;
  6416. };
  6417. _proto.setContent = function setContent() {
  6418. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  6419. this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
  6420. var content = this._getContent();
  6421. if (typeof content === 'function') {
  6422. content = content.call(this.element);
  6423. }
  6424. this.setElementContent($tip.find(Selector$7.CONTENT), content);
  6425. $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
  6426. } // Private
  6427. ;
  6428. _proto._getContent = function _getContent() {
  6429. return this.element.getAttribute('data-content') || this.config.content;
  6430. };
  6431. _proto._cleanTipClass = function _cleanTipClass() {
  6432. var $tip = $(this.getTipElement());
  6433. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  6434. if (tabClass !== null && tabClass.length > 0) {
  6435. $tip.removeClass(tabClass.join(''));
  6436. }
  6437. } // Static
  6438. ;
  6439. Popover._jQueryInterface = function _jQueryInterface(config) {
  6440. return this.each(function () {
  6441. var data = $(this).data(DATA_KEY$7);
  6442. var _config = typeof config === 'object' ? config : null;
  6443. if (!data && /dispose|hide/.test(config)) {
  6444. return;
  6445. }
  6446. if (!data) {
  6447. data = new Popover(this, _config);
  6448. $(this).data(DATA_KEY$7, data);
  6449. }
  6450. if (typeof config === 'string') {
  6451. if (typeof data[config] === 'undefined') {
  6452. throw new TypeError("No method named \"" + config + "\"");
  6453. }
  6454. data[config]();
  6455. }
  6456. });
  6457. };
  6458. _createClass(Popover, null, [{
  6459. key: "VERSION",
  6460. // Getters
  6461. get: function get() {
  6462. return VERSION$7;
  6463. }
  6464. }, {
  6465. key: "Default",
  6466. get: function get() {
  6467. return Default$5;
  6468. }
  6469. }, {
  6470. key: "NAME",
  6471. get: function get() {
  6472. return NAME$7;
  6473. }
  6474. }, {
  6475. key: "DATA_KEY",
  6476. get: function get() {
  6477. return DATA_KEY$7;
  6478. }
  6479. }, {
  6480. key: "Event",
  6481. get: function get() {
  6482. return Event$7;
  6483. }
  6484. }, {
  6485. key: "EVENT_KEY",
  6486. get: function get() {
  6487. return EVENT_KEY$7;
  6488. }
  6489. }, {
  6490. key: "DefaultType",
  6491. get: function get() {
  6492. return DefaultType$5;
  6493. }
  6494. }]);
  6495. return Popover;
  6496. }(Tooltip);
  6497. /**
  6498. * ------------------------------------------------------------------------
  6499. * jQuery
  6500. * ------------------------------------------------------------------------
  6501. */
  6502. $.fn[NAME$7] = Popover._jQueryInterface;
  6503. $.fn[NAME$7].Constructor = Popover;
  6504. $.fn[NAME$7].noConflict = function () {
  6505. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  6506. return Popover._jQueryInterface;
  6507. };
  6508. /**
  6509. * ------------------------------------------------------------------------
  6510. * Constants
  6511. * ------------------------------------------------------------------------
  6512. */
  6513. var NAME$8 = 'scrollspy';
  6514. var VERSION$8 = '4.3.1';
  6515. var DATA_KEY$8 = 'bs.scrollspy';
  6516. var EVENT_KEY$8 = "." + DATA_KEY$8;
  6517. var DATA_API_KEY$6 = '.data-api';
  6518. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  6519. var Default$6 = {
  6520. offset: 10,
  6521. method: 'auto',
  6522. target: ''
  6523. };
  6524. var DefaultType$6 = {
  6525. offset: 'number',
  6526. method: 'string',
  6527. target: '(string|element)'
  6528. };
  6529. var Event$8 = {
  6530. ACTIVATE: "activate" + EVENT_KEY$8,
  6531. SCROLL: "scroll" + EVENT_KEY$8,
  6532. LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  6533. };
  6534. var ClassName$8 = {
  6535. DROPDOWN_ITEM: 'dropdown-item',
  6536. DROPDOWN_MENU: 'dropdown-menu',
  6537. ACTIVE: 'active'
  6538. };
  6539. var Selector$8 = {
  6540. DATA_SPY: '[data-spy="scroll"]',
  6541. ACTIVE: '.active',
  6542. NAV_LIST_GROUP: '.nav, .list-group',
  6543. NAV_LINKS: '.nav-link',
  6544. NAV_ITEMS: '.nav-item',
  6545. LIST_ITEMS: '.list-group-item',
  6546. DROPDOWN: '.dropdown',
  6547. DROPDOWN_ITEMS: '.dropdown-item',
  6548. DROPDOWN_TOGGLE: '.dropdown-toggle'
  6549. };
  6550. var OffsetMethod = {
  6551. OFFSET: 'offset',
  6552. POSITION: 'position'
  6553. /**
  6554. * ------------------------------------------------------------------------
  6555. * Class Definition
  6556. * ------------------------------------------------------------------------
  6557. */
  6558. };
  6559. var ScrollSpy =
  6560. /*#__PURE__*/
  6561. function () {
  6562. function ScrollSpy(element, config) {
  6563. var _this = this;
  6564. this._element = element;
  6565. this._scrollElement = element.tagName === 'BODY' ? window : element;
  6566. this._config = this._getConfig(config);
  6567. this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
  6568. this._offsets = [];
  6569. this._targets = [];
  6570. this._activeTarget = null;
  6571. this._scrollHeight = 0;
  6572. $(this._scrollElement).on(Event$8.SCROLL, function (event) {
  6573. return _this._process(event);
  6574. });
  6575. this.refresh();
  6576. this._process();
  6577. } // Getters
  6578. var _proto = ScrollSpy.prototype;
  6579. // Public
  6580. _proto.refresh = function refresh() {
  6581. var _this2 = this;
  6582. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  6583. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  6584. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  6585. this._offsets = [];
  6586. this._targets = [];
  6587. this._scrollHeight = this._getScrollHeight();
  6588. var targets = [].slice.call(document.querySelectorAll(this._selector));
  6589. targets.map(function (element) {
  6590. var target;
  6591. var targetSelector = Util.getSelectorFromElement(element);
  6592. if (targetSelector) {
  6593. target = document.querySelector(targetSelector);
  6594. }
  6595. if (target) {
  6596. var targetBCR = target.getBoundingClientRect();
  6597. if (targetBCR.width || targetBCR.height) {
  6598. // TODO (fat): remove sketch reliance on jQuery position/offset
  6599. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  6600. }
  6601. }
  6602. return null;
  6603. }).filter(function (item) {
  6604. return item;
  6605. }).sort(function (a, b) {
  6606. return a[0] - b[0];
  6607. }).forEach(function (item) {
  6608. _this2._offsets.push(item[0]);
  6609. _this2._targets.push(item[1]);
  6610. });
  6611. };
  6612. _proto.dispose = function dispose() {
  6613. $.removeData(this._element, DATA_KEY$8);
  6614. $(this._scrollElement).off(EVENT_KEY$8);
  6615. this._element = null;
  6616. this._scrollElement = null;
  6617. this._config = null;
  6618. this._selector = null;
  6619. this._offsets = null;
  6620. this._targets = null;
  6621. this._activeTarget = null;
  6622. this._scrollHeight = null;
  6623. } // Private
  6624. ;
  6625. _proto._getConfig = function _getConfig(config) {
  6626. config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});
  6627. if (typeof config.target !== 'string') {
  6628. var id = $(config.target).attr('id');
  6629. if (!id) {
  6630. id = Util.getUID(NAME$8);
  6631. $(config.target).attr('id', id);
  6632. }
  6633. config.target = "#" + id;
  6634. }
  6635. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  6636. return config;
  6637. };
  6638. _proto._getScrollTop = function _getScrollTop() {
  6639. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  6640. };
  6641. _proto._getScrollHeight = function _getScrollHeight() {
  6642. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  6643. };
  6644. _proto._getOffsetHeight = function _getOffsetHeight() {
  6645. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  6646. };
  6647. _proto._process = function _process() {
  6648. var scrollTop = this._getScrollTop() + this._config.offset;
  6649. var scrollHeight = this._getScrollHeight();
  6650. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  6651. if (this._scrollHeight !== scrollHeight) {
  6652. this.refresh();
  6653. }
  6654. if (scrollTop >= maxScroll) {
  6655. var target = this._targets[this._targets.length - 1];
  6656. if (this._activeTarget !== target) {
  6657. this._activate(target);
  6658. }
  6659. return;
  6660. }
  6661. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  6662. this._activeTarget = null;
  6663. this._clear();
  6664. return;
  6665. }
  6666. var offsetLength = this._offsets.length;
  6667. for (var i = offsetLength; i--;) {
  6668. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  6669. if (isActiveTarget) {
  6670. this._activate(this._targets[i]);
  6671. }
  6672. }
  6673. };
  6674. _proto._activate = function _activate(target) {
  6675. this._activeTarget = target;
  6676. this._clear();
  6677. var queries = this._selector.split(',').map(function (selector) {
  6678. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  6679. });
  6680. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  6681. if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
  6682. $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
  6683. $link.addClass(ClassName$8.ACTIVE);
  6684. } else {
  6685. // Set triggered link as active
  6686. $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
  6687. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  6688. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
  6689. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
  6690. }
  6691. $(this._scrollElement).trigger(Event$8.ACTIVATE, {
  6692. relatedTarget: target
  6693. });
  6694. };
  6695. _proto._clear = function _clear() {
  6696. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  6697. return node.classList.contains(ClassName$8.ACTIVE);
  6698. }).forEach(function (node) {
  6699. return node.classList.remove(ClassName$8.ACTIVE);
  6700. });
  6701. } // Static
  6702. ;
  6703. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  6704. return this.each(function () {
  6705. var data = $(this).data(DATA_KEY$8);
  6706. var _config = typeof config === 'object' && config;
  6707. if (!data) {
  6708. data = new ScrollSpy(this, _config);
  6709. $(this).data(DATA_KEY$8, data);
  6710. }
  6711. if (typeof config === 'string') {
  6712. if (typeof data[config] === 'undefined') {
  6713. throw new TypeError("No method named \"" + config + "\"");
  6714. }
  6715. data[config]();
  6716. }
  6717. });
  6718. };
  6719. _createClass(ScrollSpy, null, [{
  6720. key: "VERSION",
  6721. get: function get() {
  6722. return VERSION$8;
  6723. }
  6724. }, {
  6725. key: "Default",
  6726. get: function get() {
  6727. return Default$6;
  6728. }
  6729. }]);
  6730. return ScrollSpy;
  6731. }();
  6732. /**
  6733. * ------------------------------------------------------------------------
  6734. * Data Api implementation
  6735. * ------------------------------------------------------------------------
  6736. */
  6737. $(window).on(Event$8.LOAD_DATA_API, function () {
  6738. var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
  6739. var scrollSpysLength = scrollSpys.length;
  6740. for (var i = scrollSpysLength; i--;) {
  6741. var $spy = $(scrollSpys[i]);
  6742. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  6743. }
  6744. });
  6745. /**
  6746. * ------------------------------------------------------------------------
  6747. * jQuery
  6748. * ------------------------------------------------------------------------
  6749. */
  6750. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  6751. $.fn[NAME$8].Constructor = ScrollSpy;
  6752. $.fn[NAME$8].noConflict = function () {
  6753. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  6754. return ScrollSpy._jQueryInterface;
  6755. };
  6756. /**
  6757. * ------------------------------------------------------------------------
  6758. * Constants
  6759. * ------------------------------------------------------------------------
  6760. */
  6761. var NAME$9 = 'tab';
  6762. var VERSION$9 = '4.3.1';
  6763. var DATA_KEY$9 = 'bs.tab';
  6764. var EVENT_KEY$9 = "." + DATA_KEY$9;
  6765. var DATA_API_KEY$7 = '.data-api';
  6766. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  6767. var Event$9 = {
  6768. HIDE: "hide" + EVENT_KEY$9,
  6769. HIDDEN: "hidden" + EVENT_KEY$9,
  6770. SHOW: "show" + EVENT_KEY$9,
  6771. SHOWN: "shown" + EVENT_KEY$9,
  6772. CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  6773. };
  6774. var ClassName$9 = {
  6775. DROPDOWN_MENU: 'dropdown-menu',
  6776. ACTIVE: 'active',
  6777. DISABLED: 'disabled',
  6778. FADE: 'fade',
  6779. SHOW: 'show'
  6780. };
  6781. var Selector$9 = {
  6782. DROPDOWN: '.dropdown',
  6783. NAV_LIST_GROUP: '.nav, .list-group',
  6784. ACTIVE: '.active',
  6785. ACTIVE_UL: '> li > .active',
  6786. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  6787. DROPDOWN_TOGGLE: '.dropdown-toggle',
  6788. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  6789. /**
  6790. * ------------------------------------------------------------------------
  6791. * Class Definition
  6792. * ------------------------------------------------------------------------
  6793. */
  6794. };
  6795. var Tab =
  6796. /*#__PURE__*/
  6797. function () {
  6798. function Tab(element) {
  6799. this._element = element;
  6800. } // Getters
  6801. var _proto = Tab.prototype;
  6802. // Public
  6803. _proto.show = function show() {
  6804. var _this = this;
  6805. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
  6806. return;
  6807. }
  6808. var target;
  6809. var previous;
  6810. var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
  6811. var selector = Util.getSelectorFromElement(this._element);
  6812. if (listElement) {
  6813. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
  6814. previous = $.makeArray($(listElement).find(itemSelector));
  6815. previous = previous[previous.length - 1];
  6816. }
  6817. var hideEvent = $.Event(Event$9.HIDE, {
  6818. relatedTarget: this._element
  6819. });
  6820. var showEvent = $.Event(Event$9.SHOW, {
  6821. relatedTarget: previous
  6822. });
  6823. if (previous) {
  6824. $(previous).trigger(hideEvent);
  6825. }
  6826. $(this._element).trigger(showEvent);
  6827. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  6828. return;
  6829. }
  6830. if (selector) {
  6831. target = document.querySelector(selector);
  6832. }
  6833. this._activate(this._element, listElement);
  6834. var complete = function complete() {
  6835. var hiddenEvent = $.Event(Event$9.HIDDEN, {
  6836. relatedTarget: _this._element
  6837. });
  6838. var shownEvent = $.Event(Event$9.SHOWN, {
  6839. relatedTarget: previous
  6840. });
  6841. $(previous).trigger(hiddenEvent);
  6842. $(_this._element).trigger(shownEvent);
  6843. };
  6844. if (target) {
  6845. this._activate(target, target.parentNode, complete);
  6846. } else {
  6847. complete();
  6848. }
  6849. };
  6850. _proto.dispose = function dispose() {
  6851. $.removeData(this._element, DATA_KEY$9);
  6852. this._element = null;
  6853. } // Private
  6854. ;
  6855. _proto._activate = function _activate(element, container, callback) {
  6856. var _this2 = this;
  6857. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
  6858. var active = activeElements[0];
  6859. var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
  6860. var complete = function complete() {
  6861. return _this2._transitionComplete(element, active, callback);
  6862. };
  6863. if (active && isTransitioning) {
  6864. var transitionDuration = Util.getTransitionDurationFromElement(active);
  6865. $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6866. } else {
  6867. complete();
  6868. }
  6869. };
  6870. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  6871. if (active) {
  6872. $(active).removeClass(ClassName$9.ACTIVE);
  6873. var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
  6874. if (dropdownChild) {
  6875. $(dropdownChild).removeClass(ClassName$9.ACTIVE);
  6876. }
  6877. if (active.getAttribute('role') === 'tab') {
  6878. active.setAttribute('aria-selected', false);
  6879. }
  6880. }
  6881. $(element).addClass(ClassName$9.ACTIVE);
  6882. if (element.getAttribute('role') === 'tab') {
  6883. element.setAttribute('aria-selected', true);
  6884. }
  6885. Util.reflow(element);
  6886. if (element.classList.contains(ClassName$9.FADE)) {
  6887. element.classList.add(ClassName$9.SHOW);
  6888. }
  6889. if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
  6890. var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
  6891. if (dropdownElement) {
  6892. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
  6893. $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
  6894. }
  6895. element.setAttribute('aria-expanded', true);
  6896. }
  6897. if (callback) {
  6898. callback();
  6899. }
  6900. } // Static
  6901. ;
  6902. Tab._jQueryInterface = function _jQueryInterface(config) {
  6903. return this.each(function () {
  6904. var $this = $(this);
  6905. var data = $this.data(DATA_KEY$9);
  6906. if (!data) {
  6907. data = new Tab(this);
  6908. $this.data(DATA_KEY$9, data);
  6909. }
  6910. if (typeof config === 'string') {
  6911. if (typeof data[config] === 'undefined') {
  6912. throw new TypeError("No method named \"" + config + "\"");
  6913. }
  6914. data[config]();
  6915. }
  6916. });
  6917. };
  6918. _createClass(Tab, null, [{
  6919. key: "VERSION",
  6920. get: function get() {
  6921. return VERSION$9;
  6922. }
  6923. }]);
  6924. return Tab;
  6925. }();
  6926. /**
  6927. * ------------------------------------------------------------------------
  6928. * Data Api implementation
  6929. * ------------------------------------------------------------------------
  6930. */
  6931. $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  6932. event.preventDefault();
  6933. Tab._jQueryInterface.call($(this), 'show');
  6934. });
  6935. /**
  6936. * ------------------------------------------------------------------------
  6937. * jQuery
  6938. * ------------------------------------------------------------------------
  6939. */
  6940. $.fn[NAME$9] = Tab._jQueryInterface;
  6941. $.fn[NAME$9].Constructor = Tab;
  6942. $.fn[NAME$9].noConflict = function () {
  6943. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  6944. return Tab._jQueryInterface;
  6945. };
  6946. /**
  6947. * ------------------------------------------------------------------------
  6948. * Constants
  6949. * ------------------------------------------------------------------------
  6950. */
  6951. var NAME$a = 'toast';
  6952. var VERSION$a = '4.3.1';
  6953. var DATA_KEY$a = 'bs.toast';
  6954. var EVENT_KEY$a = "." + DATA_KEY$a;
  6955. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  6956. var Event$a = {
  6957. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  6958. HIDE: "hide" + EVENT_KEY$a,
  6959. HIDDEN: "hidden" + EVENT_KEY$a,
  6960. SHOW: "show" + EVENT_KEY$a,
  6961. SHOWN: "shown" + EVENT_KEY$a
  6962. };
  6963. var ClassName$a = {
  6964. FADE: 'fade',
  6965. HIDE: 'hide',
  6966. SHOW: 'show',
  6967. SHOWING: 'showing'
  6968. };
  6969. var DefaultType$7 = {
  6970. animation: 'boolean',
  6971. autohide: 'boolean',
  6972. delay: 'number'
  6973. };
  6974. var Default$7 = {
  6975. animation: true,
  6976. autohide: true,
  6977. delay: 500
  6978. };
  6979. var Selector$a = {
  6980. DATA_DISMISS: '[data-dismiss="toast"]'
  6981. /**
  6982. * ------------------------------------------------------------------------
  6983. * Class Definition
  6984. * ------------------------------------------------------------------------
  6985. */
  6986. };
  6987. var Toast =
  6988. /*#__PURE__*/
  6989. function () {
  6990. function Toast(element, config) {
  6991. this._element = element;
  6992. this._config = this._getConfig(config);
  6993. this._timeout = null;
  6994. this._setListeners();
  6995. } // Getters
  6996. var _proto = Toast.prototype;
  6997. // Public
  6998. _proto.show = function show() {
  6999. var _this = this;
  7000. $(this._element).trigger(Event$a.SHOW);
  7001. if (this._config.animation) {
  7002. this._element.classList.add(ClassName$a.FADE);
  7003. }
  7004. var complete = function complete() {
  7005. _this._element.classList.remove(ClassName$a.SHOWING);
  7006. _this._element.classList.add(ClassName$a.SHOW);
  7007. $(_this._element).trigger(Event$a.SHOWN);
  7008. if (_this._config.autohide) {
  7009. _this.hide();
  7010. }
  7011. };
  7012. this._element.classList.remove(ClassName$a.HIDE);
  7013. this._element.classList.add(ClassName$a.SHOWING);
  7014. if (this._config.animation) {
  7015. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  7016. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  7017. } else {
  7018. complete();
  7019. }
  7020. };
  7021. _proto.hide = function hide(withoutTimeout) {
  7022. var _this2 = this;
  7023. if (!this._element.classList.contains(ClassName$a.SHOW)) {
  7024. return;
  7025. }
  7026. $(this._element).trigger(Event$a.HIDE);
  7027. if (withoutTimeout) {
  7028. this._close();
  7029. } else {
  7030. this._timeout = setTimeout(function () {
  7031. _this2._close();
  7032. }, this._config.delay);
  7033. }
  7034. };
  7035. _proto.dispose = function dispose() {
  7036. clearTimeout(this._timeout);
  7037. this._timeout = null;
  7038. if (this._element.classList.contains(ClassName$a.SHOW)) {
  7039. this._element.classList.remove(ClassName$a.SHOW);
  7040. }
  7041. $(this._element).off(Event$a.CLICK_DISMISS);
  7042. $.removeData(this._element, DATA_KEY$a);
  7043. this._element = null;
  7044. this._config = null;
  7045. } // Private
  7046. ;
  7047. _proto._getConfig = function _getConfig(config) {
  7048. config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {});
  7049. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  7050. return config;
  7051. };
  7052. _proto._setListeners = function _setListeners() {
  7053. var _this3 = this;
  7054. $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
  7055. return _this3.hide(true);
  7056. });
  7057. };
  7058. _proto._close = function _close() {
  7059. var _this4 = this;
  7060. var complete = function complete() {
  7061. _this4._element.classList.add(ClassName$a.HIDE);
  7062. $(_this4._element).trigger(Event$a.HIDDEN);
  7063. };
  7064. this._element.classList.remove(ClassName$a.SHOW);
  7065. if (this._config.animation) {
  7066. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  7067. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  7068. } else {
  7069. complete();
  7070. }
  7071. } // Static
  7072. ;
  7073. Toast._jQueryInterface = function _jQueryInterface(config) {
  7074. return this.each(function () {
  7075. var $element = $(this);
  7076. var data = $element.data(DATA_KEY$a);
  7077. var _config = typeof config === 'object' && config;
  7078. if (!data) {
  7079. data = new Toast(this, _config);
  7080. $element.data(DATA_KEY$a, data);
  7081. }
  7082. if (typeof config === 'string') {
  7083. if (typeof data[config] === 'undefined') {
  7084. throw new TypeError("No method named \"" + config + "\"");
  7085. }
  7086. data[config](this);
  7087. }
  7088. });
  7089. };
  7090. _createClass(Toast, null, [{
  7091. key: "VERSION",
  7092. get: function get() {
  7093. return VERSION$a;
  7094. }
  7095. }, {
  7096. key: "DefaultType",
  7097. get: function get() {
  7098. return DefaultType$7;
  7099. }
  7100. }, {
  7101. key: "Default",
  7102. get: function get() {
  7103. return Default$7;
  7104. }
  7105. }]);
  7106. return Toast;
  7107. }();
  7108. /**
  7109. * ------------------------------------------------------------------------
  7110. * jQuery
  7111. * ------------------------------------------------------------------------
  7112. */
  7113. $.fn[NAME$a] = Toast._jQueryInterface;
  7114. $.fn[NAME$a].Constructor = Toast;
  7115. $.fn[NAME$a].noConflict = function () {
  7116. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  7117. return Toast._jQueryInterface;
  7118. };
  7119. /**
  7120. * --------------------------------------------------------------------------
  7121. * Bootstrap (v4.3.1): index.js
  7122. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  7123. * --------------------------------------------------------------------------
  7124. */
  7125. (function () {
  7126. if (typeof $ === 'undefined') {
  7127. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  7128. }
  7129. var version = $.fn.jquery.split(' ')[0].split('.');
  7130. var minMajor = 1;
  7131. var ltMajor = 2;
  7132. var minMinor = 9;
  7133. var minPatch = 1;
  7134. var maxMajor = 4;
  7135. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  7136. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  7137. }
  7138. })();
  7139. exports.Util = Util;
  7140. exports.Alert = Alert;
  7141. exports.Button = Button;
  7142. exports.Carousel = Carousel;
  7143. exports.Collapse = Collapse;
  7144. exports.Dropdown = Dropdown;
  7145. exports.Modal = Modal;
  7146. exports.Popover = Popover;
  7147. exports.Scrollspy = ScrollSpy;
  7148. exports.Tab = Tab;
  7149. exports.Toast = Toast;
  7150. exports.Tooltip = Tooltip;
  7151. Object.defineProperty(exports, '__esModule', { value: true });
  7152. }));
  7153. //# sourceMappingURL=bootstrap.js.map
  7154. /***/ }),
  7155. /***/ "./node_modules/buffer/index.js":
  7156. /*!**************************************!*\
  7157. !*** ./node_modules/buffer/index.js ***!
  7158. \**************************************/
  7159. /*! no static exports found */
  7160. /***/ (function(module, exports, __webpack_require__) {
  7161. "use strict";
  7162. /* WEBPACK VAR INJECTION */(function(global) {/*!
  7163. * The buffer module from node.js, for the browser.
  7164. *
  7165. * @author Feross Aboukhadijeh <http://feross.org>
  7166. * @license MIT
  7167. */
  7168. /* eslint-disable no-proto */
  7169. var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
  7170. var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
  7171. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
  7172. exports.Buffer = Buffer
  7173. exports.SlowBuffer = SlowBuffer
  7174. exports.INSPECT_MAX_BYTES = 50
  7175. /**
  7176. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  7177. * === true Use Uint8Array implementation (fastest)
  7178. * === false Use Object implementation (most compatible, even IE6)
  7179. *
  7180. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  7181. * Opera 11.6+, iOS 4.2+.
  7182. *
  7183. * Due to various browser bugs, sometimes the Object implementation will be used even
  7184. * when the browser supports typed arrays.
  7185. *
  7186. * Note:
  7187. *
  7188. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  7189. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  7190. *
  7191. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  7192. *
  7193. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  7194. * incorrect length in some situations.
  7195. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  7196. * get the Object implementation, which is slower but behaves correctly.
  7197. */
  7198. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  7199. ? global.TYPED_ARRAY_SUPPORT
  7200. : typedArraySupport()
  7201. /*
  7202. * Export kMaxLength after typed array support is determined.
  7203. */
  7204. exports.kMaxLength = kMaxLength()
  7205. function typedArraySupport () {
  7206. try {
  7207. var arr = new Uint8Array(1)
  7208. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  7209. return arr.foo() === 42 && // typed array instances can be augmented
  7210. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  7211. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  7212. } catch (e) {
  7213. return false
  7214. }
  7215. }
  7216. function kMaxLength () {
  7217. return Buffer.TYPED_ARRAY_SUPPORT
  7218. ? 0x7fffffff
  7219. : 0x3fffffff
  7220. }
  7221. function createBuffer (that, length) {
  7222. if (kMaxLength() < length) {
  7223. throw new RangeError('Invalid typed array length')
  7224. }
  7225. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7226. // Return an augmented `Uint8Array` instance, for best performance
  7227. that = new Uint8Array(length)
  7228. that.__proto__ = Buffer.prototype
  7229. } else {
  7230. // Fallback: Return an object instance of the Buffer class
  7231. if (that === null) {
  7232. that = new Buffer(length)
  7233. }
  7234. that.length = length
  7235. }
  7236. return that
  7237. }
  7238. /**
  7239. * The Buffer constructor returns instances of `Uint8Array` that have their
  7240. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  7241. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  7242. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  7243. * returns a single octet.
  7244. *
  7245. * The `Uint8Array` prototype remains unmodified.
  7246. */
  7247. function Buffer (arg, encodingOrOffset, length) {
  7248. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  7249. return new Buffer(arg, encodingOrOffset, length)
  7250. }
  7251. // Common case.
  7252. if (typeof arg === 'number') {
  7253. if (typeof encodingOrOffset === 'string') {
  7254. throw new Error(
  7255. 'If encoding is specified then the first argument must be a string'
  7256. )
  7257. }
  7258. return allocUnsafe(this, arg)
  7259. }
  7260. return from(this, arg, encodingOrOffset, length)
  7261. }
  7262. Buffer.poolSize = 8192 // not used by this implementation
  7263. // TODO: Legacy, not needed anymore. Remove in next major version.
  7264. Buffer._augment = function (arr) {
  7265. arr.__proto__ = Buffer.prototype
  7266. return arr
  7267. }
  7268. function from (that, value, encodingOrOffset, length) {
  7269. if (typeof value === 'number') {
  7270. throw new TypeError('"value" argument must not be a number')
  7271. }
  7272. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  7273. return fromArrayBuffer(that, value, encodingOrOffset, length)
  7274. }
  7275. if (typeof value === 'string') {
  7276. return fromString(that, value, encodingOrOffset)
  7277. }
  7278. return fromObject(that, value)
  7279. }
  7280. /**
  7281. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  7282. * if value is a number.
  7283. * Buffer.from(str[, encoding])
  7284. * Buffer.from(array)
  7285. * Buffer.from(buffer)
  7286. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  7287. **/
  7288. Buffer.from = function (value, encodingOrOffset, length) {
  7289. return from(null, value, encodingOrOffset, length)
  7290. }
  7291. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7292. Buffer.prototype.__proto__ = Uint8Array.prototype
  7293. Buffer.__proto__ = Uint8Array
  7294. if (typeof Symbol !== 'undefined' && Symbol.species &&
  7295. Buffer[Symbol.species] === Buffer) {
  7296. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  7297. Object.defineProperty(Buffer, Symbol.species, {
  7298. value: null,
  7299. configurable: true
  7300. })
  7301. }
  7302. }
  7303. function assertSize (size) {
  7304. if (typeof size !== 'number') {
  7305. throw new TypeError('"size" argument must be a number')
  7306. } else if (size < 0) {
  7307. throw new RangeError('"size" argument must not be negative')
  7308. }
  7309. }
  7310. function alloc (that, size, fill, encoding) {
  7311. assertSize(size)
  7312. if (size <= 0) {
  7313. return createBuffer(that, size)
  7314. }
  7315. if (fill !== undefined) {
  7316. // Only pay attention to encoding if it's a string. This
  7317. // prevents accidentally sending in a number that would
  7318. // be interpretted as a start offset.
  7319. return typeof encoding === 'string'
  7320. ? createBuffer(that, size).fill(fill, encoding)
  7321. : createBuffer(that, size).fill(fill)
  7322. }
  7323. return createBuffer(that, size)
  7324. }
  7325. /**
  7326. * Creates a new filled Buffer instance.
  7327. * alloc(size[, fill[, encoding]])
  7328. **/
  7329. Buffer.alloc = function (size, fill, encoding) {
  7330. return alloc(null, size, fill, encoding)
  7331. }
  7332. function allocUnsafe (that, size) {
  7333. assertSize(size)
  7334. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  7335. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  7336. for (var i = 0; i < size; ++i) {
  7337. that[i] = 0
  7338. }
  7339. }
  7340. return that
  7341. }
  7342. /**
  7343. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  7344. * */
  7345. Buffer.allocUnsafe = function (size) {
  7346. return allocUnsafe(null, size)
  7347. }
  7348. /**
  7349. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  7350. */
  7351. Buffer.allocUnsafeSlow = function (size) {
  7352. return allocUnsafe(null, size)
  7353. }
  7354. function fromString (that, string, encoding) {
  7355. if (typeof encoding !== 'string' || encoding === '') {
  7356. encoding = 'utf8'
  7357. }
  7358. if (!Buffer.isEncoding(encoding)) {
  7359. throw new TypeError('"encoding" must be a valid string encoding')
  7360. }
  7361. var length = byteLength(string, encoding) | 0
  7362. that = createBuffer(that, length)
  7363. var actual = that.write(string, encoding)
  7364. if (actual !== length) {
  7365. // Writing a hex string, for example, that contains invalid characters will
  7366. // cause everything after the first invalid character to be ignored. (e.g.
  7367. // 'abxxcd' will be treated as 'ab')
  7368. that = that.slice(0, actual)
  7369. }
  7370. return that
  7371. }
  7372. function fromArrayLike (that, array) {
  7373. var length = array.length < 0 ? 0 : checked(array.length) | 0
  7374. that = createBuffer(that, length)
  7375. for (var i = 0; i < length; i += 1) {
  7376. that[i] = array[i] & 255
  7377. }
  7378. return that
  7379. }
  7380. function fromArrayBuffer (that, array, byteOffset, length) {
  7381. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  7382. if (byteOffset < 0 || array.byteLength < byteOffset) {
  7383. throw new RangeError('\'offset\' is out of bounds')
  7384. }
  7385. if (array.byteLength < byteOffset + (length || 0)) {
  7386. throw new RangeError('\'length\' is out of bounds')
  7387. }
  7388. if (byteOffset === undefined && length === undefined) {
  7389. array = new Uint8Array(array)
  7390. } else if (length === undefined) {
  7391. array = new Uint8Array(array, byteOffset)
  7392. } else {
  7393. array = new Uint8Array(array, byteOffset, length)
  7394. }
  7395. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7396. // Return an augmented `Uint8Array` instance, for best performance
  7397. that = array
  7398. that.__proto__ = Buffer.prototype
  7399. } else {
  7400. // Fallback: Return an object instance of the Buffer class
  7401. that = fromArrayLike(that, array)
  7402. }
  7403. return that
  7404. }
  7405. function fromObject (that, obj) {
  7406. if (Buffer.isBuffer(obj)) {
  7407. var len = checked(obj.length) | 0
  7408. that = createBuffer(that, len)
  7409. if (that.length === 0) {
  7410. return that
  7411. }
  7412. obj.copy(that, 0, 0, len)
  7413. return that
  7414. }
  7415. if (obj) {
  7416. if ((typeof ArrayBuffer !== 'undefined' &&
  7417. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  7418. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  7419. return createBuffer(that, 0)
  7420. }
  7421. return fromArrayLike(that, obj)
  7422. }
  7423. if (obj.type === 'Buffer' && isArray(obj.data)) {
  7424. return fromArrayLike(that, obj.data)
  7425. }
  7426. }
  7427. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  7428. }
  7429. function checked (length) {
  7430. // Note: cannot use `length < kMaxLength()` here because that fails when
  7431. // length is NaN (which is otherwise coerced to zero.)
  7432. if (length >= kMaxLength()) {
  7433. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  7434. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  7435. }
  7436. return length | 0
  7437. }
  7438. function SlowBuffer (length) {
  7439. if (+length != length) { // eslint-disable-line eqeqeq
  7440. length = 0
  7441. }
  7442. return Buffer.alloc(+length)
  7443. }
  7444. Buffer.isBuffer = function isBuffer (b) {
  7445. return !!(b != null && b._isBuffer)
  7446. }
  7447. Buffer.compare = function compare (a, b) {
  7448. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  7449. throw new TypeError('Arguments must be Buffers')
  7450. }
  7451. if (a === b) return 0
  7452. var x = a.length
  7453. var y = b.length
  7454. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  7455. if (a[i] !== b[i]) {
  7456. x = a[i]
  7457. y = b[i]
  7458. break
  7459. }
  7460. }
  7461. if (x < y) return -1
  7462. if (y < x) return 1
  7463. return 0
  7464. }
  7465. Buffer.isEncoding = function isEncoding (encoding) {
  7466. switch (String(encoding).toLowerCase()) {
  7467. case 'hex':
  7468. case 'utf8':
  7469. case 'utf-8':
  7470. case 'ascii':
  7471. case 'latin1':
  7472. case 'binary':
  7473. case 'base64':
  7474. case 'ucs2':
  7475. case 'ucs-2':
  7476. case 'utf16le':
  7477. case 'utf-16le':
  7478. return true
  7479. default:
  7480. return false
  7481. }
  7482. }
  7483. Buffer.concat = function concat (list, length) {
  7484. if (!isArray(list)) {
  7485. throw new TypeError('"list" argument must be an Array of Buffers')
  7486. }
  7487. if (list.length === 0) {
  7488. return Buffer.alloc(0)
  7489. }
  7490. var i
  7491. if (length === undefined) {
  7492. length = 0
  7493. for (i = 0; i < list.length; ++i) {
  7494. length += list[i].length
  7495. }
  7496. }
  7497. var buffer = Buffer.allocUnsafe(length)
  7498. var pos = 0
  7499. for (i = 0; i < list.length; ++i) {
  7500. var buf = list[i]
  7501. if (!Buffer.isBuffer(buf)) {
  7502. throw new TypeError('"list" argument must be an Array of Buffers')
  7503. }
  7504. buf.copy(buffer, pos)
  7505. pos += buf.length
  7506. }
  7507. return buffer
  7508. }
  7509. function byteLength (string, encoding) {
  7510. if (Buffer.isBuffer(string)) {
  7511. return string.length
  7512. }
  7513. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  7514. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  7515. return string.byteLength
  7516. }
  7517. if (typeof string !== 'string') {
  7518. string = '' + string
  7519. }
  7520. var len = string.length
  7521. if (len === 0) return 0
  7522. // Use a for loop to avoid recursion
  7523. var loweredCase = false
  7524. for (;;) {
  7525. switch (encoding) {
  7526. case 'ascii':
  7527. case 'latin1':
  7528. case 'binary':
  7529. return len
  7530. case 'utf8':
  7531. case 'utf-8':
  7532. case undefined:
  7533. return utf8ToBytes(string).length
  7534. case 'ucs2':
  7535. case 'ucs-2':
  7536. case 'utf16le':
  7537. case 'utf-16le':
  7538. return len * 2
  7539. case 'hex':
  7540. return len >>> 1
  7541. case 'base64':
  7542. return base64ToBytes(string).length
  7543. default:
  7544. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  7545. encoding = ('' + encoding).toLowerCase()
  7546. loweredCase = true
  7547. }
  7548. }
  7549. }
  7550. Buffer.byteLength = byteLength
  7551. function slowToString (encoding, start, end) {
  7552. var loweredCase = false
  7553. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  7554. // property of a typed array.
  7555. // This behaves neither like String nor Uint8Array in that we set start/end
  7556. // to their upper/lower bounds if the value passed is out of range.
  7557. // undefined is handled specially as per ECMA-262 6th Edition,
  7558. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  7559. if (start === undefined || start < 0) {
  7560. start = 0
  7561. }
  7562. // Return early if start > this.length. Done here to prevent potential uint32
  7563. // coercion fail below.
  7564. if (start > this.length) {
  7565. return ''
  7566. }
  7567. if (end === undefined || end > this.length) {
  7568. end = this.length
  7569. }
  7570. if (end <= 0) {
  7571. return ''
  7572. }
  7573. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  7574. end >>>= 0
  7575. start >>>= 0
  7576. if (end <= start) {
  7577. return ''
  7578. }
  7579. if (!encoding) encoding = 'utf8'
  7580. while (true) {
  7581. switch (encoding) {
  7582. case 'hex':
  7583. return hexSlice(this, start, end)
  7584. case 'utf8':
  7585. case 'utf-8':
  7586. return utf8Slice(this, start, end)
  7587. case 'ascii':
  7588. return asciiSlice(this, start, end)
  7589. case 'latin1':
  7590. case 'binary':
  7591. return latin1Slice(this, start, end)
  7592. case 'base64':
  7593. return base64Slice(this, start, end)
  7594. case 'ucs2':
  7595. case 'ucs-2':
  7596. case 'utf16le':
  7597. case 'utf-16le':
  7598. return utf16leSlice(this, start, end)
  7599. default:
  7600. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  7601. encoding = (encoding + '').toLowerCase()
  7602. loweredCase = true
  7603. }
  7604. }
  7605. }
  7606. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  7607. // Buffer instances.
  7608. Buffer.prototype._isBuffer = true
  7609. function swap (b, n, m) {
  7610. var i = b[n]
  7611. b[n] = b[m]
  7612. b[m] = i
  7613. }
  7614. Buffer.prototype.swap16 = function swap16 () {
  7615. var len = this.length
  7616. if (len % 2 !== 0) {
  7617. throw new RangeError('Buffer size must be a multiple of 16-bits')
  7618. }
  7619. for (var i = 0; i < len; i += 2) {
  7620. swap(this, i, i + 1)
  7621. }
  7622. return this
  7623. }
  7624. Buffer.prototype.swap32 = function swap32 () {
  7625. var len = this.length
  7626. if (len % 4 !== 0) {
  7627. throw new RangeError('Buffer size must be a multiple of 32-bits')
  7628. }
  7629. for (var i = 0; i < len; i += 4) {
  7630. swap(this, i, i + 3)
  7631. swap(this, i + 1, i + 2)
  7632. }
  7633. return this
  7634. }
  7635. Buffer.prototype.swap64 = function swap64 () {
  7636. var len = this.length
  7637. if (len % 8 !== 0) {
  7638. throw new RangeError('Buffer size must be a multiple of 64-bits')
  7639. }
  7640. for (var i = 0; i < len; i += 8) {
  7641. swap(this, i, i + 7)
  7642. swap(this, i + 1, i + 6)
  7643. swap(this, i + 2, i + 5)
  7644. swap(this, i + 3, i + 4)
  7645. }
  7646. return this
  7647. }
  7648. Buffer.prototype.toString = function toString () {
  7649. var length = this.length | 0
  7650. if (length === 0) return ''
  7651. if (arguments.length === 0) return utf8Slice(this, 0, length)
  7652. return slowToString.apply(this, arguments)
  7653. }
  7654. Buffer.prototype.equals = function equals (b) {
  7655. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  7656. if (this === b) return true
  7657. return Buffer.compare(this, b) === 0
  7658. }
  7659. Buffer.prototype.inspect = function inspect () {
  7660. var str = ''
  7661. var max = exports.INSPECT_MAX_BYTES
  7662. if (this.length > 0) {
  7663. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  7664. if (this.length > max) str += ' ... '
  7665. }
  7666. return '<Buffer ' + str + '>'
  7667. }
  7668. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  7669. if (!Buffer.isBuffer(target)) {
  7670. throw new TypeError('Argument must be a Buffer')
  7671. }
  7672. if (start === undefined) {
  7673. start = 0
  7674. }
  7675. if (end === undefined) {
  7676. end = target ? target.length : 0
  7677. }
  7678. if (thisStart === undefined) {
  7679. thisStart = 0
  7680. }
  7681. if (thisEnd === undefined) {
  7682. thisEnd = this.length
  7683. }
  7684. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  7685. throw new RangeError('out of range index')
  7686. }
  7687. if (thisStart >= thisEnd && start >= end) {
  7688. return 0
  7689. }
  7690. if (thisStart >= thisEnd) {
  7691. return -1
  7692. }
  7693. if (start >= end) {
  7694. return 1
  7695. }
  7696. start >>>= 0
  7697. end >>>= 0
  7698. thisStart >>>= 0
  7699. thisEnd >>>= 0
  7700. if (this === target) return 0
  7701. var x = thisEnd - thisStart
  7702. var y = end - start
  7703. var len = Math.min(x, y)
  7704. var thisCopy = this.slice(thisStart, thisEnd)
  7705. var targetCopy = target.slice(start, end)
  7706. for (var i = 0; i < len; ++i) {
  7707. if (thisCopy[i] !== targetCopy[i]) {
  7708. x = thisCopy[i]
  7709. y = targetCopy[i]
  7710. break
  7711. }
  7712. }
  7713. if (x < y) return -1
  7714. if (y < x) return 1
  7715. return 0
  7716. }
  7717. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  7718. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  7719. //
  7720. // Arguments:
  7721. // - buffer - a Buffer to search
  7722. // - val - a string, Buffer, or number
  7723. // - byteOffset - an index into `buffer`; will be clamped to an int32
  7724. // - encoding - an optional encoding, relevant is val is a string
  7725. // - dir - true for indexOf, false for lastIndexOf
  7726. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  7727. // Empty buffer means no match
  7728. if (buffer.length === 0) return -1
  7729. // Normalize byteOffset
  7730. if (typeof byteOffset === 'string') {
  7731. encoding = byteOffset
  7732. byteOffset = 0
  7733. } else if (byteOffset > 0x7fffffff) {
  7734. byteOffset = 0x7fffffff
  7735. } else if (byteOffset < -0x80000000) {
  7736. byteOffset = -0x80000000
  7737. }
  7738. byteOffset = +byteOffset // Coerce to Number.
  7739. if (isNaN(byteOffset)) {
  7740. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  7741. byteOffset = dir ? 0 : (buffer.length - 1)
  7742. }
  7743. // Normalize byteOffset: negative offsets start from the end of the buffer
  7744. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  7745. if (byteOffset >= buffer.length) {
  7746. if (dir) return -1
  7747. else byteOffset = buffer.length - 1
  7748. } else if (byteOffset < 0) {
  7749. if (dir) byteOffset = 0
  7750. else return -1
  7751. }
  7752. // Normalize val
  7753. if (typeof val === 'string') {
  7754. val = Buffer.from(val, encoding)
  7755. }
  7756. // Finally, search either indexOf (if dir is true) or lastIndexOf
  7757. if (Buffer.isBuffer(val)) {
  7758. // Special case: looking for empty string/buffer always fails
  7759. if (val.length === 0) {
  7760. return -1
  7761. }
  7762. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  7763. } else if (typeof val === 'number') {
  7764. val = val & 0xFF // Search for a byte value [0-255]
  7765. if (Buffer.TYPED_ARRAY_SUPPORT &&
  7766. typeof Uint8Array.prototype.indexOf === 'function') {
  7767. if (dir) {
  7768. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  7769. } else {
  7770. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  7771. }
  7772. }
  7773. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  7774. }
  7775. throw new TypeError('val must be string, number or Buffer')
  7776. }
  7777. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  7778. var indexSize = 1
  7779. var arrLength = arr.length
  7780. var valLength = val.length
  7781. if (encoding !== undefined) {
  7782. encoding = String(encoding).toLowerCase()
  7783. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  7784. encoding === 'utf16le' || encoding === 'utf-16le') {
  7785. if (arr.length < 2 || val.length < 2) {
  7786. return -1
  7787. }
  7788. indexSize = 2
  7789. arrLength /= 2
  7790. valLength /= 2
  7791. byteOffset /= 2
  7792. }
  7793. }
  7794. function read (buf, i) {
  7795. if (indexSize === 1) {
  7796. return buf[i]
  7797. } else {
  7798. return buf.readUInt16BE(i * indexSize)
  7799. }
  7800. }
  7801. var i
  7802. if (dir) {
  7803. var foundIndex = -1
  7804. for (i = byteOffset; i < arrLength; i++) {
  7805. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  7806. if (foundIndex === -1) foundIndex = i
  7807. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  7808. } else {
  7809. if (foundIndex !== -1) i -= i - foundIndex
  7810. foundIndex = -1
  7811. }
  7812. }
  7813. } else {
  7814. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  7815. for (i = byteOffset; i >= 0; i--) {
  7816. var found = true
  7817. for (var j = 0; j < valLength; j++) {
  7818. if (read(arr, i + j) !== read(val, j)) {
  7819. found = false
  7820. break
  7821. }
  7822. }
  7823. if (found) return i
  7824. }
  7825. }
  7826. return -1
  7827. }
  7828. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  7829. return this.indexOf(val, byteOffset, encoding) !== -1
  7830. }
  7831. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  7832. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  7833. }
  7834. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  7835. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  7836. }
  7837. function hexWrite (buf, string, offset, length) {
  7838. offset = Number(offset) || 0
  7839. var remaining = buf.length - offset
  7840. if (!length) {
  7841. length = remaining
  7842. } else {
  7843. length = Number(length)
  7844. if (length > remaining) {
  7845. length = remaining
  7846. }
  7847. }
  7848. // must be an even number of digits
  7849. var strLen = string.length
  7850. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  7851. if (length > strLen / 2) {
  7852. length = strLen / 2
  7853. }
  7854. for (var i = 0; i < length; ++i) {
  7855. var parsed = parseInt(string.substr(i * 2, 2), 16)
  7856. if (isNaN(parsed)) return i
  7857. buf[offset + i] = parsed
  7858. }
  7859. return i
  7860. }
  7861. function utf8Write (buf, string, offset, length) {
  7862. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  7863. }
  7864. function asciiWrite (buf, string, offset, length) {
  7865. return blitBuffer(asciiToBytes(string), buf, offset, length)
  7866. }
  7867. function latin1Write (buf, string, offset, length) {
  7868. return asciiWrite(buf, string, offset, length)
  7869. }
  7870. function base64Write (buf, string, offset, length) {
  7871. return blitBuffer(base64ToBytes(string), buf, offset, length)
  7872. }
  7873. function ucs2Write (buf, string, offset, length) {
  7874. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  7875. }
  7876. Buffer.prototype.write = function write (string, offset, length, encoding) {
  7877. // Buffer#write(string)
  7878. if (offset === undefined) {
  7879. encoding = 'utf8'
  7880. length = this.length
  7881. offset = 0
  7882. // Buffer#write(string, encoding)
  7883. } else if (length === undefined && typeof offset === 'string') {
  7884. encoding = offset
  7885. length = this.length
  7886. offset = 0
  7887. // Buffer#write(string, offset[, length][, encoding])
  7888. } else if (isFinite(offset)) {
  7889. offset = offset | 0
  7890. if (isFinite(length)) {
  7891. length = length | 0
  7892. if (encoding === undefined) encoding = 'utf8'
  7893. } else {
  7894. encoding = length
  7895. length = undefined
  7896. }
  7897. // legacy write(string, encoding, offset, length) - remove in v0.13
  7898. } else {
  7899. throw new Error(
  7900. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  7901. )
  7902. }
  7903. var remaining = this.length - offset
  7904. if (length === undefined || length > remaining) length = remaining
  7905. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  7906. throw new RangeError('Attempt to write outside buffer bounds')
  7907. }
  7908. if (!encoding) encoding = 'utf8'
  7909. var loweredCase = false
  7910. for (;;) {
  7911. switch (encoding) {
  7912. case 'hex':
  7913. return hexWrite(this, string, offset, length)
  7914. case 'utf8':
  7915. case 'utf-8':
  7916. return utf8Write(this, string, offset, length)
  7917. case 'ascii':
  7918. return asciiWrite(this, string, offset, length)
  7919. case 'latin1':
  7920. case 'binary':
  7921. return latin1Write(this, string, offset, length)
  7922. case 'base64':
  7923. // Warning: maxLength not taken into account in base64Write
  7924. return base64Write(this, string, offset, length)
  7925. case 'ucs2':
  7926. case 'ucs-2':
  7927. case 'utf16le':
  7928. case 'utf-16le':
  7929. return ucs2Write(this, string, offset, length)
  7930. default:
  7931. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  7932. encoding = ('' + encoding).toLowerCase()
  7933. loweredCase = true
  7934. }
  7935. }
  7936. }
  7937. Buffer.prototype.toJSON = function toJSON () {
  7938. return {
  7939. type: 'Buffer',
  7940. data: Array.prototype.slice.call(this._arr || this, 0)
  7941. }
  7942. }
  7943. function base64Slice (buf, start, end) {
  7944. if (start === 0 && end === buf.length) {
  7945. return base64.fromByteArray(buf)
  7946. } else {
  7947. return base64.fromByteArray(buf.slice(start, end))
  7948. }
  7949. }
  7950. function utf8Slice (buf, start, end) {
  7951. end = Math.min(buf.length, end)
  7952. var res = []
  7953. var i = start
  7954. while (i < end) {
  7955. var firstByte = buf[i]
  7956. var codePoint = null
  7957. var bytesPerSequence = (firstByte > 0xEF) ? 4
  7958. : (firstByte > 0xDF) ? 3
  7959. : (firstByte > 0xBF) ? 2
  7960. : 1
  7961. if (i + bytesPerSequence <= end) {
  7962. var secondByte, thirdByte, fourthByte, tempCodePoint
  7963. switch (bytesPerSequence) {
  7964. case 1:
  7965. if (firstByte < 0x80) {
  7966. codePoint = firstByte
  7967. }
  7968. break
  7969. case 2:
  7970. secondByte = buf[i + 1]
  7971. if ((secondByte & 0xC0) === 0x80) {
  7972. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  7973. if (tempCodePoint > 0x7F) {
  7974. codePoint = tempCodePoint
  7975. }
  7976. }
  7977. break
  7978. case 3:
  7979. secondByte = buf[i + 1]
  7980. thirdByte = buf[i + 2]
  7981. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  7982. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  7983. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  7984. codePoint = tempCodePoint
  7985. }
  7986. }
  7987. break
  7988. case 4:
  7989. secondByte = buf[i + 1]
  7990. thirdByte = buf[i + 2]
  7991. fourthByte = buf[i + 3]
  7992. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  7993. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  7994. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  7995. codePoint = tempCodePoint
  7996. }
  7997. }
  7998. }
  7999. }
  8000. if (codePoint === null) {
  8001. // we did not generate a valid codePoint so insert a
  8002. // replacement char (U+FFFD) and advance only 1 byte
  8003. codePoint = 0xFFFD
  8004. bytesPerSequence = 1
  8005. } else if (codePoint > 0xFFFF) {
  8006. // encode to utf16 (surrogate pair dance)
  8007. codePoint -= 0x10000
  8008. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  8009. codePoint = 0xDC00 | codePoint & 0x3FF
  8010. }
  8011. res.push(codePoint)
  8012. i += bytesPerSequence
  8013. }
  8014. return decodeCodePointsArray(res)
  8015. }
  8016. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  8017. // the lowest limit is Chrome, with 0x10000 args.
  8018. // We go 1 magnitude less, for safety
  8019. var MAX_ARGUMENTS_LENGTH = 0x1000
  8020. function decodeCodePointsArray (codePoints) {
  8021. var len = codePoints.length
  8022. if (len <= MAX_ARGUMENTS_LENGTH) {
  8023. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  8024. }
  8025. // Decode in chunks to avoid "call stack size exceeded".
  8026. var res = ''
  8027. var i = 0
  8028. while (i < len) {
  8029. res += String.fromCharCode.apply(
  8030. String,
  8031. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  8032. )
  8033. }
  8034. return res
  8035. }
  8036. function asciiSlice (buf, start, end) {
  8037. var ret = ''
  8038. end = Math.min(buf.length, end)
  8039. for (var i = start; i < end; ++i) {
  8040. ret += String.fromCharCode(buf[i] & 0x7F)
  8041. }
  8042. return ret
  8043. }
  8044. function latin1Slice (buf, start, end) {
  8045. var ret = ''
  8046. end = Math.min(buf.length, end)
  8047. for (var i = start; i < end; ++i) {
  8048. ret += String.fromCharCode(buf[i])
  8049. }
  8050. return ret
  8051. }
  8052. function hexSlice (buf, start, end) {
  8053. var len = buf.length
  8054. if (!start || start < 0) start = 0
  8055. if (!end || end < 0 || end > len) end = len
  8056. var out = ''
  8057. for (var i = start; i < end; ++i) {
  8058. out += toHex(buf[i])
  8059. }
  8060. return out
  8061. }
  8062. function utf16leSlice (buf, start, end) {
  8063. var bytes = buf.slice(start, end)
  8064. var res = ''
  8065. for (var i = 0; i < bytes.length; i += 2) {
  8066. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  8067. }
  8068. return res
  8069. }
  8070. Buffer.prototype.slice = function slice (start, end) {
  8071. var len = this.length
  8072. start = ~~start
  8073. end = end === undefined ? len : ~~end
  8074. if (start < 0) {
  8075. start += len
  8076. if (start < 0) start = 0
  8077. } else if (start > len) {
  8078. start = len
  8079. }
  8080. if (end < 0) {
  8081. end += len
  8082. if (end < 0) end = 0
  8083. } else if (end > len) {
  8084. end = len
  8085. }
  8086. if (end < start) end = start
  8087. var newBuf
  8088. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8089. newBuf = this.subarray(start, end)
  8090. newBuf.__proto__ = Buffer.prototype
  8091. } else {
  8092. var sliceLen = end - start
  8093. newBuf = new Buffer(sliceLen, undefined)
  8094. for (var i = 0; i < sliceLen; ++i) {
  8095. newBuf[i] = this[i + start]
  8096. }
  8097. }
  8098. return newBuf
  8099. }
  8100. /*
  8101. * Need to make sure that buffer isn't trying to write out of bounds.
  8102. */
  8103. function checkOffset (offset, ext, length) {
  8104. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  8105. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  8106. }
  8107. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  8108. offset = offset | 0
  8109. byteLength = byteLength | 0
  8110. if (!noAssert) checkOffset(offset, byteLength, this.length)
  8111. var val = this[offset]
  8112. var mul = 1
  8113. var i = 0
  8114. while (++i < byteLength && (mul *= 0x100)) {
  8115. val += this[offset + i] * mul
  8116. }
  8117. return val
  8118. }
  8119. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  8120. offset = offset | 0
  8121. byteLength = byteLength | 0
  8122. if (!noAssert) {
  8123. checkOffset(offset, byteLength, this.length)
  8124. }
  8125. var val = this[offset + --byteLength]
  8126. var mul = 1
  8127. while (byteLength > 0 && (mul *= 0x100)) {
  8128. val += this[offset + --byteLength] * mul
  8129. }
  8130. return val
  8131. }
  8132. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  8133. if (!noAssert) checkOffset(offset, 1, this.length)
  8134. return this[offset]
  8135. }
  8136. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  8137. if (!noAssert) checkOffset(offset, 2, this.length)
  8138. return this[offset] | (this[offset + 1] << 8)
  8139. }
  8140. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  8141. if (!noAssert) checkOffset(offset, 2, this.length)
  8142. return (this[offset] << 8) | this[offset + 1]
  8143. }
  8144. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  8145. if (!noAssert) checkOffset(offset, 4, this.length)
  8146. return ((this[offset]) |
  8147. (this[offset + 1] << 8) |
  8148. (this[offset + 2] << 16)) +
  8149. (this[offset + 3] * 0x1000000)
  8150. }
  8151. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  8152. if (!noAssert) checkOffset(offset, 4, this.length)
  8153. return (this[offset] * 0x1000000) +
  8154. ((this[offset + 1] << 16) |
  8155. (this[offset + 2] << 8) |
  8156. this[offset + 3])
  8157. }
  8158. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  8159. offset = offset | 0
  8160. byteLength = byteLength | 0
  8161. if (!noAssert) checkOffset(offset, byteLength, this.length)
  8162. var val = this[offset]
  8163. var mul = 1
  8164. var i = 0
  8165. while (++i < byteLength && (mul *= 0x100)) {
  8166. val += this[offset + i] * mul
  8167. }
  8168. mul *= 0x80
  8169. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  8170. return val
  8171. }
  8172. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  8173. offset = offset | 0
  8174. byteLength = byteLength | 0
  8175. if (!noAssert) checkOffset(offset, byteLength, this.length)
  8176. var i = byteLength
  8177. var mul = 1
  8178. var val = this[offset + --i]
  8179. while (i > 0 && (mul *= 0x100)) {
  8180. val += this[offset + --i] * mul
  8181. }
  8182. mul *= 0x80
  8183. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  8184. return val
  8185. }
  8186. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  8187. if (!noAssert) checkOffset(offset, 1, this.length)
  8188. if (!(this[offset] & 0x80)) return (this[offset])
  8189. return ((0xff - this[offset] + 1) * -1)
  8190. }
  8191. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  8192. if (!noAssert) checkOffset(offset, 2, this.length)
  8193. var val = this[offset] | (this[offset + 1] << 8)
  8194. return (val & 0x8000) ? val | 0xFFFF0000 : val
  8195. }
  8196. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  8197. if (!noAssert) checkOffset(offset, 2, this.length)
  8198. var val = this[offset + 1] | (this[offset] << 8)
  8199. return (val & 0x8000) ? val | 0xFFFF0000 : val
  8200. }
  8201. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  8202. if (!noAssert) checkOffset(offset, 4, this.length)
  8203. return (this[offset]) |
  8204. (this[offset + 1] << 8) |
  8205. (this[offset + 2] << 16) |
  8206. (this[offset + 3] << 24)
  8207. }
  8208. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  8209. if (!noAssert) checkOffset(offset, 4, this.length)
  8210. return (this[offset] << 24) |
  8211. (this[offset + 1] << 16) |
  8212. (this[offset + 2] << 8) |
  8213. (this[offset + 3])
  8214. }
  8215. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  8216. if (!noAssert) checkOffset(offset, 4, this.length)
  8217. return ieee754.read(this, offset, true, 23, 4)
  8218. }
  8219. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  8220. if (!noAssert) checkOffset(offset, 4, this.length)
  8221. return ieee754.read(this, offset, false, 23, 4)
  8222. }
  8223. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  8224. if (!noAssert) checkOffset(offset, 8, this.length)
  8225. return ieee754.read(this, offset, true, 52, 8)
  8226. }
  8227. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  8228. if (!noAssert) checkOffset(offset, 8, this.length)
  8229. return ieee754.read(this, offset, false, 52, 8)
  8230. }
  8231. function checkInt (buf, value, offset, ext, max, min) {
  8232. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  8233. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  8234. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  8235. }
  8236. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  8237. value = +value
  8238. offset = offset | 0
  8239. byteLength = byteLength | 0
  8240. if (!noAssert) {
  8241. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  8242. checkInt(this, value, offset, byteLength, maxBytes, 0)
  8243. }
  8244. var mul = 1
  8245. var i = 0
  8246. this[offset] = value & 0xFF
  8247. while (++i < byteLength && (mul *= 0x100)) {
  8248. this[offset + i] = (value / mul) & 0xFF
  8249. }
  8250. return offset + byteLength
  8251. }
  8252. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  8253. value = +value
  8254. offset = offset | 0
  8255. byteLength = byteLength | 0
  8256. if (!noAssert) {
  8257. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  8258. checkInt(this, value, offset, byteLength, maxBytes, 0)
  8259. }
  8260. var i = byteLength - 1
  8261. var mul = 1
  8262. this[offset + i] = value & 0xFF
  8263. while (--i >= 0 && (mul *= 0x100)) {
  8264. this[offset + i] = (value / mul) & 0xFF
  8265. }
  8266. return offset + byteLength
  8267. }
  8268. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  8269. value = +value
  8270. offset = offset | 0
  8271. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  8272. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  8273. this[offset] = (value & 0xff)
  8274. return offset + 1
  8275. }
  8276. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  8277. if (value < 0) value = 0xffff + value + 1
  8278. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  8279. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  8280. (littleEndian ? i : 1 - i) * 8
  8281. }
  8282. }
  8283. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  8284. value = +value
  8285. offset = offset | 0
  8286. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8287. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8288. this[offset] = (value & 0xff)
  8289. this[offset + 1] = (value >>> 8)
  8290. } else {
  8291. objectWriteUInt16(this, value, offset, true)
  8292. }
  8293. return offset + 2
  8294. }
  8295. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  8296. value = +value
  8297. offset = offset | 0
  8298. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8299. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8300. this[offset] = (value >>> 8)
  8301. this[offset + 1] = (value & 0xff)
  8302. } else {
  8303. objectWriteUInt16(this, value, offset, false)
  8304. }
  8305. return offset + 2
  8306. }
  8307. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  8308. if (value < 0) value = 0xffffffff + value + 1
  8309. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  8310. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  8311. }
  8312. }
  8313. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  8314. value = +value
  8315. offset = offset | 0
  8316. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  8317. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8318. this[offset + 3] = (value >>> 24)
  8319. this[offset + 2] = (value >>> 16)
  8320. this[offset + 1] = (value >>> 8)
  8321. this[offset] = (value & 0xff)
  8322. } else {
  8323. objectWriteUInt32(this, value, offset, true)
  8324. }
  8325. return offset + 4
  8326. }
  8327. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  8328. value = +value
  8329. offset = offset | 0
  8330. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  8331. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8332. this[offset] = (value >>> 24)
  8333. this[offset + 1] = (value >>> 16)
  8334. this[offset + 2] = (value >>> 8)
  8335. this[offset + 3] = (value & 0xff)
  8336. } else {
  8337. objectWriteUInt32(this, value, offset, false)
  8338. }
  8339. return offset + 4
  8340. }
  8341. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  8342. value = +value
  8343. offset = offset | 0
  8344. if (!noAssert) {
  8345. var limit = Math.pow(2, 8 * byteLength - 1)
  8346. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  8347. }
  8348. var i = 0
  8349. var mul = 1
  8350. var sub = 0
  8351. this[offset] = value & 0xFF
  8352. while (++i < byteLength && (mul *= 0x100)) {
  8353. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  8354. sub = 1
  8355. }
  8356. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  8357. }
  8358. return offset + byteLength
  8359. }
  8360. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  8361. value = +value
  8362. offset = offset | 0
  8363. if (!noAssert) {
  8364. var limit = Math.pow(2, 8 * byteLength - 1)
  8365. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  8366. }
  8367. var i = byteLength - 1
  8368. var mul = 1
  8369. var sub = 0
  8370. this[offset + i] = value & 0xFF
  8371. while (--i >= 0 && (mul *= 0x100)) {
  8372. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  8373. sub = 1
  8374. }
  8375. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  8376. }
  8377. return offset + byteLength
  8378. }
  8379. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  8380. value = +value
  8381. offset = offset | 0
  8382. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  8383. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  8384. if (value < 0) value = 0xff + value + 1
  8385. this[offset] = (value & 0xff)
  8386. return offset + 1
  8387. }
  8388. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  8389. value = +value
  8390. offset = offset | 0
  8391. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  8392. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8393. this[offset] = (value & 0xff)
  8394. this[offset + 1] = (value >>> 8)
  8395. } else {
  8396. objectWriteUInt16(this, value, offset, true)
  8397. }
  8398. return offset + 2
  8399. }
  8400. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  8401. value = +value
  8402. offset = offset | 0
  8403. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  8404. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8405. this[offset] = (value >>> 8)
  8406. this[offset + 1] = (value & 0xff)
  8407. } else {
  8408. objectWriteUInt16(this, value, offset, false)
  8409. }
  8410. return offset + 2
  8411. }
  8412. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  8413. value = +value
  8414. offset = offset | 0
  8415. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  8416. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8417. this[offset] = (value & 0xff)
  8418. this[offset + 1] = (value >>> 8)
  8419. this[offset + 2] = (value >>> 16)
  8420. this[offset + 3] = (value >>> 24)
  8421. } else {
  8422. objectWriteUInt32(this, value, offset, true)
  8423. }
  8424. return offset + 4
  8425. }
  8426. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  8427. value = +value
  8428. offset = offset | 0
  8429. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  8430. if (value < 0) value = 0xffffffff + value + 1
  8431. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8432. this[offset] = (value >>> 24)
  8433. this[offset + 1] = (value >>> 16)
  8434. this[offset + 2] = (value >>> 8)
  8435. this[offset + 3] = (value & 0xff)
  8436. } else {
  8437. objectWriteUInt32(this, value, offset, false)
  8438. }
  8439. return offset + 4
  8440. }
  8441. function checkIEEE754 (buf, value, offset, ext, max, min) {
  8442. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  8443. if (offset < 0) throw new RangeError('Index out of range')
  8444. }
  8445. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  8446. if (!noAssert) {
  8447. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  8448. }
  8449. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  8450. return offset + 4
  8451. }
  8452. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  8453. return writeFloat(this, value, offset, true, noAssert)
  8454. }
  8455. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  8456. return writeFloat(this, value, offset, false, noAssert)
  8457. }
  8458. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  8459. if (!noAssert) {
  8460. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  8461. }
  8462. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  8463. return offset + 8
  8464. }
  8465. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  8466. return writeDouble(this, value, offset, true, noAssert)
  8467. }
  8468. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  8469. return writeDouble(this, value, offset, false, noAssert)
  8470. }
  8471. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  8472. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  8473. if (!start) start = 0
  8474. if (!end && end !== 0) end = this.length
  8475. if (targetStart >= target.length) targetStart = target.length
  8476. if (!targetStart) targetStart = 0
  8477. if (end > 0 && end < start) end = start
  8478. // Copy 0 bytes; we're done
  8479. if (end === start) return 0
  8480. if (target.length === 0 || this.length === 0) return 0
  8481. // Fatal error conditions
  8482. if (targetStart < 0) {
  8483. throw new RangeError('targetStart out of bounds')
  8484. }
  8485. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  8486. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  8487. // Are we oob?
  8488. if (end > this.length) end = this.length
  8489. if (target.length - targetStart < end - start) {
  8490. end = target.length - targetStart + start
  8491. }
  8492. var len = end - start
  8493. var i
  8494. if (this === target && start < targetStart && targetStart < end) {
  8495. // descending copy from end
  8496. for (i = len - 1; i >= 0; --i) {
  8497. target[i + targetStart] = this[i + start]
  8498. }
  8499. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  8500. // ascending copy from start
  8501. for (i = 0; i < len; ++i) {
  8502. target[i + targetStart] = this[i + start]
  8503. }
  8504. } else {
  8505. Uint8Array.prototype.set.call(
  8506. target,
  8507. this.subarray(start, start + len),
  8508. targetStart
  8509. )
  8510. }
  8511. return len
  8512. }
  8513. // Usage:
  8514. // buffer.fill(number[, offset[, end]])
  8515. // buffer.fill(buffer[, offset[, end]])
  8516. // buffer.fill(string[, offset[, end]][, encoding])
  8517. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  8518. // Handle string cases:
  8519. if (typeof val === 'string') {
  8520. if (typeof start === 'string') {
  8521. encoding = start
  8522. start = 0
  8523. end = this.length
  8524. } else if (typeof end === 'string') {
  8525. encoding = end
  8526. end = this.length
  8527. }
  8528. if (val.length === 1) {
  8529. var code = val.charCodeAt(0)
  8530. if (code < 256) {
  8531. val = code
  8532. }
  8533. }
  8534. if (encoding !== undefined && typeof encoding !== 'string') {
  8535. throw new TypeError('encoding must be a string')
  8536. }
  8537. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  8538. throw new TypeError('Unknown encoding: ' + encoding)
  8539. }
  8540. } else if (typeof val === 'number') {
  8541. val = val & 255
  8542. }
  8543. // Invalid ranges are not set to a default, so can range check early.
  8544. if (start < 0 || this.length < start || this.length < end) {
  8545. throw new RangeError('Out of range index')
  8546. }
  8547. if (end <= start) {
  8548. return this
  8549. }
  8550. start = start >>> 0
  8551. end = end === undefined ? this.length : end >>> 0
  8552. if (!val) val = 0
  8553. var i
  8554. if (typeof val === 'number') {
  8555. for (i = start; i < end; ++i) {
  8556. this[i] = val
  8557. }
  8558. } else {
  8559. var bytes = Buffer.isBuffer(val)
  8560. ? val
  8561. : utf8ToBytes(new Buffer(val, encoding).toString())
  8562. var len = bytes.length
  8563. for (i = 0; i < end - start; ++i) {
  8564. this[i + start] = bytes[i % len]
  8565. }
  8566. }
  8567. return this
  8568. }
  8569. // HELPER FUNCTIONS
  8570. // ================
  8571. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  8572. function base64clean (str) {
  8573. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  8574. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  8575. // Node converts strings with length < 2 to ''
  8576. if (str.length < 2) return ''
  8577. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  8578. while (str.length % 4 !== 0) {
  8579. str = str + '='
  8580. }
  8581. return str
  8582. }
  8583. function stringtrim (str) {
  8584. if (str.trim) return str.trim()
  8585. return str.replace(/^\s+|\s+$/g, '')
  8586. }
  8587. function toHex (n) {
  8588. if (n < 16) return '0' + n.toString(16)
  8589. return n.toString(16)
  8590. }
  8591. function utf8ToBytes (string, units) {
  8592. units = units || Infinity
  8593. var codePoint
  8594. var length = string.length
  8595. var leadSurrogate = null
  8596. var bytes = []
  8597. for (var i = 0; i < length; ++i) {
  8598. codePoint = string.charCodeAt(i)
  8599. // is surrogate component
  8600. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  8601. // last char was a lead
  8602. if (!leadSurrogate) {
  8603. // no lead yet
  8604. if (codePoint > 0xDBFF) {
  8605. // unexpected trail
  8606. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8607. continue
  8608. } else if (i + 1 === length) {
  8609. // unpaired lead
  8610. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8611. continue
  8612. }
  8613. // valid lead
  8614. leadSurrogate = codePoint
  8615. continue
  8616. }
  8617. // 2 leads in a row
  8618. if (codePoint < 0xDC00) {
  8619. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8620. leadSurrogate = codePoint
  8621. continue
  8622. }
  8623. // valid surrogate pair
  8624. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  8625. } else if (leadSurrogate) {
  8626. // valid bmp char, but last char was a lead
  8627. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8628. }
  8629. leadSurrogate = null
  8630. // encode utf8
  8631. if (codePoint < 0x80) {
  8632. if ((units -= 1) < 0) break
  8633. bytes.push(codePoint)
  8634. } else if (codePoint < 0x800) {
  8635. if ((units -= 2) < 0) break
  8636. bytes.push(
  8637. codePoint >> 0x6 | 0xC0,
  8638. codePoint & 0x3F | 0x80
  8639. )
  8640. } else if (codePoint < 0x10000) {
  8641. if ((units -= 3) < 0) break
  8642. bytes.push(
  8643. codePoint >> 0xC | 0xE0,
  8644. codePoint >> 0x6 & 0x3F | 0x80,
  8645. codePoint & 0x3F | 0x80
  8646. )
  8647. } else if (codePoint < 0x110000) {
  8648. if ((units -= 4) < 0) break
  8649. bytes.push(
  8650. codePoint >> 0x12 | 0xF0,
  8651. codePoint >> 0xC & 0x3F | 0x80,
  8652. codePoint >> 0x6 & 0x3F | 0x80,
  8653. codePoint & 0x3F | 0x80
  8654. )
  8655. } else {
  8656. throw new Error('Invalid code point')
  8657. }
  8658. }
  8659. return bytes
  8660. }
  8661. function asciiToBytes (str) {
  8662. var byteArray = []
  8663. for (var i = 0; i < str.length; ++i) {
  8664. // Node's code seems to be doing this and not & 0x7F..
  8665. byteArray.push(str.charCodeAt(i) & 0xFF)
  8666. }
  8667. return byteArray
  8668. }
  8669. function utf16leToBytes (str, units) {
  8670. var c, hi, lo
  8671. var byteArray = []
  8672. for (var i = 0; i < str.length; ++i) {
  8673. if ((units -= 2) < 0) break
  8674. c = str.charCodeAt(i)
  8675. hi = c >> 8
  8676. lo = c % 256
  8677. byteArray.push(lo)
  8678. byteArray.push(hi)
  8679. }
  8680. return byteArray
  8681. }
  8682. function base64ToBytes (str) {
  8683. return base64.toByteArray(base64clean(str))
  8684. }
  8685. function blitBuffer (src, dst, offset, length) {
  8686. for (var i = 0; i < length; ++i) {
  8687. if ((i + offset >= dst.length) || (i >= src.length)) break
  8688. dst[i + offset] = src[i]
  8689. }
  8690. return i
  8691. }
  8692. function isnan (val) {
  8693. return val !== val // eslint-disable-line no-self-compare
  8694. }
  8695. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  8696. /***/ }),
  8697. /***/ "./node_modules/classnames/index.js":
  8698. /*!******************************************!*\
  8699. !*** ./node_modules/classnames/index.js ***!
  8700. \******************************************/
  8701. /*! no static exports found */
  8702. /***/ (function(module, exports, __webpack_require__) {
  8703. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  8704. Copyright (c) 2017 Jed Watson.
  8705. Licensed under the MIT License (MIT), see
  8706. http://jedwatson.github.io/classnames
  8707. */
  8708. /* global define */
  8709. (function () {
  8710. 'use strict';
  8711. var hasOwn = {}.hasOwnProperty;
  8712. function classNames () {
  8713. var classes = [];
  8714. for (var i = 0; i < arguments.length; i++) {
  8715. var arg = arguments[i];
  8716. if (!arg) continue;
  8717. var argType = typeof arg;
  8718. if (argType === 'string' || argType === 'number') {
  8719. classes.push(arg);
  8720. } else if (Array.isArray(arg) && arg.length) {
  8721. var inner = classNames.apply(null, arg);
  8722. if (inner) {
  8723. classes.push(inner);
  8724. }
  8725. } else if (argType === 'object') {
  8726. for (var key in arg) {
  8727. if (hasOwn.call(arg, key) && arg[key]) {
  8728. classes.push(key);
  8729. }
  8730. }
  8731. }
  8732. }
  8733. return classes.join(' ');
  8734. }
  8735. if ( true && module.exports) {
  8736. classNames.default = classNames;
  8737. module.exports = classNames;
  8738. } else if (true) {
  8739. // register as 'classnames', consistent with npm package name
  8740. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  8741. return classNames;
  8742. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  8743. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  8744. } else {}
  8745. }());
  8746. /***/ }),
  8747. /***/ "./node_modules/create-react-context/lib/implementation.js":
  8748. /*!*****************************************************************!*\
  8749. !*** ./node_modules/create-react-context/lib/implementation.js ***!
  8750. \*****************************************************************/
  8751. /*! no static exports found */
  8752. /***/ (function(module, exports, __webpack_require__) {
  8753. "use strict";
  8754. exports.__esModule = true;
  8755. var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  8756. var _react2 = _interopRequireDefault(_react);
  8757. var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  8758. var _propTypes2 = _interopRequireDefault(_propTypes);
  8759. var _gud = __webpack_require__(/*! gud */ "./node_modules/gud/index.js");
  8760. var _gud2 = _interopRequireDefault(_gud);
  8761. var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
  8762. var _warning2 = _interopRequireDefault(_warning);
  8763. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8764. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8765. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8766. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8767. var MAX_SIGNED_31_BIT_INT = 1073741823;
  8768. // Inlined Object.is polyfill.
  8769. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  8770. function objectIs(x, y) {
  8771. if (x === y) {
  8772. return x !== 0 || 1 / x === 1 / y;
  8773. } else {
  8774. return x !== x && y !== y;
  8775. }
  8776. }
  8777. function createEventEmitter(value) {
  8778. var handlers = [];
  8779. return {
  8780. on: function on(handler) {
  8781. handlers.push(handler);
  8782. },
  8783. off: function off(handler) {
  8784. handlers = handlers.filter(function (h) {
  8785. return h !== handler;
  8786. });
  8787. },
  8788. get: function get() {
  8789. return value;
  8790. },
  8791. set: function set(newValue, changedBits) {
  8792. value = newValue;
  8793. handlers.forEach(function (handler) {
  8794. return handler(value, changedBits);
  8795. });
  8796. }
  8797. };
  8798. }
  8799. function onlyChild(children) {
  8800. return Array.isArray(children) ? children[0] : children;
  8801. }
  8802. function createReactContext(defaultValue, calculateChangedBits) {
  8803. var _Provider$childContex, _Consumer$contextType;
  8804. var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';
  8805. var Provider = function (_Component) {
  8806. _inherits(Provider, _Component);
  8807. function Provider() {
  8808. var _temp, _this, _ret;
  8809. _classCallCheck(this, Provider);
  8810. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8811. args[_key] = arguments[_key];
  8812. }
  8813. return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
  8814. }
  8815. Provider.prototype.getChildContext = function getChildContext() {
  8816. var _ref;
  8817. return _ref = {}, _ref[contextProp] = this.emitter, _ref;
  8818. };
  8819. Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
  8820. if (this.props.value !== nextProps.value) {
  8821. var oldValue = this.props.value;
  8822. var newValue = nextProps.value;
  8823. var changedBits = void 0;
  8824. if (objectIs(oldValue, newValue)) {
  8825. changedBits = 0; // No change
  8826. } else {
  8827. changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
  8828. if (true) {
  8829. (0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
  8830. }
  8831. changedBits |= 0;
  8832. if (changedBits !== 0) {
  8833. this.emitter.set(nextProps.value, changedBits);
  8834. }
  8835. }
  8836. }
  8837. };
  8838. Provider.prototype.render = function render() {
  8839. return this.props.children;
  8840. };
  8841. return Provider;
  8842. }(_react.Component);
  8843. Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);
  8844. var Consumer = function (_Component2) {
  8845. _inherits(Consumer, _Component2);
  8846. function Consumer() {
  8847. var _temp2, _this2, _ret2;
  8848. _classCallCheck(this, Consumer);
  8849. for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  8850. args[_key2] = arguments[_key2];
  8851. }
  8852. return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {
  8853. value: _this2.getValue()
  8854. }, _this2.onUpdate = function (newValue, changedBits) {
  8855. var observedBits = _this2.observedBits | 0;
  8856. if ((observedBits & changedBits) !== 0) {
  8857. _this2.setState({ value: _this2.getValue() });
  8858. }
  8859. }, _temp2), _possibleConstructorReturn(_this2, _ret2);
  8860. }
  8861. Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
  8862. var observedBits = nextProps.observedBits;
  8863. this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
  8864. : observedBits;
  8865. };
  8866. Consumer.prototype.componentDidMount = function componentDidMount() {
  8867. if (this.context[contextProp]) {
  8868. this.context[contextProp].on(this.onUpdate);
  8869. }
  8870. var observedBits = this.props.observedBits;
  8871. this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
  8872. : observedBits;
  8873. };
  8874. Consumer.prototype.componentWillUnmount = function componentWillUnmount() {
  8875. if (this.context[contextProp]) {
  8876. this.context[contextProp].off(this.onUpdate);
  8877. }
  8878. };
  8879. Consumer.prototype.getValue = function getValue() {
  8880. if (this.context[contextProp]) {
  8881. return this.context[contextProp].get();
  8882. } else {
  8883. return defaultValue;
  8884. }
  8885. };
  8886. Consumer.prototype.render = function render() {
  8887. return onlyChild(this.props.children)(this.state.value);
  8888. };
  8889. return Consumer;
  8890. }(_react.Component);
  8891. Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);
  8892. return {
  8893. Provider: Provider,
  8894. Consumer: Consumer
  8895. };
  8896. }
  8897. exports.default = createReactContext;
  8898. module.exports = exports['default'];
  8899. /***/ }),
  8900. /***/ "./node_modules/create-react-context/lib/index.js":
  8901. /*!********************************************************!*\
  8902. !*** ./node_modules/create-react-context/lib/index.js ***!
  8903. \********************************************************/
  8904. /*! no static exports found */
  8905. /***/ (function(module, exports, __webpack_require__) {
  8906. "use strict";
  8907. exports.__esModule = true;
  8908. var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  8909. var _react2 = _interopRequireDefault(_react);
  8910. var _implementation = __webpack_require__(/*! ./implementation */ "./node_modules/create-react-context/lib/implementation.js");
  8911. var _implementation2 = _interopRequireDefault(_implementation);
  8912. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8913. exports.default = _react2.default.createContext || _implementation2.default;
  8914. module.exports = exports['default'];
  8915. /***/ }),
  8916. /***/ "./node_modules/dom-helpers/activeElement.js":
  8917. /*!***************************************************!*\
  8918. !*** ./node_modules/dom-helpers/activeElement.js ***!
  8919. \***************************************************/
  8920. /*! no static exports found */
  8921. /***/ (function(module, exports, __webpack_require__) {
  8922. "use strict";
  8923. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  8924. exports.__esModule = true;
  8925. exports.default = activeElement;
  8926. var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! ./ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
  8927. function activeElement(doc) {
  8928. if (doc === void 0) {
  8929. doc = (0, _ownerDocument.default)();
  8930. }
  8931. try {
  8932. return doc.activeElement;
  8933. } catch (e) {
  8934. /* ie throws if no active element */
  8935. }
  8936. }
  8937. module.exports = exports["default"];
  8938. /***/ }),
  8939. /***/ "./node_modules/dom-helpers/class/addClass.js":
  8940. /*!****************************************************!*\
  8941. !*** ./node_modules/dom-helpers/class/addClass.js ***!
  8942. \****************************************************/
  8943. /*! no static exports found */
  8944. /***/ (function(module, exports, __webpack_require__) {
  8945. "use strict";
  8946. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  8947. exports.__esModule = true;
  8948. exports.default = addClass;
  8949. var _hasClass = _interopRequireDefault(__webpack_require__(/*! ./hasClass */ "./node_modules/dom-helpers/class/hasClass.js"));
  8950. function addClass(element, className) {
  8951. if (element.classList) element.classList.add(className);else if (!(0, _hasClass.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);
  8952. }
  8953. module.exports = exports["default"];
  8954. /***/ }),
  8955. /***/ "./node_modules/dom-helpers/class/hasClass.js":
  8956. /*!****************************************************!*\
  8957. !*** ./node_modules/dom-helpers/class/hasClass.js ***!
  8958. \****************************************************/
  8959. /*! no static exports found */
  8960. /***/ (function(module, exports, __webpack_require__) {
  8961. "use strict";
  8962. exports.__esModule = true;
  8963. exports.default = hasClass;
  8964. function hasClass(element, className) {
  8965. if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
  8966. }
  8967. module.exports = exports["default"];
  8968. /***/ }),
  8969. /***/ "./node_modules/dom-helpers/class/index.js":
  8970. /*!*************************************************!*\
  8971. !*** ./node_modules/dom-helpers/class/index.js ***!
  8972. \*************************************************/
  8973. /*! no static exports found */
  8974. /***/ (function(module, exports, __webpack_require__) {
  8975. "use strict";
  8976. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  8977. exports.__esModule = true;
  8978. exports.default = void 0;
  8979. var _addClass = _interopRequireDefault(__webpack_require__(/*! ./addClass */ "./node_modules/dom-helpers/class/addClass.js"));
  8980. exports.addClass = _addClass.default;
  8981. var _removeClass = _interopRequireDefault(__webpack_require__(/*! ./removeClass */ "./node_modules/dom-helpers/class/removeClass.js"));
  8982. exports.removeClass = _removeClass.default;
  8983. var _hasClass = _interopRequireDefault(__webpack_require__(/*! ./hasClass */ "./node_modules/dom-helpers/class/hasClass.js"));
  8984. exports.hasClass = _hasClass.default;
  8985. var _default = {
  8986. addClass: _addClass.default,
  8987. removeClass: _removeClass.default,
  8988. hasClass: _hasClass.default
  8989. };
  8990. exports.default = _default;
  8991. /***/ }),
  8992. /***/ "./node_modules/dom-helpers/class/removeClass.js":
  8993. /*!*******************************************************!*\
  8994. !*** ./node_modules/dom-helpers/class/removeClass.js ***!
  8995. \*******************************************************/
  8996. /*! no static exports found */
  8997. /***/ (function(module, exports, __webpack_require__) {
  8998. "use strict";
  8999. function replaceClassName(origClass, classToRemove) {
  9000. return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
  9001. }
  9002. module.exports = function removeClass(element, className) {
  9003. if (element.classList) element.classList.remove(className);else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className);else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
  9004. };
  9005. /***/ }),
  9006. /***/ "./node_modules/dom-helpers/events/filter.js":
  9007. /*!***************************************************!*\
  9008. !*** ./node_modules/dom-helpers/events/filter.js ***!
  9009. \***************************************************/
  9010. /*! no static exports found */
  9011. /***/ (function(module, exports, __webpack_require__) {
  9012. "use strict";
  9013. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9014. exports.__esModule = true;
  9015. exports.default = filterEvents;
  9016. var _contains = _interopRequireDefault(__webpack_require__(/*! ../query/contains */ "./node_modules/dom-helpers/query/contains.js"));
  9017. var _querySelectorAll = _interopRequireDefault(__webpack_require__(/*! ../query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js"));
  9018. function filterEvents(selector, handler) {
  9019. return function filterHandler(e) {
  9020. var top = e.currentTarget,
  9021. target = e.target,
  9022. matches = (0, _querySelectorAll.default)(top, selector);
  9023. if (matches.some(function (match) {
  9024. return (0, _contains.default)(match, target);
  9025. })) handler.call(this, e);
  9026. };
  9027. }
  9028. module.exports = exports["default"];
  9029. /***/ }),
  9030. /***/ "./node_modules/dom-helpers/events/index.js":
  9031. /*!**************************************************!*\
  9032. !*** ./node_modules/dom-helpers/events/index.js ***!
  9033. \**************************************************/
  9034. /*! no static exports found */
  9035. /***/ (function(module, exports, __webpack_require__) {
  9036. "use strict";
  9037. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9038. exports.__esModule = true;
  9039. exports.default = void 0;
  9040. var _on = _interopRequireDefault(__webpack_require__(/*! ./on */ "./node_modules/dom-helpers/events/on.js"));
  9041. exports.on = _on.default;
  9042. var _off = _interopRequireDefault(__webpack_require__(/*! ./off */ "./node_modules/dom-helpers/events/off.js"));
  9043. exports.off = _off.default;
  9044. var _filter = _interopRequireDefault(__webpack_require__(/*! ./filter */ "./node_modules/dom-helpers/events/filter.js"));
  9045. exports.filter = _filter.default;
  9046. var _listen = _interopRequireDefault(__webpack_require__(/*! ./listen */ "./node_modules/dom-helpers/events/listen.js"));
  9047. exports.listen = _listen.default;
  9048. var _default = {
  9049. on: _on.default,
  9050. off: _off.default,
  9051. filter: _filter.default,
  9052. listen: _listen.default
  9053. };
  9054. exports.default = _default;
  9055. /***/ }),
  9056. /***/ "./node_modules/dom-helpers/events/listen.js":
  9057. /*!***************************************************!*\
  9058. !*** ./node_modules/dom-helpers/events/listen.js ***!
  9059. \***************************************************/
  9060. /*! no static exports found */
  9061. /***/ (function(module, exports, __webpack_require__) {
  9062. "use strict";
  9063. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9064. exports.__esModule = true;
  9065. exports.default = void 0;
  9066. var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  9067. var _on = _interopRequireDefault(__webpack_require__(/*! ./on */ "./node_modules/dom-helpers/events/on.js"));
  9068. var _off = _interopRequireDefault(__webpack_require__(/*! ./off */ "./node_modules/dom-helpers/events/off.js"));
  9069. var listen = function listen() {};
  9070. if (_inDOM.default) {
  9071. listen = function listen(node, eventName, handler, capture) {
  9072. (0, _on.default)(node, eventName, handler, capture);
  9073. return function () {
  9074. (0, _off.default)(node, eventName, handler, capture);
  9075. };
  9076. };
  9077. }
  9078. var _default = listen;
  9079. exports.default = _default;
  9080. module.exports = exports["default"];
  9081. /***/ }),
  9082. /***/ "./node_modules/dom-helpers/events/off.js":
  9083. /*!************************************************!*\
  9084. !*** ./node_modules/dom-helpers/events/off.js ***!
  9085. \************************************************/
  9086. /*! no static exports found */
  9087. /***/ (function(module, exports, __webpack_require__) {
  9088. "use strict";
  9089. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9090. exports.__esModule = true;
  9091. exports.default = void 0;
  9092. var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  9093. var off = function off() {};
  9094. if (_inDOM.default) {
  9095. off = function () {
  9096. if (document.addEventListener) return function (node, eventName, handler, capture) {
  9097. return node.removeEventListener(eventName, handler, capture || false);
  9098. };else if (document.attachEvent) return function (node, eventName, handler) {
  9099. return node.detachEvent('on' + eventName, handler);
  9100. };
  9101. }();
  9102. }
  9103. var _default = off;
  9104. exports.default = _default;
  9105. module.exports = exports["default"];
  9106. /***/ }),
  9107. /***/ "./node_modules/dom-helpers/events/on.js":
  9108. /*!***********************************************!*\
  9109. !*** ./node_modules/dom-helpers/events/on.js ***!
  9110. \***********************************************/
  9111. /*! no static exports found */
  9112. /***/ (function(module, exports, __webpack_require__) {
  9113. "use strict";
  9114. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9115. exports.__esModule = true;
  9116. exports.default = void 0;
  9117. var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  9118. var on = function on() {};
  9119. if (_inDOM.default) {
  9120. on = function () {
  9121. if (document.addEventListener) return function (node, eventName, handler, capture) {
  9122. return node.addEventListener(eventName, handler, capture || false);
  9123. };else if (document.attachEvent) return function (node, eventName, handler) {
  9124. return node.attachEvent('on' + eventName, function (e) {
  9125. e = e || window.event;
  9126. e.target = e.target || e.srcElement;
  9127. e.currentTarget = node;
  9128. handler.call(node, e);
  9129. });
  9130. };
  9131. }();
  9132. }
  9133. var _default = on;
  9134. exports.default = _default;
  9135. module.exports = exports["default"];
  9136. /***/ }),
  9137. /***/ "./node_modules/dom-helpers/ownerDocument.js":
  9138. /*!***************************************************!*\
  9139. !*** ./node_modules/dom-helpers/ownerDocument.js ***!
  9140. \***************************************************/
  9141. /*! no static exports found */
  9142. /***/ (function(module, exports, __webpack_require__) {
  9143. "use strict";
  9144. exports.__esModule = true;
  9145. exports.default = ownerDocument;
  9146. function ownerDocument(node) {
  9147. return node && node.ownerDocument || document;
  9148. }
  9149. module.exports = exports["default"];
  9150. /***/ }),
  9151. /***/ "./node_modules/dom-helpers/query/contains.js":
  9152. /*!****************************************************!*\
  9153. !*** ./node_modules/dom-helpers/query/contains.js ***!
  9154. \****************************************************/
  9155. /*! no static exports found */
  9156. /***/ (function(module, exports, __webpack_require__) {
  9157. "use strict";
  9158. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9159. exports.__esModule = true;
  9160. exports.default = void 0;
  9161. var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  9162. var _default = function () {
  9163. // HTML DOM and SVG DOM may have different support levels,
  9164. // so we need to check on context instead of a document root element.
  9165. return _inDOM.default ? function (context, node) {
  9166. if (context.contains) {
  9167. return context.contains(node);
  9168. } else if (context.compareDocumentPosition) {
  9169. return context === node || !!(context.compareDocumentPosition(node) & 16);
  9170. } else {
  9171. return fallback(context, node);
  9172. }
  9173. } : fallback;
  9174. }();
  9175. exports.default = _default;
  9176. function fallback(context, node) {
  9177. if (node) do {
  9178. if (node === context) return true;
  9179. } while (node = node.parentNode);
  9180. return false;
  9181. }
  9182. module.exports = exports["default"];
  9183. /***/ }),
  9184. /***/ "./node_modules/dom-helpers/query/isWindow.js":
  9185. /*!****************************************************!*\
  9186. !*** ./node_modules/dom-helpers/query/isWindow.js ***!
  9187. \****************************************************/
  9188. /*! no static exports found */
  9189. /***/ (function(module, exports, __webpack_require__) {
  9190. "use strict";
  9191. exports.__esModule = true;
  9192. exports.default = getWindow;
  9193. function getWindow(node) {
  9194. return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false;
  9195. }
  9196. module.exports = exports["default"];
  9197. /***/ }),
  9198. /***/ "./node_modules/dom-helpers/query/matches.js":
  9199. /*!***************************************************!*\
  9200. !*** ./node_modules/dom-helpers/query/matches.js ***!
  9201. \***************************************************/
  9202. /*! no static exports found */
  9203. /***/ (function(module, exports, __webpack_require__) {
  9204. "use strict";
  9205. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9206. exports.__esModule = true;
  9207. exports.default = matches;
  9208. var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  9209. var _querySelectorAll = _interopRequireDefault(__webpack_require__(/*! ./querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js"));
  9210. var matchesCache;
  9211. function matches(node, selector) {
  9212. if (!matchesCache && _inDOM.default) {
  9213. var body = document.body;
  9214. var nativeMatch = body.matches || body.matchesSelector || body.webkitMatchesSelector || body.mozMatchesSelector || body.msMatchesSelector;
  9215. matchesCache = nativeMatch ? function (node, selector) {
  9216. return nativeMatch.call(node, selector);
  9217. } : ie8MatchesSelector;
  9218. }
  9219. return matchesCache ? matchesCache(node, selector) : null;
  9220. }
  9221. function ie8MatchesSelector(node, selector) {
  9222. var matches = (0, _querySelectorAll.default)(node.document || node.ownerDocument, selector),
  9223. i = 0;
  9224. while (matches[i] && matches[i] !== node) {
  9225. i++;
  9226. }
  9227. return !!matches[i];
  9228. }
  9229. module.exports = exports["default"];
  9230. /***/ }),
  9231. /***/ "./node_modules/dom-helpers/query/querySelectorAll.js":
  9232. /*!************************************************************!*\
  9233. !*** ./node_modules/dom-helpers/query/querySelectorAll.js ***!
  9234. \************************************************************/
  9235. /*! no static exports found */
  9236. /***/ (function(module, exports, __webpack_require__) {
  9237. "use strict";
  9238. exports.__esModule = true;
  9239. exports.default = qsa;
  9240. // Zepto.js
  9241. // (c) 2010-2015 Thomas Fuchs
  9242. // Zepto.js may be freely distributed under the MIT license.
  9243. var simpleSelectorRE = /^[\w-]*$/;
  9244. var toArray = Function.prototype.bind.call(Function.prototype.call, [].slice);
  9245. function qsa(element, selector) {
  9246. var maybeID = selector[0] === '#',
  9247. maybeClass = selector[0] === '.',
  9248. nameOnly = maybeID || maybeClass ? selector.slice(1) : selector,
  9249. isSimple = simpleSelectorRE.test(nameOnly),
  9250. found;
  9251. if (isSimple) {
  9252. if (maybeID) {
  9253. element = element.getElementById ? element : document;
  9254. return (found = element.getElementById(nameOnly)) ? [found] : [];
  9255. }
  9256. if (element.getElementsByClassName && maybeClass) return toArray(element.getElementsByClassName(nameOnly));
  9257. return toArray(element.getElementsByTagName(selector));
  9258. }
  9259. return toArray(element.querySelectorAll(selector));
  9260. }
  9261. module.exports = exports["default"];
  9262. /***/ }),
  9263. /***/ "./node_modules/dom-helpers/style/getComputedStyle.js":
  9264. /*!************************************************************!*\
  9265. !*** ./node_modules/dom-helpers/style/getComputedStyle.js ***!
  9266. \************************************************************/
  9267. /*! no static exports found */
  9268. /***/ (function(module, exports, __webpack_require__) {
  9269. "use strict";
  9270. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9271. exports.__esModule = true;
  9272. exports.default = _getComputedStyle;
  9273. var _camelizeStyle = _interopRequireDefault(__webpack_require__(/*! ../util/camelizeStyle */ "./node_modules/dom-helpers/util/camelizeStyle.js"));
  9274. var rposition = /^(top|right|bottom|left)$/;
  9275. var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;
  9276. function _getComputedStyle(node) {
  9277. if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');
  9278. var doc = node.ownerDocument;
  9279. return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
  9280. //ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72
  9281. getPropertyValue: function getPropertyValue(prop) {
  9282. var style = node.style;
  9283. prop = (0, _camelizeStyle.default)(prop);
  9284. if (prop == 'float') prop = 'styleFloat';
  9285. var current = node.currentStyle[prop] || null;
  9286. if (current == null && style && style[prop]) current = style[prop];
  9287. if (rnumnonpx.test(current) && !rposition.test(prop)) {
  9288. // Remember the original values
  9289. var left = style.left;
  9290. var runStyle = node.runtimeStyle;
  9291. var rsLeft = runStyle && runStyle.left; // Put in the new values to get a computed value out
  9292. if (rsLeft) runStyle.left = node.currentStyle.left;
  9293. style.left = prop === 'fontSize' ? '1em' : current;
  9294. current = style.pixelLeft + 'px'; // Revert the changed values
  9295. style.left = left;
  9296. if (rsLeft) runStyle.left = rsLeft;
  9297. }
  9298. return current;
  9299. }
  9300. };
  9301. }
  9302. module.exports = exports["default"];
  9303. /***/ }),
  9304. /***/ "./node_modules/dom-helpers/style/index.js":
  9305. /*!*************************************************!*\
  9306. !*** ./node_modules/dom-helpers/style/index.js ***!
  9307. \*************************************************/
  9308. /*! no static exports found */
  9309. /***/ (function(module, exports, __webpack_require__) {
  9310. "use strict";
  9311. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9312. exports.__esModule = true;
  9313. exports.default = style;
  9314. var _camelizeStyle = _interopRequireDefault(__webpack_require__(/*! ../util/camelizeStyle */ "./node_modules/dom-helpers/util/camelizeStyle.js"));
  9315. var _hyphenateStyle = _interopRequireDefault(__webpack_require__(/*! ../util/hyphenateStyle */ "./node_modules/dom-helpers/util/hyphenateStyle.js"));
  9316. var _getComputedStyle2 = _interopRequireDefault(__webpack_require__(/*! ./getComputedStyle */ "./node_modules/dom-helpers/style/getComputedStyle.js"));
  9317. var _removeStyle = _interopRequireDefault(__webpack_require__(/*! ./removeStyle */ "./node_modules/dom-helpers/style/removeStyle.js"));
  9318. var _properties = __webpack_require__(/*! ../transition/properties */ "./node_modules/dom-helpers/transition/properties.js");
  9319. var _isTransform = _interopRequireDefault(__webpack_require__(/*! ../transition/isTransform */ "./node_modules/dom-helpers/transition/isTransform.js"));
  9320. function style(node, property, value) {
  9321. var css = '';
  9322. var transforms = '';
  9323. var props = property;
  9324. if (typeof property === 'string') {
  9325. if (value === undefined) {
  9326. return node.style[(0, _camelizeStyle.default)(property)] || (0, _getComputedStyle2.default)(node).getPropertyValue((0, _hyphenateStyle.default)(property));
  9327. } else {
  9328. (props = {})[property] = value;
  9329. }
  9330. }
  9331. Object.keys(props).forEach(function (key) {
  9332. var value = props[key];
  9333. if (!value && value !== 0) {
  9334. (0, _removeStyle.default)(node, (0, _hyphenateStyle.default)(key));
  9335. } else if ((0, _isTransform.default)(key)) {
  9336. transforms += key + "(" + value + ") ";
  9337. } else {
  9338. css += (0, _hyphenateStyle.default)(key) + ": " + value + ";";
  9339. }
  9340. });
  9341. if (transforms) {
  9342. css += _properties.transform + ": " + transforms + ";";
  9343. }
  9344. node.style.cssText += ';' + css;
  9345. }
  9346. module.exports = exports["default"];
  9347. /***/ }),
  9348. /***/ "./node_modules/dom-helpers/style/removeStyle.js":
  9349. /*!*******************************************************!*\
  9350. !*** ./node_modules/dom-helpers/style/removeStyle.js ***!
  9351. \*******************************************************/
  9352. /*! no static exports found */
  9353. /***/ (function(module, exports, __webpack_require__) {
  9354. "use strict";
  9355. exports.__esModule = true;
  9356. exports.default = removeStyle;
  9357. function removeStyle(node, key) {
  9358. return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);
  9359. }
  9360. module.exports = exports["default"];
  9361. /***/ }),
  9362. /***/ "./node_modules/dom-helpers/transition/end.js":
  9363. /*!****************************************************!*\
  9364. !*** ./node_modules/dom-helpers/transition/end.js ***!
  9365. \****************************************************/
  9366. /*! no static exports found */
  9367. /***/ (function(module, exports, __webpack_require__) {
  9368. "use strict";
  9369. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9370. exports.__esModule = true;
  9371. exports.default = void 0;
  9372. var _properties = _interopRequireDefault(__webpack_require__(/*! ./properties */ "./node_modules/dom-helpers/transition/properties.js"));
  9373. var _style = _interopRequireDefault(__webpack_require__(/*! ../style */ "./node_modules/dom-helpers/style/index.js"));
  9374. function onEnd(node, handler, duration) {
  9375. var fakeEvent = {
  9376. target: node,
  9377. currentTarget: node
  9378. },
  9379. backup;
  9380. if (!_properties.default.end) duration = 0;else if (duration == null) duration = parseDuration(node) || 0;
  9381. if (_properties.default.end) {
  9382. node.addEventListener(_properties.default.end, done, false);
  9383. backup = setTimeout(function () {
  9384. return done(fakeEvent);
  9385. }, (duration || 100) * 1.5);
  9386. } else setTimeout(done.bind(null, fakeEvent), 0);
  9387. function done(event) {
  9388. if (event.target !== event.currentTarget) return;
  9389. clearTimeout(backup);
  9390. event.target.removeEventListener(_properties.default.end, done);
  9391. handler.call(this);
  9392. }
  9393. }
  9394. onEnd._parseDuration = parseDuration;
  9395. var _default = onEnd;
  9396. exports.default = _default;
  9397. function parseDuration(node) {
  9398. var str = (0, _style.default)(node, _properties.default.duration),
  9399. mult = str.indexOf('ms') === -1 ? 1000 : 1;
  9400. return parseFloat(str) * mult;
  9401. }
  9402. module.exports = exports["default"];
  9403. /***/ }),
  9404. /***/ "./node_modules/dom-helpers/transition/index.js":
  9405. /*!******************************************************!*\
  9406. !*** ./node_modules/dom-helpers/transition/index.js ***!
  9407. \******************************************************/
  9408. /*! no static exports found */
  9409. /***/ (function(module, exports, __webpack_require__) {
  9410. "use strict";
  9411. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9412. exports.__esModule = true;
  9413. exports.default = void 0;
  9414. var _end = _interopRequireDefault(__webpack_require__(/*! ./end */ "./node_modules/dom-helpers/transition/end.js"));
  9415. exports.end = _end.default;
  9416. var _properties = _interopRequireDefault(__webpack_require__(/*! ./properties */ "./node_modules/dom-helpers/transition/properties.js"));
  9417. exports.properties = _properties.default;
  9418. var _default = {
  9419. end: _end.default,
  9420. properties: _properties.default
  9421. };
  9422. exports.default = _default;
  9423. /***/ }),
  9424. /***/ "./node_modules/dom-helpers/transition/isTransform.js":
  9425. /*!************************************************************!*\
  9426. !*** ./node_modules/dom-helpers/transition/isTransform.js ***!
  9427. \************************************************************/
  9428. /*! no static exports found */
  9429. /***/ (function(module, exports, __webpack_require__) {
  9430. "use strict";
  9431. exports.__esModule = true;
  9432. exports.default = isTransform;
  9433. var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
  9434. function isTransform(property) {
  9435. return !!(property && supportedTransforms.test(property));
  9436. }
  9437. module.exports = exports["default"];
  9438. /***/ }),
  9439. /***/ "./node_modules/dom-helpers/transition/properties.js":
  9440. /*!***********************************************************!*\
  9441. !*** ./node_modules/dom-helpers/transition/properties.js ***!
  9442. \***********************************************************/
  9443. /*! no static exports found */
  9444. /***/ (function(module, exports, __webpack_require__) {
  9445. "use strict";
  9446. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9447. exports.__esModule = true;
  9448. exports.default = exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = void 0;
  9449. var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  9450. var transform = 'transform';
  9451. exports.transform = transform;
  9452. var prefix, transitionEnd, animationEnd;
  9453. exports.animationEnd = animationEnd;
  9454. exports.transitionEnd = transitionEnd;
  9455. var transitionProperty, transitionDuration, transitionTiming, transitionDelay;
  9456. exports.transitionDelay = transitionDelay;
  9457. exports.transitionTiming = transitionTiming;
  9458. exports.transitionDuration = transitionDuration;
  9459. exports.transitionProperty = transitionProperty;
  9460. var animationName, animationDuration, animationTiming, animationDelay;
  9461. exports.animationDelay = animationDelay;
  9462. exports.animationTiming = animationTiming;
  9463. exports.animationDuration = animationDuration;
  9464. exports.animationName = animationName;
  9465. if (_inDOM.default) {
  9466. var _getTransitionPropert = getTransitionProperties();
  9467. prefix = _getTransitionPropert.prefix;
  9468. exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
  9469. exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
  9470. exports.transform = transform = prefix + "-" + transform;
  9471. exports.transitionProperty = transitionProperty = prefix + "-transition-property";
  9472. exports.transitionDuration = transitionDuration = prefix + "-transition-duration";
  9473. exports.transitionDelay = transitionDelay = prefix + "-transition-delay";
  9474. exports.transitionTiming = transitionTiming = prefix + "-transition-timing-function";
  9475. exports.animationName = animationName = prefix + "-animation-name";
  9476. exports.animationDuration = animationDuration = prefix + "-animation-duration";
  9477. exports.animationTiming = animationTiming = prefix + "-animation-delay";
  9478. exports.animationDelay = animationDelay = prefix + "-animation-timing-function";
  9479. }
  9480. var _default = {
  9481. transform: transform,
  9482. end: transitionEnd,
  9483. property: transitionProperty,
  9484. timing: transitionTiming,
  9485. delay: transitionDelay,
  9486. duration: transitionDuration
  9487. };
  9488. exports.default = _default;
  9489. function getTransitionProperties() {
  9490. var style = document.createElement('div').style;
  9491. var vendorMap = {
  9492. O: function O(e) {
  9493. return "o" + e.toLowerCase();
  9494. },
  9495. Moz: function Moz(e) {
  9496. return e.toLowerCase();
  9497. },
  9498. Webkit: function Webkit(e) {
  9499. return "webkit" + e;
  9500. },
  9501. ms: function ms(e) {
  9502. return "MS" + e;
  9503. }
  9504. };
  9505. var vendors = Object.keys(vendorMap);
  9506. var transitionEnd, animationEnd;
  9507. var prefix = '';
  9508. for (var i = 0; i < vendors.length; i++) {
  9509. var vendor = vendors[i];
  9510. if (vendor + "TransitionProperty" in style) {
  9511. prefix = "-" + vendor.toLowerCase();
  9512. transitionEnd = vendorMap[vendor]('TransitionEnd');
  9513. animationEnd = vendorMap[vendor]('AnimationEnd');
  9514. break;
  9515. }
  9516. }
  9517. if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
  9518. if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
  9519. style = null;
  9520. return {
  9521. animationEnd: animationEnd,
  9522. transitionEnd: transitionEnd,
  9523. prefix: prefix
  9524. };
  9525. }
  9526. /***/ }),
  9527. /***/ "./node_modules/dom-helpers/util/camelize.js":
  9528. /*!***************************************************!*\
  9529. !*** ./node_modules/dom-helpers/util/camelize.js ***!
  9530. \***************************************************/
  9531. /*! no static exports found */
  9532. /***/ (function(module, exports, __webpack_require__) {
  9533. "use strict";
  9534. exports.__esModule = true;
  9535. exports.default = camelize;
  9536. var rHyphen = /-(.)/g;
  9537. function camelize(string) {
  9538. return string.replace(rHyphen, function (_, chr) {
  9539. return chr.toUpperCase();
  9540. });
  9541. }
  9542. module.exports = exports["default"];
  9543. /***/ }),
  9544. /***/ "./node_modules/dom-helpers/util/camelizeStyle.js":
  9545. /*!********************************************************!*\
  9546. !*** ./node_modules/dom-helpers/util/camelizeStyle.js ***!
  9547. \********************************************************/
  9548. /*! no static exports found */
  9549. /***/ (function(module, exports, __webpack_require__) {
  9550. "use strict";
  9551. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9552. exports.__esModule = true;
  9553. exports.default = camelizeStyleName;
  9554. var _camelize = _interopRequireDefault(__webpack_require__(/*! ./camelize */ "./node_modules/dom-helpers/util/camelize.js"));
  9555. /**
  9556. * Copyright 2014-2015, Facebook, Inc.
  9557. * All rights reserved.
  9558. * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js
  9559. */
  9560. var msPattern = /^-ms-/;
  9561. function camelizeStyleName(string) {
  9562. return (0, _camelize.default)(string.replace(msPattern, 'ms-'));
  9563. }
  9564. module.exports = exports["default"];
  9565. /***/ }),
  9566. /***/ "./node_modules/dom-helpers/util/hyphenate.js":
  9567. /*!****************************************************!*\
  9568. !*** ./node_modules/dom-helpers/util/hyphenate.js ***!
  9569. \****************************************************/
  9570. /*! no static exports found */
  9571. /***/ (function(module, exports, __webpack_require__) {
  9572. "use strict";
  9573. exports.__esModule = true;
  9574. exports.default = hyphenate;
  9575. var rUpper = /([A-Z])/g;
  9576. function hyphenate(string) {
  9577. return string.replace(rUpper, '-$1').toLowerCase();
  9578. }
  9579. module.exports = exports["default"];
  9580. /***/ }),
  9581. /***/ "./node_modules/dom-helpers/util/hyphenateStyle.js":
  9582. /*!*********************************************************!*\
  9583. !*** ./node_modules/dom-helpers/util/hyphenateStyle.js ***!
  9584. \*********************************************************/
  9585. /*! no static exports found */
  9586. /***/ (function(module, exports, __webpack_require__) {
  9587. "use strict";
  9588. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9589. exports.__esModule = true;
  9590. exports.default = hyphenateStyleName;
  9591. var _hyphenate = _interopRequireDefault(__webpack_require__(/*! ./hyphenate */ "./node_modules/dom-helpers/util/hyphenate.js"));
  9592. /**
  9593. * Copyright 2013-2014, Facebook, Inc.
  9594. * All rights reserved.
  9595. * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js
  9596. */
  9597. var msPattern = /^ms-/;
  9598. function hyphenateStyleName(string) {
  9599. return (0, _hyphenate.default)(string).replace(msPattern, '-ms-');
  9600. }
  9601. module.exports = exports["default"];
  9602. /***/ }),
  9603. /***/ "./node_modules/dom-helpers/util/inDOM.js":
  9604. /*!************************************************!*\
  9605. !*** ./node_modules/dom-helpers/util/inDOM.js ***!
  9606. \************************************************/
  9607. /*! no static exports found */
  9608. /***/ (function(module, exports, __webpack_require__) {
  9609. "use strict";
  9610. exports.__esModule = true;
  9611. exports.default = void 0;
  9612. var _default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
  9613. exports.default = _default;
  9614. module.exports = exports["default"];
  9615. /***/ }),
  9616. /***/ "./node_modules/dom-helpers/util/scrollbarSize.js":
  9617. /*!********************************************************!*\
  9618. !*** ./node_modules/dom-helpers/util/scrollbarSize.js ***!
  9619. \********************************************************/
  9620. /*! no static exports found */
  9621. /***/ (function(module, exports, __webpack_require__) {
  9622. "use strict";
  9623. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  9624. exports.__esModule = true;
  9625. exports.default = scrollbarSize;
  9626. var _inDOM = _interopRequireDefault(__webpack_require__(/*! ./inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  9627. var size;
  9628. function scrollbarSize(recalc) {
  9629. if (!size && size !== 0 || recalc) {
  9630. if (_inDOM.default) {
  9631. var scrollDiv = document.createElement('div');
  9632. scrollDiv.style.position = 'absolute';
  9633. scrollDiv.style.top = '-9999px';
  9634. scrollDiv.style.width = '50px';
  9635. scrollDiv.style.height = '50px';
  9636. scrollDiv.style.overflow = 'scroll';
  9637. document.body.appendChild(scrollDiv);
  9638. size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  9639. document.body.removeChild(scrollDiv);
  9640. }
  9641. }
  9642. return size;
  9643. }
  9644. module.exports = exports["default"];
  9645. /***/ }),
  9646. /***/ "./node_modules/file-saver/dist/FileSaver.min.js":
  9647. /*!*******************************************************!*\
  9648. !*** ./node_modules/file-saver/dist/FileSaver.min.js ***!
  9649. \*******************************************************/
  9650. /*! no static exports found */
  9651. /***/ (function(module, exports, __webpack_require__) {
  9652. /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),
  9653. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  9654. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  9655. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open("","_blank"),e&&(e.document.title=e.document.body.innerText="downloading..."),"string"==typeof a)return c(a,b,d);var g="application/octet-stream"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||g&&h)&&"object"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),e?e.location.href=a:location=a,e=null},j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l,e=null,setTimeout(function(){k.revokeObjectURL(l)},4E4)}});f.saveAs=a.saveAs=a, true&&(module.exports=a)});
  9656. //# sourceMappingURL=FileSaver.min.js.map
  9657. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  9658. /***/ }),
  9659. /***/ "./node_modules/gud/index.js":
  9660. /*!***********************************!*\
  9661. !*** ./node_modules/gud/index.js ***!
  9662. \***********************************/
  9663. /*! no static exports found */
  9664. /***/ (function(module, exports, __webpack_require__) {
  9665. "use strict";
  9666. /* WEBPACK VAR INJECTION */(function(global) {// @flow
  9667. var key = '__global_unique_id__';
  9668. module.exports = function() {
  9669. return global[key] = (global[key] || 0) + 1;
  9670. };
  9671. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  9672. /***/ }),
  9673. /***/ "./node_modules/ieee754/index.js":
  9674. /*!***************************************!*\
  9675. !*** ./node_modules/ieee754/index.js ***!
  9676. \***************************************/
  9677. /*! no static exports found */
  9678. /***/ (function(module, exports) {
  9679. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  9680. var e, m
  9681. var eLen = (nBytes * 8) - mLen - 1
  9682. var eMax = (1 << eLen) - 1
  9683. var eBias = eMax >> 1
  9684. var nBits = -7
  9685. var i = isLE ? (nBytes - 1) : 0
  9686. var d = isLE ? -1 : 1
  9687. var s = buffer[offset + i]
  9688. i += d
  9689. e = s & ((1 << (-nBits)) - 1)
  9690. s >>= (-nBits)
  9691. nBits += eLen
  9692. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9693. m = e & ((1 << (-nBits)) - 1)
  9694. e >>= (-nBits)
  9695. nBits += mLen
  9696. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9697. if (e === 0) {
  9698. e = 1 - eBias
  9699. } else if (e === eMax) {
  9700. return m ? NaN : ((s ? -1 : 1) * Infinity)
  9701. } else {
  9702. m = m + Math.pow(2, mLen)
  9703. e = e - eBias
  9704. }
  9705. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  9706. }
  9707. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  9708. var e, m, c
  9709. var eLen = (nBytes * 8) - mLen - 1
  9710. var eMax = (1 << eLen) - 1
  9711. var eBias = eMax >> 1
  9712. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  9713. var i = isLE ? 0 : (nBytes - 1)
  9714. var d = isLE ? 1 : -1
  9715. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  9716. value = Math.abs(value)
  9717. if (isNaN(value) || value === Infinity) {
  9718. m = isNaN(value) ? 1 : 0
  9719. e = eMax
  9720. } else {
  9721. e = Math.floor(Math.log(value) / Math.LN2)
  9722. if (value * (c = Math.pow(2, -e)) < 1) {
  9723. e--
  9724. c *= 2
  9725. }
  9726. if (e + eBias >= 1) {
  9727. value += rt / c
  9728. } else {
  9729. value += rt * Math.pow(2, 1 - eBias)
  9730. }
  9731. if (value * c >= 2) {
  9732. e++
  9733. c /= 2
  9734. }
  9735. if (e + eBias >= eMax) {
  9736. m = 0
  9737. e = eMax
  9738. } else if (e + eBias >= 1) {
  9739. m = ((value * c) - 1) * Math.pow(2, mLen)
  9740. e = e + eBias
  9741. } else {
  9742. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  9743. e = 0
  9744. }
  9745. }
  9746. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  9747. e = (e << mLen) | m
  9748. eLen += mLen
  9749. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  9750. buffer[offset + i - d] |= s * 128
  9751. }
  9752. /***/ }),
  9753. /***/ "./node_modules/invariant/browser.js":
  9754. /*!*******************************************!*\
  9755. !*** ./node_modules/invariant/browser.js ***!
  9756. \*******************************************/
  9757. /*! no static exports found */
  9758. /***/ (function(module, exports, __webpack_require__) {
  9759. "use strict";
  9760. /**
  9761. * Copyright (c) 2013-present, Facebook, Inc.
  9762. *
  9763. * This source code is licensed under the MIT license found in the
  9764. * LICENSE file in the root directory of this source tree.
  9765. */
  9766. /**
  9767. * Use invariant() to assert state which your program assumes to be true.
  9768. *
  9769. * Provide sprintf-style format (only %s is supported) and arguments
  9770. * to provide information about what broke and what you were
  9771. * expecting.
  9772. *
  9773. * The invariant message will be stripped in production, but the invariant
  9774. * will remain to ensure logic does not differ in production.
  9775. */
  9776. var invariant = function(condition, format, a, b, c, d, e, f) {
  9777. if (true) {
  9778. if (format === undefined) {
  9779. throw new Error('invariant requires an error message argument');
  9780. }
  9781. }
  9782. if (!condition) {
  9783. var error;
  9784. if (format === undefined) {
  9785. error = new Error(
  9786. 'Minified exception occurred; use the non-minified dev environment ' +
  9787. 'for the full error message and additional helpful warnings.'
  9788. );
  9789. } else {
  9790. var args = [a, b, c, d, e, f];
  9791. var argIndex = 0;
  9792. error = new Error(
  9793. format.replace(/%s/g, function() { return args[argIndex++]; })
  9794. );
  9795. error.name = 'Invariant Violation';
  9796. }
  9797. error.framesToPop = 1; // we don't care about invariant's own frame
  9798. throw error;
  9799. }
  9800. };
  9801. module.exports = invariant;
  9802. /***/ }),
  9803. /***/ "./node_modules/is-buffer/index.js":
  9804. /*!*****************************************!*\
  9805. !*** ./node_modules/is-buffer/index.js ***!
  9806. \*****************************************/
  9807. /*! no static exports found */
  9808. /***/ (function(module, exports) {
  9809. /*!
  9810. * Determine if an object is a Buffer
  9811. *
  9812. * @author Feross Aboukhadijeh <https://feross.org>
  9813. * @license MIT
  9814. */
  9815. module.exports = function isBuffer (obj) {
  9816. return obj != null && obj.constructor != null &&
  9817. typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  9818. }
  9819. /***/ }),
  9820. /***/ "./node_modules/isarray/index.js":
  9821. /*!***************************************!*\
  9822. !*** ./node_modules/isarray/index.js ***!
  9823. \***************************************/
  9824. /*! no static exports found */
  9825. /***/ (function(module, exports) {
  9826. var toString = {}.toString;
  9827. module.exports = Array.isArray || function (arr) {
  9828. return toString.call(arr) == '[object Array]';
  9829. };
  9830. /***/ }),
  9831. /***/ "./node_modules/jquery/dist/jquery.js":
  9832. /*!********************************************!*\
  9833. !*** ./node_modules/jquery/dist/jquery.js ***!
  9834. \********************************************/
  9835. /*! no static exports found */
  9836. /***/ (function(module, exports, __webpack_require__) {
  9837. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  9838. * jQuery JavaScript Library v3.4.1
  9839. * https://jquery.com/
  9840. *
  9841. * Includes Sizzle.js
  9842. * https://sizzlejs.com/
  9843. *
  9844. * Copyright JS Foundation and other contributors
  9845. * Released under the MIT license
  9846. * https://jquery.org/license
  9847. *
  9848. * Date: 2019-05-01T21:04Z
  9849. */
  9850. ( function( global, factory ) {
  9851. "use strict";
  9852. if ( true && typeof module.exports === "object" ) {
  9853. // For CommonJS and CommonJS-like environments where a proper `window`
  9854. // is present, execute the factory and get jQuery.
  9855. // For environments that do not have a `window` with a `document`
  9856. // (such as Node.js), expose a factory as module.exports.
  9857. // This accentuates the need for the creation of a real `window`.
  9858. // e.g. var jQuery = require("jquery")(window);
  9859. // See ticket #14549 for more info.
  9860. module.exports = global.document ?
  9861. factory( global, true ) :
  9862. function( w ) {
  9863. if ( !w.document ) {
  9864. throw new Error( "jQuery requires a window with a document" );
  9865. }
  9866. return factory( w );
  9867. };
  9868. } else {
  9869. factory( global );
  9870. }
  9871. // Pass this if window is not defined yet
  9872. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  9873. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  9874. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  9875. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  9876. // enough that all such attempts are guarded in a try block.
  9877. "use strict";
  9878. var arr = [];
  9879. var document = window.document;
  9880. var getProto = Object.getPrototypeOf;
  9881. var slice = arr.slice;
  9882. var concat = arr.concat;
  9883. var push = arr.push;
  9884. var indexOf = arr.indexOf;
  9885. var class2type = {};
  9886. var toString = class2type.toString;
  9887. var hasOwn = class2type.hasOwnProperty;
  9888. var fnToString = hasOwn.toString;
  9889. var ObjectFunctionString = fnToString.call( Object );
  9890. var support = {};
  9891. var isFunction = function isFunction( obj ) {
  9892. // Support: Chrome <=57, Firefox <=52
  9893. // In some browsers, typeof returns "function" for HTML <object> elements
  9894. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  9895. // We don't want to classify *any* DOM node as a function.
  9896. return typeof obj === "function" && typeof obj.nodeType !== "number";
  9897. };
  9898. var isWindow = function isWindow( obj ) {
  9899. return obj != null && obj === obj.window;
  9900. };
  9901. var preservedScriptAttributes = {
  9902. type: true,
  9903. src: true,
  9904. nonce: true,
  9905. noModule: true
  9906. };
  9907. function DOMEval( code, node, doc ) {
  9908. doc = doc || document;
  9909. var i, val,
  9910. script = doc.createElement( "script" );
  9911. script.text = code;
  9912. if ( node ) {
  9913. for ( i in preservedScriptAttributes ) {
  9914. // Support: Firefox 64+, Edge 18+
  9915. // Some browsers don't support the "nonce" property on scripts.
  9916. // On the other hand, just using `getAttribute` is not enough as
  9917. // the `nonce` attribute is reset to an empty string whenever it
  9918. // becomes browsing-context connected.
  9919. // See https://github.com/whatwg/html/issues/2369
  9920. // See https://html.spec.whatwg.org/#nonce-attributes
  9921. // The `node.getAttribute` check was added for the sake of
  9922. // `jQuery.globalEval` so that it can fake a nonce-containing node
  9923. // via an object.
  9924. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  9925. if ( val ) {
  9926. script.setAttribute( i, val );
  9927. }
  9928. }
  9929. }
  9930. doc.head.appendChild( script ).parentNode.removeChild( script );
  9931. }
  9932. function toType( obj ) {
  9933. if ( obj == null ) {
  9934. return obj + "";
  9935. }
  9936. // Support: Android <=2.3 only (functionish RegExp)
  9937. return typeof obj === "object" || typeof obj === "function" ?
  9938. class2type[ toString.call( obj ) ] || "object" :
  9939. typeof obj;
  9940. }
  9941. /* global Symbol */
  9942. // Defining this global in .eslintrc.json would create a danger of using the global
  9943. // unguarded in another place, it seems safer to define global only for this module
  9944. var
  9945. version = "3.4.1",
  9946. // Define a local copy of jQuery
  9947. jQuery = function( selector, context ) {
  9948. // The jQuery object is actually just the init constructor 'enhanced'
  9949. // Need init if jQuery is called (just allow error to be thrown if not included)
  9950. return new jQuery.fn.init( selector, context );
  9951. },
  9952. // Support: Android <=4.0 only
  9953. // Make sure we trim BOM and NBSP
  9954. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  9955. jQuery.fn = jQuery.prototype = {
  9956. // The current version of jQuery being used
  9957. jquery: version,
  9958. constructor: jQuery,
  9959. // The default length of a jQuery object is 0
  9960. length: 0,
  9961. toArray: function() {
  9962. return slice.call( this );
  9963. },
  9964. // Get the Nth element in the matched element set OR
  9965. // Get the whole matched element set as a clean array
  9966. get: function( num ) {
  9967. // Return all the elements in a clean array
  9968. if ( num == null ) {
  9969. return slice.call( this );
  9970. }
  9971. // Return just the one element from the set
  9972. return num < 0 ? this[ num + this.length ] : this[ num ];
  9973. },
  9974. // Take an array of elements and push it onto the stack
  9975. // (returning the new matched element set)
  9976. pushStack: function( elems ) {
  9977. // Build a new jQuery matched element set
  9978. var ret = jQuery.merge( this.constructor(), elems );
  9979. // Add the old object onto the stack (as a reference)
  9980. ret.prevObject = this;
  9981. // Return the newly-formed element set
  9982. return ret;
  9983. },
  9984. // Execute a callback for every element in the matched set.
  9985. each: function( callback ) {
  9986. return jQuery.each( this, callback );
  9987. },
  9988. map: function( callback ) {
  9989. return this.pushStack( jQuery.map( this, function( elem, i ) {
  9990. return callback.call( elem, i, elem );
  9991. } ) );
  9992. },
  9993. slice: function() {
  9994. return this.pushStack( slice.apply( this, arguments ) );
  9995. },
  9996. first: function() {
  9997. return this.eq( 0 );
  9998. },
  9999. last: function() {
  10000. return this.eq( -1 );
  10001. },
  10002. eq: function( i ) {
  10003. var len = this.length,
  10004. j = +i + ( i < 0 ? len : 0 );
  10005. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  10006. },
  10007. end: function() {
  10008. return this.prevObject || this.constructor();
  10009. },
  10010. // For internal use only.
  10011. // Behaves like an Array's method, not like a jQuery method.
  10012. push: push,
  10013. sort: arr.sort,
  10014. splice: arr.splice
  10015. };
  10016. jQuery.extend = jQuery.fn.extend = function() {
  10017. var options, name, src, copy, copyIsArray, clone,
  10018. target = arguments[ 0 ] || {},
  10019. i = 1,
  10020. length = arguments.length,
  10021. deep = false;
  10022. // Handle a deep copy situation
  10023. if ( typeof target === "boolean" ) {
  10024. deep = target;
  10025. // Skip the boolean and the target
  10026. target = arguments[ i ] || {};
  10027. i++;
  10028. }
  10029. // Handle case when target is a string or something (possible in deep copy)
  10030. if ( typeof target !== "object" && !isFunction( target ) ) {
  10031. target = {};
  10032. }
  10033. // Extend jQuery itself if only one argument is passed
  10034. if ( i === length ) {
  10035. target = this;
  10036. i--;
  10037. }
  10038. for ( ; i < length; i++ ) {
  10039. // Only deal with non-null/undefined values
  10040. if ( ( options = arguments[ i ] ) != null ) {
  10041. // Extend the base object
  10042. for ( name in options ) {
  10043. copy = options[ name ];
  10044. // Prevent Object.prototype pollution
  10045. // Prevent never-ending loop
  10046. if ( name === "__proto__" || target === copy ) {
  10047. continue;
  10048. }
  10049. // Recurse if we're merging plain objects or arrays
  10050. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  10051. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  10052. src = target[ name ];
  10053. // Ensure proper type for the source value
  10054. if ( copyIsArray && !Array.isArray( src ) ) {
  10055. clone = [];
  10056. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  10057. clone = {};
  10058. } else {
  10059. clone = src;
  10060. }
  10061. copyIsArray = false;
  10062. // Never move original objects, clone them
  10063. target[ name ] = jQuery.extend( deep, clone, copy );
  10064. // Don't bring in undefined values
  10065. } else if ( copy !== undefined ) {
  10066. target[ name ] = copy;
  10067. }
  10068. }
  10069. }
  10070. }
  10071. // Return the modified object
  10072. return target;
  10073. };
  10074. jQuery.extend( {
  10075. // Unique for each copy of jQuery on the page
  10076. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  10077. // Assume jQuery is ready without the ready module
  10078. isReady: true,
  10079. error: function( msg ) {
  10080. throw new Error( msg );
  10081. },
  10082. noop: function() {},
  10083. isPlainObject: function( obj ) {
  10084. var proto, Ctor;
  10085. // Detect obvious negatives
  10086. // Use toString instead of jQuery.type to catch host objects
  10087. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  10088. return false;
  10089. }
  10090. proto = getProto( obj );
  10091. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  10092. if ( !proto ) {
  10093. return true;
  10094. }
  10095. // Objects with prototype are plain iff they were constructed by a global Object function
  10096. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  10097. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  10098. },
  10099. isEmptyObject: function( obj ) {
  10100. var name;
  10101. for ( name in obj ) {
  10102. return false;
  10103. }
  10104. return true;
  10105. },
  10106. // Evaluates a script in a global context
  10107. globalEval: function( code, options ) {
  10108. DOMEval( code, { nonce: options && options.nonce } );
  10109. },
  10110. each: function( obj, callback ) {
  10111. var length, i = 0;
  10112. if ( isArrayLike( obj ) ) {
  10113. length = obj.length;
  10114. for ( ; i < length; i++ ) {
  10115. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  10116. break;
  10117. }
  10118. }
  10119. } else {
  10120. for ( i in obj ) {
  10121. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  10122. break;
  10123. }
  10124. }
  10125. }
  10126. return obj;
  10127. },
  10128. // Support: Android <=4.0 only
  10129. trim: function( text ) {
  10130. return text == null ?
  10131. "" :
  10132. ( text + "" ).replace( rtrim, "" );
  10133. },
  10134. // results is for internal usage only
  10135. makeArray: function( arr, results ) {
  10136. var ret = results || [];
  10137. if ( arr != null ) {
  10138. if ( isArrayLike( Object( arr ) ) ) {
  10139. jQuery.merge( ret,
  10140. typeof arr === "string" ?
  10141. [ arr ] : arr
  10142. );
  10143. } else {
  10144. push.call( ret, arr );
  10145. }
  10146. }
  10147. return ret;
  10148. },
  10149. inArray: function( elem, arr, i ) {
  10150. return arr == null ? -1 : indexOf.call( arr, elem, i );
  10151. },
  10152. // Support: Android <=4.0 only, PhantomJS 1 only
  10153. // push.apply(_, arraylike) throws on ancient WebKit
  10154. merge: function( first, second ) {
  10155. var len = +second.length,
  10156. j = 0,
  10157. i = first.length;
  10158. for ( ; j < len; j++ ) {
  10159. first[ i++ ] = second[ j ];
  10160. }
  10161. first.length = i;
  10162. return first;
  10163. },
  10164. grep: function( elems, callback, invert ) {
  10165. var callbackInverse,
  10166. matches = [],
  10167. i = 0,
  10168. length = elems.length,
  10169. callbackExpect = !invert;
  10170. // Go through the array, only saving the items
  10171. // that pass the validator function
  10172. for ( ; i < length; i++ ) {
  10173. callbackInverse = !callback( elems[ i ], i );
  10174. if ( callbackInverse !== callbackExpect ) {
  10175. matches.push( elems[ i ] );
  10176. }
  10177. }
  10178. return matches;
  10179. },
  10180. // arg is for internal usage only
  10181. map: function( elems, callback, arg ) {
  10182. var length, value,
  10183. i = 0,
  10184. ret = [];
  10185. // Go through the array, translating each of the items to their new values
  10186. if ( isArrayLike( elems ) ) {
  10187. length = elems.length;
  10188. for ( ; i < length; i++ ) {
  10189. value = callback( elems[ i ], i, arg );
  10190. if ( value != null ) {
  10191. ret.push( value );
  10192. }
  10193. }
  10194. // Go through every key on the object,
  10195. } else {
  10196. for ( i in elems ) {
  10197. value = callback( elems[ i ], i, arg );
  10198. if ( value != null ) {
  10199. ret.push( value );
  10200. }
  10201. }
  10202. }
  10203. // Flatten any nested arrays
  10204. return concat.apply( [], ret );
  10205. },
  10206. // A global GUID counter for objects
  10207. guid: 1,
  10208. // jQuery.support is not used in Core but other projects attach their
  10209. // properties to it so it needs to exist.
  10210. support: support
  10211. } );
  10212. if ( typeof Symbol === "function" ) {
  10213. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  10214. }
  10215. // Populate the class2type map
  10216. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  10217. function( i, name ) {
  10218. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  10219. } );
  10220. function isArrayLike( obj ) {
  10221. // Support: real iOS 8.2 only (not reproducible in simulator)
  10222. // `in` check used to prevent JIT error (gh-2145)
  10223. // hasOwn isn't used here due to false negatives
  10224. // regarding Nodelist length in IE
  10225. var length = !!obj && "length" in obj && obj.length,
  10226. type = toType( obj );
  10227. if ( isFunction( obj ) || isWindow( obj ) ) {
  10228. return false;
  10229. }
  10230. return type === "array" || length === 0 ||
  10231. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  10232. }
  10233. var Sizzle =
  10234. /*!
  10235. * Sizzle CSS Selector Engine v2.3.4
  10236. * https://sizzlejs.com/
  10237. *
  10238. * Copyright JS Foundation and other contributors
  10239. * Released under the MIT license
  10240. * https://js.foundation/
  10241. *
  10242. * Date: 2019-04-08
  10243. */
  10244. (function( window ) {
  10245. var i,
  10246. support,
  10247. Expr,
  10248. getText,
  10249. isXML,
  10250. tokenize,
  10251. compile,
  10252. select,
  10253. outermostContext,
  10254. sortInput,
  10255. hasDuplicate,
  10256. // Local document vars
  10257. setDocument,
  10258. document,
  10259. docElem,
  10260. documentIsHTML,
  10261. rbuggyQSA,
  10262. rbuggyMatches,
  10263. matches,
  10264. contains,
  10265. // Instance-specific data
  10266. expando = "sizzle" + 1 * new Date(),
  10267. preferredDoc = window.document,
  10268. dirruns = 0,
  10269. done = 0,
  10270. classCache = createCache(),
  10271. tokenCache = createCache(),
  10272. compilerCache = createCache(),
  10273. nonnativeSelectorCache = createCache(),
  10274. sortOrder = function( a, b ) {
  10275. if ( a === b ) {
  10276. hasDuplicate = true;
  10277. }
  10278. return 0;
  10279. },
  10280. // Instance methods
  10281. hasOwn = ({}).hasOwnProperty,
  10282. arr = [],
  10283. pop = arr.pop,
  10284. push_native = arr.push,
  10285. push = arr.push,
  10286. slice = arr.slice,
  10287. // Use a stripped-down indexOf as it's faster than native
  10288. // https://jsperf.com/thor-indexof-vs-for/5
  10289. indexOf = function( list, elem ) {
  10290. var i = 0,
  10291. len = list.length;
  10292. for ( ; i < len; i++ ) {
  10293. if ( list[i] === elem ) {
  10294. return i;
  10295. }
  10296. }
  10297. return -1;
  10298. },
  10299. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  10300. // Regular expressions
  10301. // http://www.w3.org/TR/css3-selectors/#whitespace
  10302. whitespace = "[\\x20\\t\\r\\n\\f]",
  10303. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  10304. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  10305. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  10306. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  10307. // Operator (capture 2)
  10308. "*([*^$|!~]?=)" + whitespace +
  10309. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  10310. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  10311. "*\\]",
  10312. pseudos = ":(" + identifier + ")(?:\\((" +
  10313. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  10314. // 1. quoted (capture 3; capture 4 or capture 5)
  10315. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  10316. // 2. simple (capture 6)
  10317. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  10318. // 3. anything else (capture 2)
  10319. ".*" +
  10320. ")\\)|)",
  10321. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  10322. rwhitespace = new RegExp( whitespace + "+", "g" ),
  10323. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  10324. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  10325. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  10326. rdescend = new RegExp( whitespace + "|>" ),
  10327. rpseudo = new RegExp( pseudos ),
  10328. ridentifier = new RegExp( "^" + identifier + "$" ),
  10329. matchExpr = {
  10330. "ID": new RegExp( "^#(" + identifier + ")" ),
  10331. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  10332. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  10333. "ATTR": new RegExp( "^" + attributes ),
  10334. "PSEUDO": new RegExp( "^" + pseudos ),
  10335. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  10336. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  10337. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  10338. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  10339. // For use in libraries implementing .is()
  10340. // We use this for POS matching in `select`
  10341. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  10342. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  10343. },
  10344. rhtml = /HTML$/i,
  10345. rinputs = /^(?:input|select|textarea|button)$/i,
  10346. rheader = /^h\d$/i,
  10347. rnative = /^[^{]+\{\s*\[native \w/,
  10348. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  10349. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  10350. rsibling = /[+~]/,
  10351. // CSS escapes
  10352. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  10353. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  10354. funescape = function( _, escaped, escapedWhitespace ) {
  10355. var high = "0x" + escaped - 0x10000;
  10356. // NaN means non-codepoint
  10357. // Support: Firefox<24
  10358. // Workaround erroneous numeric interpretation of +"0x"
  10359. return high !== high || escapedWhitespace ?
  10360. escaped :
  10361. high < 0 ?
  10362. // BMP codepoint
  10363. String.fromCharCode( high + 0x10000 ) :
  10364. // Supplemental Plane codepoint (surrogate pair)
  10365. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  10366. },
  10367. // CSS string/identifier serialization
  10368. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  10369. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  10370. fcssescape = function( ch, asCodePoint ) {
  10371. if ( asCodePoint ) {
  10372. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  10373. if ( ch === "\0" ) {
  10374. return "\uFFFD";
  10375. }
  10376. // Control characters and (dependent upon position) numbers get escaped as code points
  10377. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  10378. }
  10379. // Other potentially-special ASCII characters get backslash-escaped
  10380. return "\\" + ch;
  10381. },
  10382. // Used for iframes
  10383. // See setDocument()
  10384. // Removing the function wrapper causes a "Permission Denied"
  10385. // error in IE
  10386. unloadHandler = function() {
  10387. setDocument();
  10388. },
  10389. inDisabledFieldset = addCombinator(
  10390. function( elem ) {
  10391. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  10392. },
  10393. { dir: "parentNode", next: "legend" }
  10394. );
  10395. // Optimize for push.apply( _, NodeList )
  10396. try {
  10397. push.apply(
  10398. (arr = slice.call( preferredDoc.childNodes )),
  10399. preferredDoc.childNodes
  10400. );
  10401. // Support: Android<4.0
  10402. // Detect silently failing push.apply
  10403. arr[ preferredDoc.childNodes.length ].nodeType;
  10404. } catch ( e ) {
  10405. push = { apply: arr.length ?
  10406. // Leverage slice if possible
  10407. function( target, els ) {
  10408. push_native.apply( target, slice.call(els) );
  10409. } :
  10410. // Support: IE<9
  10411. // Otherwise append directly
  10412. function( target, els ) {
  10413. var j = target.length,
  10414. i = 0;
  10415. // Can't trust NodeList.length
  10416. while ( (target[j++] = els[i++]) ) {}
  10417. target.length = j - 1;
  10418. }
  10419. };
  10420. }
  10421. function Sizzle( selector, context, results, seed ) {
  10422. var m, i, elem, nid, match, groups, newSelector,
  10423. newContext = context && context.ownerDocument,
  10424. // nodeType defaults to 9, since context defaults to document
  10425. nodeType = context ? context.nodeType : 9;
  10426. results = results || [];
  10427. // Return early from calls with invalid selector or context
  10428. if ( typeof selector !== "string" || !selector ||
  10429. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  10430. return results;
  10431. }
  10432. // Try to shortcut find operations (as opposed to filters) in HTML documents
  10433. if ( !seed ) {
  10434. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  10435. setDocument( context );
  10436. }
  10437. context = context || document;
  10438. if ( documentIsHTML ) {
  10439. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  10440. // (excepting DocumentFragment context, where the methods don't exist)
  10441. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  10442. // ID selector
  10443. if ( (m = match[1]) ) {
  10444. // Document context
  10445. if ( nodeType === 9 ) {
  10446. if ( (elem = context.getElementById( m )) ) {
  10447. // Support: IE, Opera, Webkit
  10448. // TODO: identify versions
  10449. // getElementById can match elements by name instead of ID
  10450. if ( elem.id === m ) {
  10451. results.push( elem );
  10452. return results;
  10453. }
  10454. } else {
  10455. return results;
  10456. }
  10457. // Element context
  10458. } else {
  10459. // Support: IE, Opera, Webkit
  10460. // TODO: identify versions
  10461. // getElementById can match elements by name instead of ID
  10462. if ( newContext && (elem = newContext.getElementById( m )) &&
  10463. contains( context, elem ) &&
  10464. elem.id === m ) {
  10465. results.push( elem );
  10466. return results;
  10467. }
  10468. }
  10469. // Type selector
  10470. } else if ( match[2] ) {
  10471. push.apply( results, context.getElementsByTagName( selector ) );
  10472. return results;
  10473. // Class selector
  10474. } else if ( (m = match[3]) && support.getElementsByClassName &&
  10475. context.getElementsByClassName ) {
  10476. push.apply( results, context.getElementsByClassName( m ) );
  10477. return results;
  10478. }
  10479. }
  10480. // Take advantage of querySelectorAll
  10481. if ( support.qsa &&
  10482. !nonnativeSelectorCache[ selector + " " ] &&
  10483. (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
  10484. // Support: IE 8 only
  10485. // Exclude object elements
  10486. (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
  10487. newSelector = selector;
  10488. newContext = context;
  10489. // qSA considers elements outside a scoping root when evaluating child or
  10490. // descendant combinators, which is not what we want.
  10491. // In such cases, we work around the behavior by prefixing every selector in the
  10492. // list with an ID selector referencing the scope context.
  10493. // Thanks to Andrew Dupont for this technique.
  10494. if ( nodeType === 1 && rdescend.test( selector ) ) {
  10495. // Capture the context ID, setting it first if necessary
  10496. if ( (nid = context.getAttribute( "id" )) ) {
  10497. nid = nid.replace( rcssescape, fcssescape );
  10498. } else {
  10499. context.setAttribute( "id", (nid = expando) );
  10500. }
  10501. // Prefix every selector in the list
  10502. groups = tokenize( selector );
  10503. i = groups.length;
  10504. while ( i-- ) {
  10505. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  10506. }
  10507. newSelector = groups.join( "," );
  10508. // Expand context for sibling selectors
  10509. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  10510. context;
  10511. }
  10512. try {
  10513. push.apply( results,
  10514. newContext.querySelectorAll( newSelector )
  10515. );
  10516. return results;
  10517. } catch ( qsaError ) {
  10518. nonnativeSelectorCache( selector, true );
  10519. } finally {
  10520. if ( nid === expando ) {
  10521. context.removeAttribute( "id" );
  10522. }
  10523. }
  10524. }
  10525. }
  10526. }
  10527. // All others
  10528. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  10529. }
  10530. /**
  10531. * Create key-value caches of limited size
  10532. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  10533. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  10534. * deleting the oldest entry
  10535. */
  10536. function createCache() {
  10537. var keys = [];
  10538. function cache( key, value ) {
  10539. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  10540. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  10541. // Only keep the most recent entries
  10542. delete cache[ keys.shift() ];
  10543. }
  10544. return (cache[ key + " " ] = value);
  10545. }
  10546. return cache;
  10547. }
  10548. /**
  10549. * Mark a function for special use by Sizzle
  10550. * @param {Function} fn The function to mark
  10551. */
  10552. function markFunction( fn ) {
  10553. fn[ expando ] = true;
  10554. return fn;
  10555. }
  10556. /**
  10557. * Support testing using an element
  10558. * @param {Function} fn Passed the created element and returns a boolean result
  10559. */
  10560. function assert( fn ) {
  10561. var el = document.createElement("fieldset");
  10562. try {
  10563. return !!fn( el );
  10564. } catch (e) {
  10565. return false;
  10566. } finally {
  10567. // Remove from its parent by default
  10568. if ( el.parentNode ) {
  10569. el.parentNode.removeChild( el );
  10570. }
  10571. // release memory in IE
  10572. el = null;
  10573. }
  10574. }
  10575. /**
  10576. * Adds the same handler for all of the specified attrs
  10577. * @param {String} attrs Pipe-separated list of attributes
  10578. * @param {Function} handler The method that will be applied
  10579. */
  10580. function addHandle( attrs, handler ) {
  10581. var arr = attrs.split("|"),
  10582. i = arr.length;
  10583. while ( i-- ) {
  10584. Expr.attrHandle[ arr[i] ] = handler;
  10585. }
  10586. }
  10587. /**
  10588. * Checks document order of two siblings
  10589. * @param {Element} a
  10590. * @param {Element} b
  10591. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  10592. */
  10593. function siblingCheck( a, b ) {
  10594. var cur = b && a,
  10595. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  10596. a.sourceIndex - b.sourceIndex;
  10597. // Use IE sourceIndex if available on both nodes
  10598. if ( diff ) {
  10599. return diff;
  10600. }
  10601. // Check if b follows a
  10602. if ( cur ) {
  10603. while ( (cur = cur.nextSibling) ) {
  10604. if ( cur === b ) {
  10605. return -1;
  10606. }
  10607. }
  10608. }
  10609. return a ? 1 : -1;
  10610. }
  10611. /**
  10612. * Returns a function to use in pseudos for input types
  10613. * @param {String} type
  10614. */
  10615. function createInputPseudo( type ) {
  10616. return function( elem ) {
  10617. var name = elem.nodeName.toLowerCase();
  10618. return name === "input" && elem.type === type;
  10619. };
  10620. }
  10621. /**
  10622. * Returns a function to use in pseudos for buttons
  10623. * @param {String} type
  10624. */
  10625. function createButtonPseudo( type ) {
  10626. return function( elem ) {
  10627. var name = elem.nodeName.toLowerCase();
  10628. return (name === "input" || name === "button") && elem.type === type;
  10629. };
  10630. }
  10631. /**
  10632. * Returns a function to use in pseudos for :enabled/:disabled
  10633. * @param {Boolean} disabled true for :disabled; false for :enabled
  10634. */
  10635. function createDisabledPseudo( disabled ) {
  10636. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  10637. return function( elem ) {
  10638. // Only certain elements can match :enabled or :disabled
  10639. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  10640. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  10641. if ( "form" in elem ) {
  10642. // Check for inherited disabledness on relevant non-disabled elements:
  10643. // * listed form-associated elements in a disabled fieldset
  10644. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  10645. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  10646. // * option elements in a disabled optgroup
  10647. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  10648. // All such elements have a "form" property.
  10649. if ( elem.parentNode && elem.disabled === false ) {
  10650. // Option elements defer to a parent optgroup if present
  10651. if ( "label" in elem ) {
  10652. if ( "label" in elem.parentNode ) {
  10653. return elem.parentNode.disabled === disabled;
  10654. } else {
  10655. return elem.disabled === disabled;
  10656. }
  10657. }
  10658. // Support: IE 6 - 11
  10659. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  10660. return elem.isDisabled === disabled ||
  10661. // Where there is no isDisabled, check manually
  10662. /* jshint -W018 */
  10663. elem.isDisabled !== !disabled &&
  10664. inDisabledFieldset( elem ) === disabled;
  10665. }
  10666. return elem.disabled === disabled;
  10667. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  10668. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  10669. // even exist on them, let alone have a boolean value.
  10670. } else if ( "label" in elem ) {
  10671. return elem.disabled === disabled;
  10672. }
  10673. // Remaining elements are neither :enabled nor :disabled
  10674. return false;
  10675. };
  10676. }
  10677. /**
  10678. * Returns a function to use in pseudos for positionals
  10679. * @param {Function} fn
  10680. */
  10681. function createPositionalPseudo( fn ) {
  10682. return markFunction(function( argument ) {
  10683. argument = +argument;
  10684. return markFunction(function( seed, matches ) {
  10685. var j,
  10686. matchIndexes = fn( [], seed.length, argument ),
  10687. i = matchIndexes.length;
  10688. // Match elements found at the specified indexes
  10689. while ( i-- ) {
  10690. if ( seed[ (j = matchIndexes[i]) ] ) {
  10691. seed[j] = !(matches[j] = seed[j]);
  10692. }
  10693. }
  10694. });
  10695. });
  10696. }
  10697. /**
  10698. * Checks a node for validity as a Sizzle context
  10699. * @param {Element|Object=} context
  10700. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  10701. */
  10702. function testContext( context ) {
  10703. return context && typeof context.getElementsByTagName !== "undefined" && context;
  10704. }
  10705. // Expose support vars for convenience
  10706. support = Sizzle.support = {};
  10707. /**
  10708. * Detects XML nodes
  10709. * @param {Element|Object} elem An element or a document
  10710. * @returns {Boolean} True iff elem is a non-HTML XML node
  10711. */
  10712. isXML = Sizzle.isXML = function( elem ) {
  10713. var namespace = elem.namespaceURI,
  10714. docElem = (elem.ownerDocument || elem).documentElement;
  10715. // Support: IE <=8
  10716. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  10717. // https://bugs.jquery.com/ticket/4833
  10718. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  10719. };
  10720. /**
  10721. * Sets document-related variables once based on the current document
  10722. * @param {Element|Object} [doc] An element or document object to use to set the document
  10723. * @returns {Object} Returns the current document
  10724. */
  10725. setDocument = Sizzle.setDocument = function( node ) {
  10726. var hasCompare, subWindow,
  10727. doc = node ? node.ownerDocument || node : preferredDoc;
  10728. // Return early if doc is invalid or already selected
  10729. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  10730. return document;
  10731. }
  10732. // Update global variables
  10733. document = doc;
  10734. docElem = document.documentElement;
  10735. documentIsHTML = !isXML( document );
  10736. // Support: IE 9-11, Edge
  10737. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  10738. if ( preferredDoc !== document &&
  10739. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  10740. // Support: IE 11, Edge
  10741. if ( subWindow.addEventListener ) {
  10742. subWindow.addEventListener( "unload", unloadHandler, false );
  10743. // Support: IE 9 - 10 only
  10744. } else if ( subWindow.attachEvent ) {
  10745. subWindow.attachEvent( "onunload", unloadHandler );
  10746. }
  10747. }
  10748. /* Attributes
  10749. ---------------------------------------------------------------------- */
  10750. // Support: IE<8
  10751. // Verify that getAttribute really returns attributes and not properties
  10752. // (excepting IE8 booleans)
  10753. support.attributes = assert(function( el ) {
  10754. el.className = "i";
  10755. return !el.getAttribute("className");
  10756. });
  10757. /* getElement(s)By*
  10758. ---------------------------------------------------------------------- */
  10759. // Check if getElementsByTagName("*") returns only elements
  10760. support.getElementsByTagName = assert(function( el ) {
  10761. el.appendChild( document.createComment("") );
  10762. return !el.getElementsByTagName("*").length;
  10763. });
  10764. // Support: IE<9
  10765. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  10766. // Support: IE<10
  10767. // Check if getElementById returns elements by name
  10768. // The broken getElementById methods don't pick up programmatically-set names,
  10769. // so use a roundabout getElementsByName test
  10770. support.getById = assert(function( el ) {
  10771. docElem.appendChild( el ).id = expando;
  10772. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  10773. });
  10774. // ID filter and find
  10775. if ( support.getById ) {
  10776. Expr.filter["ID"] = function( id ) {
  10777. var attrId = id.replace( runescape, funescape );
  10778. return function( elem ) {
  10779. return elem.getAttribute("id") === attrId;
  10780. };
  10781. };
  10782. Expr.find["ID"] = function( id, context ) {
  10783. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  10784. var elem = context.getElementById( id );
  10785. return elem ? [ elem ] : [];
  10786. }
  10787. };
  10788. } else {
  10789. Expr.filter["ID"] = function( id ) {
  10790. var attrId = id.replace( runescape, funescape );
  10791. return function( elem ) {
  10792. var node = typeof elem.getAttributeNode !== "undefined" &&
  10793. elem.getAttributeNode("id");
  10794. return node && node.value === attrId;
  10795. };
  10796. };
  10797. // Support: IE 6 - 7 only
  10798. // getElementById is not reliable as a find shortcut
  10799. Expr.find["ID"] = function( id, context ) {
  10800. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  10801. var node, i, elems,
  10802. elem = context.getElementById( id );
  10803. if ( elem ) {
  10804. // Verify the id attribute
  10805. node = elem.getAttributeNode("id");
  10806. if ( node && node.value === id ) {
  10807. return [ elem ];
  10808. }
  10809. // Fall back on getElementsByName
  10810. elems = context.getElementsByName( id );
  10811. i = 0;
  10812. while ( (elem = elems[i++]) ) {
  10813. node = elem.getAttributeNode("id");
  10814. if ( node && node.value === id ) {
  10815. return [ elem ];
  10816. }
  10817. }
  10818. }
  10819. return [];
  10820. }
  10821. };
  10822. }
  10823. // Tag
  10824. Expr.find["TAG"] = support.getElementsByTagName ?
  10825. function( tag, context ) {
  10826. if ( typeof context.getElementsByTagName !== "undefined" ) {
  10827. return context.getElementsByTagName( tag );
  10828. // DocumentFragment nodes don't have gEBTN
  10829. } else if ( support.qsa ) {
  10830. return context.querySelectorAll( tag );
  10831. }
  10832. } :
  10833. function( tag, context ) {
  10834. var elem,
  10835. tmp = [],
  10836. i = 0,
  10837. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  10838. results = context.getElementsByTagName( tag );
  10839. // Filter out possible comments
  10840. if ( tag === "*" ) {
  10841. while ( (elem = results[i++]) ) {
  10842. if ( elem.nodeType === 1 ) {
  10843. tmp.push( elem );
  10844. }
  10845. }
  10846. return tmp;
  10847. }
  10848. return results;
  10849. };
  10850. // Class
  10851. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  10852. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  10853. return context.getElementsByClassName( className );
  10854. }
  10855. };
  10856. /* QSA/matchesSelector
  10857. ---------------------------------------------------------------------- */
  10858. // QSA and matchesSelector support
  10859. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  10860. rbuggyMatches = [];
  10861. // qSa(:focus) reports false when true (Chrome 21)
  10862. // We allow this because of a bug in IE8/9 that throws an error
  10863. // whenever `document.activeElement` is accessed on an iframe
  10864. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  10865. // See https://bugs.jquery.com/ticket/13378
  10866. rbuggyQSA = [];
  10867. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  10868. // Build QSA regex
  10869. // Regex strategy adopted from Diego Perini
  10870. assert(function( el ) {
  10871. // Select is set to empty string on purpose
  10872. // This is to test IE's treatment of not explicitly
  10873. // setting a boolean content attribute,
  10874. // since its presence should be enough
  10875. // https://bugs.jquery.com/ticket/12359
  10876. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  10877. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  10878. "<option selected=''></option></select>";
  10879. // Support: IE8, Opera 11-12.16
  10880. // Nothing should be selected when empty strings follow ^= or $= or *=
  10881. // The test attribute must be unknown in Opera but "safe" for WinRT
  10882. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  10883. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  10884. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  10885. }
  10886. // Support: IE8
  10887. // Boolean attributes and "value" are not treated correctly
  10888. if ( !el.querySelectorAll("[selected]").length ) {
  10889. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  10890. }
  10891. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  10892. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  10893. rbuggyQSA.push("~=");
  10894. }
  10895. // Webkit/Opera - :checked should return selected option elements
  10896. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  10897. // IE8 throws error here and will not see later tests
  10898. if ( !el.querySelectorAll(":checked").length ) {
  10899. rbuggyQSA.push(":checked");
  10900. }
  10901. // Support: Safari 8+, iOS 8+
  10902. // https://bugs.webkit.org/show_bug.cgi?id=136851
  10903. // In-page `selector#id sibling-combinator selector` fails
  10904. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  10905. rbuggyQSA.push(".#.+[+~]");
  10906. }
  10907. });
  10908. assert(function( el ) {
  10909. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  10910. "<select disabled='disabled'><option/></select>";
  10911. // Support: Windows 8 Native Apps
  10912. // The type and name attributes are restricted during .innerHTML assignment
  10913. var input = document.createElement("input");
  10914. input.setAttribute( "type", "hidden" );
  10915. el.appendChild( input ).setAttribute( "name", "D" );
  10916. // Support: IE8
  10917. // Enforce case-sensitivity of name attribute
  10918. if ( el.querySelectorAll("[name=d]").length ) {
  10919. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  10920. }
  10921. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  10922. // IE8 throws error here and will not see later tests
  10923. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  10924. rbuggyQSA.push( ":enabled", ":disabled" );
  10925. }
  10926. // Support: IE9-11+
  10927. // IE's :disabled selector does not pick up the children of disabled fieldsets
  10928. docElem.appendChild( el ).disabled = true;
  10929. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  10930. rbuggyQSA.push( ":enabled", ":disabled" );
  10931. }
  10932. // Opera 10-11 does not throw on post-comma invalid pseudos
  10933. el.querySelectorAll("*,:x");
  10934. rbuggyQSA.push(",.*:");
  10935. });
  10936. }
  10937. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  10938. docElem.webkitMatchesSelector ||
  10939. docElem.mozMatchesSelector ||
  10940. docElem.oMatchesSelector ||
  10941. docElem.msMatchesSelector) )) ) {
  10942. assert(function( el ) {
  10943. // Check to see if it's possible to do matchesSelector
  10944. // on a disconnected node (IE 9)
  10945. support.disconnectedMatch = matches.call( el, "*" );
  10946. // This should fail with an exception
  10947. // Gecko does not error, returns false instead
  10948. matches.call( el, "[s!='']:x" );
  10949. rbuggyMatches.push( "!=", pseudos );
  10950. });
  10951. }
  10952. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  10953. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  10954. /* Contains
  10955. ---------------------------------------------------------------------- */
  10956. hasCompare = rnative.test( docElem.compareDocumentPosition );
  10957. // Element contains another
  10958. // Purposefully self-exclusive
  10959. // As in, an element does not contain itself
  10960. contains = hasCompare || rnative.test( docElem.contains ) ?
  10961. function( a, b ) {
  10962. var adown = a.nodeType === 9 ? a.documentElement : a,
  10963. bup = b && b.parentNode;
  10964. return a === bup || !!( bup && bup.nodeType === 1 && (
  10965. adown.contains ?
  10966. adown.contains( bup ) :
  10967. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  10968. ));
  10969. } :
  10970. function( a, b ) {
  10971. if ( b ) {
  10972. while ( (b = b.parentNode) ) {
  10973. if ( b === a ) {
  10974. return true;
  10975. }
  10976. }
  10977. }
  10978. return false;
  10979. };
  10980. /* Sorting
  10981. ---------------------------------------------------------------------- */
  10982. // Document order sorting
  10983. sortOrder = hasCompare ?
  10984. function( a, b ) {
  10985. // Flag for duplicate removal
  10986. if ( a === b ) {
  10987. hasDuplicate = true;
  10988. return 0;
  10989. }
  10990. // Sort on method existence if only one input has compareDocumentPosition
  10991. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  10992. if ( compare ) {
  10993. return compare;
  10994. }
  10995. // Calculate position if both inputs belong to the same document
  10996. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  10997. a.compareDocumentPosition( b ) :
  10998. // Otherwise we know they are disconnected
  10999. 1;
  11000. // Disconnected nodes
  11001. if ( compare & 1 ||
  11002. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  11003. // Choose the first element that is related to our preferred document
  11004. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  11005. return -1;
  11006. }
  11007. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  11008. return 1;
  11009. }
  11010. // Maintain original order
  11011. return sortInput ?
  11012. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  11013. 0;
  11014. }
  11015. return compare & 4 ? -1 : 1;
  11016. } :
  11017. function( a, b ) {
  11018. // Exit early if the nodes are identical
  11019. if ( a === b ) {
  11020. hasDuplicate = true;
  11021. return 0;
  11022. }
  11023. var cur,
  11024. i = 0,
  11025. aup = a.parentNode,
  11026. bup = b.parentNode,
  11027. ap = [ a ],
  11028. bp = [ b ];
  11029. // Parentless nodes are either documents or disconnected
  11030. if ( !aup || !bup ) {
  11031. return a === document ? -1 :
  11032. b === document ? 1 :
  11033. aup ? -1 :
  11034. bup ? 1 :
  11035. sortInput ?
  11036. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  11037. 0;
  11038. // If the nodes are siblings, we can do a quick check
  11039. } else if ( aup === bup ) {
  11040. return siblingCheck( a, b );
  11041. }
  11042. // Otherwise we need full lists of their ancestors for comparison
  11043. cur = a;
  11044. while ( (cur = cur.parentNode) ) {
  11045. ap.unshift( cur );
  11046. }
  11047. cur = b;
  11048. while ( (cur = cur.parentNode) ) {
  11049. bp.unshift( cur );
  11050. }
  11051. // Walk down the tree looking for a discrepancy
  11052. while ( ap[i] === bp[i] ) {
  11053. i++;
  11054. }
  11055. return i ?
  11056. // Do a sibling check if the nodes have a common ancestor
  11057. siblingCheck( ap[i], bp[i] ) :
  11058. // Otherwise nodes in our document sort first
  11059. ap[i] === preferredDoc ? -1 :
  11060. bp[i] === preferredDoc ? 1 :
  11061. 0;
  11062. };
  11063. return document;
  11064. };
  11065. Sizzle.matches = function( expr, elements ) {
  11066. return Sizzle( expr, null, null, elements );
  11067. };
  11068. Sizzle.matchesSelector = function( elem, expr ) {
  11069. // Set document vars if needed
  11070. if ( ( elem.ownerDocument || elem ) !== document ) {
  11071. setDocument( elem );
  11072. }
  11073. if ( support.matchesSelector && documentIsHTML &&
  11074. !nonnativeSelectorCache[ expr + " " ] &&
  11075. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  11076. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  11077. try {
  11078. var ret = matches.call( elem, expr );
  11079. // IE 9's matchesSelector returns false on disconnected nodes
  11080. if ( ret || support.disconnectedMatch ||
  11081. // As well, disconnected nodes are said to be in a document
  11082. // fragment in IE 9
  11083. elem.document && elem.document.nodeType !== 11 ) {
  11084. return ret;
  11085. }
  11086. } catch (e) {
  11087. nonnativeSelectorCache( expr, true );
  11088. }
  11089. }
  11090. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  11091. };
  11092. Sizzle.contains = function( context, elem ) {
  11093. // Set document vars if needed
  11094. if ( ( context.ownerDocument || context ) !== document ) {
  11095. setDocument( context );
  11096. }
  11097. return contains( context, elem );
  11098. };
  11099. Sizzle.attr = function( elem, name ) {
  11100. // Set document vars if needed
  11101. if ( ( elem.ownerDocument || elem ) !== document ) {
  11102. setDocument( elem );
  11103. }
  11104. var fn = Expr.attrHandle[ name.toLowerCase() ],
  11105. // Don't get fooled by Object.prototype properties (jQuery #13807)
  11106. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  11107. fn( elem, name, !documentIsHTML ) :
  11108. undefined;
  11109. return val !== undefined ?
  11110. val :
  11111. support.attributes || !documentIsHTML ?
  11112. elem.getAttribute( name ) :
  11113. (val = elem.getAttributeNode(name)) && val.specified ?
  11114. val.value :
  11115. null;
  11116. };
  11117. Sizzle.escape = function( sel ) {
  11118. return (sel + "").replace( rcssescape, fcssescape );
  11119. };
  11120. Sizzle.error = function( msg ) {
  11121. throw new Error( "Syntax error, unrecognized expression: " + msg );
  11122. };
  11123. /**
  11124. * Document sorting and removing duplicates
  11125. * @param {ArrayLike} results
  11126. */
  11127. Sizzle.uniqueSort = function( results ) {
  11128. var elem,
  11129. duplicates = [],
  11130. j = 0,
  11131. i = 0;
  11132. // Unless we *know* we can detect duplicates, assume their presence
  11133. hasDuplicate = !support.detectDuplicates;
  11134. sortInput = !support.sortStable && results.slice( 0 );
  11135. results.sort( sortOrder );
  11136. if ( hasDuplicate ) {
  11137. while ( (elem = results[i++]) ) {
  11138. if ( elem === results[ i ] ) {
  11139. j = duplicates.push( i );
  11140. }
  11141. }
  11142. while ( j-- ) {
  11143. results.splice( duplicates[ j ], 1 );
  11144. }
  11145. }
  11146. // Clear input after sorting to release objects
  11147. // See https://github.com/jquery/sizzle/pull/225
  11148. sortInput = null;
  11149. return results;
  11150. };
  11151. /**
  11152. * Utility function for retrieving the text value of an array of DOM nodes
  11153. * @param {Array|Element} elem
  11154. */
  11155. getText = Sizzle.getText = function( elem ) {
  11156. var node,
  11157. ret = "",
  11158. i = 0,
  11159. nodeType = elem.nodeType;
  11160. if ( !nodeType ) {
  11161. // If no nodeType, this is expected to be an array
  11162. while ( (node = elem[i++]) ) {
  11163. // Do not traverse comment nodes
  11164. ret += getText( node );
  11165. }
  11166. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  11167. // Use textContent for elements
  11168. // innerText usage removed for consistency of new lines (jQuery #11153)
  11169. if ( typeof elem.textContent === "string" ) {
  11170. return elem.textContent;
  11171. } else {
  11172. // Traverse its children
  11173. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  11174. ret += getText( elem );
  11175. }
  11176. }
  11177. } else if ( nodeType === 3 || nodeType === 4 ) {
  11178. return elem.nodeValue;
  11179. }
  11180. // Do not include comment or processing instruction nodes
  11181. return ret;
  11182. };
  11183. Expr = Sizzle.selectors = {
  11184. // Can be adjusted by the user
  11185. cacheLength: 50,
  11186. createPseudo: markFunction,
  11187. match: matchExpr,
  11188. attrHandle: {},
  11189. find: {},
  11190. relative: {
  11191. ">": { dir: "parentNode", first: true },
  11192. " ": { dir: "parentNode" },
  11193. "+": { dir: "previousSibling", first: true },
  11194. "~": { dir: "previousSibling" }
  11195. },
  11196. preFilter: {
  11197. "ATTR": function( match ) {
  11198. match[1] = match[1].replace( runescape, funescape );
  11199. // Move the given value to match[3] whether quoted or unquoted
  11200. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  11201. if ( match[2] === "~=" ) {
  11202. match[3] = " " + match[3] + " ";
  11203. }
  11204. return match.slice( 0, 4 );
  11205. },
  11206. "CHILD": function( match ) {
  11207. /* matches from matchExpr["CHILD"]
  11208. 1 type (only|nth|...)
  11209. 2 what (child|of-type)
  11210. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  11211. 4 xn-component of xn+y argument ([+-]?\d*n|)
  11212. 5 sign of xn-component
  11213. 6 x of xn-component
  11214. 7 sign of y-component
  11215. 8 y of y-component
  11216. */
  11217. match[1] = match[1].toLowerCase();
  11218. if ( match[1].slice( 0, 3 ) === "nth" ) {
  11219. // nth-* requires argument
  11220. if ( !match[3] ) {
  11221. Sizzle.error( match[0] );
  11222. }
  11223. // numeric x and y parameters for Expr.filter.CHILD
  11224. // remember that false/true cast respectively to 0/1
  11225. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  11226. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  11227. // other types prohibit arguments
  11228. } else if ( match[3] ) {
  11229. Sizzle.error( match[0] );
  11230. }
  11231. return match;
  11232. },
  11233. "PSEUDO": function( match ) {
  11234. var excess,
  11235. unquoted = !match[6] && match[2];
  11236. if ( matchExpr["CHILD"].test( match[0] ) ) {
  11237. return null;
  11238. }
  11239. // Accept quoted arguments as-is
  11240. if ( match[3] ) {
  11241. match[2] = match[4] || match[5] || "";
  11242. // Strip excess characters from unquoted arguments
  11243. } else if ( unquoted && rpseudo.test( unquoted ) &&
  11244. // Get excess from tokenize (recursively)
  11245. (excess = tokenize( unquoted, true )) &&
  11246. // advance to the next closing parenthesis
  11247. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  11248. // excess is a negative index
  11249. match[0] = match[0].slice( 0, excess );
  11250. match[2] = unquoted.slice( 0, excess );
  11251. }
  11252. // Return only captures needed by the pseudo filter method (type and argument)
  11253. return match.slice( 0, 3 );
  11254. }
  11255. },
  11256. filter: {
  11257. "TAG": function( nodeNameSelector ) {
  11258. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  11259. return nodeNameSelector === "*" ?
  11260. function() { return true; } :
  11261. function( elem ) {
  11262. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  11263. };
  11264. },
  11265. "CLASS": function( className ) {
  11266. var pattern = classCache[ className + " " ];
  11267. return pattern ||
  11268. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  11269. classCache( className, function( elem ) {
  11270. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  11271. });
  11272. },
  11273. "ATTR": function( name, operator, check ) {
  11274. return function( elem ) {
  11275. var result = Sizzle.attr( elem, name );
  11276. if ( result == null ) {
  11277. return operator === "!=";
  11278. }
  11279. if ( !operator ) {
  11280. return true;
  11281. }
  11282. result += "";
  11283. return operator === "=" ? result === check :
  11284. operator === "!=" ? result !== check :
  11285. operator === "^=" ? check && result.indexOf( check ) === 0 :
  11286. operator === "*=" ? check && result.indexOf( check ) > -1 :
  11287. operator === "$=" ? check && result.slice( -check.length ) === check :
  11288. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  11289. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  11290. false;
  11291. };
  11292. },
  11293. "CHILD": function( type, what, argument, first, last ) {
  11294. var simple = type.slice( 0, 3 ) !== "nth",
  11295. forward = type.slice( -4 ) !== "last",
  11296. ofType = what === "of-type";
  11297. return first === 1 && last === 0 ?
  11298. // Shortcut for :nth-*(n)
  11299. function( elem ) {
  11300. return !!elem.parentNode;
  11301. } :
  11302. function( elem, context, xml ) {
  11303. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  11304. dir = simple !== forward ? "nextSibling" : "previousSibling",
  11305. parent = elem.parentNode,
  11306. name = ofType && elem.nodeName.toLowerCase(),
  11307. useCache = !xml && !ofType,
  11308. diff = false;
  11309. if ( parent ) {
  11310. // :(first|last|only)-(child|of-type)
  11311. if ( simple ) {
  11312. while ( dir ) {
  11313. node = elem;
  11314. while ( (node = node[ dir ]) ) {
  11315. if ( ofType ?
  11316. node.nodeName.toLowerCase() === name :
  11317. node.nodeType === 1 ) {
  11318. return false;
  11319. }
  11320. }
  11321. // Reverse direction for :only-* (if we haven't yet done so)
  11322. start = dir = type === "only" && !start && "nextSibling";
  11323. }
  11324. return true;
  11325. }
  11326. start = [ forward ? parent.firstChild : parent.lastChild ];
  11327. // non-xml :nth-child(...) stores cache data on `parent`
  11328. if ( forward && useCache ) {
  11329. // Seek `elem` from a previously-cached index
  11330. // ...in a gzip-friendly way
  11331. node = parent;
  11332. outerCache = node[ expando ] || (node[ expando ] = {});
  11333. // Support: IE <9 only
  11334. // Defend against cloned attroperties (jQuery gh-1709)
  11335. uniqueCache = outerCache[ node.uniqueID ] ||
  11336. (outerCache[ node.uniqueID ] = {});
  11337. cache = uniqueCache[ type ] || [];
  11338. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  11339. diff = nodeIndex && cache[ 2 ];
  11340. node = nodeIndex && parent.childNodes[ nodeIndex ];
  11341. while ( (node = ++nodeIndex && node && node[ dir ] ||
  11342. // Fallback to seeking `elem` from the start
  11343. (diff = nodeIndex = 0) || start.pop()) ) {
  11344. // When found, cache indexes on `parent` and break
  11345. if ( node.nodeType === 1 && ++diff && node === elem ) {
  11346. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  11347. break;
  11348. }
  11349. }
  11350. } else {
  11351. // Use previously-cached element index if available
  11352. if ( useCache ) {
  11353. // ...in a gzip-friendly way
  11354. node = elem;
  11355. outerCache = node[ expando ] || (node[ expando ] = {});
  11356. // Support: IE <9 only
  11357. // Defend against cloned attroperties (jQuery gh-1709)
  11358. uniqueCache = outerCache[ node.uniqueID ] ||
  11359. (outerCache[ node.uniqueID ] = {});
  11360. cache = uniqueCache[ type ] || [];
  11361. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  11362. diff = nodeIndex;
  11363. }
  11364. // xml :nth-child(...)
  11365. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  11366. if ( diff === false ) {
  11367. // Use the same loop as above to seek `elem` from the start
  11368. while ( (node = ++nodeIndex && node && node[ dir ] ||
  11369. (diff = nodeIndex = 0) || start.pop()) ) {
  11370. if ( ( ofType ?
  11371. node.nodeName.toLowerCase() === name :
  11372. node.nodeType === 1 ) &&
  11373. ++diff ) {
  11374. // Cache the index of each encountered element
  11375. if ( useCache ) {
  11376. outerCache = node[ expando ] || (node[ expando ] = {});
  11377. // Support: IE <9 only
  11378. // Defend against cloned attroperties (jQuery gh-1709)
  11379. uniqueCache = outerCache[ node.uniqueID ] ||
  11380. (outerCache[ node.uniqueID ] = {});
  11381. uniqueCache[ type ] = [ dirruns, diff ];
  11382. }
  11383. if ( node === elem ) {
  11384. break;
  11385. }
  11386. }
  11387. }
  11388. }
  11389. }
  11390. // Incorporate the offset, then check against cycle size
  11391. diff -= last;
  11392. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  11393. }
  11394. };
  11395. },
  11396. "PSEUDO": function( pseudo, argument ) {
  11397. // pseudo-class names are case-insensitive
  11398. // http://www.w3.org/TR/selectors/#pseudo-classes
  11399. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  11400. // Remember that setFilters inherits from pseudos
  11401. var args,
  11402. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  11403. Sizzle.error( "unsupported pseudo: " + pseudo );
  11404. // The user may use createPseudo to indicate that
  11405. // arguments are needed to create the filter function
  11406. // just as Sizzle does
  11407. if ( fn[ expando ] ) {
  11408. return fn( argument );
  11409. }
  11410. // But maintain support for old signatures
  11411. if ( fn.length > 1 ) {
  11412. args = [ pseudo, pseudo, "", argument ];
  11413. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  11414. markFunction(function( seed, matches ) {
  11415. var idx,
  11416. matched = fn( seed, argument ),
  11417. i = matched.length;
  11418. while ( i-- ) {
  11419. idx = indexOf( seed, matched[i] );
  11420. seed[ idx ] = !( matches[ idx ] = matched[i] );
  11421. }
  11422. }) :
  11423. function( elem ) {
  11424. return fn( elem, 0, args );
  11425. };
  11426. }
  11427. return fn;
  11428. }
  11429. },
  11430. pseudos: {
  11431. // Potentially complex pseudos
  11432. "not": markFunction(function( selector ) {
  11433. // Trim the selector passed to compile
  11434. // to avoid treating leading and trailing
  11435. // spaces as combinators
  11436. var input = [],
  11437. results = [],
  11438. matcher = compile( selector.replace( rtrim, "$1" ) );
  11439. return matcher[ expando ] ?
  11440. markFunction(function( seed, matches, context, xml ) {
  11441. var elem,
  11442. unmatched = matcher( seed, null, xml, [] ),
  11443. i = seed.length;
  11444. // Match elements unmatched by `matcher`
  11445. while ( i-- ) {
  11446. if ( (elem = unmatched[i]) ) {
  11447. seed[i] = !(matches[i] = elem);
  11448. }
  11449. }
  11450. }) :
  11451. function( elem, context, xml ) {
  11452. input[0] = elem;
  11453. matcher( input, null, xml, results );
  11454. // Don't keep the element (issue #299)
  11455. input[0] = null;
  11456. return !results.pop();
  11457. };
  11458. }),
  11459. "has": markFunction(function( selector ) {
  11460. return function( elem ) {
  11461. return Sizzle( selector, elem ).length > 0;
  11462. };
  11463. }),
  11464. "contains": markFunction(function( text ) {
  11465. text = text.replace( runescape, funescape );
  11466. return function( elem ) {
  11467. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  11468. };
  11469. }),
  11470. // "Whether an element is represented by a :lang() selector
  11471. // is based solely on the element's language value
  11472. // being equal to the identifier C,
  11473. // or beginning with the identifier C immediately followed by "-".
  11474. // The matching of C against the element's language value is performed case-insensitively.
  11475. // The identifier C does not have to be a valid language name."
  11476. // http://www.w3.org/TR/selectors/#lang-pseudo
  11477. "lang": markFunction( function( lang ) {
  11478. // lang value must be a valid identifier
  11479. if ( !ridentifier.test(lang || "") ) {
  11480. Sizzle.error( "unsupported lang: " + lang );
  11481. }
  11482. lang = lang.replace( runescape, funescape ).toLowerCase();
  11483. return function( elem ) {
  11484. var elemLang;
  11485. do {
  11486. if ( (elemLang = documentIsHTML ?
  11487. elem.lang :
  11488. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  11489. elemLang = elemLang.toLowerCase();
  11490. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  11491. }
  11492. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  11493. return false;
  11494. };
  11495. }),
  11496. // Miscellaneous
  11497. "target": function( elem ) {
  11498. var hash = window.location && window.location.hash;
  11499. return hash && hash.slice( 1 ) === elem.id;
  11500. },
  11501. "root": function( elem ) {
  11502. return elem === docElem;
  11503. },
  11504. "focus": function( elem ) {
  11505. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  11506. },
  11507. // Boolean properties
  11508. "enabled": createDisabledPseudo( false ),
  11509. "disabled": createDisabledPseudo( true ),
  11510. "checked": function( elem ) {
  11511. // In CSS3, :checked should return both checked and selected elements
  11512. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  11513. var nodeName = elem.nodeName.toLowerCase();
  11514. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  11515. },
  11516. "selected": function( elem ) {
  11517. // Accessing this property makes selected-by-default
  11518. // options in Safari work properly
  11519. if ( elem.parentNode ) {
  11520. elem.parentNode.selectedIndex;
  11521. }
  11522. return elem.selected === true;
  11523. },
  11524. // Contents
  11525. "empty": function( elem ) {
  11526. // http://www.w3.org/TR/selectors/#empty-pseudo
  11527. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  11528. // but not by others (comment: 8; processing instruction: 7; etc.)
  11529. // nodeType < 6 works because attributes (2) do not appear as children
  11530. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  11531. if ( elem.nodeType < 6 ) {
  11532. return false;
  11533. }
  11534. }
  11535. return true;
  11536. },
  11537. "parent": function( elem ) {
  11538. return !Expr.pseudos["empty"]( elem );
  11539. },
  11540. // Element/input types
  11541. "header": function( elem ) {
  11542. return rheader.test( elem.nodeName );
  11543. },
  11544. "input": function( elem ) {
  11545. return rinputs.test( elem.nodeName );
  11546. },
  11547. "button": function( elem ) {
  11548. var name = elem.nodeName.toLowerCase();
  11549. return name === "input" && elem.type === "button" || name === "button";
  11550. },
  11551. "text": function( elem ) {
  11552. var attr;
  11553. return elem.nodeName.toLowerCase() === "input" &&
  11554. elem.type === "text" &&
  11555. // Support: IE<8
  11556. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  11557. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  11558. },
  11559. // Position-in-collection
  11560. "first": createPositionalPseudo(function() {
  11561. return [ 0 ];
  11562. }),
  11563. "last": createPositionalPseudo(function( matchIndexes, length ) {
  11564. return [ length - 1 ];
  11565. }),
  11566. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11567. return [ argument < 0 ? argument + length : argument ];
  11568. }),
  11569. "even": createPositionalPseudo(function( matchIndexes, length ) {
  11570. var i = 0;
  11571. for ( ; i < length; i += 2 ) {
  11572. matchIndexes.push( i );
  11573. }
  11574. return matchIndexes;
  11575. }),
  11576. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  11577. var i = 1;
  11578. for ( ; i < length; i += 2 ) {
  11579. matchIndexes.push( i );
  11580. }
  11581. return matchIndexes;
  11582. }),
  11583. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11584. var i = argument < 0 ?
  11585. argument + length :
  11586. argument > length ?
  11587. length :
  11588. argument;
  11589. for ( ; --i >= 0; ) {
  11590. matchIndexes.push( i );
  11591. }
  11592. return matchIndexes;
  11593. }),
  11594. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11595. var i = argument < 0 ? argument + length : argument;
  11596. for ( ; ++i < length; ) {
  11597. matchIndexes.push( i );
  11598. }
  11599. return matchIndexes;
  11600. })
  11601. }
  11602. };
  11603. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  11604. // Add button/input type pseudos
  11605. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  11606. Expr.pseudos[ i ] = createInputPseudo( i );
  11607. }
  11608. for ( i in { submit: true, reset: true } ) {
  11609. Expr.pseudos[ i ] = createButtonPseudo( i );
  11610. }
  11611. // Easy API for creating new setFilters
  11612. function setFilters() {}
  11613. setFilters.prototype = Expr.filters = Expr.pseudos;
  11614. Expr.setFilters = new setFilters();
  11615. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  11616. var matched, match, tokens, type,
  11617. soFar, groups, preFilters,
  11618. cached = tokenCache[ selector + " " ];
  11619. if ( cached ) {
  11620. return parseOnly ? 0 : cached.slice( 0 );
  11621. }
  11622. soFar = selector;
  11623. groups = [];
  11624. preFilters = Expr.preFilter;
  11625. while ( soFar ) {
  11626. // Comma and first run
  11627. if ( !matched || (match = rcomma.exec( soFar )) ) {
  11628. if ( match ) {
  11629. // Don't consume trailing commas as valid
  11630. soFar = soFar.slice( match[0].length ) || soFar;
  11631. }
  11632. groups.push( (tokens = []) );
  11633. }
  11634. matched = false;
  11635. // Combinators
  11636. if ( (match = rcombinators.exec( soFar )) ) {
  11637. matched = match.shift();
  11638. tokens.push({
  11639. value: matched,
  11640. // Cast descendant combinators to space
  11641. type: match[0].replace( rtrim, " " )
  11642. });
  11643. soFar = soFar.slice( matched.length );
  11644. }
  11645. // Filters
  11646. for ( type in Expr.filter ) {
  11647. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  11648. (match = preFilters[ type ]( match ))) ) {
  11649. matched = match.shift();
  11650. tokens.push({
  11651. value: matched,
  11652. type: type,
  11653. matches: match
  11654. });
  11655. soFar = soFar.slice( matched.length );
  11656. }
  11657. }
  11658. if ( !matched ) {
  11659. break;
  11660. }
  11661. }
  11662. // Return the length of the invalid excess
  11663. // if we're just parsing
  11664. // Otherwise, throw an error or return tokens
  11665. return parseOnly ?
  11666. soFar.length :
  11667. soFar ?
  11668. Sizzle.error( selector ) :
  11669. // Cache the tokens
  11670. tokenCache( selector, groups ).slice( 0 );
  11671. };
  11672. function toSelector( tokens ) {
  11673. var i = 0,
  11674. len = tokens.length,
  11675. selector = "";
  11676. for ( ; i < len; i++ ) {
  11677. selector += tokens[i].value;
  11678. }
  11679. return selector;
  11680. }
  11681. function addCombinator( matcher, combinator, base ) {
  11682. var dir = combinator.dir,
  11683. skip = combinator.next,
  11684. key = skip || dir,
  11685. checkNonElements = base && key === "parentNode",
  11686. doneName = done++;
  11687. return combinator.first ?
  11688. // Check against closest ancestor/preceding element
  11689. function( elem, context, xml ) {
  11690. while ( (elem = elem[ dir ]) ) {
  11691. if ( elem.nodeType === 1 || checkNonElements ) {
  11692. return matcher( elem, context, xml );
  11693. }
  11694. }
  11695. return false;
  11696. } :
  11697. // Check against all ancestor/preceding elements
  11698. function( elem, context, xml ) {
  11699. var oldCache, uniqueCache, outerCache,
  11700. newCache = [ dirruns, doneName ];
  11701. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  11702. if ( xml ) {
  11703. while ( (elem = elem[ dir ]) ) {
  11704. if ( elem.nodeType === 1 || checkNonElements ) {
  11705. if ( matcher( elem, context, xml ) ) {
  11706. return true;
  11707. }
  11708. }
  11709. }
  11710. } else {
  11711. while ( (elem = elem[ dir ]) ) {
  11712. if ( elem.nodeType === 1 || checkNonElements ) {
  11713. outerCache = elem[ expando ] || (elem[ expando ] = {});
  11714. // Support: IE <9 only
  11715. // Defend against cloned attroperties (jQuery gh-1709)
  11716. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  11717. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  11718. elem = elem[ dir ] || elem;
  11719. } else if ( (oldCache = uniqueCache[ key ]) &&
  11720. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  11721. // Assign to newCache so results back-propagate to previous elements
  11722. return (newCache[ 2 ] = oldCache[ 2 ]);
  11723. } else {
  11724. // Reuse newcache so results back-propagate to previous elements
  11725. uniqueCache[ key ] = newCache;
  11726. // A match means we're done; a fail means we have to keep checking
  11727. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  11728. return true;
  11729. }
  11730. }
  11731. }
  11732. }
  11733. }
  11734. return false;
  11735. };
  11736. }
  11737. function elementMatcher( matchers ) {
  11738. return matchers.length > 1 ?
  11739. function( elem, context, xml ) {
  11740. var i = matchers.length;
  11741. while ( i-- ) {
  11742. if ( !matchers[i]( elem, context, xml ) ) {
  11743. return false;
  11744. }
  11745. }
  11746. return true;
  11747. } :
  11748. matchers[0];
  11749. }
  11750. function multipleContexts( selector, contexts, results ) {
  11751. var i = 0,
  11752. len = contexts.length;
  11753. for ( ; i < len; i++ ) {
  11754. Sizzle( selector, contexts[i], results );
  11755. }
  11756. return results;
  11757. }
  11758. function condense( unmatched, map, filter, context, xml ) {
  11759. var elem,
  11760. newUnmatched = [],
  11761. i = 0,
  11762. len = unmatched.length,
  11763. mapped = map != null;
  11764. for ( ; i < len; i++ ) {
  11765. if ( (elem = unmatched[i]) ) {
  11766. if ( !filter || filter( elem, context, xml ) ) {
  11767. newUnmatched.push( elem );
  11768. if ( mapped ) {
  11769. map.push( i );
  11770. }
  11771. }
  11772. }
  11773. }
  11774. return newUnmatched;
  11775. }
  11776. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  11777. if ( postFilter && !postFilter[ expando ] ) {
  11778. postFilter = setMatcher( postFilter );
  11779. }
  11780. if ( postFinder && !postFinder[ expando ] ) {
  11781. postFinder = setMatcher( postFinder, postSelector );
  11782. }
  11783. return markFunction(function( seed, results, context, xml ) {
  11784. var temp, i, elem,
  11785. preMap = [],
  11786. postMap = [],
  11787. preexisting = results.length,
  11788. // Get initial elements from seed or context
  11789. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  11790. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  11791. matcherIn = preFilter && ( seed || !selector ) ?
  11792. condense( elems, preMap, preFilter, context, xml ) :
  11793. elems,
  11794. matcherOut = matcher ?
  11795. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  11796. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  11797. // ...intermediate processing is necessary
  11798. [] :
  11799. // ...otherwise use results directly
  11800. results :
  11801. matcherIn;
  11802. // Find primary matches
  11803. if ( matcher ) {
  11804. matcher( matcherIn, matcherOut, context, xml );
  11805. }
  11806. // Apply postFilter
  11807. if ( postFilter ) {
  11808. temp = condense( matcherOut, postMap );
  11809. postFilter( temp, [], context, xml );
  11810. // Un-match failing elements by moving them back to matcherIn
  11811. i = temp.length;
  11812. while ( i-- ) {
  11813. if ( (elem = temp[i]) ) {
  11814. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  11815. }
  11816. }
  11817. }
  11818. if ( seed ) {
  11819. if ( postFinder || preFilter ) {
  11820. if ( postFinder ) {
  11821. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  11822. temp = [];
  11823. i = matcherOut.length;
  11824. while ( i-- ) {
  11825. if ( (elem = matcherOut[i]) ) {
  11826. // Restore matcherIn since elem is not yet a final match
  11827. temp.push( (matcherIn[i] = elem) );
  11828. }
  11829. }
  11830. postFinder( null, (matcherOut = []), temp, xml );
  11831. }
  11832. // Move matched elements from seed to results to keep them synchronized
  11833. i = matcherOut.length;
  11834. while ( i-- ) {
  11835. if ( (elem = matcherOut[i]) &&
  11836. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  11837. seed[temp] = !(results[temp] = elem);
  11838. }
  11839. }
  11840. }
  11841. // Add elements to results, through postFinder if defined
  11842. } else {
  11843. matcherOut = condense(
  11844. matcherOut === results ?
  11845. matcherOut.splice( preexisting, matcherOut.length ) :
  11846. matcherOut
  11847. );
  11848. if ( postFinder ) {
  11849. postFinder( null, results, matcherOut, xml );
  11850. } else {
  11851. push.apply( results, matcherOut );
  11852. }
  11853. }
  11854. });
  11855. }
  11856. function matcherFromTokens( tokens ) {
  11857. var checkContext, matcher, j,
  11858. len = tokens.length,
  11859. leadingRelative = Expr.relative[ tokens[0].type ],
  11860. implicitRelative = leadingRelative || Expr.relative[" "],
  11861. i = leadingRelative ? 1 : 0,
  11862. // The foundational matcher ensures that elements are reachable from top-level context(s)
  11863. matchContext = addCombinator( function( elem ) {
  11864. return elem === checkContext;
  11865. }, implicitRelative, true ),
  11866. matchAnyContext = addCombinator( function( elem ) {
  11867. return indexOf( checkContext, elem ) > -1;
  11868. }, implicitRelative, true ),
  11869. matchers = [ function( elem, context, xml ) {
  11870. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  11871. (checkContext = context).nodeType ?
  11872. matchContext( elem, context, xml ) :
  11873. matchAnyContext( elem, context, xml ) );
  11874. // Avoid hanging onto element (issue #299)
  11875. checkContext = null;
  11876. return ret;
  11877. } ];
  11878. for ( ; i < len; i++ ) {
  11879. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  11880. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  11881. } else {
  11882. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  11883. // Return special upon seeing a positional matcher
  11884. if ( matcher[ expando ] ) {
  11885. // Find the next relative operator (if any) for proper handling
  11886. j = ++i;
  11887. for ( ; j < len; j++ ) {
  11888. if ( Expr.relative[ tokens[j].type ] ) {
  11889. break;
  11890. }
  11891. }
  11892. return setMatcher(
  11893. i > 1 && elementMatcher( matchers ),
  11894. i > 1 && toSelector(
  11895. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  11896. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  11897. ).replace( rtrim, "$1" ),
  11898. matcher,
  11899. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  11900. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  11901. j < len && toSelector( tokens )
  11902. );
  11903. }
  11904. matchers.push( matcher );
  11905. }
  11906. }
  11907. return elementMatcher( matchers );
  11908. }
  11909. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  11910. var bySet = setMatchers.length > 0,
  11911. byElement = elementMatchers.length > 0,
  11912. superMatcher = function( seed, context, xml, results, outermost ) {
  11913. var elem, j, matcher,
  11914. matchedCount = 0,
  11915. i = "0",
  11916. unmatched = seed && [],
  11917. setMatched = [],
  11918. contextBackup = outermostContext,
  11919. // We must always have either seed elements or outermost context
  11920. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  11921. // Use integer dirruns iff this is the outermost matcher
  11922. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  11923. len = elems.length;
  11924. if ( outermost ) {
  11925. outermostContext = context === document || context || outermost;
  11926. }
  11927. // Add elements passing elementMatchers directly to results
  11928. // Support: IE<9, Safari
  11929. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  11930. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  11931. if ( byElement && elem ) {
  11932. j = 0;
  11933. if ( !context && elem.ownerDocument !== document ) {
  11934. setDocument( elem );
  11935. xml = !documentIsHTML;
  11936. }
  11937. while ( (matcher = elementMatchers[j++]) ) {
  11938. if ( matcher( elem, context || document, xml) ) {
  11939. results.push( elem );
  11940. break;
  11941. }
  11942. }
  11943. if ( outermost ) {
  11944. dirruns = dirrunsUnique;
  11945. }
  11946. }
  11947. // Track unmatched elements for set filters
  11948. if ( bySet ) {
  11949. // They will have gone through all possible matchers
  11950. if ( (elem = !matcher && elem) ) {
  11951. matchedCount--;
  11952. }
  11953. // Lengthen the array for every element, matched or not
  11954. if ( seed ) {
  11955. unmatched.push( elem );
  11956. }
  11957. }
  11958. }
  11959. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  11960. // makes the latter nonnegative.
  11961. matchedCount += i;
  11962. // Apply set filters to unmatched elements
  11963. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  11964. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  11965. // no element matchers and no seed.
  11966. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  11967. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  11968. // numerically zero.
  11969. if ( bySet && i !== matchedCount ) {
  11970. j = 0;
  11971. while ( (matcher = setMatchers[j++]) ) {
  11972. matcher( unmatched, setMatched, context, xml );
  11973. }
  11974. if ( seed ) {
  11975. // Reintegrate element matches to eliminate the need for sorting
  11976. if ( matchedCount > 0 ) {
  11977. while ( i-- ) {
  11978. if ( !(unmatched[i] || setMatched[i]) ) {
  11979. setMatched[i] = pop.call( results );
  11980. }
  11981. }
  11982. }
  11983. // Discard index placeholder values to get only actual matches
  11984. setMatched = condense( setMatched );
  11985. }
  11986. // Add matches to results
  11987. push.apply( results, setMatched );
  11988. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  11989. if ( outermost && !seed && setMatched.length > 0 &&
  11990. ( matchedCount + setMatchers.length ) > 1 ) {
  11991. Sizzle.uniqueSort( results );
  11992. }
  11993. }
  11994. // Override manipulation of globals by nested matchers
  11995. if ( outermost ) {
  11996. dirruns = dirrunsUnique;
  11997. outermostContext = contextBackup;
  11998. }
  11999. return unmatched;
  12000. };
  12001. return bySet ?
  12002. markFunction( superMatcher ) :
  12003. superMatcher;
  12004. }
  12005. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  12006. var i,
  12007. setMatchers = [],
  12008. elementMatchers = [],
  12009. cached = compilerCache[ selector + " " ];
  12010. if ( !cached ) {
  12011. // Generate a function of recursive functions that can be used to check each element
  12012. if ( !match ) {
  12013. match = tokenize( selector );
  12014. }
  12015. i = match.length;
  12016. while ( i-- ) {
  12017. cached = matcherFromTokens( match[i] );
  12018. if ( cached[ expando ] ) {
  12019. setMatchers.push( cached );
  12020. } else {
  12021. elementMatchers.push( cached );
  12022. }
  12023. }
  12024. // Cache the compiled function
  12025. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  12026. // Save selector and tokenization
  12027. cached.selector = selector;
  12028. }
  12029. return cached;
  12030. };
  12031. /**
  12032. * A low-level selection function that works with Sizzle's compiled
  12033. * selector functions
  12034. * @param {String|Function} selector A selector or a pre-compiled
  12035. * selector function built with Sizzle.compile
  12036. * @param {Element} context
  12037. * @param {Array} [results]
  12038. * @param {Array} [seed] A set of elements to match against
  12039. */
  12040. select = Sizzle.select = function( selector, context, results, seed ) {
  12041. var i, tokens, token, type, find,
  12042. compiled = typeof selector === "function" && selector,
  12043. match = !seed && tokenize( (selector = compiled.selector || selector) );
  12044. results = results || [];
  12045. // Try to minimize operations if there is only one selector in the list and no seed
  12046. // (the latter of which guarantees us context)
  12047. if ( match.length === 1 ) {
  12048. // Reduce context if the leading compound selector is an ID
  12049. tokens = match[0] = match[0].slice( 0 );
  12050. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  12051. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  12052. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  12053. if ( !context ) {
  12054. return results;
  12055. // Precompiled matchers will still verify ancestry, so step up a level
  12056. } else if ( compiled ) {
  12057. context = context.parentNode;
  12058. }
  12059. selector = selector.slice( tokens.shift().value.length );
  12060. }
  12061. // Fetch a seed set for right-to-left matching
  12062. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  12063. while ( i-- ) {
  12064. token = tokens[i];
  12065. // Abort if we hit a combinator
  12066. if ( Expr.relative[ (type = token.type) ] ) {
  12067. break;
  12068. }
  12069. if ( (find = Expr.find[ type ]) ) {
  12070. // Search, expanding context for leading sibling combinators
  12071. if ( (seed = find(
  12072. token.matches[0].replace( runescape, funescape ),
  12073. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  12074. )) ) {
  12075. // If seed is empty or no tokens remain, we can return early
  12076. tokens.splice( i, 1 );
  12077. selector = seed.length && toSelector( tokens );
  12078. if ( !selector ) {
  12079. push.apply( results, seed );
  12080. return results;
  12081. }
  12082. break;
  12083. }
  12084. }
  12085. }
  12086. }
  12087. // Compile and execute a filtering function if one is not provided
  12088. // Provide `match` to avoid retokenization if we modified the selector above
  12089. ( compiled || compile( selector, match ) )(
  12090. seed,
  12091. context,
  12092. !documentIsHTML,
  12093. results,
  12094. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  12095. );
  12096. return results;
  12097. };
  12098. // One-time assignments
  12099. // Sort stability
  12100. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  12101. // Support: Chrome 14-35+
  12102. // Always assume duplicates if they aren't passed to the comparison function
  12103. support.detectDuplicates = !!hasDuplicate;
  12104. // Initialize against the default document
  12105. setDocument();
  12106. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  12107. // Detached nodes confoundingly follow *each other*
  12108. support.sortDetached = assert(function( el ) {
  12109. // Should return 1, but returns 4 (following)
  12110. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  12111. });
  12112. // Support: IE<8
  12113. // Prevent attribute/property "interpolation"
  12114. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  12115. if ( !assert(function( el ) {
  12116. el.innerHTML = "<a href='#'></a>";
  12117. return el.firstChild.getAttribute("href") === "#" ;
  12118. }) ) {
  12119. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  12120. if ( !isXML ) {
  12121. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  12122. }
  12123. });
  12124. }
  12125. // Support: IE<9
  12126. // Use defaultValue in place of getAttribute("value")
  12127. if ( !support.attributes || !assert(function( el ) {
  12128. el.innerHTML = "<input/>";
  12129. el.firstChild.setAttribute( "value", "" );
  12130. return el.firstChild.getAttribute( "value" ) === "";
  12131. }) ) {
  12132. addHandle( "value", function( elem, name, isXML ) {
  12133. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  12134. return elem.defaultValue;
  12135. }
  12136. });
  12137. }
  12138. // Support: IE<9
  12139. // Use getAttributeNode to fetch booleans when getAttribute lies
  12140. if ( !assert(function( el ) {
  12141. return el.getAttribute("disabled") == null;
  12142. }) ) {
  12143. addHandle( booleans, function( elem, name, isXML ) {
  12144. var val;
  12145. if ( !isXML ) {
  12146. return elem[ name ] === true ? name.toLowerCase() :
  12147. (val = elem.getAttributeNode( name )) && val.specified ?
  12148. val.value :
  12149. null;
  12150. }
  12151. });
  12152. }
  12153. return Sizzle;
  12154. })( window );
  12155. jQuery.find = Sizzle;
  12156. jQuery.expr = Sizzle.selectors;
  12157. // Deprecated
  12158. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  12159. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  12160. jQuery.text = Sizzle.getText;
  12161. jQuery.isXMLDoc = Sizzle.isXML;
  12162. jQuery.contains = Sizzle.contains;
  12163. jQuery.escapeSelector = Sizzle.escape;
  12164. var dir = function( elem, dir, until ) {
  12165. var matched = [],
  12166. truncate = until !== undefined;
  12167. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  12168. if ( elem.nodeType === 1 ) {
  12169. if ( truncate && jQuery( elem ).is( until ) ) {
  12170. break;
  12171. }
  12172. matched.push( elem );
  12173. }
  12174. }
  12175. return matched;
  12176. };
  12177. var siblings = function( n, elem ) {
  12178. var matched = [];
  12179. for ( ; n; n = n.nextSibling ) {
  12180. if ( n.nodeType === 1 && n !== elem ) {
  12181. matched.push( n );
  12182. }
  12183. }
  12184. return matched;
  12185. };
  12186. var rneedsContext = jQuery.expr.match.needsContext;
  12187. function nodeName( elem, name ) {
  12188. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  12189. };
  12190. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  12191. // Implement the identical functionality for filter and not
  12192. function winnow( elements, qualifier, not ) {
  12193. if ( isFunction( qualifier ) ) {
  12194. return jQuery.grep( elements, function( elem, i ) {
  12195. return !!qualifier.call( elem, i, elem ) !== not;
  12196. } );
  12197. }
  12198. // Single element
  12199. if ( qualifier.nodeType ) {
  12200. return jQuery.grep( elements, function( elem ) {
  12201. return ( elem === qualifier ) !== not;
  12202. } );
  12203. }
  12204. // Arraylike of elements (jQuery, arguments, Array)
  12205. if ( typeof qualifier !== "string" ) {
  12206. return jQuery.grep( elements, function( elem ) {
  12207. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  12208. } );
  12209. }
  12210. // Filtered directly for both simple and complex selectors
  12211. return jQuery.filter( qualifier, elements, not );
  12212. }
  12213. jQuery.filter = function( expr, elems, not ) {
  12214. var elem = elems[ 0 ];
  12215. if ( not ) {
  12216. expr = ":not(" + expr + ")";
  12217. }
  12218. if ( elems.length === 1 && elem.nodeType === 1 ) {
  12219. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  12220. }
  12221. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  12222. return elem.nodeType === 1;
  12223. } ) );
  12224. };
  12225. jQuery.fn.extend( {
  12226. find: function( selector ) {
  12227. var i, ret,
  12228. len = this.length,
  12229. self = this;
  12230. if ( typeof selector !== "string" ) {
  12231. return this.pushStack( jQuery( selector ).filter( function() {
  12232. for ( i = 0; i < len; i++ ) {
  12233. if ( jQuery.contains( self[ i ], this ) ) {
  12234. return true;
  12235. }
  12236. }
  12237. } ) );
  12238. }
  12239. ret = this.pushStack( [] );
  12240. for ( i = 0; i < len; i++ ) {
  12241. jQuery.find( selector, self[ i ], ret );
  12242. }
  12243. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  12244. },
  12245. filter: function( selector ) {
  12246. return this.pushStack( winnow( this, selector || [], false ) );
  12247. },
  12248. not: function( selector ) {
  12249. return this.pushStack( winnow( this, selector || [], true ) );
  12250. },
  12251. is: function( selector ) {
  12252. return !!winnow(
  12253. this,
  12254. // If this is a positional/relative selector, check membership in the returned set
  12255. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  12256. typeof selector === "string" && rneedsContext.test( selector ) ?
  12257. jQuery( selector ) :
  12258. selector || [],
  12259. false
  12260. ).length;
  12261. }
  12262. } );
  12263. // Initialize a jQuery object
  12264. // A central reference to the root jQuery(document)
  12265. var rootjQuery,
  12266. // A simple way to check for HTML strings
  12267. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  12268. // Strict HTML recognition (#11290: must start with <)
  12269. // Shortcut simple #id case for speed
  12270. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  12271. init = jQuery.fn.init = function( selector, context, root ) {
  12272. var match, elem;
  12273. // HANDLE: $(""), $(null), $(undefined), $(false)
  12274. if ( !selector ) {
  12275. return this;
  12276. }
  12277. // Method init() accepts an alternate rootjQuery
  12278. // so migrate can support jQuery.sub (gh-2101)
  12279. root = root || rootjQuery;
  12280. // Handle HTML strings
  12281. if ( typeof selector === "string" ) {
  12282. if ( selector[ 0 ] === "<" &&
  12283. selector[ selector.length - 1 ] === ">" &&
  12284. selector.length >= 3 ) {
  12285. // Assume that strings that start and end with <> are HTML and skip the regex check
  12286. match = [ null, selector, null ];
  12287. } else {
  12288. match = rquickExpr.exec( selector );
  12289. }
  12290. // Match html or make sure no context is specified for #id
  12291. if ( match && ( match[ 1 ] || !context ) ) {
  12292. // HANDLE: $(html) -> $(array)
  12293. if ( match[ 1 ] ) {
  12294. context = context instanceof jQuery ? context[ 0 ] : context;
  12295. // Option to run scripts is true for back-compat
  12296. // Intentionally let the error be thrown if parseHTML is not present
  12297. jQuery.merge( this, jQuery.parseHTML(
  12298. match[ 1 ],
  12299. context && context.nodeType ? context.ownerDocument || context : document,
  12300. true
  12301. ) );
  12302. // HANDLE: $(html, props)
  12303. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  12304. for ( match in context ) {
  12305. // Properties of context are called as methods if possible
  12306. if ( isFunction( this[ match ] ) ) {
  12307. this[ match ]( context[ match ] );
  12308. // ...and otherwise set as attributes
  12309. } else {
  12310. this.attr( match, context[ match ] );
  12311. }
  12312. }
  12313. }
  12314. return this;
  12315. // HANDLE: $(#id)
  12316. } else {
  12317. elem = document.getElementById( match[ 2 ] );
  12318. if ( elem ) {
  12319. // Inject the element directly into the jQuery object
  12320. this[ 0 ] = elem;
  12321. this.length = 1;
  12322. }
  12323. return this;
  12324. }
  12325. // HANDLE: $(expr, $(...))
  12326. } else if ( !context || context.jquery ) {
  12327. return ( context || root ).find( selector );
  12328. // HANDLE: $(expr, context)
  12329. // (which is just equivalent to: $(context).find(expr)
  12330. } else {
  12331. return this.constructor( context ).find( selector );
  12332. }
  12333. // HANDLE: $(DOMElement)
  12334. } else if ( selector.nodeType ) {
  12335. this[ 0 ] = selector;
  12336. this.length = 1;
  12337. return this;
  12338. // HANDLE: $(function)
  12339. // Shortcut for document ready
  12340. } else if ( isFunction( selector ) ) {
  12341. return root.ready !== undefined ?
  12342. root.ready( selector ) :
  12343. // Execute immediately if ready is not present
  12344. selector( jQuery );
  12345. }
  12346. return jQuery.makeArray( selector, this );
  12347. };
  12348. // Give the init function the jQuery prototype for later instantiation
  12349. init.prototype = jQuery.fn;
  12350. // Initialize central reference
  12351. rootjQuery = jQuery( document );
  12352. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  12353. // Methods guaranteed to produce a unique set when starting from a unique set
  12354. guaranteedUnique = {
  12355. children: true,
  12356. contents: true,
  12357. next: true,
  12358. prev: true
  12359. };
  12360. jQuery.fn.extend( {
  12361. has: function( target ) {
  12362. var targets = jQuery( target, this ),
  12363. l = targets.length;
  12364. return this.filter( function() {
  12365. var i = 0;
  12366. for ( ; i < l; i++ ) {
  12367. if ( jQuery.contains( this, targets[ i ] ) ) {
  12368. return true;
  12369. }
  12370. }
  12371. } );
  12372. },
  12373. closest: function( selectors, context ) {
  12374. var cur,
  12375. i = 0,
  12376. l = this.length,
  12377. matched = [],
  12378. targets = typeof selectors !== "string" && jQuery( selectors );
  12379. // Positional selectors never match, since there's no _selection_ context
  12380. if ( !rneedsContext.test( selectors ) ) {
  12381. for ( ; i < l; i++ ) {
  12382. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  12383. // Always skip document fragments
  12384. if ( cur.nodeType < 11 && ( targets ?
  12385. targets.index( cur ) > -1 :
  12386. // Don't pass non-elements to Sizzle
  12387. cur.nodeType === 1 &&
  12388. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  12389. matched.push( cur );
  12390. break;
  12391. }
  12392. }
  12393. }
  12394. }
  12395. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  12396. },
  12397. // Determine the position of an element within the set
  12398. index: function( elem ) {
  12399. // No argument, return index in parent
  12400. if ( !elem ) {
  12401. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  12402. }
  12403. // Index in selector
  12404. if ( typeof elem === "string" ) {
  12405. return indexOf.call( jQuery( elem ), this[ 0 ] );
  12406. }
  12407. // Locate the position of the desired element
  12408. return indexOf.call( this,
  12409. // If it receives a jQuery object, the first element is used
  12410. elem.jquery ? elem[ 0 ] : elem
  12411. );
  12412. },
  12413. add: function( selector, context ) {
  12414. return this.pushStack(
  12415. jQuery.uniqueSort(
  12416. jQuery.merge( this.get(), jQuery( selector, context ) )
  12417. )
  12418. );
  12419. },
  12420. addBack: function( selector ) {
  12421. return this.add( selector == null ?
  12422. this.prevObject : this.prevObject.filter( selector )
  12423. );
  12424. }
  12425. } );
  12426. function sibling( cur, dir ) {
  12427. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  12428. return cur;
  12429. }
  12430. jQuery.each( {
  12431. parent: function( elem ) {
  12432. var parent = elem.parentNode;
  12433. return parent && parent.nodeType !== 11 ? parent : null;
  12434. },
  12435. parents: function( elem ) {
  12436. return dir( elem, "parentNode" );
  12437. },
  12438. parentsUntil: function( elem, i, until ) {
  12439. return dir( elem, "parentNode", until );
  12440. },
  12441. next: function( elem ) {
  12442. return sibling( elem, "nextSibling" );
  12443. },
  12444. prev: function( elem ) {
  12445. return sibling( elem, "previousSibling" );
  12446. },
  12447. nextAll: function( elem ) {
  12448. return dir( elem, "nextSibling" );
  12449. },
  12450. prevAll: function( elem ) {
  12451. return dir( elem, "previousSibling" );
  12452. },
  12453. nextUntil: function( elem, i, until ) {
  12454. return dir( elem, "nextSibling", until );
  12455. },
  12456. prevUntil: function( elem, i, until ) {
  12457. return dir( elem, "previousSibling", until );
  12458. },
  12459. siblings: function( elem ) {
  12460. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  12461. },
  12462. children: function( elem ) {
  12463. return siblings( elem.firstChild );
  12464. },
  12465. contents: function( elem ) {
  12466. if ( typeof elem.contentDocument !== "undefined" ) {
  12467. return elem.contentDocument;
  12468. }
  12469. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  12470. // Treat the template element as a regular one in browsers that
  12471. // don't support it.
  12472. if ( nodeName( elem, "template" ) ) {
  12473. elem = elem.content || elem;
  12474. }
  12475. return jQuery.merge( [], elem.childNodes );
  12476. }
  12477. }, function( name, fn ) {
  12478. jQuery.fn[ name ] = function( until, selector ) {
  12479. var matched = jQuery.map( this, fn, until );
  12480. if ( name.slice( -5 ) !== "Until" ) {
  12481. selector = until;
  12482. }
  12483. if ( selector && typeof selector === "string" ) {
  12484. matched = jQuery.filter( selector, matched );
  12485. }
  12486. if ( this.length > 1 ) {
  12487. // Remove duplicates
  12488. if ( !guaranteedUnique[ name ] ) {
  12489. jQuery.uniqueSort( matched );
  12490. }
  12491. // Reverse order for parents* and prev-derivatives
  12492. if ( rparentsprev.test( name ) ) {
  12493. matched.reverse();
  12494. }
  12495. }
  12496. return this.pushStack( matched );
  12497. };
  12498. } );
  12499. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  12500. // Convert String-formatted options into Object-formatted ones
  12501. function createOptions( options ) {
  12502. var object = {};
  12503. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  12504. object[ flag ] = true;
  12505. } );
  12506. return object;
  12507. }
  12508. /*
  12509. * Create a callback list using the following parameters:
  12510. *
  12511. * options: an optional list of space-separated options that will change how
  12512. * the callback list behaves or a more traditional option object
  12513. *
  12514. * By default a callback list will act like an event callback list and can be
  12515. * "fired" multiple times.
  12516. *
  12517. * Possible options:
  12518. *
  12519. * once: will ensure the callback list can only be fired once (like a Deferred)
  12520. *
  12521. * memory: will keep track of previous values and will call any callback added
  12522. * after the list has been fired right away with the latest "memorized"
  12523. * values (like a Deferred)
  12524. *
  12525. * unique: will ensure a callback can only be added once (no duplicate in the list)
  12526. *
  12527. * stopOnFalse: interrupt callings when a callback returns false
  12528. *
  12529. */
  12530. jQuery.Callbacks = function( options ) {
  12531. // Convert options from String-formatted to Object-formatted if needed
  12532. // (we check in cache first)
  12533. options = typeof options === "string" ?
  12534. createOptions( options ) :
  12535. jQuery.extend( {}, options );
  12536. var // Flag to know if list is currently firing
  12537. firing,
  12538. // Last fire value for non-forgettable lists
  12539. memory,
  12540. // Flag to know if list was already fired
  12541. fired,
  12542. // Flag to prevent firing
  12543. locked,
  12544. // Actual callback list
  12545. list = [],
  12546. // Queue of execution data for repeatable lists
  12547. queue = [],
  12548. // Index of currently firing callback (modified by add/remove as needed)
  12549. firingIndex = -1,
  12550. // Fire callbacks
  12551. fire = function() {
  12552. // Enforce single-firing
  12553. locked = locked || options.once;
  12554. // Execute callbacks for all pending executions,
  12555. // respecting firingIndex overrides and runtime changes
  12556. fired = firing = true;
  12557. for ( ; queue.length; firingIndex = -1 ) {
  12558. memory = queue.shift();
  12559. while ( ++firingIndex < list.length ) {
  12560. // Run callback and check for early termination
  12561. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  12562. options.stopOnFalse ) {
  12563. // Jump to end and forget the data so .add doesn't re-fire
  12564. firingIndex = list.length;
  12565. memory = false;
  12566. }
  12567. }
  12568. }
  12569. // Forget the data if we're done with it
  12570. if ( !options.memory ) {
  12571. memory = false;
  12572. }
  12573. firing = false;
  12574. // Clean up if we're done firing for good
  12575. if ( locked ) {
  12576. // Keep an empty list if we have data for future add calls
  12577. if ( memory ) {
  12578. list = [];
  12579. // Otherwise, this object is spent
  12580. } else {
  12581. list = "";
  12582. }
  12583. }
  12584. },
  12585. // Actual Callbacks object
  12586. self = {
  12587. // Add a callback or a collection of callbacks to the list
  12588. add: function() {
  12589. if ( list ) {
  12590. // If we have memory from a past run, we should fire after adding
  12591. if ( memory && !firing ) {
  12592. firingIndex = list.length - 1;
  12593. queue.push( memory );
  12594. }
  12595. ( function add( args ) {
  12596. jQuery.each( args, function( _, arg ) {
  12597. if ( isFunction( arg ) ) {
  12598. if ( !options.unique || !self.has( arg ) ) {
  12599. list.push( arg );
  12600. }
  12601. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  12602. // Inspect recursively
  12603. add( arg );
  12604. }
  12605. } );
  12606. } )( arguments );
  12607. if ( memory && !firing ) {
  12608. fire();
  12609. }
  12610. }
  12611. return this;
  12612. },
  12613. // Remove a callback from the list
  12614. remove: function() {
  12615. jQuery.each( arguments, function( _, arg ) {
  12616. var index;
  12617. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  12618. list.splice( index, 1 );
  12619. // Handle firing indexes
  12620. if ( index <= firingIndex ) {
  12621. firingIndex--;
  12622. }
  12623. }
  12624. } );
  12625. return this;
  12626. },
  12627. // Check if a given callback is in the list.
  12628. // If no argument is given, return whether or not list has callbacks attached.
  12629. has: function( fn ) {
  12630. return fn ?
  12631. jQuery.inArray( fn, list ) > -1 :
  12632. list.length > 0;
  12633. },
  12634. // Remove all callbacks from the list
  12635. empty: function() {
  12636. if ( list ) {
  12637. list = [];
  12638. }
  12639. return this;
  12640. },
  12641. // Disable .fire and .add
  12642. // Abort any current/pending executions
  12643. // Clear all callbacks and values
  12644. disable: function() {
  12645. locked = queue = [];
  12646. list = memory = "";
  12647. return this;
  12648. },
  12649. disabled: function() {
  12650. return !list;
  12651. },
  12652. // Disable .fire
  12653. // Also disable .add unless we have memory (since it would have no effect)
  12654. // Abort any pending executions
  12655. lock: function() {
  12656. locked = queue = [];
  12657. if ( !memory && !firing ) {
  12658. list = memory = "";
  12659. }
  12660. return this;
  12661. },
  12662. locked: function() {
  12663. return !!locked;
  12664. },
  12665. // Call all callbacks with the given context and arguments
  12666. fireWith: function( context, args ) {
  12667. if ( !locked ) {
  12668. args = args || [];
  12669. args = [ context, args.slice ? args.slice() : args ];
  12670. queue.push( args );
  12671. if ( !firing ) {
  12672. fire();
  12673. }
  12674. }
  12675. return this;
  12676. },
  12677. // Call all the callbacks with the given arguments
  12678. fire: function() {
  12679. self.fireWith( this, arguments );
  12680. return this;
  12681. },
  12682. // To know if the callbacks have already been called at least once
  12683. fired: function() {
  12684. return !!fired;
  12685. }
  12686. };
  12687. return self;
  12688. };
  12689. function Identity( v ) {
  12690. return v;
  12691. }
  12692. function Thrower( ex ) {
  12693. throw ex;
  12694. }
  12695. function adoptValue( value, resolve, reject, noValue ) {
  12696. var method;
  12697. try {
  12698. // Check for promise aspect first to privilege synchronous behavior
  12699. if ( value && isFunction( ( method = value.promise ) ) ) {
  12700. method.call( value ).done( resolve ).fail( reject );
  12701. // Other thenables
  12702. } else if ( value && isFunction( ( method = value.then ) ) ) {
  12703. method.call( value, resolve, reject );
  12704. // Other non-thenables
  12705. } else {
  12706. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  12707. // * false: [ value ].slice( 0 ) => resolve( value )
  12708. // * true: [ value ].slice( 1 ) => resolve()
  12709. resolve.apply( undefined, [ value ].slice( noValue ) );
  12710. }
  12711. // For Promises/A+, convert exceptions into rejections
  12712. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  12713. // Deferred#then to conditionally suppress rejection.
  12714. } catch ( value ) {
  12715. // Support: Android 4.0 only
  12716. // Strict mode functions invoked without .call/.apply get global-object context
  12717. reject.apply( undefined, [ value ] );
  12718. }
  12719. }
  12720. jQuery.extend( {
  12721. Deferred: function( func ) {
  12722. var tuples = [
  12723. // action, add listener, callbacks,
  12724. // ... .then handlers, argument index, [final state]
  12725. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  12726. jQuery.Callbacks( "memory" ), 2 ],
  12727. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  12728. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  12729. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  12730. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  12731. ],
  12732. state = "pending",
  12733. promise = {
  12734. state: function() {
  12735. return state;
  12736. },
  12737. always: function() {
  12738. deferred.done( arguments ).fail( arguments );
  12739. return this;
  12740. },
  12741. "catch": function( fn ) {
  12742. return promise.then( null, fn );
  12743. },
  12744. // Keep pipe for back-compat
  12745. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  12746. var fns = arguments;
  12747. return jQuery.Deferred( function( newDefer ) {
  12748. jQuery.each( tuples, function( i, tuple ) {
  12749. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  12750. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  12751. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  12752. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  12753. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  12754. deferred[ tuple[ 1 ] ]( function() {
  12755. var returned = fn && fn.apply( this, arguments );
  12756. if ( returned && isFunction( returned.promise ) ) {
  12757. returned.promise()
  12758. .progress( newDefer.notify )
  12759. .done( newDefer.resolve )
  12760. .fail( newDefer.reject );
  12761. } else {
  12762. newDefer[ tuple[ 0 ] + "With" ](
  12763. this,
  12764. fn ? [ returned ] : arguments
  12765. );
  12766. }
  12767. } );
  12768. } );
  12769. fns = null;
  12770. } ).promise();
  12771. },
  12772. then: function( onFulfilled, onRejected, onProgress ) {
  12773. var maxDepth = 0;
  12774. function resolve( depth, deferred, handler, special ) {
  12775. return function() {
  12776. var that = this,
  12777. args = arguments,
  12778. mightThrow = function() {
  12779. var returned, then;
  12780. // Support: Promises/A+ section 2.3.3.3.3
  12781. // https://promisesaplus.com/#point-59
  12782. // Ignore double-resolution attempts
  12783. if ( depth < maxDepth ) {
  12784. return;
  12785. }
  12786. returned = handler.apply( that, args );
  12787. // Support: Promises/A+ section 2.3.1
  12788. // https://promisesaplus.com/#point-48
  12789. if ( returned === deferred.promise() ) {
  12790. throw new TypeError( "Thenable self-resolution" );
  12791. }
  12792. // Support: Promises/A+ sections 2.3.3.1, 3.5
  12793. // https://promisesaplus.com/#point-54
  12794. // https://promisesaplus.com/#point-75
  12795. // Retrieve `then` only once
  12796. then = returned &&
  12797. // Support: Promises/A+ section 2.3.4
  12798. // https://promisesaplus.com/#point-64
  12799. // Only check objects and functions for thenability
  12800. ( typeof returned === "object" ||
  12801. typeof returned === "function" ) &&
  12802. returned.then;
  12803. // Handle a returned thenable
  12804. if ( isFunction( then ) ) {
  12805. // Special processors (notify) just wait for resolution
  12806. if ( special ) {
  12807. then.call(
  12808. returned,
  12809. resolve( maxDepth, deferred, Identity, special ),
  12810. resolve( maxDepth, deferred, Thrower, special )
  12811. );
  12812. // Normal processors (resolve) also hook into progress
  12813. } else {
  12814. // ...and disregard older resolution values
  12815. maxDepth++;
  12816. then.call(
  12817. returned,
  12818. resolve( maxDepth, deferred, Identity, special ),
  12819. resolve( maxDepth, deferred, Thrower, special ),
  12820. resolve( maxDepth, deferred, Identity,
  12821. deferred.notifyWith )
  12822. );
  12823. }
  12824. // Handle all other returned values
  12825. } else {
  12826. // Only substitute handlers pass on context
  12827. // and multiple values (non-spec behavior)
  12828. if ( handler !== Identity ) {
  12829. that = undefined;
  12830. args = [ returned ];
  12831. }
  12832. // Process the value(s)
  12833. // Default process is resolve
  12834. ( special || deferred.resolveWith )( that, args );
  12835. }
  12836. },
  12837. // Only normal processors (resolve) catch and reject exceptions
  12838. process = special ?
  12839. mightThrow :
  12840. function() {
  12841. try {
  12842. mightThrow();
  12843. } catch ( e ) {
  12844. if ( jQuery.Deferred.exceptionHook ) {
  12845. jQuery.Deferred.exceptionHook( e,
  12846. process.stackTrace );
  12847. }
  12848. // Support: Promises/A+ section 2.3.3.3.4.1
  12849. // https://promisesaplus.com/#point-61
  12850. // Ignore post-resolution exceptions
  12851. if ( depth + 1 >= maxDepth ) {
  12852. // Only substitute handlers pass on context
  12853. // and multiple values (non-spec behavior)
  12854. if ( handler !== Thrower ) {
  12855. that = undefined;
  12856. args = [ e ];
  12857. }
  12858. deferred.rejectWith( that, args );
  12859. }
  12860. }
  12861. };
  12862. // Support: Promises/A+ section 2.3.3.3.1
  12863. // https://promisesaplus.com/#point-57
  12864. // Re-resolve promises immediately to dodge false rejection from
  12865. // subsequent errors
  12866. if ( depth ) {
  12867. process();
  12868. } else {
  12869. // Call an optional hook to record the stack, in case of exception
  12870. // since it's otherwise lost when execution goes async
  12871. if ( jQuery.Deferred.getStackHook ) {
  12872. process.stackTrace = jQuery.Deferred.getStackHook();
  12873. }
  12874. window.setTimeout( process );
  12875. }
  12876. };
  12877. }
  12878. return jQuery.Deferred( function( newDefer ) {
  12879. // progress_handlers.add( ... )
  12880. tuples[ 0 ][ 3 ].add(
  12881. resolve(
  12882. 0,
  12883. newDefer,
  12884. isFunction( onProgress ) ?
  12885. onProgress :
  12886. Identity,
  12887. newDefer.notifyWith
  12888. )
  12889. );
  12890. // fulfilled_handlers.add( ... )
  12891. tuples[ 1 ][ 3 ].add(
  12892. resolve(
  12893. 0,
  12894. newDefer,
  12895. isFunction( onFulfilled ) ?
  12896. onFulfilled :
  12897. Identity
  12898. )
  12899. );
  12900. // rejected_handlers.add( ... )
  12901. tuples[ 2 ][ 3 ].add(
  12902. resolve(
  12903. 0,
  12904. newDefer,
  12905. isFunction( onRejected ) ?
  12906. onRejected :
  12907. Thrower
  12908. )
  12909. );
  12910. } ).promise();
  12911. },
  12912. // Get a promise for this deferred
  12913. // If obj is provided, the promise aspect is added to the object
  12914. promise: function( obj ) {
  12915. return obj != null ? jQuery.extend( obj, promise ) : promise;
  12916. }
  12917. },
  12918. deferred = {};
  12919. // Add list-specific methods
  12920. jQuery.each( tuples, function( i, tuple ) {
  12921. var list = tuple[ 2 ],
  12922. stateString = tuple[ 5 ];
  12923. // promise.progress = list.add
  12924. // promise.done = list.add
  12925. // promise.fail = list.add
  12926. promise[ tuple[ 1 ] ] = list.add;
  12927. // Handle state
  12928. if ( stateString ) {
  12929. list.add(
  12930. function() {
  12931. // state = "resolved" (i.e., fulfilled)
  12932. // state = "rejected"
  12933. state = stateString;
  12934. },
  12935. // rejected_callbacks.disable
  12936. // fulfilled_callbacks.disable
  12937. tuples[ 3 - i ][ 2 ].disable,
  12938. // rejected_handlers.disable
  12939. // fulfilled_handlers.disable
  12940. tuples[ 3 - i ][ 3 ].disable,
  12941. // progress_callbacks.lock
  12942. tuples[ 0 ][ 2 ].lock,
  12943. // progress_handlers.lock
  12944. tuples[ 0 ][ 3 ].lock
  12945. );
  12946. }
  12947. // progress_handlers.fire
  12948. // fulfilled_handlers.fire
  12949. // rejected_handlers.fire
  12950. list.add( tuple[ 3 ].fire );
  12951. // deferred.notify = function() { deferred.notifyWith(...) }
  12952. // deferred.resolve = function() { deferred.resolveWith(...) }
  12953. // deferred.reject = function() { deferred.rejectWith(...) }
  12954. deferred[ tuple[ 0 ] ] = function() {
  12955. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  12956. return this;
  12957. };
  12958. // deferred.notifyWith = list.fireWith
  12959. // deferred.resolveWith = list.fireWith
  12960. // deferred.rejectWith = list.fireWith
  12961. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  12962. } );
  12963. // Make the deferred a promise
  12964. promise.promise( deferred );
  12965. // Call given func if any
  12966. if ( func ) {
  12967. func.call( deferred, deferred );
  12968. }
  12969. // All done!
  12970. return deferred;
  12971. },
  12972. // Deferred helper
  12973. when: function( singleValue ) {
  12974. var
  12975. // count of uncompleted subordinates
  12976. remaining = arguments.length,
  12977. // count of unprocessed arguments
  12978. i = remaining,
  12979. // subordinate fulfillment data
  12980. resolveContexts = Array( i ),
  12981. resolveValues = slice.call( arguments ),
  12982. // the master Deferred
  12983. master = jQuery.Deferred(),
  12984. // subordinate callback factory
  12985. updateFunc = function( i ) {
  12986. return function( value ) {
  12987. resolveContexts[ i ] = this;
  12988. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  12989. if ( !( --remaining ) ) {
  12990. master.resolveWith( resolveContexts, resolveValues );
  12991. }
  12992. };
  12993. };
  12994. // Single- and empty arguments are adopted like Promise.resolve
  12995. if ( remaining <= 1 ) {
  12996. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  12997. !remaining );
  12998. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  12999. if ( master.state() === "pending" ||
  13000. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  13001. return master.then();
  13002. }
  13003. }
  13004. // Multiple arguments are aggregated like Promise.all array elements
  13005. while ( i-- ) {
  13006. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  13007. }
  13008. return master.promise();
  13009. }
  13010. } );
  13011. // These usually indicate a programmer mistake during development,
  13012. // warn about them ASAP rather than swallowing them by default.
  13013. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  13014. jQuery.Deferred.exceptionHook = function( error, stack ) {
  13015. // Support: IE 8 - 9 only
  13016. // Console exists when dev tools are open, which can happen at any time
  13017. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  13018. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  13019. }
  13020. };
  13021. jQuery.readyException = function( error ) {
  13022. window.setTimeout( function() {
  13023. throw error;
  13024. } );
  13025. };
  13026. // The deferred used on DOM ready
  13027. var readyList = jQuery.Deferred();
  13028. jQuery.fn.ready = function( fn ) {
  13029. readyList
  13030. .then( fn )
  13031. // Wrap jQuery.readyException in a function so that the lookup
  13032. // happens at the time of error handling instead of callback
  13033. // registration.
  13034. .catch( function( error ) {
  13035. jQuery.readyException( error );
  13036. } );
  13037. return this;
  13038. };
  13039. jQuery.extend( {
  13040. // Is the DOM ready to be used? Set to true once it occurs.
  13041. isReady: false,
  13042. // A counter to track how many items to wait for before
  13043. // the ready event fires. See #6781
  13044. readyWait: 1,
  13045. // Handle when the DOM is ready
  13046. ready: function( wait ) {
  13047. // Abort if there are pending holds or we're already ready
  13048. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  13049. return;
  13050. }
  13051. // Remember that the DOM is ready
  13052. jQuery.isReady = true;
  13053. // If a normal DOM Ready event fired, decrement, and wait if need be
  13054. if ( wait !== true && --jQuery.readyWait > 0 ) {
  13055. return;
  13056. }
  13057. // If there are functions bound, to execute
  13058. readyList.resolveWith( document, [ jQuery ] );
  13059. }
  13060. } );
  13061. jQuery.ready.then = readyList.then;
  13062. // The ready event handler and self cleanup method
  13063. function completed() {
  13064. document.removeEventListener( "DOMContentLoaded", completed );
  13065. window.removeEventListener( "load", completed );
  13066. jQuery.ready();
  13067. }
  13068. // Catch cases where $(document).ready() is called
  13069. // after the browser event has already occurred.
  13070. // Support: IE <=9 - 10 only
  13071. // Older IE sometimes signals "interactive" too soon
  13072. if ( document.readyState === "complete" ||
  13073. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  13074. // Handle it asynchronously to allow scripts the opportunity to delay ready
  13075. window.setTimeout( jQuery.ready );
  13076. } else {
  13077. // Use the handy event callback
  13078. document.addEventListener( "DOMContentLoaded", completed );
  13079. // A fallback to window.onload, that will always work
  13080. window.addEventListener( "load", completed );
  13081. }
  13082. // Multifunctional method to get and set values of a collection
  13083. // The value/s can optionally be executed if it's a function
  13084. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  13085. var i = 0,
  13086. len = elems.length,
  13087. bulk = key == null;
  13088. // Sets many values
  13089. if ( toType( key ) === "object" ) {
  13090. chainable = true;
  13091. for ( i in key ) {
  13092. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  13093. }
  13094. // Sets one value
  13095. } else if ( value !== undefined ) {
  13096. chainable = true;
  13097. if ( !isFunction( value ) ) {
  13098. raw = true;
  13099. }
  13100. if ( bulk ) {
  13101. // Bulk operations run against the entire set
  13102. if ( raw ) {
  13103. fn.call( elems, value );
  13104. fn = null;
  13105. // ...except when executing function values
  13106. } else {
  13107. bulk = fn;
  13108. fn = function( elem, key, value ) {
  13109. return bulk.call( jQuery( elem ), value );
  13110. };
  13111. }
  13112. }
  13113. if ( fn ) {
  13114. for ( ; i < len; i++ ) {
  13115. fn(
  13116. elems[ i ], key, raw ?
  13117. value :
  13118. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  13119. );
  13120. }
  13121. }
  13122. }
  13123. if ( chainable ) {
  13124. return elems;
  13125. }
  13126. // Gets
  13127. if ( bulk ) {
  13128. return fn.call( elems );
  13129. }
  13130. return len ? fn( elems[ 0 ], key ) : emptyGet;
  13131. };
  13132. // Matches dashed string for camelizing
  13133. var rmsPrefix = /^-ms-/,
  13134. rdashAlpha = /-([a-z])/g;
  13135. // Used by camelCase as callback to replace()
  13136. function fcamelCase( all, letter ) {
  13137. return letter.toUpperCase();
  13138. }
  13139. // Convert dashed to camelCase; used by the css and data modules
  13140. // Support: IE <=9 - 11, Edge 12 - 15
  13141. // Microsoft forgot to hump their vendor prefix (#9572)
  13142. function camelCase( string ) {
  13143. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  13144. }
  13145. var acceptData = function( owner ) {
  13146. // Accepts only:
  13147. // - Node
  13148. // - Node.ELEMENT_NODE
  13149. // - Node.DOCUMENT_NODE
  13150. // - Object
  13151. // - Any
  13152. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  13153. };
  13154. function Data() {
  13155. this.expando = jQuery.expando + Data.uid++;
  13156. }
  13157. Data.uid = 1;
  13158. Data.prototype = {
  13159. cache: function( owner ) {
  13160. // Check if the owner object already has a cache
  13161. var value = owner[ this.expando ];
  13162. // If not, create one
  13163. if ( !value ) {
  13164. value = {};
  13165. // We can accept data for non-element nodes in modern browsers,
  13166. // but we should not, see #8335.
  13167. // Always return an empty object.
  13168. if ( acceptData( owner ) ) {
  13169. // If it is a node unlikely to be stringify-ed or looped over
  13170. // use plain assignment
  13171. if ( owner.nodeType ) {
  13172. owner[ this.expando ] = value;
  13173. // Otherwise secure it in a non-enumerable property
  13174. // configurable must be true to allow the property to be
  13175. // deleted when data is removed
  13176. } else {
  13177. Object.defineProperty( owner, this.expando, {
  13178. value: value,
  13179. configurable: true
  13180. } );
  13181. }
  13182. }
  13183. }
  13184. return value;
  13185. },
  13186. set: function( owner, data, value ) {
  13187. var prop,
  13188. cache = this.cache( owner );
  13189. // Handle: [ owner, key, value ] args
  13190. // Always use camelCase key (gh-2257)
  13191. if ( typeof data === "string" ) {
  13192. cache[ camelCase( data ) ] = value;
  13193. // Handle: [ owner, { properties } ] args
  13194. } else {
  13195. // Copy the properties one-by-one to the cache object
  13196. for ( prop in data ) {
  13197. cache[ camelCase( prop ) ] = data[ prop ];
  13198. }
  13199. }
  13200. return cache;
  13201. },
  13202. get: function( owner, key ) {
  13203. return key === undefined ?
  13204. this.cache( owner ) :
  13205. // Always use camelCase key (gh-2257)
  13206. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  13207. },
  13208. access: function( owner, key, value ) {
  13209. // In cases where either:
  13210. //
  13211. // 1. No key was specified
  13212. // 2. A string key was specified, but no value provided
  13213. //
  13214. // Take the "read" path and allow the get method to determine
  13215. // which value to return, respectively either:
  13216. //
  13217. // 1. The entire cache object
  13218. // 2. The data stored at the key
  13219. //
  13220. if ( key === undefined ||
  13221. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  13222. return this.get( owner, key );
  13223. }
  13224. // When the key is not a string, or both a key and value
  13225. // are specified, set or extend (existing objects) with either:
  13226. //
  13227. // 1. An object of properties
  13228. // 2. A key and value
  13229. //
  13230. this.set( owner, key, value );
  13231. // Since the "set" path can have two possible entry points
  13232. // return the expected data based on which path was taken[*]
  13233. return value !== undefined ? value : key;
  13234. },
  13235. remove: function( owner, key ) {
  13236. var i,
  13237. cache = owner[ this.expando ];
  13238. if ( cache === undefined ) {
  13239. return;
  13240. }
  13241. if ( key !== undefined ) {
  13242. // Support array or space separated string of keys
  13243. if ( Array.isArray( key ) ) {
  13244. // If key is an array of keys...
  13245. // We always set camelCase keys, so remove that.
  13246. key = key.map( camelCase );
  13247. } else {
  13248. key = camelCase( key );
  13249. // If a key with the spaces exists, use it.
  13250. // Otherwise, create an array by matching non-whitespace
  13251. key = key in cache ?
  13252. [ key ] :
  13253. ( key.match( rnothtmlwhite ) || [] );
  13254. }
  13255. i = key.length;
  13256. while ( i-- ) {
  13257. delete cache[ key[ i ] ];
  13258. }
  13259. }
  13260. // Remove the expando if there's no more data
  13261. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  13262. // Support: Chrome <=35 - 45
  13263. // Webkit & Blink performance suffers when deleting properties
  13264. // from DOM nodes, so set to undefined instead
  13265. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  13266. if ( owner.nodeType ) {
  13267. owner[ this.expando ] = undefined;
  13268. } else {
  13269. delete owner[ this.expando ];
  13270. }
  13271. }
  13272. },
  13273. hasData: function( owner ) {
  13274. var cache = owner[ this.expando ];
  13275. return cache !== undefined && !jQuery.isEmptyObject( cache );
  13276. }
  13277. };
  13278. var dataPriv = new Data();
  13279. var dataUser = new Data();
  13280. // Implementation Summary
  13281. //
  13282. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  13283. // 2. Improve the module's maintainability by reducing the storage
  13284. // paths to a single mechanism.
  13285. // 3. Use the same single mechanism to support "private" and "user" data.
  13286. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  13287. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  13288. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  13289. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  13290. rmultiDash = /[A-Z]/g;
  13291. function getData( data ) {
  13292. if ( data === "true" ) {
  13293. return true;
  13294. }
  13295. if ( data === "false" ) {
  13296. return false;
  13297. }
  13298. if ( data === "null" ) {
  13299. return null;
  13300. }
  13301. // Only convert to a number if it doesn't change the string
  13302. if ( data === +data + "" ) {
  13303. return +data;
  13304. }
  13305. if ( rbrace.test( data ) ) {
  13306. return JSON.parse( data );
  13307. }
  13308. return data;
  13309. }
  13310. function dataAttr( elem, key, data ) {
  13311. var name;
  13312. // If nothing was found internally, try to fetch any
  13313. // data from the HTML5 data-* attribute
  13314. if ( data === undefined && elem.nodeType === 1 ) {
  13315. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  13316. data = elem.getAttribute( name );
  13317. if ( typeof data === "string" ) {
  13318. try {
  13319. data = getData( data );
  13320. } catch ( e ) {}
  13321. // Make sure we set the data so it isn't changed later
  13322. dataUser.set( elem, key, data );
  13323. } else {
  13324. data = undefined;
  13325. }
  13326. }
  13327. return data;
  13328. }
  13329. jQuery.extend( {
  13330. hasData: function( elem ) {
  13331. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  13332. },
  13333. data: function( elem, name, data ) {
  13334. return dataUser.access( elem, name, data );
  13335. },
  13336. removeData: function( elem, name ) {
  13337. dataUser.remove( elem, name );
  13338. },
  13339. // TODO: Now that all calls to _data and _removeData have been replaced
  13340. // with direct calls to dataPriv methods, these can be deprecated.
  13341. _data: function( elem, name, data ) {
  13342. return dataPriv.access( elem, name, data );
  13343. },
  13344. _removeData: function( elem, name ) {
  13345. dataPriv.remove( elem, name );
  13346. }
  13347. } );
  13348. jQuery.fn.extend( {
  13349. data: function( key, value ) {
  13350. var i, name, data,
  13351. elem = this[ 0 ],
  13352. attrs = elem && elem.attributes;
  13353. // Gets all values
  13354. if ( key === undefined ) {
  13355. if ( this.length ) {
  13356. data = dataUser.get( elem );
  13357. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  13358. i = attrs.length;
  13359. while ( i-- ) {
  13360. // Support: IE 11 only
  13361. // The attrs elements can be null (#14894)
  13362. if ( attrs[ i ] ) {
  13363. name = attrs[ i ].name;
  13364. if ( name.indexOf( "data-" ) === 0 ) {
  13365. name = camelCase( name.slice( 5 ) );
  13366. dataAttr( elem, name, data[ name ] );
  13367. }
  13368. }
  13369. }
  13370. dataPriv.set( elem, "hasDataAttrs", true );
  13371. }
  13372. }
  13373. return data;
  13374. }
  13375. // Sets multiple values
  13376. if ( typeof key === "object" ) {
  13377. return this.each( function() {
  13378. dataUser.set( this, key );
  13379. } );
  13380. }
  13381. return access( this, function( value ) {
  13382. var data;
  13383. // The calling jQuery object (element matches) is not empty
  13384. // (and therefore has an element appears at this[ 0 ]) and the
  13385. // `value` parameter was not undefined. An empty jQuery object
  13386. // will result in `undefined` for elem = this[ 0 ] which will
  13387. // throw an exception if an attempt to read a data cache is made.
  13388. if ( elem && value === undefined ) {
  13389. // Attempt to get data from the cache
  13390. // The key will always be camelCased in Data
  13391. data = dataUser.get( elem, key );
  13392. if ( data !== undefined ) {
  13393. return data;
  13394. }
  13395. // Attempt to "discover" the data in
  13396. // HTML5 custom data-* attrs
  13397. data = dataAttr( elem, key );
  13398. if ( data !== undefined ) {
  13399. return data;
  13400. }
  13401. // We tried really hard, but the data doesn't exist.
  13402. return;
  13403. }
  13404. // Set the data...
  13405. this.each( function() {
  13406. // We always store the camelCased key
  13407. dataUser.set( this, key, value );
  13408. } );
  13409. }, null, value, arguments.length > 1, null, true );
  13410. },
  13411. removeData: function( key ) {
  13412. return this.each( function() {
  13413. dataUser.remove( this, key );
  13414. } );
  13415. }
  13416. } );
  13417. jQuery.extend( {
  13418. queue: function( elem, type, data ) {
  13419. var queue;
  13420. if ( elem ) {
  13421. type = ( type || "fx" ) + "queue";
  13422. queue = dataPriv.get( elem, type );
  13423. // Speed up dequeue by getting out quickly if this is just a lookup
  13424. if ( data ) {
  13425. if ( !queue || Array.isArray( data ) ) {
  13426. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  13427. } else {
  13428. queue.push( data );
  13429. }
  13430. }
  13431. return queue || [];
  13432. }
  13433. },
  13434. dequeue: function( elem, type ) {
  13435. type = type || "fx";
  13436. var queue = jQuery.queue( elem, type ),
  13437. startLength = queue.length,
  13438. fn = queue.shift(),
  13439. hooks = jQuery._queueHooks( elem, type ),
  13440. next = function() {
  13441. jQuery.dequeue( elem, type );
  13442. };
  13443. // If the fx queue is dequeued, always remove the progress sentinel
  13444. if ( fn === "inprogress" ) {
  13445. fn = queue.shift();
  13446. startLength--;
  13447. }
  13448. if ( fn ) {
  13449. // Add a progress sentinel to prevent the fx queue from being
  13450. // automatically dequeued
  13451. if ( type === "fx" ) {
  13452. queue.unshift( "inprogress" );
  13453. }
  13454. // Clear up the last queue stop function
  13455. delete hooks.stop;
  13456. fn.call( elem, next, hooks );
  13457. }
  13458. if ( !startLength && hooks ) {
  13459. hooks.empty.fire();
  13460. }
  13461. },
  13462. // Not public - generate a queueHooks object, or return the current one
  13463. _queueHooks: function( elem, type ) {
  13464. var key = type + "queueHooks";
  13465. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  13466. empty: jQuery.Callbacks( "once memory" ).add( function() {
  13467. dataPriv.remove( elem, [ type + "queue", key ] );
  13468. } )
  13469. } );
  13470. }
  13471. } );
  13472. jQuery.fn.extend( {
  13473. queue: function( type, data ) {
  13474. var setter = 2;
  13475. if ( typeof type !== "string" ) {
  13476. data = type;
  13477. type = "fx";
  13478. setter--;
  13479. }
  13480. if ( arguments.length < setter ) {
  13481. return jQuery.queue( this[ 0 ], type );
  13482. }
  13483. return data === undefined ?
  13484. this :
  13485. this.each( function() {
  13486. var queue = jQuery.queue( this, type, data );
  13487. // Ensure a hooks for this queue
  13488. jQuery._queueHooks( this, type );
  13489. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  13490. jQuery.dequeue( this, type );
  13491. }
  13492. } );
  13493. },
  13494. dequeue: function( type ) {
  13495. return this.each( function() {
  13496. jQuery.dequeue( this, type );
  13497. } );
  13498. },
  13499. clearQueue: function( type ) {
  13500. return this.queue( type || "fx", [] );
  13501. },
  13502. // Get a promise resolved when queues of a certain type
  13503. // are emptied (fx is the type by default)
  13504. promise: function( type, obj ) {
  13505. var tmp,
  13506. count = 1,
  13507. defer = jQuery.Deferred(),
  13508. elements = this,
  13509. i = this.length,
  13510. resolve = function() {
  13511. if ( !( --count ) ) {
  13512. defer.resolveWith( elements, [ elements ] );
  13513. }
  13514. };
  13515. if ( typeof type !== "string" ) {
  13516. obj = type;
  13517. type = undefined;
  13518. }
  13519. type = type || "fx";
  13520. while ( i-- ) {
  13521. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  13522. if ( tmp && tmp.empty ) {
  13523. count++;
  13524. tmp.empty.add( resolve );
  13525. }
  13526. }
  13527. resolve();
  13528. return defer.promise( obj );
  13529. }
  13530. } );
  13531. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  13532. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  13533. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  13534. var documentElement = document.documentElement;
  13535. var isAttached = function( elem ) {
  13536. return jQuery.contains( elem.ownerDocument, elem );
  13537. },
  13538. composed = { composed: true };
  13539. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  13540. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  13541. // Support: iOS 10.0-10.2 only
  13542. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  13543. // leading to errors. We need to check for `getRootNode`.
  13544. if ( documentElement.getRootNode ) {
  13545. isAttached = function( elem ) {
  13546. return jQuery.contains( elem.ownerDocument, elem ) ||
  13547. elem.getRootNode( composed ) === elem.ownerDocument;
  13548. };
  13549. }
  13550. var isHiddenWithinTree = function( elem, el ) {
  13551. // isHiddenWithinTree might be called from jQuery#filter function;
  13552. // in that case, element will be second argument
  13553. elem = el || elem;
  13554. // Inline style trumps all
  13555. return elem.style.display === "none" ||
  13556. elem.style.display === "" &&
  13557. // Otherwise, check computed style
  13558. // Support: Firefox <=43 - 45
  13559. // Disconnected elements can have computed display: none, so first confirm that elem is
  13560. // in the document.
  13561. isAttached( elem ) &&
  13562. jQuery.css( elem, "display" ) === "none";
  13563. };
  13564. var swap = function( elem, options, callback, args ) {
  13565. var ret, name,
  13566. old = {};
  13567. // Remember the old values, and insert the new ones
  13568. for ( name in options ) {
  13569. old[ name ] = elem.style[ name ];
  13570. elem.style[ name ] = options[ name ];
  13571. }
  13572. ret = callback.apply( elem, args || [] );
  13573. // Revert the old values
  13574. for ( name in options ) {
  13575. elem.style[ name ] = old[ name ];
  13576. }
  13577. return ret;
  13578. };
  13579. function adjustCSS( elem, prop, valueParts, tween ) {
  13580. var adjusted, scale,
  13581. maxIterations = 20,
  13582. currentValue = tween ?
  13583. function() {
  13584. return tween.cur();
  13585. } :
  13586. function() {
  13587. return jQuery.css( elem, prop, "" );
  13588. },
  13589. initial = currentValue(),
  13590. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  13591. // Starting value computation is required for potential unit mismatches
  13592. initialInUnit = elem.nodeType &&
  13593. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  13594. rcssNum.exec( jQuery.css( elem, prop ) );
  13595. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  13596. // Support: Firefox <=54
  13597. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  13598. initial = initial / 2;
  13599. // Trust units reported by jQuery.css
  13600. unit = unit || initialInUnit[ 3 ];
  13601. // Iteratively approximate from a nonzero starting point
  13602. initialInUnit = +initial || 1;
  13603. while ( maxIterations-- ) {
  13604. // Evaluate and update our best guess (doubling guesses that zero out).
  13605. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  13606. jQuery.style( elem, prop, initialInUnit + unit );
  13607. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  13608. maxIterations = 0;
  13609. }
  13610. initialInUnit = initialInUnit / scale;
  13611. }
  13612. initialInUnit = initialInUnit * 2;
  13613. jQuery.style( elem, prop, initialInUnit + unit );
  13614. // Make sure we update the tween properties later on
  13615. valueParts = valueParts || [];
  13616. }
  13617. if ( valueParts ) {
  13618. initialInUnit = +initialInUnit || +initial || 0;
  13619. // Apply relative offset (+=/-=) if specified
  13620. adjusted = valueParts[ 1 ] ?
  13621. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  13622. +valueParts[ 2 ];
  13623. if ( tween ) {
  13624. tween.unit = unit;
  13625. tween.start = initialInUnit;
  13626. tween.end = adjusted;
  13627. }
  13628. }
  13629. return adjusted;
  13630. }
  13631. var defaultDisplayMap = {};
  13632. function getDefaultDisplay( elem ) {
  13633. var temp,
  13634. doc = elem.ownerDocument,
  13635. nodeName = elem.nodeName,
  13636. display = defaultDisplayMap[ nodeName ];
  13637. if ( display ) {
  13638. return display;
  13639. }
  13640. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  13641. display = jQuery.css( temp, "display" );
  13642. temp.parentNode.removeChild( temp );
  13643. if ( display === "none" ) {
  13644. display = "block";
  13645. }
  13646. defaultDisplayMap[ nodeName ] = display;
  13647. return display;
  13648. }
  13649. function showHide( elements, show ) {
  13650. var display, elem,
  13651. values = [],
  13652. index = 0,
  13653. length = elements.length;
  13654. // Determine new display value for elements that need to change
  13655. for ( ; index < length; index++ ) {
  13656. elem = elements[ index ];
  13657. if ( !elem.style ) {
  13658. continue;
  13659. }
  13660. display = elem.style.display;
  13661. if ( show ) {
  13662. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  13663. // check is required in this first loop unless we have a nonempty display value (either
  13664. // inline or about-to-be-restored)
  13665. if ( display === "none" ) {
  13666. values[ index ] = dataPriv.get( elem, "display" ) || null;
  13667. if ( !values[ index ] ) {
  13668. elem.style.display = "";
  13669. }
  13670. }
  13671. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  13672. values[ index ] = getDefaultDisplay( elem );
  13673. }
  13674. } else {
  13675. if ( display !== "none" ) {
  13676. values[ index ] = "none";
  13677. // Remember what we're overwriting
  13678. dataPriv.set( elem, "display", display );
  13679. }
  13680. }
  13681. }
  13682. // Set the display of the elements in a second loop to avoid constant reflow
  13683. for ( index = 0; index < length; index++ ) {
  13684. if ( values[ index ] != null ) {
  13685. elements[ index ].style.display = values[ index ];
  13686. }
  13687. }
  13688. return elements;
  13689. }
  13690. jQuery.fn.extend( {
  13691. show: function() {
  13692. return showHide( this, true );
  13693. },
  13694. hide: function() {
  13695. return showHide( this );
  13696. },
  13697. toggle: function( state ) {
  13698. if ( typeof state === "boolean" ) {
  13699. return state ? this.show() : this.hide();
  13700. }
  13701. return this.each( function() {
  13702. if ( isHiddenWithinTree( this ) ) {
  13703. jQuery( this ).show();
  13704. } else {
  13705. jQuery( this ).hide();
  13706. }
  13707. } );
  13708. }
  13709. } );
  13710. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  13711. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  13712. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  13713. // We have to close these tags to support XHTML (#13200)
  13714. var wrapMap = {
  13715. // Support: IE <=9 only
  13716. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  13717. // XHTML parsers do not magically insert elements in the
  13718. // same way that tag soup parsers do. So we cannot shorten
  13719. // this by omitting <tbody> or other required elements.
  13720. thead: [ 1, "<table>", "</table>" ],
  13721. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  13722. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  13723. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  13724. _default: [ 0, "", "" ]
  13725. };
  13726. // Support: IE <=9 only
  13727. wrapMap.optgroup = wrapMap.option;
  13728. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  13729. wrapMap.th = wrapMap.td;
  13730. function getAll( context, tag ) {
  13731. // Support: IE <=9 - 11 only
  13732. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  13733. var ret;
  13734. if ( typeof context.getElementsByTagName !== "undefined" ) {
  13735. ret = context.getElementsByTagName( tag || "*" );
  13736. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  13737. ret = context.querySelectorAll( tag || "*" );
  13738. } else {
  13739. ret = [];
  13740. }
  13741. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  13742. return jQuery.merge( [ context ], ret );
  13743. }
  13744. return ret;
  13745. }
  13746. // Mark scripts as having already been evaluated
  13747. function setGlobalEval( elems, refElements ) {
  13748. var i = 0,
  13749. l = elems.length;
  13750. for ( ; i < l; i++ ) {
  13751. dataPriv.set(
  13752. elems[ i ],
  13753. "globalEval",
  13754. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  13755. );
  13756. }
  13757. }
  13758. var rhtml = /<|&#?\w+;/;
  13759. function buildFragment( elems, context, scripts, selection, ignored ) {
  13760. var elem, tmp, tag, wrap, attached, j,
  13761. fragment = context.createDocumentFragment(),
  13762. nodes = [],
  13763. i = 0,
  13764. l = elems.length;
  13765. for ( ; i < l; i++ ) {
  13766. elem = elems[ i ];
  13767. if ( elem || elem === 0 ) {
  13768. // Add nodes directly
  13769. if ( toType( elem ) === "object" ) {
  13770. // Support: Android <=4.0 only, PhantomJS 1 only
  13771. // push.apply(_, arraylike) throws on ancient WebKit
  13772. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  13773. // Convert non-html into a text node
  13774. } else if ( !rhtml.test( elem ) ) {
  13775. nodes.push( context.createTextNode( elem ) );
  13776. // Convert html into DOM nodes
  13777. } else {
  13778. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  13779. // Deserialize a standard representation
  13780. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  13781. wrap = wrapMap[ tag ] || wrapMap._default;
  13782. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  13783. // Descend through wrappers to the right content
  13784. j = wrap[ 0 ];
  13785. while ( j-- ) {
  13786. tmp = tmp.lastChild;
  13787. }
  13788. // Support: Android <=4.0 only, PhantomJS 1 only
  13789. // push.apply(_, arraylike) throws on ancient WebKit
  13790. jQuery.merge( nodes, tmp.childNodes );
  13791. // Remember the top-level container
  13792. tmp = fragment.firstChild;
  13793. // Ensure the created nodes are orphaned (#12392)
  13794. tmp.textContent = "";
  13795. }
  13796. }
  13797. }
  13798. // Remove wrapper from fragment
  13799. fragment.textContent = "";
  13800. i = 0;
  13801. while ( ( elem = nodes[ i++ ] ) ) {
  13802. // Skip elements already in the context collection (trac-4087)
  13803. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  13804. if ( ignored ) {
  13805. ignored.push( elem );
  13806. }
  13807. continue;
  13808. }
  13809. attached = isAttached( elem );
  13810. // Append to fragment
  13811. tmp = getAll( fragment.appendChild( elem ), "script" );
  13812. // Preserve script evaluation history
  13813. if ( attached ) {
  13814. setGlobalEval( tmp );
  13815. }
  13816. // Capture executables
  13817. if ( scripts ) {
  13818. j = 0;
  13819. while ( ( elem = tmp[ j++ ] ) ) {
  13820. if ( rscriptType.test( elem.type || "" ) ) {
  13821. scripts.push( elem );
  13822. }
  13823. }
  13824. }
  13825. }
  13826. return fragment;
  13827. }
  13828. ( function() {
  13829. var fragment = document.createDocumentFragment(),
  13830. div = fragment.appendChild( document.createElement( "div" ) ),
  13831. input = document.createElement( "input" );
  13832. // Support: Android 4.0 - 4.3 only
  13833. // Check state lost if the name is set (#11217)
  13834. // Support: Windows Web Apps (WWA)
  13835. // `name` and `type` must use .setAttribute for WWA (#14901)
  13836. input.setAttribute( "type", "radio" );
  13837. input.setAttribute( "checked", "checked" );
  13838. input.setAttribute( "name", "t" );
  13839. div.appendChild( input );
  13840. // Support: Android <=4.1 only
  13841. // Older WebKit doesn't clone checked state correctly in fragments
  13842. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  13843. // Support: IE <=11 only
  13844. // Make sure textarea (and checkbox) defaultValue is properly cloned
  13845. div.innerHTML = "<textarea>x</textarea>";
  13846. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  13847. } )();
  13848. var
  13849. rkeyEvent = /^key/,
  13850. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  13851. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  13852. function returnTrue() {
  13853. return true;
  13854. }
  13855. function returnFalse() {
  13856. return false;
  13857. }
  13858. // Support: IE <=9 - 11+
  13859. // focus() and blur() are asynchronous, except when they are no-op.
  13860. // So expect focus to be synchronous when the element is already active,
  13861. // and blur to be synchronous when the element is not already active.
  13862. // (focus and blur are always synchronous in other supported browsers,
  13863. // this just defines when we can count on it).
  13864. function expectSync( elem, type ) {
  13865. return ( elem === safeActiveElement() ) === ( type === "focus" );
  13866. }
  13867. // Support: IE <=9 only
  13868. // Accessing document.activeElement can throw unexpectedly
  13869. // https://bugs.jquery.com/ticket/13393
  13870. function safeActiveElement() {
  13871. try {
  13872. return document.activeElement;
  13873. } catch ( err ) { }
  13874. }
  13875. function on( elem, types, selector, data, fn, one ) {
  13876. var origFn, type;
  13877. // Types can be a map of types/handlers
  13878. if ( typeof types === "object" ) {
  13879. // ( types-Object, selector, data )
  13880. if ( typeof selector !== "string" ) {
  13881. // ( types-Object, data )
  13882. data = data || selector;
  13883. selector = undefined;
  13884. }
  13885. for ( type in types ) {
  13886. on( elem, type, selector, data, types[ type ], one );
  13887. }
  13888. return elem;
  13889. }
  13890. if ( data == null && fn == null ) {
  13891. // ( types, fn )
  13892. fn = selector;
  13893. data = selector = undefined;
  13894. } else if ( fn == null ) {
  13895. if ( typeof selector === "string" ) {
  13896. // ( types, selector, fn )
  13897. fn = data;
  13898. data = undefined;
  13899. } else {
  13900. // ( types, data, fn )
  13901. fn = data;
  13902. data = selector;
  13903. selector = undefined;
  13904. }
  13905. }
  13906. if ( fn === false ) {
  13907. fn = returnFalse;
  13908. } else if ( !fn ) {
  13909. return elem;
  13910. }
  13911. if ( one === 1 ) {
  13912. origFn = fn;
  13913. fn = function( event ) {
  13914. // Can use an empty set, since event contains the info
  13915. jQuery().off( event );
  13916. return origFn.apply( this, arguments );
  13917. };
  13918. // Use same guid so caller can remove using origFn
  13919. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  13920. }
  13921. return elem.each( function() {
  13922. jQuery.event.add( this, types, fn, data, selector );
  13923. } );
  13924. }
  13925. /*
  13926. * Helper functions for managing events -- not part of the public interface.
  13927. * Props to Dean Edwards' addEvent library for many of the ideas.
  13928. */
  13929. jQuery.event = {
  13930. global: {},
  13931. add: function( elem, types, handler, data, selector ) {
  13932. var handleObjIn, eventHandle, tmp,
  13933. events, t, handleObj,
  13934. special, handlers, type, namespaces, origType,
  13935. elemData = dataPriv.get( elem );
  13936. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  13937. if ( !elemData ) {
  13938. return;
  13939. }
  13940. // Caller can pass in an object of custom data in lieu of the handler
  13941. if ( handler.handler ) {
  13942. handleObjIn = handler;
  13943. handler = handleObjIn.handler;
  13944. selector = handleObjIn.selector;
  13945. }
  13946. // Ensure that invalid selectors throw exceptions at attach time
  13947. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  13948. if ( selector ) {
  13949. jQuery.find.matchesSelector( documentElement, selector );
  13950. }
  13951. // Make sure that the handler has a unique ID, used to find/remove it later
  13952. if ( !handler.guid ) {
  13953. handler.guid = jQuery.guid++;
  13954. }
  13955. // Init the element's event structure and main handler, if this is the first
  13956. if ( !( events = elemData.events ) ) {
  13957. events = elemData.events = {};
  13958. }
  13959. if ( !( eventHandle = elemData.handle ) ) {
  13960. eventHandle = elemData.handle = function( e ) {
  13961. // Discard the second event of a jQuery.event.trigger() and
  13962. // when an event is called after a page has unloaded
  13963. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  13964. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  13965. };
  13966. }
  13967. // Handle multiple events separated by a space
  13968. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  13969. t = types.length;
  13970. while ( t-- ) {
  13971. tmp = rtypenamespace.exec( types[ t ] ) || [];
  13972. type = origType = tmp[ 1 ];
  13973. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  13974. // There *must* be a type, no attaching namespace-only handlers
  13975. if ( !type ) {
  13976. continue;
  13977. }
  13978. // If event changes its type, use the special event handlers for the changed type
  13979. special = jQuery.event.special[ type ] || {};
  13980. // If selector defined, determine special event api type, otherwise given type
  13981. type = ( selector ? special.delegateType : special.bindType ) || type;
  13982. // Update special based on newly reset type
  13983. special = jQuery.event.special[ type ] || {};
  13984. // handleObj is passed to all event handlers
  13985. handleObj = jQuery.extend( {
  13986. type: type,
  13987. origType: origType,
  13988. data: data,
  13989. handler: handler,
  13990. guid: handler.guid,
  13991. selector: selector,
  13992. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  13993. namespace: namespaces.join( "." )
  13994. }, handleObjIn );
  13995. // Init the event handler queue if we're the first
  13996. if ( !( handlers = events[ type ] ) ) {
  13997. handlers = events[ type ] = [];
  13998. handlers.delegateCount = 0;
  13999. // Only use addEventListener if the special events handler returns false
  14000. if ( !special.setup ||
  14001. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  14002. if ( elem.addEventListener ) {
  14003. elem.addEventListener( type, eventHandle );
  14004. }
  14005. }
  14006. }
  14007. if ( special.add ) {
  14008. special.add.call( elem, handleObj );
  14009. if ( !handleObj.handler.guid ) {
  14010. handleObj.handler.guid = handler.guid;
  14011. }
  14012. }
  14013. // Add to the element's handler list, delegates in front
  14014. if ( selector ) {
  14015. handlers.splice( handlers.delegateCount++, 0, handleObj );
  14016. } else {
  14017. handlers.push( handleObj );
  14018. }
  14019. // Keep track of which events have ever been used, for event optimization
  14020. jQuery.event.global[ type ] = true;
  14021. }
  14022. },
  14023. // Detach an event or set of events from an element
  14024. remove: function( elem, types, handler, selector, mappedTypes ) {
  14025. var j, origCount, tmp,
  14026. events, t, handleObj,
  14027. special, handlers, type, namespaces, origType,
  14028. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  14029. if ( !elemData || !( events = elemData.events ) ) {
  14030. return;
  14031. }
  14032. // Once for each type.namespace in types; type may be omitted
  14033. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  14034. t = types.length;
  14035. while ( t-- ) {
  14036. tmp = rtypenamespace.exec( types[ t ] ) || [];
  14037. type = origType = tmp[ 1 ];
  14038. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  14039. // Unbind all events (on this namespace, if provided) for the element
  14040. if ( !type ) {
  14041. for ( type in events ) {
  14042. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  14043. }
  14044. continue;
  14045. }
  14046. special = jQuery.event.special[ type ] || {};
  14047. type = ( selector ? special.delegateType : special.bindType ) || type;
  14048. handlers = events[ type ] || [];
  14049. tmp = tmp[ 2 ] &&
  14050. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  14051. // Remove matching events
  14052. origCount = j = handlers.length;
  14053. while ( j-- ) {
  14054. handleObj = handlers[ j ];
  14055. if ( ( mappedTypes || origType === handleObj.origType ) &&
  14056. ( !handler || handler.guid === handleObj.guid ) &&
  14057. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  14058. ( !selector || selector === handleObj.selector ||
  14059. selector === "**" && handleObj.selector ) ) {
  14060. handlers.splice( j, 1 );
  14061. if ( handleObj.selector ) {
  14062. handlers.delegateCount--;
  14063. }
  14064. if ( special.remove ) {
  14065. special.remove.call( elem, handleObj );
  14066. }
  14067. }
  14068. }
  14069. // Remove generic event handler if we removed something and no more handlers exist
  14070. // (avoids potential for endless recursion during removal of special event handlers)
  14071. if ( origCount && !handlers.length ) {
  14072. if ( !special.teardown ||
  14073. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  14074. jQuery.removeEvent( elem, type, elemData.handle );
  14075. }
  14076. delete events[ type ];
  14077. }
  14078. }
  14079. // Remove data and the expando if it's no longer used
  14080. if ( jQuery.isEmptyObject( events ) ) {
  14081. dataPriv.remove( elem, "handle events" );
  14082. }
  14083. },
  14084. dispatch: function( nativeEvent ) {
  14085. // Make a writable jQuery.Event from the native event object
  14086. var event = jQuery.event.fix( nativeEvent );
  14087. var i, j, ret, matched, handleObj, handlerQueue,
  14088. args = new Array( arguments.length ),
  14089. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  14090. special = jQuery.event.special[ event.type ] || {};
  14091. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  14092. args[ 0 ] = event;
  14093. for ( i = 1; i < arguments.length; i++ ) {
  14094. args[ i ] = arguments[ i ];
  14095. }
  14096. event.delegateTarget = this;
  14097. // Call the preDispatch hook for the mapped type, and let it bail if desired
  14098. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  14099. return;
  14100. }
  14101. // Determine handlers
  14102. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  14103. // Run delegates first; they may want to stop propagation beneath us
  14104. i = 0;
  14105. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  14106. event.currentTarget = matched.elem;
  14107. j = 0;
  14108. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  14109. !event.isImmediatePropagationStopped() ) {
  14110. // If the event is namespaced, then each handler is only invoked if it is
  14111. // specially universal or its namespaces are a superset of the event's.
  14112. if ( !event.rnamespace || handleObj.namespace === false ||
  14113. event.rnamespace.test( handleObj.namespace ) ) {
  14114. event.handleObj = handleObj;
  14115. event.data = handleObj.data;
  14116. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  14117. handleObj.handler ).apply( matched.elem, args );
  14118. if ( ret !== undefined ) {
  14119. if ( ( event.result = ret ) === false ) {
  14120. event.preventDefault();
  14121. event.stopPropagation();
  14122. }
  14123. }
  14124. }
  14125. }
  14126. }
  14127. // Call the postDispatch hook for the mapped type
  14128. if ( special.postDispatch ) {
  14129. special.postDispatch.call( this, event );
  14130. }
  14131. return event.result;
  14132. },
  14133. handlers: function( event, handlers ) {
  14134. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  14135. handlerQueue = [],
  14136. delegateCount = handlers.delegateCount,
  14137. cur = event.target;
  14138. // Find delegate handlers
  14139. if ( delegateCount &&
  14140. // Support: IE <=9
  14141. // Black-hole SVG <use> instance trees (trac-13180)
  14142. cur.nodeType &&
  14143. // Support: Firefox <=42
  14144. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  14145. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  14146. // Support: IE 11 only
  14147. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  14148. !( event.type === "click" && event.button >= 1 ) ) {
  14149. for ( ; cur !== this; cur = cur.parentNode || this ) {
  14150. // Don't check non-elements (#13208)
  14151. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  14152. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  14153. matchedHandlers = [];
  14154. matchedSelectors = {};
  14155. for ( i = 0; i < delegateCount; i++ ) {
  14156. handleObj = handlers[ i ];
  14157. // Don't conflict with Object.prototype properties (#13203)
  14158. sel = handleObj.selector + " ";
  14159. if ( matchedSelectors[ sel ] === undefined ) {
  14160. matchedSelectors[ sel ] = handleObj.needsContext ?
  14161. jQuery( sel, this ).index( cur ) > -1 :
  14162. jQuery.find( sel, this, null, [ cur ] ).length;
  14163. }
  14164. if ( matchedSelectors[ sel ] ) {
  14165. matchedHandlers.push( handleObj );
  14166. }
  14167. }
  14168. if ( matchedHandlers.length ) {
  14169. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  14170. }
  14171. }
  14172. }
  14173. }
  14174. // Add the remaining (directly-bound) handlers
  14175. cur = this;
  14176. if ( delegateCount < handlers.length ) {
  14177. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  14178. }
  14179. return handlerQueue;
  14180. },
  14181. addProp: function( name, hook ) {
  14182. Object.defineProperty( jQuery.Event.prototype, name, {
  14183. enumerable: true,
  14184. configurable: true,
  14185. get: isFunction( hook ) ?
  14186. function() {
  14187. if ( this.originalEvent ) {
  14188. return hook( this.originalEvent );
  14189. }
  14190. } :
  14191. function() {
  14192. if ( this.originalEvent ) {
  14193. return this.originalEvent[ name ];
  14194. }
  14195. },
  14196. set: function( value ) {
  14197. Object.defineProperty( this, name, {
  14198. enumerable: true,
  14199. configurable: true,
  14200. writable: true,
  14201. value: value
  14202. } );
  14203. }
  14204. } );
  14205. },
  14206. fix: function( originalEvent ) {
  14207. return originalEvent[ jQuery.expando ] ?
  14208. originalEvent :
  14209. new jQuery.Event( originalEvent );
  14210. },
  14211. special: {
  14212. load: {
  14213. // Prevent triggered image.load events from bubbling to window.load
  14214. noBubble: true
  14215. },
  14216. click: {
  14217. // Utilize native event to ensure correct state for checkable inputs
  14218. setup: function( data ) {
  14219. // For mutual compressibility with _default, replace `this` access with a local var.
  14220. // `|| data` is dead code meant only to preserve the variable through minification.
  14221. var el = this || data;
  14222. // Claim the first handler
  14223. if ( rcheckableType.test( el.type ) &&
  14224. el.click && nodeName( el, "input" ) ) {
  14225. // dataPriv.set( el, "click", ... )
  14226. leverageNative( el, "click", returnTrue );
  14227. }
  14228. // Return false to allow normal processing in the caller
  14229. return false;
  14230. },
  14231. trigger: function( data ) {
  14232. // For mutual compressibility with _default, replace `this` access with a local var.
  14233. // `|| data` is dead code meant only to preserve the variable through minification.
  14234. var el = this || data;
  14235. // Force setup before triggering a click
  14236. if ( rcheckableType.test( el.type ) &&
  14237. el.click && nodeName( el, "input" ) ) {
  14238. leverageNative( el, "click" );
  14239. }
  14240. // Return non-false to allow normal event-path propagation
  14241. return true;
  14242. },
  14243. // For cross-browser consistency, suppress native .click() on links
  14244. // Also prevent it if we're currently inside a leveraged native-event stack
  14245. _default: function( event ) {
  14246. var target = event.target;
  14247. return rcheckableType.test( target.type ) &&
  14248. target.click && nodeName( target, "input" ) &&
  14249. dataPriv.get( target, "click" ) ||
  14250. nodeName( target, "a" );
  14251. }
  14252. },
  14253. beforeunload: {
  14254. postDispatch: function( event ) {
  14255. // Support: Firefox 20+
  14256. // Firefox doesn't alert if the returnValue field is not set.
  14257. if ( event.result !== undefined && event.originalEvent ) {
  14258. event.originalEvent.returnValue = event.result;
  14259. }
  14260. }
  14261. }
  14262. }
  14263. };
  14264. // Ensure the presence of an event listener that handles manually-triggered
  14265. // synthetic events by interrupting progress until reinvoked in response to
  14266. // *native* events that it fires directly, ensuring that state changes have
  14267. // already occurred before other listeners are invoked.
  14268. function leverageNative( el, type, expectSync ) {
  14269. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  14270. if ( !expectSync ) {
  14271. if ( dataPriv.get( el, type ) === undefined ) {
  14272. jQuery.event.add( el, type, returnTrue );
  14273. }
  14274. return;
  14275. }
  14276. // Register the controller as a special universal handler for all event namespaces
  14277. dataPriv.set( el, type, false );
  14278. jQuery.event.add( el, type, {
  14279. namespace: false,
  14280. handler: function( event ) {
  14281. var notAsync, result,
  14282. saved = dataPriv.get( this, type );
  14283. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  14284. // Interrupt processing of the outer synthetic .trigger()ed event
  14285. // Saved data should be false in such cases, but might be a leftover capture object
  14286. // from an async native handler (gh-4350)
  14287. if ( !saved.length ) {
  14288. // Store arguments for use when handling the inner native event
  14289. // There will always be at least one argument (an event object), so this array
  14290. // will not be confused with a leftover capture object.
  14291. saved = slice.call( arguments );
  14292. dataPriv.set( this, type, saved );
  14293. // Trigger the native event and capture its result
  14294. // Support: IE <=9 - 11+
  14295. // focus() and blur() are asynchronous
  14296. notAsync = expectSync( this, type );
  14297. this[ type ]();
  14298. result = dataPriv.get( this, type );
  14299. if ( saved !== result || notAsync ) {
  14300. dataPriv.set( this, type, false );
  14301. } else {
  14302. result = {};
  14303. }
  14304. if ( saved !== result ) {
  14305. // Cancel the outer synthetic event
  14306. event.stopImmediatePropagation();
  14307. event.preventDefault();
  14308. return result.value;
  14309. }
  14310. // If this is an inner synthetic event for an event with a bubbling surrogate
  14311. // (focus or blur), assume that the surrogate already propagated from triggering the
  14312. // native event and prevent that from happening again here.
  14313. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  14314. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  14315. // less bad than duplication.
  14316. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  14317. event.stopPropagation();
  14318. }
  14319. // If this is a native event triggered above, everything is now in order
  14320. // Fire an inner synthetic event with the original arguments
  14321. } else if ( saved.length ) {
  14322. // ...and capture the result
  14323. dataPriv.set( this, type, {
  14324. value: jQuery.event.trigger(
  14325. // Support: IE <=9 - 11+
  14326. // Extend with the prototype to reset the above stopImmediatePropagation()
  14327. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  14328. saved.slice( 1 ),
  14329. this
  14330. )
  14331. } );
  14332. // Abort handling of the native event
  14333. event.stopImmediatePropagation();
  14334. }
  14335. }
  14336. } );
  14337. }
  14338. jQuery.removeEvent = function( elem, type, handle ) {
  14339. // This "if" is needed for plain objects
  14340. if ( elem.removeEventListener ) {
  14341. elem.removeEventListener( type, handle );
  14342. }
  14343. };
  14344. jQuery.Event = function( src, props ) {
  14345. // Allow instantiation without the 'new' keyword
  14346. if ( !( this instanceof jQuery.Event ) ) {
  14347. return new jQuery.Event( src, props );
  14348. }
  14349. // Event object
  14350. if ( src && src.type ) {
  14351. this.originalEvent = src;
  14352. this.type = src.type;
  14353. // Events bubbling up the document may have been marked as prevented
  14354. // by a handler lower down the tree; reflect the correct value.
  14355. this.isDefaultPrevented = src.defaultPrevented ||
  14356. src.defaultPrevented === undefined &&
  14357. // Support: Android <=2.3 only
  14358. src.returnValue === false ?
  14359. returnTrue :
  14360. returnFalse;
  14361. // Create target properties
  14362. // Support: Safari <=6 - 7 only
  14363. // Target should not be a text node (#504, #13143)
  14364. this.target = ( src.target && src.target.nodeType === 3 ) ?
  14365. src.target.parentNode :
  14366. src.target;
  14367. this.currentTarget = src.currentTarget;
  14368. this.relatedTarget = src.relatedTarget;
  14369. // Event type
  14370. } else {
  14371. this.type = src;
  14372. }
  14373. // Put explicitly provided properties onto the event object
  14374. if ( props ) {
  14375. jQuery.extend( this, props );
  14376. }
  14377. // Create a timestamp if incoming event doesn't have one
  14378. this.timeStamp = src && src.timeStamp || Date.now();
  14379. // Mark it as fixed
  14380. this[ jQuery.expando ] = true;
  14381. };
  14382. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  14383. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  14384. jQuery.Event.prototype = {
  14385. constructor: jQuery.Event,
  14386. isDefaultPrevented: returnFalse,
  14387. isPropagationStopped: returnFalse,
  14388. isImmediatePropagationStopped: returnFalse,
  14389. isSimulated: false,
  14390. preventDefault: function() {
  14391. var e = this.originalEvent;
  14392. this.isDefaultPrevented = returnTrue;
  14393. if ( e && !this.isSimulated ) {
  14394. e.preventDefault();
  14395. }
  14396. },
  14397. stopPropagation: function() {
  14398. var e = this.originalEvent;
  14399. this.isPropagationStopped = returnTrue;
  14400. if ( e && !this.isSimulated ) {
  14401. e.stopPropagation();
  14402. }
  14403. },
  14404. stopImmediatePropagation: function() {
  14405. var e = this.originalEvent;
  14406. this.isImmediatePropagationStopped = returnTrue;
  14407. if ( e && !this.isSimulated ) {
  14408. e.stopImmediatePropagation();
  14409. }
  14410. this.stopPropagation();
  14411. }
  14412. };
  14413. // Includes all common event props including KeyEvent and MouseEvent specific props
  14414. jQuery.each( {
  14415. altKey: true,
  14416. bubbles: true,
  14417. cancelable: true,
  14418. changedTouches: true,
  14419. ctrlKey: true,
  14420. detail: true,
  14421. eventPhase: true,
  14422. metaKey: true,
  14423. pageX: true,
  14424. pageY: true,
  14425. shiftKey: true,
  14426. view: true,
  14427. "char": true,
  14428. code: true,
  14429. charCode: true,
  14430. key: true,
  14431. keyCode: true,
  14432. button: true,
  14433. buttons: true,
  14434. clientX: true,
  14435. clientY: true,
  14436. offsetX: true,
  14437. offsetY: true,
  14438. pointerId: true,
  14439. pointerType: true,
  14440. screenX: true,
  14441. screenY: true,
  14442. targetTouches: true,
  14443. toElement: true,
  14444. touches: true,
  14445. which: function( event ) {
  14446. var button = event.button;
  14447. // Add which for key events
  14448. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  14449. return event.charCode != null ? event.charCode : event.keyCode;
  14450. }
  14451. // Add which for click: 1 === left; 2 === middle; 3 === right
  14452. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  14453. if ( button & 1 ) {
  14454. return 1;
  14455. }
  14456. if ( button & 2 ) {
  14457. return 3;
  14458. }
  14459. if ( button & 4 ) {
  14460. return 2;
  14461. }
  14462. return 0;
  14463. }
  14464. return event.which;
  14465. }
  14466. }, jQuery.event.addProp );
  14467. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  14468. jQuery.event.special[ type ] = {
  14469. // Utilize native event if possible so blur/focus sequence is correct
  14470. setup: function() {
  14471. // Claim the first handler
  14472. // dataPriv.set( this, "focus", ... )
  14473. // dataPriv.set( this, "blur", ... )
  14474. leverageNative( this, type, expectSync );
  14475. // Return false to allow normal processing in the caller
  14476. return false;
  14477. },
  14478. trigger: function() {
  14479. // Force setup before trigger
  14480. leverageNative( this, type );
  14481. // Return non-false to allow normal event-path propagation
  14482. return true;
  14483. },
  14484. delegateType: delegateType
  14485. };
  14486. } );
  14487. // Create mouseenter/leave events using mouseover/out and event-time checks
  14488. // so that event delegation works in jQuery.
  14489. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  14490. //
  14491. // Support: Safari 7 only
  14492. // Safari sends mouseenter too often; see:
  14493. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  14494. // for the description of the bug (it existed in older Chrome versions as well).
  14495. jQuery.each( {
  14496. mouseenter: "mouseover",
  14497. mouseleave: "mouseout",
  14498. pointerenter: "pointerover",
  14499. pointerleave: "pointerout"
  14500. }, function( orig, fix ) {
  14501. jQuery.event.special[ orig ] = {
  14502. delegateType: fix,
  14503. bindType: fix,
  14504. handle: function( event ) {
  14505. var ret,
  14506. target = this,
  14507. related = event.relatedTarget,
  14508. handleObj = event.handleObj;
  14509. // For mouseenter/leave call the handler if related is outside the target.
  14510. // NB: No relatedTarget if the mouse left/entered the browser window
  14511. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  14512. event.type = handleObj.origType;
  14513. ret = handleObj.handler.apply( this, arguments );
  14514. event.type = fix;
  14515. }
  14516. return ret;
  14517. }
  14518. };
  14519. } );
  14520. jQuery.fn.extend( {
  14521. on: function( types, selector, data, fn ) {
  14522. return on( this, types, selector, data, fn );
  14523. },
  14524. one: function( types, selector, data, fn ) {
  14525. return on( this, types, selector, data, fn, 1 );
  14526. },
  14527. off: function( types, selector, fn ) {
  14528. var handleObj, type;
  14529. if ( types && types.preventDefault && types.handleObj ) {
  14530. // ( event ) dispatched jQuery.Event
  14531. handleObj = types.handleObj;
  14532. jQuery( types.delegateTarget ).off(
  14533. handleObj.namespace ?
  14534. handleObj.origType + "." + handleObj.namespace :
  14535. handleObj.origType,
  14536. handleObj.selector,
  14537. handleObj.handler
  14538. );
  14539. return this;
  14540. }
  14541. if ( typeof types === "object" ) {
  14542. // ( types-object [, selector] )
  14543. for ( type in types ) {
  14544. this.off( type, selector, types[ type ] );
  14545. }
  14546. return this;
  14547. }
  14548. if ( selector === false || typeof selector === "function" ) {
  14549. // ( types [, fn] )
  14550. fn = selector;
  14551. selector = undefined;
  14552. }
  14553. if ( fn === false ) {
  14554. fn = returnFalse;
  14555. }
  14556. return this.each( function() {
  14557. jQuery.event.remove( this, types, fn, selector );
  14558. } );
  14559. }
  14560. } );
  14561. var
  14562. /* eslint-disable max-len */
  14563. // See https://github.com/eslint/eslint/issues/3229
  14564. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  14565. /* eslint-enable */
  14566. // Support: IE <=10 - 11, Edge 12 - 13 only
  14567. // In IE/Edge using regex groups here causes severe slowdowns.
  14568. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  14569. rnoInnerhtml = /<script|<style|<link/i,
  14570. // checked="checked" or checked
  14571. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  14572. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  14573. // Prefer a tbody over its parent table for containing new rows
  14574. function manipulationTarget( elem, content ) {
  14575. if ( nodeName( elem, "table" ) &&
  14576. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  14577. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  14578. }
  14579. return elem;
  14580. }
  14581. // Replace/restore the type attribute of script elements for safe DOM manipulation
  14582. function disableScript( elem ) {
  14583. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  14584. return elem;
  14585. }
  14586. function restoreScript( elem ) {
  14587. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  14588. elem.type = elem.type.slice( 5 );
  14589. } else {
  14590. elem.removeAttribute( "type" );
  14591. }
  14592. return elem;
  14593. }
  14594. function cloneCopyEvent( src, dest ) {
  14595. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  14596. if ( dest.nodeType !== 1 ) {
  14597. return;
  14598. }
  14599. // 1. Copy private data: events, handlers, etc.
  14600. if ( dataPriv.hasData( src ) ) {
  14601. pdataOld = dataPriv.access( src );
  14602. pdataCur = dataPriv.set( dest, pdataOld );
  14603. events = pdataOld.events;
  14604. if ( events ) {
  14605. delete pdataCur.handle;
  14606. pdataCur.events = {};
  14607. for ( type in events ) {
  14608. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  14609. jQuery.event.add( dest, type, events[ type ][ i ] );
  14610. }
  14611. }
  14612. }
  14613. }
  14614. // 2. Copy user data
  14615. if ( dataUser.hasData( src ) ) {
  14616. udataOld = dataUser.access( src );
  14617. udataCur = jQuery.extend( {}, udataOld );
  14618. dataUser.set( dest, udataCur );
  14619. }
  14620. }
  14621. // Fix IE bugs, see support tests
  14622. function fixInput( src, dest ) {
  14623. var nodeName = dest.nodeName.toLowerCase();
  14624. // Fails to persist the checked state of a cloned checkbox or radio button.
  14625. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  14626. dest.checked = src.checked;
  14627. // Fails to return the selected option to the default selected state when cloning options
  14628. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  14629. dest.defaultValue = src.defaultValue;
  14630. }
  14631. }
  14632. function domManip( collection, args, callback, ignored ) {
  14633. // Flatten any nested arrays
  14634. args = concat.apply( [], args );
  14635. var fragment, first, scripts, hasScripts, node, doc,
  14636. i = 0,
  14637. l = collection.length,
  14638. iNoClone = l - 1,
  14639. value = args[ 0 ],
  14640. valueIsFunction = isFunction( value );
  14641. // We can't cloneNode fragments that contain checked, in WebKit
  14642. if ( valueIsFunction ||
  14643. ( l > 1 && typeof value === "string" &&
  14644. !support.checkClone && rchecked.test( value ) ) ) {
  14645. return collection.each( function( index ) {
  14646. var self = collection.eq( index );
  14647. if ( valueIsFunction ) {
  14648. args[ 0 ] = value.call( this, index, self.html() );
  14649. }
  14650. domManip( self, args, callback, ignored );
  14651. } );
  14652. }
  14653. if ( l ) {
  14654. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  14655. first = fragment.firstChild;
  14656. if ( fragment.childNodes.length === 1 ) {
  14657. fragment = first;
  14658. }
  14659. // Require either new content or an interest in ignored elements to invoke the callback
  14660. if ( first || ignored ) {
  14661. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  14662. hasScripts = scripts.length;
  14663. // Use the original fragment for the last item
  14664. // instead of the first because it can end up
  14665. // being emptied incorrectly in certain situations (#8070).
  14666. for ( ; i < l; i++ ) {
  14667. node = fragment;
  14668. if ( i !== iNoClone ) {
  14669. node = jQuery.clone( node, true, true );
  14670. // Keep references to cloned scripts for later restoration
  14671. if ( hasScripts ) {
  14672. // Support: Android <=4.0 only, PhantomJS 1 only
  14673. // push.apply(_, arraylike) throws on ancient WebKit
  14674. jQuery.merge( scripts, getAll( node, "script" ) );
  14675. }
  14676. }
  14677. callback.call( collection[ i ], node, i );
  14678. }
  14679. if ( hasScripts ) {
  14680. doc = scripts[ scripts.length - 1 ].ownerDocument;
  14681. // Reenable scripts
  14682. jQuery.map( scripts, restoreScript );
  14683. // Evaluate executable scripts on first document insertion
  14684. for ( i = 0; i < hasScripts; i++ ) {
  14685. node = scripts[ i ];
  14686. if ( rscriptType.test( node.type || "" ) &&
  14687. !dataPriv.access( node, "globalEval" ) &&
  14688. jQuery.contains( doc, node ) ) {
  14689. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  14690. // Optional AJAX dependency, but won't run scripts if not present
  14691. if ( jQuery._evalUrl && !node.noModule ) {
  14692. jQuery._evalUrl( node.src, {
  14693. nonce: node.nonce || node.getAttribute( "nonce" )
  14694. } );
  14695. }
  14696. } else {
  14697. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  14698. }
  14699. }
  14700. }
  14701. }
  14702. }
  14703. }
  14704. return collection;
  14705. }
  14706. function remove( elem, selector, keepData ) {
  14707. var node,
  14708. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  14709. i = 0;
  14710. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  14711. if ( !keepData && node.nodeType === 1 ) {
  14712. jQuery.cleanData( getAll( node ) );
  14713. }
  14714. if ( node.parentNode ) {
  14715. if ( keepData && isAttached( node ) ) {
  14716. setGlobalEval( getAll( node, "script" ) );
  14717. }
  14718. node.parentNode.removeChild( node );
  14719. }
  14720. }
  14721. return elem;
  14722. }
  14723. jQuery.extend( {
  14724. htmlPrefilter: function( html ) {
  14725. return html.replace( rxhtmlTag, "<$1></$2>" );
  14726. },
  14727. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  14728. var i, l, srcElements, destElements,
  14729. clone = elem.cloneNode( true ),
  14730. inPage = isAttached( elem );
  14731. // Fix IE cloning issues
  14732. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  14733. !jQuery.isXMLDoc( elem ) ) {
  14734. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  14735. destElements = getAll( clone );
  14736. srcElements = getAll( elem );
  14737. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  14738. fixInput( srcElements[ i ], destElements[ i ] );
  14739. }
  14740. }
  14741. // Copy the events from the original to the clone
  14742. if ( dataAndEvents ) {
  14743. if ( deepDataAndEvents ) {
  14744. srcElements = srcElements || getAll( elem );
  14745. destElements = destElements || getAll( clone );
  14746. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  14747. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  14748. }
  14749. } else {
  14750. cloneCopyEvent( elem, clone );
  14751. }
  14752. }
  14753. // Preserve script evaluation history
  14754. destElements = getAll( clone, "script" );
  14755. if ( destElements.length > 0 ) {
  14756. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  14757. }
  14758. // Return the cloned set
  14759. return clone;
  14760. },
  14761. cleanData: function( elems ) {
  14762. var data, elem, type,
  14763. special = jQuery.event.special,
  14764. i = 0;
  14765. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  14766. if ( acceptData( elem ) ) {
  14767. if ( ( data = elem[ dataPriv.expando ] ) ) {
  14768. if ( data.events ) {
  14769. for ( type in data.events ) {
  14770. if ( special[ type ] ) {
  14771. jQuery.event.remove( elem, type );
  14772. // This is a shortcut to avoid jQuery.event.remove's overhead
  14773. } else {
  14774. jQuery.removeEvent( elem, type, data.handle );
  14775. }
  14776. }
  14777. }
  14778. // Support: Chrome <=35 - 45+
  14779. // Assign undefined instead of using delete, see Data#remove
  14780. elem[ dataPriv.expando ] = undefined;
  14781. }
  14782. if ( elem[ dataUser.expando ] ) {
  14783. // Support: Chrome <=35 - 45+
  14784. // Assign undefined instead of using delete, see Data#remove
  14785. elem[ dataUser.expando ] = undefined;
  14786. }
  14787. }
  14788. }
  14789. }
  14790. } );
  14791. jQuery.fn.extend( {
  14792. detach: function( selector ) {
  14793. return remove( this, selector, true );
  14794. },
  14795. remove: function( selector ) {
  14796. return remove( this, selector );
  14797. },
  14798. text: function( value ) {
  14799. return access( this, function( value ) {
  14800. return value === undefined ?
  14801. jQuery.text( this ) :
  14802. this.empty().each( function() {
  14803. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14804. this.textContent = value;
  14805. }
  14806. } );
  14807. }, null, value, arguments.length );
  14808. },
  14809. append: function() {
  14810. return domManip( this, arguments, function( elem ) {
  14811. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14812. var target = manipulationTarget( this, elem );
  14813. target.appendChild( elem );
  14814. }
  14815. } );
  14816. },
  14817. prepend: function() {
  14818. return domManip( this, arguments, function( elem ) {
  14819. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14820. var target = manipulationTarget( this, elem );
  14821. target.insertBefore( elem, target.firstChild );
  14822. }
  14823. } );
  14824. },
  14825. before: function() {
  14826. return domManip( this, arguments, function( elem ) {
  14827. if ( this.parentNode ) {
  14828. this.parentNode.insertBefore( elem, this );
  14829. }
  14830. } );
  14831. },
  14832. after: function() {
  14833. return domManip( this, arguments, function( elem ) {
  14834. if ( this.parentNode ) {
  14835. this.parentNode.insertBefore( elem, this.nextSibling );
  14836. }
  14837. } );
  14838. },
  14839. empty: function() {
  14840. var elem,
  14841. i = 0;
  14842. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  14843. if ( elem.nodeType === 1 ) {
  14844. // Prevent memory leaks
  14845. jQuery.cleanData( getAll( elem, false ) );
  14846. // Remove any remaining nodes
  14847. elem.textContent = "";
  14848. }
  14849. }
  14850. return this;
  14851. },
  14852. clone: function( dataAndEvents, deepDataAndEvents ) {
  14853. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  14854. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  14855. return this.map( function() {
  14856. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  14857. } );
  14858. },
  14859. html: function( value ) {
  14860. return access( this, function( value ) {
  14861. var elem = this[ 0 ] || {},
  14862. i = 0,
  14863. l = this.length;
  14864. if ( value === undefined && elem.nodeType === 1 ) {
  14865. return elem.innerHTML;
  14866. }
  14867. // See if we can take a shortcut and just use innerHTML
  14868. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  14869. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  14870. value = jQuery.htmlPrefilter( value );
  14871. try {
  14872. for ( ; i < l; i++ ) {
  14873. elem = this[ i ] || {};
  14874. // Remove element nodes and prevent memory leaks
  14875. if ( elem.nodeType === 1 ) {
  14876. jQuery.cleanData( getAll( elem, false ) );
  14877. elem.innerHTML = value;
  14878. }
  14879. }
  14880. elem = 0;
  14881. // If using innerHTML throws an exception, use the fallback method
  14882. } catch ( e ) {}
  14883. }
  14884. if ( elem ) {
  14885. this.empty().append( value );
  14886. }
  14887. }, null, value, arguments.length );
  14888. },
  14889. replaceWith: function() {
  14890. var ignored = [];
  14891. // Make the changes, replacing each non-ignored context element with the new content
  14892. return domManip( this, arguments, function( elem ) {
  14893. var parent = this.parentNode;
  14894. if ( jQuery.inArray( this, ignored ) < 0 ) {
  14895. jQuery.cleanData( getAll( this ) );
  14896. if ( parent ) {
  14897. parent.replaceChild( elem, this );
  14898. }
  14899. }
  14900. // Force callback invocation
  14901. }, ignored );
  14902. }
  14903. } );
  14904. jQuery.each( {
  14905. appendTo: "append",
  14906. prependTo: "prepend",
  14907. insertBefore: "before",
  14908. insertAfter: "after",
  14909. replaceAll: "replaceWith"
  14910. }, function( name, original ) {
  14911. jQuery.fn[ name ] = function( selector ) {
  14912. var elems,
  14913. ret = [],
  14914. insert = jQuery( selector ),
  14915. last = insert.length - 1,
  14916. i = 0;
  14917. for ( ; i <= last; i++ ) {
  14918. elems = i === last ? this : this.clone( true );
  14919. jQuery( insert[ i ] )[ original ]( elems );
  14920. // Support: Android <=4.0 only, PhantomJS 1 only
  14921. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  14922. push.apply( ret, elems.get() );
  14923. }
  14924. return this.pushStack( ret );
  14925. };
  14926. } );
  14927. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  14928. var getStyles = function( elem ) {
  14929. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  14930. // IE throws on elements created in popups
  14931. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  14932. var view = elem.ownerDocument.defaultView;
  14933. if ( !view || !view.opener ) {
  14934. view = window;
  14935. }
  14936. return view.getComputedStyle( elem );
  14937. };
  14938. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  14939. ( function() {
  14940. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  14941. // so they're executed at the same time to save the second computation.
  14942. function computeStyleTests() {
  14943. // This is a singleton, we need to execute it only once
  14944. if ( !div ) {
  14945. return;
  14946. }
  14947. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  14948. "margin-top:1px;padding:0;border:0";
  14949. div.style.cssText =
  14950. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  14951. "margin:auto;border:1px;padding:1px;" +
  14952. "width:60%;top:1%";
  14953. documentElement.appendChild( container ).appendChild( div );
  14954. var divStyle = window.getComputedStyle( div );
  14955. pixelPositionVal = divStyle.top !== "1%";
  14956. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  14957. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  14958. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  14959. // Some styles come back with percentage values, even though they shouldn't
  14960. div.style.right = "60%";
  14961. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  14962. // Support: IE 9 - 11 only
  14963. // Detect misreporting of content dimensions for box-sizing:border-box elements
  14964. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  14965. // Support: IE 9 only
  14966. // Detect overflow:scroll screwiness (gh-3699)
  14967. // Support: Chrome <=64
  14968. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  14969. div.style.position = "absolute";
  14970. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  14971. documentElement.removeChild( container );
  14972. // Nullify the div so it wouldn't be stored in the memory and
  14973. // it will also be a sign that checks already performed
  14974. div = null;
  14975. }
  14976. function roundPixelMeasures( measure ) {
  14977. return Math.round( parseFloat( measure ) );
  14978. }
  14979. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  14980. reliableMarginLeftVal,
  14981. container = document.createElement( "div" ),
  14982. div = document.createElement( "div" );
  14983. // Finish early in limited (non-browser) environments
  14984. if ( !div.style ) {
  14985. return;
  14986. }
  14987. // Support: IE <=9 - 11 only
  14988. // Style of cloned element affects source element cloned (#8908)
  14989. div.style.backgroundClip = "content-box";
  14990. div.cloneNode( true ).style.backgroundClip = "";
  14991. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  14992. jQuery.extend( support, {
  14993. boxSizingReliable: function() {
  14994. computeStyleTests();
  14995. return boxSizingReliableVal;
  14996. },
  14997. pixelBoxStyles: function() {
  14998. computeStyleTests();
  14999. return pixelBoxStylesVal;
  15000. },
  15001. pixelPosition: function() {
  15002. computeStyleTests();
  15003. return pixelPositionVal;
  15004. },
  15005. reliableMarginLeft: function() {
  15006. computeStyleTests();
  15007. return reliableMarginLeftVal;
  15008. },
  15009. scrollboxSize: function() {
  15010. computeStyleTests();
  15011. return scrollboxSizeVal;
  15012. }
  15013. } );
  15014. } )();
  15015. function curCSS( elem, name, computed ) {
  15016. var width, minWidth, maxWidth, ret,
  15017. // Support: Firefox 51+
  15018. // Retrieving style before computed somehow
  15019. // fixes an issue with getting wrong values
  15020. // on detached elements
  15021. style = elem.style;
  15022. computed = computed || getStyles( elem );
  15023. // getPropertyValue is needed for:
  15024. // .css('filter') (IE 9 only, #12537)
  15025. // .css('--customProperty) (#3144)
  15026. if ( computed ) {
  15027. ret = computed.getPropertyValue( name ) || computed[ name ];
  15028. if ( ret === "" && !isAttached( elem ) ) {
  15029. ret = jQuery.style( elem, name );
  15030. }
  15031. // A tribute to the "awesome hack by Dean Edwards"
  15032. // Android Browser returns percentage for some values,
  15033. // but width seems to be reliably pixels.
  15034. // This is against the CSSOM draft spec:
  15035. // https://drafts.csswg.org/cssom/#resolved-values
  15036. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  15037. // Remember the original values
  15038. width = style.width;
  15039. minWidth = style.minWidth;
  15040. maxWidth = style.maxWidth;
  15041. // Put in the new values to get a computed value out
  15042. style.minWidth = style.maxWidth = style.width = ret;
  15043. ret = computed.width;
  15044. // Revert the changed values
  15045. style.width = width;
  15046. style.minWidth = minWidth;
  15047. style.maxWidth = maxWidth;
  15048. }
  15049. }
  15050. return ret !== undefined ?
  15051. // Support: IE <=9 - 11 only
  15052. // IE returns zIndex value as an integer.
  15053. ret + "" :
  15054. ret;
  15055. }
  15056. function addGetHookIf( conditionFn, hookFn ) {
  15057. // Define the hook, we'll check on the first run if it's really needed.
  15058. return {
  15059. get: function() {
  15060. if ( conditionFn() ) {
  15061. // Hook not needed (or it's not possible to use it due
  15062. // to missing dependency), remove it.
  15063. delete this.get;
  15064. return;
  15065. }
  15066. // Hook needed; redefine it so that the support test is not executed again.
  15067. return ( this.get = hookFn ).apply( this, arguments );
  15068. }
  15069. };
  15070. }
  15071. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  15072. emptyStyle = document.createElement( "div" ).style,
  15073. vendorProps = {};
  15074. // Return a vendor-prefixed property or undefined
  15075. function vendorPropName( name ) {
  15076. // Check for vendor prefixed names
  15077. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  15078. i = cssPrefixes.length;
  15079. while ( i-- ) {
  15080. name = cssPrefixes[ i ] + capName;
  15081. if ( name in emptyStyle ) {
  15082. return name;
  15083. }
  15084. }
  15085. }
  15086. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  15087. function finalPropName( name ) {
  15088. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  15089. if ( final ) {
  15090. return final;
  15091. }
  15092. if ( name in emptyStyle ) {
  15093. return name;
  15094. }
  15095. return vendorProps[ name ] = vendorPropName( name ) || name;
  15096. }
  15097. var
  15098. // Swappable if display is none or starts with table
  15099. // except "table", "table-cell", or "table-caption"
  15100. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  15101. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  15102. rcustomProp = /^--/,
  15103. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  15104. cssNormalTransform = {
  15105. letterSpacing: "0",
  15106. fontWeight: "400"
  15107. };
  15108. function setPositiveNumber( elem, value, subtract ) {
  15109. // Any relative (+/-) values have already been
  15110. // normalized at this point
  15111. var matches = rcssNum.exec( value );
  15112. return matches ?
  15113. // Guard against undefined "subtract", e.g., when used as in cssHooks
  15114. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  15115. value;
  15116. }
  15117. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  15118. var i = dimension === "width" ? 1 : 0,
  15119. extra = 0,
  15120. delta = 0;
  15121. // Adjustment may not be necessary
  15122. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  15123. return 0;
  15124. }
  15125. for ( ; i < 4; i += 2 ) {
  15126. // Both box models exclude margin
  15127. if ( box === "margin" ) {
  15128. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  15129. }
  15130. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  15131. if ( !isBorderBox ) {
  15132. // Add padding
  15133. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  15134. // For "border" or "margin", add border
  15135. if ( box !== "padding" ) {
  15136. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  15137. // But still keep track of it otherwise
  15138. } else {
  15139. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  15140. }
  15141. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  15142. // "padding" or "margin"
  15143. } else {
  15144. // For "content", subtract padding
  15145. if ( box === "content" ) {
  15146. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  15147. }
  15148. // For "content" or "padding", subtract border
  15149. if ( box !== "margin" ) {
  15150. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  15151. }
  15152. }
  15153. }
  15154. // Account for positive content-box scroll gutter when requested by providing computedVal
  15155. if ( !isBorderBox && computedVal >= 0 ) {
  15156. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  15157. // Assuming integer scroll gutter, subtract the rest and round down
  15158. delta += Math.max( 0, Math.ceil(
  15159. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  15160. computedVal -
  15161. delta -
  15162. extra -
  15163. 0.5
  15164. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  15165. // Use an explicit zero to avoid NaN (gh-3964)
  15166. ) ) || 0;
  15167. }
  15168. return delta;
  15169. }
  15170. function getWidthOrHeight( elem, dimension, extra ) {
  15171. // Start with computed style
  15172. var styles = getStyles( elem ),
  15173. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  15174. // Fake content-box until we know it's needed to know the true value.
  15175. boxSizingNeeded = !support.boxSizingReliable() || extra,
  15176. isBorderBox = boxSizingNeeded &&
  15177. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  15178. valueIsBorderBox = isBorderBox,
  15179. val = curCSS( elem, dimension, styles ),
  15180. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  15181. // Support: Firefox <=54
  15182. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  15183. if ( rnumnonpx.test( val ) ) {
  15184. if ( !extra ) {
  15185. return val;
  15186. }
  15187. val = "auto";
  15188. }
  15189. // Fall back to offsetWidth/offsetHeight when value is "auto"
  15190. // This happens for inline elements with no explicit setting (gh-3571)
  15191. // Support: Android <=4.1 - 4.3 only
  15192. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  15193. // Support: IE 9-11 only
  15194. // Also use offsetWidth/offsetHeight for when box sizing is unreliable
  15195. // We use getClientRects() to check for hidden/disconnected.
  15196. // In those cases, the computed value can be trusted to be border-box
  15197. if ( ( !support.boxSizingReliable() && isBorderBox ||
  15198. val === "auto" ||
  15199. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  15200. elem.getClientRects().length ) {
  15201. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  15202. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  15203. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  15204. // retrieved value as a content box dimension.
  15205. valueIsBorderBox = offsetProp in elem;
  15206. if ( valueIsBorderBox ) {
  15207. val = elem[ offsetProp ];
  15208. }
  15209. }
  15210. // Normalize "" and auto
  15211. val = parseFloat( val ) || 0;
  15212. // Adjust for the element's box model
  15213. return ( val +
  15214. boxModelAdjustment(
  15215. elem,
  15216. dimension,
  15217. extra || ( isBorderBox ? "border" : "content" ),
  15218. valueIsBorderBox,
  15219. styles,
  15220. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  15221. val
  15222. )
  15223. ) + "px";
  15224. }
  15225. jQuery.extend( {
  15226. // Add in style property hooks for overriding the default
  15227. // behavior of getting and setting a style property
  15228. cssHooks: {
  15229. opacity: {
  15230. get: function( elem, computed ) {
  15231. if ( computed ) {
  15232. // We should always get a number back from opacity
  15233. var ret = curCSS( elem, "opacity" );
  15234. return ret === "" ? "1" : ret;
  15235. }
  15236. }
  15237. }
  15238. },
  15239. // Don't automatically add "px" to these possibly-unitless properties
  15240. cssNumber: {
  15241. "animationIterationCount": true,
  15242. "columnCount": true,
  15243. "fillOpacity": true,
  15244. "flexGrow": true,
  15245. "flexShrink": true,
  15246. "fontWeight": true,
  15247. "gridArea": true,
  15248. "gridColumn": true,
  15249. "gridColumnEnd": true,
  15250. "gridColumnStart": true,
  15251. "gridRow": true,
  15252. "gridRowEnd": true,
  15253. "gridRowStart": true,
  15254. "lineHeight": true,
  15255. "opacity": true,
  15256. "order": true,
  15257. "orphans": true,
  15258. "widows": true,
  15259. "zIndex": true,
  15260. "zoom": true
  15261. },
  15262. // Add in properties whose names you wish to fix before
  15263. // setting or getting the value
  15264. cssProps: {},
  15265. // Get and set the style property on a DOM Node
  15266. style: function( elem, name, value, extra ) {
  15267. // Don't set styles on text and comment nodes
  15268. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  15269. return;
  15270. }
  15271. // Make sure that we're working with the right name
  15272. var ret, type, hooks,
  15273. origName = camelCase( name ),
  15274. isCustomProp = rcustomProp.test( name ),
  15275. style = elem.style;
  15276. // Make sure that we're working with the right name. We don't
  15277. // want to query the value if it is a CSS custom property
  15278. // since they are user-defined.
  15279. if ( !isCustomProp ) {
  15280. name = finalPropName( origName );
  15281. }
  15282. // Gets hook for the prefixed version, then unprefixed version
  15283. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  15284. // Check if we're setting a value
  15285. if ( value !== undefined ) {
  15286. type = typeof value;
  15287. // Convert "+=" or "-=" to relative numbers (#7345)
  15288. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  15289. value = adjustCSS( elem, name, ret );
  15290. // Fixes bug #9237
  15291. type = "number";
  15292. }
  15293. // Make sure that null and NaN values aren't set (#7116)
  15294. if ( value == null || value !== value ) {
  15295. return;
  15296. }
  15297. // If a number was passed in, add the unit (except for certain CSS properties)
  15298. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  15299. // "px" to a few hardcoded values.
  15300. if ( type === "number" && !isCustomProp ) {
  15301. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  15302. }
  15303. // background-* props affect original clone's values
  15304. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  15305. style[ name ] = "inherit";
  15306. }
  15307. // If a hook was provided, use that value, otherwise just set the specified value
  15308. if ( !hooks || !( "set" in hooks ) ||
  15309. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  15310. if ( isCustomProp ) {
  15311. style.setProperty( name, value );
  15312. } else {
  15313. style[ name ] = value;
  15314. }
  15315. }
  15316. } else {
  15317. // If a hook was provided get the non-computed value from there
  15318. if ( hooks && "get" in hooks &&
  15319. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  15320. return ret;
  15321. }
  15322. // Otherwise just get the value from the style object
  15323. return style[ name ];
  15324. }
  15325. },
  15326. css: function( elem, name, extra, styles ) {
  15327. var val, num, hooks,
  15328. origName = camelCase( name ),
  15329. isCustomProp = rcustomProp.test( name );
  15330. // Make sure that we're working with the right name. We don't
  15331. // want to modify the value if it is a CSS custom property
  15332. // since they are user-defined.
  15333. if ( !isCustomProp ) {
  15334. name = finalPropName( origName );
  15335. }
  15336. // Try prefixed name followed by the unprefixed name
  15337. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  15338. // If a hook was provided get the computed value from there
  15339. if ( hooks && "get" in hooks ) {
  15340. val = hooks.get( elem, true, extra );
  15341. }
  15342. // Otherwise, if a way to get the computed value exists, use that
  15343. if ( val === undefined ) {
  15344. val = curCSS( elem, name, styles );
  15345. }
  15346. // Convert "normal" to computed value
  15347. if ( val === "normal" && name in cssNormalTransform ) {
  15348. val = cssNormalTransform[ name ];
  15349. }
  15350. // Make numeric if forced or a qualifier was provided and val looks numeric
  15351. if ( extra === "" || extra ) {
  15352. num = parseFloat( val );
  15353. return extra === true || isFinite( num ) ? num || 0 : val;
  15354. }
  15355. return val;
  15356. }
  15357. } );
  15358. jQuery.each( [ "height", "width" ], function( i, dimension ) {
  15359. jQuery.cssHooks[ dimension ] = {
  15360. get: function( elem, computed, extra ) {
  15361. if ( computed ) {
  15362. // Certain elements can have dimension info if we invisibly show them
  15363. // but it must have a current display style that would benefit
  15364. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  15365. // Support: Safari 8+
  15366. // Table columns in Safari have non-zero offsetWidth & zero
  15367. // getBoundingClientRect().width unless display is changed.
  15368. // Support: IE <=11 only
  15369. // Running getBoundingClientRect on a disconnected node
  15370. // in IE throws an error.
  15371. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  15372. swap( elem, cssShow, function() {
  15373. return getWidthOrHeight( elem, dimension, extra );
  15374. } ) :
  15375. getWidthOrHeight( elem, dimension, extra );
  15376. }
  15377. },
  15378. set: function( elem, value, extra ) {
  15379. var matches,
  15380. styles = getStyles( elem ),
  15381. // Only read styles.position if the test has a chance to fail
  15382. // to avoid forcing a reflow.
  15383. scrollboxSizeBuggy = !support.scrollboxSize() &&
  15384. styles.position === "absolute",
  15385. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  15386. boxSizingNeeded = scrollboxSizeBuggy || extra,
  15387. isBorderBox = boxSizingNeeded &&
  15388. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  15389. subtract = extra ?
  15390. boxModelAdjustment(
  15391. elem,
  15392. dimension,
  15393. extra,
  15394. isBorderBox,
  15395. styles
  15396. ) :
  15397. 0;
  15398. // Account for unreliable border-box dimensions by comparing offset* to computed and
  15399. // faking a content-box to get border and padding (gh-3699)
  15400. if ( isBorderBox && scrollboxSizeBuggy ) {
  15401. subtract -= Math.ceil(
  15402. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  15403. parseFloat( styles[ dimension ] ) -
  15404. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  15405. 0.5
  15406. );
  15407. }
  15408. // Convert to pixels if value adjustment is needed
  15409. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  15410. ( matches[ 3 ] || "px" ) !== "px" ) {
  15411. elem.style[ dimension ] = value;
  15412. value = jQuery.css( elem, dimension );
  15413. }
  15414. return setPositiveNumber( elem, value, subtract );
  15415. }
  15416. };
  15417. } );
  15418. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  15419. function( elem, computed ) {
  15420. if ( computed ) {
  15421. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  15422. elem.getBoundingClientRect().left -
  15423. swap( elem, { marginLeft: 0 }, function() {
  15424. return elem.getBoundingClientRect().left;
  15425. } )
  15426. ) + "px";
  15427. }
  15428. }
  15429. );
  15430. // These hooks are used by animate to expand properties
  15431. jQuery.each( {
  15432. margin: "",
  15433. padding: "",
  15434. border: "Width"
  15435. }, function( prefix, suffix ) {
  15436. jQuery.cssHooks[ prefix + suffix ] = {
  15437. expand: function( value ) {
  15438. var i = 0,
  15439. expanded = {},
  15440. // Assumes a single number if not a string
  15441. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  15442. for ( ; i < 4; i++ ) {
  15443. expanded[ prefix + cssExpand[ i ] + suffix ] =
  15444. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  15445. }
  15446. return expanded;
  15447. }
  15448. };
  15449. if ( prefix !== "margin" ) {
  15450. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  15451. }
  15452. } );
  15453. jQuery.fn.extend( {
  15454. css: function( name, value ) {
  15455. return access( this, function( elem, name, value ) {
  15456. var styles, len,
  15457. map = {},
  15458. i = 0;
  15459. if ( Array.isArray( name ) ) {
  15460. styles = getStyles( elem );
  15461. len = name.length;
  15462. for ( ; i < len; i++ ) {
  15463. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  15464. }
  15465. return map;
  15466. }
  15467. return value !== undefined ?
  15468. jQuery.style( elem, name, value ) :
  15469. jQuery.css( elem, name );
  15470. }, name, value, arguments.length > 1 );
  15471. }
  15472. } );
  15473. function Tween( elem, options, prop, end, easing ) {
  15474. return new Tween.prototype.init( elem, options, prop, end, easing );
  15475. }
  15476. jQuery.Tween = Tween;
  15477. Tween.prototype = {
  15478. constructor: Tween,
  15479. init: function( elem, options, prop, end, easing, unit ) {
  15480. this.elem = elem;
  15481. this.prop = prop;
  15482. this.easing = easing || jQuery.easing._default;
  15483. this.options = options;
  15484. this.start = this.now = this.cur();
  15485. this.end = end;
  15486. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  15487. },
  15488. cur: function() {
  15489. var hooks = Tween.propHooks[ this.prop ];
  15490. return hooks && hooks.get ?
  15491. hooks.get( this ) :
  15492. Tween.propHooks._default.get( this );
  15493. },
  15494. run: function( percent ) {
  15495. var eased,
  15496. hooks = Tween.propHooks[ this.prop ];
  15497. if ( this.options.duration ) {
  15498. this.pos = eased = jQuery.easing[ this.easing ](
  15499. percent, this.options.duration * percent, 0, 1, this.options.duration
  15500. );
  15501. } else {
  15502. this.pos = eased = percent;
  15503. }
  15504. this.now = ( this.end - this.start ) * eased + this.start;
  15505. if ( this.options.step ) {
  15506. this.options.step.call( this.elem, this.now, this );
  15507. }
  15508. if ( hooks && hooks.set ) {
  15509. hooks.set( this );
  15510. } else {
  15511. Tween.propHooks._default.set( this );
  15512. }
  15513. return this;
  15514. }
  15515. };
  15516. Tween.prototype.init.prototype = Tween.prototype;
  15517. Tween.propHooks = {
  15518. _default: {
  15519. get: function( tween ) {
  15520. var result;
  15521. // Use a property on the element directly when it is not a DOM element,
  15522. // or when there is no matching style property that exists.
  15523. if ( tween.elem.nodeType !== 1 ||
  15524. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  15525. return tween.elem[ tween.prop ];
  15526. }
  15527. // Passing an empty string as a 3rd parameter to .css will automatically
  15528. // attempt a parseFloat and fallback to a string if the parse fails.
  15529. // Simple values such as "10px" are parsed to Float;
  15530. // complex values such as "rotate(1rad)" are returned as-is.
  15531. result = jQuery.css( tween.elem, tween.prop, "" );
  15532. // Empty strings, null, undefined and "auto" are converted to 0.
  15533. return !result || result === "auto" ? 0 : result;
  15534. },
  15535. set: function( tween ) {
  15536. // Use step hook for back compat.
  15537. // Use cssHook if its there.
  15538. // Use .style if available and use plain properties where available.
  15539. if ( jQuery.fx.step[ tween.prop ] ) {
  15540. jQuery.fx.step[ tween.prop ]( tween );
  15541. } else if ( tween.elem.nodeType === 1 && (
  15542. jQuery.cssHooks[ tween.prop ] ||
  15543. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  15544. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  15545. } else {
  15546. tween.elem[ tween.prop ] = tween.now;
  15547. }
  15548. }
  15549. }
  15550. };
  15551. // Support: IE <=9 only
  15552. // Panic based approach to setting things on disconnected nodes
  15553. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  15554. set: function( tween ) {
  15555. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  15556. tween.elem[ tween.prop ] = tween.now;
  15557. }
  15558. }
  15559. };
  15560. jQuery.easing = {
  15561. linear: function( p ) {
  15562. return p;
  15563. },
  15564. swing: function( p ) {
  15565. return 0.5 - Math.cos( p * Math.PI ) / 2;
  15566. },
  15567. _default: "swing"
  15568. };
  15569. jQuery.fx = Tween.prototype.init;
  15570. // Back compat <1.8 extension point
  15571. jQuery.fx.step = {};
  15572. var
  15573. fxNow, inProgress,
  15574. rfxtypes = /^(?:toggle|show|hide)$/,
  15575. rrun = /queueHooks$/;
  15576. function schedule() {
  15577. if ( inProgress ) {
  15578. if ( document.hidden === false && window.requestAnimationFrame ) {
  15579. window.requestAnimationFrame( schedule );
  15580. } else {
  15581. window.setTimeout( schedule, jQuery.fx.interval );
  15582. }
  15583. jQuery.fx.tick();
  15584. }
  15585. }
  15586. // Animations created synchronously will run synchronously
  15587. function createFxNow() {
  15588. window.setTimeout( function() {
  15589. fxNow = undefined;
  15590. } );
  15591. return ( fxNow = Date.now() );
  15592. }
  15593. // Generate parameters to create a standard animation
  15594. function genFx( type, includeWidth ) {
  15595. var which,
  15596. i = 0,
  15597. attrs = { height: type };
  15598. // If we include width, step value is 1 to do all cssExpand values,
  15599. // otherwise step value is 2 to skip over Left and Right
  15600. includeWidth = includeWidth ? 1 : 0;
  15601. for ( ; i < 4; i += 2 - includeWidth ) {
  15602. which = cssExpand[ i ];
  15603. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  15604. }
  15605. if ( includeWidth ) {
  15606. attrs.opacity = attrs.width = type;
  15607. }
  15608. return attrs;
  15609. }
  15610. function createTween( value, prop, animation ) {
  15611. var tween,
  15612. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  15613. index = 0,
  15614. length = collection.length;
  15615. for ( ; index < length; index++ ) {
  15616. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  15617. // We're done with this property
  15618. return tween;
  15619. }
  15620. }
  15621. }
  15622. function defaultPrefilter( elem, props, opts ) {
  15623. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  15624. isBox = "width" in props || "height" in props,
  15625. anim = this,
  15626. orig = {},
  15627. style = elem.style,
  15628. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  15629. dataShow = dataPriv.get( elem, "fxshow" );
  15630. // Queue-skipping animations hijack the fx hooks
  15631. if ( !opts.queue ) {
  15632. hooks = jQuery._queueHooks( elem, "fx" );
  15633. if ( hooks.unqueued == null ) {
  15634. hooks.unqueued = 0;
  15635. oldfire = hooks.empty.fire;
  15636. hooks.empty.fire = function() {
  15637. if ( !hooks.unqueued ) {
  15638. oldfire();
  15639. }
  15640. };
  15641. }
  15642. hooks.unqueued++;
  15643. anim.always( function() {
  15644. // Ensure the complete handler is called before this completes
  15645. anim.always( function() {
  15646. hooks.unqueued--;
  15647. if ( !jQuery.queue( elem, "fx" ).length ) {
  15648. hooks.empty.fire();
  15649. }
  15650. } );
  15651. } );
  15652. }
  15653. // Detect show/hide animations
  15654. for ( prop in props ) {
  15655. value = props[ prop ];
  15656. if ( rfxtypes.test( value ) ) {
  15657. delete props[ prop ];
  15658. toggle = toggle || value === "toggle";
  15659. if ( value === ( hidden ? "hide" : "show" ) ) {
  15660. // Pretend to be hidden if this is a "show" and
  15661. // there is still data from a stopped show/hide
  15662. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  15663. hidden = true;
  15664. // Ignore all other no-op show/hide data
  15665. } else {
  15666. continue;
  15667. }
  15668. }
  15669. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  15670. }
  15671. }
  15672. // Bail out if this is a no-op like .hide().hide()
  15673. propTween = !jQuery.isEmptyObject( props );
  15674. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  15675. return;
  15676. }
  15677. // Restrict "overflow" and "display" styles during box animations
  15678. if ( isBox && elem.nodeType === 1 ) {
  15679. // Support: IE <=9 - 11, Edge 12 - 15
  15680. // Record all 3 overflow attributes because IE does not infer the shorthand
  15681. // from identically-valued overflowX and overflowY and Edge just mirrors
  15682. // the overflowX value there.
  15683. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  15684. // Identify a display type, preferring old show/hide data over the CSS cascade
  15685. restoreDisplay = dataShow && dataShow.display;
  15686. if ( restoreDisplay == null ) {
  15687. restoreDisplay = dataPriv.get( elem, "display" );
  15688. }
  15689. display = jQuery.css( elem, "display" );
  15690. if ( display === "none" ) {
  15691. if ( restoreDisplay ) {
  15692. display = restoreDisplay;
  15693. } else {
  15694. // Get nonempty value(s) by temporarily forcing visibility
  15695. showHide( [ elem ], true );
  15696. restoreDisplay = elem.style.display || restoreDisplay;
  15697. display = jQuery.css( elem, "display" );
  15698. showHide( [ elem ] );
  15699. }
  15700. }
  15701. // Animate inline elements as inline-block
  15702. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  15703. if ( jQuery.css( elem, "float" ) === "none" ) {
  15704. // Restore the original display value at the end of pure show/hide animations
  15705. if ( !propTween ) {
  15706. anim.done( function() {
  15707. style.display = restoreDisplay;
  15708. } );
  15709. if ( restoreDisplay == null ) {
  15710. display = style.display;
  15711. restoreDisplay = display === "none" ? "" : display;
  15712. }
  15713. }
  15714. style.display = "inline-block";
  15715. }
  15716. }
  15717. }
  15718. if ( opts.overflow ) {
  15719. style.overflow = "hidden";
  15720. anim.always( function() {
  15721. style.overflow = opts.overflow[ 0 ];
  15722. style.overflowX = opts.overflow[ 1 ];
  15723. style.overflowY = opts.overflow[ 2 ];
  15724. } );
  15725. }
  15726. // Implement show/hide animations
  15727. propTween = false;
  15728. for ( prop in orig ) {
  15729. // General show/hide setup for this element animation
  15730. if ( !propTween ) {
  15731. if ( dataShow ) {
  15732. if ( "hidden" in dataShow ) {
  15733. hidden = dataShow.hidden;
  15734. }
  15735. } else {
  15736. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  15737. }
  15738. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  15739. if ( toggle ) {
  15740. dataShow.hidden = !hidden;
  15741. }
  15742. // Show elements before animating them
  15743. if ( hidden ) {
  15744. showHide( [ elem ], true );
  15745. }
  15746. /* eslint-disable no-loop-func */
  15747. anim.done( function() {
  15748. /* eslint-enable no-loop-func */
  15749. // The final step of a "hide" animation is actually hiding the element
  15750. if ( !hidden ) {
  15751. showHide( [ elem ] );
  15752. }
  15753. dataPriv.remove( elem, "fxshow" );
  15754. for ( prop in orig ) {
  15755. jQuery.style( elem, prop, orig[ prop ] );
  15756. }
  15757. } );
  15758. }
  15759. // Per-property setup
  15760. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  15761. if ( !( prop in dataShow ) ) {
  15762. dataShow[ prop ] = propTween.start;
  15763. if ( hidden ) {
  15764. propTween.end = propTween.start;
  15765. propTween.start = 0;
  15766. }
  15767. }
  15768. }
  15769. }
  15770. function propFilter( props, specialEasing ) {
  15771. var index, name, easing, value, hooks;
  15772. // camelCase, specialEasing and expand cssHook pass
  15773. for ( index in props ) {
  15774. name = camelCase( index );
  15775. easing = specialEasing[ name ];
  15776. value = props[ index ];
  15777. if ( Array.isArray( value ) ) {
  15778. easing = value[ 1 ];
  15779. value = props[ index ] = value[ 0 ];
  15780. }
  15781. if ( index !== name ) {
  15782. props[ name ] = value;
  15783. delete props[ index ];
  15784. }
  15785. hooks = jQuery.cssHooks[ name ];
  15786. if ( hooks && "expand" in hooks ) {
  15787. value = hooks.expand( value );
  15788. delete props[ name ];
  15789. // Not quite $.extend, this won't overwrite existing keys.
  15790. // Reusing 'index' because we have the correct "name"
  15791. for ( index in value ) {
  15792. if ( !( index in props ) ) {
  15793. props[ index ] = value[ index ];
  15794. specialEasing[ index ] = easing;
  15795. }
  15796. }
  15797. } else {
  15798. specialEasing[ name ] = easing;
  15799. }
  15800. }
  15801. }
  15802. function Animation( elem, properties, options ) {
  15803. var result,
  15804. stopped,
  15805. index = 0,
  15806. length = Animation.prefilters.length,
  15807. deferred = jQuery.Deferred().always( function() {
  15808. // Don't match elem in the :animated selector
  15809. delete tick.elem;
  15810. } ),
  15811. tick = function() {
  15812. if ( stopped ) {
  15813. return false;
  15814. }
  15815. var currentTime = fxNow || createFxNow(),
  15816. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  15817. // Support: Android 2.3 only
  15818. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  15819. temp = remaining / animation.duration || 0,
  15820. percent = 1 - temp,
  15821. index = 0,
  15822. length = animation.tweens.length;
  15823. for ( ; index < length; index++ ) {
  15824. animation.tweens[ index ].run( percent );
  15825. }
  15826. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  15827. // If there's more to do, yield
  15828. if ( percent < 1 && length ) {
  15829. return remaining;
  15830. }
  15831. // If this was an empty animation, synthesize a final progress notification
  15832. if ( !length ) {
  15833. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  15834. }
  15835. // Resolve the animation and report its conclusion
  15836. deferred.resolveWith( elem, [ animation ] );
  15837. return false;
  15838. },
  15839. animation = deferred.promise( {
  15840. elem: elem,
  15841. props: jQuery.extend( {}, properties ),
  15842. opts: jQuery.extend( true, {
  15843. specialEasing: {},
  15844. easing: jQuery.easing._default
  15845. }, options ),
  15846. originalProperties: properties,
  15847. originalOptions: options,
  15848. startTime: fxNow || createFxNow(),
  15849. duration: options.duration,
  15850. tweens: [],
  15851. createTween: function( prop, end ) {
  15852. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  15853. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  15854. animation.tweens.push( tween );
  15855. return tween;
  15856. },
  15857. stop: function( gotoEnd ) {
  15858. var index = 0,
  15859. // If we are going to the end, we want to run all the tweens
  15860. // otherwise we skip this part
  15861. length = gotoEnd ? animation.tweens.length : 0;
  15862. if ( stopped ) {
  15863. return this;
  15864. }
  15865. stopped = true;
  15866. for ( ; index < length; index++ ) {
  15867. animation.tweens[ index ].run( 1 );
  15868. }
  15869. // Resolve when we played the last frame; otherwise, reject
  15870. if ( gotoEnd ) {
  15871. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  15872. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  15873. } else {
  15874. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  15875. }
  15876. return this;
  15877. }
  15878. } ),
  15879. props = animation.props;
  15880. propFilter( props, animation.opts.specialEasing );
  15881. for ( ; index < length; index++ ) {
  15882. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  15883. if ( result ) {
  15884. if ( isFunction( result.stop ) ) {
  15885. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  15886. result.stop.bind( result );
  15887. }
  15888. return result;
  15889. }
  15890. }
  15891. jQuery.map( props, createTween, animation );
  15892. if ( isFunction( animation.opts.start ) ) {
  15893. animation.opts.start.call( elem, animation );
  15894. }
  15895. // Attach callbacks from options
  15896. animation
  15897. .progress( animation.opts.progress )
  15898. .done( animation.opts.done, animation.opts.complete )
  15899. .fail( animation.opts.fail )
  15900. .always( animation.opts.always );
  15901. jQuery.fx.timer(
  15902. jQuery.extend( tick, {
  15903. elem: elem,
  15904. anim: animation,
  15905. queue: animation.opts.queue
  15906. } )
  15907. );
  15908. return animation;
  15909. }
  15910. jQuery.Animation = jQuery.extend( Animation, {
  15911. tweeners: {
  15912. "*": [ function( prop, value ) {
  15913. var tween = this.createTween( prop, value );
  15914. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  15915. return tween;
  15916. } ]
  15917. },
  15918. tweener: function( props, callback ) {
  15919. if ( isFunction( props ) ) {
  15920. callback = props;
  15921. props = [ "*" ];
  15922. } else {
  15923. props = props.match( rnothtmlwhite );
  15924. }
  15925. var prop,
  15926. index = 0,
  15927. length = props.length;
  15928. for ( ; index < length; index++ ) {
  15929. prop = props[ index ];
  15930. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  15931. Animation.tweeners[ prop ].unshift( callback );
  15932. }
  15933. },
  15934. prefilters: [ defaultPrefilter ],
  15935. prefilter: function( callback, prepend ) {
  15936. if ( prepend ) {
  15937. Animation.prefilters.unshift( callback );
  15938. } else {
  15939. Animation.prefilters.push( callback );
  15940. }
  15941. }
  15942. } );
  15943. jQuery.speed = function( speed, easing, fn ) {
  15944. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  15945. complete: fn || !fn && easing ||
  15946. isFunction( speed ) && speed,
  15947. duration: speed,
  15948. easing: fn && easing || easing && !isFunction( easing ) && easing
  15949. };
  15950. // Go to the end state if fx are off
  15951. if ( jQuery.fx.off ) {
  15952. opt.duration = 0;
  15953. } else {
  15954. if ( typeof opt.duration !== "number" ) {
  15955. if ( opt.duration in jQuery.fx.speeds ) {
  15956. opt.duration = jQuery.fx.speeds[ opt.duration ];
  15957. } else {
  15958. opt.duration = jQuery.fx.speeds._default;
  15959. }
  15960. }
  15961. }
  15962. // Normalize opt.queue - true/undefined/null -> "fx"
  15963. if ( opt.queue == null || opt.queue === true ) {
  15964. opt.queue = "fx";
  15965. }
  15966. // Queueing
  15967. opt.old = opt.complete;
  15968. opt.complete = function() {
  15969. if ( isFunction( opt.old ) ) {
  15970. opt.old.call( this );
  15971. }
  15972. if ( opt.queue ) {
  15973. jQuery.dequeue( this, opt.queue );
  15974. }
  15975. };
  15976. return opt;
  15977. };
  15978. jQuery.fn.extend( {
  15979. fadeTo: function( speed, to, easing, callback ) {
  15980. // Show any hidden elements after setting opacity to 0
  15981. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  15982. // Animate to the value specified
  15983. .end().animate( { opacity: to }, speed, easing, callback );
  15984. },
  15985. animate: function( prop, speed, easing, callback ) {
  15986. var empty = jQuery.isEmptyObject( prop ),
  15987. optall = jQuery.speed( speed, easing, callback ),
  15988. doAnimation = function() {
  15989. // Operate on a copy of prop so per-property easing won't be lost
  15990. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  15991. // Empty animations, or finishing resolves immediately
  15992. if ( empty || dataPriv.get( this, "finish" ) ) {
  15993. anim.stop( true );
  15994. }
  15995. };
  15996. doAnimation.finish = doAnimation;
  15997. return empty || optall.queue === false ?
  15998. this.each( doAnimation ) :
  15999. this.queue( optall.queue, doAnimation );
  16000. },
  16001. stop: function( type, clearQueue, gotoEnd ) {
  16002. var stopQueue = function( hooks ) {
  16003. var stop = hooks.stop;
  16004. delete hooks.stop;
  16005. stop( gotoEnd );
  16006. };
  16007. if ( typeof type !== "string" ) {
  16008. gotoEnd = clearQueue;
  16009. clearQueue = type;
  16010. type = undefined;
  16011. }
  16012. if ( clearQueue && type !== false ) {
  16013. this.queue( type || "fx", [] );
  16014. }
  16015. return this.each( function() {
  16016. var dequeue = true,
  16017. index = type != null && type + "queueHooks",
  16018. timers = jQuery.timers,
  16019. data = dataPriv.get( this );
  16020. if ( index ) {
  16021. if ( data[ index ] && data[ index ].stop ) {
  16022. stopQueue( data[ index ] );
  16023. }
  16024. } else {
  16025. for ( index in data ) {
  16026. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  16027. stopQueue( data[ index ] );
  16028. }
  16029. }
  16030. }
  16031. for ( index = timers.length; index--; ) {
  16032. if ( timers[ index ].elem === this &&
  16033. ( type == null || timers[ index ].queue === type ) ) {
  16034. timers[ index ].anim.stop( gotoEnd );
  16035. dequeue = false;
  16036. timers.splice( index, 1 );
  16037. }
  16038. }
  16039. // Start the next in the queue if the last step wasn't forced.
  16040. // Timers currently will call their complete callbacks, which
  16041. // will dequeue but only if they were gotoEnd.
  16042. if ( dequeue || !gotoEnd ) {
  16043. jQuery.dequeue( this, type );
  16044. }
  16045. } );
  16046. },
  16047. finish: function( type ) {
  16048. if ( type !== false ) {
  16049. type = type || "fx";
  16050. }
  16051. return this.each( function() {
  16052. var index,
  16053. data = dataPriv.get( this ),
  16054. queue = data[ type + "queue" ],
  16055. hooks = data[ type + "queueHooks" ],
  16056. timers = jQuery.timers,
  16057. length = queue ? queue.length : 0;
  16058. // Enable finishing flag on private data
  16059. data.finish = true;
  16060. // Empty the queue first
  16061. jQuery.queue( this, type, [] );
  16062. if ( hooks && hooks.stop ) {
  16063. hooks.stop.call( this, true );
  16064. }
  16065. // Look for any active animations, and finish them
  16066. for ( index = timers.length; index--; ) {
  16067. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  16068. timers[ index ].anim.stop( true );
  16069. timers.splice( index, 1 );
  16070. }
  16071. }
  16072. // Look for any animations in the old queue and finish them
  16073. for ( index = 0; index < length; index++ ) {
  16074. if ( queue[ index ] && queue[ index ].finish ) {
  16075. queue[ index ].finish.call( this );
  16076. }
  16077. }
  16078. // Turn off finishing flag
  16079. delete data.finish;
  16080. } );
  16081. }
  16082. } );
  16083. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  16084. var cssFn = jQuery.fn[ name ];
  16085. jQuery.fn[ name ] = function( speed, easing, callback ) {
  16086. return speed == null || typeof speed === "boolean" ?
  16087. cssFn.apply( this, arguments ) :
  16088. this.animate( genFx( name, true ), speed, easing, callback );
  16089. };
  16090. } );
  16091. // Generate shortcuts for custom animations
  16092. jQuery.each( {
  16093. slideDown: genFx( "show" ),
  16094. slideUp: genFx( "hide" ),
  16095. slideToggle: genFx( "toggle" ),
  16096. fadeIn: { opacity: "show" },
  16097. fadeOut: { opacity: "hide" },
  16098. fadeToggle: { opacity: "toggle" }
  16099. }, function( name, props ) {
  16100. jQuery.fn[ name ] = function( speed, easing, callback ) {
  16101. return this.animate( props, speed, easing, callback );
  16102. };
  16103. } );
  16104. jQuery.timers = [];
  16105. jQuery.fx.tick = function() {
  16106. var timer,
  16107. i = 0,
  16108. timers = jQuery.timers;
  16109. fxNow = Date.now();
  16110. for ( ; i < timers.length; i++ ) {
  16111. timer = timers[ i ];
  16112. // Run the timer and safely remove it when done (allowing for external removal)
  16113. if ( !timer() && timers[ i ] === timer ) {
  16114. timers.splice( i--, 1 );
  16115. }
  16116. }
  16117. if ( !timers.length ) {
  16118. jQuery.fx.stop();
  16119. }
  16120. fxNow = undefined;
  16121. };
  16122. jQuery.fx.timer = function( timer ) {
  16123. jQuery.timers.push( timer );
  16124. jQuery.fx.start();
  16125. };
  16126. jQuery.fx.interval = 13;
  16127. jQuery.fx.start = function() {
  16128. if ( inProgress ) {
  16129. return;
  16130. }
  16131. inProgress = true;
  16132. schedule();
  16133. };
  16134. jQuery.fx.stop = function() {
  16135. inProgress = null;
  16136. };
  16137. jQuery.fx.speeds = {
  16138. slow: 600,
  16139. fast: 200,
  16140. // Default speed
  16141. _default: 400
  16142. };
  16143. // Based off of the plugin by Clint Helfers, with permission.
  16144. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  16145. jQuery.fn.delay = function( time, type ) {
  16146. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  16147. type = type || "fx";
  16148. return this.queue( type, function( next, hooks ) {
  16149. var timeout = window.setTimeout( next, time );
  16150. hooks.stop = function() {
  16151. window.clearTimeout( timeout );
  16152. };
  16153. } );
  16154. };
  16155. ( function() {
  16156. var input = document.createElement( "input" ),
  16157. select = document.createElement( "select" ),
  16158. opt = select.appendChild( document.createElement( "option" ) );
  16159. input.type = "checkbox";
  16160. // Support: Android <=4.3 only
  16161. // Default value for a checkbox should be "on"
  16162. support.checkOn = input.value !== "";
  16163. // Support: IE <=11 only
  16164. // Must access selectedIndex to make default options select
  16165. support.optSelected = opt.selected;
  16166. // Support: IE <=11 only
  16167. // An input loses its value after becoming a radio
  16168. input = document.createElement( "input" );
  16169. input.value = "t";
  16170. input.type = "radio";
  16171. support.radioValue = input.value === "t";
  16172. } )();
  16173. var boolHook,
  16174. attrHandle = jQuery.expr.attrHandle;
  16175. jQuery.fn.extend( {
  16176. attr: function( name, value ) {
  16177. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  16178. },
  16179. removeAttr: function( name ) {
  16180. return this.each( function() {
  16181. jQuery.removeAttr( this, name );
  16182. } );
  16183. }
  16184. } );
  16185. jQuery.extend( {
  16186. attr: function( elem, name, value ) {
  16187. var ret, hooks,
  16188. nType = elem.nodeType;
  16189. // Don't get/set attributes on text, comment and attribute nodes
  16190. if ( nType === 3 || nType === 8 || nType === 2 ) {
  16191. return;
  16192. }
  16193. // Fallback to prop when attributes are not supported
  16194. if ( typeof elem.getAttribute === "undefined" ) {
  16195. return jQuery.prop( elem, name, value );
  16196. }
  16197. // Attribute hooks are determined by the lowercase version
  16198. // Grab necessary hook if one is defined
  16199. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  16200. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  16201. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  16202. }
  16203. if ( value !== undefined ) {
  16204. if ( value === null ) {
  16205. jQuery.removeAttr( elem, name );
  16206. return;
  16207. }
  16208. if ( hooks && "set" in hooks &&
  16209. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  16210. return ret;
  16211. }
  16212. elem.setAttribute( name, value + "" );
  16213. return value;
  16214. }
  16215. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  16216. return ret;
  16217. }
  16218. ret = jQuery.find.attr( elem, name );
  16219. // Non-existent attributes return null, we normalize to undefined
  16220. return ret == null ? undefined : ret;
  16221. },
  16222. attrHooks: {
  16223. type: {
  16224. set: function( elem, value ) {
  16225. if ( !support.radioValue && value === "radio" &&
  16226. nodeName( elem, "input" ) ) {
  16227. var val = elem.value;
  16228. elem.setAttribute( "type", value );
  16229. if ( val ) {
  16230. elem.value = val;
  16231. }
  16232. return value;
  16233. }
  16234. }
  16235. }
  16236. },
  16237. removeAttr: function( elem, value ) {
  16238. var name,
  16239. i = 0,
  16240. // Attribute names can contain non-HTML whitespace characters
  16241. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  16242. attrNames = value && value.match( rnothtmlwhite );
  16243. if ( attrNames && elem.nodeType === 1 ) {
  16244. while ( ( name = attrNames[ i++ ] ) ) {
  16245. elem.removeAttribute( name );
  16246. }
  16247. }
  16248. }
  16249. } );
  16250. // Hooks for boolean attributes
  16251. boolHook = {
  16252. set: function( elem, value, name ) {
  16253. if ( value === false ) {
  16254. // Remove boolean attributes when set to false
  16255. jQuery.removeAttr( elem, name );
  16256. } else {
  16257. elem.setAttribute( name, name );
  16258. }
  16259. return name;
  16260. }
  16261. };
  16262. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  16263. var getter = attrHandle[ name ] || jQuery.find.attr;
  16264. attrHandle[ name ] = function( elem, name, isXML ) {
  16265. var ret, handle,
  16266. lowercaseName = name.toLowerCase();
  16267. if ( !isXML ) {
  16268. // Avoid an infinite loop by temporarily removing this function from the getter
  16269. handle = attrHandle[ lowercaseName ];
  16270. attrHandle[ lowercaseName ] = ret;
  16271. ret = getter( elem, name, isXML ) != null ?
  16272. lowercaseName :
  16273. null;
  16274. attrHandle[ lowercaseName ] = handle;
  16275. }
  16276. return ret;
  16277. };
  16278. } );
  16279. var rfocusable = /^(?:input|select|textarea|button)$/i,
  16280. rclickable = /^(?:a|area)$/i;
  16281. jQuery.fn.extend( {
  16282. prop: function( name, value ) {
  16283. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  16284. },
  16285. removeProp: function( name ) {
  16286. return this.each( function() {
  16287. delete this[ jQuery.propFix[ name ] || name ];
  16288. } );
  16289. }
  16290. } );
  16291. jQuery.extend( {
  16292. prop: function( elem, name, value ) {
  16293. var ret, hooks,
  16294. nType = elem.nodeType;
  16295. // Don't get/set properties on text, comment and attribute nodes
  16296. if ( nType === 3 || nType === 8 || nType === 2 ) {
  16297. return;
  16298. }
  16299. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  16300. // Fix name and attach hooks
  16301. name = jQuery.propFix[ name ] || name;
  16302. hooks = jQuery.propHooks[ name ];
  16303. }
  16304. if ( value !== undefined ) {
  16305. if ( hooks && "set" in hooks &&
  16306. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  16307. return ret;
  16308. }
  16309. return ( elem[ name ] = value );
  16310. }
  16311. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  16312. return ret;
  16313. }
  16314. return elem[ name ];
  16315. },
  16316. propHooks: {
  16317. tabIndex: {
  16318. get: function( elem ) {
  16319. // Support: IE <=9 - 11 only
  16320. // elem.tabIndex doesn't always return the
  16321. // correct value when it hasn't been explicitly set
  16322. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  16323. // Use proper attribute retrieval(#12072)
  16324. var tabindex = jQuery.find.attr( elem, "tabindex" );
  16325. if ( tabindex ) {
  16326. return parseInt( tabindex, 10 );
  16327. }
  16328. if (
  16329. rfocusable.test( elem.nodeName ) ||
  16330. rclickable.test( elem.nodeName ) &&
  16331. elem.href
  16332. ) {
  16333. return 0;
  16334. }
  16335. return -1;
  16336. }
  16337. }
  16338. },
  16339. propFix: {
  16340. "for": "htmlFor",
  16341. "class": "className"
  16342. }
  16343. } );
  16344. // Support: IE <=11 only
  16345. // Accessing the selectedIndex property
  16346. // forces the browser to respect setting selected
  16347. // on the option
  16348. // The getter ensures a default option is selected
  16349. // when in an optgroup
  16350. // eslint rule "no-unused-expressions" is disabled for this code
  16351. // since it considers such accessions noop
  16352. if ( !support.optSelected ) {
  16353. jQuery.propHooks.selected = {
  16354. get: function( elem ) {
  16355. /* eslint no-unused-expressions: "off" */
  16356. var parent = elem.parentNode;
  16357. if ( parent && parent.parentNode ) {
  16358. parent.parentNode.selectedIndex;
  16359. }
  16360. return null;
  16361. },
  16362. set: function( elem ) {
  16363. /* eslint no-unused-expressions: "off" */
  16364. var parent = elem.parentNode;
  16365. if ( parent ) {
  16366. parent.selectedIndex;
  16367. if ( parent.parentNode ) {
  16368. parent.parentNode.selectedIndex;
  16369. }
  16370. }
  16371. }
  16372. };
  16373. }
  16374. jQuery.each( [
  16375. "tabIndex",
  16376. "readOnly",
  16377. "maxLength",
  16378. "cellSpacing",
  16379. "cellPadding",
  16380. "rowSpan",
  16381. "colSpan",
  16382. "useMap",
  16383. "frameBorder",
  16384. "contentEditable"
  16385. ], function() {
  16386. jQuery.propFix[ this.toLowerCase() ] = this;
  16387. } );
  16388. // Strip and collapse whitespace according to HTML spec
  16389. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  16390. function stripAndCollapse( value ) {
  16391. var tokens = value.match( rnothtmlwhite ) || [];
  16392. return tokens.join( " " );
  16393. }
  16394. function getClass( elem ) {
  16395. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  16396. }
  16397. function classesToArray( value ) {
  16398. if ( Array.isArray( value ) ) {
  16399. return value;
  16400. }
  16401. if ( typeof value === "string" ) {
  16402. return value.match( rnothtmlwhite ) || [];
  16403. }
  16404. return [];
  16405. }
  16406. jQuery.fn.extend( {
  16407. addClass: function( value ) {
  16408. var classes, elem, cur, curValue, clazz, j, finalValue,
  16409. i = 0;
  16410. if ( isFunction( value ) ) {
  16411. return this.each( function( j ) {
  16412. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  16413. } );
  16414. }
  16415. classes = classesToArray( value );
  16416. if ( classes.length ) {
  16417. while ( ( elem = this[ i++ ] ) ) {
  16418. curValue = getClass( elem );
  16419. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  16420. if ( cur ) {
  16421. j = 0;
  16422. while ( ( clazz = classes[ j++ ] ) ) {
  16423. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  16424. cur += clazz + " ";
  16425. }
  16426. }
  16427. // Only assign if different to avoid unneeded rendering.
  16428. finalValue = stripAndCollapse( cur );
  16429. if ( curValue !== finalValue ) {
  16430. elem.setAttribute( "class", finalValue );
  16431. }
  16432. }
  16433. }
  16434. }
  16435. return this;
  16436. },
  16437. removeClass: function( value ) {
  16438. var classes, elem, cur, curValue, clazz, j, finalValue,
  16439. i = 0;
  16440. if ( isFunction( value ) ) {
  16441. return this.each( function( j ) {
  16442. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  16443. } );
  16444. }
  16445. if ( !arguments.length ) {
  16446. return this.attr( "class", "" );
  16447. }
  16448. classes = classesToArray( value );
  16449. if ( classes.length ) {
  16450. while ( ( elem = this[ i++ ] ) ) {
  16451. curValue = getClass( elem );
  16452. // This expression is here for better compressibility (see addClass)
  16453. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  16454. if ( cur ) {
  16455. j = 0;
  16456. while ( ( clazz = classes[ j++ ] ) ) {
  16457. // Remove *all* instances
  16458. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  16459. cur = cur.replace( " " + clazz + " ", " " );
  16460. }
  16461. }
  16462. // Only assign if different to avoid unneeded rendering.
  16463. finalValue = stripAndCollapse( cur );
  16464. if ( curValue !== finalValue ) {
  16465. elem.setAttribute( "class", finalValue );
  16466. }
  16467. }
  16468. }
  16469. }
  16470. return this;
  16471. },
  16472. toggleClass: function( value, stateVal ) {
  16473. var type = typeof value,
  16474. isValidValue = type === "string" || Array.isArray( value );
  16475. if ( typeof stateVal === "boolean" && isValidValue ) {
  16476. return stateVal ? this.addClass( value ) : this.removeClass( value );
  16477. }
  16478. if ( isFunction( value ) ) {
  16479. return this.each( function( i ) {
  16480. jQuery( this ).toggleClass(
  16481. value.call( this, i, getClass( this ), stateVal ),
  16482. stateVal
  16483. );
  16484. } );
  16485. }
  16486. return this.each( function() {
  16487. var className, i, self, classNames;
  16488. if ( isValidValue ) {
  16489. // Toggle individual class names
  16490. i = 0;
  16491. self = jQuery( this );
  16492. classNames = classesToArray( value );
  16493. while ( ( className = classNames[ i++ ] ) ) {
  16494. // Check each className given, space separated list
  16495. if ( self.hasClass( className ) ) {
  16496. self.removeClass( className );
  16497. } else {
  16498. self.addClass( className );
  16499. }
  16500. }
  16501. // Toggle whole class name
  16502. } else if ( value === undefined || type === "boolean" ) {
  16503. className = getClass( this );
  16504. if ( className ) {
  16505. // Store className if set
  16506. dataPriv.set( this, "__className__", className );
  16507. }
  16508. // If the element has a class name or if we're passed `false`,
  16509. // then remove the whole classname (if there was one, the above saved it).
  16510. // Otherwise bring back whatever was previously saved (if anything),
  16511. // falling back to the empty string if nothing was stored.
  16512. if ( this.setAttribute ) {
  16513. this.setAttribute( "class",
  16514. className || value === false ?
  16515. "" :
  16516. dataPriv.get( this, "__className__" ) || ""
  16517. );
  16518. }
  16519. }
  16520. } );
  16521. },
  16522. hasClass: function( selector ) {
  16523. var className, elem,
  16524. i = 0;
  16525. className = " " + selector + " ";
  16526. while ( ( elem = this[ i++ ] ) ) {
  16527. if ( elem.nodeType === 1 &&
  16528. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  16529. return true;
  16530. }
  16531. }
  16532. return false;
  16533. }
  16534. } );
  16535. var rreturn = /\r/g;
  16536. jQuery.fn.extend( {
  16537. val: function( value ) {
  16538. var hooks, ret, valueIsFunction,
  16539. elem = this[ 0 ];
  16540. if ( !arguments.length ) {
  16541. if ( elem ) {
  16542. hooks = jQuery.valHooks[ elem.type ] ||
  16543. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  16544. if ( hooks &&
  16545. "get" in hooks &&
  16546. ( ret = hooks.get( elem, "value" ) ) !== undefined
  16547. ) {
  16548. return ret;
  16549. }
  16550. ret = elem.value;
  16551. // Handle most common string cases
  16552. if ( typeof ret === "string" ) {
  16553. return ret.replace( rreturn, "" );
  16554. }
  16555. // Handle cases where value is null/undef or number
  16556. return ret == null ? "" : ret;
  16557. }
  16558. return;
  16559. }
  16560. valueIsFunction = isFunction( value );
  16561. return this.each( function( i ) {
  16562. var val;
  16563. if ( this.nodeType !== 1 ) {
  16564. return;
  16565. }
  16566. if ( valueIsFunction ) {
  16567. val = value.call( this, i, jQuery( this ).val() );
  16568. } else {
  16569. val = value;
  16570. }
  16571. // Treat null/undefined as ""; convert numbers to string
  16572. if ( val == null ) {
  16573. val = "";
  16574. } else if ( typeof val === "number" ) {
  16575. val += "";
  16576. } else if ( Array.isArray( val ) ) {
  16577. val = jQuery.map( val, function( value ) {
  16578. return value == null ? "" : value + "";
  16579. } );
  16580. }
  16581. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  16582. // If set returns undefined, fall back to normal setting
  16583. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  16584. this.value = val;
  16585. }
  16586. } );
  16587. }
  16588. } );
  16589. jQuery.extend( {
  16590. valHooks: {
  16591. option: {
  16592. get: function( elem ) {
  16593. var val = jQuery.find.attr( elem, "value" );
  16594. return val != null ?
  16595. val :
  16596. // Support: IE <=10 - 11 only
  16597. // option.text throws exceptions (#14686, #14858)
  16598. // Strip and collapse whitespace
  16599. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  16600. stripAndCollapse( jQuery.text( elem ) );
  16601. }
  16602. },
  16603. select: {
  16604. get: function( elem ) {
  16605. var value, option, i,
  16606. options = elem.options,
  16607. index = elem.selectedIndex,
  16608. one = elem.type === "select-one",
  16609. values = one ? null : [],
  16610. max = one ? index + 1 : options.length;
  16611. if ( index < 0 ) {
  16612. i = max;
  16613. } else {
  16614. i = one ? index : 0;
  16615. }
  16616. // Loop through all the selected options
  16617. for ( ; i < max; i++ ) {
  16618. option = options[ i ];
  16619. // Support: IE <=9 only
  16620. // IE8-9 doesn't update selected after form reset (#2551)
  16621. if ( ( option.selected || i === index ) &&
  16622. // Don't return options that are disabled or in a disabled optgroup
  16623. !option.disabled &&
  16624. ( !option.parentNode.disabled ||
  16625. !nodeName( option.parentNode, "optgroup" ) ) ) {
  16626. // Get the specific value for the option
  16627. value = jQuery( option ).val();
  16628. // We don't need an array for one selects
  16629. if ( one ) {
  16630. return value;
  16631. }
  16632. // Multi-Selects return an array
  16633. values.push( value );
  16634. }
  16635. }
  16636. return values;
  16637. },
  16638. set: function( elem, value ) {
  16639. var optionSet, option,
  16640. options = elem.options,
  16641. values = jQuery.makeArray( value ),
  16642. i = options.length;
  16643. while ( i-- ) {
  16644. option = options[ i ];
  16645. /* eslint-disable no-cond-assign */
  16646. if ( option.selected =
  16647. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  16648. ) {
  16649. optionSet = true;
  16650. }
  16651. /* eslint-enable no-cond-assign */
  16652. }
  16653. // Force browsers to behave consistently when non-matching value is set
  16654. if ( !optionSet ) {
  16655. elem.selectedIndex = -1;
  16656. }
  16657. return values;
  16658. }
  16659. }
  16660. }
  16661. } );
  16662. // Radios and checkboxes getter/setter
  16663. jQuery.each( [ "radio", "checkbox" ], function() {
  16664. jQuery.valHooks[ this ] = {
  16665. set: function( elem, value ) {
  16666. if ( Array.isArray( value ) ) {
  16667. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  16668. }
  16669. }
  16670. };
  16671. if ( !support.checkOn ) {
  16672. jQuery.valHooks[ this ].get = function( elem ) {
  16673. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  16674. };
  16675. }
  16676. } );
  16677. // Return jQuery for attributes-only inclusion
  16678. support.focusin = "onfocusin" in window;
  16679. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  16680. stopPropagationCallback = function( e ) {
  16681. e.stopPropagation();
  16682. };
  16683. jQuery.extend( jQuery.event, {
  16684. trigger: function( event, data, elem, onlyHandlers ) {
  16685. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  16686. eventPath = [ elem || document ],
  16687. type = hasOwn.call( event, "type" ) ? event.type : event,
  16688. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  16689. cur = lastElement = tmp = elem = elem || document;
  16690. // Don't do events on text and comment nodes
  16691. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  16692. return;
  16693. }
  16694. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  16695. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  16696. return;
  16697. }
  16698. if ( type.indexOf( "." ) > -1 ) {
  16699. // Namespaced trigger; create a regexp to match event type in handle()
  16700. namespaces = type.split( "." );
  16701. type = namespaces.shift();
  16702. namespaces.sort();
  16703. }
  16704. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  16705. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  16706. event = event[ jQuery.expando ] ?
  16707. event :
  16708. new jQuery.Event( type, typeof event === "object" && event );
  16709. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  16710. event.isTrigger = onlyHandlers ? 2 : 3;
  16711. event.namespace = namespaces.join( "." );
  16712. event.rnamespace = event.namespace ?
  16713. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  16714. null;
  16715. // Clean up the event in case it is being reused
  16716. event.result = undefined;
  16717. if ( !event.target ) {
  16718. event.target = elem;
  16719. }
  16720. // Clone any incoming data and prepend the event, creating the handler arg list
  16721. data = data == null ?
  16722. [ event ] :
  16723. jQuery.makeArray( data, [ event ] );
  16724. // Allow special events to draw outside the lines
  16725. special = jQuery.event.special[ type ] || {};
  16726. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  16727. return;
  16728. }
  16729. // Determine event propagation path in advance, per W3C events spec (#9951)
  16730. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  16731. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  16732. bubbleType = special.delegateType || type;
  16733. if ( !rfocusMorph.test( bubbleType + type ) ) {
  16734. cur = cur.parentNode;
  16735. }
  16736. for ( ; cur; cur = cur.parentNode ) {
  16737. eventPath.push( cur );
  16738. tmp = cur;
  16739. }
  16740. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  16741. if ( tmp === ( elem.ownerDocument || document ) ) {
  16742. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  16743. }
  16744. }
  16745. // Fire handlers on the event path
  16746. i = 0;
  16747. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  16748. lastElement = cur;
  16749. event.type = i > 1 ?
  16750. bubbleType :
  16751. special.bindType || type;
  16752. // jQuery handler
  16753. handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
  16754. dataPriv.get( cur, "handle" );
  16755. if ( handle ) {
  16756. handle.apply( cur, data );
  16757. }
  16758. // Native handler
  16759. handle = ontype && cur[ ontype ];
  16760. if ( handle && handle.apply && acceptData( cur ) ) {
  16761. event.result = handle.apply( cur, data );
  16762. if ( event.result === false ) {
  16763. event.preventDefault();
  16764. }
  16765. }
  16766. }
  16767. event.type = type;
  16768. // If nobody prevented the default action, do it now
  16769. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  16770. if ( ( !special._default ||
  16771. special._default.apply( eventPath.pop(), data ) === false ) &&
  16772. acceptData( elem ) ) {
  16773. // Call a native DOM method on the target with the same name as the event.
  16774. // Don't do default actions on window, that's where global variables be (#6170)
  16775. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  16776. // Don't re-trigger an onFOO event when we call its FOO() method
  16777. tmp = elem[ ontype ];
  16778. if ( tmp ) {
  16779. elem[ ontype ] = null;
  16780. }
  16781. // Prevent re-triggering of the same event, since we already bubbled it above
  16782. jQuery.event.triggered = type;
  16783. if ( event.isPropagationStopped() ) {
  16784. lastElement.addEventListener( type, stopPropagationCallback );
  16785. }
  16786. elem[ type ]();
  16787. if ( event.isPropagationStopped() ) {
  16788. lastElement.removeEventListener( type, stopPropagationCallback );
  16789. }
  16790. jQuery.event.triggered = undefined;
  16791. if ( tmp ) {
  16792. elem[ ontype ] = tmp;
  16793. }
  16794. }
  16795. }
  16796. }
  16797. return event.result;
  16798. },
  16799. // Piggyback on a donor event to simulate a different one
  16800. // Used only for `focus(in | out)` events
  16801. simulate: function( type, elem, event ) {
  16802. var e = jQuery.extend(
  16803. new jQuery.Event(),
  16804. event,
  16805. {
  16806. type: type,
  16807. isSimulated: true
  16808. }
  16809. );
  16810. jQuery.event.trigger( e, null, elem );
  16811. }
  16812. } );
  16813. jQuery.fn.extend( {
  16814. trigger: function( type, data ) {
  16815. return this.each( function() {
  16816. jQuery.event.trigger( type, data, this );
  16817. } );
  16818. },
  16819. triggerHandler: function( type, data ) {
  16820. var elem = this[ 0 ];
  16821. if ( elem ) {
  16822. return jQuery.event.trigger( type, data, elem, true );
  16823. }
  16824. }
  16825. } );
  16826. // Support: Firefox <=44
  16827. // Firefox doesn't have focus(in | out) events
  16828. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  16829. //
  16830. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  16831. // focus(in | out) events fire after focus & blur events,
  16832. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  16833. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  16834. if ( !support.focusin ) {
  16835. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  16836. // Attach a single capturing handler on the document while someone wants focusin/focusout
  16837. var handler = function( event ) {
  16838. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  16839. };
  16840. jQuery.event.special[ fix ] = {
  16841. setup: function() {
  16842. var doc = this.ownerDocument || this,
  16843. attaches = dataPriv.access( doc, fix );
  16844. if ( !attaches ) {
  16845. doc.addEventListener( orig, handler, true );
  16846. }
  16847. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  16848. },
  16849. teardown: function() {
  16850. var doc = this.ownerDocument || this,
  16851. attaches = dataPriv.access( doc, fix ) - 1;
  16852. if ( !attaches ) {
  16853. doc.removeEventListener( orig, handler, true );
  16854. dataPriv.remove( doc, fix );
  16855. } else {
  16856. dataPriv.access( doc, fix, attaches );
  16857. }
  16858. }
  16859. };
  16860. } );
  16861. }
  16862. var location = window.location;
  16863. var nonce = Date.now();
  16864. var rquery = ( /\?/ );
  16865. // Cross-browser xml parsing
  16866. jQuery.parseXML = function( data ) {
  16867. var xml;
  16868. if ( !data || typeof data !== "string" ) {
  16869. return null;
  16870. }
  16871. // Support: IE 9 - 11 only
  16872. // IE throws on parseFromString with invalid input.
  16873. try {
  16874. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  16875. } catch ( e ) {
  16876. xml = undefined;
  16877. }
  16878. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  16879. jQuery.error( "Invalid XML: " + data );
  16880. }
  16881. return xml;
  16882. };
  16883. var
  16884. rbracket = /\[\]$/,
  16885. rCRLF = /\r?\n/g,
  16886. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  16887. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  16888. function buildParams( prefix, obj, traditional, add ) {
  16889. var name;
  16890. if ( Array.isArray( obj ) ) {
  16891. // Serialize array item.
  16892. jQuery.each( obj, function( i, v ) {
  16893. if ( traditional || rbracket.test( prefix ) ) {
  16894. // Treat each array item as a scalar.
  16895. add( prefix, v );
  16896. } else {
  16897. // Item is non-scalar (array or object), encode its numeric index.
  16898. buildParams(
  16899. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  16900. v,
  16901. traditional,
  16902. add
  16903. );
  16904. }
  16905. } );
  16906. } else if ( !traditional && toType( obj ) === "object" ) {
  16907. // Serialize object item.
  16908. for ( name in obj ) {
  16909. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  16910. }
  16911. } else {
  16912. // Serialize scalar item.
  16913. add( prefix, obj );
  16914. }
  16915. }
  16916. // Serialize an array of form elements or a set of
  16917. // key/values into a query string
  16918. jQuery.param = function( a, traditional ) {
  16919. var prefix,
  16920. s = [],
  16921. add = function( key, valueOrFunction ) {
  16922. // If value is a function, invoke it and use its return value
  16923. var value = isFunction( valueOrFunction ) ?
  16924. valueOrFunction() :
  16925. valueOrFunction;
  16926. s[ s.length ] = encodeURIComponent( key ) + "=" +
  16927. encodeURIComponent( value == null ? "" : value );
  16928. };
  16929. if ( a == null ) {
  16930. return "";
  16931. }
  16932. // If an array was passed in, assume that it is an array of form elements.
  16933. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  16934. // Serialize the form elements
  16935. jQuery.each( a, function() {
  16936. add( this.name, this.value );
  16937. } );
  16938. } else {
  16939. // If traditional, encode the "old" way (the way 1.3.2 or older
  16940. // did it), otherwise encode params recursively.
  16941. for ( prefix in a ) {
  16942. buildParams( prefix, a[ prefix ], traditional, add );
  16943. }
  16944. }
  16945. // Return the resulting serialization
  16946. return s.join( "&" );
  16947. };
  16948. jQuery.fn.extend( {
  16949. serialize: function() {
  16950. return jQuery.param( this.serializeArray() );
  16951. },
  16952. serializeArray: function() {
  16953. return this.map( function() {
  16954. // Can add propHook for "elements" to filter or add form elements
  16955. var elements = jQuery.prop( this, "elements" );
  16956. return elements ? jQuery.makeArray( elements ) : this;
  16957. } )
  16958. .filter( function() {
  16959. var type = this.type;
  16960. // Use .is( ":disabled" ) so that fieldset[disabled] works
  16961. return this.name && !jQuery( this ).is( ":disabled" ) &&
  16962. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  16963. ( this.checked || !rcheckableType.test( type ) );
  16964. } )
  16965. .map( function( i, elem ) {
  16966. var val = jQuery( this ).val();
  16967. if ( val == null ) {
  16968. return null;
  16969. }
  16970. if ( Array.isArray( val ) ) {
  16971. return jQuery.map( val, function( val ) {
  16972. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  16973. } );
  16974. }
  16975. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  16976. } ).get();
  16977. }
  16978. } );
  16979. var
  16980. r20 = /%20/g,
  16981. rhash = /#.*$/,
  16982. rantiCache = /([?&])_=[^&]*/,
  16983. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  16984. // #7653, #8125, #8152: local protocol detection
  16985. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  16986. rnoContent = /^(?:GET|HEAD)$/,
  16987. rprotocol = /^\/\//,
  16988. /* Prefilters
  16989. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  16990. * 2) These are called:
  16991. * - BEFORE asking for a transport
  16992. * - AFTER param serialization (s.data is a string if s.processData is true)
  16993. * 3) key is the dataType
  16994. * 4) the catchall symbol "*" can be used
  16995. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  16996. */
  16997. prefilters = {},
  16998. /* Transports bindings
  16999. * 1) key is the dataType
  17000. * 2) the catchall symbol "*" can be used
  17001. * 3) selection will start with transport dataType and THEN go to "*" if needed
  17002. */
  17003. transports = {},
  17004. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  17005. allTypes = "*/".concat( "*" ),
  17006. // Anchor tag for parsing the document origin
  17007. originAnchor = document.createElement( "a" );
  17008. originAnchor.href = location.href;
  17009. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  17010. function addToPrefiltersOrTransports( structure ) {
  17011. // dataTypeExpression is optional and defaults to "*"
  17012. return function( dataTypeExpression, func ) {
  17013. if ( typeof dataTypeExpression !== "string" ) {
  17014. func = dataTypeExpression;
  17015. dataTypeExpression = "*";
  17016. }
  17017. var dataType,
  17018. i = 0,
  17019. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  17020. if ( isFunction( func ) ) {
  17021. // For each dataType in the dataTypeExpression
  17022. while ( ( dataType = dataTypes[ i++ ] ) ) {
  17023. // Prepend if requested
  17024. if ( dataType[ 0 ] === "+" ) {
  17025. dataType = dataType.slice( 1 ) || "*";
  17026. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  17027. // Otherwise append
  17028. } else {
  17029. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  17030. }
  17031. }
  17032. }
  17033. };
  17034. }
  17035. // Base inspection function for prefilters and transports
  17036. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  17037. var inspected = {},
  17038. seekingTransport = ( structure === transports );
  17039. function inspect( dataType ) {
  17040. var selected;
  17041. inspected[ dataType ] = true;
  17042. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  17043. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  17044. if ( typeof dataTypeOrTransport === "string" &&
  17045. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  17046. options.dataTypes.unshift( dataTypeOrTransport );
  17047. inspect( dataTypeOrTransport );
  17048. return false;
  17049. } else if ( seekingTransport ) {
  17050. return !( selected = dataTypeOrTransport );
  17051. }
  17052. } );
  17053. return selected;
  17054. }
  17055. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  17056. }
  17057. // A special extend for ajax options
  17058. // that takes "flat" options (not to be deep extended)
  17059. // Fixes #9887
  17060. function ajaxExtend( target, src ) {
  17061. var key, deep,
  17062. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  17063. for ( key in src ) {
  17064. if ( src[ key ] !== undefined ) {
  17065. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  17066. }
  17067. }
  17068. if ( deep ) {
  17069. jQuery.extend( true, target, deep );
  17070. }
  17071. return target;
  17072. }
  17073. /* Handles responses to an ajax request:
  17074. * - finds the right dataType (mediates between content-type and expected dataType)
  17075. * - returns the corresponding response
  17076. */
  17077. function ajaxHandleResponses( s, jqXHR, responses ) {
  17078. var ct, type, finalDataType, firstDataType,
  17079. contents = s.contents,
  17080. dataTypes = s.dataTypes;
  17081. // Remove auto dataType and get content-type in the process
  17082. while ( dataTypes[ 0 ] === "*" ) {
  17083. dataTypes.shift();
  17084. if ( ct === undefined ) {
  17085. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  17086. }
  17087. }
  17088. // Check if we're dealing with a known content-type
  17089. if ( ct ) {
  17090. for ( type in contents ) {
  17091. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  17092. dataTypes.unshift( type );
  17093. break;
  17094. }
  17095. }
  17096. }
  17097. // Check to see if we have a response for the expected dataType
  17098. if ( dataTypes[ 0 ] in responses ) {
  17099. finalDataType = dataTypes[ 0 ];
  17100. } else {
  17101. // Try convertible dataTypes
  17102. for ( type in responses ) {
  17103. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  17104. finalDataType = type;
  17105. break;
  17106. }
  17107. if ( !firstDataType ) {
  17108. firstDataType = type;
  17109. }
  17110. }
  17111. // Or just use first one
  17112. finalDataType = finalDataType || firstDataType;
  17113. }
  17114. // If we found a dataType
  17115. // We add the dataType to the list if needed
  17116. // and return the corresponding response
  17117. if ( finalDataType ) {
  17118. if ( finalDataType !== dataTypes[ 0 ] ) {
  17119. dataTypes.unshift( finalDataType );
  17120. }
  17121. return responses[ finalDataType ];
  17122. }
  17123. }
  17124. /* Chain conversions given the request and the original response
  17125. * Also sets the responseXXX fields on the jqXHR instance
  17126. */
  17127. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  17128. var conv2, current, conv, tmp, prev,
  17129. converters = {},
  17130. // Work with a copy of dataTypes in case we need to modify it for conversion
  17131. dataTypes = s.dataTypes.slice();
  17132. // Create converters map with lowercased keys
  17133. if ( dataTypes[ 1 ] ) {
  17134. for ( conv in s.converters ) {
  17135. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  17136. }
  17137. }
  17138. current = dataTypes.shift();
  17139. // Convert to each sequential dataType
  17140. while ( current ) {
  17141. if ( s.responseFields[ current ] ) {
  17142. jqXHR[ s.responseFields[ current ] ] = response;
  17143. }
  17144. // Apply the dataFilter if provided
  17145. if ( !prev && isSuccess && s.dataFilter ) {
  17146. response = s.dataFilter( response, s.dataType );
  17147. }
  17148. prev = current;
  17149. current = dataTypes.shift();
  17150. if ( current ) {
  17151. // There's only work to do if current dataType is non-auto
  17152. if ( current === "*" ) {
  17153. current = prev;
  17154. // Convert response if prev dataType is non-auto and differs from current
  17155. } else if ( prev !== "*" && prev !== current ) {
  17156. // Seek a direct converter
  17157. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  17158. // If none found, seek a pair
  17159. if ( !conv ) {
  17160. for ( conv2 in converters ) {
  17161. // If conv2 outputs current
  17162. tmp = conv2.split( " " );
  17163. if ( tmp[ 1 ] === current ) {
  17164. // If prev can be converted to accepted input
  17165. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  17166. converters[ "* " + tmp[ 0 ] ];
  17167. if ( conv ) {
  17168. // Condense equivalence converters
  17169. if ( conv === true ) {
  17170. conv = converters[ conv2 ];
  17171. // Otherwise, insert the intermediate dataType
  17172. } else if ( converters[ conv2 ] !== true ) {
  17173. current = tmp[ 0 ];
  17174. dataTypes.unshift( tmp[ 1 ] );
  17175. }
  17176. break;
  17177. }
  17178. }
  17179. }
  17180. }
  17181. // Apply converter (if not an equivalence)
  17182. if ( conv !== true ) {
  17183. // Unless errors are allowed to bubble, catch and return them
  17184. if ( conv && s.throws ) {
  17185. response = conv( response );
  17186. } else {
  17187. try {
  17188. response = conv( response );
  17189. } catch ( e ) {
  17190. return {
  17191. state: "parsererror",
  17192. error: conv ? e : "No conversion from " + prev + " to " + current
  17193. };
  17194. }
  17195. }
  17196. }
  17197. }
  17198. }
  17199. }
  17200. return { state: "success", data: response };
  17201. }
  17202. jQuery.extend( {
  17203. // Counter for holding the number of active queries
  17204. active: 0,
  17205. // Last-Modified header cache for next request
  17206. lastModified: {},
  17207. etag: {},
  17208. ajaxSettings: {
  17209. url: location.href,
  17210. type: "GET",
  17211. isLocal: rlocalProtocol.test( location.protocol ),
  17212. global: true,
  17213. processData: true,
  17214. async: true,
  17215. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  17216. /*
  17217. timeout: 0,
  17218. data: null,
  17219. dataType: null,
  17220. username: null,
  17221. password: null,
  17222. cache: null,
  17223. throws: false,
  17224. traditional: false,
  17225. headers: {},
  17226. */
  17227. accepts: {
  17228. "*": allTypes,
  17229. text: "text/plain",
  17230. html: "text/html",
  17231. xml: "application/xml, text/xml",
  17232. json: "application/json, text/javascript"
  17233. },
  17234. contents: {
  17235. xml: /\bxml\b/,
  17236. html: /\bhtml/,
  17237. json: /\bjson\b/
  17238. },
  17239. responseFields: {
  17240. xml: "responseXML",
  17241. text: "responseText",
  17242. json: "responseJSON"
  17243. },
  17244. // Data converters
  17245. // Keys separate source (or catchall "*") and destination types with a single space
  17246. converters: {
  17247. // Convert anything to text
  17248. "* text": String,
  17249. // Text to html (true = no transformation)
  17250. "text html": true,
  17251. // Evaluate text as a json expression
  17252. "text json": JSON.parse,
  17253. // Parse text as xml
  17254. "text xml": jQuery.parseXML
  17255. },
  17256. // For options that shouldn't be deep extended:
  17257. // you can add your own custom options here if
  17258. // and when you create one that shouldn't be
  17259. // deep extended (see ajaxExtend)
  17260. flatOptions: {
  17261. url: true,
  17262. context: true
  17263. }
  17264. },
  17265. // Creates a full fledged settings object into target
  17266. // with both ajaxSettings and settings fields.
  17267. // If target is omitted, writes into ajaxSettings.
  17268. ajaxSetup: function( target, settings ) {
  17269. return settings ?
  17270. // Building a settings object
  17271. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  17272. // Extending ajaxSettings
  17273. ajaxExtend( jQuery.ajaxSettings, target );
  17274. },
  17275. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  17276. ajaxTransport: addToPrefiltersOrTransports( transports ),
  17277. // Main method
  17278. ajax: function( url, options ) {
  17279. // If url is an object, simulate pre-1.5 signature
  17280. if ( typeof url === "object" ) {
  17281. options = url;
  17282. url = undefined;
  17283. }
  17284. // Force options to be an object
  17285. options = options || {};
  17286. var transport,
  17287. // URL without anti-cache param
  17288. cacheURL,
  17289. // Response headers
  17290. responseHeadersString,
  17291. responseHeaders,
  17292. // timeout handle
  17293. timeoutTimer,
  17294. // Url cleanup var
  17295. urlAnchor,
  17296. // Request state (becomes false upon send and true upon completion)
  17297. completed,
  17298. // To know if global events are to be dispatched
  17299. fireGlobals,
  17300. // Loop variable
  17301. i,
  17302. // uncached part of the url
  17303. uncached,
  17304. // Create the final options object
  17305. s = jQuery.ajaxSetup( {}, options ),
  17306. // Callbacks context
  17307. callbackContext = s.context || s,
  17308. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  17309. globalEventContext = s.context &&
  17310. ( callbackContext.nodeType || callbackContext.jquery ) ?
  17311. jQuery( callbackContext ) :
  17312. jQuery.event,
  17313. // Deferreds
  17314. deferred = jQuery.Deferred(),
  17315. completeDeferred = jQuery.Callbacks( "once memory" ),
  17316. // Status-dependent callbacks
  17317. statusCode = s.statusCode || {},
  17318. // Headers (they are sent all at once)
  17319. requestHeaders = {},
  17320. requestHeadersNames = {},
  17321. // Default abort message
  17322. strAbort = "canceled",
  17323. // Fake xhr
  17324. jqXHR = {
  17325. readyState: 0,
  17326. // Builds headers hashtable if needed
  17327. getResponseHeader: function( key ) {
  17328. var match;
  17329. if ( completed ) {
  17330. if ( !responseHeaders ) {
  17331. responseHeaders = {};
  17332. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  17333. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  17334. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  17335. .concat( match[ 2 ] );
  17336. }
  17337. }
  17338. match = responseHeaders[ key.toLowerCase() + " " ];
  17339. }
  17340. return match == null ? null : match.join( ", " );
  17341. },
  17342. // Raw string
  17343. getAllResponseHeaders: function() {
  17344. return completed ? responseHeadersString : null;
  17345. },
  17346. // Caches the header
  17347. setRequestHeader: function( name, value ) {
  17348. if ( completed == null ) {
  17349. name = requestHeadersNames[ name.toLowerCase() ] =
  17350. requestHeadersNames[ name.toLowerCase() ] || name;
  17351. requestHeaders[ name ] = value;
  17352. }
  17353. return this;
  17354. },
  17355. // Overrides response content-type header
  17356. overrideMimeType: function( type ) {
  17357. if ( completed == null ) {
  17358. s.mimeType = type;
  17359. }
  17360. return this;
  17361. },
  17362. // Status-dependent callbacks
  17363. statusCode: function( map ) {
  17364. var code;
  17365. if ( map ) {
  17366. if ( completed ) {
  17367. // Execute the appropriate callbacks
  17368. jqXHR.always( map[ jqXHR.status ] );
  17369. } else {
  17370. // Lazy-add the new callbacks in a way that preserves old ones
  17371. for ( code in map ) {
  17372. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  17373. }
  17374. }
  17375. }
  17376. return this;
  17377. },
  17378. // Cancel the request
  17379. abort: function( statusText ) {
  17380. var finalText = statusText || strAbort;
  17381. if ( transport ) {
  17382. transport.abort( finalText );
  17383. }
  17384. done( 0, finalText );
  17385. return this;
  17386. }
  17387. };
  17388. // Attach deferreds
  17389. deferred.promise( jqXHR );
  17390. // Add protocol if not provided (prefilters might expect it)
  17391. // Handle falsy url in the settings object (#10093: consistency with old signature)
  17392. // We also use the url parameter if available
  17393. s.url = ( ( url || s.url || location.href ) + "" )
  17394. .replace( rprotocol, location.protocol + "//" );
  17395. // Alias method option to type as per ticket #12004
  17396. s.type = options.method || options.type || s.method || s.type;
  17397. // Extract dataTypes list
  17398. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  17399. // A cross-domain request is in order when the origin doesn't match the current origin.
  17400. if ( s.crossDomain == null ) {
  17401. urlAnchor = document.createElement( "a" );
  17402. // Support: IE <=8 - 11, Edge 12 - 15
  17403. // IE throws exception on accessing the href property if url is malformed,
  17404. // e.g. http://example.com:80x/
  17405. try {
  17406. urlAnchor.href = s.url;
  17407. // Support: IE <=8 - 11 only
  17408. // Anchor's host property isn't correctly set when s.url is relative
  17409. urlAnchor.href = urlAnchor.href;
  17410. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  17411. urlAnchor.protocol + "//" + urlAnchor.host;
  17412. } catch ( e ) {
  17413. // If there is an error parsing the URL, assume it is crossDomain,
  17414. // it can be rejected by the transport if it is invalid
  17415. s.crossDomain = true;
  17416. }
  17417. }
  17418. // Convert data if not already a string
  17419. if ( s.data && s.processData && typeof s.data !== "string" ) {
  17420. s.data = jQuery.param( s.data, s.traditional );
  17421. }
  17422. // Apply prefilters
  17423. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  17424. // If request was aborted inside a prefilter, stop there
  17425. if ( completed ) {
  17426. return jqXHR;
  17427. }
  17428. // We can fire global events as of now if asked to
  17429. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  17430. fireGlobals = jQuery.event && s.global;
  17431. // Watch for a new set of requests
  17432. if ( fireGlobals && jQuery.active++ === 0 ) {
  17433. jQuery.event.trigger( "ajaxStart" );
  17434. }
  17435. // Uppercase the type
  17436. s.type = s.type.toUpperCase();
  17437. // Determine if request has content
  17438. s.hasContent = !rnoContent.test( s.type );
  17439. // Save the URL in case we're toying with the If-Modified-Since
  17440. // and/or If-None-Match header later on
  17441. // Remove hash to simplify url manipulation
  17442. cacheURL = s.url.replace( rhash, "" );
  17443. // More options handling for requests with no content
  17444. if ( !s.hasContent ) {
  17445. // Remember the hash so we can put it back
  17446. uncached = s.url.slice( cacheURL.length );
  17447. // If data is available and should be processed, append data to url
  17448. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  17449. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  17450. // #9682: remove data so that it's not used in an eventual retry
  17451. delete s.data;
  17452. }
  17453. // Add or update anti-cache param if needed
  17454. if ( s.cache === false ) {
  17455. cacheURL = cacheURL.replace( rantiCache, "$1" );
  17456. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
  17457. }
  17458. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  17459. s.url = cacheURL + uncached;
  17460. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  17461. } else if ( s.data && s.processData &&
  17462. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  17463. s.data = s.data.replace( r20, "+" );
  17464. }
  17465. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  17466. if ( s.ifModified ) {
  17467. if ( jQuery.lastModified[ cacheURL ] ) {
  17468. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  17469. }
  17470. if ( jQuery.etag[ cacheURL ] ) {
  17471. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  17472. }
  17473. }
  17474. // Set the correct header, if data is being sent
  17475. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  17476. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  17477. }
  17478. // Set the Accepts header for the server, depending on the dataType
  17479. jqXHR.setRequestHeader(
  17480. "Accept",
  17481. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  17482. s.accepts[ s.dataTypes[ 0 ] ] +
  17483. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  17484. s.accepts[ "*" ]
  17485. );
  17486. // Check for headers option
  17487. for ( i in s.headers ) {
  17488. jqXHR.setRequestHeader( i, s.headers[ i ] );
  17489. }
  17490. // Allow custom headers/mimetypes and early abort
  17491. if ( s.beforeSend &&
  17492. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  17493. // Abort if not done already and return
  17494. return jqXHR.abort();
  17495. }
  17496. // Aborting is no longer a cancellation
  17497. strAbort = "abort";
  17498. // Install callbacks on deferreds
  17499. completeDeferred.add( s.complete );
  17500. jqXHR.done( s.success );
  17501. jqXHR.fail( s.error );
  17502. // Get transport
  17503. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  17504. // If no transport, we auto-abort
  17505. if ( !transport ) {
  17506. done( -1, "No Transport" );
  17507. } else {
  17508. jqXHR.readyState = 1;
  17509. // Send global event
  17510. if ( fireGlobals ) {
  17511. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  17512. }
  17513. // If request was aborted inside ajaxSend, stop there
  17514. if ( completed ) {
  17515. return jqXHR;
  17516. }
  17517. // Timeout
  17518. if ( s.async && s.timeout > 0 ) {
  17519. timeoutTimer = window.setTimeout( function() {
  17520. jqXHR.abort( "timeout" );
  17521. }, s.timeout );
  17522. }
  17523. try {
  17524. completed = false;
  17525. transport.send( requestHeaders, done );
  17526. } catch ( e ) {
  17527. // Rethrow post-completion exceptions
  17528. if ( completed ) {
  17529. throw e;
  17530. }
  17531. // Propagate others as results
  17532. done( -1, e );
  17533. }
  17534. }
  17535. // Callback for when everything is done
  17536. function done( status, nativeStatusText, responses, headers ) {
  17537. var isSuccess, success, error, response, modified,
  17538. statusText = nativeStatusText;
  17539. // Ignore repeat invocations
  17540. if ( completed ) {
  17541. return;
  17542. }
  17543. completed = true;
  17544. // Clear timeout if it exists
  17545. if ( timeoutTimer ) {
  17546. window.clearTimeout( timeoutTimer );
  17547. }
  17548. // Dereference transport for early garbage collection
  17549. // (no matter how long the jqXHR object will be used)
  17550. transport = undefined;
  17551. // Cache response headers
  17552. responseHeadersString = headers || "";
  17553. // Set readyState
  17554. jqXHR.readyState = status > 0 ? 4 : 0;
  17555. // Determine if successful
  17556. isSuccess = status >= 200 && status < 300 || status === 304;
  17557. // Get response data
  17558. if ( responses ) {
  17559. response = ajaxHandleResponses( s, jqXHR, responses );
  17560. }
  17561. // Convert no matter what (that way responseXXX fields are always set)
  17562. response = ajaxConvert( s, response, jqXHR, isSuccess );
  17563. // If successful, handle type chaining
  17564. if ( isSuccess ) {
  17565. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  17566. if ( s.ifModified ) {
  17567. modified = jqXHR.getResponseHeader( "Last-Modified" );
  17568. if ( modified ) {
  17569. jQuery.lastModified[ cacheURL ] = modified;
  17570. }
  17571. modified = jqXHR.getResponseHeader( "etag" );
  17572. if ( modified ) {
  17573. jQuery.etag[ cacheURL ] = modified;
  17574. }
  17575. }
  17576. // if no content
  17577. if ( status === 204 || s.type === "HEAD" ) {
  17578. statusText = "nocontent";
  17579. // if not modified
  17580. } else if ( status === 304 ) {
  17581. statusText = "notmodified";
  17582. // If we have data, let's convert it
  17583. } else {
  17584. statusText = response.state;
  17585. success = response.data;
  17586. error = response.error;
  17587. isSuccess = !error;
  17588. }
  17589. } else {
  17590. // Extract error from statusText and normalize for non-aborts
  17591. error = statusText;
  17592. if ( status || !statusText ) {
  17593. statusText = "error";
  17594. if ( status < 0 ) {
  17595. status = 0;
  17596. }
  17597. }
  17598. }
  17599. // Set data for the fake xhr object
  17600. jqXHR.status = status;
  17601. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  17602. // Success/Error
  17603. if ( isSuccess ) {
  17604. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  17605. } else {
  17606. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  17607. }
  17608. // Status-dependent callbacks
  17609. jqXHR.statusCode( statusCode );
  17610. statusCode = undefined;
  17611. if ( fireGlobals ) {
  17612. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  17613. [ jqXHR, s, isSuccess ? success : error ] );
  17614. }
  17615. // Complete
  17616. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  17617. if ( fireGlobals ) {
  17618. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  17619. // Handle the global AJAX counter
  17620. if ( !( --jQuery.active ) ) {
  17621. jQuery.event.trigger( "ajaxStop" );
  17622. }
  17623. }
  17624. }
  17625. return jqXHR;
  17626. },
  17627. getJSON: function( url, data, callback ) {
  17628. return jQuery.get( url, data, callback, "json" );
  17629. },
  17630. getScript: function( url, callback ) {
  17631. return jQuery.get( url, undefined, callback, "script" );
  17632. }
  17633. } );
  17634. jQuery.each( [ "get", "post" ], function( i, method ) {
  17635. jQuery[ method ] = function( url, data, callback, type ) {
  17636. // Shift arguments if data argument was omitted
  17637. if ( isFunction( data ) ) {
  17638. type = type || callback;
  17639. callback = data;
  17640. data = undefined;
  17641. }
  17642. // The url can be an options object (which then must have .url)
  17643. return jQuery.ajax( jQuery.extend( {
  17644. url: url,
  17645. type: method,
  17646. dataType: type,
  17647. data: data,
  17648. success: callback
  17649. }, jQuery.isPlainObject( url ) && url ) );
  17650. };
  17651. } );
  17652. jQuery._evalUrl = function( url, options ) {
  17653. return jQuery.ajax( {
  17654. url: url,
  17655. // Make this explicit, since user can override this through ajaxSetup (#11264)
  17656. type: "GET",
  17657. dataType: "script",
  17658. cache: true,
  17659. async: false,
  17660. global: false,
  17661. // Only evaluate the response if it is successful (gh-4126)
  17662. // dataFilter is not invoked for failure responses, so using it instead
  17663. // of the default converter is kludgy but it works.
  17664. converters: {
  17665. "text script": function() {}
  17666. },
  17667. dataFilter: function( response ) {
  17668. jQuery.globalEval( response, options );
  17669. }
  17670. } );
  17671. };
  17672. jQuery.fn.extend( {
  17673. wrapAll: function( html ) {
  17674. var wrap;
  17675. if ( this[ 0 ] ) {
  17676. if ( isFunction( html ) ) {
  17677. html = html.call( this[ 0 ] );
  17678. }
  17679. // The elements to wrap the target around
  17680. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  17681. if ( this[ 0 ].parentNode ) {
  17682. wrap.insertBefore( this[ 0 ] );
  17683. }
  17684. wrap.map( function() {
  17685. var elem = this;
  17686. while ( elem.firstElementChild ) {
  17687. elem = elem.firstElementChild;
  17688. }
  17689. return elem;
  17690. } ).append( this );
  17691. }
  17692. return this;
  17693. },
  17694. wrapInner: function( html ) {
  17695. if ( isFunction( html ) ) {
  17696. return this.each( function( i ) {
  17697. jQuery( this ).wrapInner( html.call( this, i ) );
  17698. } );
  17699. }
  17700. return this.each( function() {
  17701. var self = jQuery( this ),
  17702. contents = self.contents();
  17703. if ( contents.length ) {
  17704. contents.wrapAll( html );
  17705. } else {
  17706. self.append( html );
  17707. }
  17708. } );
  17709. },
  17710. wrap: function( html ) {
  17711. var htmlIsFunction = isFunction( html );
  17712. return this.each( function( i ) {
  17713. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  17714. } );
  17715. },
  17716. unwrap: function( selector ) {
  17717. this.parent( selector ).not( "body" ).each( function() {
  17718. jQuery( this ).replaceWith( this.childNodes );
  17719. } );
  17720. return this;
  17721. }
  17722. } );
  17723. jQuery.expr.pseudos.hidden = function( elem ) {
  17724. return !jQuery.expr.pseudos.visible( elem );
  17725. };
  17726. jQuery.expr.pseudos.visible = function( elem ) {
  17727. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  17728. };
  17729. jQuery.ajaxSettings.xhr = function() {
  17730. try {
  17731. return new window.XMLHttpRequest();
  17732. } catch ( e ) {}
  17733. };
  17734. var xhrSuccessStatus = {
  17735. // File protocol always yields status code 0, assume 200
  17736. 0: 200,
  17737. // Support: IE <=9 only
  17738. // #1450: sometimes IE returns 1223 when it should be 204
  17739. 1223: 204
  17740. },
  17741. xhrSupported = jQuery.ajaxSettings.xhr();
  17742. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  17743. support.ajax = xhrSupported = !!xhrSupported;
  17744. jQuery.ajaxTransport( function( options ) {
  17745. var callback, errorCallback;
  17746. // Cross domain only allowed if supported through XMLHttpRequest
  17747. if ( support.cors || xhrSupported && !options.crossDomain ) {
  17748. return {
  17749. send: function( headers, complete ) {
  17750. var i,
  17751. xhr = options.xhr();
  17752. xhr.open(
  17753. options.type,
  17754. options.url,
  17755. options.async,
  17756. options.username,
  17757. options.password
  17758. );
  17759. // Apply custom fields if provided
  17760. if ( options.xhrFields ) {
  17761. for ( i in options.xhrFields ) {
  17762. xhr[ i ] = options.xhrFields[ i ];
  17763. }
  17764. }
  17765. // Override mime type if needed
  17766. if ( options.mimeType && xhr.overrideMimeType ) {
  17767. xhr.overrideMimeType( options.mimeType );
  17768. }
  17769. // X-Requested-With header
  17770. // For cross-domain requests, seeing as conditions for a preflight are
  17771. // akin to a jigsaw puzzle, we simply never set it to be sure.
  17772. // (it can always be set on a per-request basis or even using ajaxSetup)
  17773. // For same-domain requests, won't change header if already provided.
  17774. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  17775. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  17776. }
  17777. // Set headers
  17778. for ( i in headers ) {
  17779. xhr.setRequestHeader( i, headers[ i ] );
  17780. }
  17781. // Callback
  17782. callback = function( type ) {
  17783. return function() {
  17784. if ( callback ) {
  17785. callback = errorCallback = xhr.onload =
  17786. xhr.onerror = xhr.onabort = xhr.ontimeout =
  17787. xhr.onreadystatechange = null;
  17788. if ( type === "abort" ) {
  17789. xhr.abort();
  17790. } else if ( type === "error" ) {
  17791. // Support: IE <=9 only
  17792. // On a manual native abort, IE9 throws
  17793. // errors on any property access that is not readyState
  17794. if ( typeof xhr.status !== "number" ) {
  17795. complete( 0, "error" );
  17796. } else {
  17797. complete(
  17798. // File: protocol always yields status 0; see #8605, #14207
  17799. xhr.status,
  17800. xhr.statusText
  17801. );
  17802. }
  17803. } else {
  17804. complete(
  17805. xhrSuccessStatus[ xhr.status ] || xhr.status,
  17806. xhr.statusText,
  17807. // Support: IE <=9 only
  17808. // IE9 has no XHR2 but throws on binary (trac-11426)
  17809. // For XHR2 non-text, let the caller handle it (gh-2498)
  17810. ( xhr.responseType || "text" ) !== "text" ||
  17811. typeof xhr.responseText !== "string" ?
  17812. { binary: xhr.response } :
  17813. { text: xhr.responseText },
  17814. xhr.getAllResponseHeaders()
  17815. );
  17816. }
  17817. }
  17818. };
  17819. };
  17820. // Listen to events
  17821. xhr.onload = callback();
  17822. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  17823. // Support: IE 9 only
  17824. // Use onreadystatechange to replace onabort
  17825. // to handle uncaught aborts
  17826. if ( xhr.onabort !== undefined ) {
  17827. xhr.onabort = errorCallback;
  17828. } else {
  17829. xhr.onreadystatechange = function() {
  17830. // Check readyState before timeout as it changes
  17831. if ( xhr.readyState === 4 ) {
  17832. // Allow onerror to be called first,
  17833. // but that will not handle a native abort
  17834. // Also, save errorCallback to a variable
  17835. // as xhr.onerror cannot be accessed
  17836. window.setTimeout( function() {
  17837. if ( callback ) {
  17838. errorCallback();
  17839. }
  17840. } );
  17841. }
  17842. };
  17843. }
  17844. // Create the abort callback
  17845. callback = callback( "abort" );
  17846. try {
  17847. // Do send the request (this may raise an exception)
  17848. xhr.send( options.hasContent && options.data || null );
  17849. } catch ( e ) {
  17850. // #14683: Only rethrow if this hasn't been notified as an error yet
  17851. if ( callback ) {
  17852. throw e;
  17853. }
  17854. }
  17855. },
  17856. abort: function() {
  17857. if ( callback ) {
  17858. callback();
  17859. }
  17860. }
  17861. };
  17862. }
  17863. } );
  17864. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  17865. jQuery.ajaxPrefilter( function( s ) {
  17866. if ( s.crossDomain ) {
  17867. s.contents.script = false;
  17868. }
  17869. } );
  17870. // Install script dataType
  17871. jQuery.ajaxSetup( {
  17872. accepts: {
  17873. script: "text/javascript, application/javascript, " +
  17874. "application/ecmascript, application/x-ecmascript"
  17875. },
  17876. contents: {
  17877. script: /\b(?:java|ecma)script\b/
  17878. },
  17879. converters: {
  17880. "text script": function( text ) {
  17881. jQuery.globalEval( text );
  17882. return text;
  17883. }
  17884. }
  17885. } );
  17886. // Handle cache's special case and crossDomain
  17887. jQuery.ajaxPrefilter( "script", function( s ) {
  17888. if ( s.cache === undefined ) {
  17889. s.cache = false;
  17890. }
  17891. if ( s.crossDomain ) {
  17892. s.type = "GET";
  17893. }
  17894. } );
  17895. // Bind script tag hack transport
  17896. jQuery.ajaxTransport( "script", function( s ) {
  17897. // This transport only deals with cross domain or forced-by-attrs requests
  17898. if ( s.crossDomain || s.scriptAttrs ) {
  17899. var script, callback;
  17900. return {
  17901. send: function( _, complete ) {
  17902. script = jQuery( "<script>" )
  17903. .attr( s.scriptAttrs || {} )
  17904. .prop( { charset: s.scriptCharset, src: s.url } )
  17905. .on( "load error", callback = function( evt ) {
  17906. script.remove();
  17907. callback = null;
  17908. if ( evt ) {
  17909. complete( evt.type === "error" ? 404 : 200, evt.type );
  17910. }
  17911. } );
  17912. // Use native DOM manipulation to avoid our domManip AJAX trickery
  17913. document.head.appendChild( script[ 0 ] );
  17914. },
  17915. abort: function() {
  17916. if ( callback ) {
  17917. callback();
  17918. }
  17919. }
  17920. };
  17921. }
  17922. } );
  17923. var oldCallbacks = [],
  17924. rjsonp = /(=)\?(?=&|$)|\?\?/;
  17925. // Default jsonp settings
  17926. jQuery.ajaxSetup( {
  17927. jsonp: "callback",
  17928. jsonpCallback: function() {
  17929. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  17930. this[ callback ] = true;
  17931. return callback;
  17932. }
  17933. } );
  17934. // Detect, normalize options and install callbacks for jsonp requests
  17935. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  17936. var callbackName, overwritten, responseContainer,
  17937. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  17938. "url" :
  17939. typeof s.data === "string" &&
  17940. ( s.contentType || "" )
  17941. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  17942. rjsonp.test( s.data ) && "data"
  17943. );
  17944. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  17945. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  17946. // Get callback name, remembering preexisting value associated with it
  17947. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  17948. s.jsonpCallback() :
  17949. s.jsonpCallback;
  17950. // Insert callback into url or form data
  17951. if ( jsonProp ) {
  17952. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  17953. } else if ( s.jsonp !== false ) {
  17954. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  17955. }
  17956. // Use data converter to retrieve json after script execution
  17957. s.converters[ "script json" ] = function() {
  17958. if ( !responseContainer ) {
  17959. jQuery.error( callbackName + " was not called" );
  17960. }
  17961. return responseContainer[ 0 ];
  17962. };
  17963. // Force json dataType
  17964. s.dataTypes[ 0 ] = "json";
  17965. // Install callback
  17966. overwritten = window[ callbackName ];
  17967. window[ callbackName ] = function() {
  17968. responseContainer = arguments;
  17969. };
  17970. // Clean-up function (fires after converters)
  17971. jqXHR.always( function() {
  17972. // If previous value didn't exist - remove it
  17973. if ( overwritten === undefined ) {
  17974. jQuery( window ).removeProp( callbackName );
  17975. // Otherwise restore preexisting value
  17976. } else {
  17977. window[ callbackName ] = overwritten;
  17978. }
  17979. // Save back as free
  17980. if ( s[ callbackName ] ) {
  17981. // Make sure that re-using the options doesn't screw things around
  17982. s.jsonpCallback = originalSettings.jsonpCallback;
  17983. // Save the callback name for future use
  17984. oldCallbacks.push( callbackName );
  17985. }
  17986. // Call if it was a function and we have a response
  17987. if ( responseContainer && isFunction( overwritten ) ) {
  17988. overwritten( responseContainer[ 0 ] );
  17989. }
  17990. responseContainer = overwritten = undefined;
  17991. } );
  17992. // Delegate to script
  17993. return "script";
  17994. }
  17995. } );
  17996. // Support: Safari 8 only
  17997. // In Safari 8 documents created via document.implementation.createHTMLDocument
  17998. // collapse sibling forms: the second one becomes a child of the first one.
  17999. // Because of that, this security measure has to be disabled in Safari 8.
  18000. // https://bugs.webkit.org/show_bug.cgi?id=137337
  18001. support.createHTMLDocument = ( function() {
  18002. var body = document.implementation.createHTMLDocument( "" ).body;
  18003. body.innerHTML = "<form></form><form></form>";
  18004. return body.childNodes.length === 2;
  18005. } )();
  18006. // Argument "data" should be string of html
  18007. // context (optional): If specified, the fragment will be created in this context,
  18008. // defaults to document
  18009. // keepScripts (optional): If true, will include scripts passed in the html string
  18010. jQuery.parseHTML = function( data, context, keepScripts ) {
  18011. if ( typeof data !== "string" ) {
  18012. return [];
  18013. }
  18014. if ( typeof context === "boolean" ) {
  18015. keepScripts = context;
  18016. context = false;
  18017. }
  18018. var base, parsed, scripts;
  18019. if ( !context ) {
  18020. // Stop scripts or inline event handlers from being executed immediately
  18021. // by using document.implementation
  18022. if ( support.createHTMLDocument ) {
  18023. context = document.implementation.createHTMLDocument( "" );
  18024. // Set the base href for the created document
  18025. // so any parsed elements with URLs
  18026. // are based on the document's URL (gh-2965)
  18027. base = context.createElement( "base" );
  18028. base.href = document.location.href;
  18029. context.head.appendChild( base );
  18030. } else {
  18031. context = document;
  18032. }
  18033. }
  18034. parsed = rsingleTag.exec( data );
  18035. scripts = !keepScripts && [];
  18036. // Single tag
  18037. if ( parsed ) {
  18038. return [ context.createElement( parsed[ 1 ] ) ];
  18039. }
  18040. parsed = buildFragment( [ data ], context, scripts );
  18041. if ( scripts && scripts.length ) {
  18042. jQuery( scripts ).remove();
  18043. }
  18044. return jQuery.merge( [], parsed.childNodes );
  18045. };
  18046. /**
  18047. * Load a url into a page
  18048. */
  18049. jQuery.fn.load = function( url, params, callback ) {
  18050. var selector, type, response,
  18051. self = this,
  18052. off = url.indexOf( " " );
  18053. if ( off > -1 ) {
  18054. selector = stripAndCollapse( url.slice( off ) );
  18055. url = url.slice( 0, off );
  18056. }
  18057. // If it's a function
  18058. if ( isFunction( params ) ) {
  18059. // We assume that it's the callback
  18060. callback = params;
  18061. params = undefined;
  18062. // Otherwise, build a param string
  18063. } else if ( params && typeof params === "object" ) {
  18064. type = "POST";
  18065. }
  18066. // If we have elements to modify, make the request
  18067. if ( self.length > 0 ) {
  18068. jQuery.ajax( {
  18069. url: url,
  18070. // If "type" variable is undefined, then "GET" method will be used.
  18071. // Make value of this field explicit since
  18072. // user can override it through ajaxSetup method
  18073. type: type || "GET",
  18074. dataType: "html",
  18075. data: params
  18076. } ).done( function( responseText ) {
  18077. // Save response for use in complete callback
  18078. response = arguments;
  18079. self.html( selector ?
  18080. // If a selector was specified, locate the right elements in a dummy div
  18081. // Exclude scripts to avoid IE 'Permission Denied' errors
  18082. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  18083. // Otherwise use the full result
  18084. responseText );
  18085. // If the request succeeds, this function gets "data", "status", "jqXHR"
  18086. // but they are ignored because response was set above.
  18087. // If it fails, this function gets "jqXHR", "status", "error"
  18088. } ).always( callback && function( jqXHR, status ) {
  18089. self.each( function() {
  18090. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  18091. } );
  18092. } );
  18093. }
  18094. return this;
  18095. };
  18096. // Attach a bunch of functions for handling common AJAX events
  18097. jQuery.each( [
  18098. "ajaxStart",
  18099. "ajaxStop",
  18100. "ajaxComplete",
  18101. "ajaxError",
  18102. "ajaxSuccess",
  18103. "ajaxSend"
  18104. ], function( i, type ) {
  18105. jQuery.fn[ type ] = function( fn ) {
  18106. return this.on( type, fn );
  18107. };
  18108. } );
  18109. jQuery.expr.pseudos.animated = function( elem ) {
  18110. return jQuery.grep( jQuery.timers, function( fn ) {
  18111. return elem === fn.elem;
  18112. } ).length;
  18113. };
  18114. jQuery.offset = {
  18115. setOffset: function( elem, options, i ) {
  18116. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  18117. position = jQuery.css( elem, "position" ),
  18118. curElem = jQuery( elem ),
  18119. props = {};
  18120. // Set position first, in-case top/left are set even on static elem
  18121. if ( position === "static" ) {
  18122. elem.style.position = "relative";
  18123. }
  18124. curOffset = curElem.offset();
  18125. curCSSTop = jQuery.css( elem, "top" );
  18126. curCSSLeft = jQuery.css( elem, "left" );
  18127. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  18128. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  18129. // Need to be able to calculate position if either
  18130. // top or left is auto and position is either absolute or fixed
  18131. if ( calculatePosition ) {
  18132. curPosition = curElem.position();
  18133. curTop = curPosition.top;
  18134. curLeft = curPosition.left;
  18135. } else {
  18136. curTop = parseFloat( curCSSTop ) || 0;
  18137. curLeft = parseFloat( curCSSLeft ) || 0;
  18138. }
  18139. if ( isFunction( options ) ) {
  18140. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  18141. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  18142. }
  18143. if ( options.top != null ) {
  18144. props.top = ( options.top - curOffset.top ) + curTop;
  18145. }
  18146. if ( options.left != null ) {
  18147. props.left = ( options.left - curOffset.left ) + curLeft;
  18148. }
  18149. if ( "using" in options ) {
  18150. options.using.call( elem, props );
  18151. } else {
  18152. curElem.css( props );
  18153. }
  18154. }
  18155. };
  18156. jQuery.fn.extend( {
  18157. // offset() relates an element's border box to the document origin
  18158. offset: function( options ) {
  18159. // Preserve chaining for setter
  18160. if ( arguments.length ) {
  18161. return options === undefined ?
  18162. this :
  18163. this.each( function( i ) {
  18164. jQuery.offset.setOffset( this, options, i );
  18165. } );
  18166. }
  18167. var rect, win,
  18168. elem = this[ 0 ];
  18169. if ( !elem ) {
  18170. return;
  18171. }
  18172. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  18173. // Support: IE <=11 only
  18174. // Running getBoundingClientRect on a
  18175. // disconnected node in IE throws an error
  18176. if ( !elem.getClientRects().length ) {
  18177. return { top: 0, left: 0 };
  18178. }
  18179. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  18180. rect = elem.getBoundingClientRect();
  18181. win = elem.ownerDocument.defaultView;
  18182. return {
  18183. top: rect.top + win.pageYOffset,
  18184. left: rect.left + win.pageXOffset
  18185. };
  18186. },
  18187. // position() relates an element's margin box to its offset parent's padding box
  18188. // This corresponds to the behavior of CSS absolute positioning
  18189. position: function() {
  18190. if ( !this[ 0 ] ) {
  18191. return;
  18192. }
  18193. var offsetParent, offset, doc,
  18194. elem = this[ 0 ],
  18195. parentOffset = { top: 0, left: 0 };
  18196. // position:fixed elements are offset from the viewport, which itself always has zero offset
  18197. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  18198. // Assume position:fixed implies availability of getBoundingClientRect
  18199. offset = elem.getBoundingClientRect();
  18200. } else {
  18201. offset = this.offset();
  18202. // Account for the *real* offset parent, which can be the document or its root element
  18203. // when a statically positioned element is identified
  18204. doc = elem.ownerDocument;
  18205. offsetParent = elem.offsetParent || doc.documentElement;
  18206. while ( offsetParent &&
  18207. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  18208. jQuery.css( offsetParent, "position" ) === "static" ) {
  18209. offsetParent = offsetParent.parentNode;
  18210. }
  18211. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  18212. // Incorporate borders into its offset, since they are outside its content origin
  18213. parentOffset = jQuery( offsetParent ).offset();
  18214. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  18215. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  18216. }
  18217. }
  18218. // Subtract parent offsets and element margins
  18219. return {
  18220. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  18221. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  18222. };
  18223. },
  18224. // This method will return documentElement in the following cases:
  18225. // 1) For the element inside the iframe without offsetParent, this method will return
  18226. // documentElement of the parent window
  18227. // 2) For the hidden or detached element
  18228. // 3) For body or html element, i.e. in case of the html node - it will return itself
  18229. //
  18230. // but those exceptions were never presented as a real life use-cases
  18231. // and might be considered as more preferable results.
  18232. //
  18233. // This logic, however, is not guaranteed and can change at any point in the future
  18234. offsetParent: function() {
  18235. return this.map( function() {
  18236. var offsetParent = this.offsetParent;
  18237. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  18238. offsetParent = offsetParent.offsetParent;
  18239. }
  18240. return offsetParent || documentElement;
  18241. } );
  18242. }
  18243. } );
  18244. // Create scrollLeft and scrollTop methods
  18245. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  18246. var top = "pageYOffset" === prop;
  18247. jQuery.fn[ method ] = function( val ) {
  18248. return access( this, function( elem, method, val ) {
  18249. // Coalesce documents and windows
  18250. var win;
  18251. if ( isWindow( elem ) ) {
  18252. win = elem;
  18253. } else if ( elem.nodeType === 9 ) {
  18254. win = elem.defaultView;
  18255. }
  18256. if ( val === undefined ) {
  18257. return win ? win[ prop ] : elem[ method ];
  18258. }
  18259. if ( win ) {
  18260. win.scrollTo(
  18261. !top ? val : win.pageXOffset,
  18262. top ? val : win.pageYOffset
  18263. );
  18264. } else {
  18265. elem[ method ] = val;
  18266. }
  18267. }, method, val, arguments.length );
  18268. };
  18269. } );
  18270. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  18271. // Add the top/left cssHooks using jQuery.fn.position
  18272. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  18273. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  18274. // getComputedStyle returns percent when specified for top/left/bottom/right;
  18275. // rather than make the css module depend on the offset module, just check for it here
  18276. jQuery.each( [ "top", "left" ], function( i, prop ) {
  18277. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  18278. function( elem, computed ) {
  18279. if ( computed ) {
  18280. computed = curCSS( elem, prop );
  18281. // If curCSS returns percentage, fallback to offset
  18282. return rnumnonpx.test( computed ) ?
  18283. jQuery( elem ).position()[ prop ] + "px" :
  18284. computed;
  18285. }
  18286. }
  18287. );
  18288. } );
  18289. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  18290. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  18291. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  18292. function( defaultExtra, funcName ) {
  18293. // Margin is only for outerHeight, outerWidth
  18294. jQuery.fn[ funcName ] = function( margin, value ) {
  18295. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  18296. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  18297. return access( this, function( elem, type, value ) {
  18298. var doc;
  18299. if ( isWindow( elem ) ) {
  18300. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  18301. return funcName.indexOf( "outer" ) === 0 ?
  18302. elem[ "inner" + name ] :
  18303. elem.document.documentElement[ "client" + name ];
  18304. }
  18305. // Get document width or height
  18306. if ( elem.nodeType === 9 ) {
  18307. doc = elem.documentElement;
  18308. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  18309. // whichever is greatest
  18310. return Math.max(
  18311. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  18312. elem.body[ "offset" + name ], doc[ "offset" + name ],
  18313. doc[ "client" + name ]
  18314. );
  18315. }
  18316. return value === undefined ?
  18317. // Get width or height on the element, requesting but not forcing parseFloat
  18318. jQuery.css( elem, type, extra ) :
  18319. // Set width or height on the element
  18320. jQuery.style( elem, type, value, extra );
  18321. }, type, chainable ? margin : undefined, chainable );
  18322. };
  18323. } );
  18324. } );
  18325. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  18326. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  18327. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  18328. function( i, name ) {
  18329. // Handle event binding
  18330. jQuery.fn[ name ] = function( data, fn ) {
  18331. return arguments.length > 0 ?
  18332. this.on( name, null, data, fn ) :
  18333. this.trigger( name );
  18334. };
  18335. } );
  18336. jQuery.fn.extend( {
  18337. hover: function( fnOver, fnOut ) {
  18338. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  18339. }
  18340. } );
  18341. jQuery.fn.extend( {
  18342. bind: function( types, data, fn ) {
  18343. return this.on( types, null, data, fn );
  18344. },
  18345. unbind: function( types, fn ) {
  18346. return this.off( types, null, fn );
  18347. },
  18348. delegate: function( selector, types, data, fn ) {
  18349. return this.on( types, selector, data, fn );
  18350. },
  18351. undelegate: function( selector, types, fn ) {
  18352. // ( namespace ) or ( selector, types [, fn] )
  18353. return arguments.length === 1 ?
  18354. this.off( selector, "**" ) :
  18355. this.off( types, selector || "**", fn );
  18356. }
  18357. } );
  18358. // Bind a function to a context, optionally partially applying any
  18359. // arguments.
  18360. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  18361. // However, it is not slated for removal any time soon
  18362. jQuery.proxy = function( fn, context ) {
  18363. var tmp, args, proxy;
  18364. if ( typeof context === "string" ) {
  18365. tmp = fn[ context ];
  18366. context = fn;
  18367. fn = tmp;
  18368. }
  18369. // Quick check to determine if target is callable, in the spec
  18370. // this throws a TypeError, but we will just return undefined.
  18371. if ( !isFunction( fn ) ) {
  18372. return undefined;
  18373. }
  18374. // Simulated bind
  18375. args = slice.call( arguments, 2 );
  18376. proxy = function() {
  18377. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  18378. };
  18379. // Set the guid of unique handler to the same of original handler, so it can be removed
  18380. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  18381. return proxy;
  18382. };
  18383. jQuery.holdReady = function( hold ) {
  18384. if ( hold ) {
  18385. jQuery.readyWait++;
  18386. } else {
  18387. jQuery.ready( true );
  18388. }
  18389. };
  18390. jQuery.isArray = Array.isArray;
  18391. jQuery.parseJSON = JSON.parse;
  18392. jQuery.nodeName = nodeName;
  18393. jQuery.isFunction = isFunction;
  18394. jQuery.isWindow = isWindow;
  18395. jQuery.camelCase = camelCase;
  18396. jQuery.type = toType;
  18397. jQuery.now = Date.now;
  18398. jQuery.isNumeric = function( obj ) {
  18399. // As of jQuery 3.0, isNumeric is limited to
  18400. // strings and numbers (primitives or objects)
  18401. // that can be coerced to finite numbers (gh-2662)
  18402. var type = jQuery.type( obj );
  18403. return ( type === "number" || type === "string" ) &&
  18404. // parseFloat NaNs numeric-cast false positives ("")
  18405. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  18406. // subtraction forces infinities to NaN
  18407. !isNaN( obj - parseFloat( obj ) );
  18408. };
  18409. // Register as a named AMD module, since jQuery can be concatenated with other
  18410. // files that may use define, but not via a proper concatenation script that
  18411. // understands anonymous AMD modules. A named AMD is safest and most robust
  18412. // way to register. Lowercase jquery is used because AMD module names are
  18413. // derived from file names, and jQuery is normally delivered in a lowercase
  18414. // file name. Do this after creating the global so that if an AMD module wants
  18415. // to call noConflict to hide this version of jQuery, it will work.
  18416. // Note that for maximum portability, libraries that are not jQuery should
  18417. // declare themselves as anonymous modules, and avoid setting a global if an
  18418. // AMD loader is present. jQuery is a special case. For more information, see
  18419. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  18420. if ( true ) {
  18421. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  18422. return jQuery;
  18423. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  18424. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  18425. }
  18426. var
  18427. // Map over jQuery in case of overwrite
  18428. _jQuery = window.jQuery,
  18429. // Map over the $ in case of overwrite
  18430. _$ = window.$;
  18431. jQuery.noConflict = function( deep ) {
  18432. if ( window.$ === jQuery ) {
  18433. window.$ = _$;
  18434. }
  18435. if ( deep && window.jQuery === jQuery ) {
  18436. window.jQuery = _jQuery;
  18437. }
  18438. return jQuery;
  18439. };
  18440. // Expose jQuery and $ identifiers, even in AMD
  18441. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  18442. // and CommonJS for browser emulators (#13566)
  18443. if ( !noGlobal ) {
  18444. window.jQuery = window.$ = jQuery;
  18445. }
  18446. return jQuery;
  18447. } );
  18448. /***/ }),
  18449. /***/ "./node_modules/lodash/lodash.js":
  18450. /*!***************************************!*\
  18451. !*** ./node_modules/lodash/lodash.js ***!
  18452. \***************************************/
  18453. /*! no static exports found */
  18454. /***/ (function(module, exports, __webpack_require__) {
  18455. /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  18456. * @license
  18457. * Lodash <https://lodash.com/>
  18458. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  18459. * Released under MIT license <https://lodash.com/license>
  18460. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  18461. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  18462. */
  18463. ;(function() {
  18464. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  18465. var undefined;
  18466. /** Used as the semantic version number. */
  18467. var VERSION = '4.17.15';
  18468. /** Used as the size to enable large array optimizations. */
  18469. var LARGE_ARRAY_SIZE = 200;
  18470. /** Error message constants. */
  18471. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  18472. FUNC_ERROR_TEXT = 'Expected a function';
  18473. /** Used to stand-in for `undefined` hash values. */
  18474. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  18475. /** Used as the maximum memoize cache size. */
  18476. var MAX_MEMOIZE_SIZE = 500;
  18477. /** Used as the internal argument placeholder. */
  18478. var PLACEHOLDER = '__lodash_placeholder__';
  18479. /** Used to compose bitmasks for cloning. */
  18480. var CLONE_DEEP_FLAG = 1,
  18481. CLONE_FLAT_FLAG = 2,
  18482. CLONE_SYMBOLS_FLAG = 4;
  18483. /** Used to compose bitmasks for value comparisons. */
  18484. var COMPARE_PARTIAL_FLAG = 1,
  18485. COMPARE_UNORDERED_FLAG = 2;
  18486. /** Used to compose bitmasks for function metadata. */
  18487. var WRAP_BIND_FLAG = 1,
  18488. WRAP_BIND_KEY_FLAG = 2,
  18489. WRAP_CURRY_BOUND_FLAG = 4,
  18490. WRAP_CURRY_FLAG = 8,
  18491. WRAP_CURRY_RIGHT_FLAG = 16,
  18492. WRAP_PARTIAL_FLAG = 32,
  18493. WRAP_PARTIAL_RIGHT_FLAG = 64,
  18494. WRAP_ARY_FLAG = 128,
  18495. WRAP_REARG_FLAG = 256,
  18496. WRAP_FLIP_FLAG = 512;
  18497. /** Used as default options for `_.truncate`. */
  18498. var DEFAULT_TRUNC_LENGTH = 30,
  18499. DEFAULT_TRUNC_OMISSION = '...';
  18500. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  18501. var HOT_COUNT = 800,
  18502. HOT_SPAN = 16;
  18503. /** Used to indicate the type of lazy iteratees. */
  18504. var LAZY_FILTER_FLAG = 1,
  18505. LAZY_MAP_FLAG = 2,
  18506. LAZY_WHILE_FLAG = 3;
  18507. /** Used as references for various `Number` constants. */
  18508. var INFINITY = 1 / 0,
  18509. MAX_SAFE_INTEGER = 9007199254740991,
  18510. MAX_INTEGER = 1.7976931348623157e+308,
  18511. NAN = 0 / 0;
  18512. /** Used as references for the maximum length and index of an array. */
  18513. var MAX_ARRAY_LENGTH = 4294967295,
  18514. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  18515. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  18516. /** Used to associate wrap methods with their bit flags. */
  18517. var wrapFlags = [
  18518. ['ary', WRAP_ARY_FLAG],
  18519. ['bind', WRAP_BIND_FLAG],
  18520. ['bindKey', WRAP_BIND_KEY_FLAG],
  18521. ['curry', WRAP_CURRY_FLAG],
  18522. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  18523. ['flip', WRAP_FLIP_FLAG],
  18524. ['partial', WRAP_PARTIAL_FLAG],
  18525. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  18526. ['rearg', WRAP_REARG_FLAG]
  18527. ];
  18528. /** `Object#toString` result references. */
  18529. var argsTag = '[object Arguments]',
  18530. arrayTag = '[object Array]',
  18531. asyncTag = '[object AsyncFunction]',
  18532. boolTag = '[object Boolean]',
  18533. dateTag = '[object Date]',
  18534. domExcTag = '[object DOMException]',
  18535. errorTag = '[object Error]',
  18536. funcTag = '[object Function]',
  18537. genTag = '[object GeneratorFunction]',
  18538. mapTag = '[object Map]',
  18539. numberTag = '[object Number]',
  18540. nullTag = '[object Null]',
  18541. objectTag = '[object Object]',
  18542. promiseTag = '[object Promise]',
  18543. proxyTag = '[object Proxy]',
  18544. regexpTag = '[object RegExp]',
  18545. setTag = '[object Set]',
  18546. stringTag = '[object String]',
  18547. symbolTag = '[object Symbol]',
  18548. undefinedTag = '[object Undefined]',
  18549. weakMapTag = '[object WeakMap]',
  18550. weakSetTag = '[object WeakSet]';
  18551. var arrayBufferTag = '[object ArrayBuffer]',
  18552. dataViewTag = '[object DataView]',
  18553. float32Tag = '[object Float32Array]',
  18554. float64Tag = '[object Float64Array]',
  18555. int8Tag = '[object Int8Array]',
  18556. int16Tag = '[object Int16Array]',
  18557. int32Tag = '[object Int32Array]',
  18558. uint8Tag = '[object Uint8Array]',
  18559. uint8ClampedTag = '[object Uint8ClampedArray]',
  18560. uint16Tag = '[object Uint16Array]',
  18561. uint32Tag = '[object Uint32Array]';
  18562. /** Used to match empty string literals in compiled template source. */
  18563. var reEmptyStringLeading = /\b__p \+= '';/g,
  18564. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  18565. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  18566. /** Used to match HTML entities and HTML characters. */
  18567. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  18568. reUnescapedHtml = /[&<>"']/g,
  18569. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  18570. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  18571. /** Used to match template delimiters. */
  18572. var reEscape = /<%-([\s\S]+?)%>/g,
  18573. reEvaluate = /<%([\s\S]+?)%>/g,
  18574. reInterpolate = /<%=([\s\S]+?)%>/g;
  18575. /** Used to match property names within property paths. */
  18576. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  18577. reIsPlainProp = /^\w*$/,
  18578. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  18579. /**
  18580. * Used to match `RegExp`
  18581. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  18582. */
  18583. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  18584. reHasRegExpChar = RegExp(reRegExpChar.source);
  18585. /** Used to match leading and trailing whitespace. */
  18586. var reTrim = /^\s+|\s+$/g,
  18587. reTrimStart = /^\s+/,
  18588. reTrimEnd = /\s+$/;
  18589. /** Used to match wrap detail comments. */
  18590. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  18591. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  18592. reSplitDetails = /,? & /;
  18593. /** Used to match words composed of alphanumeric characters. */
  18594. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  18595. /** Used to match backslashes in property paths. */
  18596. var reEscapeChar = /\\(\\)?/g;
  18597. /**
  18598. * Used to match
  18599. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  18600. */
  18601. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  18602. /** Used to match `RegExp` flags from their coerced string values. */
  18603. var reFlags = /\w*$/;
  18604. /** Used to detect bad signed hexadecimal string values. */
  18605. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  18606. /** Used to detect binary string values. */
  18607. var reIsBinary = /^0b[01]+$/i;
  18608. /** Used to detect host constructors (Safari). */
  18609. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  18610. /** Used to detect octal string values. */
  18611. var reIsOctal = /^0o[0-7]+$/i;
  18612. /** Used to detect unsigned integer values. */
  18613. var reIsUint = /^(?:0|[1-9]\d*)$/;
  18614. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  18615. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  18616. /** Used to ensure capturing order of template delimiters. */
  18617. var reNoMatch = /($^)/;
  18618. /** Used to match unescaped characters in compiled string literals. */
  18619. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  18620. /** Used to compose unicode character classes. */
  18621. var rsAstralRange = '\\ud800-\\udfff',
  18622. rsComboMarksRange = '\\u0300-\\u036f',
  18623. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  18624. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  18625. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  18626. rsDingbatRange = '\\u2700-\\u27bf',
  18627. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  18628. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  18629. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  18630. rsPunctuationRange = '\\u2000-\\u206f',
  18631. 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',
  18632. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  18633. rsVarRange = '\\ufe0e\\ufe0f',
  18634. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  18635. /** Used to compose unicode capture groups. */
  18636. var rsApos = "['\u2019]",
  18637. rsAstral = '[' + rsAstralRange + ']',
  18638. rsBreak = '[' + rsBreakRange + ']',
  18639. rsCombo = '[' + rsComboRange + ']',
  18640. rsDigits = '\\d+',
  18641. rsDingbat = '[' + rsDingbatRange + ']',
  18642. rsLower = '[' + rsLowerRange + ']',
  18643. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  18644. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  18645. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  18646. rsNonAstral = '[^' + rsAstralRange + ']',
  18647. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  18648. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  18649. rsUpper = '[' + rsUpperRange + ']',
  18650. rsZWJ = '\\u200d';
  18651. /** Used to compose unicode regexes. */
  18652. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  18653. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  18654. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  18655. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  18656. reOptMod = rsModifier + '?',
  18657. rsOptVar = '[' + rsVarRange + ']?',
  18658. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  18659. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  18660. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  18661. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  18662. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  18663. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  18664. /** Used to match apostrophes. */
  18665. var reApos = RegExp(rsApos, 'g');
  18666. /**
  18667. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  18668. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  18669. */
  18670. var reComboMark = RegExp(rsCombo, 'g');
  18671. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  18672. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  18673. /** Used to match complex or compound words. */
  18674. var reUnicodeWord = RegExp([
  18675. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  18676. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  18677. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  18678. rsUpper + '+' + rsOptContrUpper,
  18679. rsOrdUpper,
  18680. rsOrdLower,
  18681. rsDigits,
  18682. rsEmoji
  18683. ].join('|'), 'g');
  18684. /** 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/). */
  18685. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  18686. /** Used to detect strings that need a more robust regexp to match words. */
  18687. 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 ]/;
  18688. /** Used to assign default `context` object properties. */
  18689. var contextProps = [
  18690. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  18691. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  18692. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  18693. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  18694. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  18695. ];
  18696. /** Used to make template sourceURLs easier to identify. */
  18697. var templateCounter = -1;
  18698. /** Used to identify `toStringTag` values of typed arrays. */
  18699. var typedArrayTags = {};
  18700. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  18701. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  18702. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  18703. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  18704. typedArrayTags[uint32Tag] = true;
  18705. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  18706. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  18707. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  18708. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  18709. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  18710. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  18711. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  18712. typedArrayTags[weakMapTag] = false;
  18713. /** Used to identify `toStringTag` values supported by `_.clone`. */
  18714. var cloneableTags = {};
  18715. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  18716. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  18717. cloneableTags[boolTag] = cloneableTags[dateTag] =
  18718. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  18719. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  18720. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  18721. cloneableTags[numberTag] = cloneableTags[objectTag] =
  18722. cloneableTags[regexpTag] = cloneableTags[setTag] =
  18723. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  18724. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  18725. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  18726. cloneableTags[errorTag] = cloneableTags[funcTag] =
  18727. cloneableTags[weakMapTag] = false;
  18728. /** Used to map Latin Unicode letters to basic Latin letters. */
  18729. var deburredLetters = {
  18730. // Latin-1 Supplement block.
  18731. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  18732. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  18733. '\xc7': 'C', '\xe7': 'c',
  18734. '\xd0': 'D', '\xf0': 'd',
  18735. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  18736. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  18737. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  18738. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  18739. '\xd1': 'N', '\xf1': 'n',
  18740. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  18741. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  18742. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  18743. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  18744. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  18745. '\xc6': 'Ae', '\xe6': 'ae',
  18746. '\xde': 'Th', '\xfe': 'th',
  18747. '\xdf': 'ss',
  18748. // Latin Extended-A block.
  18749. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  18750. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  18751. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  18752. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  18753. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  18754. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  18755. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  18756. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  18757. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  18758. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  18759. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  18760. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  18761. '\u0134': 'J', '\u0135': 'j',
  18762. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  18763. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  18764. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  18765. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  18766. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  18767. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  18768. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  18769. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  18770. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  18771. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  18772. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  18773. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  18774. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  18775. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  18776. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  18777. '\u0174': 'W', '\u0175': 'w',
  18778. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  18779. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  18780. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  18781. '\u0132': 'IJ', '\u0133': 'ij',
  18782. '\u0152': 'Oe', '\u0153': 'oe',
  18783. '\u0149': "'n", '\u017f': 's'
  18784. };
  18785. /** Used to map characters to HTML entities. */
  18786. var htmlEscapes = {
  18787. '&': '&amp;',
  18788. '<': '&lt;',
  18789. '>': '&gt;',
  18790. '"': '&quot;',
  18791. "'": '&#39;'
  18792. };
  18793. /** Used to map HTML entities to characters. */
  18794. var htmlUnescapes = {
  18795. '&amp;': '&',
  18796. '&lt;': '<',
  18797. '&gt;': '>',
  18798. '&quot;': '"',
  18799. '&#39;': "'"
  18800. };
  18801. /** Used to escape characters for inclusion in compiled string literals. */
  18802. var stringEscapes = {
  18803. '\\': '\\',
  18804. "'": "'",
  18805. '\n': 'n',
  18806. '\r': 'r',
  18807. '\u2028': 'u2028',
  18808. '\u2029': 'u2029'
  18809. };
  18810. /** Built-in method references without a dependency on `root`. */
  18811. var freeParseFloat = parseFloat,
  18812. freeParseInt = parseInt;
  18813. /** Detect free variable `global` from Node.js. */
  18814. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  18815. /** Detect free variable `self`. */
  18816. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  18817. /** Used as a reference to the global object. */
  18818. var root = freeGlobal || freeSelf || Function('return this')();
  18819. /** Detect free variable `exports`. */
  18820. var freeExports = true && exports && !exports.nodeType && exports;
  18821. /** Detect free variable `module`. */
  18822. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  18823. /** Detect the popular CommonJS extension `module.exports`. */
  18824. var moduleExports = freeModule && freeModule.exports === freeExports;
  18825. /** Detect free variable `process` from Node.js. */
  18826. var freeProcess = moduleExports && freeGlobal.process;
  18827. /** Used to access faster Node.js helpers. */
  18828. var nodeUtil = (function() {
  18829. try {
  18830. // Use `util.types` for Node.js 10+.
  18831. var types = freeModule && freeModule.require && freeModule.require('util').types;
  18832. if (types) {
  18833. return types;
  18834. }
  18835. // Legacy `process.binding('util')` for Node.js < 10.
  18836. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  18837. } catch (e) {}
  18838. }());
  18839. /* Node.js helper references. */
  18840. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  18841. nodeIsDate = nodeUtil && nodeUtil.isDate,
  18842. nodeIsMap = nodeUtil && nodeUtil.isMap,
  18843. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  18844. nodeIsSet = nodeUtil && nodeUtil.isSet,
  18845. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  18846. /*--------------------------------------------------------------------------*/
  18847. /**
  18848. * A faster alternative to `Function#apply`, this function invokes `func`
  18849. * with the `this` binding of `thisArg` and the arguments of `args`.
  18850. *
  18851. * @private
  18852. * @param {Function} func The function to invoke.
  18853. * @param {*} thisArg The `this` binding of `func`.
  18854. * @param {Array} args The arguments to invoke `func` with.
  18855. * @returns {*} Returns the result of `func`.
  18856. */
  18857. function apply(func, thisArg, args) {
  18858. switch (args.length) {
  18859. case 0: return func.call(thisArg);
  18860. case 1: return func.call(thisArg, args[0]);
  18861. case 2: return func.call(thisArg, args[0], args[1]);
  18862. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  18863. }
  18864. return func.apply(thisArg, args);
  18865. }
  18866. /**
  18867. * A specialized version of `baseAggregator` for arrays.
  18868. *
  18869. * @private
  18870. * @param {Array} [array] The array to iterate over.
  18871. * @param {Function} setter The function to set `accumulator` values.
  18872. * @param {Function} iteratee The iteratee to transform keys.
  18873. * @param {Object} accumulator The initial aggregated object.
  18874. * @returns {Function} Returns `accumulator`.
  18875. */
  18876. function arrayAggregator(array, setter, iteratee, accumulator) {
  18877. var index = -1,
  18878. length = array == null ? 0 : array.length;
  18879. while (++index < length) {
  18880. var value = array[index];
  18881. setter(accumulator, value, iteratee(value), array);
  18882. }
  18883. return accumulator;
  18884. }
  18885. /**
  18886. * A specialized version of `_.forEach` for arrays without support for
  18887. * iteratee shorthands.
  18888. *
  18889. * @private
  18890. * @param {Array} [array] The array to iterate over.
  18891. * @param {Function} iteratee The function invoked per iteration.
  18892. * @returns {Array} Returns `array`.
  18893. */
  18894. function arrayEach(array, iteratee) {
  18895. var index = -1,
  18896. length = array == null ? 0 : array.length;
  18897. while (++index < length) {
  18898. if (iteratee(array[index], index, array) === false) {
  18899. break;
  18900. }
  18901. }
  18902. return array;
  18903. }
  18904. /**
  18905. * A specialized version of `_.forEachRight` for arrays without support for
  18906. * iteratee shorthands.
  18907. *
  18908. * @private
  18909. * @param {Array} [array] The array to iterate over.
  18910. * @param {Function} iteratee The function invoked per iteration.
  18911. * @returns {Array} Returns `array`.
  18912. */
  18913. function arrayEachRight(array, iteratee) {
  18914. var length = array == null ? 0 : array.length;
  18915. while (length--) {
  18916. if (iteratee(array[length], length, array) === false) {
  18917. break;
  18918. }
  18919. }
  18920. return array;
  18921. }
  18922. /**
  18923. * A specialized version of `_.every` for arrays without support for
  18924. * iteratee shorthands.
  18925. *
  18926. * @private
  18927. * @param {Array} [array] The array to iterate over.
  18928. * @param {Function} predicate The function invoked per iteration.
  18929. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  18930. * else `false`.
  18931. */
  18932. function arrayEvery(array, predicate) {
  18933. var index = -1,
  18934. length = array == null ? 0 : array.length;
  18935. while (++index < length) {
  18936. if (!predicate(array[index], index, array)) {
  18937. return false;
  18938. }
  18939. }
  18940. return true;
  18941. }
  18942. /**
  18943. * A specialized version of `_.filter` for arrays without support for
  18944. * iteratee shorthands.
  18945. *
  18946. * @private
  18947. * @param {Array} [array] The array to iterate over.
  18948. * @param {Function} predicate The function invoked per iteration.
  18949. * @returns {Array} Returns the new filtered array.
  18950. */
  18951. function arrayFilter(array, predicate) {
  18952. var index = -1,
  18953. length = array == null ? 0 : array.length,
  18954. resIndex = 0,
  18955. result = [];
  18956. while (++index < length) {
  18957. var value = array[index];
  18958. if (predicate(value, index, array)) {
  18959. result[resIndex++] = value;
  18960. }
  18961. }
  18962. return result;
  18963. }
  18964. /**
  18965. * A specialized version of `_.includes` for arrays without support for
  18966. * specifying an index to search from.
  18967. *
  18968. * @private
  18969. * @param {Array} [array] The array to inspect.
  18970. * @param {*} target The value to search for.
  18971. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  18972. */
  18973. function arrayIncludes(array, value) {
  18974. var length = array == null ? 0 : array.length;
  18975. return !!length && baseIndexOf(array, value, 0) > -1;
  18976. }
  18977. /**
  18978. * This function is like `arrayIncludes` except that it accepts a comparator.
  18979. *
  18980. * @private
  18981. * @param {Array} [array] The array to inspect.
  18982. * @param {*} target The value to search for.
  18983. * @param {Function} comparator The comparator invoked per element.
  18984. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  18985. */
  18986. function arrayIncludesWith(array, value, comparator) {
  18987. var index = -1,
  18988. length = array == null ? 0 : array.length;
  18989. while (++index < length) {
  18990. if (comparator(value, array[index])) {
  18991. return true;
  18992. }
  18993. }
  18994. return false;
  18995. }
  18996. /**
  18997. * A specialized version of `_.map` for arrays without support for iteratee
  18998. * shorthands.
  18999. *
  19000. * @private
  19001. * @param {Array} [array] The array to iterate over.
  19002. * @param {Function} iteratee The function invoked per iteration.
  19003. * @returns {Array} Returns the new mapped array.
  19004. */
  19005. function arrayMap(array, iteratee) {
  19006. var index = -1,
  19007. length = array == null ? 0 : array.length,
  19008. result = Array(length);
  19009. while (++index < length) {
  19010. result[index] = iteratee(array[index], index, array);
  19011. }
  19012. return result;
  19013. }
  19014. /**
  19015. * Appends the elements of `values` to `array`.
  19016. *
  19017. * @private
  19018. * @param {Array} array The array to modify.
  19019. * @param {Array} values The values to append.
  19020. * @returns {Array} Returns `array`.
  19021. */
  19022. function arrayPush(array, values) {
  19023. var index = -1,
  19024. length = values.length,
  19025. offset = array.length;
  19026. while (++index < length) {
  19027. array[offset + index] = values[index];
  19028. }
  19029. return array;
  19030. }
  19031. /**
  19032. * A specialized version of `_.reduce` for arrays without support for
  19033. * iteratee shorthands.
  19034. *
  19035. * @private
  19036. * @param {Array} [array] The array to iterate over.
  19037. * @param {Function} iteratee The function invoked per iteration.
  19038. * @param {*} [accumulator] The initial value.
  19039. * @param {boolean} [initAccum] Specify using the first element of `array` as
  19040. * the initial value.
  19041. * @returns {*} Returns the accumulated value.
  19042. */
  19043. function arrayReduce(array, iteratee, accumulator, initAccum) {
  19044. var index = -1,
  19045. length = array == null ? 0 : array.length;
  19046. if (initAccum && length) {
  19047. accumulator = array[++index];
  19048. }
  19049. while (++index < length) {
  19050. accumulator = iteratee(accumulator, array[index], index, array);
  19051. }
  19052. return accumulator;
  19053. }
  19054. /**
  19055. * A specialized version of `_.reduceRight` for arrays without support for
  19056. * iteratee shorthands.
  19057. *
  19058. * @private
  19059. * @param {Array} [array] The array to iterate over.
  19060. * @param {Function} iteratee The function invoked per iteration.
  19061. * @param {*} [accumulator] The initial value.
  19062. * @param {boolean} [initAccum] Specify using the last element of `array` as
  19063. * the initial value.
  19064. * @returns {*} Returns the accumulated value.
  19065. */
  19066. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  19067. var length = array == null ? 0 : array.length;
  19068. if (initAccum && length) {
  19069. accumulator = array[--length];
  19070. }
  19071. while (length--) {
  19072. accumulator = iteratee(accumulator, array[length], length, array);
  19073. }
  19074. return accumulator;
  19075. }
  19076. /**
  19077. * A specialized version of `_.some` for arrays without support for iteratee
  19078. * shorthands.
  19079. *
  19080. * @private
  19081. * @param {Array} [array] The array to iterate over.
  19082. * @param {Function} predicate The function invoked per iteration.
  19083. * @returns {boolean} Returns `true` if any element passes the predicate check,
  19084. * else `false`.
  19085. */
  19086. function arraySome(array, predicate) {
  19087. var index = -1,
  19088. length = array == null ? 0 : array.length;
  19089. while (++index < length) {
  19090. if (predicate(array[index], index, array)) {
  19091. return true;
  19092. }
  19093. }
  19094. return false;
  19095. }
  19096. /**
  19097. * Gets the size of an ASCII `string`.
  19098. *
  19099. * @private
  19100. * @param {string} string The string inspect.
  19101. * @returns {number} Returns the string size.
  19102. */
  19103. var asciiSize = baseProperty('length');
  19104. /**
  19105. * Converts an ASCII `string` to an array.
  19106. *
  19107. * @private
  19108. * @param {string} string The string to convert.
  19109. * @returns {Array} Returns the converted array.
  19110. */
  19111. function asciiToArray(string) {
  19112. return string.split('');
  19113. }
  19114. /**
  19115. * Splits an ASCII `string` into an array of its words.
  19116. *
  19117. * @private
  19118. * @param {string} The string to inspect.
  19119. * @returns {Array} Returns the words of `string`.
  19120. */
  19121. function asciiWords(string) {
  19122. return string.match(reAsciiWord) || [];
  19123. }
  19124. /**
  19125. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  19126. * without support for iteratee shorthands, which iterates over `collection`
  19127. * using `eachFunc`.
  19128. *
  19129. * @private
  19130. * @param {Array|Object} collection The collection to inspect.
  19131. * @param {Function} predicate The function invoked per iteration.
  19132. * @param {Function} eachFunc The function to iterate over `collection`.
  19133. * @returns {*} Returns the found element or its key, else `undefined`.
  19134. */
  19135. function baseFindKey(collection, predicate, eachFunc) {
  19136. var result;
  19137. eachFunc(collection, function(value, key, collection) {
  19138. if (predicate(value, key, collection)) {
  19139. result = key;
  19140. return false;
  19141. }
  19142. });
  19143. return result;
  19144. }
  19145. /**
  19146. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  19147. * support for iteratee shorthands.
  19148. *
  19149. * @private
  19150. * @param {Array} array The array to inspect.
  19151. * @param {Function} predicate The function invoked per iteration.
  19152. * @param {number} fromIndex The index to search from.
  19153. * @param {boolean} [fromRight] Specify iterating from right to left.
  19154. * @returns {number} Returns the index of the matched value, else `-1`.
  19155. */
  19156. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  19157. var length = array.length,
  19158. index = fromIndex + (fromRight ? 1 : -1);
  19159. while ((fromRight ? index-- : ++index < length)) {
  19160. if (predicate(array[index], index, array)) {
  19161. return index;
  19162. }
  19163. }
  19164. return -1;
  19165. }
  19166. /**
  19167. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  19168. *
  19169. * @private
  19170. * @param {Array} array The array to inspect.
  19171. * @param {*} value The value to search for.
  19172. * @param {number} fromIndex The index to search from.
  19173. * @returns {number} Returns the index of the matched value, else `-1`.
  19174. */
  19175. function baseIndexOf(array, value, fromIndex) {
  19176. return value === value
  19177. ? strictIndexOf(array, value, fromIndex)
  19178. : baseFindIndex(array, baseIsNaN, fromIndex);
  19179. }
  19180. /**
  19181. * This function is like `baseIndexOf` except that it accepts a comparator.
  19182. *
  19183. * @private
  19184. * @param {Array} array The array to inspect.
  19185. * @param {*} value The value to search for.
  19186. * @param {number} fromIndex The index to search from.
  19187. * @param {Function} comparator The comparator invoked per element.
  19188. * @returns {number} Returns the index of the matched value, else `-1`.
  19189. */
  19190. function baseIndexOfWith(array, value, fromIndex, comparator) {
  19191. var index = fromIndex - 1,
  19192. length = array.length;
  19193. while (++index < length) {
  19194. if (comparator(array[index], value)) {
  19195. return index;
  19196. }
  19197. }
  19198. return -1;
  19199. }
  19200. /**
  19201. * The base implementation of `_.isNaN` without support for number objects.
  19202. *
  19203. * @private
  19204. * @param {*} value The value to check.
  19205. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  19206. */
  19207. function baseIsNaN(value) {
  19208. return value !== value;
  19209. }
  19210. /**
  19211. * The base implementation of `_.mean` and `_.meanBy` without support for
  19212. * iteratee shorthands.
  19213. *
  19214. * @private
  19215. * @param {Array} array The array to iterate over.
  19216. * @param {Function} iteratee The function invoked per iteration.
  19217. * @returns {number} Returns the mean.
  19218. */
  19219. function baseMean(array, iteratee) {
  19220. var length = array == null ? 0 : array.length;
  19221. return length ? (baseSum(array, iteratee) / length) : NAN;
  19222. }
  19223. /**
  19224. * The base implementation of `_.property` without support for deep paths.
  19225. *
  19226. * @private
  19227. * @param {string} key The key of the property to get.
  19228. * @returns {Function} Returns the new accessor function.
  19229. */
  19230. function baseProperty(key) {
  19231. return function(object) {
  19232. return object == null ? undefined : object[key];
  19233. };
  19234. }
  19235. /**
  19236. * The base implementation of `_.propertyOf` without support for deep paths.
  19237. *
  19238. * @private
  19239. * @param {Object} object The object to query.
  19240. * @returns {Function} Returns the new accessor function.
  19241. */
  19242. function basePropertyOf(object) {
  19243. return function(key) {
  19244. return object == null ? undefined : object[key];
  19245. };
  19246. }
  19247. /**
  19248. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  19249. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  19250. *
  19251. * @private
  19252. * @param {Array|Object} collection The collection to iterate over.
  19253. * @param {Function} iteratee The function invoked per iteration.
  19254. * @param {*} accumulator The initial value.
  19255. * @param {boolean} initAccum Specify using the first or last element of
  19256. * `collection` as the initial value.
  19257. * @param {Function} eachFunc The function to iterate over `collection`.
  19258. * @returns {*} Returns the accumulated value.
  19259. */
  19260. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  19261. eachFunc(collection, function(value, index, collection) {
  19262. accumulator = initAccum
  19263. ? (initAccum = false, value)
  19264. : iteratee(accumulator, value, index, collection);
  19265. });
  19266. return accumulator;
  19267. }
  19268. /**
  19269. * The base implementation of `_.sortBy` which uses `comparer` to define the
  19270. * sort order of `array` and replaces criteria objects with their corresponding
  19271. * values.
  19272. *
  19273. * @private
  19274. * @param {Array} array The array to sort.
  19275. * @param {Function} comparer The function to define sort order.
  19276. * @returns {Array} Returns `array`.
  19277. */
  19278. function baseSortBy(array, comparer) {
  19279. var length = array.length;
  19280. array.sort(comparer);
  19281. while (length--) {
  19282. array[length] = array[length].value;
  19283. }
  19284. return array;
  19285. }
  19286. /**
  19287. * The base implementation of `_.sum` and `_.sumBy` without support for
  19288. * iteratee shorthands.
  19289. *
  19290. * @private
  19291. * @param {Array} array The array to iterate over.
  19292. * @param {Function} iteratee The function invoked per iteration.
  19293. * @returns {number} Returns the sum.
  19294. */
  19295. function baseSum(array, iteratee) {
  19296. var result,
  19297. index = -1,
  19298. length = array.length;
  19299. while (++index < length) {
  19300. var current = iteratee(array[index]);
  19301. if (current !== undefined) {
  19302. result = result === undefined ? current : (result + current);
  19303. }
  19304. }
  19305. return result;
  19306. }
  19307. /**
  19308. * The base implementation of `_.times` without support for iteratee shorthands
  19309. * or max array length checks.
  19310. *
  19311. * @private
  19312. * @param {number} n The number of times to invoke `iteratee`.
  19313. * @param {Function} iteratee The function invoked per iteration.
  19314. * @returns {Array} Returns the array of results.
  19315. */
  19316. function baseTimes(n, iteratee) {
  19317. var index = -1,
  19318. result = Array(n);
  19319. while (++index < n) {
  19320. result[index] = iteratee(index);
  19321. }
  19322. return result;
  19323. }
  19324. /**
  19325. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  19326. * of key-value pairs for `object` corresponding to the property names of `props`.
  19327. *
  19328. * @private
  19329. * @param {Object} object The object to query.
  19330. * @param {Array} props The property names to get values for.
  19331. * @returns {Object} Returns the key-value pairs.
  19332. */
  19333. function baseToPairs(object, props) {
  19334. return arrayMap(props, function(key) {
  19335. return [key, object[key]];
  19336. });
  19337. }
  19338. /**
  19339. * The base implementation of `_.unary` without support for storing metadata.
  19340. *
  19341. * @private
  19342. * @param {Function} func The function to cap arguments for.
  19343. * @returns {Function} Returns the new capped function.
  19344. */
  19345. function baseUnary(func) {
  19346. return function(value) {
  19347. return func(value);
  19348. };
  19349. }
  19350. /**
  19351. * The base implementation of `_.values` and `_.valuesIn` which creates an
  19352. * array of `object` property values corresponding to the property names
  19353. * of `props`.
  19354. *
  19355. * @private
  19356. * @param {Object} object The object to query.
  19357. * @param {Array} props The property names to get values for.
  19358. * @returns {Object} Returns the array of property values.
  19359. */
  19360. function baseValues(object, props) {
  19361. return arrayMap(props, function(key) {
  19362. return object[key];
  19363. });
  19364. }
  19365. /**
  19366. * Checks if a `cache` value for `key` exists.
  19367. *
  19368. * @private
  19369. * @param {Object} cache The cache to query.
  19370. * @param {string} key The key of the entry to check.
  19371. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  19372. */
  19373. function cacheHas(cache, key) {
  19374. return cache.has(key);
  19375. }
  19376. /**
  19377. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  19378. * that is not found in the character symbols.
  19379. *
  19380. * @private
  19381. * @param {Array} strSymbols The string symbols to inspect.
  19382. * @param {Array} chrSymbols The character symbols to find.
  19383. * @returns {number} Returns the index of the first unmatched string symbol.
  19384. */
  19385. function charsStartIndex(strSymbols, chrSymbols) {
  19386. var index = -1,
  19387. length = strSymbols.length;
  19388. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  19389. return index;
  19390. }
  19391. /**
  19392. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  19393. * that is not found in the character symbols.
  19394. *
  19395. * @private
  19396. * @param {Array} strSymbols The string symbols to inspect.
  19397. * @param {Array} chrSymbols The character symbols to find.
  19398. * @returns {number} Returns the index of the last unmatched string symbol.
  19399. */
  19400. function charsEndIndex(strSymbols, chrSymbols) {
  19401. var index = strSymbols.length;
  19402. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  19403. return index;
  19404. }
  19405. /**
  19406. * Gets the number of `placeholder` occurrences in `array`.
  19407. *
  19408. * @private
  19409. * @param {Array} array The array to inspect.
  19410. * @param {*} placeholder The placeholder to search for.
  19411. * @returns {number} Returns the placeholder count.
  19412. */
  19413. function countHolders(array, placeholder) {
  19414. var length = array.length,
  19415. result = 0;
  19416. while (length--) {
  19417. if (array[length] === placeholder) {
  19418. ++result;
  19419. }
  19420. }
  19421. return result;
  19422. }
  19423. /**
  19424. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  19425. * letters to basic Latin letters.
  19426. *
  19427. * @private
  19428. * @param {string} letter The matched letter to deburr.
  19429. * @returns {string} Returns the deburred letter.
  19430. */
  19431. var deburrLetter = basePropertyOf(deburredLetters);
  19432. /**
  19433. * Used by `_.escape` to convert characters to HTML entities.
  19434. *
  19435. * @private
  19436. * @param {string} chr The matched character to escape.
  19437. * @returns {string} Returns the escaped character.
  19438. */
  19439. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  19440. /**
  19441. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  19442. *
  19443. * @private
  19444. * @param {string} chr The matched character to escape.
  19445. * @returns {string} Returns the escaped character.
  19446. */
  19447. function escapeStringChar(chr) {
  19448. return '\\' + stringEscapes[chr];
  19449. }
  19450. /**
  19451. * Gets the value at `key` of `object`.
  19452. *
  19453. * @private
  19454. * @param {Object} [object] The object to query.
  19455. * @param {string} key The key of the property to get.
  19456. * @returns {*} Returns the property value.
  19457. */
  19458. function getValue(object, key) {
  19459. return object == null ? undefined : object[key];
  19460. }
  19461. /**
  19462. * Checks if `string` contains Unicode symbols.
  19463. *
  19464. * @private
  19465. * @param {string} string The string to inspect.
  19466. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  19467. */
  19468. function hasUnicode(string) {
  19469. return reHasUnicode.test(string);
  19470. }
  19471. /**
  19472. * Checks if `string` contains a word composed of Unicode symbols.
  19473. *
  19474. * @private
  19475. * @param {string} string The string to inspect.
  19476. * @returns {boolean} Returns `true` if a word is found, else `false`.
  19477. */
  19478. function hasUnicodeWord(string) {
  19479. return reHasUnicodeWord.test(string);
  19480. }
  19481. /**
  19482. * Converts `iterator` to an array.
  19483. *
  19484. * @private
  19485. * @param {Object} iterator The iterator to convert.
  19486. * @returns {Array} Returns the converted array.
  19487. */
  19488. function iteratorToArray(iterator) {
  19489. var data,
  19490. result = [];
  19491. while (!(data = iterator.next()).done) {
  19492. result.push(data.value);
  19493. }
  19494. return result;
  19495. }
  19496. /**
  19497. * Converts `map` to its key-value pairs.
  19498. *
  19499. * @private
  19500. * @param {Object} map The map to convert.
  19501. * @returns {Array} Returns the key-value pairs.
  19502. */
  19503. function mapToArray(map) {
  19504. var index = -1,
  19505. result = Array(map.size);
  19506. map.forEach(function(value, key) {
  19507. result[++index] = [key, value];
  19508. });
  19509. return result;
  19510. }
  19511. /**
  19512. * Creates a unary function that invokes `func` with its argument transformed.
  19513. *
  19514. * @private
  19515. * @param {Function} func The function to wrap.
  19516. * @param {Function} transform The argument transform.
  19517. * @returns {Function} Returns the new function.
  19518. */
  19519. function overArg(func, transform) {
  19520. return function(arg) {
  19521. return func(transform(arg));
  19522. };
  19523. }
  19524. /**
  19525. * Replaces all `placeholder` elements in `array` with an internal placeholder
  19526. * and returns an array of their indexes.
  19527. *
  19528. * @private
  19529. * @param {Array} array The array to modify.
  19530. * @param {*} placeholder The placeholder to replace.
  19531. * @returns {Array} Returns the new array of placeholder indexes.
  19532. */
  19533. function replaceHolders(array, placeholder) {
  19534. var index = -1,
  19535. length = array.length,
  19536. resIndex = 0,
  19537. result = [];
  19538. while (++index < length) {
  19539. var value = array[index];
  19540. if (value === placeholder || value === PLACEHOLDER) {
  19541. array[index] = PLACEHOLDER;
  19542. result[resIndex++] = index;
  19543. }
  19544. }
  19545. return result;
  19546. }
  19547. /**
  19548. * Converts `set` to an array of its values.
  19549. *
  19550. * @private
  19551. * @param {Object} set The set to convert.
  19552. * @returns {Array} Returns the values.
  19553. */
  19554. function setToArray(set) {
  19555. var index = -1,
  19556. result = Array(set.size);
  19557. set.forEach(function(value) {
  19558. result[++index] = value;
  19559. });
  19560. return result;
  19561. }
  19562. /**
  19563. * Converts `set` to its value-value pairs.
  19564. *
  19565. * @private
  19566. * @param {Object} set The set to convert.
  19567. * @returns {Array} Returns the value-value pairs.
  19568. */
  19569. function setToPairs(set) {
  19570. var index = -1,
  19571. result = Array(set.size);
  19572. set.forEach(function(value) {
  19573. result[++index] = [value, value];
  19574. });
  19575. return result;
  19576. }
  19577. /**
  19578. * A specialized version of `_.indexOf` which performs strict equality
  19579. * comparisons of values, i.e. `===`.
  19580. *
  19581. * @private
  19582. * @param {Array} array The array to inspect.
  19583. * @param {*} value The value to search for.
  19584. * @param {number} fromIndex The index to search from.
  19585. * @returns {number} Returns the index of the matched value, else `-1`.
  19586. */
  19587. function strictIndexOf(array, value, fromIndex) {
  19588. var index = fromIndex - 1,
  19589. length = array.length;
  19590. while (++index < length) {
  19591. if (array[index] === value) {
  19592. return index;
  19593. }
  19594. }
  19595. return -1;
  19596. }
  19597. /**
  19598. * A specialized version of `_.lastIndexOf` which performs strict equality
  19599. * comparisons of values, i.e. `===`.
  19600. *
  19601. * @private
  19602. * @param {Array} array The array to inspect.
  19603. * @param {*} value The value to search for.
  19604. * @param {number} fromIndex The index to search from.
  19605. * @returns {number} Returns the index of the matched value, else `-1`.
  19606. */
  19607. function strictLastIndexOf(array, value, fromIndex) {
  19608. var index = fromIndex + 1;
  19609. while (index--) {
  19610. if (array[index] === value) {
  19611. return index;
  19612. }
  19613. }
  19614. return index;
  19615. }
  19616. /**
  19617. * Gets the number of symbols in `string`.
  19618. *
  19619. * @private
  19620. * @param {string} string The string to inspect.
  19621. * @returns {number} Returns the string size.
  19622. */
  19623. function stringSize(string) {
  19624. return hasUnicode(string)
  19625. ? unicodeSize(string)
  19626. : asciiSize(string);
  19627. }
  19628. /**
  19629. * Converts `string` to an array.
  19630. *
  19631. * @private
  19632. * @param {string} string The string to convert.
  19633. * @returns {Array} Returns the converted array.
  19634. */
  19635. function stringToArray(string) {
  19636. return hasUnicode(string)
  19637. ? unicodeToArray(string)
  19638. : asciiToArray(string);
  19639. }
  19640. /**
  19641. * Used by `_.unescape` to convert HTML entities to characters.
  19642. *
  19643. * @private
  19644. * @param {string} chr The matched character to unescape.
  19645. * @returns {string} Returns the unescaped character.
  19646. */
  19647. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  19648. /**
  19649. * Gets the size of a Unicode `string`.
  19650. *
  19651. * @private
  19652. * @param {string} string The string inspect.
  19653. * @returns {number} Returns the string size.
  19654. */
  19655. function unicodeSize(string) {
  19656. var result = reUnicode.lastIndex = 0;
  19657. while (reUnicode.test(string)) {
  19658. ++result;
  19659. }
  19660. return result;
  19661. }
  19662. /**
  19663. * Converts a Unicode `string` to an array.
  19664. *
  19665. * @private
  19666. * @param {string} string The string to convert.
  19667. * @returns {Array} Returns the converted array.
  19668. */
  19669. function unicodeToArray(string) {
  19670. return string.match(reUnicode) || [];
  19671. }
  19672. /**
  19673. * Splits a Unicode `string` into an array of its words.
  19674. *
  19675. * @private
  19676. * @param {string} The string to inspect.
  19677. * @returns {Array} Returns the words of `string`.
  19678. */
  19679. function unicodeWords(string) {
  19680. return string.match(reUnicodeWord) || [];
  19681. }
  19682. /*--------------------------------------------------------------------------*/
  19683. /**
  19684. * Create a new pristine `lodash` function using the `context` object.
  19685. *
  19686. * @static
  19687. * @memberOf _
  19688. * @since 1.1.0
  19689. * @category Util
  19690. * @param {Object} [context=root] The context object.
  19691. * @returns {Function} Returns a new `lodash` function.
  19692. * @example
  19693. *
  19694. * _.mixin({ 'foo': _.constant('foo') });
  19695. *
  19696. * var lodash = _.runInContext();
  19697. * lodash.mixin({ 'bar': lodash.constant('bar') });
  19698. *
  19699. * _.isFunction(_.foo);
  19700. * // => true
  19701. * _.isFunction(_.bar);
  19702. * // => false
  19703. *
  19704. * lodash.isFunction(lodash.foo);
  19705. * // => false
  19706. * lodash.isFunction(lodash.bar);
  19707. * // => true
  19708. *
  19709. * // Create a suped-up `defer` in Node.js.
  19710. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  19711. */
  19712. var runInContext = (function runInContext(context) {
  19713. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  19714. /** Built-in constructor references. */
  19715. var Array = context.Array,
  19716. Date = context.Date,
  19717. Error = context.Error,
  19718. Function = context.Function,
  19719. Math = context.Math,
  19720. Object = context.Object,
  19721. RegExp = context.RegExp,
  19722. String = context.String,
  19723. TypeError = context.TypeError;
  19724. /** Used for built-in method references. */
  19725. var arrayProto = Array.prototype,
  19726. funcProto = Function.prototype,
  19727. objectProto = Object.prototype;
  19728. /** Used to detect overreaching core-js shims. */
  19729. var coreJsData = context['__core-js_shared__'];
  19730. /** Used to resolve the decompiled source of functions. */
  19731. var funcToString = funcProto.toString;
  19732. /** Used to check objects for own properties. */
  19733. var hasOwnProperty = objectProto.hasOwnProperty;
  19734. /** Used to generate unique IDs. */
  19735. var idCounter = 0;
  19736. /** Used to detect methods masquerading as native. */
  19737. var maskSrcKey = (function() {
  19738. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  19739. return uid ? ('Symbol(src)_1.' + uid) : '';
  19740. }());
  19741. /**
  19742. * Used to resolve the
  19743. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  19744. * of values.
  19745. */
  19746. var nativeObjectToString = objectProto.toString;
  19747. /** Used to infer the `Object` constructor. */
  19748. var objectCtorString = funcToString.call(Object);
  19749. /** Used to restore the original `_` reference in `_.noConflict`. */
  19750. var oldDash = root._;
  19751. /** Used to detect if a method is native. */
  19752. var reIsNative = RegExp('^' +
  19753. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  19754. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  19755. );
  19756. /** Built-in value references. */
  19757. var Buffer = moduleExports ? context.Buffer : undefined,
  19758. Symbol = context.Symbol,
  19759. Uint8Array = context.Uint8Array,
  19760. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  19761. getPrototype = overArg(Object.getPrototypeOf, Object),
  19762. objectCreate = Object.create,
  19763. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  19764. splice = arrayProto.splice,
  19765. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  19766. symIterator = Symbol ? Symbol.iterator : undefined,
  19767. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  19768. var defineProperty = (function() {
  19769. try {
  19770. var func = getNative(Object, 'defineProperty');
  19771. func({}, '', {});
  19772. return func;
  19773. } catch (e) {}
  19774. }());
  19775. /** Mocked built-ins. */
  19776. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  19777. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  19778. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  19779. /* Built-in method references for those with the same name as other `lodash` methods. */
  19780. var nativeCeil = Math.ceil,
  19781. nativeFloor = Math.floor,
  19782. nativeGetSymbols = Object.getOwnPropertySymbols,
  19783. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  19784. nativeIsFinite = context.isFinite,
  19785. nativeJoin = arrayProto.join,
  19786. nativeKeys = overArg(Object.keys, Object),
  19787. nativeMax = Math.max,
  19788. nativeMin = Math.min,
  19789. nativeNow = Date.now,
  19790. nativeParseInt = context.parseInt,
  19791. nativeRandom = Math.random,
  19792. nativeReverse = arrayProto.reverse;
  19793. /* Built-in method references that are verified to be native. */
  19794. var DataView = getNative(context, 'DataView'),
  19795. Map = getNative(context, 'Map'),
  19796. Promise = getNative(context, 'Promise'),
  19797. Set = getNative(context, 'Set'),
  19798. WeakMap = getNative(context, 'WeakMap'),
  19799. nativeCreate = getNative(Object, 'create');
  19800. /** Used to store function metadata. */
  19801. var metaMap = WeakMap && new WeakMap;
  19802. /** Used to lookup unminified function names. */
  19803. var realNames = {};
  19804. /** Used to detect maps, sets, and weakmaps. */
  19805. var dataViewCtorString = toSource(DataView),
  19806. mapCtorString = toSource(Map),
  19807. promiseCtorString = toSource(Promise),
  19808. setCtorString = toSource(Set),
  19809. weakMapCtorString = toSource(WeakMap);
  19810. /** Used to convert symbols to primitives and strings. */
  19811. var symbolProto = Symbol ? Symbol.prototype : undefined,
  19812. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  19813. symbolToString = symbolProto ? symbolProto.toString : undefined;
  19814. /*------------------------------------------------------------------------*/
  19815. /**
  19816. * Creates a `lodash` object which wraps `value` to enable implicit method
  19817. * chain sequences. Methods that operate on and return arrays, collections,
  19818. * and functions can be chained together. Methods that retrieve a single value
  19819. * or may return a primitive value will automatically end the chain sequence
  19820. * and return the unwrapped value. Otherwise, the value must be unwrapped
  19821. * with `_#value`.
  19822. *
  19823. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  19824. * enabled using `_.chain`.
  19825. *
  19826. * The execution of chained methods is lazy, that is, it's deferred until
  19827. * `_#value` is implicitly or explicitly called.
  19828. *
  19829. * Lazy evaluation allows several methods to support shortcut fusion.
  19830. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  19831. * the creation of intermediate arrays and can greatly reduce the number of
  19832. * iteratee executions. Sections of a chain sequence qualify for shortcut
  19833. * fusion if the section is applied to an array and iteratees accept only
  19834. * one argument. The heuristic for whether a section qualifies for shortcut
  19835. * fusion is subject to change.
  19836. *
  19837. * Chaining is supported in custom builds as long as the `_#value` method is
  19838. * directly or indirectly included in the build.
  19839. *
  19840. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  19841. *
  19842. * The wrapper `Array` methods are:
  19843. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  19844. *
  19845. * The wrapper `String` methods are:
  19846. * `replace` and `split`
  19847. *
  19848. * The wrapper methods that support shortcut fusion are:
  19849. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  19850. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  19851. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  19852. *
  19853. * The chainable wrapper methods are:
  19854. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  19855. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  19856. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  19857. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  19858. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  19859. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  19860. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  19861. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  19862. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  19863. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  19864. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  19865. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  19866. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  19867. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  19868. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  19869. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  19870. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  19871. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  19872. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  19873. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  19874. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  19875. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  19876. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  19877. * `zipObject`, `zipObjectDeep`, and `zipWith`
  19878. *
  19879. * The wrapper methods that are **not** chainable by default are:
  19880. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  19881. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  19882. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  19883. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  19884. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  19885. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  19886. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  19887. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  19888. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  19889. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  19890. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  19891. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  19892. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  19893. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  19894. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  19895. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  19896. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  19897. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  19898. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  19899. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  19900. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  19901. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  19902. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  19903. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  19904. * `upperFirst`, `value`, and `words`
  19905. *
  19906. * @name _
  19907. * @constructor
  19908. * @category Seq
  19909. * @param {*} value The value to wrap in a `lodash` instance.
  19910. * @returns {Object} Returns the new `lodash` wrapper instance.
  19911. * @example
  19912. *
  19913. * function square(n) {
  19914. * return n * n;
  19915. * }
  19916. *
  19917. * var wrapped = _([1, 2, 3]);
  19918. *
  19919. * // Returns an unwrapped value.
  19920. * wrapped.reduce(_.add);
  19921. * // => 6
  19922. *
  19923. * // Returns a wrapped value.
  19924. * var squares = wrapped.map(square);
  19925. *
  19926. * _.isArray(squares);
  19927. * // => false
  19928. *
  19929. * _.isArray(squares.value());
  19930. * // => true
  19931. */
  19932. function lodash(value) {
  19933. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  19934. if (value instanceof LodashWrapper) {
  19935. return value;
  19936. }
  19937. if (hasOwnProperty.call(value, '__wrapped__')) {
  19938. return wrapperClone(value);
  19939. }
  19940. }
  19941. return new LodashWrapper(value);
  19942. }
  19943. /**
  19944. * The base implementation of `_.create` without support for assigning
  19945. * properties to the created object.
  19946. *
  19947. * @private
  19948. * @param {Object} proto The object to inherit from.
  19949. * @returns {Object} Returns the new object.
  19950. */
  19951. var baseCreate = (function() {
  19952. function object() {}
  19953. return function(proto) {
  19954. if (!isObject(proto)) {
  19955. return {};
  19956. }
  19957. if (objectCreate) {
  19958. return objectCreate(proto);
  19959. }
  19960. object.prototype = proto;
  19961. var result = new object;
  19962. object.prototype = undefined;
  19963. return result;
  19964. };
  19965. }());
  19966. /**
  19967. * The function whose prototype chain sequence wrappers inherit from.
  19968. *
  19969. * @private
  19970. */
  19971. function baseLodash() {
  19972. // No operation performed.
  19973. }
  19974. /**
  19975. * The base constructor for creating `lodash` wrapper objects.
  19976. *
  19977. * @private
  19978. * @param {*} value The value to wrap.
  19979. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  19980. */
  19981. function LodashWrapper(value, chainAll) {
  19982. this.__wrapped__ = value;
  19983. this.__actions__ = [];
  19984. this.__chain__ = !!chainAll;
  19985. this.__index__ = 0;
  19986. this.__values__ = undefined;
  19987. }
  19988. /**
  19989. * By default, the template delimiters used by lodash are like those in
  19990. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  19991. * following template settings to use alternative delimiters.
  19992. *
  19993. * @static
  19994. * @memberOf _
  19995. * @type {Object}
  19996. */
  19997. lodash.templateSettings = {
  19998. /**
  19999. * Used to detect `data` property values to be HTML-escaped.
  20000. *
  20001. * @memberOf _.templateSettings
  20002. * @type {RegExp}
  20003. */
  20004. 'escape': reEscape,
  20005. /**
  20006. * Used to detect code to be evaluated.
  20007. *
  20008. * @memberOf _.templateSettings
  20009. * @type {RegExp}
  20010. */
  20011. 'evaluate': reEvaluate,
  20012. /**
  20013. * Used to detect `data` property values to inject.
  20014. *
  20015. * @memberOf _.templateSettings
  20016. * @type {RegExp}
  20017. */
  20018. 'interpolate': reInterpolate,
  20019. /**
  20020. * Used to reference the data object in the template text.
  20021. *
  20022. * @memberOf _.templateSettings
  20023. * @type {string}
  20024. */
  20025. 'variable': '',
  20026. /**
  20027. * Used to import variables into the compiled template.
  20028. *
  20029. * @memberOf _.templateSettings
  20030. * @type {Object}
  20031. */
  20032. 'imports': {
  20033. /**
  20034. * A reference to the `lodash` function.
  20035. *
  20036. * @memberOf _.templateSettings.imports
  20037. * @type {Function}
  20038. */
  20039. '_': lodash
  20040. }
  20041. };
  20042. // Ensure wrappers are instances of `baseLodash`.
  20043. lodash.prototype = baseLodash.prototype;
  20044. lodash.prototype.constructor = lodash;
  20045. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  20046. LodashWrapper.prototype.constructor = LodashWrapper;
  20047. /*------------------------------------------------------------------------*/
  20048. /**
  20049. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  20050. *
  20051. * @private
  20052. * @constructor
  20053. * @param {*} value The value to wrap.
  20054. */
  20055. function LazyWrapper(value) {
  20056. this.__wrapped__ = value;
  20057. this.__actions__ = [];
  20058. this.__dir__ = 1;
  20059. this.__filtered__ = false;
  20060. this.__iteratees__ = [];
  20061. this.__takeCount__ = MAX_ARRAY_LENGTH;
  20062. this.__views__ = [];
  20063. }
  20064. /**
  20065. * Creates a clone of the lazy wrapper object.
  20066. *
  20067. * @private
  20068. * @name clone
  20069. * @memberOf LazyWrapper
  20070. * @returns {Object} Returns the cloned `LazyWrapper` object.
  20071. */
  20072. function lazyClone() {
  20073. var result = new LazyWrapper(this.__wrapped__);
  20074. result.__actions__ = copyArray(this.__actions__);
  20075. result.__dir__ = this.__dir__;
  20076. result.__filtered__ = this.__filtered__;
  20077. result.__iteratees__ = copyArray(this.__iteratees__);
  20078. result.__takeCount__ = this.__takeCount__;
  20079. result.__views__ = copyArray(this.__views__);
  20080. return result;
  20081. }
  20082. /**
  20083. * Reverses the direction of lazy iteration.
  20084. *
  20085. * @private
  20086. * @name reverse
  20087. * @memberOf LazyWrapper
  20088. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  20089. */
  20090. function lazyReverse() {
  20091. if (this.__filtered__) {
  20092. var result = new LazyWrapper(this);
  20093. result.__dir__ = -1;
  20094. result.__filtered__ = true;
  20095. } else {
  20096. result = this.clone();
  20097. result.__dir__ *= -1;
  20098. }
  20099. return result;
  20100. }
  20101. /**
  20102. * Extracts the unwrapped value from its lazy wrapper.
  20103. *
  20104. * @private
  20105. * @name value
  20106. * @memberOf LazyWrapper
  20107. * @returns {*} Returns the unwrapped value.
  20108. */
  20109. function lazyValue() {
  20110. var array = this.__wrapped__.value(),
  20111. dir = this.__dir__,
  20112. isArr = isArray(array),
  20113. isRight = dir < 0,
  20114. arrLength = isArr ? array.length : 0,
  20115. view = getView(0, arrLength, this.__views__),
  20116. start = view.start,
  20117. end = view.end,
  20118. length = end - start,
  20119. index = isRight ? end : (start - 1),
  20120. iteratees = this.__iteratees__,
  20121. iterLength = iteratees.length,
  20122. resIndex = 0,
  20123. takeCount = nativeMin(length, this.__takeCount__);
  20124. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  20125. return baseWrapperValue(array, this.__actions__);
  20126. }
  20127. var result = [];
  20128. outer:
  20129. while (length-- && resIndex < takeCount) {
  20130. index += dir;
  20131. var iterIndex = -1,
  20132. value = array[index];
  20133. while (++iterIndex < iterLength) {
  20134. var data = iteratees[iterIndex],
  20135. iteratee = data.iteratee,
  20136. type = data.type,
  20137. computed = iteratee(value);
  20138. if (type == LAZY_MAP_FLAG) {
  20139. value = computed;
  20140. } else if (!computed) {
  20141. if (type == LAZY_FILTER_FLAG) {
  20142. continue outer;
  20143. } else {
  20144. break outer;
  20145. }
  20146. }
  20147. }
  20148. result[resIndex++] = value;
  20149. }
  20150. return result;
  20151. }
  20152. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  20153. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  20154. LazyWrapper.prototype.constructor = LazyWrapper;
  20155. /*------------------------------------------------------------------------*/
  20156. /**
  20157. * Creates a hash object.
  20158. *
  20159. * @private
  20160. * @constructor
  20161. * @param {Array} [entries] The key-value pairs to cache.
  20162. */
  20163. function Hash(entries) {
  20164. var index = -1,
  20165. length = entries == null ? 0 : entries.length;
  20166. this.clear();
  20167. while (++index < length) {
  20168. var entry = entries[index];
  20169. this.set(entry[0], entry[1]);
  20170. }
  20171. }
  20172. /**
  20173. * Removes all key-value entries from the hash.
  20174. *
  20175. * @private
  20176. * @name clear
  20177. * @memberOf Hash
  20178. */
  20179. function hashClear() {
  20180. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  20181. this.size = 0;
  20182. }
  20183. /**
  20184. * Removes `key` and its value from the hash.
  20185. *
  20186. * @private
  20187. * @name delete
  20188. * @memberOf Hash
  20189. * @param {Object} hash The hash to modify.
  20190. * @param {string} key The key of the value to remove.
  20191. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20192. */
  20193. function hashDelete(key) {
  20194. var result = this.has(key) && delete this.__data__[key];
  20195. this.size -= result ? 1 : 0;
  20196. return result;
  20197. }
  20198. /**
  20199. * Gets the hash value for `key`.
  20200. *
  20201. * @private
  20202. * @name get
  20203. * @memberOf Hash
  20204. * @param {string} key The key of the value to get.
  20205. * @returns {*} Returns the entry value.
  20206. */
  20207. function hashGet(key) {
  20208. var data = this.__data__;
  20209. if (nativeCreate) {
  20210. var result = data[key];
  20211. return result === HASH_UNDEFINED ? undefined : result;
  20212. }
  20213. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  20214. }
  20215. /**
  20216. * Checks if a hash value for `key` exists.
  20217. *
  20218. * @private
  20219. * @name has
  20220. * @memberOf Hash
  20221. * @param {string} key The key of the entry to check.
  20222. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20223. */
  20224. function hashHas(key) {
  20225. var data = this.__data__;
  20226. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  20227. }
  20228. /**
  20229. * Sets the hash `key` to `value`.
  20230. *
  20231. * @private
  20232. * @name set
  20233. * @memberOf Hash
  20234. * @param {string} key The key of the value to set.
  20235. * @param {*} value The value to set.
  20236. * @returns {Object} Returns the hash instance.
  20237. */
  20238. function hashSet(key, value) {
  20239. var data = this.__data__;
  20240. this.size += this.has(key) ? 0 : 1;
  20241. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  20242. return this;
  20243. }
  20244. // Add methods to `Hash`.
  20245. Hash.prototype.clear = hashClear;
  20246. Hash.prototype['delete'] = hashDelete;
  20247. Hash.prototype.get = hashGet;
  20248. Hash.prototype.has = hashHas;
  20249. Hash.prototype.set = hashSet;
  20250. /*------------------------------------------------------------------------*/
  20251. /**
  20252. * Creates an list cache object.
  20253. *
  20254. * @private
  20255. * @constructor
  20256. * @param {Array} [entries] The key-value pairs to cache.
  20257. */
  20258. function ListCache(entries) {
  20259. var index = -1,
  20260. length = entries == null ? 0 : entries.length;
  20261. this.clear();
  20262. while (++index < length) {
  20263. var entry = entries[index];
  20264. this.set(entry[0], entry[1]);
  20265. }
  20266. }
  20267. /**
  20268. * Removes all key-value entries from the list cache.
  20269. *
  20270. * @private
  20271. * @name clear
  20272. * @memberOf ListCache
  20273. */
  20274. function listCacheClear() {
  20275. this.__data__ = [];
  20276. this.size = 0;
  20277. }
  20278. /**
  20279. * Removes `key` and its value from the list cache.
  20280. *
  20281. * @private
  20282. * @name delete
  20283. * @memberOf ListCache
  20284. * @param {string} key The key of the value to remove.
  20285. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20286. */
  20287. function listCacheDelete(key) {
  20288. var data = this.__data__,
  20289. index = assocIndexOf(data, key);
  20290. if (index < 0) {
  20291. return false;
  20292. }
  20293. var lastIndex = data.length - 1;
  20294. if (index == lastIndex) {
  20295. data.pop();
  20296. } else {
  20297. splice.call(data, index, 1);
  20298. }
  20299. --this.size;
  20300. return true;
  20301. }
  20302. /**
  20303. * Gets the list cache value for `key`.
  20304. *
  20305. * @private
  20306. * @name get
  20307. * @memberOf ListCache
  20308. * @param {string} key The key of the value to get.
  20309. * @returns {*} Returns the entry value.
  20310. */
  20311. function listCacheGet(key) {
  20312. var data = this.__data__,
  20313. index = assocIndexOf(data, key);
  20314. return index < 0 ? undefined : data[index][1];
  20315. }
  20316. /**
  20317. * Checks if a list cache value for `key` exists.
  20318. *
  20319. * @private
  20320. * @name has
  20321. * @memberOf ListCache
  20322. * @param {string} key The key of the entry to check.
  20323. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20324. */
  20325. function listCacheHas(key) {
  20326. return assocIndexOf(this.__data__, key) > -1;
  20327. }
  20328. /**
  20329. * Sets the list cache `key` to `value`.
  20330. *
  20331. * @private
  20332. * @name set
  20333. * @memberOf ListCache
  20334. * @param {string} key The key of the value to set.
  20335. * @param {*} value The value to set.
  20336. * @returns {Object} Returns the list cache instance.
  20337. */
  20338. function listCacheSet(key, value) {
  20339. var data = this.__data__,
  20340. index = assocIndexOf(data, key);
  20341. if (index < 0) {
  20342. ++this.size;
  20343. data.push([key, value]);
  20344. } else {
  20345. data[index][1] = value;
  20346. }
  20347. return this;
  20348. }
  20349. // Add methods to `ListCache`.
  20350. ListCache.prototype.clear = listCacheClear;
  20351. ListCache.prototype['delete'] = listCacheDelete;
  20352. ListCache.prototype.get = listCacheGet;
  20353. ListCache.prototype.has = listCacheHas;
  20354. ListCache.prototype.set = listCacheSet;
  20355. /*------------------------------------------------------------------------*/
  20356. /**
  20357. * Creates a map cache object to store key-value pairs.
  20358. *
  20359. * @private
  20360. * @constructor
  20361. * @param {Array} [entries] The key-value pairs to cache.
  20362. */
  20363. function MapCache(entries) {
  20364. var index = -1,
  20365. length = entries == null ? 0 : entries.length;
  20366. this.clear();
  20367. while (++index < length) {
  20368. var entry = entries[index];
  20369. this.set(entry[0], entry[1]);
  20370. }
  20371. }
  20372. /**
  20373. * Removes all key-value entries from the map.
  20374. *
  20375. * @private
  20376. * @name clear
  20377. * @memberOf MapCache
  20378. */
  20379. function mapCacheClear() {
  20380. this.size = 0;
  20381. this.__data__ = {
  20382. 'hash': new Hash,
  20383. 'map': new (Map || ListCache),
  20384. 'string': new Hash
  20385. };
  20386. }
  20387. /**
  20388. * Removes `key` and its value from the map.
  20389. *
  20390. * @private
  20391. * @name delete
  20392. * @memberOf MapCache
  20393. * @param {string} key The key of the value to remove.
  20394. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20395. */
  20396. function mapCacheDelete(key) {
  20397. var result = getMapData(this, key)['delete'](key);
  20398. this.size -= result ? 1 : 0;
  20399. return result;
  20400. }
  20401. /**
  20402. * Gets the map value for `key`.
  20403. *
  20404. * @private
  20405. * @name get
  20406. * @memberOf MapCache
  20407. * @param {string} key The key of the value to get.
  20408. * @returns {*} Returns the entry value.
  20409. */
  20410. function mapCacheGet(key) {
  20411. return getMapData(this, key).get(key);
  20412. }
  20413. /**
  20414. * Checks if a map value for `key` exists.
  20415. *
  20416. * @private
  20417. * @name has
  20418. * @memberOf MapCache
  20419. * @param {string} key The key of the entry to check.
  20420. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20421. */
  20422. function mapCacheHas(key) {
  20423. return getMapData(this, key).has(key);
  20424. }
  20425. /**
  20426. * Sets the map `key` to `value`.
  20427. *
  20428. * @private
  20429. * @name set
  20430. * @memberOf MapCache
  20431. * @param {string} key The key of the value to set.
  20432. * @param {*} value The value to set.
  20433. * @returns {Object} Returns the map cache instance.
  20434. */
  20435. function mapCacheSet(key, value) {
  20436. var data = getMapData(this, key),
  20437. size = data.size;
  20438. data.set(key, value);
  20439. this.size += data.size == size ? 0 : 1;
  20440. return this;
  20441. }
  20442. // Add methods to `MapCache`.
  20443. MapCache.prototype.clear = mapCacheClear;
  20444. MapCache.prototype['delete'] = mapCacheDelete;
  20445. MapCache.prototype.get = mapCacheGet;
  20446. MapCache.prototype.has = mapCacheHas;
  20447. MapCache.prototype.set = mapCacheSet;
  20448. /*------------------------------------------------------------------------*/
  20449. /**
  20450. *
  20451. * Creates an array cache object to store unique values.
  20452. *
  20453. * @private
  20454. * @constructor
  20455. * @param {Array} [values] The values to cache.
  20456. */
  20457. function SetCache(values) {
  20458. var index = -1,
  20459. length = values == null ? 0 : values.length;
  20460. this.__data__ = new MapCache;
  20461. while (++index < length) {
  20462. this.add(values[index]);
  20463. }
  20464. }
  20465. /**
  20466. * Adds `value` to the array cache.
  20467. *
  20468. * @private
  20469. * @name add
  20470. * @memberOf SetCache
  20471. * @alias push
  20472. * @param {*} value The value to cache.
  20473. * @returns {Object} Returns the cache instance.
  20474. */
  20475. function setCacheAdd(value) {
  20476. this.__data__.set(value, HASH_UNDEFINED);
  20477. return this;
  20478. }
  20479. /**
  20480. * Checks if `value` is in the array cache.
  20481. *
  20482. * @private
  20483. * @name has
  20484. * @memberOf SetCache
  20485. * @param {*} value The value to search for.
  20486. * @returns {number} Returns `true` if `value` is found, else `false`.
  20487. */
  20488. function setCacheHas(value) {
  20489. return this.__data__.has(value);
  20490. }
  20491. // Add methods to `SetCache`.
  20492. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  20493. SetCache.prototype.has = setCacheHas;
  20494. /*------------------------------------------------------------------------*/
  20495. /**
  20496. * Creates a stack cache object to store key-value pairs.
  20497. *
  20498. * @private
  20499. * @constructor
  20500. * @param {Array} [entries] The key-value pairs to cache.
  20501. */
  20502. function Stack(entries) {
  20503. var data = this.__data__ = new ListCache(entries);
  20504. this.size = data.size;
  20505. }
  20506. /**
  20507. * Removes all key-value entries from the stack.
  20508. *
  20509. * @private
  20510. * @name clear
  20511. * @memberOf Stack
  20512. */
  20513. function stackClear() {
  20514. this.__data__ = new ListCache;
  20515. this.size = 0;
  20516. }
  20517. /**
  20518. * Removes `key` and its value from the stack.
  20519. *
  20520. * @private
  20521. * @name delete
  20522. * @memberOf Stack
  20523. * @param {string} key The key of the value to remove.
  20524. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20525. */
  20526. function stackDelete(key) {
  20527. var data = this.__data__,
  20528. result = data['delete'](key);
  20529. this.size = data.size;
  20530. return result;
  20531. }
  20532. /**
  20533. * Gets the stack value for `key`.
  20534. *
  20535. * @private
  20536. * @name get
  20537. * @memberOf Stack
  20538. * @param {string} key The key of the value to get.
  20539. * @returns {*} Returns the entry value.
  20540. */
  20541. function stackGet(key) {
  20542. return this.__data__.get(key);
  20543. }
  20544. /**
  20545. * Checks if a stack value for `key` exists.
  20546. *
  20547. * @private
  20548. * @name has
  20549. * @memberOf Stack
  20550. * @param {string} key The key of the entry to check.
  20551. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20552. */
  20553. function stackHas(key) {
  20554. return this.__data__.has(key);
  20555. }
  20556. /**
  20557. * Sets the stack `key` to `value`.
  20558. *
  20559. * @private
  20560. * @name set
  20561. * @memberOf Stack
  20562. * @param {string} key The key of the value to set.
  20563. * @param {*} value The value to set.
  20564. * @returns {Object} Returns the stack cache instance.
  20565. */
  20566. function stackSet(key, value) {
  20567. var data = this.__data__;
  20568. if (data instanceof ListCache) {
  20569. var pairs = data.__data__;
  20570. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  20571. pairs.push([key, value]);
  20572. this.size = ++data.size;
  20573. return this;
  20574. }
  20575. data = this.__data__ = new MapCache(pairs);
  20576. }
  20577. data.set(key, value);
  20578. this.size = data.size;
  20579. return this;
  20580. }
  20581. // Add methods to `Stack`.
  20582. Stack.prototype.clear = stackClear;
  20583. Stack.prototype['delete'] = stackDelete;
  20584. Stack.prototype.get = stackGet;
  20585. Stack.prototype.has = stackHas;
  20586. Stack.prototype.set = stackSet;
  20587. /*------------------------------------------------------------------------*/
  20588. /**
  20589. * Creates an array of the enumerable property names of the array-like `value`.
  20590. *
  20591. * @private
  20592. * @param {*} value The value to query.
  20593. * @param {boolean} inherited Specify returning inherited property names.
  20594. * @returns {Array} Returns the array of property names.
  20595. */
  20596. function arrayLikeKeys(value, inherited) {
  20597. var isArr = isArray(value),
  20598. isArg = !isArr && isArguments(value),
  20599. isBuff = !isArr && !isArg && isBuffer(value),
  20600. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  20601. skipIndexes = isArr || isArg || isBuff || isType,
  20602. result = skipIndexes ? baseTimes(value.length, String) : [],
  20603. length = result.length;
  20604. for (var key in value) {
  20605. if ((inherited || hasOwnProperty.call(value, key)) &&
  20606. !(skipIndexes && (
  20607. // Safari 9 has enumerable `arguments.length` in strict mode.
  20608. key == 'length' ||
  20609. // Node.js 0.10 has enumerable non-index properties on buffers.
  20610. (isBuff && (key == 'offset' || key == 'parent')) ||
  20611. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  20612. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  20613. // Skip index properties.
  20614. isIndex(key, length)
  20615. ))) {
  20616. result.push(key);
  20617. }
  20618. }
  20619. return result;
  20620. }
  20621. /**
  20622. * A specialized version of `_.sample` for arrays.
  20623. *
  20624. * @private
  20625. * @param {Array} array The array to sample.
  20626. * @returns {*} Returns the random element.
  20627. */
  20628. function arraySample(array) {
  20629. var length = array.length;
  20630. return length ? array[baseRandom(0, length - 1)] : undefined;
  20631. }
  20632. /**
  20633. * A specialized version of `_.sampleSize` for arrays.
  20634. *
  20635. * @private
  20636. * @param {Array} array The array to sample.
  20637. * @param {number} n The number of elements to sample.
  20638. * @returns {Array} Returns the random elements.
  20639. */
  20640. function arraySampleSize(array, n) {
  20641. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  20642. }
  20643. /**
  20644. * A specialized version of `_.shuffle` for arrays.
  20645. *
  20646. * @private
  20647. * @param {Array} array The array to shuffle.
  20648. * @returns {Array} Returns the new shuffled array.
  20649. */
  20650. function arrayShuffle(array) {
  20651. return shuffleSelf(copyArray(array));
  20652. }
  20653. /**
  20654. * This function is like `assignValue` except that it doesn't assign
  20655. * `undefined` values.
  20656. *
  20657. * @private
  20658. * @param {Object} object The object to modify.
  20659. * @param {string} key The key of the property to assign.
  20660. * @param {*} value The value to assign.
  20661. */
  20662. function assignMergeValue(object, key, value) {
  20663. if ((value !== undefined && !eq(object[key], value)) ||
  20664. (value === undefined && !(key in object))) {
  20665. baseAssignValue(object, key, value);
  20666. }
  20667. }
  20668. /**
  20669. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  20670. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  20671. * for equality comparisons.
  20672. *
  20673. * @private
  20674. * @param {Object} object The object to modify.
  20675. * @param {string} key The key of the property to assign.
  20676. * @param {*} value The value to assign.
  20677. */
  20678. function assignValue(object, key, value) {
  20679. var objValue = object[key];
  20680. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  20681. (value === undefined && !(key in object))) {
  20682. baseAssignValue(object, key, value);
  20683. }
  20684. }
  20685. /**
  20686. * Gets the index at which the `key` is found in `array` of key-value pairs.
  20687. *
  20688. * @private
  20689. * @param {Array} array The array to inspect.
  20690. * @param {*} key The key to search for.
  20691. * @returns {number} Returns the index of the matched value, else `-1`.
  20692. */
  20693. function assocIndexOf(array, key) {
  20694. var length = array.length;
  20695. while (length--) {
  20696. if (eq(array[length][0], key)) {
  20697. return length;
  20698. }
  20699. }
  20700. return -1;
  20701. }
  20702. /**
  20703. * Aggregates elements of `collection` on `accumulator` with keys transformed
  20704. * by `iteratee` and values set by `setter`.
  20705. *
  20706. * @private
  20707. * @param {Array|Object} collection The collection to iterate over.
  20708. * @param {Function} setter The function to set `accumulator` values.
  20709. * @param {Function} iteratee The iteratee to transform keys.
  20710. * @param {Object} accumulator The initial aggregated object.
  20711. * @returns {Function} Returns `accumulator`.
  20712. */
  20713. function baseAggregator(collection, setter, iteratee, accumulator) {
  20714. baseEach(collection, function(value, key, collection) {
  20715. setter(accumulator, value, iteratee(value), collection);
  20716. });
  20717. return accumulator;
  20718. }
  20719. /**
  20720. * The base implementation of `_.assign` without support for multiple sources
  20721. * or `customizer` functions.
  20722. *
  20723. * @private
  20724. * @param {Object} object The destination object.
  20725. * @param {Object} source The source object.
  20726. * @returns {Object} Returns `object`.
  20727. */
  20728. function baseAssign(object, source) {
  20729. return object && copyObject(source, keys(source), object);
  20730. }
  20731. /**
  20732. * The base implementation of `_.assignIn` without support for multiple sources
  20733. * or `customizer` functions.
  20734. *
  20735. * @private
  20736. * @param {Object} object The destination object.
  20737. * @param {Object} source The source object.
  20738. * @returns {Object} Returns `object`.
  20739. */
  20740. function baseAssignIn(object, source) {
  20741. return object && copyObject(source, keysIn(source), object);
  20742. }
  20743. /**
  20744. * The base implementation of `assignValue` and `assignMergeValue` without
  20745. * value checks.
  20746. *
  20747. * @private
  20748. * @param {Object} object The object to modify.
  20749. * @param {string} key The key of the property to assign.
  20750. * @param {*} value The value to assign.
  20751. */
  20752. function baseAssignValue(object, key, value) {
  20753. if (key == '__proto__' && defineProperty) {
  20754. defineProperty(object, key, {
  20755. 'configurable': true,
  20756. 'enumerable': true,
  20757. 'value': value,
  20758. 'writable': true
  20759. });
  20760. } else {
  20761. object[key] = value;
  20762. }
  20763. }
  20764. /**
  20765. * The base implementation of `_.at` without support for individual paths.
  20766. *
  20767. * @private
  20768. * @param {Object} object The object to iterate over.
  20769. * @param {string[]} paths The property paths to pick.
  20770. * @returns {Array} Returns the picked elements.
  20771. */
  20772. function baseAt(object, paths) {
  20773. var index = -1,
  20774. length = paths.length,
  20775. result = Array(length),
  20776. skip = object == null;
  20777. while (++index < length) {
  20778. result[index] = skip ? undefined : get(object, paths[index]);
  20779. }
  20780. return result;
  20781. }
  20782. /**
  20783. * The base implementation of `_.clamp` which doesn't coerce arguments.
  20784. *
  20785. * @private
  20786. * @param {number} number The number to clamp.
  20787. * @param {number} [lower] The lower bound.
  20788. * @param {number} upper The upper bound.
  20789. * @returns {number} Returns the clamped number.
  20790. */
  20791. function baseClamp(number, lower, upper) {
  20792. if (number === number) {
  20793. if (upper !== undefined) {
  20794. number = number <= upper ? number : upper;
  20795. }
  20796. if (lower !== undefined) {
  20797. number = number >= lower ? number : lower;
  20798. }
  20799. }
  20800. return number;
  20801. }
  20802. /**
  20803. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  20804. * traversed objects.
  20805. *
  20806. * @private
  20807. * @param {*} value The value to clone.
  20808. * @param {boolean} bitmask The bitmask flags.
  20809. * 1 - Deep clone
  20810. * 2 - Flatten inherited properties
  20811. * 4 - Clone symbols
  20812. * @param {Function} [customizer] The function to customize cloning.
  20813. * @param {string} [key] The key of `value`.
  20814. * @param {Object} [object] The parent object of `value`.
  20815. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  20816. * @returns {*} Returns the cloned value.
  20817. */
  20818. function baseClone(value, bitmask, customizer, key, object, stack) {
  20819. var result,
  20820. isDeep = bitmask & CLONE_DEEP_FLAG,
  20821. isFlat = bitmask & CLONE_FLAT_FLAG,
  20822. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  20823. if (customizer) {
  20824. result = object ? customizer(value, key, object, stack) : customizer(value);
  20825. }
  20826. if (result !== undefined) {
  20827. return result;
  20828. }
  20829. if (!isObject(value)) {
  20830. return value;
  20831. }
  20832. var isArr = isArray(value);
  20833. if (isArr) {
  20834. result = initCloneArray(value);
  20835. if (!isDeep) {
  20836. return copyArray(value, result);
  20837. }
  20838. } else {
  20839. var tag = getTag(value),
  20840. isFunc = tag == funcTag || tag == genTag;
  20841. if (isBuffer(value)) {
  20842. return cloneBuffer(value, isDeep);
  20843. }
  20844. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  20845. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  20846. if (!isDeep) {
  20847. return isFlat
  20848. ? copySymbolsIn(value, baseAssignIn(result, value))
  20849. : copySymbols(value, baseAssign(result, value));
  20850. }
  20851. } else {
  20852. if (!cloneableTags[tag]) {
  20853. return object ? value : {};
  20854. }
  20855. result = initCloneByTag(value, tag, isDeep);
  20856. }
  20857. }
  20858. // Check for circular references and return its corresponding clone.
  20859. stack || (stack = new Stack);
  20860. var stacked = stack.get(value);
  20861. if (stacked) {
  20862. return stacked;
  20863. }
  20864. stack.set(value, result);
  20865. if (isSet(value)) {
  20866. value.forEach(function(subValue) {
  20867. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  20868. });
  20869. } else if (isMap(value)) {
  20870. value.forEach(function(subValue, key) {
  20871. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  20872. });
  20873. }
  20874. var keysFunc = isFull
  20875. ? (isFlat ? getAllKeysIn : getAllKeys)
  20876. : (isFlat ? keysIn : keys);
  20877. var props = isArr ? undefined : keysFunc(value);
  20878. arrayEach(props || value, function(subValue, key) {
  20879. if (props) {
  20880. key = subValue;
  20881. subValue = value[key];
  20882. }
  20883. // Recursively populate clone (susceptible to call stack limits).
  20884. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  20885. });
  20886. return result;
  20887. }
  20888. /**
  20889. * The base implementation of `_.conforms` which doesn't clone `source`.
  20890. *
  20891. * @private
  20892. * @param {Object} source The object of property predicates to conform to.
  20893. * @returns {Function} Returns the new spec function.
  20894. */
  20895. function baseConforms(source) {
  20896. var props = keys(source);
  20897. return function(object) {
  20898. return baseConformsTo(object, source, props);
  20899. };
  20900. }
  20901. /**
  20902. * The base implementation of `_.conformsTo` which accepts `props` to check.
  20903. *
  20904. * @private
  20905. * @param {Object} object The object to inspect.
  20906. * @param {Object} source The object of property predicates to conform to.
  20907. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  20908. */
  20909. function baseConformsTo(object, source, props) {
  20910. var length = props.length;
  20911. if (object == null) {
  20912. return !length;
  20913. }
  20914. object = Object(object);
  20915. while (length--) {
  20916. var key = props[length],
  20917. predicate = source[key],
  20918. value = object[key];
  20919. if ((value === undefined && !(key in object)) || !predicate(value)) {
  20920. return false;
  20921. }
  20922. }
  20923. return true;
  20924. }
  20925. /**
  20926. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  20927. * to provide to `func`.
  20928. *
  20929. * @private
  20930. * @param {Function} func The function to delay.
  20931. * @param {number} wait The number of milliseconds to delay invocation.
  20932. * @param {Array} args The arguments to provide to `func`.
  20933. * @returns {number|Object} Returns the timer id or timeout object.
  20934. */
  20935. function baseDelay(func, wait, args) {
  20936. if (typeof func != 'function') {
  20937. throw new TypeError(FUNC_ERROR_TEXT);
  20938. }
  20939. return setTimeout(function() { func.apply(undefined, args); }, wait);
  20940. }
  20941. /**
  20942. * The base implementation of methods like `_.difference` without support
  20943. * for excluding multiple arrays or iteratee shorthands.
  20944. *
  20945. * @private
  20946. * @param {Array} array The array to inspect.
  20947. * @param {Array} values The values to exclude.
  20948. * @param {Function} [iteratee] The iteratee invoked per element.
  20949. * @param {Function} [comparator] The comparator invoked per element.
  20950. * @returns {Array} Returns the new array of filtered values.
  20951. */
  20952. function baseDifference(array, values, iteratee, comparator) {
  20953. var index = -1,
  20954. includes = arrayIncludes,
  20955. isCommon = true,
  20956. length = array.length,
  20957. result = [],
  20958. valuesLength = values.length;
  20959. if (!length) {
  20960. return result;
  20961. }
  20962. if (iteratee) {
  20963. values = arrayMap(values, baseUnary(iteratee));
  20964. }
  20965. if (comparator) {
  20966. includes = arrayIncludesWith;
  20967. isCommon = false;
  20968. }
  20969. else if (values.length >= LARGE_ARRAY_SIZE) {
  20970. includes = cacheHas;
  20971. isCommon = false;
  20972. values = new SetCache(values);
  20973. }
  20974. outer:
  20975. while (++index < length) {
  20976. var value = array[index],
  20977. computed = iteratee == null ? value : iteratee(value);
  20978. value = (comparator || value !== 0) ? value : 0;
  20979. if (isCommon && computed === computed) {
  20980. var valuesIndex = valuesLength;
  20981. while (valuesIndex--) {
  20982. if (values[valuesIndex] === computed) {
  20983. continue outer;
  20984. }
  20985. }
  20986. result.push(value);
  20987. }
  20988. else if (!includes(values, computed, comparator)) {
  20989. result.push(value);
  20990. }
  20991. }
  20992. return result;
  20993. }
  20994. /**
  20995. * The base implementation of `_.forEach` without support for iteratee shorthands.
  20996. *
  20997. * @private
  20998. * @param {Array|Object} collection The collection to iterate over.
  20999. * @param {Function} iteratee The function invoked per iteration.
  21000. * @returns {Array|Object} Returns `collection`.
  21001. */
  21002. var baseEach = createBaseEach(baseForOwn);
  21003. /**
  21004. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  21005. *
  21006. * @private
  21007. * @param {Array|Object} collection The collection to iterate over.
  21008. * @param {Function} iteratee The function invoked per iteration.
  21009. * @returns {Array|Object} Returns `collection`.
  21010. */
  21011. var baseEachRight = createBaseEach(baseForOwnRight, true);
  21012. /**
  21013. * The base implementation of `_.every` without support for iteratee shorthands.
  21014. *
  21015. * @private
  21016. * @param {Array|Object} collection The collection to iterate over.
  21017. * @param {Function} predicate The function invoked per iteration.
  21018. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  21019. * else `false`
  21020. */
  21021. function baseEvery(collection, predicate) {
  21022. var result = true;
  21023. baseEach(collection, function(value, index, collection) {
  21024. result = !!predicate(value, index, collection);
  21025. return result;
  21026. });
  21027. return result;
  21028. }
  21029. /**
  21030. * The base implementation of methods like `_.max` and `_.min` which accepts a
  21031. * `comparator` to determine the extremum value.
  21032. *
  21033. * @private
  21034. * @param {Array} array The array to iterate over.
  21035. * @param {Function} iteratee The iteratee invoked per iteration.
  21036. * @param {Function} comparator The comparator used to compare values.
  21037. * @returns {*} Returns the extremum value.
  21038. */
  21039. function baseExtremum(array, iteratee, comparator) {
  21040. var index = -1,
  21041. length = array.length;
  21042. while (++index < length) {
  21043. var value = array[index],
  21044. current = iteratee(value);
  21045. if (current != null && (computed === undefined
  21046. ? (current === current && !isSymbol(current))
  21047. : comparator(current, computed)
  21048. )) {
  21049. var computed = current,
  21050. result = value;
  21051. }
  21052. }
  21053. return result;
  21054. }
  21055. /**
  21056. * The base implementation of `_.fill` without an iteratee call guard.
  21057. *
  21058. * @private
  21059. * @param {Array} array The array to fill.
  21060. * @param {*} value The value to fill `array` with.
  21061. * @param {number} [start=0] The start position.
  21062. * @param {number} [end=array.length] The end position.
  21063. * @returns {Array} Returns `array`.
  21064. */
  21065. function baseFill(array, value, start, end) {
  21066. var length = array.length;
  21067. start = toInteger(start);
  21068. if (start < 0) {
  21069. start = -start > length ? 0 : (length + start);
  21070. }
  21071. end = (end === undefined || end > length) ? length : toInteger(end);
  21072. if (end < 0) {
  21073. end += length;
  21074. }
  21075. end = start > end ? 0 : toLength(end);
  21076. while (start < end) {
  21077. array[start++] = value;
  21078. }
  21079. return array;
  21080. }
  21081. /**
  21082. * The base implementation of `_.filter` without support for iteratee shorthands.
  21083. *
  21084. * @private
  21085. * @param {Array|Object} collection The collection to iterate over.
  21086. * @param {Function} predicate The function invoked per iteration.
  21087. * @returns {Array} Returns the new filtered array.
  21088. */
  21089. function baseFilter(collection, predicate) {
  21090. var result = [];
  21091. baseEach(collection, function(value, index, collection) {
  21092. if (predicate(value, index, collection)) {
  21093. result.push(value);
  21094. }
  21095. });
  21096. return result;
  21097. }
  21098. /**
  21099. * The base implementation of `_.flatten` with support for restricting flattening.
  21100. *
  21101. * @private
  21102. * @param {Array} array The array to flatten.
  21103. * @param {number} depth The maximum recursion depth.
  21104. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  21105. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  21106. * @param {Array} [result=[]] The initial result value.
  21107. * @returns {Array} Returns the new flattened array.
  21108. */
  21109. function baseFlatten(array, depth, predicate, isStrict, result) {
  21110. var index = -1,
  21111. length = array.length;
  21112. predicate || (predicate = isFlattenable);
  21113. result || (result = []);
  21114. while (++index < length) {
  21115. var value = array[index];
  21116. if (depth > 0 && predicate(value)) {
  21117. if (depth > 1) {
  21118. // Recursively flatten arrays (susceptible to call stack limits).
  21119. baseFlatten(value, depth - 1, predicate, isStrict, result);
  21120. } else {
  21121. arrayPush(result, value);
  21122. }
  21123. } else if (!isStrict) {
  21124. result[result.length] = value;
  21125. }
  21126. }
  21127. return result;
  21128. }
  21129. /**
  21130. * The base implementation of `baseForOwn` which iterates over `object`
  21131. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  21132. * Iteratee functions may exit iteration early by explicitly returning `false`.
  21133. *
  21134. * @private
  21135. * @param {Object} object The object to iterate over.
  21136. * @param {Function} iteratee The function invoked per iteration.
  21137. * @param {Function} keysFunc The function to get the keys of `object`.
  21138. * @returns {Object} Returns `object`.
  21139. */
  21140. var baseFor = createBaseFor();
  21141. /**
  21142. * This function is like `baseFor` except that it iterates over properties
  21143. * in the opposite order.
  21144. *
  21145. * @private
  21146. * @param {Object} object The object to iterate over.
  21147. * @param {Function} iteratee The function invoked per iteration.
  21148. * @param {Function} keysFunc The function to get the keys of `object`.
  21149. * @returns {Object} Returns `object`.
  21150. */
  21151. var baseForRight = createBaseFor(true);
  21152. /**
  21153. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  21154. *
  21155. * @private
  21156. * @param {Object} object The object to iterate over.
  21157. * @param {Function} iteratee The function invoked per iteration.
  21158. * @returns {Object} Returns `object`.
  21159. */
  21160. function baseForOwn(object, iteratee) {
  21161. return object && baseFor(object, iteratee, keys);
  21162. }
  21163. /**
  21164. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  21165. *
  21166. * @private
  21167. * @param {Object} object The object to iterate over.
  21168. * @param {Function} iteratee The function invoked per iteration.
  21169. * @returns {Object} Returns `object`.
  21170. */
  21171. function baseForOwnRight(object, iteratee) {
  21172. return object && baseForRight(object, iteratee, keys);
  21173. }
  21174. /**
  21175. * The base implementation of `_.functions` which creates an array of
  21176. * `object` function property names filtered from `props`.
  21177. *
  21178. * @private
  21179. * @param {Object} object The object to inspect.
  21180. * @param {Array} props The property names to filter.
  21181. * @returns {Array} Returns the function names.
  21182. */
  21183. function baseFunctions(object, props) {
  21184. return arrayFilter(props, function(key) {
  21185. return isFunction(object[key]);
  21186. });
  21187. }
  21188. /**
  21189. * The base implementation of `_.get` without support for default values.
  21190. *
  21191. * @private
  21192. * @param {Object} object The object to query.
  21193. * @param {Array|string} path The path of the property to get.
  21194. * @returns {*} Returns the resolved value.
  21195. */
  21196. function baseGet(object, path) {
  21197. path = castPath(path, object);
  21198. var index = 0,
  21199. length = path.length;
  21200. while (object != null && index < length) {
  21201. object = object[toKey(path[index++])];
  21202. }
  21203. return (index && index == length) ? object : undefined;
  21204. }
  21205. /**
  21206. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  21207. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  21208. * symbols of `object`.
  21209. *
  21210. * @private
  21211. * @param {Object} object The object to query.
  21212. * @param {Function} keysFunc The function to get the keys of `object`.
  21213. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  21214. * @returns {Array} Returns the array of property names and symbols.
  21215. */
  21216. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  21217. var result = keysFunc(object);
  21218. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  21219. }
  21220. /**
  21221. * The base implementation of `getTag` without fallbacks for buggy environments.
  21222. *
  21223. * @private
  21224. * @param {*} value The value to query.
  21225. * @returns {string} Returns the `toStringTag`.
  21226. */
  21227. function baseGetTag(value) {
  21228. if (value == null) {
  21229. return value === undefined ? undefinedTag : nullTag;
  21230. }
  21231. return (symToStringTag && symToStringTag in Object(value))
  21232. ? getRawTag(value)
  21233. : objectToString(value);
  21234. }
  21235. /**
  21236. * The base implementation of `_.gt` which doesn't coerce arguments.
  21237. *
  21238. * @private
  21239. * @param {*} value The value to compare.
  21240. * @param {*} other The other value to compare.
  21241. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  21242. * else `false`.
  21243. */
  21244. function baseGt(value, other) {
  21245. return value > other;
  21246. }
  21247. /**
  21248. * The base implementation of `_.has` without support for deep paths.
  21249. *
  21250. * @private
  21251. * @param {Object} [object] The object to query.
  21252. * @param {Array|string} key The key to check.
  21253. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  21254. */
  21255. function baseHas(object, key) {
  21256. return object != null && hasOwnProperty.call(object, key);
  21257. }
  21258. /**
  21259. * The base implementation of `_.hasIn` without support for deep paths.
  21260. *
  21261. * @private
  21262. * @param {Object} [object] The object to query.
  21263. * @param {Array|string} key The key to check.
  21264. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  21265. */
  21266. function baseHasIn(object, key) {
  21267. return object != null && key in Object(object);
  21268. }
  21269. /**
  21270. * The base implementation of `_.inRange` which doesn't coerce arguments.
  21271. *
  21272. * @private
  21273. * @param {number} number The number to check.
  21274. * @param {number} start The start of the range.
  21275. * @param {number} end The end of the range.
  21276. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  21277. */
  21278. function baseInRange(number, start, end) {
  21279. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  21280. }
  21281. /**
  21282. * The base implementation of methods like `_.intersection`, without support
  21283. * for iteratee shorthands, that accepts an array of arrays to inspect.
  21284. *
  21285. * @private
  21286. * @param {Array} arrays The arrays to inspect.
  21287. * @param {Function} [iteratee] The iteratee invoked per element.
  21288. * @param {Function} [comparator] The comparator invoked per element.
  21289. * @returns {Array} Returns the new array of shared values.
  21290. */
  21291. function baseIntersection(arrays, iteratee, comparator) {
  21292. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  21293. length = arrays[0].length,
  21294. othLength = arrays.length,
  21295. othIndex = othLength,
  21296. caches = Array(othLength),
  21297. maxLength = Infinity,
  21298. result = [];
  21299. while (othIndex--) {
  21300. var array = arrays[othIndex];
  21301. if (othIndex && iteratee) {
  21302. array = arrayMap(array, baseUnary(iteratee));
  21303. }
  21304. maxLength = nativeMin(array.length, maxLength);
  21305. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  21306. ? new SetCache(othIndex && array)
  21307. : undefined;
  21308. }
  21309. array = arrays[0];
  21310. var index = -1,
  21311. seen = caches[0];
  21312. outer:
  21313. while (++index < length && result.length < maxLength) {
  21314. var value = array[index],
  21315. computed = iteratee ? iteratee(value) : value;
  21316. value = (comparator || value !== 0) ? value : 0;
  21317. if (!(seen
  21318. ? cacheHas(seen, computed)
  21319. : includes(result, computed, comparator)
  21320. )) {
  21321. othIndex = othLength;
  21322. while (--othIndex) {
  21323. var cache = caches[othIndex];
  21324. if (!(cache
  21325. ? cacheHas(cache, computed)
  21326. : includes(arrays[othIndex], computed, comparator))
  21327. ) {
  21328. continue outer;
  21329. }
  21330. }
  21331. if (seen) {
  21332. seen.push(computed);
  21333. }
  21334. result.push(value);
  21335. }
  21336. }
  21337. return result;
  21338. }
  21339. /**
  21340. * The base implementation of `_.invert` and `_.invertBy` which inverts
  21341. * `object` with values transformed by `iteratee` and set by `setter`.
  21342. *
  21343. * @private
  21344. * @param {Object} object The object to iterate over.
  21345. * @param {Function} setter The function to set `accumulator` values.
  21346. * @param {Function} iteratee The iteratee to transform values.
  21347. * @param {Object} accumulator The initial inverted object.
  21348. * @returns {Function} Returns `accumulator`.
  21349. */
  21350. function baseInverter(object, setter, iteratee, accumulator) {
  21351. baseForOwn(object, function(value, key, object) {
  21352. setter(accumulator, iteratee(value), key, object);
  21353. });
  21354. return accumulator;
  21355. }
  21356. /**
  21357. * The base implementation of `_.invoke` without support for individual
  21358. * method arguments.
  21359. *
  21360. * @private
  21361. * @param {Object} object The object to query.
  21362. * @param {Array|string} path The path of the method to invoke.
  21363. * @param {Array} args The arguments to invoke the method with.
  21364. * @returns {*} Returns the result of the invoked method.
  21365. */
  21366. function baseInvoke(object, path, args) {
  21367. path = castPath(path, object);
  21368. object = parent(object, path);
  21369. var func = object == null ? object : object[toKey(last(path))];
  21370. return func == null ? undefined : apply(func, object, args);
  21371. }
  21372. /**
  21373. * The base implementation of `_.isArguments`.
  21374. *
  21375. * @private
  21376. * @param {*} value The value to check.
  21377. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  21378. */
  21379. function baseIsArguments(value) {
  21380. return isObjectLike(value) && baseGetTag(value) == argsTag;
  21381. }
  21382. /**
  21383. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  21384. *
  21385. * @private
  21386. * @param {*} value The value to check.
  21387. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  21388. */
  21389. function baseIsArrayBuffer(value) {
  21390. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  21391. }
  21392. /**
  21393. * The base implementation of `_.isDate` without Node.js optimizations.
  21394. *
  21395. * @private
  21396. * @param {*} value The value to check.
  21397. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  21398. */
  21399. function baseIsDate(value) {
  21400. return isObjectLike(value) && baseGetTag(value) == dateTag;
  21401. }
  21402. /**
  21403. * The base implementation of `_.isEqual` which supports partial comparisons
  21404. * and tracks traversed objects.
  21405. *
  21406. * @private
  21407. * @param {*} value The value to compare.
  21408. * @param {*} other The other value to compare.
  21409. * @param {boolean} bitmask The bitmask flags.
  21410. * 1 - Unordered comparison
  21411. * 2 - Partial comparison
  21412. * @param {Function} [customizer] The function to customize comparisons.
  21413. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  21414. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  21415. */
  21416. function baseIsEqual(value, other, bitmask, customizer, stack) {
  21417. if (value === other) {
  21418. return true;
  21419. }
  21420. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  21421. return value !== value && other !== other;
  21422. }
  21423. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  21424. }
  21425. /**
  21426. * A specialized version of `baseIsEqual` for arrays and objects which performs
  21427. * deep comparisons and tracks traversed objects enabling objects with circular
  21428. * references to be compared.
  21429. *
  21430. * @private
  21431. * @param {Object} object The object to compare.
  21432. * @param {Object} other The other object to compare.
  21433. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  21434. * @param {Function} customizer The function to customize comparisons.
  21435. * @param {Function} equalFunc The function to determine equivalents of values.
  21436. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  21437. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  21438. */
  21439. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  21440. var objIsArr = isArray(object),
  21441. othIsArr = isArray(other),
  21442. objTag = objIsArr ? arrayTag : getTag(object),
  21443. othTag = othIsArr ? arrayTag : getTag(other);
  21444. objTag = objTag == argsTag ? objectTag : objTag;
  21445. othTag = othTag == argsTag ? objectTag : othTag;
  21446. var objIsObj = objTag == objectTag,
  21447. othIsObj = othTag == objectTag,
  21448. isSameTag = objTag == othTag;
  21449. if (isSameTag && isBuffer(object)) {
  21450. if (!isBuffer(other)) {
  21451. return false;
  21452. }
  21453. objIsArr = true;
  21454. objIsObj = false;
  21455. }
  21456. if (isSameTag && !objIsObj) {
  21457. stack || (stack = new Stack);
  21458. return (objIsArr || isTypedArray(object))
  21459. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  21460. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  21461. }
  21462. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  21463. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  21464. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  21465. if (objIsWrapped || othIsWrapped) {
  21466. var objUnwrapped = objIsWrapped ? object.value() : object,
  21467. othUnwrapped = othIsWrapped ? other.value() : other;
  21468. stack || (stack = new Stack);
  21469. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  21470. }
  21471. }
  21472. if (!isSameTag) {
  21473. return false;
  21474. }
  21475. stack || (stack = new Stack);
  21476. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  21477. }
  21478. /**
  21479. * The base implementation of `_.isMap` without Node.js optimizations.
  21480. *
  21481. * @private
  21482. * @param {*} value The value to check.
  21483. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  21484. */
  21485. function baseIsMap(value) {
  21486. return isObjectLike(value) && getTag(value) == mapTag;
  21487. }
  21488. /**
  21489. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  21490. *
  21491. * @private
  21492. * @param {Object} object The object to inspect.
  21493. * @param {Object} source The object of property values to match.
  21494. * @param {Array} matchData The property names, values, and compare flags to match.
  21495. * @param {Function} [customizer] The function to customize comparisons.
  21496. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  21497. */
  21498. function baseIsMatch(object, source, matchData, customizer) {
  21499. var index = matchData.length,
  21500. length = index,
  21501. noCustomizer = !customizer;
  21502. if (object == null) {
  21503. return !length;
  21504. }
  21505. object = Object(object);
  21506. while (index--) {
  21507. var data = matchData[index];
  21508. if ((noCustomizer && data[2])
  21509. ? data[1] !== object[data[0]]
  21510. : !(data[0] in object)
  21511. ) {
  21512. return false;
  21513. }
  21514. }
  21515. while (++index < length) {
  21516. data = matchData[index];
  21517. var key = data[0],
  21518. objValue = object[key],
  21519. srcValue = data[1];
  21520. if (noCustomizer && data[2]) {
  21521. if (objValue === undefined && !(key in object)) {
  21522. return false;
  21523. }
  21524. } else {
  21525. var stack = new Stack;
  21526. if (customizer) {
  21527. var result = customizer(objValue, srcValue, key, object, source, stack);
  21528. }
  21529. if (!(result === undefined
  21530. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  21531. : result
  21532. )) {
  21533. return false;
  21534. }
  21535. }
  21536. }
  21537. return true;
  21538. }
  21539. /**
  21540. * The base implementation of `_.isNative` without bad shim checks.
  21541. *
  21542. * @private
  21543. * @param {*} value The value to check.
  21544. * @returns {boolean} Returns `true` if `value` is a native function,
  21545. * else `false`.
  21546. */
  21547. function baseIsNative(value) {
  21548. if (!isObject(value) || isMasked(value)) {
  21549. return false;
  21550. }
  21551. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  21552. return pattern.test(toSource(value));
  21553. }
  21554. /**
  21555. * The base implementation of `_.isRegExp` without Node.js optimizations.
  21556. *
  21557. * @private
  21558. * @param {*} value The value to check.
  21559. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  21560. */
  21561. function baseIsRegExp(value) {
  21562. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  21563. }
  21564. /**
  21565. * The base implementation of `_.isSet` without Node.js optimizations.
  21566. *
  21567. * @private
  21568. * @param {*} value The value to check.
  21569. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  21570. */
  21571. function baseIsSet(value) {
  21572. return isObjectLike(value) && getTag(value) == setTag;
  21573. }
  21574. /**
  21575. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  21576. *
  21577. * @private
  21578. * @param {*} value The value to check.
  21579. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  21580. */
  21581. function baseIsTypedArray(value) {
  21582. return isObjectLike(value) &&
  21583. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  21584. }
  21585. /**
  21586. * The base implementation of `_.iteratee`.
  21587. *
  21588. * @private
  21589. * @param {*} [value=_.identity] The value to convert to an iteratee.
  21590. * @returns {Function} Returns the iteratee.
  21591. */
  21592. function baseIteratee(value) {
  21593. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  21594. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  21595. if (typeof value == 'function') {
  21596. return value;
  21597. }
  21598. if (value == null) {
  21599. return identity;
  21600. }
  21601. if (typeof value == 'object') {
  21602. return isArray(value)
  21603. ? baseMatchesProperty(value[0], value[1])
  21604. : baseMatches(value);
  21605. }
  21606. return property(value);
  21607. }
  21608. /**
  21609. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  21610. *
  21611. * @private
  21612. * @param {Object} object The object to query.
  21613. * @returns {Array} Returns the array of property names.
  21614. */
  21615. function baseKeys(object) {
  21616. if (!isPrototype(object)) {
  21617. return nativeKeys(object);
  21618. }
  21619. var result = [];
  21620. for (var key in Object(object)) {
  21621. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  21622. result.push(key);
  21623. }
  21624. }
  21625. return result;
  21626. }
  21627. /**
  21628. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  21629. *
  21630. * @private
  21631. * @param {Object} object The object to query.
  21632. * @returns {Array} Returns the array of property names.
  21633. */
  21634. function baseKeysIn(object) {
  21635. if (!isObject(object)) {
  21636. return nativeKeysIn(object);
  21637. }
  21638. var isProto = isPrototype(object),
  21639. result = [];
  21640. for (var key in object) {
  21641. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  21642. result.push(key);
  21643. }
  21644. }
  21645. return result;
  21646. }
  21647. /**
  21648. * The base implementation of `_.lt` which doesn't coerce arguments.
  21649. *
  21650. * @private
  21651. * @param {*} value The value to compare.
  21652. * @param {*} other The other value to compare.
  21653. * @returns {boolean} Returns `true` if `value` is less than `other`,
  21654. * else `false`.
  21655. */
  21656. function baseLt(value, other) {
  21657. return value < other;
  21658. }
  21659. /**
  21660. * The base implementation of `_.map` without support for iteratee shorthands.
  21661. *
  21662. * @private
  21663. * @param {Array|Object} collection The collection to iterate over.
  21664. * @param {Function} iteratee The function invoked per iteration.
  21665. * @returns {Array} Returns the new mapped array.
  21666. */
  21667. function baseMap(collection, iteratee) {
  21668. var index = -1,
  21669. result = isArrayLike(collection) ? Array(collection.length) : [];
  21670. baseEach(collection, function(value, key, collection) {
  21671. result[++index] = iteratee(value, key, collection);
  21672. });
  21673. return result;
  21674. }
  21675. /**
  21676. * The base implementation of `_.matches` which doesn't clone `source`.
  21677. *
  21678. * @private
  21679. * @param {Object} source The object of property values to match.
  21680. * @returns {Function} Returns the new spec function.
  21681. */
  21682. function baseMatches(source) {
  21683. var matchData = getMatchData(source);
  21684. if (matchData.length == 1 && matchData[0][2]) {
  21685. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  21686. }
  21687. return function(object) {
  21688. return object === source || baseIsMatch(object, source, matchData);
  21689. };
  21690. }
  21691. /**
  21692. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  21693. *
  21694. * @private
  21695. * @param {string} path The path of the property to get.
  21696. * @param {*} srcValue The value to match.
  21697. * @returns {Function} Returns the new spec function.
  21698. */
  21699. function baseMatchesProperty(path, srcValue) {
  21700. if (isKey(path) && isStrictComparable(srcValue)) {
  21701. return matchesStrictComparable(toKey(path), srcValue);
  21702. }
  21703. return function(object) {
  21704. var objValue = get(object, path);
  21705. return (objValue === undefined && objValue === srcValue)
  21706. ? hasIn(object, path)
  21707. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  21708. };
  21709. }
  21710. /**
  21711. * The base implementation of `_.merge` without support for multiple sources.
  21712. *
  21713. * @private
  21714. * @param {Object} object The destination object.
  21715. * @param {Object} source The source object.
  21716. * @param {number} srcIndex The index of `source`.
  21717. * @param {Function} [customizer] The function to customize merged values.
  21718. * @param {Object} [stack] Tracks traversed source values and their merged
  21719. * counterparts.
  21720. */
  21721. function baseMerge(object, source, srcIndex, customizer, stack) {
  21722. if (object === source) {
  21723. return;
  21724. }
  21725. baseFor(source, function(srcValue, key) {
  21726. stack || (stack = new Stack);
  21727. if (isObject(srcValue)) {
  21728. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  21729. }
  21730. else {
  21731. var newValue = customizer
  21732. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  21733. : undefined;
  21734. if (newValue === undefined) {
  21735. newValue = srcValue;
  21736. }
  21737. assignMergeValue(object, key, newValue);
  21738. }
  21739. }, keysIn);
  21740. }
  21741. /**
  21742. * A specialized version of `baseMerge` for arrays and objects which performs
  21743. * deep merges and tracks traversed objects enabling objects with circular
  21744. * references to be merged.
  21745. *
  21746. * @private
  21747. * @param {Object} object The destination object.
  21748. * @param {Object} source The source object.
  21749. * @param {string} key The key of the value to merge.
  21750. * @param {number} srcIndex The index of `source`.
  21751. * @param {Function} mergeFunc The function to merge values.
  21752. * @param {Function} [customizer] The function to customize assigned values.
  21753. * @param {Object} [stack] Tracks traversed source values and their merged
  21754. * counterparts.
  21755. */
  21756. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  21757. var objValue = safeGet(object, key),
  21758. srcValue = safeGet(source, key),
  21759. stacked = stack.get(srcValue);
  21760. if (stacked) {
  21761. assignMergeValue(object, key, stacked);
  21762. return;
  21763. }
  21764. var newValue = customizer
  21765. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  21766. : undefined;
  21767. var isCommon = newValue === undefined;
  21768. if (isCommon) {
  21769. var isArr = isArray(srcValue),
  21770. isBuff = !isArr && isBuffer(srcValue),
  21771. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  21772. newValue = srcValue;
  21773. if (isArr || isBuff || isTyped) {
  21774. if (isArray(objValue)) {
  21775. newValue = objValue;
  21776. }
  21777. else if (isArrayLikeObject(objValue)) {
  21778. newValue = copyArray(objValue);
  21779. }
  21780. else if (isBuff) {
  21781. isCommon = false;
  21782. newValue = cloneBuffer(srcValue, true);
  21783. }
  21784. else if (isTyped) {
  21785. isCommon = false;
  21786. newValue = cloneTypedArray(srcValue, true);
  21787. }
  21788. else {
  21789. newValue = [];
  21790. }
  21791. }
  21792. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  21793. newValue = objValue;
  21794. if (isArguments(objValue)) {
  21795. newValue = toPlainObject(objValue);
  21796. }
  21797. else if (!isObject(objValue) || isFunction(objValue)) {
  21798. newValue = initCloneObject(srcValue);
  21799. }
  21800. }
  21801. else {
  21802. isCommon = false;
  21803. }
  21804. }
  21805. if (isCommon) {
  21806. // Recursively merge objects and arrays (susceptible to call stack limits).
  21807. stack.set(srcValue, newValue);
  21808. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  21809. stack['delete'](srcValue);
  21810. }
  21811. assignMergeValue(object, key, newValue);
  21812. }
  21813. /**
  21814. * The base implementation of `_.nth` which doesn't coerce arguments.
  21815. *
  21816. * @private
  21817. * @param {Array} array The array to query.
  21818. * @param {number} n The index of the element to return.
  21819. * @returns {*} Returns the nth element of `array`.
  21820. */
  21821. function baseNth(array, n) {
  21822. var length = array.length;
  21823. if (!length) {
  21824. return;
  21825. }
  21826. n += n < 0 ? length : 0;
  21827. return isIndex(n, length) ? array[n] : undefined;
  21828. }
  21829. /**
  21830. * The base implementation of `_.orderBy` without param guards.
  21831. *
  21832. * @private
  21833. * @param {Array|Object} collection The collection to iterate over.
  21834. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  21835. * @param {string[]} orders The sort orders of `iteratees`.
  21836. * @returns {Array} Returns the new sorted array.
  21837. */
  21838. function baseOrderBy(collection, iteratees, orders) {
  21839. var index = -1;
  21840. iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
  21841. var result = baseMap(collection, function(value, key, collection) {
  21842. var criteria = arrayMap(iteratees, function(iteratee) {
  21843. return iteratee(value);
  21844. });
  21845. return { 'criteria': criteria, 'index': ++index, 'value': value };
  21846. });
  21847. return baseSortBy(result, function(object, other) {
  21848. return compareMultiple(object, other, orders);
  21849. });
  21850. }
  21851. /**
  21852. * The base implementation of `_.pick` without support for individual
  21853. * property identifiers.
  21854. *
  21855. * @private
  21856. * @param {Object} object The source object.
  21857. * @param {string[]} paths The property paths to pick.
  21858. * @returns {Object} Returns the new object.
  21859. */
  21860. function basePick(object, paths) {
  21861. return basePickBy(object, paths, function(value, path) {
  21862. return hasIn(object, path);
  21863. });
  21864. }
  21865. /**
  21866. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  21867. *
  21868. * @private
  21869. * @param {Object} object The source object.
  21870. * @param {string[]} paths The property paths to pick.
  21871. * @param {Function} predicate The function invoked per property.
  21872. * @returns {Object} Returns the new object.
  21873. */
  21874. function basePickBy(object, paths, predicate) {
  21875. var index = -1,
  21876. length = paths.length,
  21877. result = {};
  21878. while (++index < length) {
  21879. var path = paths[index],
  21880. value = baseGet(object, path);
  21881. if (predicate(value, path)) {
  21882. baseSet(result, castPath(path, object), value);
  21883. }
  21884. }
  21885. return result;
  21886. }
  21887. /**
  21888. * A specialized version of `baseProperty` which supports deep paths.
  21889. *
  21890. * @private
  21891. * @param {Array|string} path The path of the property to get.
  21892. * @returns {Function} Returns the new accessor function.
  21893. */
  21894. function basePropertyDeep(path) {
  21895. return function(object) {
  21896. return baseGet(object, path);
  21897. };
  21898. }
  21899. /**
  21900. * The base implementation of `_.pullAllBy` without support for iteratee
  21901. * shorthands.
  21902. *
  21903. * @private
  21904. * @param {Array} array The array to modify.
  21905. * @param {Array} values The values to remove.
  21906. * @param {Function} [iteratee] The iteratee invoked per element.
  21907. * @param {Function} [comparator] The comparator invoked per element.
  21908. * @returns {Array} Returns `array`.
  21909. */
  21910. function basePullAll(array, values, iteratee, comparator) {
  21911. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  21912. index = -1,
  21913. length = values.length,
  21914. seen = array;
  21915. if (array === values) {
  21916. values = copyArray(values);
  21917. }
  21918. if (iteratee) {
  21919. seen = arrayMap(array, baseUnary(iteratee));
  21920. }
  21921. while (++index < length) {
  21922. var fromIndex = 0,
  21923. value = values[index],
  21924. computed = iteratee ? iteratee(value) : value;
  21925. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  21926. if (seen !== array) {
  21927. splice.call(seen, fromIndex, 1);
  21928. }
  21929. splice.call(array, fromIndex, 1);
  21930. }
  21931. }
  21932. return array;
  21933. }
  21934. /**
  21935. * The base implementation of `_.pullAt` without support for individual
  21936. * indexes or capturing the removed elements.
  21937. *
  21938. * @private
  21939. * @param {Array} array The array to modify.
  21940. * @param {number[]} indexes The indexes of elements to remove.
  21941. * @returns {Array} Returns `array`.
  21942. */
  21943. function basePullAt(array, indexes) {
  21944. var length = array ? indexes.length : 0,
  21945. lastIndex = length - 1;
  21946. while (length--) {
  21947. var index = indexes[length];
  21948. if (length == lastIndex || index !== previous) {
  21949. var previous = index;
  21950. if (isIndex(index)) {
  21951. splice.call(array, index, 1);
  21952. } else {
  21953. baseUnset(array, index);
  21954. }
  21955. }
  21956. }
  21957. return array;
  21958. }
  21959. /**
  21960. * The base implementation of `_.random` without support for returning
  21961. * floating-point numbers.
  21962. *
  21963. * @private
  21964. * @param {number} lower The lower bound.
  21965. * @param {number} upper The upper bound.
  21966. * @returns {number} Returns the random number.
  21967. */
  21968. function baseRandom(lower, upper) {
  21969. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  21970. }
  21971. /**
  21972. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  21973. * coerce arguments.
  21974. *
  21975. * @private
  21976. * @param {number} start The start of the range.
  21977. * @param {number} end The end of the range.
  21978. * @param {number} step The value to increment or decrement by.
  21979. * @param {boolean} [fromRight] Specify iterating from right to left.
  21980. * @returns {Array} Returns the range of numbers.
  21981. */
  21982. function baseRange(start, end, step, fromRight) {
  21983. var index = -1,
  21984. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  21985. result = Array(length);
  21986. while (length--) {
  21987. result[fromRight ? length : ++index] = start;
  21988. start += step;
  21989. }
  21990. return result;
  21991. }
  21992. /**
  21993. * The base implementation of `_.repeat` which doesn't coerce arguments.
  21994. *
  21995. * @private
  21996. * @param {string} string The string to repeat.
  21997. * @param {number} n The number of times to repeat the string.
  21998. * @returns {string} Returns the repeated string.
  21999. */
  22000. function baseRepeat(string, n) {
  22001. var result = '';
  22002. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  22003. return result;
  22004. }
  22005. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  22006. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  22007. do {
  22008. if (n % 2) {
  22009. result += string;
  22010. }
  22011. n = nativeFloor(n / 2);
  22012. if (n) {
  22013. string += string;
  22014. }
  22015. } while (n);
  22016. return result;
  22017. }
  22018. /**
  22019. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  22020. *
  22021. * @private
  22022. * @param {Function} func The function to apply a rest parameter to.
  22023. * @param {number} [start=func.length-1] The start position of the rest parameter.
  22024. * @returns {Function} Returns the new function.
  22025. */
  22026. function baseRest(func, start) {
  22027. return setToString(overRest(func, start, identity), func + '');
  22028. }
  22029. /**
  22030. * The base implementation of `_.sample`.
  22031. *
  22032. * @private
  22033. * @param {Array|Object} collection The collection to sample.
  22034. * @returns {*} Returns the random element.
  22035. */
  22036. function baseSample(collection) {
  22037. return arraySample(values(collection));
  22038. }
  22039. /**
  22040. * The base implementation of `_.sampleSize` without param guards.
  22041. *
  22042. * @private
  22043. * @param {Array|Object} collection The collection to sample.
  22044. * @param {number} n The number of elements to sample.
  22045. * @returns {Array} Returns the random elements.
  22046. */
  22047. function baseSampleSize(collection, n) {
  22048. var array = values(collection);
  22049. return shuffleSelf(array, baseClamp(n, 0, array.length));
  22050. }
  22051. /**
  22052. * The base implementation of `_.set`.
  22053. *
  22054. * @private
  22055. * @param {Object} object The object to modify.
  22056. * @param {Array|string} path The path of the property to set.
  22057. * @param {*} value The value to set.
  22058. * @param {Function} [customizer] The function to customize path creation.
  22059. * @returns {Object} Returns `object`.
  22060. */
  22061. function baseSet(object, path, value, customizer) {
  22062. if (!isObject(object)) {
  22063. return object;
  22064. }
  22065. path = castPath(path, object);
  22066. var index = -1,
  22067. length = path.length,
  22068. lastIndex = length - 1,
  22069. nested = object;
  22070. while (nested != null && ++index < length) {
  22071. var key = toKey(path[index]),
  22072. newValue = value;
  22073. if (index != lastIndex) {
  22074. var objValue = nested[key];
  22075. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  22076. if (newValue === undefined) {
  22077. newValue = isObject(objValue)
  22078. ? objValue
  22079. : (isIndex(path[index + 1]) ? [] : {});
  22080. }
  22081. }
  22082. assignValue(nested, key, newValue);
  22083. nested = nested[key];
  22084. }
  22085. return object;
  22086. }
  22087. /**
  22088. * The base implementation of `setData` without support for hot loop shorting.
  22089. *
  22090. * @private
  22091. * @param {Function} func The function to associate metadata with.
  22092. * @param {*} data The metadata.
  22093. * @returns {Function} Returns `func`.
  22094. */
  22095. var baseSetData = !metaMap ? identity : function(func, data) {
  22096. metaMap.set(func, data);
  22097. return func;
  22098. };
  22099. /**
  22100. * The base implementation of `setToString` without support for hot loop shorting.
  22101. *
  22102. * @private
  22103. * @param {Function} func The function to modify.
  22104. * @param {Function} string The `toString` result.
  22105. * @returns {Function} Returns `func`.
  22106. */
  22107. var baseSetToString = !defineProperty ? identity : function(func, string) {
  22108. return defineProperty(func, 'toString', {
  22109. 'configurable': true,
  22110. 'enumerable': false,
  22111. 'value': constant(string),
  22112. 'writable': true
  22113. });
  22114. };
  22115. /**
  22116. * The base implementation of `_.shuffle`.
  22117. *
  22118. * @private
  22119. * @param {Array|Object} collection The collection to shuffle.
  22120. * @returns {Array} Returns the new shuffled array.
  22121. */
  22122. function baseShuffle(collection) {
  22123. return shuffleSelf(values(collection));
  22124. }
  22125. /**
  22126. * The base implementation of `_.slice` without an iteratee call guard.
  22127. *
  22128. * @private
  22129. * @param {Array} array The array to slice.
  22130. * @param {number} [start=0] The start position.
  22131. * @param {number} [end=array.length] The end position.
  22132. * @returns {Array} Returns the slice of `array`.
  22133. */
  22134. function baseSlice(array, start, end) {
  22135. var index = -1,
  22136. length = array.length;
  22137. if (start < 0) {
  22138. start = -start > length ? 0 : (length + start);
  22139. }
  22140. end = end > length ? length : end;
  22141. if (end < 0) {
  22142. end += length;
  22143. }
  22144. length = start > end ? 0 : ((end - start) >>> 0);
  22145. start >>>= 0;
  22146. var result = Array(length);
  22147. while (++index < length) {
  22148. result[index] = array[index + start];
  22149. }
  22150. return result;
  22151. }
  22152. /**
  22153. * The base implementation of `_.some` without support for iteratee shorthands.
  22154. *
  22155. * @private
  22156. * @param {Array|Object} collection The collection to iterate over.
  22157. * @param {Function} predicate The function invoked per iteration.
  22158. * @returns {boolean} Returns `true` if any element passes the predicate check,
  22159. * else `false`.
  22160. */
  22161. function baseSome(collection, predicate) {
  22162. var result;
  22163. baseEach(collection, function(value, index, collection) {
  22164. result = predicate(value, index, collection);
  22165. return !result;
  22166. });
  22167. return !!result;
  22168. }
  22169. /**
  22170. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  22171. * performs a binary search of `array` to determine the index at which `value`
  22172. * should be inserted into `array` in order to maintain its sort order.
  22173. *
  22174. * @private
  22175. * @param {Array} array The sorted array to inspect.
  22176. * @param {*} value The value to evaluate.
  22177. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  22178. * @returns {number} Returns the index at which `value` should be inserted
  22179. * into `array`.
  22180. */
  22181. function baseSortedIndex(array, value, retHighest) {
  22182. var low = 0,
  22183. high = array == null ? low : array.length;
  22184. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  22185. while (low < high) {
  22186. var mid = (low + high) >>> 1,
  22187. computed = array[mid];
  22188. if (computed !== null && !isSymbol(computed) &&
  22189. (retHighest ? (computed <= value) : (computed < value))) {
  22190. low = mid + 1;
  22191. } else {
  22192. high = mid;
  22193. }
  22194. }
  22195. return high;
  22196. }
  22197. return baseSortedIndexBy(array, value, identity, retHighest);
  22198. }
  22199. /**
  22200. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  22201. * which invokes `iteratee` for `value` and each element of `array` to compute
  22202. * their sort ranking. The iteratee is invoked with one argument; (value).
  22203. *
  22204. * @private
  22205. * @param {Array} array The sorted array to inspect.
  22206. * @param {*} value The value to evaluate.
  22207. * @param {Function} iteratee The iteratee invoked per element.
  22208. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  22209. * @returns {number} Returns the index at which `value` should be inserted
  22210. * into `array`.
  22211. */
  22212. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  22213. value = iteratee(value);
  22214. var low = 0,
  22215. high = array == null ? 0 : array.length,
  22216. valIsNaN = value !== value,
  22217. valIsNull = value === null,
  22218. valIsSymbol = isSymbol(value),
  22219. valIsUndefined = value === undefined;
  22220. while (low < high) {
  22221. var mid = nativeFloor((low + high) / 2),
  22222. computed = iteratee(array[mid]),
  22223. othIsDefined = computed !== undefined,
  22224. othIsNull = computed === null,
  22225. othIsReflexive = computed === computed,
  22226. othIsSymbol = isSymbol(computed);
  22227. if (valIsNaN) {
  22228. var setLow = retHighest || othIsReflexive;
  22229. } else if (valIsUndefined) {
  22230. setLow = othIsReflexive && (retHighest || othIsDefined);
  22231. } else if (valIsNull) {
  22232. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  22233. } else if (valIsSymbol) {
  22234. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  22235. } else if (othIsNull || othIsSymbol) {
  22236. setLow = false;
  22237. } else {
  22238. setLow = retHighest ? (computed <= value) : (computed < value);
  22239. }
  22240. if (setLow) {
  22241. low = mid + 1;
  22242. } else {
  22243. high = mid;
  22244. }
  22245. }
  22246. return nativeMin(high, MAX_ARRAY_INDEX);
  22247. }
  22248. /**
  22249. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  22250. * support for iteratee shorthands.
  22251. *
  22252. * @private
  22253. * @param {Array} array The array to inspect.
  22254. * @param {Function} [iteratee] The iteratee invoked per element.
  22255. * @returns {Array} Returns the new duplicate free array.
  22256. */
  22257. function baseSortedUniq(array, iteratee) {
  22258. var index = -1,
  22259. length = array.length,
  22260. resIndex = 0,
  22261. result = [];
  22262. while (++index < length) {
  22263. var value = array[index],
  22264. computed = iteratee ? iteratee(value) : value;
  22265. if (!index || !eq(computed, seen)) {
  22266. var seen = computed;
  22267. result[resIndex++] = value === 0 ? 0 : value;
  22268. }
  22269. }
  22270. return result;
  22271. }
  22272. /**
  22273. * The base implementation of `_.toNumber` which doesn't ensure correct
  22274. * conversions of binary, hexadecimal, or octal string values.
  22275. *
  22276. * @private
  22277. * @param {*} value The value to process.
  22278. * @returns {number} Returns the number.
  22279. */
  22280. function baseToNumber(value) {
  22281. if (typeof value == 'number') {
  22282. return value;
  22283. }
  22284. if (isSymbol(value)) {
  22285. return NAN;
  22286. }
  22287. return +value;
  22288. }
  22289. /**
  22290. * The base implementation of `_.toString` which doesn't convert nullish
  22291. * values to empty strings.
  22292. *
  22293. * @private
  22294. * @param {*} value The value to process.
  22295. * @returns {string} Returns the string.
  22296. */
  22297. function baseToString(value) {
  22298. // Exit early for strings to avoid a performance hit in some environments.
  22299. if (typeof value == 'string') {
  22300. return value;
  22301. }
  22302. if (isArray(value)) {
  22303. // Recursively convert values (susceptible to call stack limits).
  22304. return arrayMap(value, baseToString) + '';
  22305. }
  22306. if (isSymbol(value)) {
  22307. return symbolToString ? symbolToString.call(value) : '';
  22308. }
  22309. var result = (value + '');
  22310. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  22311. }
  22312. /**
  22313. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  22314. *
  22315. * @private
  22316. * @param {Array} array The array to inspect.
  22317. * @param {Function} [iteratee] The iteratee invoked per element.
  22318. * @param {Function} [comparator] The comparator invoked per element.
  22319. * @returns {Array} Returns the new duplicate free array.
  22320. */
  22321. function baseUniq(array, iteratee, comparator) {
  22322. var index = -1,
  22323. includes = arrayIncludes,
  22324. length = array.length,
  22325. isCommon = true,
  22326. result = [],
  22327. seen = result;
  22328. if (comparator) {
  22329. isCommon = false;
  22330. includes = arrayIncludesWith;
  22331. }
  22332. else if (length >= LARGE_ARRAY_SIZE) {
  22333. var set = iteratee ? null : createSet(array);
  22334. if (set) {
  22335. return setToArray(set);
  22336. }
  22337. isCommon = false;
  22338. includes = cacheHas;
  22339. seen = new SetCache;
  22340. }
  22341. else {
  22342. seen = iteratee ? [] : result;
  22343. }
  22344. outer:
  22345. while (++index < length) {
  22346. var value = array[index],
  22347. computed = iteratee ? iteratee(value) : value;
  22348. value = (comparator || value !== 0) ? value : 0;
  22349. if (isCommon && computed === computed) {
  22350. var seenIndex = seen.length;
  22351. while (seenIndex--) {
  22352. if (seen[seenIndex] === computed) {
  22353. continue outer;
  22354. }
  22355. }
  22356. if (iteratee) {
  22357. seen.push(computed);
  22358. }
  22359. result.push(value);
  22360. }
  22361. else if (!includes(seen, computed, comparator)) {
  22362. if (seen !== result) {
  22363. seen.push(computed);
  22364. }
  22365. result.push(value);
  22366. }
  22367. }
  22368. return result;
  22369. }
  22370. /**
  22371. * The base implementation of `_.unset`.
  22372. *
  22373. * @private
  22374. * @param {Object} object The object to modify.
  22375. * @param {Array|string} path The property path to unset.
  22376. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  22377. */
  22378. function baseUnset(object, path) {
  22379. path = castPath(path, object);
  22380. object = parent(object, path);
  22381. return object == null || delete object[toKey(last(path))];
  22382. }
  22383. /**
  22384. * The base implementation of `_.update`.
  22385. *
  22386. * @private
  22387. * @param {Object} object The object to modify.
  22388. * @param {Array|string} path The path of the property to update.
  22389. * @param {Function} updater The function to produce the updated value.
  22390. * @param {Function} [customizer] The function to customize path creation.
  22391. * @returns {Object} Returns `object`.
  22392. */
  22393. function baseUpdate(object, path, updater, customizer) {
  22394. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  22395. }
  22396. /**
  22397. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  22398. * without support for iteratee shorthands.
  22399. *
  22400. * @private
  22401. * @param {Array} array The array to query.
  22402. * @param {Function} predicate The function invoked per iteration.
  22403. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  22404. * @param {boolean} [fromRight] Specify iterating from right to left.
  22405. * @returns {Array} Returns the slice of `array`.
  22406. */
  22407. function baseWhile(array, predicate, isDrop, fromRight) {
  22408. var length = array.length,
  22409. index = fromRight ? length : -1;
  22410. while ((fromRight ? index-- : ++index < length) &&
  22411. predicate(array[index], index, array)) {}
  22412. return isDrop
  22413. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  22414. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  22415. }
  22416. /**
  22417. * The base implementation of `wrapperValue` which returns the result of
  22418. * performing a sequence of actions on the unwrapped `value`, where each
  22419. * successive action is supplied the return value of the previous.
  22420. *
  22421. * @private
  22422. * @param {*} value The unwrapped value.
  22423. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  22424. * @returns {*} Returns the resolved value.
  22425. */
  22426. function baseWrapperValue(value, actions) {
  22427. var result = value;
  22428. if (result instanceof LazyWrapper) {
  22429. result = result.value();
  22430. }
  22431. return arrayReduce(actions, function(result, action) {
  22432. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  22433. }, result);
  22434. }
  22435. /**
  22436. * The base implementation of methods like `_.xor`, without support for
  22437. * iteratee shorthands, that accepts an array of arrays to inspect.
  22438. *
  22439. * @private
  22440. * @param {Array} arrays The arrays to inspect.
  22441. * @param {Function} [iteratee] The iteratee invoked per element.
  22442. * @param {Function} [comparator] The comparator invoked per element.
  22443. * @returns {Array} Returns the new array of values.
  22444. */
  22445. function baseXor(arrays, iteratee, comparator) {
  22446. var length = arrays.length;
  22447. if (length < 2) {
  22448. return length ? baseUniq(arrays[0]) : [];
  22449. }
  22450. var index = -1,
  22451. result = Array(length);
  22452. while (++index < length) {
  22453. var array = arrays[index],
  22454. othIndex = -1;
  22455. while (++othIndex < length) {
  22456. if (othIndex != index) {
  22457. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  22458. }
  22459. }
  22460. }
  22461. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  22462. }
  22463. /**
  22464. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  22465. *
  22466. * @private
  22467. * @param {Array} props The property identifiers.
  22468. * @param {Array} values The property values.
  22469. * @param {Function} assignFunc The function to assign values.
  22470. * @returns {Object} Returns the new object.
  22471. */
  22472. function baseZipObject(props, values, assignFunc) {
  22473. var index = -1,
  22474. length = props.length,
  22475. valsLength = values.length,
  22476. result = {};
  22477. while (++index < length) {
  22478. var value = index < valsLength ? values[index] : undefined;
  22479. assignFunc(result, props[index], value);
  22480. }
  22481. return result;
  22482. }
  22483. /**
  22484. * Casts `value` to an empty array if it's not an array like object.
  22485. *
  22486. * @private
  22487. * @param {*} value The value to inspect.
  22488. * @returns {Array|Object} Returns the cast array-like object.
  22489. */
  22490. function castArrayLikeObject(value) {
  22491. return isArrayLikeObject(value) ? value : [];
  22492. }
  22493. /**
  22494. * Casts `value` to `identity` if it's not a function.
  22495. *
  22496. * @private
  22497. * @param {*} value The value to inspect.
  22498. * @returns {Function} Returns cast function.
  22499. */
  22500. function castFunction(value) {
  22501. return typeof value == 'function' ? value : identity;
  22502. }
  22503. /**
  22504. * Casts `value` to a path array if it's not one.
  22505. *
  22506. * @private
  22507. * @param {*} value The value to inspect.
  22508. * @param {Object} [object] The object to query keys on.
  22509. * @returns {Array} Returns the cast property path array.
  22510. */
  22511. function castPath(value, object) {
  22512. if (isArray(value)) {
  22513. return value;
  22514. }
  22515. return isKey(value, object) ? [value] : stringToPath(toString(value));
  22516. }
  22517. /**
  22518. * A `baseRest` alias which can be replaced with `identity` by module
  22519. * replacement plugins.
  22520. *
  22521. * @private
  22522. * @type {Function}
  22523. * @param {Function} func The function to apply a rest parameter to.
  22524. * @returns {Function} Returns the new function.
  22525. */
  22526. var castRest = baseRest;
  22527. /**
  22528. * Casts `array` to a slice if it's needed.
  22529. *
  22530. * @private
  22531. * @param {Array} array The array to inspect.
  22532. * @param {number} start The start position.
  22533. * @param {number} [end=array.length] The end position.
  22534. * @returns {Array} Returns the cast slice.
  22535. */
  22536. function castSlice(array, start, end) {
  22537. var length = array.length;
  22538. end = end === undefined ? length : end;
  22539. return (!start && end >= length) ? array : baseSlice(array, start, end);
  22540. }
  22541. /**
  22542. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  22543. *
  22544. * @private
  22545. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  22546. */
  22547. var clearTimeout = ctxClearTimeout || function(id) {
  22548. return root.clearTimeout(id);
  22549. };
  22550. /**
  22551. * Creates a clone of `buffer`.
  22552. *
  22553. * @private
  22554. * @param {Buffer} buffer The buffer to clone.
  22555. * @param {boolean} [isDeep] Specify a deep clone.
  22556. * @returns {Buffer} Returns the cloned buffer.
  22557. */
  22558. function cloneBuffer(buffer, isDeep) {
  22559. if (isDeep) {
  22560. return buffer.slice();
  22561. }
  22562. var length = buffer.length,
  22563. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  22564. buffer.copy(result);
  22565. return result;
  22566. }
  22567. /**
  22568. * Creates a clone of `arrayBuffer`.
  22569. *
  22570. * @private
  22571. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  22572. * @returns {ArrayBuffer} Returns the cloned array buffer.
  22573. */
  22574. function cloneArrayBuffer(arrayBuffer) {
  22575. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  22576. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  22577. return result;
  22578. }
  22579. /**
  22580. * Creates a clone of `dataView`.
  22581. *
  22582. * @private
  22583. * @param {Object} dataView The data view to clone.
  22584. * @param {boolean} [isDeep] Specify a deep clone.
  22585. * @returns {Object} Returns the cloned data view.
  22586. */
  22587. function cloneDataView(dataView, isDeep) {
  22588. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  22589. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  22590. }
  22591. /**
  22592. * Creates a clone of `regexp`.
  22593. *
  22594. * @private
  22595. * @param {Object} regexp The regexp to clone.
  22596. * @returns {Object} Returns the cloned regexp.
  22597. */
  22598. function cloneRegExp(regexp) {
  22599. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  22600. result.lastIndex = regexp.lastIndex;
  22601. return result;
  22602. }
  22603. /**
  22604. * Creates a clone of the `symbol` object.
  22605. *
  22606. * @private
  22607. * @param {Object} symbol The symbol object to clone.
  22608. * @returns {Object} Returns the cloned symbol object.
  22609. */
  22610. function cloneSymbol(symbol) {
  22611. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  22612. }
  22613. /**
  22614. * Creates a clone of `typedArray`.
  22615. *
  22616. * @private
  22617. * @param {Object} typedArray The typed array to clone.
  22618. * @param {boolean} [isDeep] Specify a deep clone.
  22619. * @returns {Object} Returns the cloned typed array.
  22620. */
  22621. function cloneTypedArray(typedArray, isDeep) {
  22622. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  22623. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  22624. }
  22625. /**
  22626. * Compares values to sort them in ascending order.
  22627. *
  22628. * @private
  22629. * @param {*} value The value to compare.
  22630. * @param {*} other The other value to compare.
  22631. * @returns {number} Returns the sort order indicator for `value`.
  22632. */
  22633. function compareAscending(value, other) {
  22634. if (value !== other) {
  22635. var valIsDefined = value !== undefined,
  22636. valIsNull = value === null,
  22637. valIsReflexive = value === value,
  22638. valIsSymbol = isSymbol(value);
  22639. var othIsDefined = other !== undefined,
  22640. othIsNull = other === null,
  22641. othIsReflexive = other === other,
  22642. othIsSymbol = isSymbol(other);
  22643. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  22644. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  22645. (valIsNull && othIsDefined && othIsReflexive) ||
  22646. (!valIsDefined && othIsReflexive) ||
  22647. !valIsReflexive) {
  22648. return 1;
  22649. }
  22650. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  22651. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  22652. (othIsNull && valIsDefined && valIsReflexive) ||
  22653. (!othIsDefined && valIsReflexive) ||
  22654. !othIsReflexive) {
  22655. return -1;
  22656. }
  22657. }
  22658. return 0;
  22659. }
  22660. /**
  22661. * Used by `_.orderBy` to compare multiple properties of a value to another
  22662. * and stable sort them.
  22663. *
  22664. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  22665. * specify an order of "desc" for descending or "asc" for ascending sort order
  22666. * of corresponding values.
  22667. *
  22668. * @private
  22669. * @param {Object} object The object to compare.
  22670. * @param {Object} other The other object to compare.
  22671. * @param {boolean[]|string[]} orders The order to sort by for each property.
  22672. * @returns {number} Returns the sort order indicator for `object`.
  22673. */
  22674. function compareMultiple(object, other, orders) {
  22675. var index = -1,
  22676. objCriteria = object.criteria,
  22677. othCriteria = other.criteria,
  22678. length = objCriteria.length,
  22679. ordersLength = orders.length;
  22680. while (++index < length) {
  22681. var result = compareAscending(objCriteria[index], othCriteria[index]);
  22682. if (result) {
  22683. if (index >= ordersLength) {
  22684. return result;
  22685. }
  22686. var order = orders[index];
  22687. return result * (order == 'desc' ? -1 : 1);
  22688. }
  22689. }
  22690. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  22691. // that causes it, under certain circumstances, to provide the same value for
  22692. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  22693. // for more details.
  22694. //
  22695. // This also ensures a stable sort in V8 and other engines.
  22696. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  22697. return object.index - other.index;
  22698. }
  22699. /**
  22700. * Creates an array that is the composition of partially applied arguments,
  22701. * placeholders, and provided arguments into a single array of arguments.
  22702. *
  22703. * @private
  22704. * @param {Array} args The provided arguments.
  22705. * @param {Array} partials The arguments to prepend to those provided.
  22706. * @param {Array} holders The `partials` placeholder indexes.
  22707. * @params {boolean} [isCurried] Specify composing for a curried function.
  22708. * @returns {Array} Returns the new array of composed arguments.
  22709. */
  22710. function composeArgs(args, partials, holders, isCurried) {
  22711. var argsIndex = -1,
  22712. argsLength = args.length,
  22713. holdersLength = holders.length,
  22714. leftIndex = -1,
  22715. leftLength = partials.length,
  22716. rangeLength = nativeMax(argsLength - holdersLength, 0),
  22717. result = Array(leftLength + rangeLength),
  22718. isUncurried = !isCurried;
  22719. while (++leftIndex < leftLength) {
  22720. result[leftIndex] = partials[leftIndex];
  22721. }
  22722. while (++argsIndex < holdersLength) {
  22723. if (isUncurried || argsIndex < argsLength) {
  22724. result[holders[argsIndex]] = args[argsIndex];
  22725. }
  22726. }
  22727. while (rangeLength--) {
  22728. result[leftIndex++] = args[argsIndex++];
  22729. }
  22730. return result;
  22731. }
  22732. /**
  22733. * This function is like `composeArgs` except that the arguments composition
  22734. * is tailored for `_.partialRight`.
  22735. *
  22736. * @private
  22737. * @param {Array} args The provided arguments.
  22738. * @param {Array} partials The arguments to append to those provided.
  22739. * @param {Array} holders The `partials` placeholder indexes.
  22740. * @params {boolean} [isCurried] Specify composing for a curried function.
  22741. * @returns {Array} Returns the new array of composed arguments.
  22742. */
  22743. function composeArgsRight(args, partials, holders, isCurried) {
  22744. var argsIndex = -1,
  22745. argsLength = args.length,
  22746. holdersIndex = -1,
  22747. holdersLength = holders.length,
  22748. rightIndex = -1,
  22749. rightLength = partials.length,
  22750. rangeLength = nativeMax(argsLength - holdersLength, 0),
  22751. result = Array(rangeLength + rightLength),
  22752. isUncurried = !isCurried;
  22753. while (++argsIndex < rangeLength) {
  22754. result[argsIndex] = args[argsIndex];
  22755. }
  22756. var offset = argsIndex;
  22757. while (++rightIndex < rightLength) {
  22758. result[offset + rightIndex] = partials[rightIndex];
  22759. }
  22760. while (++holdersIndex < holdersLength) {
  22761. if (isUncurried || argsIndex < argsLength) {
  22762. result[offset + holders[holdersIndex]] = args[argsIndex++];
  22763. }
  22764. }
  22765. return result;
  22766. }
  22767. /**
  22768. * Copies the values of `source` to `array`.
  22769. *
  22770. * @private
  22771. * @param {Array} source The array to copy values from.
  22772. * @param {Array} [array=[]] The array to copy values to.
  22773. * @returns {Array} Returns `array`.
  22774. */
  22775. function copyArray(source, array) {
  22776. var index = -1,
  22777. length = source.length;
  22778. array || (array = Array(length));
  22779. while (++index < length) {
  22780. array[index] = source[index];
  22781. }
  22782. return array;
  22783. }
  22784. /**
  22785. * Copies properties of `source` to `object`.
  22786. *
  22787. * @private
  22788. * @param {Object} source The object to copy properties from.
  22789. * @param {Array} props The property identifiers to copy.
  22790. * @param {Object} [object={}] The object to copy properties to.
  22791. * @param {Function} [customizer] The function to customize copied values.
  22792. * @returns {Object} Returns `object`.
  22793. */
  22794. function copyObject(source, props, object, customizer) {
  22795. var isNew = !object;
  22796. object || (object = {});
  22797. var index = -1,
  22798. length = props.length;
  22799. while (++index < length) {
  22800. var key = props[index];
  22801. var newValue = customizer
  22802. ? customizer(object[key], source[key], key, object, source)
  22803. : undefined;
  22804. if (newValue === undefined) {
  22805. newValue = source[key];
  22806. }
  22807. if (isNew) {
  22808. baseAssignValue(object, key, newValue);
  22809. } else {
  22810. assignValue(object, key, newValue);
  22811. }
  22812. }
  22813. return object;
  22814. }
  22815. /**
  22816. * Copies own symbols of `source` to `object`.
  22817. *
  22818. * @private
  22819. * @param {Object} source The object to copy symbols from.
  22820. * @param {Object} [object={}] The object to copy symbols to.
  22821. * @returns {Object} Returns `object`.
  22822. */
  22823. function copySymbols(source, object) {
  22824. return copyObject(source, getSymbols(source), object);
  22825. }
  22826. /**
  22827. * Copies own and inherited symbols of `source` to `object`.
  22828. *
  22829. * @private
  22830. * @param {Object} source The object to copy symbols from.
  22831. * @param {Object} [object={}] The object to copy symbols to.
  22832. * @returns {Object} Returns `object`.
  22833. */
  22834. function copySymbolsIn(source, object) {
  22835. return copyObject(source, getSymbolsIn(source), object);
  22836. }
  22837. /**
  22838. * Creates a function like `_.groupBy`.
  22839. *
  22840. * @private
  22841. * @param {Function} setter The function to set accumulator values.
  22842. * @param {Function} [initializer] The accumulator object initializer.
  22843. * @returns {Function} Returns the new aggregator function.
  22844. */
  22845. function createAggregator(setter, initializer) {
  22846. return function(collection, iteratee) {
  22847. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  22848. accumulator = initializer ? initializer() : {};
  22849. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  22850. };
  22851. }
  22852. /**
  22853. * Creates a function like `_.assign`.
  22854. *
  22855. * @private
  22856. * @param {Function} assigner The function to assign values.
  22857. * @returns {Function} Returns the new assigner function.
  22858. */
  22859. function createAssigner(assigner) {
  22860. return baseRest(function(object, sources) {
  22861. var index = -1,
  22862. length = sources.length,
  22863. customizer = length > 1 ? sources[length - 1] : undefined,
  22864. guard = length > 2 ? sources[2] : undefined;
  22865. customizer = (assigner.length > 3 && typeof customizer == 'function')
  22866. ? (length--, customizer)
  22867. : undefined;
  22868. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  22869. customizer = length < 3 ? undefined : customizer;
  22870. length = 1;
  22871. }
  22872. object = Object(object);
  22873. while (++index < length) {
  22874. var source = sources[index];
  22875. if (source) {
  22876. assigner(object, source, index, customizer);
  22877. }
  22878. }
  22879. return object;
  22880. });
  22881. }
  22882. /**
  22883. * Creates a `baseEach` or `baseEachRight` function.
  22884. *
  22885. * @private
  22886. * @param {Function} eachFunc The function to iterate over a collection.
  22887. * @param {boolean} [fromRight] Specify iterating from right to left.
  22888. * @returns {Function} Returns the new base function.
  22889. */
  22890. function createBaseEach(eachFunc, fromRight) {
  22891. return function(collection, iteratee) {
  22892. if (collection == null) {
  22893. return collection;
  22894. }
  22895. if (!isArrayLike(collection)) {
  22896. return eachFunc(collection, iteratee);
  22897. }
  22898. var length = collection.length,
  22899. index = fromRight ? length : -1,
  22900. iterable = Object(collection);
  22901. while ((fromRight ? index-- : ++index < length)) {
  22902. if (iteratee(iterable[index], index, iterable) === false) {
  22903. break;
  22904. }
  22905. }
  22906. return collection;
  22907. };
  22908. }
  22909. /**
  22910. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  22911. *
  22912. * @private
  22913. * @param {boolean} [fromRight] Specify iterating from right to left.
  22914. * @returns {Function} Returns the new base function.
  22915. */
  22916. function createBaseFor(fromRight) {
  22917. return function(object, iteratee, keysFunc) {
  22918. var index = -1,
  22919. iterable = Object(object),
  22920. props = keysFunc(object),
  22921. length = props.length;
  22922. while (length--) {
  22923. var key = props[fromRight ? length : ++index];
  22924. if (iteratee(iterable[key], key, iterable) === false) {
  22925. break;
  22926. }
  22927. }
  22928. return object;
  22929. };
  22930. }
  22931. /**
  22932. * Creates a function that wraps `func` to invoke it with the optional `this`
  22933. * binding of `thisArg`.
  22934. *
  22935. * @private
  22936. * @param {Function} func The function to wrap.
  22937. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  22938. * @param {*} [thisArg] The `this` binding of `func`.
  22939. * @returns {Function} Returns the new wrapped function.
  22940. */
  22941. function createBind(func, bitmask, thisArg) {
  22942. var isBind = bitmask & WRAP_BIND_FLAG,
  22943. Ctor = createCtor(func);
  22944. function wrapper() {
  22945. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  22946. return fn.apply(isBind ? thisArg : this, arguments);
  22947. }
  22948. return wrapper;
  22949. }
  22950. /**
  22951. * Creates a function like `_.lowerFirst`.
  22952. *
  22953. * @private
  22954. * @param {string} methodName The name of the `String` case method to use.
  22955. * @returns {Function} Returns the new case function.
  22956. */
  22957. function createCaseFirst(methodName) {
  22958. return function(string) {
  22959. string = toString(string);
  22960. var strSymbols = hasUnicode(string)
  22961. ? stringToArray(string)
  22962. : undefined;
  22963. var chr = strSymbols
  22964. ? strSymbols[0]
  22965. : string.charAt(0);
  22966. var trailing = strSymbols
  22967. ? castSlice(strSymbols, 1).join('')
  22968. : string.slice(1);
  22969. return chr[methodName]() + trailing;
  22970. };
  22971. }
  22972. /**
  22973. * Creates a function like `_.camelCase`.
  22974. *
  22975. * @private
  22976. * @param {Function} callback The function to combine each word.
  22977. * @returns {Function} Returns the new compounder function.
  22978. */
  22979. function createCompounder(callback) {
  22980. return function(string) {
  22981. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  22982. };
  22983. }
  22984. /**
  22985. * Creates a function that produces an instance of `Ctor` regardless of
  22986. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  22987. *
  22988. * @private
  22989. * @param {Function} Ctor The constructor to wrap.
  22990. * @returns {Function} Returns the new wrapped function.
  22991. */
  22992. function createCtor(Ctor) {
  22993. return function() {
  22994. // Use a `switch` statement to work with class constructors. See
  22995. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  22996. // for more details.
  22997. var args = arguments;
  22998. switch (args.length) {
  22999. case 0: return new Ctor;
  23000. case 1: return new Ctor(args[0]);
  23001. case 2: return new Ctor(args[0], args[1]);
  23002. case 3: return new Ctor(args[0], args[1], args[2]);
  23003. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  23004. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  23005. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  23006. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  23007. }
  23008. var thisBinding = baseCreate(Ctor.prototype),
  23009. result = Ctor.apply(thisBinding, args);
  23010. // Mimic the constructor's `return` behavior.
  23011. // See https://es5.github.io/#x13.2.2 for more details.
  23012. return isObject(result) ? result : thisBinding;
  23013. };
  23014. }
  23015. /**
  23016. * Creates a function that wraps `func` to enable currying.
  23017. *
  23018. * @private
  23019. * @param {Function} func The function to wrap.
  23020. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23021. * @param {number} arity The arity of `func`.
  23022. * @returns {Function} Returns the new wrapped function.
  23023. */
  23024. function createCurry(func, bitmask, arity) {
  23025. var Ctor = createCtor(func);
  23026. function wrapper() {
  23027. var length = arguments.length,
  23028. args = Array(length),
  23029. index = length,
  23030. placeholder = getHolder(wrapper);
  23031. while (index--) {
  23032. args[index] = arguments[index];
  23033. }
  23034. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  23035. ? []
  23036. : replaceHolders(args, placeholder);
  23037. length -= holders.length;
  23038. if (length < arity) {
  23039. return createRecurry(
  23040. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  23041. args, holders, undefined, undefined, arity - length);
  23042. }
  23043. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23044. return apply(fn, this, args);
  23045. }
  23046. return wrapper;
  23047. }
  23048. /**
  23049. * Creates a `_.find` or `_.findLast` function.
  23050. *
  23051. * @private
  23052. * @param {Function} findIndexFunc The function to find the collection index.
  23053. * @returns {Function} Returns the new find function.
  23054. */
  23055. function createFind(findIndexFunc) {
  23056. return function(collection, predicate, fromIndex) {
  23057. var iterable = Object(collection);
  23058. if (!isArrayLike(collection)) {
  23059. var iteratee = getIteratee(predicate, 3);
  23060. collection = keys(collection);
  23061. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  23062. }
  23063. var index = findIndexFunc(collection, predicate, fromIndex);
  23064. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  23065. };
  23066. }
  23067. /**
  23068. * Creates a `_.flow` or `_.flowRight` function.
  23069. *
  23070. * @private
  23071. * @param {boolean} [fromRight] Specify iterating from right to left.
  23072. * @returns {Function} Returns the new flow function.
  23073. */
  23074. function createFlow(fromRight) {
  23075. return flatRest(function(funcs) {
  23076. var length = funcs.length,
  23077. index = length,
  23078. prereq = LodashWrapper.prototype.thru;
  23079. if (fromRight) {
  23080. funcs.reverse();
  23081. }
  23082. while (index--) {
  23083. var func = funcs[index];
  23084. if (typeof func != 'function') {
  23085. throw new TypeError(FUNC_ERROR_TEXT);
  23086. }
  23087. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  23088. var wrapper = new LodashWrapper([], true);
  23089. }
  23090. }
  23091. index = wrapper ? index : length;
  23092. while (++index < length) {
  23093. func = funcs[index];
  23094. var funcName = getFuncName(func),
  23095. data = funcName == 'wrapper' ? getData(func) : undefined;
  23096. if (data && isLaziable(data[0]) &&
  23097. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  23098. !data[4].length && data[9] == 1
  23099. ) {
  23100. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  23101. } else {
  23102. wrapper = (func.length == 1 && isLaziable(func))
  23103. ? wrapper[funcName]()
  23104. : wrapper.thru(func);
  23105. }
  23106. }
  23107. return function() {
  23108. var args = arguments,
  23109. value = args[0];
  23110. if (wrapper && args.length == 1 && isArray(value)) {
  23111. return wrapper.plant(value).value();
  23112. }
  23113. var index = 0,
  23114. result = length ? funcs[index].apply(this, args) : value;
  23115. while (++index < length) {
  23116. result = funcs[index].call(this, result);
  23117. }
  23118. return result;
  23119. };
  23120. });
  23121. }
  23122. /**
  23123. * Creates a function that wraps `func` to invoke it with optional `this`
  23124. * binding of `thisArg`, partial application, and currying.
  23125. *
  23126. * @private
  23127. * @param {Function|string} func The function or method name to wrap.
  23128. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23129. * @param {*} [thisArg] The `this` binding of `func`.
  23130. * @param {Array} [partials] The arguments to prepend to those provided to
  23131. * the new function.
  23132. * @param {Array} [holders] The `partials` placeholder indexes.
  23133. * @param {Array} [partialsRight] The arguments to append to those provided
  23134. * to the new function.
  23135. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  23136. * @param {Array} [argPos] The argument positions of the new function.
  23137. * @param {number} [ary] The arity cap of `func`.
  23138. * @param {number} [arity] The arity of `func`.
  23139. * @returns {Function} Returns the new wrapped function.
  23140. */
  23141. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  23142. var isAry = bitmask & WRAP_ARY_FLAG,
  23143. isBind = bitmask & WRAP_BIND_FLAG,
  23144. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  23145. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  23146. isFlip = bitmask & WRAP_FLIP_FLAG,
  23147. Ctor = isBindKey ? undefined : createCtor(func);
  23148. function wrapper() {
  23149. var length = arguments.length,
  23150. args = Array(length),
  23151. index = length;
  23152. while (index--) {
  23153. args[index] = arguments[index];
  23154. }
  23155. if (isCurried) {
  23156. var placeholder = getHolder(wrapper),
  23157. holdersCount = countHolders(args, placeholder);
  23158. }
  23159. if (partials) {
  23160. args = composeArgs(args, partials, holders, isCurried);
  23161. }
  23162. if (partialsRight) {
  23163. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  23164. }
  23165. length -= holdersCount;
  23166. if (isCurried && length < arity) {
  23167. var newHolders = replaceHolders(args, placeholder);
  23168. return createRecurry(
  23169. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  23170. args, newHolders, argPos, ary, arity - length
  23171. );
  23172. }
  23173. var thisBinding = isBind ? thisArg : this,
  23174. fn = isBindKey ? thisBinding[func] : func;
  23175. length = args.length;
  23176. if (argPos) {
  23177. args = reorder(args, argPos);
  23178. } else if (isFlip && length > 1) {
  23179. args.reverse();
  23180. }
  23181. if (isAry && ary < length) {
  23182. args.length = ary;
  23183. }
  23184. if (this && this !== root && this instanceof wrapper) {
  23185. fn = Ctor || createCtor(fn);
  23186. }
  23187. return fn.apply(thisBinding, args);
  23188. }
  23189. return wrapper;
  23190. }
  23191. /**
  23192. * Creates a function like `_.invertBy`.
  23193. *
  23194. * @private
  23195. * @param {Function} setter The function to set accumulator values.
  23196. * @param {Function} toIteratee The function to resolve iteratees.
  23197. * @returns {Function} Returns the new inverter function.
  23198. */
  23199. function createInverter(setter, toIteratee) {
  23200. return function(object, iteratee) {
  23201. return baseInverter(object, setter, toIteratee(iteratee), {});
  23202. };
  23203. }
  23204. /**
  23205. * Creates a function that performs a mathematical operation on two values.
  23206. *
  23207. * @private
  23208. * @param {Function} operator The function to perform the operation.
  23209. * @param {number} [defaultValue] The value used for `undefined` arguments.
  23210. * @returns {Function} Returns the new mathematical operation function.
  23211. */
  23212. function createMathOperation(operator, defaultValue) {
  23213. return function(value, other) {
  23214. var result;
  23215. if (value === undefined && other === undefined) {
  23216. return defaultValue;
  23217. }
  23218. if (value !== undefined) {
  23219. result = value;
  23220. }
  23221. if (other !== undefined) {
  23222. if (result === undefined) {
  23223. return other;
  23224. }
  23225. if (typeof value == 'string' || typeof other == 'string') {
  23226. value = baseToString(value);
  23227. other = baseToString(other);
  23228. } else {
  23229. value = baseToNumber(value);
  23230. other = baseToNumber(other);
  23231. }
  23232. result = operator(value, other);
  23233. }
  23234. return result;
  23235. };
  23236. }
  23237. /**
  23238. * Creates a function like `_.over`.
  23239. *
  23240. * @private
  23241. * @param {Function} arrayFunc The function to iterate over iteratees.
  23242. * @returns {Function} Returns the new over function.
  23243. */
  23244. function createOver(arrayFunc) {
  23245. return flatRest(function(iteratees) {
  23246. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  23247. return baseRest(function(args) {
  23248. var thisArg = this;
  23249. return arrayFunc(iteratees, function(iteratee) {
  23250. return apply(iteratee, thisArg, args);
  23251. });
  23252. });
  23253. });
  23254. }
  23255. /**
  23256. * Creates the padding for `string` based on `length`. The `chars` string
  23257. * is truncated if the number of characters exceeds `length`.
  23258. *
  23259. * @private
  23260. * @param {number} length The padding length.
  23261. * @param {string} [chars=' '] The string used as padding.
  23262. * @returns {string} Returns the padding for `string`.
  23263. */
  23264. function createPadding(length, chars) {
  23265. chars = chars === undefined ? ' ' : baseToString(chars);
  23266. var charsLength = chars.length;
  23267. if (charsLength < 2) {
  23268. return charsLength ? baseRepeat(chars, length) : chars;
  23269. }
  23270. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  23271. return hasUnicode(chars)
  23272. ? castSlice(stringToArray(result), 0, length).join('')
  23273. : result.slice(0, length);
  23274. }
  23275. /**
  23276. * Creates a function that wraps `func` to invoke it with the `this` binding
  23277. * of `thisArg` and `partials` prepended to the arguments it receives.
  23278. *
  23279. * @private
  23280. * @param {Function} func The function to wrap.
  23281. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23282. * @param {*} thisArg The `this` binding of `func`.
  23283. * @param {Array} partials The arguments to prepend to those provided to
  23284. * the new function.
  23285. * @returns {Function} Returns the new wrapped function.
  23286. */
  23287. function createPartial(func, bitmask, thisArg, partials) {
  23288. var isBind = bitmask & WRAP_BIND_FLAG,
  23289. Ctor = createCtor(func);
  23290. function wrapper() {
  23291. var argsIndex = -1,
  23292. argsLength = arguments.length,
  23293. leftIndex = -1,
  23294. leftLength = partials.length,
  23295. args = Array(leftLength + argsLength),
  23296. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23297. while (++leftIndex < leftLength) {
  23298. args[leftIndex] = partials[leftIndex];
  23299. }
  23300. while (argsLength--) {
  23301. args[leftIndex++] = arguments[++argsIndex];
  23302. }
  23303. return apply(fn, isBind ? thisArg : this, args);
  23304. }
  23305. return wrapper;
  23306. }
  23307. /**
  23308. * Creates a `_.range` or `_.rangeRight` function.
  23309. *
  23310. * @private
  23311. * @param {boolean} [fromRight] Specify iterating from right to left.
  23312. * @returns {Function} Returns the new range function.
  23313. */
  23314. function createRange(fromRight) {
  23315. return function(start, end, step) {
  23316. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  23317. end = step = undefined;
  23318. }
  23319. // Ensure the sign of `-0` is preserved.
  23320. start = toFinite(start);
  23321. if (end === undefined) {
  23322. end = start;
  23323. start = 0;
  23324. } else {
  23325. end = toFinite(end);
  23326. }
  23327. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  23328. return baseRange(start, end, step, fromRight);
  23329. };
  23330. }
  23331. /**
  23332. * Creates a function that performs a relational operation on two values.
  23333. *
  23334. * @private
  23335. * @param {Function} operator The function to perform the operation.
  23336. * @returns {Function} Returns the new relational operation function.
  23337. */
  23338. function createRelationalOperation(operator) {
  23339. return function(value, other) {
  23340. if (!(typeof value == 'string' && typeof other == 'string')) {
  23341. value = toNumber(value);
  23342. other = toNumber(other);
  23343. }
  23344. return operator(value, other);
  23345. };
  23346. }
  23347. /**
  23348. * Creates a function that wraps `func` to continue currying.
  23349. *
  23350. * @private
  23351. * @param {Function} func The function to wrap.
  23352. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23353. * @param {Function} wrapFunc The function to create the `func` wrapper.
  23354. * @param {*} placeholder The placeholder value.
  23355. * @param {*} [thisArg] The `this` binding of `func`.
  23356. * @param {Array} [partials] The arguments to prepend to those provided to
  23357. * the new function.
  23358. * @param {Array} [holders] The `partials` placeholder indexes.
  23359. * @param {Array} [argPos] The argument positions of the new function.
  23360. * @param {number} [ary] The arity cap of `func`.
  23361. * @param {number} [arity] The arity of `func`.
  23362. * @returns {Function} Returns the new wrapped function.
  23363. */
  23364. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  23365. var isCurry = bitmask & WRAP_CURRY_FLAG,
  23366. newHolders = isCurry ? holders : undefined,
  23367. newHoldersRight = isCurry ? undefined : holders,
  23368. newPartials = isCurry ? partials : undefined,
  23369. newPartialsRight = isCurry ? undefined : partials;
  23370. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  23371. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  23372. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  23373. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  23374. }
  23375. var newData = [
  23376. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  23377. newHoldersRight, argPos, ary, arity
  23378. ];
  23379. var result = wrapFunc.apply(undefined, newData);
  23380. if (isLaziable(func)) {
  23381. setData(result, newData);
  23382. }
  23383. result.placeholder = placeholder;
  23384. return setWrapToString(result, func, bitmask);
  23385. }
  23386. /**
  23387. * Creates a function like `_.round`.
  23388. *
  23389. * @private
  23390. * @param {string} methodName The name of the `Math` method to use when rounding.
  23391. * @returns {Function} Returns the new round function.
  23392. */
  23393. function createRound(methodName) {
  23394. var func = Math[methodName];
  23395. return function(number, precision) {
  23396. number = toNumber(number);
  23397. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  23398. if (precision && nativeIsFinite(number)) {
  23399. // Shift with exponential notation to avoid floating-point issues.
  23400. // See [MDN](https://mdn.io/round#Examples) for more details.
  23401. var pair = (toString(number) + 'e').split('e'),
  23402. value = func(pair[0] + 'e' + (+pair[1] + precision));
  23403. pair = (toString(value) + 'e').split('e');
  23404. return +(pair[0] + 'e' + (+pair[1] - precision));
  23405. }
  23406. return func(number);
  23407. };
  23408. }
  23409. /**
  23410. * Creates a set object of `values`.
  23411. *
  23412. * @private
  23413. * @param {Array} values The values to add to the set.
  23414. * @returns {Object} Returns the new set.
  23415. */
  23416. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  23417. return new Set(values);
  23418. };
  23419. /**
  23420. * Creates a `_.toPairs` or `_.toPairsIn` function.
  23421. *
  23422. * @private
  23423. * @param {Function} keysFunc The function to get the keys of a given object.
  23424. * @returns {Function} Returns the new pairs function.
  23425. */
  23426. function createToPairs(keysFunc) {
  23427. return function(object) {
  23428. var tag = getTag(object);
  23429. if (tag == mapTag) {
  23430. return mapToArray(object);
  23431. }
  23432. if (tag == setTag) {
  23433. return setToPairs(object);
  23434. }
  23435. return baseToPairs(object, keysFunc(object));
  23436. };
  23437. }
  23438. /**
  23439. * Creates a function that either curries or invokes `func` with optional
  23440. * `this` binding and partially applied arguments.
  23441. *
  23442. * @private
  23443. * @param {Function|string} func The function or method name to wrap.
  23444. * @param {number} bitmask The bitmask flags.
  23445. * 1 - `_.bind`
  23446. * 2 - `_.bindKey`
  23447. * 4 - `_.curry` or `_.curryRight` of a bound function
  23448. * 8 - `_.curry`
  23449. * 16 - `_.curryRight`
  23450. * 32 - `_.partial`
  23451. * 64 - `_.partialRight`
  23452. * 128 - `_.rearg`
  23453. * 256 - `_.ary`
  23454. * 512 - `_.flip`
  23455. * @param {*} [thisArg] The `this` binding of `func`.
  23456. * @param {Array} [partials] The arguments to be partially applied.
  23457. * @param {Array} [holders] The `partials` placeholder indexes.
  23458. * @param {Array} [argPos] The argument positions of the new function.
  23459. * @param {number} [ary] The arity cap of `func`.
  23460. * @param {number} [arity] The arity of `func`.
  23461. * @returns {Function} Returns the new wrapped function.
  23462. */
  23463. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  23464. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  23465. if (!isBindKey && typeof func != 'function') {
  23466. throw new TypeError(FUNC_ERROR_TEXT);
  23467. }
  23468. var length = partials ? partials.length : 0;
  23469. if (!length) {
  23470. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  23471. partials = holders = undefined;
  23472. }
  23473. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  23474. arity = arity === undefined ? arity : toInteger(arity);
  23475. length -= holders ? holders.length : 0;
  23476. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  23477. var partialsRight = partials,
  23478. holdersRight = holders;
  23479. partials = holders = undefined;
  23480. }
  23481. var data = isBindKey ? undefined : getData(func);
  23482. var newData = [
  23483. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  23484. argPos, ary, arity
  23485. ];
  23486. if (data) {
  23487. mergeData(newData, data);
  23488. }
  23489. func = newData[0];
  23490. bitmask = newData[1];
  23491. thisArg = newData[2];
  23492. partials = newData[3];
  23493. holders = newData[4];
  23494. arity = newData[9] = newData[9] === undefined
  23495. ? (isBindKey ? 0 : func.length)
  23496. : nativeMax(newData[9] - length, 0);
  23497. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  23498. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  23499. }
  23500. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  23501. var result = createBind(func, bitmask, thisArg);
  23502. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  23503. result = createCurry(func, bitmask, arity);
  23504. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  23505. result = createPartial(func, bitmask, thisArg, partials);
  23506. } else {
  23507. result = createHybrid.apply(undefined, newData);
  23508. }
  23509. var setter = data ? baseSetData : setData;
  23510. return setWrapToString(setter(result, newData), func, bitmask);
  23511. }
  23512. /**
  23513. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  23514. * of source objects to the destination object for all destination properties
  23515. * that resolve to `undefined`.
  23516. *
  23517. * @private
  23518. * @param {*} objValue The destination value.
  23519. * @param {*} srcValue The source value.
  23520. * @param {string} key The key of the property to assign.
  23521. * @param {Object} object The parent object of `objValue`.
  23522. * @returns {*} Returns the value to assign.
  23523. */
  23524. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  23525. if (objValue === undefined ||
  23526. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  23527. return srcValue;
  23528. }
  23529. return objValue;
  23530. }
  23531. /**
  23532. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  23533. * objects into destination objects that are passed thru.
  23534. *
  23535. * @private
  23536. * @param {*} objValue The destination value.
  23537. * @param {*} srcValue The source value.
  23538. * @param {string} key The key of the property to merge.
  23539. * @param {Object} object The parent object of `objValue`.
  23540. * @param {Object} source The parent object of `srcValue`.
  23541. * @param {Object} [stack] Tracks traversed source values and their merged
  23542. * counterparts.
  23543. * @returns {*} Returns the value to assign.
  23544. */
  23545. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  23546. if (isObject(objValue) && isObject(srcValue)) {
  23547. // Recursively merge objects and arrays (susceptible to call stack limits).
  23548. stack.set(srcValue, objValue);
  23549. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  23550. stack['delete'](srcValue);
  23551. }
  23552. return objValue;
  23553. }
  23554. /**
  23555. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  23556. * objects.
  23557. *
  23558. * @private
  23559. * @param {*} value The value to inspect.
  23560. * @param {string} key The key of the property to inspect.
  23561. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  23562. */
  23563. function customOmitClone(value) {
  23564. return isPlainObject(value) ? undefined : value;
  23565. }
  23566. /**
  23567. * A specialized version of `baseIsEqualDeep` for arrays with support for
  23568. * partial deep comparisons.
  23569. *
  23570. * @private
  23571. * @param {Array} array The array to compare.
  23572. * @param {Array} other The other array to compare.
  23573. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  23574. * @param {Function} customizer The function to customize comparisons.
  23575. * @param {Function} equalFunc The function to determine equivalents of values.
  23576. * @param {Object} stack Tracks traversed `array` and `other` objects.
  23577. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  23578. */
  23579. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  23580. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  23581. arrLength = array.length,
  23582. othLength = other.length;
  23583. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  23584. return false;
  23585. }
  23586. // Assume cyclic values are equal.
  23587. var stacked = stack.get(array);
  23588. if (stacked && stack.get(other)) {
  23589. return stacked == other;
  23590. }
  23591. var index = -1,
  23592. result = true,
  23593. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  23594. stack.set(array, other);
  23595. stack.set(other, array);
  23596. // Ignore non-index properties.
  23597. while (++index < arrLength) {
  23598. var arrValue = array[index],
  23599. othValue = other[index];
  23600. if (customizer) {
  23601. var compared = isPartial
  23602. ? customizer(othValue, arrValue, index, other, array, stack)
  23603. : customizer(arrValue, othValue, index, array, other, stack);
  23604. }
  23605. if (compared !== undefined) {
  23606. if (compared) {
  23607. continue;
  23608. }
  23609. result = false;
  23610. break;
  23611. }
  23612. // Recursively compare arrays (susceptible to call stack limits).
  23613. if (seen) {
  23614. if (!arraySome(other, function(othValue, othIndex) {
  23615. if (!cacheHas(seen, othIndex) &&
  23616. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  23617. return seen.push(othIndex);
  23618. }
  23619. })) {
  23620. result = false;
  23621. break;
  23622. }
  23623. } else if (!(
  23624. arrValue === othValue ||
  23625. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  23626. )) {
  23627. result = false;
  23628. break;
  23629. }
  23630. }
  23631. stack['delete'](array);
  23632. stack['delete'](other);
  23633. return result;
  23634. }
  23635. /**
  23636. * A specialized version of `baseIsEqualDeep` for comparing objects of
  23637. * the same `toStringTag`.
  23638. *
  23639. * **Note:** This function only supports comparing values with tags of
  23640. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  23641. *
  23642. * @private
  23643. * @param {Object} object The object to compare.
  23644. * @param {Object} other The other object to compare.
  23645. * @param {string} tag The `toStringTag` of the objects to compare.
  23646. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  23647. * @param {Function} customizer The function to customize comparisons.
  23648. * @param {Function} equalFunc The function to determine equivalents of values.
  23649. * @param {Object} stack Tracks traversed `object` and `other` objects.
  23650. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  23651. */
  23652. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  23653. switch (tag) {
  23654. case dataViewTag:
  23655. if ((object.byteLength != other.byteLength) ||
  23656. (object.byteOffset != other.byteOffset)) {
  23657. return false;
  23658. }
  23659. object = object.buffer;
  23660. other = other.buffer;
  23661. case arrayBufferTag:
  23662. if ((object.byteLength != other.byteLength) ||
  23663. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  23664. return false;
  23665. }
  23666. return true;
  23667. case boolTag:
  23668. case dateTag:
  23669. case numberTag:
  23670. // Coerce booleans to `1` or `0` and dates to milliseconds.
  23671. // Invalid dates are coerced to `NaN`.
  23672. return eq(+object, +other);
  23673. case errorTag:
  23674. return object.name == other.name && object.message == other.message;
  23675. case regexpTag:
  23676. case stringTag:
  23677. // Coerce regexes to strings and treat strings, primitives and objects,
  23678. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  23679. // for more details.
  23680. return object == (other + '');
  23681. case mapTag:
  23682. var convert = mapToArray;
  23683. case setTag:
  23684. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  23685. convert || (convert = setToArray);
  23686. if (object.size != other.size && !isPartial) {
  23687. return false;
  23688. }
  23689. // Assume cyclic values are equal.
  23690. var stacked = stack.get(object);
  23691. if (stacked) {
  23692. return stacked == other;
  23693. }
  23694. bitmask |= COMPARE_UNORDERED_FLAG;
  23695. // Recursively compare objects (susceptible to call stack limits).
  23696. stack.set(object, other);
  23697. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  23698. stack['delete'](object);
  23699. return result;
  23700. case symbolTag:
  23701. if (symbolValueOf) {
  23702. return symbolValueOf.call(object) == symbolValueOf.call(other);
  23703. }
  23704. }
  23705. return false;
  23706. }
  23707. /**
  23708. * A specialized version of `baseIsEqualDeep` for objects with support for
  23709. * partial deep comparisons.
  23710. *
  23711. * @private
  23712. * @param {Object} object The object to compare.
  23713. * @param {Object} other The other object to compare.
  23714. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  23715. * @param {Function} customizer The function to customize comparisons.
  23716. * @param {Function} equalFunc The function to determine equivalents of values.
  23717. * @param {Object} stack Tracks traversed `object` and `other` objects.
  23718. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  23719. */
  23720. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  23721. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  23722. objProps = getAllKeys(object),
  23723. objLength = objProps.length,
  23724. othProps = getAllKeys(other),
  23725. othLength = othProps.length;
  23726. if (objLength != othLength && !isPartial) {
  23727. return false;
  23728. }
  23729. var index = objLength;
  23730. while (index--) {
  23731. var key = objProps[index];
  23732. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  23733. return false;
  23734. }
  23735. }
  23736. // Assume cyclic values are equal.
  23737. var stacked = stack.get(object);
  23738. if (stacked && stack.get(other)) {
  23739. return stacked == other;
  23740. }
  23741. var result = true;
  23742. stack.set(object, other);
  23743. stack.set(other, object);
  23744. var skipCtor = isPartial;
  23745. while (++index < objLength) {
  23746. key = objProps[index];
  23747. var objValue = object[key],
  23748. othValue = other[key];
  23749. if (customizer) {
  23750. var compared = isPartial
  23751. ? customizer(othValue, objValue, key, other, object, stack)
  23752. : customizer(objValue, othValue, key, object, other, stack);
  23753. }
  23754. // Recursively compare objects (susceptible to call stack limits).
  23755. if (!(compared === undefined
  23756. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  23757. : compared
  23758. )) {
  23759. result = false;
  23760. break;
  23761. }
  23762. skipCtor || (skipCtor = key == 'constructor');
  23763. }
  23764. if (result && !skipCtor) {
  23765. var objCtor = object.constructor,
  23766. othCtor = other.constructor;
  23767. // Non `Object` object instances with different constructors are not equal.
  23768. if (objCtor != othCtor &&
  23769. ('constructor' in object && 'constructor' in other) &&
  23770. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  23771. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  23772. result = false;
  23773. }
  23774. }
  23775. stack['delete'](object);
  23776. stack['delete'](other);
  23777. return result;
  23778. }
  23779. /**
  23780. * A specialized version of `baseRest` which flattens the rest array.
  23781. *
  23782. * @private
  23783. * @param {Function} func The function to apply a rest parameter to.
  23784. * @returns {Function} Returns the new function.
  23785. */
  23786. function flatRest(func) {
  23787. return setToString(overRest(func, undefined, flatten), func + '');
  23788. }
  23789. /**
  23790. * Creates an array of own enumerable property names and symbols of `object`.
  23791. *
  23792. * @private
  23793. * @param {Object} object The object to query.
  23794. * @returns {Array} Returns the array of property names and symbols.
  23795. */
  23796. function getAllKeys(object) {
  23797. return baseGetAllKeys(object, keys, getSymbols);
  23798. }
  23799. /**
  23800. * Creates an array of own and inherited enumerable property names and
  23801. * symbols of `object`.
  23802. *
  23803. * @private
  23804. * @param {Object} object The object to query.
  23805. * @returns {Array} Returns the array of property names and symbols.
  23806. */
  23807. function getAllKeysIn(object) {
  23808. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  23809. }
  23810. /**
  23811. * Gets metadata for `func`.
  23812. *
  23813. * @private
  23814. * @param {Function} func The function to query.
  23815. * @returns {*} Returns the metadata for `func`.
  23816. */
  23817. var getData = !metaMap ? noop : function(func) {
  23818. return metaMap.get(func);
  23819. };
  23820. /**
  23821. * Gets the name of `func`.
  23822. *
  23823. * @private
  23824. * @param {Function} func The function to query.
  23825. * @returns {string} Returns the function name.
  23826. */
  23827. function getFuncName(func) {
  23828. var result = (func.name + ''),
  23829. array = realNames[result],
  23830. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  23831. while (length--) {
  23832. var data = array[length],
  23833. otherFunc = data.func;
  23834. if (otherFunc == null || otherFunc == func) {
  23835. return data.name;
  23836. }
  23837. }
  23838. return result;
  23839. }
  23840. /**
  23841. * Gets the argument placeholder value for `func`.
  23842. *
  23843. * @private
  23844. * @param {Function} func The function to inspect.
  23845. * @returns {*} Returns the placeholder value.
  23846. */
  23847. function getHolder(func) {
  23848. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  23849. return object.placeholder;
  23850. }
  23851. /**
  23852. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  23853. * this function returns the custom method, otherwise it returns `baseIteratee`.
  23854. * If arguments are provided, the chosen function is invoked with them and
  23855. * its result is returned.
  23856. *
  23857. * @private
  23858. * @param {*} [value] The value to convert to an iteratee.
  23859. * @param {number} [arity] The arity of the created iteratee.
  23860. * @returns {Function} Returns the chosen function or its result.
  23861. */
  23862. function getIteratee() {
  23863. var result = lodash.iteratee || iteratee;
  23864. result = result === iteratee ? baseIteratee : result;
  23865. return arguments.length ? result(arguments[0], arguments[1]) : result;
  23866. }
  23867. /**
  23868. * Gets the data for `map`.
  23869. *
  23870. * @private
  23871. * @param {Object} map The map to query.
  23872. * @param {string} key The reference key.
  23873. * @returns {*} Returns the map data.
  23874. */
  23875. function getMapData(map, key) {
  23876. var data = map.__data__;
  23877. return isKeyable(key)
  23878. ? data[typeof key == 'string' ? 'string' : 'hash']
  23879. : data.map;
  23880. }
  23881. /**
  23882. * Gets the property names, values, and compare flags of `object`.
  23883. *
  23884. * @private
  23885. * @param {Object} object The object to query.
  23886. * @returns {Array} Returns the match data of `object`.
  23887. */
  23888. function getMatchData(object) {
  23889. var result = keys(object),
  23890. length = result.length;
  23891. while (length--) {
  23892. var key = result[length],
  23893. value = object[key];
  23894. result[length] = [key, value, isStrictComparable(value)];
  23895. }
  23896. return result;
  23897. }
  23898. /**
  23899. * Gets the native function at `key` of `object`.
  23900. *
  23901. * @private
  23902. * @param {Object} object The object to query.
  23903. * @param {string} key The key of the method to get.
  23904. * @returns {*} Returns the function if it's native, else `undefined`.
  23905. */
  23906. function getNative(object, key) {
  23907. var value = getValue(object, key);
  23908. return baseIsNative(value) ? value : undefined;
  23909. }
  23910. /**
  23911. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  23912. *
  23913. * @private
  23914. * @param {*} value The value to query.
  23915. * @returns {string} Returns the raw `toStringTag`.
  23916. */
  23917. function getRawTag(value) {
  23918. var isOwn = hasOwnProperty.call(value, symToStringTag),
  23919. tag = value[symToStringTag];
  23920. try {
  23921. value[symToStringTag] = undefined;
  23922. var unmasked = true;
  23923. } catch (e) {}
  23924. var result = nativeObjectToString.call(value);
  23925. if (unmasked) {
  23926. if (isOwn) {
  23927. value[symToStringTag] = tag;
  23928. } else {
  23929. delete value[symToStringTag];
  23930. }
  23931. }
  23932. return result;
  23933. }
  23934. /**
  23935. * Creates an array of the own enumerable symbols of `object`.
  23936. *
  23937. * @private
  23938. * @param {Object} object The object to query.
  23939. * @returns {Array} Returns the array of symbols.
  23940. */
  23941. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  23942. if (object == null) {
  23943. return [];
  23944. }
  23945. object = Object(object);
  23946. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  23947. return propertyIsEnumerable.call(object, symbol);
  23948. });
  23949. };
  23950. /**
  23951. * Creates an array of the own and inherited enumerable symbols of `object`.
  23952. *
  23953. * @private
  23954. * @param {Object} object The object to query.
  23955. * @returns {Array} Returns the array of symbols.
  23956. */
  23957. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  23958. var result = [];
  23959. while (object) {
  23960. arrayPush(result, getSymbols(object));
  23961. object = getPrototype(object);
  23962. }
  23963. return result;
  23964. };
  23965. /**
  23966. * Gets the `toStringTag` of `value`.
  23967. *
  23968. * @private
  23969. * @param {*} value The value to query.
  23970. * @returns {string} Returns the `toStringTag`.
  23971. */
  23972. var getTag = baseGetTag;
  23973. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  23974. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  23975. (Map && getTag(new Map) != mapTag) ||
  23976. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  23977. (Set && getTag(new Set) != setTag) ||
  23978. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  23979. getTag = function(value) {
  23980. var result = baseGetTag(value),
  23981. Ctor = result == objectTag ? value.constructor : undefined,
  23982. ctorString = Ctor ? toSource(Ctor) : '';
  23983. if (ctorString) {
  23984. switch (ctorString) {
  23985. case dataViewCtorString: return dataViewTag;
  23986. case mapCtorString: return mapTag;
  23987. case promiseCtorString: return promiseTag;
  23988. case setCtorString: return setTag;
  23989. case weakMapCtorString: return weakMapTag;
  23990. }
  23991. }
  23992. return result;
  23993. };
  23994. }
  23995. /**
  23996. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  23997. *
  23998. * @private
  23999. * @param {number} start The start of the view.
  24000. * @param {number} end The end of the view.
  24001. * @param {Array} transforms The transformations to apply to the view.
  24002. * @returns {Object} Returns an object containing the `start` and `end`
  24003. * positions of the view.
  24004. */
  24005. function getView(start, end, transforms) {
  24006. var index = -1,
  24007. length = transforms.length;
  24008. while (++index < length) {
  24009. var data = transforms[index],
  24010. size = data.size;
  24011. switch (data.type) {
  24012. case 'drop': start += size; break;
  24013. case 'dropRight': end -= size; break;
  24014. case 'take': end = nativeMin(end, start + size); break;
  24015. case 'takeRight': start = nativeMax(start, end - size); break;
  24016. }
  24017. }
  24018. return { 'start': start, 'end': end };
  24019. }
  24020. /**
  24021. * Extracts wrapper details from the `source` body comment.
  24022. *
  24023. * @private
  24024. * @param {string} source The source to inspect.
  24025. * @returns {Array} Returns the wrapper details.
  24026. */
  24027. function getWrapDetails(source) {
  24028. var match = source.match(reWrapDetails);
  24029. return match ? match[1].split(reSplitDetails) : [];
  24030. }
  24031. /**
  24032. * Checks if `path` exists on `object`.
  24033. *
  24034. * @private
  24035. * @param {Object} object The object to query.
  24036. * @param {Array|string} path The path to check.
  24037. * @param {Function} hasFunc The function to check properties.
  24038. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  24039. */
  24040. function hasPath(object, path, hasFunc) {
  24041. path = castPath(path, object);
  24042. var index = -1,
  24043. length = path.length,
  24044. result = false;
  24045. while (++index < length) {
  24046. var key = toKey(path[index]);
  24047. if (!(result = object != null && hasFunc(object, key))) {
  24048. break;
  24049. }
  24050. object = object[key];
  24051. }
  24052. if (result || ++index != length) {
  24053. return result;
  24054. }
  24055. length = object == null ? 0 : object.length;
  24056. return !!length && isLength(length) && isIndex(key, length) &&
  24057. (isArray(object) || isArguments(object));
  24058. }
  24059. /**
  24060. * Initializes an array clone.
  24061. *
  24062. * @private
  24063. * @param {Array} array The array to clone.
  24064. * @returns {Array} Returns the initialized clone.
  24065. */
  24066. function initCloneArray(array) {
  24067. var length = array.length,
  24068. result = new array.constructor(length);
  24069. // Add properties assigned by `RegExp#exec`.
  24070. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  24071. result.index = array.index;
  24072. result.input = array.input;
  24073. }
  24074. return result;
  24075. }
  24076. /**
  24077. * Initializes an object clone.
  24078. *
  24079. * @private
  24080. * @param {Object} object The object to clone.
  24081. * @returns {Object} Returns the initialized clone.
  24082. */
  24083. function initCloneObject(object) {
  24084. return (typeof object.constructor == 'function' && !isPrototype(object))
  24085. ? baseCreate(getPrototype(object))
  24086. : {};
  24087. }
  24088. /**
  24089. * Initializes an object clone based on its `toStringTag`.
  24090. *
  24091. * **Note:** This function only supports cloning values with tags of
  24092. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  24093. *
  24094. * @private
  24095. * @param {Object} object The object to clone.
  24096. * @param {string} tag The `toStringTag` of the object to clone.
  24097. * @param {boolean} [isDeep] Specify a deep clone.
  24098. * @returns {Object} Returns the initialized clone.
  24099. */
  24100. function initCloneByTag(object, tag, isDeep) {
  24101. var Ctor = object.constructor;
  24102. switch (tag) {
  24103. case arrayBufferTag:
  24104. return cloneArrayBuffer(object);
  24105. case boolTag:
  24106. case dateTag:
  24107. return new Ctor(+object);
  24108. case dataViewTag:
  24109. return cloneDataView(object, isDeep);
  24110. case float32Tag: case float64Tag:
  24111. case int8Tag: case int16Tag: case int32Tag:
  24112. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  24113. return cloneTypedArray(object, isDeep);
  24114. case mapTag:
  24115. return new Ctor;
  24116. case numberTag:
  24117. case stringTag:
  24118. return new Ctor(object);
  24119. case regexpTag:
  24120. return cloneRegExp(object);
  24121. case setTag:
  24122. return new Ctor;
  24123. case symbolTag:
  24124. return cloneSymbol(object);
  24125. }
  24126. }
  24127. /**
  24128. * Inserts wrapper `details` in a comment at the top of the `source` body.
  24129. *
  24130. * @private
  24131. * @param {string} source The source to modify.
  24132. * @returns {Array} details The details to insert.
  24133. * @returns {string} Returns the modified source.
  24134. */
  24135. function insertWrapDetails(source, details) {
  24136. var length = details.length;
  24137. if (!length) {
  24138. return source;
  24139. }
  24140. var lastIndex = length - 1;
  24141. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  24142. details = details.join(length > 2 ? ', ' : ' ');
  24143. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  24144. }
  24145. /**
  24146. * Checks if `value` is a flattenable `arguments` object or array.
  24147. *
  24148. * @private
  24149. * @param {*} value The value to check.
  24150. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  24151. */
  24152. function isFlattenable(value) {
  24153. return isArray(value) || isArguments(value) ||
  24154. !!(spreadableSymbol && value && value[spreadableSymbol]);
  24155. }
  24156. /**
  24157. * Checks if `value` is a valid array-like index.
  24158. *
  24159. * @private
  24160. * @param {*} value The value to check.
  24161. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  24162. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  24163. */
  24164. function isIndex(value, length) {
  24165. var type = typeof value;
  24166. length = length == null ? MAX_SAFE_INTEGER : length;
  24167. return !!length &&
  24168. (type == 'number' ||
  24169. (type != 'symbol' && reIsUint.test(value))) &&
  24170. (value > -1 && value % 1 == 0 && value < length);
  24171. }
  24172. /**
  24173. * Checks if the given arguments are from an iteratee call.
  24174. *
  24175. * @private
  24176. * @param {*} value The potential iteratee value argument.
  24177. * @param {*} index The potential iteratee index or key argument.
  24178. * @param {*} object The potential iteratee object argument.
  24179. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  24180. * else `false`.
  24181. */
  24182. function isIterateeCall(value, index, object) {
  24183. if (!isObject(object)) {
  24184. return false;
  24185. }
  24186. var type = typeof index;
  24187. if (type == 'number'
  24188. ? (isArrayLike(object) && isIndex(index, object.length))
  24189. : (type == 'string' && index in object)
  24190. ) {
  24191. return eq(object[index], value);
  24192. }
  24193. return false;
  24194. }
  24195. /**
  24196. * Checks if `value` is a property name and not a property path.
  24197. *
  24198. * @private
  24199. * @param {*} value The value to check.
  24200. * @param {Object} [object] The object to query keys on.
  24201. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  24202. */
  24203. function isKey(value, object) {
  24204. if (isArray(value)) {
  24205. return false;
  24206. }
  24207. var type = typeof value;
  24208. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  24209. value == null || isSymbol(value)) {
  24210. return true;
  24211. }
  24212. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  24213. (object != null && value in Object(object));
  24214. }
  24215. /**
  24216. * Checks if `value` is suitable for use as unique object key.
  24217. *
  24218. * @private
  24219. * @param {*} value The value to check.
  24220. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  24221. */
  24222. function isKeyable(value) {
  24223. var type = typeof value;
  24224. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  24225. ? (value !== '__proto__')
  24226. : (value === null);
  24227. }
  24228. /**
  24229. * Checks if `func` has a lazy counterpart.
  24230. *
  24231. * @private
  24232. * @param {Function} func The function to check.
  24233. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  24234. * else `false`.
  24235. */
  24236. function isLaziable(func) {
  24237. var funcName = getFuncName(func),
  24238. other = lodash[funcName];
  24239. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  24240. return false;
  24241. }
  24242. if (func === other) {
  24243. return true;
  24244. }
  24245. var data = getData(other);
  24246. return !!data && func === data[0];
  24247. }
  24248. /**
  24249. * Checks if `func` has its source masked.
  24250. *
  24251. * @private
  24252. * @param {Function} func The function to check.
  24253. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  24254. */
  24255. function isMasked(func) {
  24256. return !!maskSrcKey && (maskSrcKey in func);
  24257. }
  24258. /**
  24259. * Checks if `func` is capable of being masked.
  24260. *
  24261. * @private
  24262. * @param {*} value The value to check.
  24263. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  24264. */
  24265. var isMaskable = coreJsData ? isFunction : stubFalse;
  24266. /**
  24267. * Checks if `value` is likely a prototype object.
  24268. *
  24269. * @private
  24270. * @param {*} value The value to check.
  24271. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  24272. */
  24273. function isPrototype(value) {
  24274. var Ctor = value && value.constructor,
  24275. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  24276. return value === proto;
  24277. }
  24278. /**
  24279. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  24280. *
  24281. * @private
  24282. * @param {*} value The value to check.
  24283. * @returns {boolean} Returns `true` if `value` if suitable for strict
  24284. * equality comparisons, else `false`.
  24285. */
  24286. function isStrictComparable(value) {
  24287. return value === value && !isObject(value);
  24288. }
  24289. /**
  24290. * A specialized version of `matchesProperty` for source values suitable
  24291. * for strict equality comparisons, i.e. `===`.
  24292. *
  24293. * @private
  24294. * @param {string} key The key of the property to get.
  24295. * @param {*} srcValue The value to match.
  24296. * @returns {Function} Returns the new spec function.
  24297. */
  24298. function matchesStrictComparable(key, srcValue) {
  24299. return function(object) {
  24300. if (object == null) {
  24301. return false;
  24302. }
  24303. return object[key] === srcValue &&
  24304. (srcValue !== undefined || (key in Object(object)));
  24305. };
  24306. }
  24307. /**
  24308. * A specialized version of `_.memoize` which clears the memoized function's
  24309. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  24310. *
  24311. * @private
  24312. * @param {Function} func The function to have its output memoized.
  24313. * @returns {Function} Returns the new memoized function.
  24314. */
  24315. function memoizeCapped(func) {
  24316. var result = memoize(func, function(key) {
  24317. if (cache.size === MAX_MEMOIZE_SIZE) {
  24318. cache.clear();
  24319. }
  24320. return key;
  24321. });
  24322. var cache = result.cache;
  24323. return result;
  24324. }
  24325. /**
  24326. * Merges the function metadata of `source` into `data`.
  24327. *
  24328. * Merging metadata reduces the number of wrappers used to invoke a function.
  24329. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  24330. * may be applied regardless of execution order. Methods like `_.ary` and
  24331. * `_.rearg` modify function arguments, making the order in which they are
  24332. * executed important, preventing the merging of metadata. However, we make
  24333. * an exception for a safe combined case where curried functions have `_.ary`
  24334. * and or `_.rearg` applied.
  24335. *
  24336. * @private
  24337. * @param {Array} data The destination metadata.
  24338. * @param {Array} source The source metadata.
  24339. * @returns {Array} Returns `data`.
  24340. */
  24341. function mergeData(data, source) {
  24342. var bitmask = data[1],
  24343. srcBitmask = source[1],
  24344. newBitmask = bitmask | srcBitmask,
  24345. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  24346. var isCombo =
  24347. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  24348. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  24349. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  24350. // Exit early if metadata can't be merged.
  24351. if (!(isCommon || isCombo)) {
  24352. return data;
  24353. }
  24354. // Use source `thisArg` if available.
  24355. if (srcBitmask & WRAP_BIND_FLAG) {
  24356. data[2] = source[2];
  24357. // Set when currying a bound function.
  24358. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  24359. }
  24360. // Compose partial arguments.
  24361. var value = source[3];
  24362. if (value) {
  24363. var partials = data[3];
  24364. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  24365. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  24366. }
  24367. // Compose partial right arguments.
  24368. value = source[5];
  24369. if (value) {
  24370. partials = data[5];
  24371. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  24372. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  24373. }
  24374. // Use source `argPos` if available.
  24375. value = source[7];
  24376. if (value) {
  24377. data[7] = value;
  24378. }
  24379. // Use source `ary` if it's smaller.
  24380. if (srcBitmask & WRAP_ARY_FLAG) {
  24381. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  24382. }
  24383. // Use source `arity` if one is not provided.
  24384. if (data[9] == null) {
  24385. data[9] = source[9];
  24386. }
  24387. // Use source `func` and merge bitmasks.
  24388. data[0] = source[0];
  24389. data[1] = newBitmask;
  24390. return data;
  24391. }
  24392. /**
  24393. * This function is like
  24394. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  24395. * except that it includes inherited enumerable properties.
  24396. *
  24397. * @private
  24398. * @param {Object} object The object to query.
  24399. * @returns {Array} Returns the array of property names.
  24400. */
  24401. function nativeKeysIn(object) {
  24402. var result = [];
  24403. if (object != null) {
  24404. for (var key in Object(object)) {
  24405. result.push(key);
  24406. }
  24407. }
  24408. return result;
  24409. }
  24410. /**
  24411. * Converts `value` to a string using `Object.prototype.toString`.
  24412. *
  24413. * @private
  24414. * @param {*} value The value to convert.
  24415. * @returns {string} Returns the converted string.
  24416. */
  24417. function objectToString(value) {
  24418. return nativeObjectToString.call(value);
  24419. }
  24420. /**
  24421. * A specialized version of `baseRest` which transforms the rest array.
  24422. *
  24423. * @private
  24424. * @param {Function} func The function to apply a rest parameter to.
  24425. * @param {number} [start=func.length-1] The start position of the rest parameter.
  24426. * @param {Function} transform The rest array transform.
  24427. * @returns {Function} Returns the new function.
  24428. */
  24429. function overRest(func, start, transform) {
  24430. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  24431. return function() {
  24432. var args = arguments,
  24433. index = -1,
  24434. length = nativeMax(args.length - start, 0),
  24435. array = Array(length);
  24436. while (++index < length) {
  24437. array[index] = args[start + index];
  24438. }
  24439. index = -1;
  24440. var otherArgs = Array(start + 1);
  24441. while (++index < start) {
  24442. otherArgs[index] = args[index];
  24443. }
  24444. otherArgs[start] = transform(array);
  24445. return apply(func, this, otherArgs);
  24446. };
  24447. }
  24448. /**
  24449. * Gets the parent value at `path` of `object`.
  24450. *
  24451. * @private
  24452. * @param {Object} object The object to query.
  24453. * @param {Array} path The path to get the parent value of.
  24454. * @returns {*} Returns the parent value.
  24455. */
  24456. function parent(object, path) {
  24457. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  24458. }
  24459. /**
  24460. * Reorder `array` according to the specified indexes where the element at
  24461. * the first index is assigned as the first element, the element at
  24462. * the second index is assigned as the second element, and so on.
  24463. *
  24464. * @private
  24465. * @param {Array} array The array to reorder.
  24466. * @param {Array} indexes The arranged array indexes.
  24467. * @returns {Array} Returns `array`.
  24468. */
  24469. function reorder(array, indexes) {
  24470. var arrLength = array.length,
  24471. length = nativeMin(indexes.length, arrLength),
  24472. oldArray = copyArray(array);
  24473. while (length--) {
  24474. var index = indexes[length];
  24475. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  24476. }
  24477. return array;
  24478. }
  24479. /**
  24480. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  24481. *
  24482. * @private
  24483. * @param {Object} object The object to query.
  24484. * @param {string} key The key of the property to get.
  24485. * @returns {*} Returns the property value.
  24486. */
  24487. function safeGet(object, key) {
  24488. if (key === 'constructor' && typeof object[key] === 'function') {
  24489. return;
  24490. }
  24491. if (key == '__proto__') {
  24492. return;
  24493. }
  24494. return object[key];
  24495. }
  24496. /**
  24497. * Sets metadata for `func`.
  24498. *
  24499. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  24500. * period of time, it will trip its breaker and transition to an identity
  24501. * function to avoid garbage collection pauses in V8. See
  24502. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  24503. * for more details.
  24504. *
  24505. * @private
  24506. * @param {Function} func The function to associate metadata with.
  24507. * @param {*} data The metadata.
  24508. * @returns {Function} Returns `func`.
  24509. */
  24510. var setData = shortOut(baseSetData);
  24511. /**
  24512. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  24513. *
  24514. * @private
  24515. * @param {Function} func The function to delay.
  24516. * @param {number} wait The number of milliseconds to delay invocation.
  24517. * @returns {number|Object} Returns the timer id or timeout object.
  24518. */
  24519. var setTimeout = ctxSetTimeout || function(func, wait) {
  24520. return root.setTimeout(func, wait);
  24521. };
  24522. /**
  24523. * Sets the `toString` method of `func` to return `string`.
  24524. *
  24525. * @private
  24526. * @param {Function} func The function to modify.
  24527. * @param {Function} string The `toString` result.
  24528. * @returns {Function} Returns `func`.
  24529. */
  24530. var setToString = shortOut(baseSetToString);
  24531. /**
  24532. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  24533. * with wrapper details in a comment at the top of the source body.
  24534. *
  24535. * @private
  24536. * @param {Function} wrapper The function to modify.
  24537. * @param {Function} reference The reference function.
  24538. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  24539. * @returns {Function} Returns `wrapper`.
  24540. */
  24541. function setWrapToString(wrapper, reference, bitmask) {
  24542. var source = (reference + '');
  24543. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  24544. }
  24545. /**
  24546. * Creates a function that'll short out and invoke `identity` instead
  24547. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  24548. * milliseconds.
  24549. *
  24550. * @private
  24551. * @param {Function} func The function to restrict.
  24552. * @returns {Function} Returns the new shortable function.
  24553. */
  24554. function shortOut(func) {
  24555. var count = 0,
  24556. lastCalled = 0;
  24557. return function() {
  24558. var stamp = nativeNow(),
  24559. remaining = HOT_SPAN - (stamp - lastCalled);
  24560. lastCalled = stamp;
  24561. if (remaining > 0) {
  24562. if (++count >= HOT_COUNT) {
  24563. return arguments[0];
  24564. }
  24565. } else {
  24566. count = 0;
  24567. }
  24568. return func.apply(undefined, arguments);
  24569. };
  24570. }
  24571. /**
  24572. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  24573. *
  24574. * @private
  24575. * @param {Array} array The array to shuffle.
  24576. * @param {number} [size=array.length] The size of `array`.
  24577. * @returns {Array} Returns `array`.
  24578. */
  24579. function shuffleSelf(array, size) {
  24580. var index = -1,
  24581. length = array.length,
  24582. lastIndex = length - 1;
  24583. size = size === undefined ? length : size;
  24584. while (++index < size) {
  24585. var rand = baseRandom(index, lastIndex),
  24586. value = array[rand];
  24587. array[rand] = array[index];
  24588. array[index] = value;
  24589. }
  24590. array.length = size;
  24591. return array;
  24592. }
  24593. /**
  24594. * Converts `string` to a property path array.
  24595. *
  24596. * @private
  24597. * @param {string} string The string to convert.
  24598. * @returns {Array} Returns the property path array.
  24599. */
  24600. var stringToPath = memoizeCapped(function(string) {
  24601. var result = [];
  24602. if (string.charCodeAt(0) === 46 /* . */) {
  24603. result.push('');
  24604. }
  24605. string.replace(rePropName, function(match, number, quote, subString) {
  24606. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  24607. });
  24608. return result;
  24609. });
  24610. /**
  24611. * Converts `value` to a string key if it's not a string or symbol.
  24612. *
  24613. * @private
  24614. * @param {*} value The value to inspect.
  24615. * @returns {string|symbol} Returns the key.
  24616. */
  24617. function toKey(value) {
  24618. if (typeof value == 'string' || isSymbol(value)) {
  24619. return value;
  24620. }
  24621. var result = (value + '');
  24622. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  24623. }
  24624. /**
  24625. * Converts `func` to its source code.
  24626. *
  24627. * @private
  24628. * @param {Function} func The function to convert.
  24629. * @returns {string} Returns the source code.
  24630. */
  24631. function toSource(func) {
  24632. if (func != null) {
  24633. try {
  24634. return funcToString.call(func);
  24635. } catch (e) {}
  24636. try {
  24637. return (func + '');
  24638. } catch (e) {}
  24639. }
  24640. return '';
  24641. }
  24642. /**
  24643. * Updates wrapper `details` based on `bitmask` flags.
  24644. *
  24645. * @private
  24646. * @returns {Array} details The details to modify.
  24647. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  24648. * @returns {Array} Returns `details`.
  24649. */
  24650. function updateWrapDetails(details, bitmask) {
  24651. arrayEach(wrapFlags, function(pair) {
  24652. var value = '_.' + pair[0];
  24653. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  24654. details.push(value);
  24655. }
  24656. });
  24657. return details.sort();
  24658. }
  24659. /**
  24660. * Creates a clone of `wrapper`.
  24661. *
  24662. * @private
  24663. * @param {Object} wrapper The wrapper to clone.
  24664. * @returns {Object} Returns the cloned wrapper.
  24665. */
  24666. function wrapperClone(wrapper) {
  24667. if (wrapper instanceof LazyWrapper) {
  24668. return wrapper.clone();
  24669. }
  24670. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  24671. result.__actions__ = copyArray(wrapper.__actions__);
  24672. result.__index__ = wrapper.__index__;
  24673. result.__values__ = wrapper.__values__;
  24674. return result;
  24675. }
  24676. /*------------------------------------------------------------------------*/
  24677. /**
  24678. * Creates an array of elements split into groups the length of `size`.
  24679. * If `array` can't be split evenly, the final chunk will be the remaining
  24680. * elements.
  24681. *
  24682. * @static
  24683. * @memberOf _
  24684. * @since 3.0.0
  24685. * @category Array
  24686. * @param {Array} array The array to process.
  24687. * @param {number} [size=1] The length of each chunk
  24688. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  24689. * @returns {Array} Returns the new array of chunks.
  24690. * @example
  24691. *
  24692. * _.chunk(['a', 'b', 'c', 'd'], 2);
  24693. * // => [['a', 'b'], ['c', 'd']]
  24694. *
  24695. * _.chunk(['a', 'b', 'c', 'd'], 3);
  24696. * // => [['a', 'b', 'c'], ['d']]
  24697. */
  24698. function chunk(array, size, guard) {
  24699. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  24700. size = 1;
  24701. } else {
  24702. size = nativeMax(toInteger(size), 0);
  24703. }
  24704. var length = array == null ? 0 : array.length;
  24705. if (!length || size < 1) {
  24706. return [];
  24707. }
  24708. var index = 0,
  24709. resIndex = 0,
  24710. result = Array(nativeCeil(length / size));
  24711. while (index < length) {
  24712. result[resIndex++] = baseSlice(array, index, (index += size));
  24713. }
  24714. return result;
  24715. }
  24716. /**
  24717. * Creates an array with all falsey values removed. The values `false`, `null`,
  24718. * `0`, `""`, `undefined`, and `NaN` are falsey.
  24719. *
  24720. * @static
  24721. * @memberOf _
  24722. * @since 0.1.0
  24723. * @category Array
  24724. * @param {Array} array The array to compact.
  24725. * @returns {Array} Returns the new array of filtered values.
  24726. * @example
  24727. *
  24728. * _.compact([0, 1, false, 2, '', 3]);
  24729. * // => [1, 2, 3]
  24730. */
  24731. function compact(array) {
  24732. var index = -1,
  24733. length = array == null ? 0 : array.length,
  24734. resIndex = 0,
  24735. result = [];
  24736. while (++index < length) {
  24737. var value = array[index];
  24738. if (value) {
  24739. result[resIndex++] = value;
  24740. }
  24741. }
  24742. return result;
  24743. }
  24744. /**
  24745. * Creates a new array concatenating `array` with any additional arrays
  24746. * and/or values.
  24747. *
  24748. * @static
  24749. * @memberOf _
  24750. * @since 4.0.0
  24751. * @category Array
  24752. * @param {Array} array The array to concatenate.
  24753. * @param {...*} [values] The values to concatenate.
  24754. * @returns {Array} Returns the new concatenated array.
  24755. * @example
  24756. *
  24757. * var array = [1];
  24758. * var other = _.concat(array, 2, [3], [[4]]);
  24759. *
  24760. * console.log(other);
  24761. * // => [1, 2, 3, [4]]
  24762. *
  24763. * console.log(array);
  24764. * // => [1]
  24765. */
  24766. function concat() {
  24767. var length = arguments.length;
  24768. if (!length) {
  24769. return [];
  24770. }
  24771. var args = Array(length - 1),
  24772. array = arguments[0],
  24773. index = length;
  24774. while (index--) {
  24775. args[index - 1] = arguments[index];
  24776. }
  24777. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  24778. }
  24779. /**
  24780. * Creates an array of `array` values not included in the other given arrays
  24781. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  24782. * for equality comparisons. The order and references of result values are
  24783. * determined by the first array.
  24784. *
  24785. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  24786. *
  24787. * @static
  24788. * @memberOf _
  24789. * @since 0.1.0
  24790. * @category Array
  24791. * @param {Array} array The array to inspect.
  24792. * @param {...Array} [values] The values to exclude.
  24793. * @returns {Array} Returns the new array of filtered values.
  24794. * @see _.without, _.xor
  24795. * @example
  24796. *
  24797. * _.difference([2, 1], [2, 3]);
  24798. * // => [1]
  24799. */
  24800. var difference = baseRest(function(array, values) {
  24801. return isArrayLikeObject(array)
  24802. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  24803. : [];
  24804. });
  24805. /**
  24806. * This method is like `_.difference` except that it accepts `iteratee` which
  24807. * is invoked for each element of `array` and `values` to generate the criterion
  24808. * by which they're compared. The order and references of result values are
  24809. * determined by the first array. The iteratee is invoked with one argument:
  24810. * (value).
  24811. *
  24812. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  24813. *
  24814. * @static
  24815. * @memberOf _
  24816. * @since 4.0.0
  24817. * @category Array
  24818. * @param {Array} array The array to inspect.
  24819. * @param {...Array} [values] The values to exclude.
  24820. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  24821. * @returns {Array} Returns the new array of filtered values.
  24822. * @example
  24823. *
  24824. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  24825. * // => [1.2]
  24826. *
  24827. * // The `_.property` iteratee shorthand.
  24828. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  24829. * // => [{ 'x': 2 }]
  24830. */
  24831. var differenceBy = baseRest(function(array, values) {
  24832. var iteratee = last(values);
  24833. if (isArrayLikeObject(iteratee)) {
  24834. iteratee = undefined;
  24835. }
  24836. return isArrayLikeObject(array)
  24837. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  24838. : [];
  24839. });
  24840. /**
  24841. * This method is like `_.difference` except that it accepts `comparator`
  24842. * which is invoked to compare elements of `array` to `values`. The order and
  24843. * references of result values are determined by the first array. The comparator
  24844. * is invoked with two arguments: (arrVal, othVal).
  24845. *
  24846. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  24847. *
  24848. * @static
  24849. * @memberOf _
  24850. * @since 4.0.0
  24851. * @category Array
  24852. * @param {Array} array The array to inspect.
  24853. * @param {...Array} [values] The values to exclude.
  24854. * @param {Function} [comparator] The comparator invoked per element.
  24855. * @returns {Array} Returns the new array of filtered values.
  24856. * @example
  24857. *
  24858. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  24859. *
  24860. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  24861. * // => [{ 'x': 2, 'y': 1 }]
  24862. */
  24863. var differenceWith = baseRest(function(array, values) {
  24864. var comparator = last(values);
  24865. if (isArrayLikeObject(comparator)) {
  24866. comparator = undefined;
  24867. }
  24868. return isArrayLikeObject(array)
  24869. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  24870. : [];
  24871. });
  24872. /**
  24873. * Creates a slice of `array` with `n` elements dropped from the beginning.
  24874. *
  24875. * @static
  24876. * @memberOf _
  24877. * @since 0.5.0
  24878. * @category Array
  24879. * @param {Array} array The array to query.
  24880. * @param {number} [n=1] The number of elements to drop.
  24881. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  24882. * @returns {Array} Returns the slice of `array`.
  24883. * @example
  24884. *
  24885. * _.drop([1, 2, 3]);
  24886. * // => [2, 3]
  24887. *
  24888. * _.drop([1, 2, 3], 2);
  24889. * // => [3]
  24890. *
  24891. * _.drop([1, 2, 3], 5);
  24892. * // => []
  24893. *
  24894. * _.drop([1, 2, 3], 0);
  24895. * // => [1, 2, 3]
  24896. */
  24897. function drop(array, n, guard) {
  24898. var length = array == null ? 0 : array.length;
  24899. if (!length) {
  24900. return [];
  24901. }
  24902. n = (guard || n === undefined) ? 1 : toInteger(n);
  24903. return baseSlice(array, n < 0 ? 0 : n, length);
  24904. }
  24905. /**
  24906. * Creates a slice of `array` with `n` elements dropped from the end.
  24907. *
  24908. * @static
  24909. * @memberOf _
  24910. * @since 3.0.0
  24911. * @category Array
  24912. * @param {Array} array The array to query.
  24913. * @param {number} [n=1] The number of elements to drop.
  24914. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  24915. * @returns {Array} Returns the slice of `array`.
  24916. * @example
  24917. *
  24918. * _.dropRight([1, 2, 3]);
  24919. * // => [1, 2]
  24920. *
  24921. * _.dropRight([1, 2, 3], 2);
  24922. * // => [1]
  24923. *
  24924. * _.dropRight([1, 2, 3], 5);
  24925. * // => []
  24926. *
  24927. * _.dropRight([1, 2, 3], 0);
  24928. * // => [1, 2, 3]
  24929. */
  24930. function dropRight(array, n, guard) {
  24931. var length = array == null ? 0 : array.length;
  24932. if (!length) {
  24933. return [];
  24934. }
  24935. n = (guard || n === undefined) ? 1 : toInteger(n);
  24936. n = length - n;
  24937. return baseSlice(array, 0, n < 0 ? 0 : n);
  24938. }
  24939. /**
  24940. * Creates a slice of `array` excluding elements dropped from the end.
  24941. * Elements are dropped until `predicate` returns falsey. The predicate is
  24942. * invoked with three arguments: (value, index, array).
  24943. *
  24944. * @static
  24945. * @memberOf _
  24946. * @since 3.0.0
  24947. * @category Array
  24948. * @param {Array} array The array to query.
  24949. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  24950. * @returns {Array} Returns the slice of `array`.
  24951. * @example
  24952. *
  24953. * var users = [
  24954. * { 'user': 'barney', 'active': true },
  24955. * { 'user': 'fred', 'active': false },
  24956. * { 'user': 'pebbles', 'active': false }
  24957. * ];
  24958. *
  24959. * _.dropRightWhile(users, function(o) { return !o.active; });
  24960. * // => objects for ['barney']
  24961. *
  24962. * // The `_.matches` iteratee shorthand.
  24963. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  24964. * // => objects for ['barney', 'fred']
  24965. *
  24966. * // The `_.matchesProperty` iteratee shorthand.
  24967. * _.dropRightWhile(users, ['active', false]);
  24968. * // => objects for ['barney']
  24969. *
  24970. * // The `_.property` iteratee shorthand.
  24971. * _.dropRightWhile(users, 'active');
  24972. * // => objects for ['barney', 'fred', 'pebbles']
  24973. */
  24974. function dropRightWhile(array, predicate) {
  24975. return (array && array.length)
  24976. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  24977. : [];
  24978. }
  24979. /**
  24980. * Creates a slice of `array` excluding elements dropped from the beginning.
  24981. * Elements are dropped until `predicate` returns falsey. The predicate is
  24982. * invoked with three arguments: (value, index, array).
  24983. *
  24984. * @static
  24985. * @memberOf _
  24986. * @since 3.0.0
  24987. * @category Array
  24988. * @param {Array} array The array to query.
  24989. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  24990. * @returns {Array} Returns the slice of `array`.
  24991. * @example
  24992. *
  24993. * var users = [
  24994. * { 'user': 'barney', 'active': false },
  24995. * { 'user': 'fred', 'active': false },
  24996. * { 'user': 'pebbles', 'active': true }
  24997. * ];
  24998. *
  24999. * _.dropWhile(users, function(o) { return !o.active; });
  25000. * // => objects for ['pebbles']
  25001. *
  25002. * // The `_.matches` iteratee shorthand.
  25003. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  25004. * // => objects for ['fred', 'pebbles']
  25005. *
  25006. * // The `_.matchesProperty` iteratee shorthand.
  25007. * _.dropWhile(users, ['active', false]);
  25008. * // => objects for ['pebbles']
  25009. *
  25010. * // The `_.property` iteratee shorthand.
  25011. * _.dropWhile(users, 'active');
  25012. * // => objects for ['barney', 'fred', 'pebbles']
  25013. */
  25014. function dropWhile(array, predicate) {
  25015. return (array && array.length)
  25016. ? baseWhile(array, getIteratee(predicate, 3), true)
  25017. : [];
  25018. }
  25019. /**
  25020. * Fills elements of `array` with `value` from `start` up to, but not
  25021. * including, `end`.
  25022. *
  25023. * **Note:** This method mutates `array`.
  25024. *
  25025. * @static
  25026. * @memberOf _
  25027. * @since 3.2.0
  25028. * @category Array
  25029. * @param {Array} array The array to fill.
  25030. * @param {*} value The value to fill `array` with.
  25031. * @param {number} [start=0] The start position.
  25032. * @param {number} [end=array.length] The end position.
  25033. * @returns {Array} Returns `array`.
  25034. * @example
  25035. *
  25036. * var array = [1, 2, 3];
  25037. *
  25038. * _.fill(array, 'a');
  25039. * console.log(array);
  25040. * // => ['a', 'a', 'a']
  25041. *
  25042. * _.fill(Array(3), 2);
  25043. * // => [2, 2, 2]
  25044. *
  25045. * _.fill([4, 6, 8, 10], '*', 1, 3);
  25046. * // => [4, '*', '*', 10]
  25047. */
  25048. function fill(array, value, start, end) {
  25049. var length = array == null ? 0 : array.length;
  25050. if (!length) {
  25051. return [];
  25052. }
  25053. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  25054. start = 0;
  25055. end = length;
  25056. }
  25057. return baseFill(array, value, start, end);
  25058. }
  25059. /**
  25060. * This method is like `_.find` except that it returns the index of the first
  25061. * element `predicate` returns truthy for instead of the element itself.
  25062. *
  25063. * @static
  25064. * @memberOf _
  25065. * @since 1.1.0
  25066. * @category Array
  25067. * @param {Array} array The array to inspect.
  25068. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25069. * @param {number} [fromIndex=0] The index to search from.
  25070. * @returns {number} Returns the index of the found element, else `-1`.
  25071. * @example
  25072. *
  25073. * var users = [
  25074. * { 'user': 'barney', 'active': false },
  25075. * { 'user': 'fred', 'active': false },
  25076. * { 'user': 'pebbles', 'active': true }
  25077. * ];
  25078. *
  25079. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  25080. * // => 0
  25081. *
  25082. * // The `_.matches` iteratee shorthand.
  25083. * _.findIndex(users, { 'user': 'fred', 'active': false });
  25084. * // => 1
  25085. *
  25086. * // The `_.matchesProperty` iteratee shorthand.
  25087. * _.findIndex(users, ['active', false]);
  25088. * // => 0
  25089. *
  25090. * // The `_.property` iteratee shorthand.
  25091. * _.findIndex(users, 'active');
  25092. * // => 2
  25093. */
  25094. function findIndex(array, predicate, fromIndex) {
  25095. var length = array == null ? 0 : array.length;
  25096. if (!length) {
  25097. return -1;
  25098. }
  25099. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  25100. if (index < 0) {
  25101. index = nativeMax(length + index, 0);
  25102. }
  25103. return baseFindIndex(array, getIteratee(predicate, 3), index);
  25104. }
  25105. /**
  25106. * This method is like `_.findIndex` except that it iterates over elements
  25107. * of `collection` from right to left.
  25108. *
  25109. * @static
  25110. * @memberOf _
  25111. * @since 2.0.0
  25112. * @category Array
  25113. * @param {Array} array The array to inspect.
  25114. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25115. * @param {number} [fromIndex=array.length-1] The index to search from.
  25116. * @returns {number} Returns the index of the found element, else `-1`.
  25117. * @example
  25118. *
  25119. * var users = [
  25120. * { 'user': 'barney', 'active': true },
  25121. * { 'user': 'fred', 'active': false },
  25122. * { 'user': 'pebbles', 'active': false }
  25123. * ];
  25124. *
  25125. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  25126. * // => 2
  25127. *
  25128. * // The `_.matches` iteratee shorthand.
  25129. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  25130. * // => 0
  25131. *
  25132. * // The `_.matchesProperty` iteratee shorthand.
  25133. * _.findLastIndex(users, ['active', false]);
  25134. * // => 2
  25135. *
  25136. * // The `_.property` iteratee shorthand.
  25137. * _.findLastIndex(users, 'active');
  25138. * // => 0
  25139. */
  25140. function findLastIndex(array, predicate, fromIndex) {
  25141. var length = array == null ? 0 : array.length;
  25142. if (!length) {
  25143. return -1;
  25144. }
  25145. var index = length - 1;
  25146. if (fromIndex !== undefined) {
  25147. index = toInteger(fromIndex);
  25148. index = fromIndex < 0
  25149. ? nativeMax(length + index, 0)
  25150. : nativeMin(index, length - 1);
  25151. }
  25152. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  25153. }
  25154. /**
  25155. * Flattens `array` a single level deep.
  25156. *
  25157. * @static
  25158. * @memberOf _
  25159. * @since 0.1.0
  25160. * @category Array
  25161. * @param {Array} array The array to flatten.
  25162. * @returns {Array} Returns the new flattened array.
  25163. * @example
  25164. *
  25165. * _.flatten([1, [2, [3, [4]], 5]]);
  25166. * // => [1, 2, [3, [4]], 5]
  25167. */
  25168. function flatten(array) {
  25169. var length = array == null ? 0 : array.length;
  25170. return length ? baseFlatten(array, 1) : [];
  25171. }
  25172. /**
  25173. * Recursively flattens `array`.
  25174. *
  25175. * @static
  25176. * @memberOf _
  25177. * @since 3.0.0
  25178. * @category Array
  25179. * @param {Array} array The array to flatten.
  25180. * @returns {Array} Returns the new flattened array.
  25181. * @example
  25182. *
  25183. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  25184. * // => [1, 2, 3, 4, 5]
  25185. */
  25186. function flattenDeep(array) {
  25187. var length = array == null ? 0 : array.length;
  25188. return length ? baseFlatten(array, INFINITY) : [];
  25189. }
  25190. /**
  25191. * Recursively flatten `array` up to `depth` times.
  25192. *
  25193. * @static
  25194. * @memberOf _
  25195. * @since 4.4.0
  25196. * @category Array
  25197. * @param {Array} array The array to flatten.
  25198. * @param {number} [depth=1] The maximum recursion depth.
  25199. * @returns {Array} Returns the new flattened array.
  25200. * @example
  25201. *
  25202. * var array = [1, [2, [3, [4]], 5]];
  25203. *
  25204. * _.flattenDepth(array, 1);
  25205. * // => [1, 2, [3, [4]], 5]
  25206. *
  25207. * _.flattenDepth(array, 2);
  25208. * // => [1, 2, 3, [4], 5]
  25209. */
  25210. function flattenDepth(array, depth) {
  25211. var length = array == null ? 0 : array.length;
  25212. if (!length) {
  25213. return [];
  25214. }
  25215. depth = depth === undefined ? 1 : toInteger(depth);
  25216. return baseFlatten(array, depth);
  25217. }
  25218. /**
  25219. * The inverse of `_.toPairs`; this method returns an object composed
  25220. * from key-value `pairs`.
  25221. *
  25222. * @static
  25223. * @memberOf _
  25224. * @since 4.0.0
  25225. * @category Array
  25226. * @param {Array} pairs The key-value pairs.
  25227. * @returns {Object} Returns the new object.
  25228. * @example
  25229. *
  25230. * _.fromPairs([['a', 1], ['b', 2]]);
  25231. * // => { 'a': 1, 'b': 2 }
  25232. */
  25233. function fromPairs(pairs) {
  25234. var index = -1,
  25235. length = pairs == null ? 0 : pairs.length,
  25236. result = {};
  25237. while (++index < length) {
  25238. var pair = pairs[index];
  25239. result[pair[0]] = pair[1];
  25240. }
  25241. return result;
  25242. }
  25243. /**
  25244. * Gets the first element of `array`.
  25245. *
  25246. * @static
  25247. * @memberOf _
  25248. * @since 0.1.0
  25249. * @alias first
  25250. * @category Array
  25251. * @param {Array} array The array to query.
  25252. * @returns {*} Returns the first element of `array`.
  25253. * @example
  25254. *
  25255. * _.head([1, 2, 3]);
  25256. * // => 1
  25257. *
  25258. * _.head([]);
  25259. * // => undefined
  25260. */
  25261. function head(array) {
  25262. return (array && array.length) ? array[0] : undefined;
  25263. }
  25264. /**
  25265. * Gets the index at which the first occurrence of `value` is found in `array`
  25266. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  25267. * for equality comparisons. If `fromIndex` is negative, it's used as the
  25268. * offset from the end of `array`.
  25269. *
  25270. * @static
  25271. * @memberOf _
  25272. * @since 0.1.0
  25273. * @category Array
  25274. * @param {Array} array The array to inspect.
  25275. * @param {*} value The value to search for.
  25276. * @param {number} [fromIndex=0] The index to search from.
  25277. * @returns {number} Returns the index of the matched value, else `-1`.
  25278. * @example
  25279. *
  25280. * _.indexOf([1, 2, 1, 2], 2);
  25281. * // => 1
  25282. *
  25283. * // Search from the `fromIndex`.
  25284. * _.indexOf([1, 2, 1, 2], 2, 2);
  25285. * // => 3
  25286. */
  25287. function indexOf(array, value, fromIndex) {
  25288. var length = array == null ? 0 : array.length;
  25289. if (!length) {
  25290. return -1;
  25291. }
  25292. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  25293. if (index < 0) {
  25294. index = nativeMax(length + index, 0);
  25295. }
  25296. return baseIndexOf(array, value, index);
  25297. }
  25298. /**
  25299. * Gets all but the last element of `array`.
  25300. *
  25301. * @static
  25302. * @memberOf _
  25303. * @since 0.1.0
  25304. * @category Array
  25305. * @param {Array} array The array to query.
  25306. * @returns {Array} Returns the slice of `array`.
  25307. * @example
  25308. *
  25309. * _.initial([1, 2, 3]);
  25310. * // => [1, 2]
  25311. */
  25312. function initial(array) {
  25313. var length = array == null ? 0 : array.length;
  25314. return length ? baseSlice(array, 0, -1) : [];
  25315. }
  25316. /**
  25317. * Creates an array of unique values that are included in all given arrays
  25318. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  25319. * for equality comparisons. The order and references of result values are
  25320. * determined by the first array.
  25321. *
  25322. * @static
  25323. * @memberOf _
  25324. * @since 0.1.0
  25325. * @category Array
  25326. * @param {...Array} [arrays] The arrays to inspect.
  25327. * @returns {Array} Returns the new array of intersecting values.
  25328. * @example
  25329. *
  25330. * _.intersection([2, 1], [2, 3]);
  25331. * // => [2]
  25332. */
  25333. var intersection = baseRest(function(arrays) {
  25334. var mapped = arrayMap(arrays, castArrayLikeObject);
  25335. return (mapped.length && mapped[0] === arrays[0])
  25336. ? baseIntersection(mapped)
  25337. : [];
  25338. });
  25339. /**
  25340. * This method is like `_.intersection` except that it accepts `iteratee`
  25341. * which is invoked for each element of each `arrays` to generate the criterion
  25342. * by which they're compared. The order and references of result values are
  25343. * determined by the first array. The iteratee is invoked with one argument:
  25344. * (value).
  25345. *
  25346. * @static
  25347. * @memberOf _
  25348. * @since 4.0.0
  25349. * @category Array
  25350. * @param {...Array} [arrays] The arrays to inspect.
  25351. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  25352. * @returns {Array} Returns the new array of intersecting values.
  25353. * @example
  25354. *
  25355. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  25356. * // => [2.1]
  25357. *
  25358. * // The `_.property` iteratee shorthand.
  25359. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  25360. * // => [{ 'x': 1 }]
  25361. */
  25362. var intersectionBy = baseRest(function(arrays) {
  25363. var iteratee = last(arrays),
  25364. mapped = arrayMap(arrays, castArrayLikeObject);
  25365. if (iteratee === last(mapped)) {
  25366. iteratee = undefined;
  25367. } else {
  25368. mapped.pop();
  25369. }
  25370. return (mapped.length && mapped[0] === arrays[0])
  25371. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  25372. : [];
  25373. });
  25374. /**
  25375. * This method is like `_.intersection` except that it accepts `comparator`
  25376. * which is invoked to compare elements of `arrays`. The order and references
  25377. * of result values are determined by the first array. The comparator is
  25378. * invoked with two arguments: (arrVal, othVal).
  25379. *
  25380. * @static
  25381. * @memberOf _
  25382. * @since 4.0.0
  25383. * @category Array
  25384. * @param {...Array} [arrays] The arrays to inspect.
  25385. * @param {Function} [comparator] The comparator invoked per element.
  25386. * @returns {Array} Returns the new array of intersecting values.
  25387. * @example
  25388. *
  25389. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  25390. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  25391. *
  25392. * _.intersectionWith(objects, others, _.isEqual);
  25393. * // => [{ 'x': 1, 'y': 2 }]
  25394. */
  25395. var intersectionWith = baseRest(function(arrays) {
  25396. var comparator = last(arrays),
  25397. mapped = arrayMap(arrays, castArrayLikeObject);
  25398. comparator = typeof comparator == 'function' ? comparator : undefined;
  25399. if (comparator) {
  25400. mapped.pop();
  25401. }
  25402. return (mapped.length && mapped[0] === arrays[0])
  25403. ? baseIntersection(mapped, undefined, comparator)
  25404. : [];
  25405. });
  25406. /**
  25407. * Converts all elements in `array` into a string separated by `separator`.
  25408. *
  25409. * @static
  25410. * @memberOf _
  25411. * @since 4.0.0
  25412. * @category Array
  25413. * @param {Array} array The array to convert.
  25414. * @param {string} [separator=','] The element separator.
  25415. * @returns {string} Returns the joined string.
  25416. * @example
  25417. *
  25418. * _.join(['a', 'b', 'c'], '~');
  25419. * // => 'a~b~c'
  25420. */
  25421. function join(array, separator) {
  25422. return array == null ? '' : nativeJoin.call(array, separator);
  25423. }
  25424. /**
  25425. * Gets the last element of `array`.
  25426. *
  25427. * @static
  25428. * @memberOf _
  25429. * @since 0.1.0
  25430. * @category Array
  25431. * @param {Array} array The array to query.
  25432. * @returns {*} Returns the last element of `array`.
  25433. * @example
  25434. *
  25435. * _.last([1, 2, 3]);
  25436. * // => 3
  25437. */
  25438. function last(array) {
  25439. var length = array == null ? 0 : array.length;
  25440. return length ? array[length - 1] : undefined;
  25441. }
  25442. /**
  25443. * This method is like `_.indexOf` except that it iterates over elements of
  25444. * `array` from right to left.
  25445. *
  25446. * @static
  25447. * @memberOf _
  25448. * @since 0.1.0
  25449. * @category Array
  25450. * @param {Array} array The array to inspect.
  25451. * @param {*} value The value to search for.
  25452. * @param {number} [fromIndex=array.length-1] The index to search from.
  25453. * @returns {number} Returns the index of the matched value, else `-1`.
  25454. * @example
  25455. *
  25456. * _.lastIndexOf([1, 2, 1, 2], 2);
  25457. * // => 3
  25458. *
  25459. * // Search from the `fromIndex`.
  25460. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  25461. * // => 1
  25462. */
  25463. function lastIndexOf(array, value, fromIndex) {
  25464. var length = array == null ? 0 : array.length;
  25465. if (!length) {
  25466. return -1;
  25467. }
  25468. var index = length;
  25469. if (fromIndex !== undefined) {
  25470. index = toInteger(fromIndex);
  25471. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  25472. }
  25473. return value === value
  25474. ? strictLastIndexOf(array, value, index)
  25475. : baseFindIndex(array, baseIsNaN, index, true);
  25476. }
  25477. /**
  25478. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  25479. * element from the end is returned.
  25480. *
  25481. * @static
  25482. * @memberOf _
  25483. * @since 4.11.0
  25484. * @category Array
  25485. * @param {Array} array The array to query.
  25486. * @param {number} [n=0] The index of the element to return.
  25487. * @returns {*} Returns the nth element of `array`.
  25488. * @example
  25489. *
  25490. * var array = ['a', 'b', 'c', 'd'];
  25491. *
  25492. * _.nth(array, 1);
  25493. * // => 'b'
  25494. *
  25495. * _.nth(array, -2);
  25496. * // => 'c';
  25497. */
  25498. function nth(array, n) {
  25499. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  25500. }
  25501. /**
  25502. * Removes all given values from `array` using
  25503. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  25504. * for equality comparisons.
  25505. *
  25506. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  25507. * to remove elements from an array by predicate.
  25508. *
  25509. * @static
  25510. * @memberOf _
  25511. * @since 2.0.0
  25512. * @category Array
  25513. * @param {Array} array The array to modify.
  25514. * @param {...*} [values] The values to remove.
  25515. * @returns {Array} Returns `array`.
  25516. * @example
  25517. *
  25518. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  25519. *
  25520. * _.pull(array, 'a', 'c');
  25521. * console.log(array);
  25522. * // => ['b', 'b']
  25523. */
  25524. var pull = baseRest(pullAll);
  25525. /**
  25526. * This method is like `_.pull` except that it accepts an array of values to remove.
  25527. *
  25528. * **Note:** Unlike `_.difference`, this method mutates `array`.
  25529. *
  25530. * @static
  25531. * @memberOf _
  25532. * @since 4.0.0
  25533. * @category Array
  25534. * @param {Array} array The array to modify.
  25535. * @param {Array} values The values to remove.
  25536. * @returns {Array} Returns `array`.
  25537. * @example
  25538. *
  25539. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  25540. *
  25541. * _.pullAll(array, ['a', 'c']);
  25542. * console.log(array);
  25543. * // => ['b', 'b']
  25544. */
  25545. function pullAll(array, values) {
  25546. return (array && array.length && values && values.length)
  25547. ? basePullAll(array, values)
  25548. : array;
  25549. }
  25550. /**
  25551. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  25552. * invoked for each element of `array` and `values` to generate the criterion
  25553. * by which they're compared. The iteratee is invoked with one argument: (value).
  25554. *
  25555. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  25556. *
  25557. * @static
  25558. * @memberOf _
  25559. * @since 4.0.0
  25560. * @category Array
  25561. * @param {Array} array The array to modify.
  25562. * @param {Array} values The values to remove.
  25563. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  25564. * @returns {Array} Returns `array`.
  25565. * @example
  25566. *
  25567. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  25568. *
  25569. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  25570. * console.log(array);
  25571. * // => [{ 'x': 2 }]
  25572. */
  25573. function pullAllBy(array, values, iteratee) {
  25574. return (array && array.length && values && values.length)
  25575. ? basePullAll(array, values, getIteratee(iteratee, 2))
  25576. : array;
  25577. }
  25578. /**
  25579. * This method is like `_.pullAll` except that it accepts `comparator` which
  25580. * is invoked to compare elements of `array` to `values`. The comparator is
  25581. * invoked with two arguments: (arrVal, othVal).
  25582. *
  25583. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  25584. *
  25585. * @static
  25586. * @memberOf _
  25587. * @since 4.6.0
  25588. * @category Array
  25589. * @param {Array} array The array to modify.
  25590. * @param {Array} values The values to remove.
  25591. * @param {Function} [comparator] The comparator invoked per element.
  25592. * @returns {Array} Returns `array`.
  25593. * @example
  25594. *
  25595. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  25596. *
  25597. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  25598. * console.log(array);
  25599. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  25600. */
  25601. function pullAllWith(array, values, comparator) {
  25602. return (array && array.length && values && values.length)
  25603. ? basePullAll(array, values, undefined, comparator)
  25604. : array;
  25605. }
  25606. /**
  25607. * Removes elements from `array` corresponding to `indexes` and returns an
  25608. * array of removed elements.
  25609. *
  25610. * **Note:** Unlike `_.at`, this method mutates `array`.
  25611. *
  25612. * @static
  25613. * @memberOf _
  25614. * @since 3.0.0
  25615. * @category Array
  25616. * @param {Array} array The array to modify.
  25617. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  25618. * @returns {Array} Returns the new array of removed elements.
  25619. * @example
  25620. *
  25621. * var array = ['a', 'b', 'c', 'd'];
  25622. * var pulled = _.pullAt(array, [1, 3]);
  25623. *
  25624. * console.log(array);
  25625. * // => ['a', 'c']
  25626. *
  25627. * console.log(pulled);
  25628. * // => ['b', 'd']
  25629. */
  25630. var pullAt = flatRest(function(array, indexes) {
  25631. var length = array == null ? 0 : array.length,
  25632. result = baseAt(array, indexes);
  25633. basePullAt(array, arrayMap(indexes, function(index) {
  25634. return isIndex(index, length) ? +index : index;
  25635. }).sort(compareAscending));
  25636. return result;
  25637. });
  25638. /**
  25639. * Removes all elements from `array` that `predicate` returns truthy for
  25640. * and returns an array of the removed elements. The predicate is invoked
  25641. * with three arguments: (value, index, array).
  25642. *
  25643. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  25644. * to pull elements from an array by value.
  25645. *
  25646. * @static
  25647. * @memberOf _
  25648. * @since 2.0.0
  25649. * @category Array
  25650. * @param {Array} array The array to modify.
  25651. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25652. * @returns {Array} Returns the new array of removed elements.
  25653. * @example
  25654. *
  25655. * var array = [1, 2, 3, 4];
  25656. * var evens = _.remove(array, function(n) {
  25657. * return n % 2 == 0;
  25658. * });
  25659. *
  25660. * console.log(array);
  25661. * // => [1, 3]
  25662. *
  25663. * console.log(evens);
  25664. * // => [2, 4]
  25665. */
  25666. function remove(array, predicate) {
  25667. var result = [];
  25668. if (!(array && array.length)) {
  25669. return result;
  25670. }
  25671. var index = -1,
  25672. indexes = [],
  25673. length = array.length;
  25674. predicate = getIteratee(predicate, 3);
  25675. while (++index < length) {
  25676. var value = array[index];
  25677. if (predicate(value, index, array)) {
  25678. result.push(value);
  25679. indexes.push(index);
  25680. }
  25681. }
  25682. basePullAt(array, indexes);
  25683. return result;
  25684. }
  25685. /**
  25686. * Reverses `array` so that the first element becomes the last, the second
  25687. * element becomes the second to last, and so on.
  25688. *
  25689. * **Note:** This method mutates `array` and is based on
  25690. * [`Array#reverse`](https://mdn.io/Array/reverse).
  25691. *
  25692. * @static
  25693. * @memberOf _
  25694. * @since 4.0.0
  25695. * @category Array
  25696. * @param {Array} array The array to modify.
  25697. * @returns {Array} Returns `array`.
  25698. * @example
  25699. *
  25700. * var array = [1, 2, 3];
  25701. *
  25702. * _.reverse(array);
  25703. * // => [3, 2, 1]
  25704. *
  25705. * console.log(array);
  25706. * // => [3, 2, 1]
  25707. */
  25708. function reverse(array) {
  25709. return array == null ? array : nativeReverse.call(array);
  25710. }
  25711. /**
  25712. * Creates a slice of `array` from `start` up to, but not including, `end`.
  25713. *
  25714. * **Note:** This method is used instead of
  25715. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  25716. * returned.
  25717. *
  25718. * @static
  25719. * @memberOf _
  25720. * @since 3.0.0
  25721. * @category Array
  25722. * @param {Array} array The array to slice.
  25723. * @param {number} [start=0] The start position.
  25724. * @param {number} [end=array.length] The end position.
  25725. * @returns {Array} Returns the slice of `array`.
  25726. */
  25727. function slice(array, start, end) {
  25728. var length = array == null ? 0 : array.length;
  25729. if (!length) {
  25730. return [];
  25731. }
  25732. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  25733. start = 0;
  25734. end = length;
  25735. }
  25736. else {
  25737. start = start == null ? 0 : toInteger(start);
  25738. end = end === undefined ? length : toInteger(end);
  25739. }
  25740. return baseSlice(array, start, end);
  25741. }
  25742. /**
  25743. * Uses a binary search to determine the lowest index at which `value`
  25744. * should be inserted into `array` in order to maintain its sort order.
  25745. *
  25746. * @static
  25747. * @memberOf _
  25748. * @since 0.1.0
  25749. * @category Array
  25750. * @param {Array} array The sorted array to inspect.
  25751. * @param {*} value The value to evaluate.
  25752. * @returns {number} Returns the index at which `value` should be inserted
  25753. * into `array`.
  25754. * @example
  25755. *
  25756. * _.sortedIndex([30, 50], 40);
  25757. * // => 1
  25758. */
  25759. function sortedIndex(array, value) {
  25760. return baseSortedIndex(array, value);
  25761. }
  25762. /**
  25763. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  25764. * which is invoked for `value` and each element of `array` to compute their
  25765. * sort ranking. The iteratee is invoked with one argument: (value).
  25766. *
  25767. * @static
  25768. * @memberOf _
  25769. * @since 4.0.0
  25770. * @category Array
  25771. * @param {Array} array The sorted array to inspect.
  25772. * @param {*} value The value to evaluate.
  25773. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  25774. * @returns {number} Returns the index at which `value` should be inserted
  25775. * into `array`.
  25776. * @example
  25777. *
  25778. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  25779. *
  25780. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  25781. * // => 0
  25782. *
  25783. * // The `_.property` iteratee shorthand.
  25784. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  25785. * // => 0
  25786. */
  25787. function sortedIndexBy(array, value, iteratee) {
  25788. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  25789. }
  25790. /**
  25791. * This method is like `_.indexOf` except that it performs a binary
  25792. * search on a sorted `array`.
  25793. *
  25794. * @static
  25795. * @memberOf _
  25796. * @since 4.0.0
  25797. * @category Array
  25798. * @param {Array} array The array to inspect.
  25799. * @param {*} value The value to search for.
  25800. * @returns {number} Returns the index of the matched value, else `-1`.
  25801. * @example
  25802. *
  25803. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  25804. * // => 1
  25805. */
  25806. function sortedIndexOf(array, value) {
  25807. var length = array == null ? 0 : array.length;
  25808. if (length) {
  25809. var index = baseSortedIndex(array, value);
  25810. if (index < length && eq(array[index], value)) {
  25811. return index;
  25812. }
  25813. }
  25814. return -1;
  25815. }
  25816. /**
  25817. * This method is like `_.sortedIndex` except that it returns the highest
  25818. * index at which `value` should be inserted into `array` in order to
  25819. * maintain its sort order.
  25820. *
  25821. * @static
  25822. * @memberOf _
  25823. * @since 3.0.0
  25824. * @category Array
  25825. * @param {Array} array The sorted array to inspect.
  25826. * @param {*} value The value to evaluate.
  25827. * @returns {number} Returns the index at which `value` should be inserted
  25828. * into `array`.
  25829. * @example
  25830. *
  25831. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  25832. * // => 4
  25833. */
  25834. function sortedLastIndex(array, value) {
  25835. return baseSortedIndex(array, value, true);
  25836. }
  25837. /**
  25838. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  25839. * which is invoked for `value` and each element of `array` to compute their
  25840. * sort ranking. The iteratee is invoked with one argument: (value).
  25841. *
  25842. * @static
  25843. * @memberOf _
  25844. * @since 4.0.0
  25845. * @category Array
  25846. * @param {Array} array The sorted array to inspect.
  25847. * @param {*} value The value to evaluate.
  25848. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  25849. * @returns {number} Returns the index at which `value` should be inserted
  25850. * into `array`.
  25851. * @example
  25852. *
  25853. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  25854. *
  25855. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  25856. * // => 1
  25857. *
  25858. * // The `_.property` iteratee shorthand.
  25859. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  25860. * // => 1
  25861. */
  25862. function sortedLastIndexBy(array, value, iteratee) {
  25863. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  25864. }
  25865. /**
  25866. * This method is like `_.lastIndexOf` except that it performs a binary
  25867. * search on a sorted `array`.
  25868. *
  25869. * @static
  25870. * @memberOf _
  25871. * @since 4.0.0
  25872. * @category Array
  25873. * @param {Array} array The array to inspect.
  25874. * @param {*} value The value to search for.
  25875. * @returns {number} Returns the index of the matched value, else `-1`.
  25876. * @example
  25877. *
  25878. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  25879. * // => 3
  25880. */
  25881. function sortedLastIndexOf(array, value) {
  25882. var length = array == null ? 0 : array.length;
  25883. if (length) {
  25884. var index = baseSortedIndex(array, value, true) - 1;
  25885. if (eq(array[index], value)) {
  25886. return index;
  25887. }
  25888. }
  25889. return -1;
  25890. }
  25891. /**
  25892. * This method is like `_.uniq` except that it's designed and optimized
  25893. * for sorted arrays.
  25894. *
  25895. * @static
  25896. * @memberOf _
  25897. * @since 4.0.0
  25898. * @category Array
  25899. * @param {Array} array The array to inspect.
  25900. * @returns {Array} Returns the new duplicate free array.
  25901. * @example
  25902. *
  25903. * _.sortedUniq([1, 1, 2]);
  25904. * // => [1, 2]
  25905. */
  25906. function sortedUniq(array) {
  25907. return (array && array.length)
  25908. ? baseSortedUniq(array)
  25909. : [];
  25910. }
  25911. /**
  25912. * This method is like `_.uniqBy` except that it's designed and optimized
  25913. * for sorted arrays.
  25914. *
  25915. * @static
  25916. * @memberOf _
  25917. * @since 4.0.0
  25918. * @category Array
  25919. * @param {Array} array The array to inspect.
  25920. * @param {Function} [iteratee] The iteratee invoked per element.
  25921. * @returns {Array} Returns the new duplicate free array.
  25922. * @example
  25923. *
  25924. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  25925. * // => [1.1, 2.3]
  25926. */
  25927. function sortedUniqBy(array, iteratee) {
  25928. return (array && array.length)
  25929. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  25930. : [];
  25931. }
  25932. /**
  25933. * Gets all but the first element of `array`.
  25934. *
  25935. * @static
  25936. * @memberOf _
  25937. * @since 4.0.0
  25938. * @category Array
  25939. * @param {Array} array The array to query.
  25940. * @returns {Array} Returns the slice of `array`.
  25941. * @example
  25942. *
  25943. * _.tail([1, 2, 3]);
  25944. * // => [2, 3]
  25945. */
  25946. function tail(array) {
  25947. var length = array == null ? 0 : array.length;
  25948. return length ? baseSlice(array, 1, length) : [];
  25949. }
  25950. /**
  25951. * Creates a slice of `array` with `n` elements taken from the beginning.
  25952. *
  25953. * @static
  25954. * @memberOf _
  25955. * @since 0.1.0
  25956. * @category Array
  25957. * @param {Array} array The array to query.
  25958. * @param {number} [n=1] The number of elements to take.
  25959. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25960. * @returns {Array} Returns the slice of `array`.
  25961. * @example
  25962. *
  25963. * _.take([1, 2, 3]);
  25964. * // => [1]
  25965. *
  25966. * _.take([1, 2, 3], 2);
  25967. * // => [1, 2]
  25968. *
  25969. * _.take([1, 2, 3], 5);
  25970. * // => [1, 2, 3]
  25971. *
  25972. * _.take([1, 2, 3], 0);
  25973. * // => []
  25974. */
  25975. function take(array, n, guard) {
  25976. if (!(array && array.length)) {
  25977. return [];
  25978. }
  25979. n = (guard || n === undefined) ? 1 : toInteger(n);
  25980. return baseSlice(array, 0, n < 0 ? 0 : n);
  25981. }
  25982. /**
  25983. * Creates a slice of `array` with `n` elements taken from the end.
  25984. *
  25985. * @static
  25986. * @memberOf _
  25987. * @since 3.0.0
  25988. * @category Array
  25989. * @param {Array} array The array to query.
  25990. * @param {number} [n=1] The number of elements to take.
  25991. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25992. * @returns {Array} Returns the slice of `array`.
  25993. * @example
  25994. *
  25995. * _.takeRight([1, 2, 3]);
  25996. * // => [3]
  25997. *
  25998. * _.takeRight([1, 2, 3], 2);
  25999. * // => [2, 3]
  26000. *
  26001. * _.takeRight([1, 2, 3], 5);
  26002. * // => [1, 2, 3]
  26003. *
  26004. * _.takeRight([1, 2, 3], 0);
  26005. * // => []
  26006. */
  26007. function takeRight(array, n, guard) {
  26008. var length = array == null ? 0 : array.length;
  26009. if (!length) {
  26010. return [];
  26011. }
  26012. n = (guard || n === undefined) ? 1 : toInteger(n);
  26013. n = length - n;
  26014. return baseSlice(array, n < 0 ? 0 : n, length);
  26015. }
  26016. /**
  26017. * Creates a slice of `array` with elements taken from the end. Elements are
  26018. * taken until `predicate` returns falsey. The predicate is invoked with
  26019. * three arguments: (value, index, array).
  26020. *
  26021. * @static
  26022. * @memberOf _
  26023. * @since 3.0.0
  26024. * @category Array
  26025. * @param {Array} array The array to query.
  26026. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26027. * @returns {Array} Returns the slice of `array`.
  26028. * @example
  26029. *
  26030. * var users = [
  26031. * { 'user': 'barney', 'active': true },
  26032. * { 'user': 'fred', 'active': false },
  26033. * { 'user': 'pebbles', 'active': false }
  26034. * ];
  26035. *
  26036. * _.takeRightWhile(users, function(o) { return !o.active; });
  26037. * // => objects for ['fred', 'pebbles']
  26038. *
  26039. * // The `_.matches` iteratee shorthand.
  26040. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  26041. * // => objects for ['pebbles']
  26042. *
  26043. * // The `_.matchesProperty` iteratee shorthand.
  26044. * _.takeRightWhile(users, ['active', false]);
  26045. * // => objects for ['fred', 'pebbles']
  26046. *
  26047. * // The `_.property` iteratee shorthand.
  26048. * _.takeRightWhile(users, 'active');
  26049. * // => []
  26050. */
  26051. function takeRightWhile(array, predicate) {
  26052. return (array && array.length)
  26053. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  26054. : [];
  26055. }
  26056. /**
  26057. * Creates a slice of `array` with elements taken from the beginning. Elements
  26058. * are taken until `predicate` returns falsey. The predicate is invoked with
  26059. * three arguments: (value, index, array).
  26060. *
  26061. * @static
  26062. * @memberOf _
  26063. * @since 3.0.0
  26064. * @category Array
  26065. * @param {Array} array The array to query.
  26066. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26067. * @returns {Array} Returns the slice of `array`.
  26068. * @example
  26069. *
  26070. * var users = [
  26071. * { 'user': 'barney', 'active': false },
  26072. * { 'user': 'fred', 'active': false },
  26073. * { 'user': 'pebbles', 'active': true }
  26074. * ];
  26075. *
  26076. * _.takeWhile(users, function(o) { return !o.active; });
  26077. * // => objects for ['barney', 'fred']
  26078. *
  26079. * // The `_.matches` iteratee shorthand.
  26080. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  26081. * // => objects for ['barney']
  26082. *
  26083. * // The `_.matchesProperty` iteratee shorthand.
  26084. * _.takeWhile(users, ['active', false]);
  26085. * // => objects for ['barney', 'fred']
  26086. *
  26087. * // The `_.property` iteratee shorthand.
  26088. * _.takeWhile(users, 'active');
  26089. * // => []
  26090. */
  26091. function takeWhile(array, predicate) {
  26092. return (array && array.length)
  26093. ? baseWhile(array, getIteratee(predicate, 3))
  26094. : [];
  26095. }
  26096. /**
  26097. * Creates an array of unique values, in order, from all given arrays using
  26098. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26099. * for equality comparisons.
  26100. *
  26101. * @static
  26102. * @memberOf _
  26103. * @since 0.1.0
  26104. * @category Array
  26105. * @param {...Array} [arrays] The arrays to inspect.
  26106. * @returns {Array} Returns the new array of combined values.
  26107. * @example
  26108. *
  26109. * _.union([2], [1, 2]);
  26110. * // => [2, 1]
  26111. */
  26112. var union = baseRest(function(arrays) {
  26113. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  26114. });
  26115. /**
  26116. * This method is like `_.union` except that it accepts `iteratee` which is
  26117. * invoked for each element of each `arrays` to generate the criterion by
  26118. * which uniqueness is computed. Result values are chosen from the first
  26119. * array in which the value occurs. The iteratee is invoked with one argument:
  26120. * (value).
  26121. *
  26122. * @static
  26123. * @memberOf _
  26124. * @since 4.0.0
  26125. * @category Array
  26126. * @param {...Array} [arrays] The arrays to inspect.
  26127. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26128. * @returns {Array} Returns the new array of combined values.
  26129. * @example
  26130. *
  26131. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  26132. * // => [2.1, 1.2]
  26133. *
  26134. * // The `_.property` iteratee shorthand.
  26135. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  26136. * // => [{ 'x': 1 }, { 'x': 2 }]
  26137. */
  26138. var unionBy = baseRest(function(arrays) {
  26139. var iteratee = last(arrays);
  26140. if (isArrayLikeObject(iteratee)) {
  26141. iteratee = undefined;
  26142. }
  26143. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  26144. });
  26145. /**
  26146. * This method is like `_.union` except that it accepts `comparator` which
  26147. * is invoked to compare elements of `arrays`. Result values are chosen from
  26148. * the first array in which the value occurs. The comparator is invoked
  26149. * with two arguments: (arrVal, othVal).
  26150. *
  26151. * @static
  26152. * @memberOf _
  26153. * @since 4.0.0
  26154. * @category Array
  26155. * @param {...Array} [arrays] The arrays to inspect.
  26156. * @param {Function} [comparator] The comparator invoked per element.
  26157. * @returns {Array} Returns the new array of combined values.
  26158. * @example
  26159. *
  26160. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  26161. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26162. *
  26163. * _.unionWith(objects, others, _.isEqual);
  26164. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  26165. */
  26166. var unionWith = baseRest(function(arrays) {
  26167. var comparator = last(arrays);
  26168. comparator = typeof comparator == 'function' ? comparator : undefined;
  26169. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  26170. });
  26171. /**
  26172. * Creates a duplicate-free version of an array, using
  26173. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26174. * for equality comparisons, in which only the first occurrence of each element
  26175. * is kept. The order of result values is determined by the order they occur
  26176. * in the array.
  26177. *
  26178. * @static
  26179. * @memberOf _
  26180. * @since 0.1.0
  26181. * @category Array
  26182. * @param {Array} array The array to inspect.
  26183. * @returns {Array} Returns the new duplicate free array.
  26184. * @example
  26185. *
  26186. * _.uniq([2, 1, 2]);
  26187. * // => [2, 1]
  26188. */
  26189. function uniq(array) {
  26190. return (array && array.length) ? baseUniq(array) : [];
  26191. }
  26192. /**
  26193. * This method is like `_.uniq` except that it accepts `iteratee` which is
  26194. * invoked for each element in `array` to generate the criterion by which
  26195. * uniqueness is computed. The order of result values is determined by the
  26196. * order they occur in the array. The iteratee is invoked with one argument:
  26197. * (value).
  26198. *
  26199. * @static
  26200. * @memberOf _
  26201. * @since 4.0.0
  26202. * @category Array
  26203. * @param {Array} array The array to inspect.
  26204. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26205. * @returns {Array} Returns the new duplicate free array.
  26206. * @example
  26207. *
  26208. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  26209. * // => [2.1, 1.2]
  26210. *
  26211. * // The `_.property` iteratee shorthand.
  26212. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  26213. * // => [{ 'x': 1 }, { 'x': 2 }]
  26214. */
  26215. function uniqBy(array, iteratee) {
  26216. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  26217. }
  26218. /**
  26219. * This method is like `_.uniq` except that it accepts `comparator` which
  26220. * is invoked to compare elements of `array`. The order of result values is
  26221. * determined by the order they occur in the array.The comparator is invoked
  26222. * with two arguments: (arrVal, othVal).
  26223. *
  26224. * @static
  26225. * @memberOf _
  26226. * @since 4.0.0
  26227. * @category Array
  26228. * @param {Array} array The array to inspect.
  26229. * @param {Function} [comparator] The comparator invoked per element.
  26230. * @returns {Array} Returns the new duplicate free array.
  26231. * @example
  26232. *
  26233. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26234. *
  26235. * _.uniqWith(objects, _.isEqual);
  26236. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  26237. */
  26238. function uniqWith(array, comparator) {
  26239. comparator = typeof comparator == 'function' ? comparator : undefined;
  26240. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  26241. }
  26242. /**
  26243. * This method is like `_.zip` except that it accepts an array of grouped
  26244. * elements and creates an array regrouping the elements to their pre-zip
  26245. * configuration.
  26246. *
  26247. * @static
  26248. * @memberOf _
  26249. * @since 1.2.0
  26250. * @category Array
  26251. * @param {Array} array The array of grouped elements to process.
  26252. * @returns {Array} Returns the new array of regrouped elements.
  26253. * @example
  26254. *
  26255. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  26256. * // => [['a', 1, true], ['b', 2, false]]
  26257. *
  26258. * _.unzip(zipped);
  26259. * // => [['a', 'b'], [1, 2], [true, false]]
  26260. */
  26261. function unzip(array) {
  26262. if (!(array && array.length)) {
  26263. return [];
  26264. }
  26265. var length = 0;
  26266. array = arrayFilter(array, function(group) {
  26267. if (isArrayLikeObject(group)) {
  26268. length = nativeMax(group.length, length);
  26269. return true;
  26270. }
  26271. });
  26272. return baseTimes(length, function(index) {
  26273. return arrayMap(array, baseProperty(index));
  26274. });
  26275. }
  26276. /**
  26277. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  26278. * how regrouped values should be combined. The iteratee is invoked with the
  26279. * elements of each group: (...group).
  26280. *
  26281. * @static
  26282. * @memberOf _
  26283. * @since 3.8.0
  26284. * @category Array
  26285. * @param {Array} array The array of grouped elements to process.
  26286. * @param {Function} [iteratee=_.identity] The function to combine
  26287. * regrouped values.
  26288. * @returns {Array} Returns the new array of regrouped elements.
  26289. * @example
  26290. *
  26291. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  26292. * // => [[1, 10, 100], [2, 20, 200]]
  26293. *
  26294. * _.unzipWith(zipped, _.add);
  26295. * // => [3, 30, 300]
  26296. */
  26297. function unzipWith(array, iteratee) {
  26298. if (!(array && array.length)) {
  26299. return [];
  26300. }
  26301. var result = unzip(array);
  26302. if (iteratee == null) {
  26303. return result;
  26304. }
  26305. return arrayMap(result, function(group) {
  26306. return apply(iteratee, undefined, group);
  26307. });
  26308. }
  26309. /**
  26310. * Creates an array excluding all given values using
  26311. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26312. * for equality comparisons.
  26313. *
  26314. * **Note:** Unlike `_.pull`, this method returns a new array.
  26315. *
  26316. * @static
  26317. * @memberOf _
  26318. * @since 0.1.0
  26319. * @category Array
  26320. * @param {Array} array The array to inspect.
  26321. * @param {...*} [values] The values to exclude.
  26322. * @returns {Array} Returns the new array of filtered values.
  26323. * @see _.difference, _.xor
  26324. * @example
  26325. *
  26326. * _.without([2, 1, 2, 3], 1, 2);
  26327. * // => [3]
  26328. */
  26329. var without = baseRest(function(array, values) {
  26330. return isArrayLikeObject(array)
  26331. ? baseDifference(array, values)
  26332. : [];
  26333. });
  26334. /**
  26335. * Creates an array of unique values that is the
  26336. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  26337. * of the given arrays. The order of result values is determined by the order
  26338. * they occur in the arrays.
  26339. *
  26340. * @static
  26341. * @memberOf _
  26342. * @since 2.4.0
  26343. * @category Array
  26344. * @param {...Array} [arrays] The arrays to inspect.
  26345. * @returns {Array} Returns the new array of filtered values.
  26346. * @see _.difference, _.without
  26347. * @example
  26348. *
  26349. * _.xor([2, 1], [2, 3]);
  26350. * // => [1, 3]
  26351. */
  26352. var xor = baseRest(function(arrays) {
  26353. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  26354. });
  26355. /**
  26356. * This method is like `_.xor` except that it accepts `iteratee` which is
  26357. * invoked for each element of each `arrays` to generate the criterion by
  26358. * which by which they're compared. The order of result values is determined
  26359. * by the order they occur in the arrays. The iteratee is invoked with one
  26360. * argument: (value).
  26361. *
  26362. * @static
  26363. * @memberOf _
  26364. * @since 4.0.0
  26365. * @category Array
  26366. * @param {...Array} [arrays] The arrays to inspect.
  26367. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26368. * @returns {Array} Returns the new array of filtered values.
  26369. * @example
  26370. *
  26371. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  26372. * // => [1.2, 3.4]
  26373. *
  26374. * // The `_.property` iteratee shorthand.
  26375. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  26376. * // => [{ 'x': 2 }]
  26377. */
  26378. var xorBy = baseRest(function(arrays) {
  26379. var iteratee = last(arrays);
  26380. if (isArrayLikeObject(iteratee)) {
  26381. iteratee = undefined;
  26382. }
  26383. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  26384. });
  26385. /**
  26386. * This method is like `_.xor` except that it accepts `comparator` which is
  26387. * invoked to compare elements of `arrays`. The order of result values is
  26388. * determined by the order they occur in the arrays. The comparator is invoked
  26389. * with two arguments: (arrVal, othVal).
  26390. *
  26391. * @static
  26392. * @memberOf _
  26393. * @since 4.0.0
  26394. * @category Array
  26395. * @param {...Array} [arrays] The arrays to inspect.
  26396. * @param {Function} [comparator] The comparator invoked per element.
  26397. * @returns {Array} Returns the new array of filtered values.
  26398. * @example
  26399. *
  26400. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  26401. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26402. *
  26403. * _.xorWith(objects, others, _.isEqual);
  26404. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  26405. */
  26406. var xorWith = baseRest(function(arrays) {
  26407. var comparator = last(arrays);
  26408. comparator = typeof comparator == 'function' ? comparator : undefined;
  26409. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  26410. });
  26411. /**
  26412. * Creates an array of grouped elements, the first of which contains the
  26413. * first elements of the given arrays, the second of which contains the
  26414. * second elements of the given arrays, and so on.
  26415. *
  26416. * @static
  26417. * @memberOf _
  26418. * @since 0.1.0
  26419. * @category Array
  26420. * @param {...Array} [arrays] The arrays to process.
  26421. * @returns {Array} Returns the new array of grouped elements.
  26422. * @example
  26423. *
  26424. * _.zip(['a', 'b'], [1, 2], [true, false]);
  26425. * // => [['a', 1, true], ['b', 2, false]]
  26426. */
  26427. var zip = baseRest(unzip);
  26428. /**
  26429. * This method is like `_.fromPairs` except that it accepts two arrays,
  26430. * one of property identifiers and one of corresponding values.
  26431. *
  26432. * @static
  26433. * @memberOf _
  26434. * @since 0.4.0
  26435. * @category Array
  26436. * @param {Array} [props=[]] The property identifiers.
  26437. * @param {Array} [values=[]] The property values.
  26438. * @returns {Object} Returns the new object.
  26439. * @example
  26440. *
  26441. * _.zipObject(['a', 'b'], [1, 2]);
  26442. * // => { 'a': 1, 'b': 2 }
  26443. */
  26444. function zipObject(props, values) {
  26445. return baseZipObject(props || [], values || [], assignValue);
  26446. }
  26447. /**
  26448. * This method is like `_.zipObject` except that it supports property paths.
  26449. *
  26450. * @static
  26451. * @memberOf _
  26452. * @since 4.1.0
  26453. * @category Array
  26454. * @param {Array} [props=[]] The property identifiers.
  26455. * @param {Array} [values=[]] The property values.
  26456. * @returns {Object} Returns the new object.
  26457. * @example
  26458. *
  26459. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  26460. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  26461. */
  26462. function zipObjectDeep(props, values) {
  26463. return baseZipObject(props || [], values || [], baseSet);
  26464. }
  26465. /**
  26466. * This method is like `_.zip` except that it accepts `iteratee` to specify
  26467. * how grouped values should be combined. The iteratee is invoked with the
  26468. * elements of each group: (...group).
  26469. *
  26470. * @static
  26471. * @memberOf _
  26472. * @since 3.8.0
  26473. * @category Array
  26474. * @param {...Array} [arrays] The arrays to process.
  26475. * @param {Function} [iteratee=_.identity] The function to combine
  26476. * grouped values.
  26477. * @returns {Array} Returns the new array of grouped elements.
  26478. * @example
  26479. *
  26480. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  26481. * return a + b + c;
  26482. * });
  26483. * // => [111, 222]
  26484. */
  26485. var zipWith = baseRest(function(arrays) {
  26486. var length = arrays.length,
  26487. iteratee = length > 1 ? arrays[length - 1] : undefined;
  26488. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  26489. return unzipWith(arrays, iteratee);
  26490. });
  26491. /*------------------------------------------------------------------------*/
  26492. /**
  26493. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  26494. * chain sequences enabled. The result of such sequences must be unwrapped
  26495. * with `_#value`.
  26496. *
  26497. * @static
  26498. * @memberOf _
  26499. * @since 1.3.0
  26500. * @category Seq
  26501. * @param {*} value The value to wrap.
  26502. * @returns {Object} Returns the new `lodash` wrapper instance.
  26503. * @example
  26504. *
  26505. * var users = [
  26506. * { 'user': 'barney', 'age': 36 },
  26507. * { 'user': 'fred', 'age': 40 },
  26508. * { 'user': 'pebbles', 'age': 1 }
  26509. * ];
  26510. *
  26511. * var youngest = _
  26512. * .chain(users)
  26513. * .sortBy('age')
  26514. * .map(function(o) {
  26515. * return o.user + ' is ' + o.age;
  26516. * })
  26517. * .head()
  26518. * .value();
  26519. * // => 'pebbles is 1'
  26520. */
  26521. function chain(value) {
  26522. var result = lodash(value);
  26523. result.__chain__ = true;
  26524. return result;
  26525. }
  26526. /**
  26527. * This method invokes `interceptor` and returns `value`. The interceptor
  26528. * is invoked with one argument; (value). The purpose of this method is to
  26529. * "tap into" a method chain sequence in order to modify intermediate results.
  26530. *
  26531. * @static
  26532. * @memberOf _
  26533. * @since 0.1.0
  26534. * @category Seq
  26535. * @param {*} value The value to provide to `interceptor`.
  26536. * @param {Function} interceptor The function to invoke.
  26537. * @returns {*} Returns `value`.
  26538. * @example
  26539. *
  26540. * _([1, 2, 3])
  26541. * .tap(function(array) {
  26542. * // Mutate input array.
  26543. * array.pop();
  26544. * })
  26545. * .reverse()
  26546. * .value();
  26547. * // => [2, 1]
  26548. */
  26549. function tap(value, interceptor) {
  26550. interceptor(value);
  26551. return value;
  26552. }
  26553. /**
  26554. * This method is like `_.tap` except that it returns the result of `interceptor`.
  26555. * The purpose of this method is to "pass thru" values replacing intermediate
  26556. * results in a method chain sequence.
  26557. *
  26558. * @static
  26559. * @memberOf _
  26560. * @since 3.0.0
  26561. * @category Seq
  26562. * @param {*} value The value to provide to `interceptor`.
  26563. * @param {Function} interceptor The function to invoke.
  26564. * @returns {*} Returns the result of `interceptor`.
  26565. * @example
  26566. *
  26567. * _(' abc ')
  26568. * .chain()
  26569. * .trim()
  26570. * .thru(function(value) {
  26571. * return [value];
  26572. * })
  26573. * .value();
  26574. * // => ['abc']
  26575. */
  26576. function thru(value, interceptor) {
  26577. return interceptor(value);
  26578. }
  26579. /**
  26580. * This method is the wrapper version of `_.at`.
  26581. *
  26582. * @name at
  26583. * @memberOf _
  26584. * @since 1.0.0
  26585. * @category Seq
  26586. * @param {...(string|string[])} [paths] The property paths to pick.
  26587. * @returns {Object} Returns the new `lodash` wrapper instance.
  26588. * @example
  26589. *
  26590. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  26591. *
  26592. * _(object).at(['a[0].b.c', 'a[1]']).value();
  26593. * // => [3, 4]
  26594. */
  26595. var wrapperAt = flatRest(function(paths) {
  26596. var length = paths.length,
  26597. start = length ? paths[0] : 0,
  26598. value = this.__wrapped__,
  26599. interceptor = function(object) { return baseAt(object, paths); };
  26600. if (length > 1 || this.__actions__.length ||
  26601. !(value instanceof LazyWrapper) || !isIndex(start)) {
  26602. return this.thru(interceptor);
  26603. }
  26604. value = value.slice(start, +start + (length ? 1 : 0));
  26605. value.__actions__.push({
  26606. 'func': thru,
  26607. 'args': [interceptor],
  26608. 'thisArg': undefined
  26609. });
  26610. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  26611. if (length && !array.length) {
  26612. array.push(undefined);
  26613. }
  26614. return array;
  26615. });
  26616. });
  26617. /**
  26618. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  26619. *
  26620. * @name chain
  26621. * @memberOf _
  26622. * @since 0.1.0
  26623. * @category Seq
  26624. * @returns {Object} Returns the new `lodash` wrapper instance.
  26625. * @example
  26626. *
  26627. * var users = [
  26628. * { 'user': 'barney', 'age': 36 },
  26629. * { 'user': 'fred', 'age': 40 }
  26630. * ];
  26631. *
  26632. * // A sequence without explicit chaining.
  26633. * _(users).head();
  26634. * // => { 'user': 'barney', 'age': 36 }
  26635. *
  26636. * // A sequence with explicit chaining.
  26637. * _(users)
  26638. * .chain()
  26639. * .head()
  26640. * .pick('user')
  26641. * .value();
  26642. * // => { 'user': 'barney' }
  26643. */
  26644. function wrapperChain() {
  26645. return chain(this);
  26646. }
  26647. /**
  26648. * Executes the chain sequence and returns the wrapped result.
  26649. *
  26650. * @name commit
  26651. * @memberOf _
  26652. * @since 3.2.0
  26653. * @category Seq
  26654. * @returns {Object} Returns the new `lodash` wrapper instance.
  26655. * @example
  26656. *
  26657. * var array = [1, 2];
  26658. * var wrapped = _(array).push(3);
  26659. *
  26660. * console.log(array);
  26661. * // => [1, 2]
  26662. *
  26663. * wrapped = wrapped.commit();
  26664. * console.log(array);
  26665. * // => [1, 2, 3]
  26666. *
  26667. * wrapped.last();
  26668. * // => 3
  26669. *
  26670. * console.log(array);
  26671. * // => [1, 2, 3]
  26672. */
  26673. function wrapperCommit() {
  26674. return new LodashWrapper(this.value(), this.__chain__);
  26675. }
  26676. /**
  26677. * Gets the next value on a wrapped object following the
  26678. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  26679. *
  26680. * @name next
  26681. * @memberOf _
  26682. * @since 4.0.0
  26683. * @category Seq
  26684. * @returns {Object} Returns the next iterator value.
  26685. * @example
  26686. *
  26687. * var wrapped = _([1, 2]);
  26688. *
  26689. * wrapped.next();
  26690. * // => { 'done': false, 'value': 1 }
  26691. *
  26692. * wrapped.next();
  26693. * // => { 'done': false, 'value': 2 }
  26694. *
  26695. * wrapped.next();
  26696. * // => { 'done': true, 'value': undefined }
  26697. */
  26698. function wrapperNext() {
  26699. if (this.__values__ === undefined) {
  26700. this.__values__ = toArray(this.value());
  26701. }
  26702. var done = this.__index__ >= this.__values__.length,
  26703. value = done ? undefined : this.__values__[this.__index__++];
  26704. return { 'done': done, 'value': value };
  26705. }
  26706. /**
  26707. * Enables the wrapper to be iterable.
  26708. *
  26709. * @name Symbol.iterator
  26710. * @memberOf _
  26711. * @since 4.0.0
  26712. * @category Seq
  26713. * @returns {Object} Returns the wrapper object.
  26714. * @example
  26715. *
  26716. * var wrapped = _([1, 2]);
  26717. *
  26718. * wrapped[Symbol.iterator]() === wrapped;
  26719. * // => true
  26720. *
  26721. * Array.from(wrapped);
  26722. * // => [1, 2]
  26723. */
  26724. function wrapperToIterator() {
  26725. return this;
  26726. }
  26727. /**
  26728. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  26729. *
  26730. * @name plant
  26731. * @memberOf _
  26732. * @since 3.2.0
  26733. * @category Seq
  26734. * @param {*} value The value to plant.
  26735. * @returns {Object} Returns the new `lodash` wrapper instance.
  26736. * @example
  26737. *
  26738. * function square(n) {
  26739. * return n * n;
  26740. * }
  26741. *
  26742. * var wrapped = _([1, 2]).map(square);
  26743. * var other = wrapped.plant([3, 4]);
  26744. *
  26745. * other.value();
  26746. * // => [9, 16]
  26747. *
  26748. * wrapped.value();
  26749. * // => [1, 4]
  26750. */
  26751. function wrapperPlant(value) {
  26752. var result,
  26753. parent = this;
  26754. while (parent instanceof baseLodash) {
  26755. var clone = wrapperClone(parent);
  26756. clone.__index__ = 0;
  26757. clone.__values__ = undefined;
  26758. if (result) {
  26759. previous.__wrapped__ = clone;
  26760. } else {
  26761. result = clone;
  26762. }
  26763. var previous = clone;
  26764. parent = parent.__wrapped__;
  26765. }
  26766. previous.__wrapped__ = value;
  26767. return result;
  26768. }
  26769. /**
  26770. * This method is the wrapper version of `_.reverse`.
  26771. *
  26772. * **Note:** This method mutates the wrapped array.
  26773. *
  26774. * @name reverse
  26775. * @memberOf _
  26776. * @since 0.1.0
  26777. * @category Seq
  26778. * @returns {Object} Returns the new `lodash` wrapper instance.
  26779. * @example
  26780. *
  26781. * var array = [1, 2, 3];
  26782. *
  26783. * _(array).reverse().value()
  26784. * // => [3, 2, 1]
  26785. *
  26786. * console.log(array);
  26787. * // => [3, 2, 1]
  26788. */
  26789. function wrapperReverse() {
  26790. var value = this.__wrapped__;
  26791. if (value instanceof LazyWrapper) {
  26792. var wrapped = value;
  26793. if (this.__actions__.length) {
  26794. wrapped = new LazyWrapper(this);
  26795. }
  26796. wrapped = wrapped.reverse();
  26797. wrapped.__actions__.push({
  26798. 'func': thru,
  26799. 'args': [reverse],
  26800. 'thisArg': undefined
  26801. });
  26802. return new LodashWrapper(wrapped, this.__chain__);
  26803. }
  26804. return this.thru(reverse);
  26805. }
  26806. /**
  26807. * Executes the chain sequence to resolve the unwrapped value.
  26808. *
  26809. * @name value
  26810. * @memberOf _
  26811. * @since 0.1.0
  26812. * @alias toJSON, valueOf
  26813. * @category Seq
  26814. * @returns {*} Returns the resolved unwrapped value.
  26815. * @example
  26816. *
  26817. * _([1, 2, 3]).value();
  26818. * // => [1, 2, 3]
  26819. */
  26820. function wrapperValue() {
  26821. return baseWrapperValue(this.__wrapped__, this.__actions__);
  26822. }
  26823. /*------------------------------------------------------------------------*/
  26824. /**
  26825. * Creates an object composed of keys generated from the results of running
  26826. * each element of `collection` thru `iteratee`. The corresponding value of
  26827. * each key is the number of times the key was returned by `iteratee`. The
  26828. * iteratee is invoked with one argument: (value).
  26829. *
  26830. * @static
  26831. * @memberOf _
  26832. * @since 0.5.0
  26833. * @category Collection
  26834. * @param {Array|Object} collection The collection to iterate over.
  26835. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  26836. * @returns {Object} Returns the composed aggregate object.
  26837. * @example
  26838. *
  26839. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  26840. * // => { '4': 1, '6': 2 }
  26841. *
  26842. * // The `_.property` iteratee shorthand.
  26843. * _.countBy(['one', 'two', 'three'], 'length');
  26844. * // => { '3': 2, '5': 1 }
  26845. */
  26846. var countBy = createAggregator(function(result, value, key) {
  26847. if (hasOwnProperty.call(result, key)) {
  26848. ++result[key];
  26849. } else {
  26850. baseAssignValue(result, key, 1);
  26851. }
  26852. });
  26853. /**
  26854. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  26855. * Iteration is stopped once `predicate` returns falsey. The predicate is
  26856. * invoked with three arguments: (value, index|key, collection).
  26857. *
  26858. * **Note:** This method returns `true` for
  26859. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  26860. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  26861. * elements of empty collections.
  26862. *
  26863. * @static
  26864. * @memberOf _
  26865. * @since 0.1.0
  26866. * @category Collection
  26867. * @param {Array|Object} collection The collection to iterate over.
  26868. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26869. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  26870. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  26871. * else `false`.
  26872. * @example
  26873. *
  26874. * _.every([true, 1, null, 'yes'], Boolean);
  26875. * // => false
  26876. *
  26877. * var users = [
  26878. * { 'user': 'barney', 'age': 36, 'active': false },
  26879. * { 'user': 'fred', 'age': 40, 'active': false }
  26880. * ];
  26881. *
  26882. * // The `_.matches` iteratee shorthand.
  26883. * _.every(users, { 'user': 'barney', 'active': false });
  26884. * // => false
  26885. *
  26886. * // The `_.matchesProperty` iteratee shorthand.
  26887. * _.every(users, ['active', false]);
  26888. * // => true
  26889. *
  26890. * // The `_.property` iteratee shorthand.
  26891. * _.every(users, 'active');
  26892. * // => false
  26893. */
  26894. function every(collection, predicate, guard) {
  26895. var func = isArray(collection) ? arrayEvery : baseEvery;
  26896. if (guard && isIterateeCall(collection, predicate, guard)) {
  26897. predicate = undefined;
  26898. }
  26899. return func(collection, getIteratee(predicate, 3));
  26900. }
  26901. /**
  26902. * Iterates over elements of `collection`, returning an array of all elements
  26903. * `predicate` returns truthy for. The predicate is invoked with three
  26904. * arguments: (value, index|key, collection).
  26905. *
  26906. * **Note:** Unlike `_.remove`, this method returns a new array.
  26907. *
  26908. * @static
  26909. * @memberOf _
  26910. * @since 0.1.0
  26911. * @category Collection
  26912. * @param {Array|Object} collection The collection to iterate over.
  26913. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26914. * @returns {Array} Returns the new filtered array.
  26915. * @see _.reject
  26916. * @example
  26917. *
  26918. * var users = [
  26919. * { 'user': 'barney', 'age': 36, 'active': true },
  26920. * { 'user': 'fred', 'age': 40, 'active': false }
  26921. * ];
  26922. *
  26923. * _.filter(users, function(o) { return !o.active; });
  26924. * // => objects for ['fred']
  26925. *
  26926. * // The `_.matches` iteratee shorthand.
  26927. * _.filter(users, { 'age': 36, 'active': true });
  26928. * // => objects for ['barney']
  26929. *
  26930. * // The `_.matchesProperty` iteratee shorthand.
  26931. * _.filter(users, ['active', false]);
  26932. * // => objects for ['fred']
  26933. *
  26934. * // The `_.property` iteratee shorthand.
  26935. * _.filter(users, 'active');
  26936. * // => objects for ['barney']
  26937. */
  26938. function filter(collection, predicate) {
  26939. var func = isArray(collection) ? arrayFilter : baseFilter;
  26940. return func(collection, getIteratee(predicate, 3));
  26941. }
  26942. /**
  26943. * Iterates over elements of `collection`, returning the first element
  26944. * `predicate` returns truthy for. The predicate is invoked with three
  26945. * arguments: (value, index|key, collection).
  26946. *
  26947. * @static
  26948. * @memberOf _
  26949. * @since 0.1.0
  26950. * @category Collection
  26951. * @param {Array|Object} collection The collection to inspect.
  26952. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26953. * @param {number} [fromIndex=0] The index to search from.
  26954. * @returns {*} Returns the matched element, else `undefined`.
  26955. * @example
  26956. *
  26957. * var users = [
  26958. * { 'user': 'barney', 'age': 36, 'active': true },
  26959. * { 'user': 'fred', 'age': 40, 'active': false },
  26960. * { 'user': 'pebbles', 'age': 1, 'active': true }
  26961. * ];
  26962. *
  26963. * _.find(users, function(o) { return o.age < 40; });
  26964. * // => object for 'barney'
  26965. *
  26966. * // The `_.matches` iteratee shorthand.
  26967. * _.find(users, { 'age': 1, 'active': true });
  26968. * // => object for 'pebbles'
  26969. *
  26970. * // The `_.matchesProperty` iteratee shorthand.
  26971. * _.find(users, ['active', false]);
  26972. * // => object for 'fred'
  26973. *
  26974. * // The `_.property` iteratee shorthand.
  26975. * _.find(users, 'active');
  26976. * // => object for 'barney'
  26977. */
  26978. var find = createFind(findIndex);
  26979. /**
  26980. * This method is like `_.find` except that it iterates over elements of
  26981. * `collection` from right to left.
  26982. *
  26983. * @static
  26984. * @memberOf _
  26985. * @since 2.0.0
  26986. * @category Collection
  26987. * @param {Array|Object} collection The collection to inspect.
  26988. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26989. * @param {number} [fromIndex=collection.length-1] The index to search from.
  26990. * @returns {*} Returns the matched element, else `undefined`.
  26991. * @example
  26992. *
  26993. * _.findLast([1, 2, 3, 4], function(n) {
  26994. * return n % 2 == 1;
  26995. * });
  26996. * // => 3
  26997. */
  26998. var findLast = createFind(findLastIndex);
  26999. /**
  27000. * Creates a flattened array of values by running each element in `collection`
  27001. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  27002. * with three arguments: (value, index|key, collection).
  27003. *
  27004. * @static
  27005. * @memberOf _
  27006. * @since 4.0.0
  27007. * @category Collection
  27008. * @param {Array|Object} collection The collection to iterate over.
  27009. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27010. * @returns {Array} Returns the new flattened array.
  27011. * @example
  27012. *
  27013. * function duplicate(n) {
  27014. * return [n, n];
  27015. * }
  27016. *
  27017. * _.flatMap([1, 2], duplicate);
  27018. * // => [1, 1, 2, 2]
  27019. */
  27020. function flatMap(collection, iteratee) {
  27021. return baseFlatten(map(collection, iteratee), 1);
  27022. }
  27023. /**
  27024. * This method is like `_.flatMap` except that it recursively flattens the
  27025. * mapped results.
  27026. *
  27027. * @static
  27028. * @memberOf _
  27029. * @since 4.7.0
  27030. * @category Collection
  27031. * @param {Array|Object} collection The collection to iterate over.
  27032. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27033. * @returns {Array} Returns the new flattened array.
  27034. * @example
  27035. *
  27036. * function duplicate(n) {
  27037. * return [[[n, n]]];
  27038. * }
  27039. *
  27040. * _.flatMapDeep([1, 2], duplicate);
  27041. * // => [1, 1, 2, 2]
  27042. */
  27043. function flatMapDeep(collection, iteratee) {
  27044. return baseFlatten(map(collection, iteratee), INFINITY);
  27045. }
  27046. /**
  27047. * This method is like `_.flatMap` except that it recursively flattens the
  27048. * mapped results up to `depth` times.
  27049. *
  27050. * @static
  27051. * @memberOf _
  27052. * @since 4.7.0
  27053. * @category Collection
  27054. * @param {Array|Object} collection The collection to iterate over.
  27055. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27056. * @param {number} [depth=1] The maximum recursion depth.
  27057. * @returns {Array} Returns the new flattened array.
  27058. * @example
  27059. *
  27060. * function duplicate(n) {
  27061. * return [[[n, n]]];
  27062. * }
  27063. *
  27064. * _.flatMapDepth([1, 2], duplicate, 2);
  27065. * // => [[1, 1], [2, 2]]
  27066. */
  27067. function flatMapDepth(collection, iteratee, depth) {
  27068. depth = depth === undefined ? 1 : toInteger(depth);
  27069. return baseFlatten(map(collection, iteratee), depth);
  27070. }
  27071. /**
  27072. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  27073. * The iteratee is invoked with three arguments: (value, index|key, collection).
  27074. * Iteratee functions may exit iteration early by explicitly returning `false`.
  27075. *
  27076. * **Note:** As with other "Collections" methods, objects with a "length"
  27077. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  27078. * or `_.forOwn` for object iteration.
  27079. *
  27080. * @static
  27081. * @memberOf _
  27082. * @since 0.1.0
  27083. * @alias each
  27084. * @category Collection
  27085. * @param {Array|Object} collection The collection to iterate over.
  27086. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27087. * @returns {Array|Object} Returns `collection`.
  27088. * @see _.forEachRight
  27089. * @example
  27090. *
  27091. * _.forEach([1, 2], function(value) {
  27092. * console.log(value);
  27093. * });
  27094. * // => Logs `1` then `2`.
  27095. *
  27096. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  27097. * console.log(key);
  27098. * });
  27099. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  27100. */
  27101. function forEach(collection, iteratee) {
  27102. var func = isArray(collection) ? arrayEach : baseEach;
  27103. return func(collection, getIteratee(iteratee, 3));
  27104. }
  27105. /**
  27106. * This method is like `_.forEach` except that it iterates over elements of
  27107. * `collection` from right to left.
  27108. *
  27109. * @static
  27110. * @memberOf _
  27111. * @since 2.0.0
  27112. * @alias eachRight
  27113. * @category Collection
  27114. * @param {Array|Object} collection The collection to iterate over.
  27115. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27116. * @returns {Array|Object} Returns `collection`.
  27117. * @see _.forEach
  27118. * @example
  27119. *
  27120. * _.forEachRight([1, 2], function(value) {
  27121. * console.log(value);
  27122. * });
  27123. * // => Logs `2` then `1`.
  27124. */
  27125. function forEachRight(collection, iteratee) {
  27126. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  27127. return func(collection, getIteratee(iteratee, 3));
  27128. }
  27129. /**
  27130. * Creates an object composed of keys generated from the results of running
  27131. * each element of `collection` thru `iteratee`. The order of grouped values
  27132. * is determined by the order they occur in `collection`. The corresponding
  27133. * value of each key is an array of elements responsible for generating the
  27134. * key. The iteratee is invoked with one argument: (value).
  27135. *
  27136. * @static
  27137. * @memberOf _
  27138. * @since 0.1.0
  27139. * @category Collection
  27140. * @param {Array|Object} collection The collection to iterate over.
  27141. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27142. * @returns {Object} Returns the composed aggregate object.
  27143. * @example
  27144. *
  27145. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  27146. * // => { '4': [4.2], '6': [6.1, 6.3] }
  27147. *
  27148. * // The `_.property` iteratee shorthand.
  27149. * _.groupBy(['one', 'two', 'three'], 'length');
  27150. * // => { '3': ['one', 'two'], '5': ['three'] }
  27151. */
  27152. var groupBy = createAggregator(function(result, value, key) {
  27153. if (hasOwnProperty.call(result, key)) {
  27154. result[key].push(value);
  27155. } else {
  27156. baseAssignValue(result, key, [value]);
  27157. }
  27158. });
  27159. /**
  27160. * Checks if `value` is in `collection`. If `collection` is a string, it's
  27161. * checked for a substring of `value`, otherwise
  27162. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27163. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  27164. * the offset from the end of `collection`.
  27165. *
  27166. * @static
  27167. * @memberOf _
  27168. * @since 0.1.0
  27169. * @category Collection
  27170. * @param {Array|Object|string} collection The collection to inspect.
  27171. * @param {*} value The value to search for.
  27172. * @param {number} [fromIndex=0] The index to search from.
  27173. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  27174. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  27175. * @example
  27176. *
  27177. * _.includes([1, 2, 3], 1);
  27178. * // => true
  27179. *
  27180. * _.includes([1, 2, 3], 1, 2);
  27181. * // => false
  27182. *
  27183. * _.includes({ 'a': 1, 'b': 2 }, 1);
  27184. * // => true
  27185. *
  27186. * _.includes('abcd', 'bc');
  27187. * // => true
  27188. */
  27189. function includes(collection, value, fromIndex, guard) {
  27190. collection = isArrayLike(collection) ? collection : values(collection);
  27191. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  27192. var length = collection.length;
  27193. if (fromIndex < 0) {
  27194. fromIndex = nativeMax(length + fromIndex, 0);
  27195. }
  27196. return isString(collection)
  27197. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  27198. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  27199. }
  27200. /**
  27201. * Invokes the method at `path` of each element in `collection`, returning
  27202. * an array of the results of each invoked method. Any additional arguments
  27203. * are provided to each invoked method. If `path` is a function, it's invoked
  27204. * for, and `this` bound to, each element in `collection`.
  27205. *
  27206. * @static
  27207. * @memberOf _
  27208. * @since 4.0.0
  27209. * @category Collection
  27210. * @param {Array|Object} collection The collection to iterate over.
  27211. * @param {Array|Function|string} path The path of the method to invoke or
  27212. * the function invoked per iteration.
  27213. * @param {...*} [args] The arguments to invoke each method with.
  27214. * @returns {Array} Returns the array of results.
  27215. * @example
  27216. *
  27217. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  27218. * // => [[1, 5, 7], [1, 2, 3]]
  27219. *
  27220. * _.invokeMap([123, 456], String.prototype.split, '');
  27221. * // => [['1', '2', '3'], ['4', '5', '6']]
  27222. */
  27223. var invokeMap = baseRest(function(collection, path, args) {
  27224. var index = -1,
  27225. isFunc = typeof path == 'function',
  27226. result = isArrayLike(collection) ? Array(collection.length) : [];
  27227. baseEach(collection, function(value) {
  27228. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  27229. });
  27230. return result;
  27231. });
  27232. /**
  27233. * Creates an object composed of keys generated from the results of running
  27234. * each element of `collection` thru `iteratee`. The corresponding value of
  27235. * each key is the last element responsible for generating the key. The
  27236. * iteratee is invoked with one argument: (value).
  27237. *
  27238. * @static
  27239. * @memberOf _
  27240. * @since 4.0.0
  27241. * @category Collection
  27242. * @param {Array|Object} collection The collection to iterate over.
  27243. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27244. * @returns {Object} Returns the composed aggregate object.
  27245. * @example
  27246. *
  27247. * var array = [
  27248. * { 'dir': 'left', 'code': 97 },
  27249. * { 'dir': 'right', 'code': 100 }
  27250. * ];
  27251. *
  27252. * _.keyBy(array, function(o) {
  27253. * return String.fromCharCode(o.code);
  27254. * });
  27255. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  27256. *
  27257. * _.keyBy(array, 'dir');
  27258. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  27259. */
  27260. var keyBy = createAggregator(function(result, value, key) {
  27261. baseAssignValue(result, key, value);
  27262. });
  27263. /**
  27264. * Creates an array of values by running each element in `collection` thru
  27265. * `iteratee`. The iteratee is invoked with three arguments:
  27266. * (value, index|key, collection).
  27267. *
  27268. * Many lodash methods are guarded to work as iteratees for methods like
  27269. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  27270. *
  27271. * The guarded methods are:
  27272. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  27273. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  27274. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  27275. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  27276. *
  27277. * @static
  27278. * @memberOf _
  27279. * @since 0.1.0
  27280. * @category Collection
  27281. * @param {Array|Object} collection The collection to iterate over.
  27282. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27283. * @returns {Array} Returns the new mapped array.
  27284. * @example
  27285. *
  27286. * function square(n) {
  27287. * return n * n;
  27288. * }
  27289. *
  27290. * _.map([4, 8], square);
  27291. * // => [16, 64]
  27292. *
  27293. * _.map({ 'a': 4, 'b': 8 }, square);
  27294. * // => [16, 64] (iteration order is not guaranteed)
  27295. *
  27296. * var users = [
  27297. * { 'user': 'barney' },
  27298. * { 'user': 'fred' }
  27299. * ];
  27300. *
  27301. * // The `_.property` iteratee shorthand.
  27302. * _.map(users, 'user');
  27303. * // => ['barney', 'fred']
  27304. */
  27305. function map(collection, iteratee) {
  27306. var func = isArray(collection) ? arrayMap : baseMap;
  27307. return func(collection, getIteratee(iteratee, 3));
  27308. }
  27309. /**
  27310. * This method is like `_.sortBy` except that it allows specifying the sort
  27311. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  27312. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  27313. * descending or "asc" for ascending sort order of corresponding values.
  27314. *
  27315. * @static
  27316. * @memberOf _
  27317. * @since 4.0.0
  27318. * @category Collection
  27319. * @param {Array|Object} collection The collection to iterate over.
  27320. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  27321. * The iteratees to sort by.
  27322. * @param {string[]} [orders] The sort orders of `iteratees`.
  27323. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  27324. * @returns {Array} Returns the new sorted array.
  27325. * @example
  27326. *
  27327. * var users = [
  27328. * { 'user': 'fred', 'age': 48 },
  27329. * { 'user': 'barney', 'age': 34 },
  27330. * { 'user': 'fred', 'age': 40 },
  27331. * { 'user': 'barney', 'age': 36 }
  27332. * ];
  27333. *
  27334. * // Sort by `user` in ascending order and by `age` in descending order.
  27335. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  27336. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  27337. */
  27338. function orderBy(collection, iteratees, orders, guard) {
  27339. if (collection == null) {
  27340. return [];
  27341. }
  27342. if (!isArray(iteratees)) {
  27343. iteratees = iteratees == null ? [] : [iteratees];
  27344. }
  27345. orders = guard ? undefined : orders;
  27346. if (!isArray(orders)) {
  27347. orders = orders == null ? [] : [orders];
  27348. }
  27349. return baseOrderBy(collection, iteratees, orders);
  27350. }
  27351. /**
  27352. * Creates an array of elements split into two groups, the first of which
  27353. * contains elements `predicate` returns truthy for, the second of which
  27354. * contains elements `predicate` returns falsey for. The predicate is
  27355. * invoked with one argument: (value).
  27356. *
  27357. * @static
  27358. * @memberOf _
  27359. * @since 3.0.0
  27360. * @category Collection
  27361. * @param {Array|Object} collection The collection to iterate over.
  27362. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27363. * @returns {Array} Returns the array of grouped elements.
  27364. * @example
  27365. *
  27366. * var users = [
  27367. * { 'user': 'barney', 'age': 36, 'active': false },
  27368. * { 'user': 'fred', 'age': 40, 'active': true },
  27369. * { 'user': 'pebbles', 'age': 1, 'active': false }
  27370. * ];
  27371. *
  27372. * _.partition(users, function(o) { return o.active; });
  27373. * // => objects for [['fred'], ['barney', 'pebbles']]
  27374. *
  27375. * // The `_.matches` iteratee shorthand.
  27376. * _.partition(users, { 'age': 1, 'active': false });
  27377. * // => objects for [['pebbles'], ['barney', 'fred']]
  27378. *
  27379. * // The `_.matchesProperty` iteratee shorthand.
  27380. * _.partition(users, ['active', false]);
  27381. * // => objects for [['barney', 'pebbles'], ['fred']]
  27382. *
  27383. * // The `_.property` iteratee shorthand.
  27384. * _.partition(users, 'active');
  27385. * // => objects for [['fred'], ['barney', 'pebbles']]
  27386. */
  27387. var partition = createAggregator(function(result, value, key) {
  27388. result[key ? 0 : 1].push(value);
  27389. }, function() { return [[], []]; });
  27390. /**
  27391. * Reduces `collection` to a value which is the accumulated result of running
  27392. * each element in `collection` thru `iteratee`, where each successive
  27393. * invocation is supplied the return value of the previous. If `accumulator`
  27394. * is not given, the first element of `collection` is used as the initial
  27395. * value. The iteratee is invoked with four arguments:
  27396. * (accumulator, value, index|key, collection).
  27397. *
  27398. * Many lodash methods are guarded to work as iteratees for methods like
  27399. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  27400. *
  27401. * The guarded methods are:
  27402. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  27403. * and `sortBy`
  27404. *
  27405. * @static
  27406. * @memberOf _
  27407. * @since 0.1.0
  27408. * @category Collection
  27409. * @param {Array|Object} collection The collection to iterate over.
  27410. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27411. * @param {*} [accumulator] The initial value.
  27412. * @returns {*} Returns the accumulated value.
  27413. * @see _.reduceRight
  27414. * @example
  27415. *
  27416. * _.reduce([1, 2], function(sum, n) {
  27417. * return sum + n;
  27418. * }, 0);
  27419. * // => 3
  27420. *
  27421. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  27422. * (result[value] || (result[value] = [])).push(key);
  27423. * return result;
  27424. * }, {});
  27425. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  27426. */
  27427. function reduce(collection, iteratee, accumulator) {
  27428. var func = isArray(collection) ? arrayReduce : baseReduce,
  27429. initAccum = arguments.length < 3;
  27430. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  27431. }
  27432. /**
  27433. * This method is like `_.reduce` except that it iterates over elements of
  27434. * `collection` from right to left.
  27435. *
  27436. * @static
  27437. * @memberOf _
  27438. * @since 0.1.0
  27439. * @category Collection
  27440. * @param {Array|Object} collection The collection to iterate over.
  27441. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27442. * @param {*} [accumulator] The initial value.
  27443. * @returns {*} Returns the accumulated value.
  27444. * @see _.reduce
  27445. * @example
  27446. *
  27447. * var array = [[0, 1], [2, 3], [4, 5]];
  27448. *
  27449. * _.reduceRight(array, function(flattened, other) {
  27450. * return flattened.concat(other);
  27451. * }, []);
  27452. * // => [4, 5, 2, 3, 0, 1]
  27453. */
  27454. function reduceRight(collection, iteratee, accumulator) {
  27455. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  27456. initAccum = arguments.length < 3;
  27457. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  27458. }
  27459. /**
  27460. * The opposite of `_.filter`; this method returns the elements of `collection`
  27461. * that `predicate` does **not** return truthy for.
  27462. *
  27463. * @static
  27464. * @memberOf _
  27465. * @since 0.1.0
  27466. * @category Collection
  27467. * @param {Array|Object} collection The collection to iterate over.
  27468. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27469. * @returns {Array} Returns the new filtered array.
  27470. * @see _.filter
  27471. * @example
  27472. *
  27473. * var users = [
  27474. * { 'user': 'barney', 'age': 36, 'active': false },
  27475. * { 'user': 'fred', 'age': 40, 'active': true }
  27476. * ];
  27477. *
  27478. * _.reject(users, function(o) { return !o.active; });
  27479. * // => objects for ['fred']
  27480. *
  27481. * // The `_.matches` iteratee shorthand.
  27482. * _.reject(users, { 'age': 40, 'active': true });
  27483. * // => objects for ['barney']
  27484. *
  27485. * // The `_.matchesProperty` iteratee shorthand.
  27486. * _.reject(users, ['active', false]);
  27487. * // => objects for ['fred']
  27488. *
  27489. * // The `_.property` iteratee shorthand.
  27490. * _.reject(users, 'active');
  27491. * // => objects for ['barney']
  27492. */
  27493. function reject(collection, predicate) {
  27494. var func = isArray(collection) ? arrayFilter : baseFilter;
  27495. return func(collection, negate(getIteratee(predicate, 3)));
  27496. }
  27497. /**
  27498. * Gets a random element from `collection`.
  27499. *
  27500. * @static
  27501. * @memberOf _
  27502. * @since 2.0.0
  27503. * @category Collection
  27504. * @param {Array|Object} collection The collection to sample.
  27505. * @returns {*} Returns the random element.
  27506. * @example
  27507. *
  27508. * _.sample([1, 2, 3, 4]);
  27509. * // => 2
  27510. */
  27511. function sample(collection) {
  27512. var func = isArray(collection) ? arraySample : baseSample;
  27513. return func(collection);
  27514. }
  27515. /**
  27516. * Gets `n` random elements at unique keys from `collection` up to the
  27517. * size of `collection`.
  27518. *
  27519. * @static
  27520. * @memberOf _
  27521. * @since 4.0.0
  27522. * @category Collection
  27523. * @param {Array|Object} collection The collection to sample.
  27524. * @param {number} [n=1] The number of elements to sample.
  27525. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27526. * @returns {Array} Returns the random elements.
  27527. * @example
  27528. *
  27529. * _.sampleSize([1, 2, 3], 2);
  27530. * // => [3, 1]
  27531. *
  27532. * _.sampleSize([1, 2, 3], 4);
  27533. * // => [2, 3, 1]
  27534. */
  27535. function sampleSize(collection, n, guard) {
  27536. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  27537. n = 1;
  27538. } else {
  27539. n = toInteger(n);
  27540. }
  27541. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  27542. return func(collection, n);
  27543. }
  27544. /**
  27545. * Creates an array of shuffled values, using a version of the
  27546. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  27547. *
  27548. * @static
  27549. * @memberOf _
  27550. * @since 0.1.0
  27551. * @category Collection
  27552. * @param {Array|Object} collection The collection to shuffle.
  27553. * @returns {Array} Returns the new shuffled array.
  27554. * @example
  27555. *
  27556. * _.shuffle([1, 2, 3, 4]);
  27557. * // => [4, 1, 3, 2]
  27558. */
  27559. function shuffle(collection) {
  27560. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  27561. return func(collection);
  27562. }
  27563. /**
  27564. * Gets the size of `collection` by returning its length for array-like
  27565. * values or the number of own enumerable string keyed properties for objects.
  27566. *
  27567. * @static
  27568. * @memberOf _
  27569. * @since 0.1.0
  27570. * @category Collection
  27571. * @param {Array|Object|string} collection The collection to inspect.
  27572. * @returns {number} Returns the collection size.
  27573. * @example
  27574. *
  27575. * _.size([1, 2, 3]);
  27576. * // => 3
  27577. *
  27578. * _.size({ 'a': 1, 'b': 2 });
  27579. * // => 2
  27580. *
  27581. * _.size('pebbles');
  27582. * // => 7
  27583. */
  27584. function size(collection) {
  27585. if (collection == null) {
  27586. return 0;
  27587. }
  27588. if (isArrayLike(collection)) {
  27589. return isString(collection) ? stringSize(collection) : collection.length;
  27590. }
  27591. var tag = getTag(collection);
  27592. if (tag == mapTag || tag == setTag) {
  27593. return collection.size;
  27594. }
  27595. return baseKeys(collection).length;
  27596. }
  27597. /**
  27598. * Checks if `predicate` returns truthy for **any** element of `collection`.
  27599. * Iteration is stopped once `predicate` returns truthy. The predicate is
  27600. * invoked with three arguments: (value, index|key, collection).
  27601. *
  27602. * @static
  27603. * @memberOf _
  27604. * @since 0.1.0
  27605. * @category Collection
  27606. * @param {Array|Object} collection The collection to iterate over.
  27607. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27608. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27609. * @returns {boolean} Returns `true` if any element passes the predicate check,
  27610. * else `false`.
  27611. * @example
  27612. *
  27613. * _.some([null, 0, 'yes', false], Boolean);
  27614. * // => true
  27615. *
  27616. * var users = [
  27617. * { 'user': 'barney', 'active': true },
  27618. * { 'user': 'fred', 'active': false }
  27619. * ];
  27620. *
  27621. * // The `_.matches` iteratee shorthand.
  27622. * _.some(users, { 'user': 'barney', 'active': false });
  27623. * // => false
  27624. *
  27625. * // The `_.matchesProperty` iteratee shorthand.
  27626. * _.some(users, ['active', false]);
  27627. * // => true
  27628. *
  27629. * // The `_.property` iteratee shorthand.
  27630. * _.some(users, 'active');
  27631. * // => true
  27632. */
  27633. function some(collection, predicate, guard) {
  27634. var func = isArray(collection) ? arraySome : baseSome;
  27635. if (guard && isIterateeCall(collection, predicate, guard)) {
  27636. predicate = undefined;
  27637. }
  27638. return func(collection, getIteratee(predicate, 3));
  27639. }
  27640. /**
  27641. * Creates an array of elements, sorted in ascending order by the results of
  27642. * running each element in a collection thru each iteratee. This method
  27643. * performs a stable sort, that is, it preserves the original sort order of
  27644. * equal elements. The iteratees are invoked with one argument: (value).
  27645. *
  27646. * @static
  27647. * @memberOf _
  27648. * @since 0.1.0
  27649. * @category Collection
  27650. * @param {Array|Object} collection The collection to iterate over.
  27651. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  27652. * The iteratees to sort by.
  27653. * @returns {Array} Returns the new sorted array.
  27654. * @example
  27655. *
  27656. * var users = [
  27657. * { 'user': 'fred', 'age': 48 },
  27658. * { 'user': 'barney', 'age': 36 },
  27659. * { 'user': 'fred', 'age': 40 },
  27660. * { 'user': 'barney', 'age': 34 }
  27661. * ];
  27662. *
  27663. * _.sortBy(users, [function(o) { return o.user; }]);
  27664. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  27665. *
  27666. * _.sortBy(users, ['user', 'age']);
  27667. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  27668. */
  27669. var sortBy = baseRest(function(collection, iteratees) {
  27670. if (collection == null) {
  27671. return [];
  27672. }
  27673. var length = iteratees.length;
  27674. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  27675. iteratees = [];
  27676. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  27677. iteratees = [iteratees[0]];
  27678. }
  27679. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  27680. });
  27681. /*------------------------------------------------------------------------*/
  27682. /**
  27683. * Gets the timestamp of the number of milliseconds that have elapsed since
  27684. * the Unix epoch (1 January 1970 00:00:00 UTC).
  27685. *
  27686. * @static
  27687. * @memberOf _
  27688. * @since 2.4.0
  27689. * @category Date
  27690. * @returns {number} Returns the timestamp.
  27691. * @example
  27692. *
  27693. * _.defer(function(stamp) {
  27694. * console.log(_.now() - stamp);
  27695. * }, _.now());
  27696. * // => Logs the number of milliseconds it took for the deferred invocation.
  27697. */
  27698. var now = ctxNow || function() {
  27699. return root.Date.now();
  27700. };
  27701. /*------------------------------------------------------------------------*/
  27702. /**
  27703. * The opposite of `_.before`; this method creates a function that invokes
  27704. * `func` once it's called `n` or more times.
  27705. *
  27706. * @static
  27707. * @memberOf _
  27708. * @since 0.1.0
  27709. * @category Function
  27710. * @param {number} n The number of calls before `func` is invoked.
  27711. * @param {Function} func The function to restrict.
  27712. * @returns {Function} Returns the new restricted function.
  27713. * @example
  27714. *
  27715. * var saves = ['profile', 'settings'];
  27716. *
  27717. * var done = _.after(saves.length, function() {
  27718. * console.log('done saving!');
  27719. * });
  27720. *
  27721. * _.forEach(saves, function(type) {
  27722. * asyncSave({ 'type': type, 'complete': done });
  27723. * });
  27724. * // => Logs 'done saving!' after the two async saves have completed.
  27725. */
  27726. function after(n, func) {
  27727. if (typeof func != 'function') {
  27728. throw new TypeError(FUNC_ERROR_TEXT);
  27729. }
  27730. n = toInteger(n);
  27731. return function() {
  27732. if (--n < 1) {
  27733. return func.apply(this, arguments);
  27734. }
  27735. };
  27736. }
  27737. /**
  27738. * Creates a function that invokes `func`, with up to `n` arguments,
  27739. * ignoring any additional arguments.
  27740. *
  27741. * @static
  27742. * @memberOf _
  27743. * @since 3.0.0
  27744. * @category Function
  27745. * @param {Function} func The function to cap arguments for.
  27746. * @param {number} [n=func.length] The arity cap.
  27747. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27748. * @returns {Function} Returns the new capped function.
  27749. * @example
  27750. *
  27751. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  27752. * // => [6, 8, 10]
  27753. */
  27754. function ary(func, n, guard) {
  27755. n = guard ? undefined : n;
  27756. n = (func && n == null) ? func.length : n;
  27757. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  27758. }
  27759. /**
  27760. * Creates a function that invokes `func`, with the `this` binding and arguments
  27761. * of the created function, while it's called less than `n` times. Subsequent
  27762. * calls to the created function return the result of the last `func` invocation.
  27763. *
  27764. * @static
  27765. * @memberOf _
  27766. * @since 3.0.0
  27767. * @category Function
  27768. * @param {number} n The number of calls at which `func` is no longer invoked.
  27769. * @param {Function} func The function to restrict.
  27770. * @returns {Function} Returns the new restricted function.
  27771. * @example
  27772. *
  27773. * jQuery(element).on('click', _.before(5, addContactToList));
  27774. * // => Allows adding up to 4 contacts to the list.
  27775. */
  27776. function before(n, func) {
  27777. var result;
  27778. if (typeof func != 'function') {
  27779. throw new TypeError(FUNC_ERROR_TEXT);
  27780. }
  27781. n = toInteger(n);
  27782. return function() {
  27783. if (--n > 0) {
  27784. result = func.apply(this, arguments);
  27785. }
  27786. if (n <= 1) {
  27787. func = undefined;
  27788. }
  27789. return result;
  27790. };
  27791. }
  27792. /**
  27793. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  27794. * and `partials` prepended to the arguments it receives.
  27795. *
  27796. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  27797. * may be used as a placeholder for partially applied arguments.
  27798. *
  27799. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  27800. * property of bound functions.
  27801. *
  27802. * @static
  27803. * @memberOf _
  27804. * @since 0.1.0
  27805. * @category Function
  27806. * @param {Function} func The function to bind.
  27807. * @param {*} thisArg The `this` binding of `func`.
  27808. * @param {...*} [partials] The arguments to be partially applied.
  27809. * @returns {Function} Returns the new bound function.
  27810. * @example
  27811. *
  27812. * function greet(greeting, punctuation) {
  27813. * return greeting + ' ' + this.user + punctuation;
  27814. * }
  27815. *
  27816. * var object = { 'user': 'fred' };
  27817. *
  27818. * var bound = _.bind(greet, object, 'hi');
  27819. * bound('!');
  27820. * // => 'hi fred!'
  27821. *
  27822. * // Bound with placeholders.
  27823. * var bound = _.bind(greet, object, _, '!');
  27824. * bound('hi');
  27825. * // => 'hi fred!'
  27826. */
  27827. var bind = baseRest(function(func, thisArg, partials) {
  27828. var bitmask = WRAP_BIND_FLAG;
  27829. if (partials.length) {
  27830. var holders = replaceHolders(partials, getHolder(bind));
  27831. bitmask |= WRAP_PARTIAL_FLAG;
  27832. }
  27833. return createWrap(func, bitmask, thisArg, partials, holders);
  27834. });
  27835. /**
  27836. * Creates a function that invokes the method at `object[key]` with `partials`
  27837. * prepended to the arguments it receives.
  27838. *
  27839. * This method differs from `_.bind` by allowing bound functions to reference
  27840. * methods that may be redefined or don't yet exist. See
  27841. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  27842. * for more details.
  27843. *
  27844. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  27845. * builds, may be used as a placeholder for partially applied arguments.
  27846. *
  27847. * @static
  27848. * @memberOf _
  27849. * @since 0.10.0
  27850. * @category Function
  27851. * @param {Object} object The object to invoke the method on.
  27852. * @param {string} key The key of the method.
  27853. * @param {...*} [partials] The arguments to be partially applied.
  27854. * @returns {Function} Returns the new bound function.
  27855. * @example
  27856. *
  27857. * var object = {
  27858. * 'user': 'fred',
  27859. * 'greet': function(greeting, punctuation) {
  27860. * return greeting + ' ' + this.user + punctuation;
  27861. * }
  27862. * };
  27863. *
  27864. * var bound = _.bindKey(object, 'greet', 'hi');
  27865. * bound('!');
  27866. * // => 'hi fred!'
  27867. *
  27868. * object.greet = function(greeting, punctuation) {
  27869. * return greeting + 'ya ' + this.user + punctuation;
  27870. * };
  27871. *
  27872. * bound('!');
  27873. * // => 'hiya fred!'
  27874. *
  27875. * // Bound with placeholders.
  27876. * var bound = _.bindKey(object, 'greet', _, '!');
  27877. * bound('hi');
  27878. * // => 'hiya fred!'
  27879. */
  27880. var bindKey = baseRest(function(object, key, partials) {
  27881. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  27882. if (partials.length) {
  27883. var holders = replaceHolders(partials, getHolder(bindKey));
  27884. bitmask |= WRAP_PARTIAL_FLAG;
  27885. }
  27886. return createWrap(key, bitmask, object, partials, holders);
  27887. });
  27888. /**
  27889. * Creates a function that accepts arguments of `func` and either invokes
  27890. * `func` returning its result, if at least `arity` number of arguments have
  27891. * been provided, or returns a function that accepts the remaining `func`
  27892. * arguments, and so on. The arity of `func` may be specified if `func.length`
  27893. * is not sufficient.
  27894. *
  27895. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  27896. * may be used as a placeholder for provided arguments.
  27897. *
  27898. * **Note:** This method doesn't set the "length" property of curried functions.
  27899. *
  27900. * @static
  27901. * @memberOf _
  27902. * @since 2.0.0
  27903. * @category Function
  27904. * @param {Function} func The function to curry.
  27905. * @param {number} [arity=func.length] The arity of `func`.
  27906. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27907. * @returns {Function} Returns the new curried function.
  27908. * @example
  27909. *
  27910. * var abc = function(a, b, c) {
  27911. * return [a, b, c];
  27912. * };
  27913. *
  27914. * var curried = _.curry(abc);
  27915. *
  27916. * curried(1)(2)(3);
  27917. * // => [1, 2, 3]
  27918. *
  27919. * curried(1, 2)(3);
  27920. * // => [1, 2, 3]
  27921. *
  27922. * curried(1, 2, 3);
  27923. * // => [1, 2, 3]
  27924. *
  27925. * // Curried with placeholders.
  27926. * curried(1)(_, 3)(2);
  27927. * // => [1, 2, 3]
  27928. */
  27929. function curry(func, arity, guard) {
  27930. arity = guard ? undefined : arity;
  27931. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  27932. result.placeholder = curry.placeholder;
  27933. return result;
  27934. }
  27935. /**
  27936. * This method is like `_.curry` except that arguments are applied to `func`
  27937. * in the manner of `_.partialRight` instead of `_.partial`.
  27938. *
  27939. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  27940. * builds, may be used as a placeholder for provided arguments.
  27941. *
  27942. * **Note:** This method doesn't set the "length" property of curried functions.
  27943. *
  27944. * @static
  27945. * @memberOf _
  27946. * @since 3.0.0
  27947. * @category Function
  27948. * @param {Function} func The function to curry.
  27949. * @param {number} [arity=func.length] The arity of `func`.
  27950. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27951. * @returns {Function} Returns the new curried function.
  27952. * @example
  27953. *
  27954. * var abc = function(a, b, c) {
  27955. * return [a, b, c];
  27956. * };
  27957. *
  27958. * var curried = _.curryRight(abc);
  27959. *
  27960. * curried(3)(2)(1);
  27961. * // => [1, 2, 3]
  27962. *
  27963. * curried(2, 3)(1);
  27964. * // => [1, 2, 3]
  27965. *
  27966. * curried(1, 2, 3);
  27967. * // => [1, 2, 3]
  27968. *
  27969. * // Curried with placeholders.
  27970. * curried(3)(1, _)(2);
  27971. * // => [1, 2, 3]
  27972. */
  27973. function curryRight(func, arity, guard) {
  27974. arity = guard ? undefined : arity;
  27975. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  27976. result.placeholder = curryRight.placeholder;
  27977. return result;
  27978. }
  27979. /**
  27980. * Creates a debounced function that delays invoking `func` until after `wait`
  27981. * milliseconds have elapsed since the last time the debounced function was
  27982. * invoked. The debounced function comes with a `cancel` method to cancel
  27983. * delayed `func` invocations and a `flush` method to immediately invoke them.
  27984. * Provide `options` to indicate whether `func` should be invoked on the
  27985. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  27986. * with the last arguments provided to the debounced function. Subsequent
  27987. * calls to the debounced function return the result of the last `func`
  27988. * invocation.
  27989. *
  27990. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  27991. * invoked on the trailing edge of the timeout only if the debounced function
  27992. * is invoked more than once during the `wait` timeout.
  27993. *
  27994. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  27995. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  27996. *
  27997. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  27998. * for details over the differences between `_.debounce` and `_.throttle`.
  27999. *
  28000. * @static
  28001. * @memberOf _
  28002. * @since 0.1.0
  28003. * @category Function
  28004. * @param {Function} func The function to debounce.
  28005. * @param {number} [wait=0] The number of milliseconds to delay.
  28006. * @param {Object} [options={}] The options object.
  28007. * @param {boolean} [options.leading=false]
  28008. * Specify invoking on the leading edge of the timeout.
  28009. * @param {number} [options.maxWait]
  28010. * The maximum time `func` is allowed to be delayed before it's invoked.
  28011. * @param {boolean} [options.trailing=true]
  28012. * Specify invoking on the trailing edge of the timeout.
  28013. * @returns {Function} Returns the new debounced function.
  28014. * @example
  28015. *
  28016. * // Avoid costly calculations while the window size is in flux.
  28017. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  28018. *
  28019. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  28020. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  28021. * 'leading': true,
  28022. * 'trailing': false
  28023. * }));
  28024. *
  28025. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  28026. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  28027. * var source = new EventSource('/stream');
  28028. * jQuery(source).on('message', debounced);
  28029. *
  28030. * // Cancel the trailing debounced invocation.
  28031. * jQuery(window).on('popstate', debounced.cancel);
  28032. */
  28033. function debounce(func, wait, options) {
  28034. var lastArgs,
  28035. lastThis,
  28036. maxWait,
  28037. result,
  28038. timerId,
  28039. lastCallTime,
  28040. lastInvokeTime = 0,
  28041. leading = false,
  28042. maxing = false,
  28043. trailing = true;
  28044. if (typeof func != 'function') {
  28045. throw new TypeError(FUNC_ERROR_TEXT);
  28046. }
  28047. wait = toNumber(wait) || 0;
  28048. if (isObject(options)) {
  28049. leading = !!options.leading;
  28050. maxing = 'maxWait' in options;
  28051. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  28052. trailing = 'trailing' in options ? !!options.trailing : trailing;
  28053. }
  28054. function invokeFunc(time) {
  28055. var args = lastArgs,
  28056. thisArg = lastThis;
  28057. lastArgs = lastThis = undefined;
  28058. lastInvokeTime = time;
  28059. result = func.apply(thisArg, args);
  28060. return result;
  28061. }
  28062. function leadingEdge(time) {
  28063. // Reset any `maxWait` timer.
  28064. lastInvokeTime = time;
  28065. // Start the timer for the trailing edge.
  28066. timerId = setTimeout(timerExpired, wait);
  28067. // Invoke the leading edge.
  28068. return leading ? invokeFunc(time) : result;
  28069. }
  28070. function remainingWait(time) {
  28071. var timeSinceLastCall = time - lastCallTime,
  28072. timeSinceLastInvoke = time - lastInvokeTime,
  28073. timeWaiting = wait - timeSinceLastCall;
  28074. return maxing
  28075. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  28076. : timeWaiting;
  28077. }
  28078. function shouldInvoke(time) {
  28079. var timeSinceLastCall = time - lastCallTime,
  28080. timeSinceLastInvoke = time - lastInvokeTime;
  28081. // Either this is the first call, activity has stopped and we're at the
  28082. // trailing edge, the system time has gone backwards and we're treating
  28083. // it as the trailing edge, or we've hit the `maxWait` limit.
  28084. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  28085. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  28086. }
  28087. function timerExpired() {
  28088. var time = now();
  28089. if (shouldInvoke(time)) {
  28090. return trailingEdge(time);
  28091. }
  28092. // Restart the timer.
  28093. timerId = setTimeout(timerExpired, remainingWait(time));
  28094. }
  28095. function trailingEdge(time) {
  28096. timerId = undefined;
  28097. // Only invoke if we have `lastArgs` which means `func` has been
  28098. // debounced at least once.
  28099. if (trailing && lastArgs) {
  28100. return invokeFunc(time);
  28101. }
  28102. lastArgs = lastThis = undefined;
  28103. return result;
  28104. }
  28105. function cancel() {
  28106. if (timerId !== undefined) {
  28107. clearTimeout(timerId);
  28108. }
  28109. lastInvokeTime = 0;
  28110. lastArgs = lastCallTime = lastThis = timerId = undefined;
  28111. }
  28112. function flush() {
  28113. return timerId === undefined ? result : trailingEdge(now());
  28114. }
  28115. function debounced() {
  28116. var time = now(),
  28117. isInvoking = shouldInvoke(time);
  28118. lastArgs = arguments;
  28119. lastThis = this;
  28120. lastCallTime = time;
  28121. if (isInvoking) {
  28122. if (timerId === undefined) {
  28123. return leadingEdge(lastCallTime);
  28124. }
  28125. if (maxing) {
  28126. // Handle invocations in a tight loop.
  28127. clearTimeout(timerId);
  28128. timerId = setTimeout(timerExpired, wait);
  28129. return invokeFunc(lastCallTime);
  28130. }
  28131. }
  28132. if (timerId === undefined) {
  28133. timerId = setTimeout(timerExpired, wait);
  28134. }
  28135. return result;
  28136. }
  28137. debounced.cancel = cancel;
  28138. debounced.flush = flush;
  28139. return debounced;
  28140. }
  28141. /**
  28142. * Defers invoking the `func` until the current call stack has cleared. Any
  28143. * additional arguments are provided to `func` when it's invoked.
  28144. *
  28145. * @static
  28146. * @memberOf _
  28147. * @since 0.1.0
  28148. * @category Function
  28149. * @param {Function} func The function to defer.
  28150. * @param {...*} [args] The arguments to invoke `func` with.
  28151. * @returns {number} Returns the timer id.
  28152. * @example
  28153. *
  28154. * _.defer(function(text) {
  28155. * console.log(text);
  28156. * }, 'deferred');
  28157. * // => Logs 'deferred' after one millisecond.
  28158. */
  28159. var defer = baseRest(function(func, args) {
  28160. return baseDelay(func, 1, args);
  28161. });
  28162. /**
  28163. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  28164. * provided to `func` when it's invoked.
  28165. *
  28166. * @static
  28167. * @memberOf _
  28168. * @since 0.1.0
  28169. * @category Function
  28170. * @param {Function} func The function to delay.
  28171. * @param {number} wait The number of milliseconds to delay invocation.
  28172. * @param {...*} [args] The arguments to invoke `func` with.
  28173. * @returns {number} Returns the timer id.
  28174. * @example
  28175. *
  28176. * _.delay(function(text) {
  28177. * console.log(text);
  28178. * }, 1000, 'later');
  28179. * // => Logs 'later' after one second.
  28180. */
  28181. var delay = baseRest(function(func, wait, args) {
  28182. return baseDelay(func, toNumber(wait) || 0, args);
  28183. });
  28184. /**
  28185. * Creates a function that invokes `func` with arguments reversed.
  28186. *
  28187. * @static
  28188. * @memberOf _
  28189. * @since 4.0.0
  28190. * @category Function
  28191. * @param {Function} func The function to flip arguments for.
  28192. * @returns {Function} Returns the new flipped function.
  28193. * @example
  28194. *
  28195. * var flipped = _.flip(function() {
  28196. * return _.toArray(arguments);
  28197. * });
  28198. *
  28199. * flipped('a', 'b', 'c', 'd');
  28200. * // => ['d', 'c', 'b', 'a']
  28201. */
  28202. function flip(func) {
  28203. return createWrap(func, WRAP_FLIP_FLAG);
  28204. }
  28205. /**
  28206. * Creates a function that memoizes the result of `func`. If `resolver` is
  28207. * provided, it determines the cache key for storing the result based on the
  28208. * arguments provided to the memoized function. By default, the first argument
  28209. * provided to the memoized function is used as the map cache key. The `func`
  28210. * is invoked with the `this` binding of the memoized function.
  28211. *
  28212. * **Note:** The cache is exposed as the `cache` property on the memoized
  28213. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28214. * constructor with one whose instances implement the
  28215. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28216. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  28217. *
  28218. * @static
  28219. * @memberOf _
  28220. * @since 0.1.0
  28221. * @category Function
  28222. * @param {Function} func The function to have its output memoized.
  28223. * @param {Function} [resolver] The function to resolve the cache key.
  28224. * @returns {Function} Returns the new memoized function.
  28225. * @example
  28226. *
  28227. * var object = { 'a': 1, 'b': 2 };
  28228. * var other = { 'c': 3, 'd': 4 };
  28229. *
  28230. * var values = _.memoize(_.values);
  28231. * values(object);
  28232. * // => [1, 2]
  28233. *
  28234. * values(other);
  28235. * // => [3, 4]
  28236. *
  28237. * object.a = 2;
  28238. * values(object);
  28239. * // => [1, 2]
  28240. *
  28241. * // Modify the result cache.
  28242. * values.cache.set(object, ['a', 'b']);
  28243. * values(object);
  28244. * // => ['a', 'b']
  28245. *
  28246. * // Replace `_.memoize.Cache`.
  28247. * _.memoize.Cache = WeakMap;
  28248. */
  28249. function memoize(func, resolver) {
  28250. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  28251. throw new TypeError(FUNC_ERROR_TEXT);
  28252. }
  28253. var memoized = function() {
  28254. var args = arguments,
  28255. key = resolver ? resolver.apply(this, args) : args[0],
  28256. cache = memoized.cache;
  28257. if (cache.has(key)) {
  28258. return cache.get(key);
  28259. }
  28260. var result = func.apply(this, args);
  28261. memoized.cache = cache.set(key, result) || cache;
  28262. return result;
  28263. };
  28264. memoized.cache = new (memoize.Cache || MapCache);
  28265. return memoized;
  28266. }
  28267. // Expose `MapCache`.
  28268. memoize.Cache = MapCache;
  28269. /**
  28270. * Creates a function that negates the result of the predicate `func`. The
  28271. * `func` predicate is invoked with the `this` binding and arguments of the
  28272. * created function.
  28273. *
  28274. * @static
  28275. * @memberOf _
  28276. * @since 3.0.0
  28277. * @category Function
  28278. * @param {Function} predicate The predicate to negate.
  28279. * @returns {Function} Returns the new negated function.
  28280. * @example
  28281. *
  28282. * function isEven(n) {
  28283. * return n % 2 == 0;
  28284. * }
  28285. *
  28286. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  28287. * // => [1, 3, 5]
  28288. */
  28289. function negate(predicate) {
  28290. if (typeof predicate != 'function') {
  28291. throw new TypeError(FUNC_ERROR_TEXT);
  28292. }
  28293. return function() {
  28294. var args = arguments;
  28295. switch (args.length) {
  28296. case 0: return !predicate.call(this);
  28297. case 1: return !predicate.call(this, args[0]);
  28298. case 2: return !predicate.call(this, args[0], args[1]);
  28299. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  28300. }
  28301. return !predicate.apply(this, args);
  28302. };
  28303. }
  28304. /**
  28305. * Creates a function that is restricted to invoking `func` once. Repeat calls
  28306. * to the function return the value of the first invocation. The `func` is
  28307. * invoked with the `this` binding and arguments of the created function.
  28308. *
  28309. * @static
  28310. * @memberOf _
  28311. * @since 0.1.0
  28312. * @category Function
  28313. * @param {Function} func The function to restrict.
  28314. * @returns {Function} Returns the new restricted function.
  28315. * @example
  28316. *
  28317. * var initialize = _.once(createApplication);
  28318. * initialize();
  28319. * initialize();
  28320. * // => `createApplication` is invoked once
  28321. */
  28322. function once(func) {
  28323. return before(2, func);
  28324. }
  28325. /**
  28326. * Creates a function that invokes `func` with its arguments transformed.
  28327. *
  28328. * @static
  28329. * @since 4.0.0
  28330. * @memberOf _
  28331. * @category Function
  28332. * @param {Function} func The function to wrap.
  28333. * @param {...(Function|Function[])} [transforms=[_.identity]]
  28334. * The argument transforms.
  28335. * @returns {Function} Returns the new function.
  28336. * @example
  28337. *
  28338. * function doubled(n) {
  28339. * return n * 2;
  28340. * }
  28341. *
  28342. * function square(n) {
  28343. * return n * n;
  28344. * }
  28345. *
  28346. * var func = _.overArgs(function(x, y) {
  28347. * return [x, y];
  28348. * }, [square, doubled]);
  28349. *
  28350. * func(9, 3);
  28351. * // => [81, 6]
  28352. *
  28353. * func(10, 5);
  28354. * // => [100, 10]
  28355. */
  28356. var overArgs = castRest(function(func, transforms) {
  28357. transforms = (transforms.length == 1 && isArray(transforms[0]))
  28358. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  28359. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  28360. var funcsLength = transforms.length;
  28361. return baseRest(function(args) {
  28362. var index = -1,
  28363. length = nativeMin(args.length, funcsLength);
  28364. while (++index < length) {
  28365. args[index] = transforms[index].call(this, args[index]);
  28366. }
  28367. return apply(func, this, args);
  28368. });
  28369. });
  28370. /**
  28371. * Creates a function that invokes `func` with `partials` prepended to the
  28372. * arguments it receives. This method is like `_.bind` except it does **not**
  28373. * alter the `this` binding.
  28374. *
  28375. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  28376. * builds, may be used as a placeholder for partially applied arguments.
  28377. *
  28378. * **Note:** This method doesn't set the "length" property of partially
  28379. * applied functions.
  28380. *
  28381. * @static
  28382. * @memberOf _
  28383. * @since 0.2.0
  28384. * @category Function
  28385. * @param {Function} func The function to partially apply arguments to.
  28386. * @param {...*} [partials] The arguments to be partially applied.
  28387. * @returns {Function} Returns the new partially applied function.
  28388. * @example
  28389. *
  28390. * function greet(greeting, name) {
  28391. * return greeting + ' ' + name;
  28392. * }
  28393. *
  28394. * var sayHelloTo = _.partial(greet, 'hello');
  28395. * sayHelloTo('fred');
  28396. * // => 'hello fred'
  28397. *
  28398. * // Partially applied with placeholders.
  28399. * var greetFred = _.partial(greet, _, 'fred');
  28400. * greetFred('hi');
  28401. * // => 'hi fred'
  28402. */
  28403. var partial = baseRest(function(func, partials) {
  28404. var holders = replaceHolders(partials, getHolder(partial));
  28405. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  28406. });
  28407. /**
  28408. * This method is like `_.partial` except that partially applied arguments
  28409. * are appended to the arguments it receives.
  28410. *
  28411. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  28412. * builds, may be used as a placeholder for partially applied arguments.
  28413. *
  28414. * **Note:** This method doesn't set the "length" property of partially
  28415. * applied functions.
  28416. *
  28417. * @static
  28418. * @memberOf _
  28419. * @since 1.0.0
  28420. * @category Function
  28421. * @param {Function} func The function to partially apply arguments to.
  28422. * @param {...*} [partials] The arguments to be partially applied.
  28423. * @returns {Function} Returns the new partially applied function.
  28424. * @example
  28425. *
  28426. * function greet(greeting, name) {
  28427. * return greeting + ' ' + name;
  28428. * }
  28429. *
  28430. * var greetFred = _.partialRight(greet, 'fred');
  28431. * greetFred('hi');
  28432. * // => 'hi fred'
  28433. *
  28434. * // Partially applied with placeholders.
  28435. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  28436. * sayHelloTo('fred');
  28437. * // => 'hello fred'
  28438. */
  28439. var partialRight = baseRest(function(func, partials) {
  28440. var holders = replaceHolders(partials, getHolder(partialRight));
  28441. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  28442. });
  28443. /**
  28444. * Creates a function that invokes `func` with arguments arranged according
  28445. * to the specified `indexes` where the argument value at the first index is
  28446. * provided as the first argument, the argument value at the second index is
  28447. * provided as the second argument, and so on.
  28448. *
  28449. * @static
  28450. * @memberOf _
  28451. * @since 3.0.0
  28452. * @category Function
  28453. * @param {Function} func The function to rearrange arguments for.
  28454. * @param {...(number|number[])} indexes The arranged argument indexes.
  28455. * @returns {Function} Returns the new function.
  28456. * @example
  28457. *
  28458. * var rearged = _.rearg(function(a, b, c) {
  28459. * return [a, b, c];
  28460. * }, [2, 0, 1]);
  28461. *
  28462. * rearged('b', 'c', 'a')
  28463. * // => ['a', 'b', 'c']
  28464. */
  28465. var rearg = flatRest(function(func, indexes) {
  28466. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  28467. });
  28468. /**
  28469. * Creates a function that invokes `func` with the `this` binding of the
  28470. * created function and arguments from `start` and beyond provided as
  28471. * an array.
  28472. *
  28473. * **Note:** This method is based on the
  28474. * [rest parameter](https://mdn.io/rest_parameters).
  28475. *
  28476. * @static
  28477. * @memberOf _
  28478. * @since 4.0.0
  28479. * @category Function
  28480. * @param {Function} func The function to apply a rest parameter to.
  28481. * @param {number} [start=func.length-1] The start position of the rest parameter.
  28482. * @returns {Function} Returns the new function.
  28483. * @example
  28484. *
  28485. * var say = _.rest(function(what, names) {
  28486. * return what + ' ' + _.initial(names).join(', ') +
  28487. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  28488. * });
  28489. *
  28490. * say('hello', 'fred', 'barney', 'pebbles');
  28491. * // => 'hello fred, barney, & pebbles'
  28492. */
  28493. function rest(func, start) {
  28494. if (typeof func != 'function') {
  28495. throw new TypeError(FUNC_ERROR_TEXT);
  28496. }
  28497. start = start === undefined ? start : toInteger(start);
  28498. return baseRest(func, start);
  28499. }
  28500. /**
  28501. * Creates a function that invokes `func` with the `this` binding of the
  28502. * create function and an array of arguments much like
  28503. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  28504. *
  28505. * **Note:** This method is based on the
  28506. * [spread operator](https://mdn.io/spread_operator).
  28507. *
  28508. * @static
  28509. * @memberOf _
  28510. * @since 3.2.0
  28511. * @category Function
  28512. * @param {Function} func The function to spread arguments over.
  28513. * @param {number} [start=0] The start position of the spread.
  28514. * @returns {Function} Returns the new function.
  28515. * @example
  28516. *
  28517. * var say = _.spread(function(who, what) {
  28518. * return who + ' says ' + what;
  28519. * });
  28520. *
  28521. * say(['fred', 'hello']);
  28522. * // => 'fred says hello'
  28523. *
  28524. * var numbers = Promise.all([
  28525. * Promise.resolve(40),
  28526. * Promise.resolve(36)
  28527. * ]);
  28528. *
  28529. * numbers.then(_.spread(function(x, y) {
  28530. * return x + y;
  28531. * }));
  28532. * // => a Promise of 76
  28533. */
  28534. function spread(func, start) {
  28535. if (typeof func != 'function') {
  28536. throw new TypeError(FUNC_ERROR_TEXT);
  28537. }
  28538. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  28539. return baseRest(function(args) {
  28540. var array = args[start],
  28541. otherArgs = castSlice(args, 0, start);
  28542. if (array) {
  28543. arrayPush(otherArgs, array);
  28544. }
  28545. return apply(func, this, otherArgs);
  28546. });
  28547. }
  28548. /**
  28549. * Creates a throttled function that only invokes `func` at most once per
  28550. * every `wait` milliseconds. The throttled function comes with a `cancel`
  28551. * method to cancel delayed `func` invocations and a `flush` method to
  28552. * immediately invoke them. Provide `options` to indicate whether `func`
  28553. * should be invoked on the leading and/or trailing edge of the `wait`
  28554. * timeout. The `func` is invoked with the last arguments provided to the
  28555. * throttled function. Subsequent calls to the throttled function return the
  28556. * result of the last `func` invocation.
  28557. *
  28558. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  28559. * invoked on the trailing edge of the timeout only if the throttled function
  28560. * is invoked more than once during the `wait` timeout.
  28561. *
  28562. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  28563. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  28564. *
  28565. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  28566. * for details over the differences between `_.throttle` and `_.debounce`.
  28567. *
  28568. * @static
  28569. * @memberOf _
  28570. * @since 0.1.0
  28571. * @category Function
  28572. * @param {Function} func The function to throttle.
  28573. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  28574. * @param {Object} [options={}] The options object.
  28575. * @param {boolean} [options.leading=true]
  28576. * Specify invoking on the leading edge of the timeout.
  28577. * @param {boolean} [options.trailing=true]
  28578. * Specify invoking on the trailing edge of the timeout.
  28579. * @returns {Function} Returns the new throttled function.
  28580. * @example
  28581. *
  28582. * // Avoid excessively updating the position while scrolling.
  28583. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  28584. *
  28585. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  28586. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  28587. * jQuery(element).on('click', throttled);
  28588. *
  28589. * // Cancel the trailing throttled invocation.
  28590. * jQuery(window).on('popstate', throttled.cancel);
  28591. */
  28592. function throttle(func, wait, options) {
  28593. var leading = true,
  28594. trailing = true;
  28595. if (typeof func != 'function') {
  28596. throw new TypeError(FUNC_ERROR_TEXT);
  28597. }
  28598. if (isObject(options)) {
  28599. leading = 'leading' in options ? !!options.leading : leading;
  28600. trailing = 'trailing' in options ? !!options.trailing : trailing;
  28601. }
  28602. return debounce(func, wait, {
  28603. 'leading': leading,
  28604. 'maxWait': wait,
  28605. 'trailing': trailing
  28606. });
  28607. }
  28608. /**
  28609. * Creates a function that accepts up to one argument, ignoring any
  28610. * additional arguments.
  28611. *
  28612. * @static
  28613. * @memberOf _
  28614. * @since 4.0.0
  28615. * @category Function
  28616. * @param {Function} func The function to cap arguments for.
  28617. * @returns {Function} Returns the new capped function.
  28618. * @example
  28619. *
  28620. * _.map(['6', '8', '10'], _.unary(parseInt));
  28621. * // => [6, 8, 10]
  28622. */
  28623. function unary(func) {
  28624. return ary(func, 1);
  28625. }
  28626. /**
  28627. * Creates a function that provides `value` to `wrapper` as its first
  28628. * argument. Any additional arguments provided to the function are appended
  28629. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  28630. * binding of the created function.
  28631. *
  28632. * @static
  28633. * @memberOf _
  28634. * @since 0.1.0
  28635. * @category Function
  28636. * @param {*} value The value to wrap.
  28637. * @param {Function} [wrapper=identity] The wrapper function.
  28638. * @returns {Function} Returns the new function.
  28639. * @example
  28640. *
  28641. * var p = _.wrap(_.escape, function(func, text) {
  28642. * return '<p>' + func(text) + '</p>';
  28643. * });
  28644. *
  28645. * p('fred, barney, & pebbles');
  28646. * // => '<p>fred, barney, &amp; pebbles</p>'
  28647. */
  28648. function wrap(value, wrapper) {
  28649. return partial(castFunction(wrapper), value);
  28650. }
  28651. /*------------------------------------------------------------------------*/
  28652. /**
  28653. * Casts `value` as an array if it's not one.
  28654. *
  28655. * @static
  28656. * @memberOf _
  28657. * @since 4.4.0
  28658. * @category Lang
  28659. * @param {*} value The value to inspect.
  28660. * @returns {Array} Returns the cast array.
  28661. * @example
  28662. *
  28663. * _.castArray(1);
  28664. * // => [1]
  28665. *
  28666. * _.castArray({ 'a': 1 });
  28667. * // => [{ 'a': 1 }]
  28668. *
  28669. * _.castArray('abc');
  28670. * // => ['abc']
  28671. *
  28672. * _.castArray(null);
  28673. * // => [null]
  28674. *
  28675. * _.castArray(undefined);
  28676. * // => [undefined]
  28677. *
  28678. * _.castArray();
  28679. * // => []
  28680. *
  28681. * var array = [1, 2, 3];
  28682. * console.log(_.castArray(array) === array);
  28683. * // => true
  28684. */
  28685. function castArray() {
  28686. if (!arguments.length) {
  28687. return [];
  28688. }
  28689. var value = arguments[0];
  28690. return isArray(value) ? value : [value];
  28691. }
  28692. /**
  28693. * Creates a shallow clone of `value`.
  28694. *
  28695. * **Note:** This method is loosely based on the
  28696. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  28697. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  28698. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  28699. * arrays. The own enumerable properties of `arguments` objects are cloned
  28700. * as plain objects. An empty object is returned for uncloneable values such
  28701. * as error objects, functions, DOM nodes, and WeakMaps.
  28702. *
  28703. * @static
  28704. * @memberOf _
  28705. * @since 0.1.0
  28706. * @category Lang
  28707. * @param {*} value The value to clone.
  28708. * @returns {*} Returns the cloned value.
  28709. * @see _.cloneDeep
  28710. * @example
  28711. *
  28712. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  28713. *
  28714. * var shallow = _.clone(objects);
  28715. * console.log(shallow[0] === objects[0]);
  28716. * // => true
  28717. */
  28718. function clone(value) {
  28719. return baseClone(value, CLONE_SYMBOLS_FLAG);
  28720. }
  28721. /**
  28722. * This method is like `_.clone` except that it accepts `customizer` which
  28723. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  28724. * cloning is handled by the method instead. The `customizer` is invoked with
  28725. * up to four arguments; (value [, index|key, object, stack]).
  28726. *
  28727. * @static
  28728. * @memberOf _
  28729. * @since 4.0.0
  28730. * @category Lang
  28731. * @param {*} value The value to clone.
  28732. * @param {Function} [customizer] The function to customize cloning.
  28733. * @returns {*} Returns the cloned value.
  28734. * @see _.cloneDeepWith
  28735. * @example
  28736. *
  28737. * function customizer(value) {
  28738. * if (_.isElement(value)) {
  28739. * return value.cloneNode(false);
  28740. * }
  28741. * }
  28742. *
  28743. * var el = _.cloneWith(document.body, customizer);
  28744. *
  28745. * console.log(el === document.body);
  28746. * // => false
  28747. * console.log(el.nodeName);
  28748. * // => 'BODY'
  28749. * console.log(el.childNodes.length);
  28750. * // => 0
  28751. */
  28752. function cloneWith(value, customizer) {
  28753. customizer = typeof customizer == 'function' ? customizer : undefined;
  28754. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  28755. }
  28756. /**
  28757. * This method is like `_.clone` except that it recursively clones `value`.
  28758. *
  28759. * @static
  28760. * @memberOf _
  28761. * @since 1.0.0
  28762. * @category Lang
  28763. * @param {*} value The value to recursively clone.
  28764. * @returns {*} Returns the deep cloned value.
  28765. * @see _.clone
  28766. * @example
  28767. *
  28768. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  28769. *
  28770. * var deep = _.cloneDeep(objects);
  28771. * console.log(deep[0] === objects[0]);
  28772. * // => false
  28773. */
  28774. function cloneDeep(value) {
  28775. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  28776. }
  28777. /**
  28778. * This method is like `_.cloneWith` except that it recursively clones `value`.
  28779. *
  28780. * @static
  28781. * @memberOf _
  28782. * @since 4.0.0
  28783. * @category Lang
  28784. * @param {*} value The value to recursively clone.
  28785. * @param {Function} [customizer] The function to customize cloning.
  28786. * @returns {*} Returns the deep cloned value.
  28787. * @see _.cloneWith
  28788. * @example
  28789. *
  28790. * function customizer(value) {
  28791. * if (_.isElement(value)) {
  28792. * return value.cloneNode(true);
  28793. * }
  28794. * }
  28795. *
  28796. * var el = _.cloneDeepWith(document.body, customizer);
  28797. *
  28798. * console.log(el === document.body);
  28799. * // => false
  28800. * console.log(el.nodeName);
  28801. * // => 'BODY'
  28802. * console.log(el.childNodes.length);
  28803. * // => 20
  28804. */
  28805. function cloneDeepWith(value, customizer) {
  28806. customizer = typeof customizer == 'function' ? customizer : undefined;
  28807. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  28808. }
  28809. /**
  28810. * Checks if `object` conforms to `source` by invoking the predicate
  28811. * properties of `source` with the corresponding property values of `object`.
  28812. *
  28813. * **Note:** This method is equivalent to `_.conforms` when `source` is
  28814. * partially applied.
  28815. *
  28816. * @static
  28817. * @memberOf _
  28818. * @since 4.14.0
  28819. * @category Lang
  28820. * @param {Object} object The object to inspect.
  28821. * @param {Object} source The object of property predicates to conform to.
  28822. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  28823. * @example
  28824. *
  28825. * var object = { 'a': 1, 'b': 2 };
  28826. *
  28827. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  28828. * // => true
  28829. *
  28830. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  28831. * // => false
  28832. */
  28833. function conformsTo(object, source) {
  28834. return source == null || baseConformsTo(object, source, keys(source));
  28835. }
  28836. /**
  28837. * Performs a
  28838. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28839. * comparison between two values to determine if they are equivalent.
  28840. *
  28841. * @static
  28842. * @memberOf _
  28843. * @since 4.0.0
  28844. * @category Lang
  28845. * @param {*} value The value to compare.
  28846. * @param {*} other The other value to compare.
  28847. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28848. * @example
  28849. *
  28850. * var object = { 'a': 1 };
  28851. * var other = { 'a': 1 };
  28852. *
  28853. * _.eq(object, object);
  28854. * // => true
  28855. *
  28856. * _.eq(object, other);
  28857. * // => false
  28858. *
  28859. * _.eq('a', 'a');
  28860. * // => true
  28861. *
  28862. * _.eq('a', Object('a'));
  28863. * // => false
  28864. *
  28865. * _.eq(NaN, NaN);
  28866. * // => true
  28867. */
  28868. function eq(value, other) {
  28869. return value === other || (value !== value && other !== other);
  28870. }
  28871. /**
  28872. * Checks if `value` is greater than `other`.
  28873. *
  28874. * @static
  28875. * @memberOf _
  28876. * @since 3.9.0
  28877. * @category Lang
  28878. * @param {*} value The value to compare.
  28879. * @param {*} other The other value to compare.
  28880. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  28881. * else `false`.
  28882. * @see _.lt
  28883. * @example
  28884. *
  28885. * _.gt(3, 1);
  28886. * // => true
  28887. *
  28888. * _.gt(3, 3);
  28889. * // => false
  28890. *
  28891. * _.gt(1, 3);
  28892. * // => false
  28893. */
  28894. var gt = createRelationalOperation(baseGt);
  28895. /**
  28896. * Checks if `value` is greater than or equal to `other`.
  28897. *
  28898. * @static
  28899. * @memberOf _
  28900. * @since 3.9.0
  28901. * @category Lang
  28902. * @param {*} value The value to compare.
  28903. * @param {*} other The other value to compare.
  28904. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  28905. * `other`, else `false`.
  28906. * @see _.lte
  28907. * @example
  28908. *
  28909. * _.gte(3, 1);
  28910. * // => true
  28911. *
  28912. * _.gte(3, 3);
  28913. * // => true
  28914. *
  28915. * _.gte(1, 3);
  28916. * // => false
  28917. */
  28918. var gte = createRelationalOperation(function(value, other) {
  28919. return value >= other;
  28920. });
  28921. /**
  28922. * Checks if `value` is likely an `arguments` object.
  28923. *
  28924. * @static
  28925. * @memberOf _
  28926. * @since 0.1.0
  28927. * @category Lang
  28928. * @param {*} value The value to check.
  28929. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  28930. * else `false`.
  28931. * @example
  28932. *
  28933. * _.isArguments(function() { return arguments; }());
  28934. * // => true
  28935. *
  28936. * _.isArguments([1, 2, 3]);
  28937. * // => false
  28938. */
  28939. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  28940. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  28941. !propertyIsEnumerable.call(value, 'callee');
  28942. };
  28943. /**
  28944. * Checks if `value` is classified as an `Array` object.
  28945. *
  28946. * @static
  28947. * @memberOf _
  28948. * @since 0.1.0
  28949. * @category Lang
  28950. * @param {*} value The value to check.
  28951. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28952. * @example
  28953. *
  28954. * _.isArray([1, 2, 3]);
  28955. * // => true
  28956. *
  28957. * _.isArray(document.body.children);
  28958. * // => false
  28959. *
  28960. * _.isArray('abc');
  28961. * // => false
  28962. *
  28963. * _.isArray(_.noop);
  28964. * // => false
  28965. */
  28966. var isArray = Array.isArray;
  28967. /**
  28968. * Checks if `value` is classified as an `ArrayBuffer` object.
  28969. *
  28970. * @static
  28971. * @memberOf _
  28972. * @since 4.3.0
  28973. * @category Lang
  28974. * @param {*} value The value to check.
  28975. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  28976. * @example
  28977. *
  28978. * _.isArrayBuffer(new ArrayBuffer(2));
  28979. * // => true
  28980. *
  28981. * _.isArrayBuffer(new Array(2));
  28982. * // => false
  28983. */
  28984. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  28985. /**
  28986. * Checks if `value` is array-like. A value is considered array-like if it's
  28987. * not a function and has a `value.length` that's an integer greater than or
  28988. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  28989. *
  28990. * @static
  28991. * @memberOf _
  28992. * @since 4.0.0
  28993. * @category Lang
  28994. * @param {*} value The value to check.
  28995. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  28996. * @example
  28997. *
  28998. * _.isArrayLike([1, 2, 3]);
  28999. * // => true
  29000. *
  29001. * _.isArrayLike(document.body.children);
  29002. * // => true
  29003. *
  29004. * _.isArrayLike('abc');
  29005. * // => true
  29006. *
  29007. * _.isArrayLike(_.noop);
  29008. * // => false
  29009. */
  29010. function isArrayLike(value) {
  29011. return value != null && isLength(value.length) && !isFunction(value);
  29012. }
  29013. /**
  29014. * This method is like `_.isArrayLike` except that it also checks if `value`
  29015. * is an object.
  29016. *
  29017. * @static
  29018. * @memberOf _
  29019. * @since 4.0.0
  29020. * @category Lang
  29021. * @param {*} value The value to check.
  29022. * @returns {boolean} Returns `true` if `value` is an array-like object,
  29023. * else `false`.
  29024. * @example
  29025. *
  29026. * _.isArrayLikeObject([1, 2, 3]);
  29027. * // => true
  29028. *
  29029. * _.isArrayLikeObject(document.body.children);
  29030. * // => true
  29031. *
  29032. * _.isArrayLikeObject('abc');
  29033. * // => false
  29034. *
  29035. * _.isArrayLikeObject(_.noop);
  29036. * // => false
  29037. */
  29038. function isArrayLikeObject(value) {
  29039. return isObjectLike(value) && isArrayLike(value);
  29040. }
  29041. /**
  29042. * Checks if `value` is classified as a boolean primitive or object.
  29043. *
  29044. * @static
  29045. * @memberOf _
  29046. * @since 0.1.0
  29047. * @category Lang
  29048. * @param {*} value The value to check.
  29049. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  29050. * @example
  29051. *
  29052. * _.isBoolean(false);
  29053. * // => true
  29054. *
  29055. * _.isBoolean(null);
  29056. * // => false
  29057. */
  29058. function isBoolean(value) {
  29059. return value === true || value === false ||
  29060. (isObjectLike(value) && baseGetTag(value) == boolTag);
  29061. }
  29062. /**
  29063. * Checks if `value` is a buffer.
  29064. *
  29065. * @static
  29066. * @memberOf _
  29067. * @since 4.3.0
  29068. * @category Lang
  29069. * @param {*} value The value to check.
  29070. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  29071. * @example
  29072. *
  29073. * _.isBuffer(new Buffer(2));
  29074. * // => true
  29075. *
  29076. * _.isBuffer(new Uint8Array(2));
  29077. * // => false
  29078. */
  29079. var isBuffer = nativeIsBuffer || stubFalse;
  29080. /**
  29081. * Checks if `value` is classified as a `Date` object.
  29082. *
  29083. * @static
  29084. * @memberOf _
  29085. * @since 0.1.0
  29086. * @category Lang
  29087. * @param {*} value The value to check.
  29088. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  29089. * @example
  29090. *
  29091. * _.isDate(new Date);
  29092. * // => true
  29093. *
  29094. * _.isDate('Mon April 23 2012');
  29095. * // => false
  29096. */
  29097. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  29098. /**
  29099. * Checks if `value` is likely a DOM element.
  29100. *
  29101. * @static
  29102. * @memberOf _
  29103. * @since 0.1.0
  29104. * @category Lang
  29105. * @param {*} value The value to check.
  29106. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  29107. * @example
  29108. *
  29109. * _.isElement(document.body);
  29110. * // => true
  29111. *
  29112. * _.isElement('<body>');
  29113. * // => false
  29114. */
  29115. function isElement(value) {
  29116. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  29117. }
  29118. /**
  29119. * Checks if `value` is an empty object, collection, map, or set.
  29120. *
  29121. * Objects are considered empty if they have no own enumerable string keyed
  29122. * properties.
  29123. *
  29124. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  29125. * jQuery-like collections are considered empty if they have a `length` of `0`.
  29126. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  29127. *
  29128. * @static
  29129. * @memberOf _
  29130. * @since 0.1.0
  29131. * @category Lang
  29132. * @param {*} value The value to check.
  29133. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  29134. * @example
  29135. *
  29136. * _.isEmpty(null);
  29137. * // => true
  29138. *
  29139. * _.isEmpty(true);
  29140. * // => true
  29141. *
  29142. * _.isEmpty(1);
  29143. * // => true
  29144. *
  29145. * _.isEmpty([1, 2, 3]);
  29146. * // => false
  29147. *
  29148. * _.isEmpty({ 'a': 1 });
  29149. * // => false
  29150. */
  29151. function isEmpty(value) {
  29152. if (value == null) {
  29153. return true;
  29154. }
  29155. if (isArrayLike(value) &&
  29156. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  29157. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  29158. return !value.length;
  29159. }
  29160. var tag = getTag(value);
  29161. if (tag == mapTag || tag == setTag) {
  29162. return !value.size;
  29163. }
  29164. if (isPrototype(value)) {
  29165. return !baseKeys(value).length;
  29166. }
  29167. for (var key in value) {
  29168. if (hasOwnProperty.call(value, key)) {
  29169. return false;
  29170. }
  29171. }
  29172. return true;
  29173. }
  29174. /**
  29175. * Performs a deep comparison between two values to determine if they are
  29176. * equivalent.
  29177. *
  29178. * **Note:** This method supports comparing arrays, array buffers, booleans,
  29179. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  29180. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  29181. * by their own, not inherited, enumerable properties. Functions and DOM
  29182. * nodes are compared by strict equality, i.e. `===`.
  29183. *
  29184. * @static
  29185. * @memberOf _
  29186. * @since 0.1.0
  29187. * @category Lang
  29188. * @param {*} value The value to compare.
  29189. * @param {*} other The other value to compare.
  29190. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29191. * @example
  29192. *
  29193. * var object = { 'a': 1 };
  29194. * var other = { 'a': 1 };
  29195. *
  29196. * _.isEqual(object, other);
  29197. * // => true
  29198. *
  29199. * object === other;
  29200. * // => false
  29201. */
  29202. function isEqual(value, other) {
  29203. return baseIsEqual(value, other);
  29204. }
  29205. /**
  29206. * This method is like `_.isEqual` except that it accepts `customizer` which
  29207. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  29208. * are handled by the method instead. The `customizer` is invoked with up to
  29209. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  29210. *
  29211. * @static
  29212. * @memberOf _
  29213. * @since 4.0.0
  29214. * @category Lang
  29215. * @param {*} value The value to compare.
  29216. * @param {*} other The other value to compare.
  29217. * @param {Function} [customizer] The function to customize comparisons.
  29218. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29219. * @example
  29220. *
  29221. * function isGreeting(value) {
  29222. * return /^h(?:i|ello)$/.test(value);
  29223. * }
  29224. *
  29225. * function customizer(objValue, othValue) {
  29226. * if (isGreeting(objValue) && isGreeting(othValue)) {
  29227. * return true;
  29228. * }
  29229. * }
  29230. *
  29231. * var array = ['hello', 'goodbye'];
  29232. * var other = ['hi', 'goodbye'];
  29233. *
  29234. * _.isEqualWith(array, other, customizer);
  29235. * // => true
  29236. */
  29237. function isEqualWith(value, other, customizer) {
  29238. customizer = typeof customizer == 'function' ? customizer : undefined;
  29239. var result = customizer ? customizer(value, other) : undefined;
  29240. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  29241. }
  29242. /**
  29243. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  29244. * `SyntaxError`, `TypeError`, or `URIError` object.
  29245. *
  29246. * @static
  29247. * @memberOf _
  29248. * @since 3.0.0
  29249. * @category Lang
  29250. * @param {*} value The value to check.
  29251. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  29252. * @example
  29253. *
  29254. * _.isError(new Error);
  29255. * // => true
  29256. *
  29257. * _.isError(Error);
  29258. * // => false
  29259. */
  29260. function isError(value) {
  29261. if (!isObjectLike(value)) {
  29262. return false;
  29263. }
  29264. var tag = baseGetTag(value);
  29265. return tag == errorTag || tag == domExcTag ||
  29266. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  29267. }
  29268. /**
  29269. * Checks if `value` is a finite primitive number.
  29270. *
  29271. * **Note:** This method is based on
  29272. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  29273. *
  29274. * @static
  29275. * @memberOf _
  29276. * @since 0.1.0
  29277. * @category Lang
  29278. * @param {*} value The value to check.
  29279. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  29280. * @example
  29281. *
  29282. * _.isFinite(3);
  29283. * // => true
  29284. *
  29285. * _.isFinite(Number.MIN_VALUE);
  29286. * // => true
  29287. *
  29288. * _.isFinite(Infinity);
  29289. * // => false
  29290. *
  29291. * _.isFinite('3');
  29292. * // => false
  29293. */
  29294. function isFinite(value) {
  29295. return typeof value == 'number' && nativeIsFinite(value);
  29296. }
  29297. /**
  29298. * Checks if `value` is classified as a `Function` object.
  29299. *
  29300. * @static
  29301. * @memberOf _
  29302. * @since 0.1.0
  29303. * @category Lang
  29304. * @param {*} value The value to check.
  29305. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  29306. * @example
  29307. *
  29308. * _.isFunction(_);
  29309. * // => true
  29310. *
  29311. * _.isFunction(/abc/);
  29312. * // => false
  29313. */
  29314. function isFunction(value) {
  29315. if (!isObject(value)) {
  29316. return false;
  29317. }
  29318. // The use of `Object#toString` avoids issues with the `typeof` operator
  29319. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  29320. var tag = baseGetTag(value);
  29321. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  29322. }
  29323. /**
  29324. * Checks if `value` is an integer.
  29325. *
  29326. * **Note:** This method is based on
  29327. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  29328. *
  29329. * @static
  29330. * @memberOf _
  29331. * @since 4.0.0
  29332. * @category Lang
  29333. * @param {*} value The value to check.
  29334. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  29335. * @example
  29336. *
  29337. * _.isInteger(3);
  29338. * // => true
  29339. *
  29340. * _.isInteger(Number.MIN_VALUE);
  29341. * // => false
  29342. *
  29343. * _.isInteger(Infinity);
  29344. * // => false
  29345. *
  29346. * _.isInteger('3');
  29347. * // => false
  29348. */
  29349. function isInteger(value) {
  29350. return typeof value == 'number' && value == toInteger(value);
  29351. }
  29352. /**
  29353. * Checks if `value` is a valid array-like length.
  29354. *
  29355. * **Note:** This method is loosely based on
  29356. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  29357. *
  29358. * @static
  29359. * @memberOf _
  29360. * @since 4.0.0
  29361. * @category Lang
  29362. * @param {*} value The value to check.
  29363. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  29364. * @example
  29365. *
  29366. * _.isLength(3);
  29367. * // => true
  29368. *
  29369. * _.isLength(Number.MIN_VALUE);
  29370. * // => false
  29371. *
  29372. * _.isLength(Infinity);
  29373. * // => false
  29374. *
  29375. * _.isLength('3');
  29376. * // => false
  29377. */
  29378. function isLength(value) {
  29379. return typeof value == 'number' &&
  29380. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  29381. }
  29382. /**
  29383. * Checks if `value` is the
  29384. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  29385. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  29386. *
  29387. * @static
  29388. * @memberOf _
  29389. * @since 0.1.0
  29390. * @category Lang
  29391. * @param {*} value The value to check.
  29392. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  29393. * @example
  29394. *
  29395. * _.isObject({});
  29396. * // => true
  29397. *
  29398. * _.isObject([1, 2, 3]);
  29399. * // => true
  29400. *
  29401. * _.isObject(_.noop);
  29402. * // => true
  29403. *
  29404. * _.isObject(null);
  29405. * // => false
  29406. */
  29407. function isObject(value) {
  29408. var type = typeof value;
  29409. return value != null && (type == 'object' || type == 'function');
  29410. }
  29411. /**
  29412. * Checks if `value` is object-like. A value is object-like if it's not `null`
  29413. * and has a `typeof` result of "object".
  29414. *
  29415. * @static
  29416. * @memberOf _
  29417. * @since 4.0.0
  29418. * @category Lang
  29419. * @param {*} value The value to check.
  29420. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  29421. * @example
  29422. *
  29423. * _.isObjectLike({});
  29424. * // => true
  29425. *
  29426. * _.isObjectLike([1, 2, 3]);
  29427. * // => true
  29428. *
  29429. * _.isObjectLike(_.noop);
  29430. * // => false
  29431. *
  29432. * _.isObjectLike(null);
  29433. * // => false
  29434. */
  29435. function isObjectLike(value) {
  29436. return value != null && typeof value == 'object';
  29437. }
  29438. /**
  29439. * Checks if `value` is classified as a `Map` object.
  29440. *
  29441. * @static
  29442. * @memberOf _
  29443. * @since 4.3.0
  29444. * @category Lang
  29445. * @param {*} value The value to check.
  29446. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  29447. * @example
  29448. *
  29449. * _.isMap(new Map);
  29450. * // => true
  29451. *
  29452. * _.isMap(new WeakMap);
  29453. * // => false
  29454. */
  29455. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  29456. /**
  29457. * Performs a partial deep comparison between `object` and `source` to
  29458. * determine if `object` contains equivalent property values.
  29459. *
  29460. * **Note:** This method is equivalent to `_.matches` when `source` is
  29461. * partially applied.
  29462. *
  29463. * Partial comparisons will match empty array and empty object `source`
  29464. * values against any array or object value, respectively. See `_.isEqual`
  29465. * for a list of supported value comparisons.
  29466. *
  29467. * @static
  29468. * @memberOf _
  29469. * @since 3.0.0
  29470. * @category Lang
  29471. * @param {Object} object The object to inspect.
  29472. * @param {Object} source The object of property values to match.
  29473. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  29474. * @example
  29475. *
  29476. * var object = { 'a': 1, 'b': 2 };
  29477. *
  29478. * _.isMatch(object, { 'b': 2 });
  29479. * // => true
  29480. *
  29481. * _.isMatch(object, { 'b': 1 });
  29482. * // => false
  29483. */
  29484. function isMatch(object, source) {
  29485. return object === source || baseIsMatch(object, source, getMatchData(source));
  29486. }
  29487. /**
  29488. * This method is like `_.isMatch` except that it accepts `customizer` which
  29489. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  29490. * are handled by the method instead. The `customizer` is invoked with five
  29491. * arguments: (objValue, srcValue, index|key, object, source).
  29492. *
  29493. * @static
  29494. * @memberOf _
  29495. * @since 4.0.0
  29496. * @category Lang
  29497. * @param {Object} object The object to inspect.
  29498. * @param {Object} source The object of property values to match.
  29499. * @param {Function} [customizer] The function to customize comparisons.
  29500. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  29501. * @example
  29502. *
  29503. * function isGreeting(value) {
  29504. * return /^h(?:i|ello)$/.test(value);
  29505. * }
  29506. *
  29507. * function customizer(objValue, srcValue) {
  29508. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  29509. * return true;
  29510. * }
  29511. * }
  29512. *
  29513. * var object = { 'greeting': 'hello' };
  29514. * var source = { 'greeting': 'hi' };
  29515. *
  29516. * _.isMatchWith(object, source, customizer);
  29517. * // => true
  29518. */
  29519. function isMatchWith(object, source, customizer) {
  29520. customizer = typeof customizer == 'function' ? customizer : undefined;
  29521. return baseIsMatch(object, source, getMatchData(source), customizer);
  29522. }
  29523. /**
  29524. * Checks if `value` is `NaN`.
  29525. *
  29526. * **Note:** This method is based on
  29527. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  29528. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  29529. * `undefined` and other non-number values.
  29530. *
  29531. * @static
  29532. * @memberOf _
  29533. * @since 0.1.0
  29534. * @category Lang
  29535. * @param {*} value The value to check.
  29536. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  29537. * @example
  29538. *
  29539. * _.isNaN(NaN);
  29540. * // => true
  29541. *
  29542. * _.isNaN(new Number(NaN));
  29543. * // => true
  29544. *
  29545. * isNaN(undefined);
  29546. * // => true
  29547. *
  29548. * _.isNaN(undefined);
  29549. * // => false
  29550. */
  29551. function isNaN(value) {
  29552. // An `NaN` primitive is the only value that is not equal to itself.
  29553. // Perform the `toStringTag` check first to avoid errors with some
  29554. // ActiveX objects in IE.
  29555. return isNumber(value) && value != +value;
  29556. }
  29557. /**
  29558. * Checks if `value` is a pristine native function.
  29559. *
  29560. * **Note:** This method can't reliably detect native functions in the presence
  29561. * of the core-js package because core-js circumvents this kind of detection.
  29562. * Despite multiple requests, the core-js maintainer has made it clear: any
  29563. * attempt to fix the detection will be obstructed. As a result, we're left
  29564. * with little choice but to throw an error. Unfortunately, this also affects
  29565. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  29566. * which rely on core-js.
  29567. *
  29568. * @static
  29569. * @memberOf _
  29570. * @since 3.0.0
  29571. * @category Lang
  29572. * @param {*} value The value to check.
  29573. * @returns {boolean} Returns `true` if `value` is a native function,
  29574. * else `false`.
  29575. * @example
  29576. *
  29577. * _.isNative(Array.prototype.push);
  29578. * // => true
  29579. *
  29580. * _.isNative(_);
  29581. * // => false
  29582. */
  29583. function isNative(value) {
  29584. if (isMaskable(value)) {
  29585. throw new Error(CORE_ERROR_TEXT);
  29586. }
  29587. return baseIsNative(value);
  29588. }
  29589. /**
  29590. * Checks if `value` is `null`.
  29591. *
  29592. * @static
  29593. * @memberOf _
  29594. * @since 0.1.0
  29595. * @category Lang
  29596. * @param {*} value The value to check.
  29597. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  29598. * @example
  29599. *
  29600. * _.isNull(null);
  29601. * // => true
  29602. *
  29603. * _.isNull(void 0);
  29604. * // => false
  29605. */
  29606. function isNull(value) {
  29607. return value === null;
  29608. }
  29609. /**
  29610. * Checks if `value` is `null` or `undefined`.
  29611. *
  29612. * @static
  29613. * @memberOf _
  29614. * @since 4.0.0
  29615. * @category Lang
  29616. * @param {*} value The value to check.
  29617. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  29618. * @example
  29619. *
  29620. * _.isNil(null);
  29621. * // => true
  29622. *
  29623. * _.isNil(void 0);
  29624. * // => true
  29625. *
  29626. * _.isNil(NaN);
  29627. * // => false
  29628. */
  29629. function isNil(value) {
  29630. return value == null;
  29631. }
  29632. /**
  29633. * Checks if `value` is classified as a `Number` primitive or object.
  29634. *
  29635. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  29636. * classified as numbers, use the `_.isFinite` method.
  29637. *
  29638. * @static
  29639. * @memberOf _
  29640. * @since 0.1.0
  29641. * @category Lang
  29642. * @param {*} value The value to check.
  29643. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  29644. * @example
  29645. *
  29646. * _.isNumber(3);
  29647. * // => true
  29648. *
  29649. * _.isNumber(Number.MIN_VALUE);
  29650. * // => true
  29651. *
  29652. * _.isNumber(Infinity);
  29653. * // => true
  29654. *
  29655. * _.isNumber('3');
  29656. * // => false
  29657. */
  29658. function isNumber(value) {
  29659. return typeof value == 'number' ||
  29660. (isObjectLike(value) && baseGetTag(value) == numberTag);
  29661. }
  29662. /**
  29663. * Checks if `value` is a plain object, that is, an object created by the
  29664. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  29665. *
  29666. * @static
  29667. * @memberOf _
  29668. * @since 0.8.0
  29669. * @category Lang
  29670. * @param {*} value The value to check.
  29671. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  29672. * @example
  29673. *
  29674. * function Foo() {
  29675. * this.a = 1;
  29676. * }
  29677. *
  29678. * _.isPlainObject(new Foo);
  29679. * // => false
  29680. *
  29681. * _.isPlainObject([1, 2, 3]);
  29682. * // => false
  29683. *
  29684. * _.isPlainObject({ 'x': 0, 'y': 0 });
  29685. * // => true
  29686. *
  29687. * _.isPlainObject(Object.create(null));
  29688. * // => true
  29689. */
  29690. function isPlainObject(value) {
  29691. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  29692. return false;
  29693. }
  29694. var proto = getPrototype(value);
  29695. if (proto === null) {
  29696. return true;
  29697. }
  29698. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  29699. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  29700. funcToString.call(Ctor) == objectCtorString;
  29701. }
  29702. /**
  29703. * Checks if `value` is classified as a `RegExp` object.
  29704. *
  29705. * @static
  29706. * @memberOf _
  29707. * @since 0.1.0
  29708. * @category Lang
  29709. * @param {*} value The value to check.
  29710. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  29711. * @example
  29712. *
  29713. * _.isRegExp(/abc/);
  29714. * // => true
  29715. *
  29716. * _.isRegExp('/abc/');
  29717. * // => false
  29718. */
  29719. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  29720. /**
  29721. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  29722. * double precision number which isn't the result of a rounded unsafe integer.
  29723. *
  29724. * **Note:** This method is based on
  29725. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  29726. *
  29727. * @static
  29728. * @memberOf _
  29729. * @since 4.0.0
  29730. * @category Lang
  29731. * @param {*} value The value to check.
  29732. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  29733. * @example
  29734. *
  29735. * _.isSafeInteger(3);
  29736. * // => true
  29737. *
  29738. * _.isSafeInteger(Number.MIN_VALUE);
  29739. * // => false
  29740. *
  29741. * _.isSafeInteger(Infinity);
  29742. * // => false
  29743. *
  29744. * _.isSafeInteger('3');
  29745. * // => false
  29746. */
  29747. function isSafeInteger(value) {
  29748. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  29749. }
  29750. /**
  29751. * Checks if `value` is classified as a `Set` object.
  29752. *
  29753. * @static
  29754. * @memberOf _
  29755. * @since 4.3.0
  29756. * @category Lang
  29757. * @param {*} value The value to check.
  29758. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  29759. * @example
  29760. *
  29761. * _.isSet(new Set);
  29762. * // => true
  29763. *
  29764. * _.isSet(new WeakSet);
  29765. * // => false
  29766. */
  29767. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  29768. /**
  29769. * Checks if `value` is classified as a `String` primitive or object.
  29770. *
  29771. * @static
  29772. * @since 0.1.0
  29773. * @memberOf _
  29774. * @category Lang
  29775. * @param {*} value The value to check.
  29776. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  29777. * @example
  29778. *
  29779. * _.isString('abc');
  29780. * // => true
  29781. *
  29782. * _.isString(1);
  29783. * // => false
  29784. */
  29785. function isString(value) {
  29786. return typeof value == 'string' ||
  29787. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  29788. }
  29789. /**
  29790. * Checks if `value` is classified as a `Symbol` primitive or object.
  29791. *
  29792. * @static
  29793. * @memberOf _
  29794. * @since 4.0.0
  29795. * @category Lang
  29796. * @param {*} value The value to check.
  29797. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  29798. * @example
  29799. *
  29800. * _.isSymbol(Symbol.iterator);
  29801. * // => true
  29802. *
  29803. * _.isSymbol('abc');
  29804. * // => false
  29805. */
  29806. function isSymbol(value) {
  29807. return typeof value == 'symbol' ||
  29808. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  29809. }
  29810. /**
  29811. * Checks if `value` is classified as a typed array.
  29812. *
  29813. * @static
  29814. * @memberOf _
  29815. * @since 3.0.0
  29816. * @category Lang
  29817. * @param {*} value The value to check.
  29818. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  29819. * @example
  29820. *
  29821. * _.isTypedArray(new Uint8Array);
  29822. * // => true
  29823. *
  29824. * _.isTypedArray([]);
  29825. * // => false
  29826. */
  29827. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  29828. /**
  29829. * Checks if `value` is `undefined`.
  29830. *
  29831. * @static
  29832. * @since 0.1.0
  29833. * @memberOf _
  29834. * @category Lang
  29835. * @param {*} value The value to check.
  29836. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  29837. * @example
  29838. *
  29839. * _.isUndefined(void 0);
  29840. * // => true
  29841. *
  29842. * _.isUndefined(null);
  29843. * // => false
  29844. */
  29845. function isUndefined(value) {
  29846. return value === undefined;
  29847. }
  29848. /**
  29849. * Checks if `value` is classified as a `WeakMap` object.
  29850. *
  29851. * @static
  29852. * @memberOf _
  29853. * @since 4.3.0
  29854. * @category Lang
  29855. * @param {*} value The value to check.
  29856. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  29857. * @example
  29858. *
  29859. * _.isWeakMap(new WeakMap);
  29860. * // => true
  29861. *
  29862. * _.isWeakMap(new Map);
  29863. * // => false
  29864. */
  29865. function isWeakMap(value) {
  29866. return isObjectLike(value) && getTag(value) == weakMapTag;
  29867. }
  29868. /**
  29869. * Checks if `value` is classified as a `WeakSet` object.
  29870. *
  29871. * @static
  29872. * @memberOf _
  29873. * @since 4.3.0
  29874. * @category Lang
  29875. * @param {*} value The value to check.
  29876. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  29877. * @example
  29878. *
  29879. * _.isWeakSet(new WeakSet);
  29880. * // => true
  29881. *
  29882. * _.isWeakSet(new Set);
  29883. * // => false
  29884. */
  29885. function isWeakSet(value) {
  29886. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  29887. }
  29888. /**
  29889. * Checks if `value` is less than `other`.
  29890. *
  29891. * @static
  29892. * @memberOf _
  29893. * @since 3.9.0
  29894. * @category Lang
  29895. * @param {*} value The value to compare.
  29896. * @param {*} other The other value to compare.
  29897. * @returns {boolean} Returns `true` if `value` is less than `other`,
  29898. * else `false`.
  29899. * @see _.gt
  29900. * @example
  29901. *
  29902. * _.lt(1, 3);
  29903. * // => true
  29904. *
  29905. * _.lt(3, 3);
  29906. * // => false
  29907. *
  29908. * _.lt(3, 1);
  29909. * // => false
  29910. */
  29911. var lt = createRelationalOperation(baseLt);
  29912. /**
  29913. * Checks if `value` is less than or equal to `other`.
  29914. *
  29915. * @static
  29916. * @memberOf _
  29917. * @since 3.9.0
  29918. * @category Lang
  29919. * @param {*} value The value to compare.
  29920. * @param {*} other The other value to compare.
  29921. * @returns {boolean} Returns `true` if `value` is less than or equal to
  29922. * `other`, else `false`.
  29923. * @see _.gte
  29924. * @example
  29925. *
  29926. * _.lte(1, 3);
  29927. * // => true
  29928. *
  29929. * _.lte(3, 3);
  29930. * // => true
  29931. *
  29932. * _.lte(3, 1);
  29933. * // => false
  29934. */
  29935. var lte = createRelationalOperation(function(value, other) {
  29936. return value <= other;
  29937. });
  29938. /**
  29939. * Converts `value` to an array.
  29940. *
  29941. * @static
  29942. * @since 0.1.0
  29943. * @memberOf _
  29944. * @category Lang
  29945. * @param {*} value The value to convert.
  29946. * @returns {Array} Returns the converted array.
  29947. * @example
  29948. *
  29949. * _.toArray({ 'a': 1, 'b': 2 });
  29950. * // => [1, 2]
  29951. *
  29952. * _.toArray('abc');
  29953. * // => ['a', 'b', 'c']
  29954. *
  29955. * _.toArray(1);
  29956. * // => []
  29957. *
  29958. * _.toArray(null);
  29959. * // => []
  29960. */
  29961. function toArray(value) {
  29962. if (!value) {
  29963. return [];
  29964. }
  29965. if (isArrayLike(value)) {
  29966. return isString(value) ? stringToArray(value) : copyArray(value);
  29967. }
  29968. if (symIterator && value[symIterator]) {
  29969. return iteratorToArray(value[symIterator]());
  29970. }
  29971. var tag = getTag(value),
  29972. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  29973. return func(value);
  29974. }
  29975. /**
  29976. * Converts `value` to a finite number.
  29977. *
  29978. * @static
  29979. * @memberOf _
  29980. * @since 4.12.0
  29981. * @category Lang
  29982. * @param {*} value The value to convert.
  29983. * @returns {number} Returns the converted number.
  29984. * @example
  29985. *
  29986. * _.toFinite(3.2);
  29987. * // => 3.2
  29988. *
  29989. * _.toFinite(Number.MIN_VALUE);
  29990. * // => 5e-324
  29991. *
  29992. * _.toFinite(Infinity);
  29993. * // => 1.7976931348623157e+308
  29994. *
  29995. * _.toFinite('3.2');
  29996. * // => 3.2
  29997. */
  29998. function toFinite(value) {
  29999. if (!value) {
  30000. return value === 0 ? value : 0;
  30001. }
  30002. value = toNumber(value);
  30003. if (value === INFINITY || value === -INFINITY) {
  30004. var sign = (value < 0 ? -1 : 1);
  30005. return sign * MAX_INTEGER;
  30006. }
  30007. return value === value ? value : 0;
  30008. }
  30009. /**
  30010. * Converts `value` to an integer.
  30011. *
  30012. * **Note:** This method is loosely based on
  30013. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  30014. *
  30015. * @static
  30016. * @memberOf _
  30017. * @since 4.0.0
  30018. * @category Lang
  30019. * @param {*} value The value to convert.
  30020. * @returns {number} Returns the converted integer.
  30021. * @example
  30022. *
  30023. * _.toInteger(3.2);
  30024. * // => 3
  30025. *
  30026. * _.toInteger(Number.MIN_VALUE);
  30027. * // => 0
  30028. *
  30029. * _.toInteger(Infinity);
  30030. * // => 1.7976931348623157e+308
  30031. *
  30032. * _.toInteger('3.2');
  30033. * // => 3
  30034. */
  30035. function toInteger(value) {
  30036. var result = toFinite(value),
  30037. remainder = result % 1;
  30038. return result === result ? (remainder ? result - remainder : result) : 0;
  30039. }
  30040. /**
  30041. * Converts `value` to an integer suitable for use as the length of an
  30042. * array-like object.
  30043. *
  30044. * **Note:** This method is based on
  30045. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  30046. *
  30047. * @static
  30048. * @memberOf _
  30049. * @since 4.0.0
  30050. * @category Lang
  30051. * @param {*} value The value to convert.
  30052. * @returns {number} Returns the converted integer.
  30053. * @example
  30054. *
  30055. * _.toLength(3.2);
  30056. * // => 3
  30057. *
  30058. * _.toLength(Number.MIN_VALUE);
  30059. * // => 0
  30060. *
  30061. * _.toLength(Infinity);
  30062. * // => 4294967295
  30063. *
  30064. * _.toLength('3.2');
  30065. * // => 3
  30066. */
  30067. function toLength(value) {
  30068. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  30069. }
  30070. /**
  30071. * Converts `value` to a number.
  30072. *
  30073. * @static
  30074. * @memberOf _
  30075. * @since 4.0.0
  30076. * @category Lang
  30077. * @param {*} value The value to process.
  30078. * @returns {number} Returns the number.
  30079. * @example
  30080. *
  30081. * _.toNumber(3.2);
  30082. * // => 3.2
  30083. *
  30084. * _.toNumber(Number.MIN_VALUE);
  30085. * // => 5e-324
  30086. *
  30087. * _.toNumber(Infinity);
  30088. * // => Infinity
  30089. *
  30090. * _.toNumber('3.2');
  30091. * // => 3.2
  30092. */
  30093. function toNumber(value) {
  30094. if (typeof value == 'number') {
  30095. return value;
  30096. }
  30097. if (isSymbol(value)) {
  30098. return NAN;
  30099. }
  30100. if (isObject(value)) {
  30101. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  30102. value = isObject(other) ? (other + '') : other;
  30103. }
  30104. if (typeof value != 'string') {
  30105. return value === 0 ? value : +value;
  30106. }
  30107. value = value.replace(reTrim, '');
  30108. var isBinary = reIsBinary.test(value);
  30109. return (isBinary || reIsOctal.test(value))
  30110. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  30111. : (reIsBadHex.test(value) ? NAN : +value);
  30112. }
  30113. /**
  30114. * Converts `value` to a plain object flattening inherited enumerable string
  30115. * keyed properties of `value` to own properties of the plain object.
  30116. *
  30117. * @static
  30118. * @memberOf _
  30119. * @since 3.0.0
  30120. * @category Lang
  30121. * @param {*} value The value to convert.
  30122. * @returns {Object} Returns the converted plain object.
  30123. * @example
  30124. *
  30125. * function Foo() {
  30126. * this.b = 2;
  30127. * }
  30128. *
  30129. * Foo.prototype.c = 3;
  30130. *
  30131. * _.assign({ 'a': 1 }, new Foo);
  30132. * // => { 'a': 1, 'b': 2 }
  30133. *
  30134. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  30135. * // => { 'a': 1, 'b': 2, 'c': 3 }
  30136. */
  30137. function toPlainObject(value) {
  30138. return copyObject(value, keysIn(value));
  30139. }
  30140. /**
  30141. * Converts `value` to a safe integer. A safe integer can be compared and
  30142. * represented correctly.
  30143. *
  30144. * @static
  30145. * @memberOf _
  30146. * @since 4.0.0
  30147. * @category Lang
  30148. * @param {*} value The value to convert.
  30149. * @returns {number} Returns the converted integer.
  30150. * @example
  30151. *
  30152. * _.toSafeInteger(3.2);
  30153. * // => 3
  30154. *
  30155. * _.toSafeInteger(Number.MIN_VALUE);
  30156. * // => 0
  30157. *
  30158. * _.toSafeInteger(Infinity);
  30159. * // => 9007199254740991
  30160. *
  30161. * _.toSafeInteger('3.2');
  30162. * // => 3
  30163. */
  30164. function toSafeInteger(value) {
  30165. return value
  30166. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  30167. : (value === 0 ? value : 0);
  30168. }
  30169. /**
  30170. * Converts `value` to a string. An empty string is returned for `null`
  30171. * and `undefined` values. The sign of `-0` is preserved.
  30172. *
  30173. * @static
  30174. * @memberOf _
  30175. * @since 4.0.0
  30176. * @category Lang
  30177. * @param {*} value The value to convert.
  30178. * @returns {string} Returns the converted string.
  30179. * @example
  30180. *
  30181. * _.toString(null);
  30182. * // => ''
  30183. *
  30184. * _.toString(-0);
  30185. * // => '-0'
  30186. *
  30187. * _.toString([1, 2, 3]);
  30188. * // => '1,2,3'
  30189. */
  30190. function toString(value) {
  30191. return value == null ? '' : baseToString(value);
  30192. }
  30193. /*------------------------------------------------------------------------*/
  30194. /**
  30195. * Assigns own enumerable string keyed properties of source objects to the
  30196. * destination object. Source objects are applied from left to right.
  30197. * Subsequent sources overwrite property assignments of previous sources.
  30198. *
  30199. * **Note:** This method mutates `object` and is loosely based on
  30200. * [`Object.assign`](https://mdn.io/Object/assign).
  30201. *
  30202. * @static
  30203. * @memberOf _
  30204. * @since 0.10.0
  30205. * @category Object
  30206. * @param {Object} object The destination object.
  30207. * @param {...Object} [sources] The source objects.
  30208. * @returns {Object} Returns `object`.
  30209. * @see _.assignIn
  30210. * @example
  30211. *
  30212. * function Foo() {
  30213. * this.a = 1;
  30214. * }
  30215. *
  30216. * function Bar() {
  30217. * this.c = 3;
  30218. * }
  30219. *
  30220. * Foo.prototype.b = 2;
  30221. * Bar.prototype.d = 4;
  30222. *
  30223. * _.assign({ 'a': 0 }, new Foo, new Bar);
  30224. * // => { 'a': 1, 'c': 3 }
  30225. */
  30226. var assign = createAssigner(function(object, source) {
  30227. if (isPrototype(source) || isArrayLike(source)) {
  30228. copyObject(source, keys(source), object);
  30229. return;
  30230. }
  30231. for (var key in source) {
  30232. if (hasOwnProperty.call(source, key)) {
  30233. assignValue(object, key, source[key]);
  30234. }
  30235. }
  30236. });
  30237. /**
  30238. * This method is like `_.assign` except that it iterates over own and
  30239. * inherited source properties.
  30240. *
  30241. * **Note:** This method mutates `object`.
  30242. *
  30243. * @static
  30244. * @memberOf _
  30245. * @since 4.0.0
  30246. * @alias extend
  30247. * @category Object
  30248. * @param {Object} object The destination object.
  30249. * @param {...Object} [sources] The source objects.
  30250. * @returns {Object} Returns `object`.
  30251. * @see _.assign
  30252. * @example
  30253. *
  30254. * function Foo() {
  30255. * this.a = 1;
  30256. * }
  30257. *
  30258. * function Bar() {
  30259. * this.c = 3;
  30260. * }
  30261. *
  30262. * Foo.prototype.b = 2;
  30263. * Bar.prototype.d = 4;
  30264. *
  30265. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  30266. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  30267. */
  30268. var assignIn = createAssigner(function(object, source) {
  30269. copyObject(source, keysIn(source), object);
  30270. });
  30271. /**
  30272. * This method is like `_.assignIn` except that it accepts `customizer`
  30273. * which is invoked to produce the assigned values. If `customizer` returns
  30274. * `undefined`, assignment is handled by the method instead. The `customizer`
  30275. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  30276. *
  30277. * **Note:** This method mutates `object`.
  30278. *
  30279. * @static
  30280. * @memberOf _
  30281. * @since 4.0.0
  30282. * @alias extendWith
  30283. * @category Object
  30284. * @param {Object} object The destination object.
  30285. * @param {...Object} sources The source objects.
  30286. * @param {Function} [customizer] The function to customize assigned values.
  30287. * @returns {Object} Returns `object`.
  30288. * @see _.assignWith
  30289. * @example
  30290. *
  30291. * function customizer(objValue, srcValue) {
  30292. * return _.isUndefined(objValue) ? srcValue : objValue;
  30293. * }
  30294. *
  30295. * var defaults = _.partialRight(_.assignInWith, customizer);
  30296. *
  30297. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  30298. * // => { 'a': 1, 'b': 2 }
  30299. */
  30300. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  30301. copyObject(source, keysIn(source), object, customizer);
  30302. });
  30303. /**
  30304. * This method is like `_.assign` except that it accepts `customizer`
  30305. * which is invoked to produce the assigned values. If `customizer` returns
  30306. * `undefined`, assignment is handled by the method instead. The `customizer`
  30307. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  30308. *
  30309. * **Note:** This method mutates `object`.
  30310. *
  30311. * @static
  30312. * @memberOf _
  30313. * @since 4.0.0
  30314. * @category Object
  30315. * @param {Object} object The destination object.
  30316. * @param {...Object} sources The source objects.
  30317. * @param {Function} [customizer] The function to customize assigned values.
  30318. * @returns {Object} Returns `object`.
  30319. * @see _.assignInWith
  30320. * @example
  30321. *
  30322. * function customizer(objValue, srcValue) {
  30323. * return _.isUndefined(objValue) ? srcValue : objValue;
  30324. * }
  30325. *
  30326. * var defaults = _.partialRight(_.assignWith, customizer);
  30327. *
  30328. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  30329. * // => { 'a': 1, 'b': 2 }
  30330. */
  30331. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  30332. copyObject(source, keys(source), object, customizer);
  30333. });
  30334. /**
  30335. * Creates an array of values corresponding to `paths` of `object`.
  30336. *
  30337. * @static
  30338. * @memberOf _
  30339. * @since 1.0.0
  30340. * @category Object
  30341. * @param {Object} object The object to iterate over.
  30342. * @param {...(string|string[])} [paths] The property paths to pick.
  30343. * @returns {Array} Returns the picked values.
  30344. * @example
  30345. *
  30346. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  30347. *
  30348. * _.at(object, ['a[0].b.c', 'a[1]']);
  30349. * // => [3, 4]
  30350. */
  30351. var at = flatRest(baseAt);
  30352. /**
  30353. * Creates an object that inherits from the `prototype` object. If a
  30354. * `properties` object is given, its own enumerable string keyed properties
  30355. * are assigned to the created object.
  30356. *
  30357. * @static
  30358. * @memberOf _
  30359. * @since 2.3.0
  30360. * @category Object
  30361. * @param {Object} prototype The object to inherit from.
  30362. * @param {Object} [properties] The properties to assign to the object.
  30363. * @returns {Object} Returns the new object.
  30364. * @example
  30365. *
  30366. * function Shape() {
  30367. * this.x = 0;
  30368. * this.y = 0;
  30369. * }
  30370. *
  30371. * function Circle() {
  30372. * Shape.call(this);
  30373. * }
  30374. *
  30375. * Circle.prototype = _.create(Shape.prototype, {
  30376. * 'constructor': Circle
  30377. * });
  30378. *
  30379. * var circle = new Circle;
  30380. * circle instanceof Circle;
  30381. * // => true
  30382. *
  30383. * circle instanceof Shape;
  30384. * // => true
  30385. */
  30386. function create(prototype, properties) {
  30387. var result = baseCreate(prototype);
  30388. return properties == null ? result : baseAssign(result, properties);
  30389. }
  30390. /**
  30391. * Assigns own and inherited enumerable string keyed properties of source
  30392. * objects to the destination object for all destination properties that
  30393. * resolve to `undefined`. Source objects are applied from left to right.
  30394. * Once a property is set, additional values of the same property are ignored.
  30395. *
  30396. * **Note:** This method mutates `object`.
  30397. *
  30398. * @static
  30399. * @since 0.1.0
  30400. * @memberOf _
  30401. * @category Object
  30402. * @param {Object} object The destination object.
  30403. * @param {...Object} [sources] The source objects.
  30404. * @returns {Object} Returns `object`.
  30405. * @see _.defaultsDeep
  30406. * @example
  30407. *
  30408. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  30409. * // => { 'a': 1, 'b': 2 }
  30410. */
  30411. var defaults = baseRest(function(object, sources) {
  30412. object = Object(object);
  30413. var index = -1;
  30414. var length = sources.length;
  30415. var guard = length > 2 ? sources[2] : undefined;
  30416. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  30417. length = 1;
  30418. }
  30419. while (++index < length) {
  30420. var source = sources[index];
  30421. var props = keysIn(source);
  30422. var propsIndex = -1;
  30423. var propsLength = props.length;
  30424. while (++propsIndex < propsLength) {
  30425. var key = props[propsIndex];
  30426. var value = object[key];
  30427. if (value === undefined ||
  30428. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  30429. object[key] = source[key];
  30430. }
  30431. }
  30432. }
  30433. return object;
  30434. });
  30435. /**
  30436. * This method is like `_.defaults` except that it recursively assigns
  30437. * default properties.
  30438. *
  30439. * **Note:** This method mutates `object`.
  30440. *
  30441. * @static
  30442. * @memberOf _
  30443. * @since 3.10.0
  30444. * @category Object
  30445. * @param {Object} object The destination object.
  30446. * @param {...Object} [sources] The source objects.
  30447. * @returns {Object} Returns `object`.
  30448. * @see _.defaults
  30449. * @example
  30450. *
  30451. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  30452. * // => { 'a': { 'b': 2, 'c': 3 } }
  30453. */
  30454. var defaultsDeep = baseRest(function(args) {
  30455. args.push(undefined, customDefaultsMerge);
  30456. return apply(mergeWith, undefined, args);
  30457. });
  30458. /**
  30459. * This method is like `_.find` except that it returns the key of the first
  30460. * element `predicate` returns truthy for instead of the element itself.
  30461. *
  30462. * @static
  30463. * @memberOf _
  30464. * @since 1.1.0
  30465. * @category Object
  30466. * @param {Object} object The object to inspect.
  30467. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30468. * @returns {string|undefined} Returns the key of the matched element,
  30469. * else `undefined`.
  30470. * @example
  30471. *
  30472. * var users = {
  30473. * 'barney': { 'age': 36, 'active': true },
  30474. * 'fred': { 'age': 40, 'active': false },
  30475. * 'pebbles': { 'age': 1, 'active': true }
  30476. * };
  30477. *
  30478. * _.findKey(users, function(o) { return o.age < 40; });
  30479. * // => 'barney' (iteration order is not guaranteed)
  30480. *
  30481. * // The `_.matches` iteratee shorthand.
  30482. * _.findKey(users, { 'age': 1, 'active': true });
  30483. * // => 'pebbles'
  30484. *
  30485. * // The `_.matchesProperty` iteratee shorthand.
  30486. * _.findKey(users, ['active', false]);
  30487. * // => 'fred'
  30488. *
  30489. * // The `_.property` iteratee shorthand.
  30490. * _.findKey(users, 'active');
  30491. * // => 'barney'
  30492. */
  30493. function findKey(object, predicate) {
  30494. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  30495. }
  30496. /**
  30497. * This method is like `_.findKey` except that it iterates over elements of
  30498. * a collection in the opposite order.
  30499. *
  30500. * @static
  30501. * @memberOf _
  30502. * @since 2.0.0
  30503. * @category Object
  30504. * @param {Object} object The object to inspect.
  30505. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30506. * @returns {string|undefined} Returns the key of the matched element,
  30507. * else `undefined`.
  30508. * @example
  30509. *
  30510. * var users = {
  30511. * 'barney': { 'age': 36, 'active': true },
  30512. * 'fred': { 'age': 40, 'active': false },
  30513. * 'pebbles': { 'age': 1, 'active': true }
  30514. * };
  30515. *
  30516. * _.findLastKey(users, function(o) { return o.age < 40; });
  30517. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  30518. *
  30519. * // The `_.matches` iteratee shorthand.
  30520. * _.findLastKey(users, { 'age': 36, 'active': true });
  30521. * // => 'barney'
  30522. *
  30523. * // The `_.matchesProperty` iteratee shorthand.
  30524. * _.findLastKey(users, ['active', false]);
  30525. * // => 'fred'
  30526. *
  30527. * // The `_.property` iteratee shorthand.
  30528. * _.findLastKey(users, 'active');
  30529. * // => 'pebbles'
  30530. */
  30531. function findLastKey(object, predicate) {
  30532. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  30533. }
  30534. /**
  30535. * Iterates over own and inherited enumerable string keyed properties of an
  30536. * object and invokes `iteratee` for each property. The iteratee is invoked
  30537. * with three arguments: (value, key, object). Iteratee functions may exit
  30538. * iteration early by explicitly returning `false`.
  30539. *
  30540. * @static
  30541. * @memberOf _
  30542. * @since 0.3.0
  30543. * @category Object
  30544. * @param {Object} object The object to iterate over.
  30545. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30546. * @returns {Object} Returns `object`.
  30547. * @see _.forInRight
  30548. * @example
  30549. *
  30550. * function Foo() {
  30551. * this.a = 1;
  30552. * this.b = 2;
  30553. * }
  30554. *
  30555. * Foo.prototype.c = 3;
  30556. *
  30557. * _.forIn(new Foo, function(value, key) {
  30558. * console.log(key);
  30559. * });
  30560. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  30561. */
  30562. function forIn(object, iteratee) {
  30563. return object == null
  30564. ? object
  30565. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  30566. }
  30567. /**
  30568. * This method is like `_.forIn` except that it iterates over properties of
  30569. * `object` in the opposite order.
  30570. *
  30571. * @static
  30572. * @memberOf _
  30573. * @since 2.0.0
  30574. * @category Object
  30575. * @param {Object} object The object to iterate over.
  30576. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30577. * @returns {Object} Returns `object`.
  30578. * @see _.forIn
  30579. * @example
  30580. *
  30581. * function Foo() {
  30582. * this.a = 1;
  30583. * this.b = 2;
  30584. * }
  30585. *
  30586. * Foo.prototype.c = 3;
  30587. *
  30588. * _.forInRight(new Foo, function(value, key) {
  30589. * console.log(key);
  30590. * });
  30591. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  30592. */
  30593. function forInRight(object, iteratee) {
  30594. return object == null
  30595. ? object
  30596. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  30597. }
  30598. /**
  30599. * Iterates over own enumerable string keyed properties of an object and
  30600. * invokes `iteratee` for each property. The iteratee is invoked with three
  30601. * arguments: (value, key, object). Iteratee functions may exit iteration
  30602. * early by explicitly returning `false`.
  30603. *
  30604. * @static
  30605. * @memberOf _
  30606. * @since 0.3.0
  30607. * @category Object
  30608. * @param {Object} object The object to iterate over.
  30609. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30610. * @returns {Object} Returns `object`.
  30611. * @see _.forOwnRight
  30612. * @example
  30613. *
  30614. * function Foo() {
  30615. * this.a = 1;
  30616. * this.b = 2;
  30617. * }
  30618. *
  30619. * Foo.prototype.c = 3;
  30620. *
  30621. * _.forOwn(new Foo, function(value, key) {
  30622. * console.log(key);
  30623. * });
  30624. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  30625. */
  30626. function forOwn(object, iteratee) {
  30627. return object && baseForOwn(object, getIteratee(iteratee, 3));
  30628. }
  30629. /**
  30630. * This method is like `_.forOwn` except that it iterates over properties of
  30631. * `object` in the opposite order.
  30632. *
  30633. * @static
  30634. * @memberOf _
  30635. * @since 2.0.0
  30636. * @category Object
  30637. * @param {Object} object The object to iterate over.
  30638. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30639. * @returns {Object} Returns `object`.
  30640. * @see _.forOwn
  30641. * @example
  30642. *
  30643. * function Foo() {
  30644. * this.a = 1;
  30645. * this.b = 2;
  30646. * }
  30647. *
  30648. * Foo.prototype.c = 3;
  30649. *
  30650. * _.forOwnRight(new Foo, function(value, key) {
  30651. * console.log(key);
  30652. * });
  30653. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  30654. */
  30655. function forOwnRight(object, iteratee) {
  30656. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  30657. }
  30658. /**
  30659. * Creates an array of function property names from own enumerable properties
  30660. * of `object`.
  30661. *
  30662. * @static
  30663. * @since 0.1.0
  30664. * @memberOf _
  30665. * @category Object
  30666. * @param {Object} object The object to inspect.
  30667. * @returns {Array} Returns the function names.
  30668. * @see _.functionsIn
  30669. * @example
  30670. *
  30671. * function Foo() {
  30672. * this.a = _.constant('a');
  30673. * this.b = _.constant('b');
  30674. * }
  30675. *
  30676. * Foo.prototype.c = _.constant('c');
  30677. *
  30678. * _.functions(new Foo);
  30679. * // => ['a', 'b']
  30680. */
  30681. function functions(object) {
  30682. return object == null ? [] : baseFunctions(object, keys(object));
  30683. }
  30684. /**
  30685. * Creates an array of function property names from own and inherited
  30686. * enumerable properties of `object`.
  30687. *
  30688. * @static
  30689. * @memberOf _
  30690. * @since 4.0.0
  30691. * @category Object
  30692. * @param {Object} object The object to inspect.
  30693. * @returns {Array} Returns the function names.
  30694. * @see _.functions
  30695. * @example
  30696. *
  30697. * function Foo() {
  30698. * this.a = _.constant('a');
  30699. * this.b = _.constant('b');
  30700. * }
  30701. *
  30702. * Foo.prototype.c = _.constant('c');
  30703. *
  30704. * _.functionsIn(new Foo);
  30705. * // => ['a', 'b', 'c']
  30706. */
  30707. function functionsIn(object) {
  30708. return object == null ? [] : baseFunctions(object, keysIn(object));
  30709. }
  30710. /**
  30711. * Gets the value at `path` of `object`. If the resolved value is
  30712. * `undefined`, the `defaultValue` is returned in its place.
  30713. *
  30714. * @static
  30715. * @memberOf _
  30716. * @since 3.7.0
  30717. * @category Object
  30718. * @param {Object} object The object to query.
  30719. * @param {Array|string} path The path of the property to get.
  30720. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  30721. * @returns {*} Returns the resolved value.
  30722. * @example
  30723. *
  30724. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  30725. *
  30726. * _.get(object, 'a[0].b.c');
  30727. * // => 3
  30728. *
  30729. * _.get(object, ['a', '0', 'b', 'c']);
  30730. * // => 3
  30731. *
  30732. * _.get(object, 'a.b.c', 'default');
  30733. * // => 'default'
  30734. */
  30735. function get(object, path, defaultValue) {
  30736. var result = object == null ? undefined : baseGet(object, path);
  30737. return result === undefined ? defaultValue : result;
  30738. }
  30739. /**
  30740. * Checks if `path` is a direct property of `object`.
  30741. *
  30742. * @static
  30743. * @since 0.1.0
  30744. * @memberOf _
  30745. * @category Object
  30746. * @param {Object} object The object to query.
  30747. * @param {Array|string} path The path to check.
  30748. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  30749. * @example
  30750. *
  30751. * var object = { 'a': { 'b': 2 } };
  30752. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  30753. *
  30754. * _.has(object, 'a');
  30755. * // => true
  30756. *
  30757. * _.has(object, 'a.b');
  30758. * // => true
  30759. *
  30760. * _.has(object, ['a', 'b']);
  30761. * // => true
  30762. *
  30763. * _.has(other, 'a');
  30764. * // => false
  30765. */
  30766. function has(object, path) {
  30767. return object != null && hasPath(object, path, baseHas);
  30768. }
  30769. /**
  30770. * Checks if `path` is a direct or inherited property of `object`.
  30771. *
  30772. * @static
  30773. * @memberOf _
  30774. * @since 4.0.0
  30775. * @category Object
  30776. * @param {Object} object The object to query.
  30777. * @param {Array|string} path The path to check.
  30778. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  30779. * @example
  30780. *
  30781. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  30782. *
  30783. * _.hasIn(object, 'a');
  30784. * // => true
  30785. *
  30786. * _.hasIn(object, 'a.b');
  30787. * // => true
  30788. *
  30789. * _.hasIn(object, ['a', 'b']);
  30790. * // => true
  30791. *
  30792. * _.hasIn(object, 'b');
  30793. * // => false
  30794. */
  30795. function hasIn(object, path) {
  30796. return object != null && hasPath(object, path, baseHasIn);
  30797. }
  30798. /**
  30799. * Creates an object composed of the inverted keys and values of `object`.
  30800. * If `object` contains duplicate values, subsequent values overwrite
  30801. * property assignments of previous values.
  30802. *
  30803. * @static
  30804. * @memberOf _
  30805. * @since 0.7.0
  30806. * @category Object
  30807. * @param {Object} object The object to invert.
  30808. * @returns {Object} Returns the new inverted object.
  30809. * @example
  30810. *
  30811. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  30812. *
  30813. * _.invert(object);
  30814. * // => { '1': 'c', '2': 'b' }
  30815. */
  30816. var invert = createInverter(function(result, value, key) {
  30817. if (value != null &&
  30818. typeof value.toString != 'function') {
  30819. value = nativeObjectToString.call(value);
  30820. }
  30821. result[value] = key;
  30822. }, constant(identity));
  30823. /**
  30824. * This method is like `_.invert` except that the inverted object is generated
  30825. * from the results of running each element of `object` thru `iteratee`. The
  30826. * corresponding inverted value of each inverted key is an array of keys
  30827. * responsible for generating the inverted value. The iteratee is invoked
  30828. * with one argument: (value).
  30829. *
  30830. * @static
  30831. * @memberOf _
  30832. * @since 4.1.0
  30833. * @category Object
  30834. * @param {Object} object The object to invert.
  30835. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  30836. * @returns {Object} Returns the new inverted object.
  30837. * @example
  30838. *
  30839. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  30840. *
  30841. * _.invertBy(object);
  30842. * // => { '1': ['a', 'c'], '2': ['b'] }
  30843. *
  30844. * _.invertBy(object, function(value) {
  30845. * return 'group' + value;
  30846. * });
  30847. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  30848. */
  30849. var invertBy = createInverter(function(result, value, key) {
  30850. if (value != null &&
  30851. typeof value.toString != 'function') {
  30852. value = nativeObjectToString.call(value);
  30853. }
  30854. if (hasOwnProperty.call(result, value)) {
  30855. result[value].push(key);
  30856. } else {
  30857. result[value] = [key];
  30858. }
  30859. }, getIteratee);
  30860. /**
  30861. * Invokes the method at `path` of `object`.
  30862. *
  30863. * @static
  30864. * @memberOf _
  30865. * @since 4.0.0
  30866. * @category Object
  30867. * @param {Object} object The object to query.
  30868. * @param {Array|string} path The path of the method to invoke.
  30869. * @param {...*} [args] The arguments to invoke the method with.
  30870. * @returns {*} Returns the result of the invoked method.
  30871. * @example
  30872. *
  30873. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  30874. *
  30875. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  30876. * // => [2, 3]
  30877. */
  30878. var invoke = baseRest(baseInvoke);
  30879. /**
  30880. * Creates an array of the own enumerable property names of `object`.
  30881. *
  30882. * **Note:** Non-object values are coerced to objects. See the
  30883. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  30884. * for more details.
  30885. *
  30886. * @static
  30887. * @since 0.1.0
  30888. * @memberOf _
  30889. * @category Object
  30890. * @param {Object} object The object to query.
  30891. * @returns {Array} Returns the array of property names.
  30892. * @example
  30893. *
  30894. * function Foo() {
  30895. * this.a = 1;
  30896. * this.b = 2;
  30897. * }
  30898. *
  30899. * Foo.prototype.c = 3;
  30900. *
  30901. * _.keys(new Foo);
  30902. * // => ['a', 'b'] (iteration order is not guaranteed)
  30903. *
  30904. * _.keys('hi');
  30905. * // => ['0', '1']
  30906. */
  30907. function keys(object) {
  30908. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  30909. }
  30910. /**
  30911. * Creates an array of the own and inherited enumerable property names of `object`.
  30912. *
  30913. * **Note:** Non-object values are coerced to objects.
  30914. *
  30915. * @static
  30916. * @memberOf _
  30917. * @since 3.0.0
  30918. * @category Object
  30919. * @param {Object} object The object to query.
  30920. * @returns {Array} Returns the array of property names.
  30921. * @example
  30922. *
  30923. * function Foo() {
  30924. * this.a = 1;
  30925. * this.b = 2;
  30926. * }
  30927. *
  30928. * Foo.prototype.c = 3;
  30929. *
  30930. * _.keysIn(new Foo);
  30931. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  30932. */
  30933. function keysIn(object) {
  30934. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  30935. }
  30936. /**
  30937. * The opposite of `_.mapValues`; this method creates an object with the
  30938. * same values as `object` and keys generated by running each own enumerable
  30939. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  30940. * with three arguments: (value, key, object).
  30941. *
  30942. * @static
  30943. * @memberOf _
  30944. * @since 3.8.0
  30945. * @category Object
  30946. * @param {Object} object The object to iterate over.
  30947. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30948. * @returns {Object} Returns the new mapped object.
  30949. * @see _.mapValues
  30950. * @example
  30951. *
  30952. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  30953. * return key + value;
  30954. * });
  30955. * // => { 'a1': 1, 'b2': 2 }
  30956. */
  30957. function mapKeys(object, iteratee) {
  30958. var result = {};
  30959. iteratee = getIteratee(iteratee, 3);
  30960. baseForOwn(object, function(value, key, object) {
  30961. baseAssignValue(result, iteratee(value, key, object), value);
  30962. });
  30963. return result;
  30964. }
  30965. /**
  30966. * Creates an object with the same keys as `object` and values generated
  30967. * by running each own enumerable string keyed property of `object` thru
  30968. * `iteratee`. The iteratee is invoked with three arguments:
  30969. * (value, key, object).
  30970. *
  30971. * @static
  30972. * @memberOf _
  30973. * @since 2.4.0
  30974. * @category Object
  30975. * @param {Object} object The object to iterate over.
  30976. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  30977. * @returns {Object} Returns the new mapped object.
  30978. * @see _.mapKeys
  30979. * @example
  30980. *
  30981. * var users = {
  30982. * 'fred': { 'user': 'fred', 'age': 40 },
  30983. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  30984. * };
  30985. *
  30986. * _.mapValues(users, function(o) { return o.age; });
  30987. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  30988. *
  30989. * // The `_.property` iteratee shorthand.
  30990. * _.mapValues(users, 'age');
  30991. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  30992. */
  30993. function mapValues(object, iteratee) {
  30994. var result = {};
  30995. iteratee = getIteratee(iteratee, 3);
  30996. baseForOwn(object, function(value, key, object) {
  30997. baseAssignValue(result, key, iteratee(value, key, object));
  30998. });
  30999. return result;
  31000. }
  31001. /**
  31002. * This method is like `_.assign` except that it recursively merges own and
  31003. * inherited enumerable string keyed properties of source objects into the
  31004. * destination object. Source properties that resolve to `undefined` are
  31005. * skipped if a destination value exists. Array and plain object properties
  31006. * are merged recursively. Other objects and value types are overridden by
  31007. * assignment. Source objects are applied from left to right. Subsequent
  31008. * sources overwrite property assignments of previous sources.
  31009. *
  31010. * **Note:** This method mutates `object`.
  31011. *
  31012. * @static
  31013. * @memberOf _
  31014. * @since 0.5.0
  31015. * @category Object
  31016. * @param {Object} object The destination object.
  31017. * @param {...Object} [sources] The source objects.
  31018. * @returns {Object} Returns `object`.
  31019. * @example
  31020. *
  31021. * var object = {
  31022. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  31023. * };
  31024. *
  31025. * var other = {
  31026. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  31027. * };
  31028. *
  31029. * _.merge(object, other);
  31030. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  31031. */
  31032. var merge = createAssigner(function(object, source, srcIndex) {
  31033. baseMerge(object, source, srcIndex);
  31034. });
  31035. /**
  31036. * This method is like `_.merge` except that it accepts `customizer` which
  31037. * is invoked to produce the merged values of the destination and source
  31038. * properties. If `customizer` returns `undefined`, merging is handled by the
  31039. * method instead. The `customizer` is invoked with six arguments:
  31040. * (objValue, srcValue, key, object, source, stack).
  31041. *
  31042. * **Note:** This method mutates `object`.
  31043. *
  31044. * @static
  31045. * @memberOf _
  31046. * @since 4.0.0
  31047. * @category Object
  31048. * @param {Object} object The destination object.
  31049. * @param {...Object} sources The source objects.
  31050. * @param {Function} customizer The function to customize assigned values.
  31051. * @returns {Object} Returns `object`.
  31052. * @example
  31053. *
  31054. * function customizer(objValue, srcValue) {
  31055. * if (_.isArray(objValue)) {
  31056. * return objValue.concat(srcValue);
  31057. * }
  31058. * }
  31059. *
  31060. * var object = { 'a': [1], 'b': [2] };
  31061. * var other = { 'a': [3], 'b': [4] };
  31062. *
  31063. * _.mergeWith(object, other, customizer);
  31064. * // => { 'a': [1, 3], 'b': [2, 4] }
  31065. */
  31066. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  31067. baseMerge(object, source, srcIndex, customizer);
  31068. });
  31069. /**
  31070. * The opposite of `_.pick`; this method creates an object composed of the
  31071. * own and inherited enumerable property paths of `object` that are not omitted.
  31072. *
  31073. * **Note:** This method is considerably slower than `_.pick`.
  31074. *
  31075. * @static
  31076. * @since 0.1.0
  31077. * @memberOf _
  31078. * @category Object
  31079. * @param {Object} object The source object.
  31080. * @param {...(string|string[])} [paths] The property paths to omit.
  31081. * @returns {Object} Returns the new object.
  31082. * @example
  31083. *
  31084. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31085. *
  31086. * _.omit(object, ['a', 'c']);
  31087. * // => { 'b': '2' }
  31088. */
  31089. var omit = flatRest(function(object, paths) {
  31090. var result = {};
  31091. if (object == null) {
  31092. return result;
  31093. }
  31094. var isDeep = false;
  31095. paths = arrayMap(paths, function(path) {
  31096. path = castPath(path, object);
  31097. isDeep || (isDeep = path.length > 1);
  31098. return path;
  31099. });
  31100. copyObject(object, getAllKeysIn(object), result);
  31101. if (isDeep) {
  31102. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  31103. }
  31104. var length = paths.length;
  31105. while (length--) {
  31106. baseUnset(result, paths[length]);
  31107. }
  31108. return result;
  31109. });
  31110. /**
  31111. * The opposite of `_.pickBy`; this method creates an object composed of
  31112. * the own and inherited enumerable string keyed properties of `object` that
  31113. * `predicate` doesn't return truthy for. The predicate is invoked with two
  31114. * arguments: (value, key).
  31115. *
  31116. * @static
  31117. * @memberOf _
  31118. * @since 4.0.0
  31119. * @category Object
  31120. * @param {Object} object The source object.
  31121. * @param {Function} [predicate=_.identity] The function invoked per property.
  31122. * @returns {Object} Returns the new object.
  31123. * @example
  31124. *
  31125. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31126. *
  31127. * _.omitBy(object, _.isNumber);
  31128. * // => { 'b': '2' }
  31129. */
  31130. function omitBy(object, predicate) {
  31131. return pickBy(object, negate(getIteratee(predicate)));
  31132. }
  31133. /**
  31134. * Creates an object composed of the picked `object` properties.
  31135. *
  31136. * @static
  31137. * @since 0.1.0
  31138. * @memberOf _
  31139. * @category Object
  31140. * @param {Object} object The source object.
  31141. * @param {...(string|string[])} [paths] The property paths to pick.
  31142. * @returns {Object} Returns the new object.
  31143. * @example
  31144. *
  31145. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31146. *
  31147. * _.pick(object, ['a', 'c']);
  31148. * // => { 'a': 1, 'c': 3 }
  31149. */
  31150. var pick = flatRest(function(object, paths) {
  31151. return object == null ? {} : basePick(object, paths);
  31152. });
  31153. /**
  31154. * Creates an object composed of the `object` properties `predicate` returns
  31155. * truthy for. The predicate is invoked with two arguments: (value, key).
  31156. *
  31157. * @static
  31158. * @memberOf _
  31159. * @since 4.0.0
  31160. * @category Object
  31161. * @param {Object} object The source object.
  31162. * @param {Function} [predicate=_.identity] The function invoked per property.
  31163. * @returns {Object} Returns the new object.
  31164. * @example
  31165. *
  31166. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31167. *
  31168. * _.pickBy(object, _.isNumber);
  31169. * // => { 'a': 1, 'c': 3 }
  31170. */
  31171. function pickBy(object, predicate) {
  31172. if (object == null) {
  31173. return {};
  31174. }
  31175. var props = arrayMap(getAllKeysIn(object), function(prop) {
  31176. return [prop];
  31177. });
  31178. predicate = getIteratee(predicate);
  31179. return basePickBy(object, props, function(value, path) {
  31180. return predicate(value, path[0]);
  31181. });
  31182. }
  31183. /**
  31184. * This method is like `_.get` except that if the resolved value is a
  31185. * function it's invoked with the `this` binding of its parent object and
  31186. * its result is returned.
  31187. *
  31188. * @static
  31189. * @since 0.1.0
  31190. * @memberOf _
  31191. * @category Object
  31192. * @param {Object} object The object to query.
  31193. * @param {Array|string} path The path of the property to resolve.
  31194. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  31195. * @returns {*} Returns the resolved value.
  31196. * @example
  31197. *
  31198. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  31199. *
  31200. * _.result(object, 'a[0].b.c1');
  31201. * // => 3
  31202. *
  31203. * _.result(object, 'a[0].b.c2');
  31204. * // => 4
  31205. *
  31206. * _.result(object, 'a[0].b.c3', 'default');
  31207. * // => 'default'
  31208. *
  31209. * _.result(object, 'a[0].b.c3', _.constant('default'));
  31210. * // => 'default'
  31211. */
  31212. function result(object, path, defaultValue) {
  31213. path = castPath(path, object);
  31214. var index = -1,
  31215. length = path.length;
  31216. // Ensure the loop is entered when path is empty.
  31217. if (!length) {
  31218. length = 1;
  31219. object = undefined;
  31220. }
  31221. while (++index < length) {
  31222. var value = object == null ? undefined : object[toKey(path[index])];
  31223. if (value === undefined) {
  31224. index = length;
  31225. value = defaultValue;
  31226. }
  31227. object = isFunction(value) ? value.call(object) : value;
  31228. }
  31229. return object;
  31230. }
  31231. /**
  31232. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  31233. * it's created. Arrays are created for missing index properties while objects
  31234. * are created for all other missing properties. Use `_.setWith` to customize
  31235. * `path` creation.
  31236. *
  31237. * **Note:** This method mutates `object`.
  31238. *
  31239. * @static
  31240. * @memberOf _
  31241. * @since 3.7.0
  31242. * @category Object
  31243. * @param {Object} object The object to modify.
  31244. * @param {Array|string} path The path of the property to set.
  31245. * @param {*} value The value to set.
  31246. * @returns {Object} Returns `object`.
  31247. * @example
  31248. *
  31249. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  31250. *
  31251. * _.set(object, 'a[0].b.c', 4);
  31252. * console.log(object.a[0].b.c);
  31253. * // => 4
  31254. *
  31255. * _.set(object, ['x', '0', 'y', 'z'], 5);
  31256. * console.log(object.x[0].y.z);
  31257. * // => 5
  31258. */
  31259. function set(object, path, value) {
  31260. return object == null ? object : baseSet(object, path, value);
  31261. }
  31262. /**
  31263. * This method is like `_.set` except that it accepts `customizer` which is
  31264. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  31265. * path creation is handled by the method instead. The `customizer` is invoked
  31266. * with three arguments: (nsValue, key, nsObject).
  31267. *
  31268. * **Note:** This method mutates `object`.
  31269. *
  31270. * @static
  31271. * @memberOf _
  31272. * @since 4.0.0
  31273. * @category Object
  31274. * @param {Object} object The object to modify.
  31275. * @param {Array|string} path The path of the property to set.
  31276. * @param {*} value The value to set.
  31277. * @param {Function} [customizer] The function to customize assigned values.
  31278. * @returns {Object} Returns `object`.
  31279. * @example
  31280. *
  31281. * var object = {};
  31282. *
  31283. * _.setWith(object, '[0][1]', 'a', Object);
  31284. * // => { '0': { '1': 'a' } }
  31285. */
  31286. function setWith(object, path, value, customizer) {
  31287. customizer = typeof customizer == 'function' ? customizer : undefined;
  31288. return object == null ? object : baseSet(object, path, value, customizer);
  31289. }
  31290. /**
  31291. * Creates an array of own enumerable string keyed-value pairs for `object`
  31292. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  31293. * entries are returned.
  31294. *
  31295. * @static
  31296. * @memberOf _
  31297. * @since 4.0.0
  31298. * @alias entries
  31299. * @category Object
  31300. * @param {Object} object The object to query.
  31301. * @returns {Array} Returns the key-value pairs.
  31302. * @example
  31303. *
  31304. * function Foo() {
  31305. * this.a = 1;
  31306. * this.b = 2;
  31307. * }
  31308. *
  31309. * Foo.prototype.c = 3;
  31310. *
  31311. * _.toPairs(new Foo);
  31312. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  31313. */
  31314. var toPairs = createToPairs(keys);
  31315. /**
  31316. * Creates an array of own and inherited enumerable string keyed-value pairs
  31317. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  31318. * or set, its entries are returned.
  31319. *
  31320. * @static
  31321. * @memberOf _
  31322. * @since 4.0.0
  31323. * @alias entriesIn
  31324. * @category Object
  31325. * @param {Object} object The object to query.
  31326. * @returns {Array} Returns the key-value pairs.
  31327. * @example
  31328. *
  31329. * function Foo() {
  31330. * this.a = 1;
  31331. * this.b = 2;
  31332. * }
  31333. *
  31334. * Foo.prototype.c = 3;
  31335. *
  31336. * _.toPairsIn(new Foo);
  31337. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  31338. */
  31339. var toPairsIn = createToPairs(keysIn);
  31340. /**
  31341. * An alternative to `_.reduce`; this method transforms `object` to a new
  31342. * `accumulator` object which is the result of running each of its own
  31343. * enumerable string keyed properties thru `iteratee`, with each invocation
  31344. * potentially mutating the `accumulator` object. If `accumulator` is not
  31345. * provided, a new object with the same `[[Prototype]]` will be used. The
  31346. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  31347. * Iteratee functions may exit iteration early by explicitly returning `false`.
  31348. *
  31349. * @static
  31350. * @memberOf _
  31351. * @since 1.3.0
  31352. * @category Object
  31353. * @param {Object} object The object to iterate over.
  31354. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31355. * @param {*} [accumulator] The custom accumulator value.
  31356. * @returns {*} Returns the accumulated value.
  31357. * @example
  31358. *
  31359. * _.transform([2, 3, 4], function(result, n) {
  31360. * result.push(n *= n);
  31361. * return n % 2 == 0;
  31362. * }, []);
  31363. * // => [4, 9]
  31364. *
  31365. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  31366. * (result[value] || (result[value] = [])).push(key);
  31367. * }, {});
  31368. * // => { '1': ['a', 'c'], '2': ['b'] }
  31369. */
  31370. function transform(object, iteratee, accumulator) {
  31371. var isArr = isArray(object),
  31372. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  31373. iteratee = getIteratee(iteratee, 4);
  31374. if (accumulator == null) {
  31375. var Ctor = object && object.constructor;
  31376. if (isArrLike) {
  31377. accumulator = isArr ? new Ctor : [];
  31378. }
  31379. else if (isObject(object)) {
  31380. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  31381. }
  31382. else {
  31383. accumulator = {};
  31384. }
  31385. }
  31386. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  31387. return iteratee(accumulator, value, index, object);
  31388. });
  31389. return accumulator;
  31390. }
  31391. /**
  31392. * Removes the property at `path` of `object`.
  31393. *
  31394. * **Note:** This method mutates `object`.
  31395. *
  31396. * @static
  31397. * @memberOf _
  31398. * @since 4.0.0
  31399. * @category Object
  31400. * @param {Object} object The object to modify.
  31401. * @param {Array|string} path The path of the property to unset.
  31402. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  31403. * @example
  31404. *
  31405. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  31406. * _.unset(object, 'a[0].b.c');
  31407. * // => true
  31408. *
  31409. * console.log(object);
  31410. * // => { 'a': [{ 'b': {} }] };
  31411. *
  31412. * _.unset(object, ['a', '0', 'b', 'c']);
  31413. * // => true
  31414. *
  31415. * console.log(object);
  31416. * // => { 'a': [{ 'b': {} }] };
  31417. */
  31418. function unset(object, path) {
  31419. return object == null ? true : baseUnset(object, path);
  31420. }
  31421. /**
  31422. * This method is like `_.set` except that accepts `updater` to produce the
  31423. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  31424. * is invoked with one argument: (value).
  31425. *
  31426. * **Note:** This method mutates `object`.
  31427. *
  31428. * @static
  31429. * @memberOf _
  31430. * @since 4.6.0
  31431. * @category Object
  31432. * @param {Object} object The object to modify.
  31433. * @param {Array|string} path The path of the property to set.
  31434. * @param {Function} updater The function to produce the updated value.
  31435. * @returns {Object} Returns `object`.
  31436. * @example
  31437. *
  31438. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  31439. *
  31440. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  31441. * console.log(object.a[0].b.c);
  31442. * // => 9
  31443. *
  31444. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  31445. * console.log(object.x[0].y.z);
  31446. * // => 0
  31447. */
  31448. function update(object, path, updater) {
  31449. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  31450. }
  31451. /**
  31452. * This method is like `_.update` except that it accepts `customizer` which is
  31453. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  31454. * path creation is handled by the method instead. The `customizer` is invoked
  31455. * with three arguments: (nsValue, key, nsObject).
  31456. *
  31457. * **Note:** This method mutates `object`.
  31458. *
  31459. * @static
  31460. * @memberOf _
  31461. * @since 4.6.0
  31462. * @category Object
  31463. * @param {Object} object The object to modify.
  31464. * @param {Array|string} path The path of the property to set.
  31465. * @param {Function} updater The function to produce the updated value.
  31466. * @param {Function} [customizer] The function to customize assigned values.
  31467. * @returns {Object} Returns `object`.
  31468. * @example
  31469. *
  31470. * var object = {};
  31471. *
  31472. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  31473. * // => { '0': { '1': 'a' } }
  31474. */
  31475. function updateWith(object, path, updater, customizer) {
  31476. customizer = typeof customizer == 'function' ? customizer : undefined;
  31477. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  31478. }
  31479. /**
  31480. * Creates an array of the own enumerable string keyed property values of `object`.
  31481. *
  31482. * **Note:** Non-object values are coerced to objects.
  31483. *
  31484. * @static
  31485. * @since 0.1.0
  31486. * @memberOf _
  31487. * @category Object
  31488. * @param {Object} object The object to query.
  31489. * @returns {Array} Returns the array of property values.
  31490. * @example
  31491. *
  31492. * function Foo() {
  31493. * this.a = 1;
  31494. * this.b = 2;
  31495. * }
  31496. *
  31497. * Foo.prototype.c = 3;
  31498. *
  31499. * _.values(new Foo);
  31500. * // => [1, 2] (iteration order is not guaranteed)
  31501. *
  31502. * _.values('hi');
  31503. * // => ['h', 'i']
  31504. */
  31505. function values(object) {
  31506. return object == null ? [] : baseValues(object, keys(object));
  31507. }
  31508. /**
  31509. * Creates an array of the own and inherited enumerable string keyed property
  31510. * values of `object`.
  31511. *
  31512. * **Note:** Non-object values are coerced to objects.
  31513. *
  31514. * @static
  31515. * @memberOf _
  31516. * @since 3.0.0
  31517. * @category Object
  31518. * @param {Object} object The object to query.
  31519. * @returns {Array} Returns the array of property values.
  31520. * @example
  31521. *
  31522. * function Foo() {
  31523. * this.a = 1;
  31524. * this.b = 2;
  31525. * }
  31526. *
  31527. * Foo.prototype.c = 3;
  31528. *
  31529. * _.valuesIn(new Foo);
  31530. * // => [1, 2, 3] (iteration order is not guaranteed)
  31531. */
  31532. function valuesIn(object) {
  31533. return object == null ? [] : baseValues(object, keysIn(object));
  31534. }
  31535. /*------------------------------------------------------------------------*/
  31536. /**
  31537. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  31538. *
  31539. * @static
  31540. * @memberOf _
  31541. * @since 4.0.0
  31542. * @category Number
  31543. * @param {number} number The number to clamp.
  31544. * @param {number} [lower] The lower bound.
  31545. * @param {number} upper The upper bound.
  31546. * @returns {number} Returns the clamped number.
  31547. * @example
  31548. *
  31549. * _.clamp(-10, -5, 5);
  31550. * // => -5
  31551. *
  31552. * _.clamp(10, -5, 5);
  31553. * // => 5
  31554. */
  31555. function clamp(number, lower, upper) {
  31556. if (upper === undefined) {
  31557. upper = lower;
  31558. lower = undefined;
  31559. }
  31560. if (upper !== undefined) {
  31561. upper = toNumber(upper);
  31562. upper = upper === upper ? upper : 0;
  31563. }
  31564. if (lower !== undefined) {
  31565. lower = toNumber(lower);
  31566. lower = lower === lower ? lower : 0;
  31567. }
  31568. return baseClamp(toNumber(number), lower, upper);
  31569. }
  31570. /**
  31571. * Checks if `n` is between `start` and up to, but not including, `end`. If
  31572. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  31573. * If `start` is greater than `end` the params are swapped to support
  31574. * negative ranges.
  31575. *
  31576. * @static
  31577. * @memberOf _
  31578. * @since 3.3.0
  31579. * @category Number
  31580. * @param {number} number The number to check.
  31581. * @param {number} [start=0] The start of the range.
  31582. * @param {number} end The end of the range.
  31583. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  31584. * @see _.range, _.rangeRight
  31585. * @example
  31586. *
  31587. * _.inRange(3, 2, 4);
  31588. * // => true
  31589. *
  31590. * _.inRange(4, 8);
  31591. * // => true
  31592. *
  31593. * _.inRange(4, 2);
  31594. * // => false
  31595. *
  31596. * _.inRange(2, 2);
  31597. * // => false
  31598. *
  31599. * _.inRange(1.2, 2);
  31600. * // => true
  31601. *
  31602. * _.inRange(5.2, 4);
  31603. * // => false
  31604. *
  31605. * _.inRange(-3, -2, -6);
  31606. * // => true
  31607. */
  31608. function inRange(number, start, end) {
  31609. start = toFinite(start);
  31610. if (end === undefined) {
  31611. end = start;
  31612. start = 0;
  31613. } else {
  31614. end = toFinite(end);
  31615. }
  31616. number = toNumber(number);
  31617. return baseInRange(number, start, end);
  31618. }
  31619. /**
  31620. * Produces a random number between the inclusive `lower` and `upper` bounds.
  31621. * If only one argument is provided a number between `0` and the given number
  31622. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  31623. * floats, a floating-point number is returned instead of an integer.
  31624. *
  31625. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  31626. * floating-point values which can produce unexpected results.
  31627. *
  31628. * @static
  31629. * @memberOf _
  31630. * @since 0.7.0
  31631. * @category Number
  31632. * @param {number} [lower=0] The lower bound.
  31633. * @param {number} [upper=1] The upper bound.
  31634. * @param {boolean} [floating] Specify returning a floating-point number.
  31635. * @returns {number} Returns the random number.
  31636. * @example
  31637. *
  31638. * _.random(0, 5);
  31639. * // => an integer between 0 and 5
  31640. *
  31641. * _.random(5);
  31642. * // => also an integer between 0 and 5
  31643. *
  31644. * _.random(5, true);
  31645. * // => a floating-point number between 0 and 5
  31646. *
  31647. * _.random(1.2, 5.2);
  31648. * // => a floating-point number between 1.2 and 5.2
  31649. */
  31650. function random(lower, upper, floating) {
  31651. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  31652. upper = floating = undefined;
  31653. }
  31654. if (floating === undefined) {
  31655. if (typeof upper == 'boolean') {
  31656. floating = upper;
  31657. upper = undefined;
  31658. }
  31659. else if (typeof lower == 'boolean') {
  31660. floating = lower;
  31661. lower = undefined;
  31662. }
  31663. }
  31664. if (lower === undefined && upper === undefined) {
  31665. lower = 0;
  31666. upper = 1;
  31667. }
  31668. else {
  31669. lower = toFinite(lower);
  31670. if (upper === undefined) {
  31671. upper = lower;
  31672. lower = 0;
  31673. } else {
  31674. upper = toFinite(upper);
  31675. }
  31676. }
  31677. if (lower > upper) {
  31678. var temp = lower;
  31679. lower = upper;
  31680. upper = temp;
  31681. }
  31682. if (floating || lower % 1 || upper % 1) {
  31683. var rand = nativeRandom();
  31684. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  31685. }
  31686. return baseRandom(lower, upper);
  31687. }
  31688. /*------------------------------------------------------------------------*/
  31689. /**
  31690. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  31691. *
  31692. * @static
  31693. * @memberOf _
  31694. * @since 3.0.0
  31695. * @category String
  31696. * @param {string} [string=''] The string to convert.
  31697. * @returns {string} Returns the camel cased string.
  31698. * @example
  31699. *
  31700. * _.camelCase('Foo Bar');
  31701. * // => 'fooBar'
  31702. *
  31703. * _.camelCase('--foo-bar--');
  31704. * // => 'fooBar'
  31705. *
  31706. * _.camelCase('__FOO_BAR__');
  31707. * // => 'fooBar'
  31708. */
  31709. var camelCase = createCompounder(function(result, word, index) {
  31710. word = word.toLowerCase();
  31711. return result + (index ? capitalize(word) : word);
  31712. });
  31713. /**
  31714. * Converts the first character of `string` to upper case and the remaining
  31715. * to lower case.
  31716. *
  31717. * @static
  31718. * @memberOf _
  31719. * @since 3.0.0
  31720. * @category String
  31721. * @param {string} [string=''] The string to capitalize.
  31722. * @returns {string} Returns the capitalized string.
  31723. * @example
  31724. *
  31725. * _.capitalize('FRED');
  31726. * // => 'Fred'
  31727. */
  31728. function capitalize(string) {
  31729. return upperFirst(toString(string).toLowerCase());
  31730. }
  31731. /**
  31732. * Deburrs `string` by converting
  31733. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  31734. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  31735. * letters to basic Latin letters and removing
  31736. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  31737. *
  31738. * @static
  31739. * @memberOf _
  31740. * @since 3.0.0
  31741. * @category String
  31742. * @param {string} [string=''] The string to deburr.
  31743. * @returns {string} Returns the deburred string.
  31744. * @example
  31745. *
  31746. * _.deburr('déjà vu');
  31747. * // => 'deja vu'
  31748. */
  31749. function deburr(string) {
  31750. string = toString(string);
  31751. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  31752. }
  31753. /**
  31754. * Checks if `string` ends with the given target string.
  31755. *
  31756. * @static
  31757. * @memberOf _
  31758. * @since 3.0.0
  31759. * @category String
  31760. * @param {string} [string=''] The string to inspect.
  31761. * @param {string} [target] The string to search for.
  31762. * @param {number} [position=string.length] The position to search up to.
  31763. * @returns {boolean} Returns `true` if `string` ends with `target`,
  31764. * else `false`.
  31765. * @example
  31766. *
  31767. * _.endsWith('abc', 'c');
  31768. * // => true
  31769. *
  31770. * _.endsWith('abc', 'b');
  31771. * // => false
  31772. *
  31773. * _.endsWith('abc', 'b', 2);
  31774. * // => true
  31775. */
  31776. function endsWith(string, target, position) {
  31777. string = toString(string);
  31778. target = baseToString(target);
  31779. var length = string.length;
  31780. position = position === undefined
  31781. ? length
  31782. : baseClamp(toInteger(position), 0, length);
  31783. var end = position;
  31784. position -= target.length;
  31785. return position >= 0 && string.slice(position, end) == target;
  31786. }
  31787. /**
  31788. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  31789. * corresponding HTML entities.
  31790. *
  31791. * **Note:** No other characters are escaped. To escape additional
  31792. * characters use a third-party library like [_he_](https://mths.be/he).
  31793. *
  31794. * Though the ">" character is escaped for symmetry, characters like
  31795. * ">" and "/" don't need escaping in HTML and have no special meaning
  31796. * unless they're part of a tag or unquoted attribute value. See
  31797. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  31798. * (under "semi-related fun fact") for more details.
  31799. *
  31800. * When working with HTML you should always
  31801. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  31802. * XSS vectors.
  31803. *
  31804. * @static
  31805. * @since 0.1.0
  31806. * @memberOf _
  31807. * @category String
  31808. * @param {string} [string=''] The string to escape.
  31809. * @returns {string} Returns the escaped string.
  31810. * @example
  31811. *
  31812. * _.escape('fred, barney, & pebbles');
  31813. * // => 'fred, barney, &amp; pebbles'
  31814. */
  31815. function escape(string) {
  31816. string = toString(string);
  31817. return (string && reHasUnescapedHtml.test(string))
  31818. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  31819. : string;
  31820. }
  31821. /**
  31822. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  31823. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  31824. *
  31825. * @static
  31826. * @memberOf _
  31827. * @since 3.0.0
  31828. * @category String
  31829. * @param {string} [string=''] The string to escape.
  31830. * @returns {string} Returns the escaped string.
  31831. * @example
  31832. *
  31833. * _.escapeRegExp('[lodash](https://lodash.com/)');
  31834. * // => '\[lodash\]\(https://lodash\.com/\)'
  31835. */
  31836. function escapeRegExp(string) {
  31837. string = toString(string);
  31838. return (string && reHasRegExpChar.test(string))
  31839. ? string.replace(reRegExpChar, '\\$&')
  31840. : string;
  31841. }
  31842. /**
  31843. * Converts `string` to
  31844. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  31845. *
  31846. * @static
  31847. * @memberOf _
  31848. * @since 3.0.0
  31849. * @category String
  31850. * @param {string} [string=''] The string to convert.
  31851. * @returns {string} Returns the kebab cased string.
  31852. * @example
  31853. *
  31854. * _.kebabCase('Foo Bar');
  31855. * // => 'foo-bar'
  31856. *
  31857. * _.kebabCase('fooBar');
  31858. * // => 'foo-bar'
  31859. *
  31860. * _.kebabCase('__FOO_BAR__');
  31861. * // => 'foo-bar'
  31862. */
  31863. var kebabCase = createCompounder(function(result, word, index) {
  31864. return result + (index ? '-' : '') + word.toLowerCase();
  31865. });
  31866. /**
  31867. * Converts `string`, as space separated words, to lower case.
  31868. *
  31869. * @static
  31870. * @memberOf _
  31871. * @since 4.0.0
  31872. * @category String
  31873. * @param {string} [string=''] The string to convert.
  31874. * @returns {string} Returns the lower cased string.
  31875. * @example
  31876. *
  31877. * _.lowerCase('--Foo-Bar--');
  31878. * // => 'foo bar'
  31879. *
  31880. * _.lowerCase('fooBar');
  31881. * // => 'foo bar'
  31882. *
  31883. * _.lowerCase('__FOO_BAR__');
  31884. * // => 'foo bar'
  31885. */
  31886. var lowerCase = createCompounder(function(result, word, index) {
  31887. return result + (index ? ' ' : '') + word.toLowerCase();
  31888. });
  31889. /**
  31890. * Converts the first character of `string` to lower case.
  31891. *
  31892. * @static
  31893. * @memberOf _
  31894. * @since 4.0.0
  31895. * @category String
  31896. * @param {string} [string=''] The string to convert.
  31897. * @returns {string} Returns the converted string.
  31898. * @example
  31899. *
  31900. * _.lowerFirst('Fred');
  31901. * // => 'fred'
  31902. *
  31903. * _.lowerFirst('FRED');
  31904. * // => 'fRED'
  31905. */
  31906. var lowerFirst = createCaseFirst('toLowerCase');
  31907. /**
  31908. * Pads `string` on the left and right sides if it's shorter than `length`.
  31909. * Padding characters are truncated if they can't be evenly divided by `length`.
  31910. *
  31911. * @static
  31912. * @memberOf _
  31913. * @since 3.0.0
  31914. * @category String
  31915. * @param {string} [string=''] The string to pad.
  31916. * @param {number} [length=0] The padding length.
  31917. * @param {string} [chars=' '] The string used as padding.
  31918. * @returns {string} Returns the padded string.
  31919. * @example
  31920. *
  31921. * _.pad('abc', 8);
  31922. * // => ' abc '
  31923. *
  31924. * _.pad('abc', 8, '_-');
  31925. * // => '_-abc_-_'
  31926. *
  31927. * _.pad('abc', 3);
  31928. * // => 'abc'
  31929. */
  31930. function pad(string, length, chars) {
  31931. string = toString(string);
  31932. length = toInteger(length);
  31933. var strLength = length ? stringSize(string) : 0;
  31934. if (!length || strLength >= length) {
  31935. return string;
  31936. }
  31937. var mid = (length - strLength) / 2;
  31938. return (
  31939. createPadding(nativeFloor(mid), chars) +
  31940. string +
  31941. createPadding(nativeCeil(mid), chars)
  31942. );
  31943. }
  31944. /**
  31945. * Pads `string` on the right side if it's shorter than `length`. Padding
  31946. * characters are truncated if they exceed `length`.
  31947. *
  31948. * @static
  31949. * @memberOf _
  31950. * @since 4.0.0
  31951. * @category String
  31952. * @param {string} [string=''] The string to pad.
  31953. * @param {number} [length=0] The padding length.
  31954. * @param {string} [chars=' '] The string used as padding.
  31955. * @returns {string} Returns the padded string.
  31956. * @example
  31957. *
  31958. * _.padEnd('abc', 6);
  31959. * // => 'abc '
  31960. *
  31961. * _.padEnd('abc', 6, '_-');
  31962. * // => 'abc_-_'
  31963. *
  31964. * _.padEnd('abc', 3);
  31965. * // => 'abc'
  31966. */
  31967. function padEnd(string, length, chars) {
  31968. string = toString(string);
  31969. length = toInteger(length);
  31970. var strLength = length ? stringSize(string) : 0;
  31971. return (length && strLength < length)
  31972. ? (string + createPadding(length - strLength, chars))
  31973. : string;
  31974. }
  31975. /**
  31976. * Pads `string` on the left side if it's shorter than `length`. Padding
  31977. * characters are truncated if they exceed `length`.
  31978. *
  31979. * @static
  31980. * @memberOf _
  31981. * @since 4.0.0
  31982. * @category String
  31983. * @param {string} [string=''] The string to pad.
  31984. * @param {number} [length=0] The padding length.
  31985. * @param {string} [chars=' '] The string used as padding.
  31986. * @returns {string} Returns the padded string.
  31987. * @example
  31988. *
  31989. * _.padStart('abc', 6);
  31990. * // => ' abc'
  31991. *
  31992. * _.padStart('abc', 6, '_-');
  31993. * // => '_-_abc'
  31994. *
  31995. * _.padStart('abc', 3);
  31996. * // => 'abc'
  31997. */
  31998. function padStart(string, length, chars) {
  31999. string = toString(string);
  32000. length = toInteger(length);
  32001. var strLength = length ? stringSize(string) : 0;
  32002. return (length && strLength < length)
  32003. ? (createPadding(length - strLength, chars) + string)
  32004. : string;
  32005. }
  32006. /**
  32007. * Converts `string` to an integer of the specified radix. If `radix` is
  32008. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  32009. * hexadecimal, in which case a `radix` of `16` is used.
  32010. *
  32011. * **Note:** This method aligns with the
  32012. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  32013. *
  32014. * @static
  32015. * @memberOf _
  32016. * @since 1.1.0
  32017. * @category String
  32018. * @param {string} string The string to convert.
  32019. * @param {number} [radix=10] The radix to interpret `value` by.
  32020. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32021. * @returns {number} Returns the converted integer.
  32022. * @example
  32023. *
  32024. * _.parseInt('08');
  32025. * // => 8
  32026. *
  32027. * _.map(['6', '08', '10'], _.parseInt);
  32028. * // => [6, 8, 10]
  32029. */
  32030. function parseInt(string, radix, guard) {
  32031. if (guard || radix == null) {
  32032. radix = 0;
  32033. } else if (radix) {
  32034. radix = +radix;
  32035. }
  32036. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  32037. }
  32038. /**
  32039. * Repeats the given string `n` times.
  32040. *
  32041. * @static
  32042. * @memberOf _
  32043. * @since 3.0.0
  32044. * @category String
  32045. * @param {string} [string=''] The string to repeat.
  32046. * @param {number} [n=1] The number of times to repeat the string.
  32047. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32048. * @returns {string} Returns the repeated string.
  32049. * @example
  32050. *
  32051. * _.repeat('*', 3);
  32052. * // => '***'
  32053. *
  32054. * _.repeat('abc', 2);
  32055. * // => 'abcabc'
  32056. *
  32057. * _.repeat('abc', 0);
  32058. * // => ''
  32059. */
  32060. function repeat(string, n, guard) {
  32061. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  32062. n = 1;
  32063. } else {
  32064. n = toInteger(n);
  32065. }
  32066. return baseRepeat(toString(string), n);
  32067. }
  32068. /**
  32069. * Replaces matches for `pattern` in `string` with `replacement`.
  32070. *
  32071. * **Note:** This method is based on
  32072. * [`String#replace`](https://mdn.io/String/replace).
  32073. *
  32074. * @static
  32075. * @memberOf _
  32076. * @since 4.0.0
  32077. * @category String
  32078. * @param {string} [string=''] The string to modify.
  32079. * @param {RegExp|string} pattern The pattern to replace.
  32080. * @param {Function|string} replacement The match replacement.
  32081. * @returns {string} Returns the modified string.
  32082. * @example
  32083. *
  32084. * _.replace('Hi Fred', 'Fred', 'Barney');
  32085. * // => 'Hi Barney'
  32086. */
  32087. function replace() {
  32088. var args = arguments,
  32089. string = toString(args[0]);
  32090. return args.length < 3 ? string : string.replace(args[1], args[2]);
  32091. }
  32092. /**
  32093. * Converts `string` to
  32094. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  32095. *
  32096. * @static
  32097. * @memberOf _
  32098. * @since 3.0.0
  32099. * @category String
  32100. * @param {string} [string=''] The string to convert.
  32101. * @returns {string} Returns the snake cased string.
  32102. * @example
  32103. *
  32104. * _.snakeCase('Foo Bar');
  32105. * // => 'foo_bar'
  32106. *
  32107. * _.snakeCase('fooBar');
  32108. * // => 'foo_bar'
  32109. *
  32110. * _.snakeCase('--FOO-BAR--');
  32111. * // => 'foo_bar'
  32112. */
  32113. var snakeCase = createCompounder(function(result, word, index) {
  32114. return result + (index ? '_' : '') + word.toLowerCase();
  32115. });
  32116. /**
  32117. * Splits `string` by `separator`.
  32118. *
  32119. * **Note:** This method is based on
  32120. * [`String#split`](https://mdn.io/String/split).
  32121. *
  32122. * @static
  32123. * @memberOf _
  32124. * @since 4.0.0
  32125. * @category String
  32126. * @param {string} [string=''] The string to split.
  32127. * @param {RegExp|string} separator The separator pattern to split by.
  32128. * @param {number} [limit] The length to truncate results to.
  32129. * @returns {Array} Returns the string segments.
  32130. * @example
  32131. *
  32132. * _.split('a-b-c', '-', 2);
  32133. * // => ['a', 'b']
  32134. */
  32135. function split(string, separator, limit) {
  32136. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  32137. separator = limit = undefined;
  32138. }
  32139. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  32140. if (!limit) {
  32141. return [];
  32142. }
  32143. string = toString(string);
  32144. if (string && (
  32145. typeof separator == 'string' ||
  32146. (separator != null && !isRegExp(separator))
  32147. )) {
  32148. separator = baseToString(separator);
  32149. if (!separator && hasUnicode(string)) {
  32150. return castSlice(stringToArray(string), 0, limit);
  32151. }
  32152. }
  32153. return string.split(separator, limit);
  32154. }
  32155. /**
  32156. * Converts `string` to
  32157. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  32158. *
  32159. * @static
  32160. * @memberOf _
  32161. * @since 3.1.0
  32162. * @category String
  32163. * @param {string} [string=''] The string to convert.
  32164. * @returns {string} Returns the start cased string.
  32165. * @example
  32166. *
  32167. * _.startCase('--foo-bar--');
  32168. * // => 'Foo Bar'
  32169. *
  32170. * _.startCase('fooBar');
  32171. * // => 'Foo Bar'
  32172. *
  32173. * _.startCase('__FOO_BAR__');
  32174. * // => 'FOO BAR'
  32175. */
  32176. var startCase = createCompounder(function(result, word, index) {
  32177. return result + (index ? ' ' : '') + upperFirst(word);
  32178. });
  32179. /**
  32180. * Checks if `string` starts with the given target string.
  32181. *
  32182. * @static
  32183. * @memberOf _
  32184. * @since 3.0.0
  32185. * @category String
  32186. * @param {string} [string=''] The string to inspect.
  32187. * @param {string} [target] The string to search for.
  32188. * @param {number} [position=0] The position to search from.
  32189. * @returns {boolean} Returns `true` if `string` starts with `target`,
  32190. * else `false`.
  32191. * @example
  32192. *
  32193. * _.startsWith('abc', 'a');
  32194. * // => true
  32195. *
  32196. * _.startsWith('abc', 'b');
  32197. * // => false
  32198. *
  32199. * _.startsWith('abc', 'b', 1);
  32200. * // => true
  32201. */
  32202. function startsWith(string, target, position) {
  32203. string = toString(string);
  32204. position = position == null
  32205. ? 0
  32206. : baseClamp(toInteger(position), 0, string.length);
  32207. target = baseToString(target);
  32208. return string.slice(position, position + target.length) == target;
  32209. }
  32210. /**
  32211. * Creates a compiled template function that can interpolate data properties
  32212. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  32213. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  32214. * properties may be accessed as free variables in the template. If a setting
  32215. * object is given, it takes precedence over `_.templateSettings` values.
  32216. *
  32217. * **Note:** In the development build `_.template` utilizes
  32218. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  32219. * for easier debugging.
  32220. *
  32221. * For more information on precompiling templates see
  32222. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  32223. *
  32224. * For more information on Chrome extension sandboxes see
  32225. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  32226. *
  32227. * @static
  32228. * @since 0.1.0
  32229. * @memberOf _
  32230. * @category String
  32231. * @param {string} [string=''] The template string.
  32232. * @param {Object} [options={}] The options object.
  32233. * @param {RegExp} [options.escape=_.templateSettings.escape]
  32234. * The HTML "escape" delimiter.
  32235. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  32236. * The "evaluate" delimiter.
  32237. * @param {Object} [options.imports=_.templateSettings.imports]
  32238. * An object to import into the template as free variables.
  32239. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  32240. * The "interpolate" delimiter.
  32241. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  32242. * The sourceURL of the compiled template.
  32243. * @param {string} [options.variable='obj']
  32244. * The data object variable name.
  32245. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32246. * @returns {Function} Returns the compiled template function.
  32247. * @example
  32248. *
  32249. * // Use the "interpolate" delimiter to create a compiled template.
  32250. * var compiled = _.template('hello <%= user %>!');
  32251. * compiled({ 'user': 'fred' });
  32252. * // => 'hello fred!'
  32253. *
  32254. * // Use the HTML "escape" delimiter to escape data property values.
  32255. * var compiled = _.template('<b><%- value %></b>');
  32256. * compiled({ 'value': '<script>' });
  32257. * // => '<b>&lt;script&gt;</b>'
  32258. *
  32259. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  32260. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  32261. * compiled({ 'users': ['fred', 'barney'] });
  32262. * // => '<li>fred</li><li>barney</li>'
  32263. *
  32264. * // Use the internal `print` function in "evaluate" delimiters.
  32265. * var compiled = _.template('<% print("hello " + user); %>!');
  32266. * compiled({ 'user': 'barney' });
  32267. * // => 'hello barney!'
  32268. *
  32269. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  32270. * // Disable support by replacing the "interpolate" delimiter.
  32271. * var compiled = _.template('hello ${ user }!');
  32272. * compiled({ 'user': 'pebbles' });
  32273. * // => 'hello pebbles!'
  32274. *
  32275. * // Use backslashes to treat delimiters as plain text.
  32276. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  32277. * compiled({ 'value': 'ignored' });
  32278. * // => '<%- value %>'
  32279. *
  32280. * // Use the `imports` option to import `jQuery` as `jq`.
  32281. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  32282. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  32283. * compiled({ 'users': ['fred', 'barney'] });
  32284. * // => '<li>fred</li><li>barney</li>'
  32285. *
  32286. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  32287. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  32288. * compiled(data);
  32289. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  32290. *
  32291. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  32292. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  32293. * compiled.source;
  32294. * // => function(data) {
  32295. * // var __t, __p = '';
  32296. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  32297. * // return __p;
  32298. * // }
  32299. *
  32300. * // Use custom template delimiters.
  32301. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  32302. * var compiled = _.template('hello {{ user }}!');
  32303. * compiled({ 'user': 'mustache' });
  32304. * // => 'hello mustache!'
  32305. *
  32306. * // Use the `source` property to inline compiled templates for meaningful
  32307. * // line numbers in error messages and stack traces.
  32308. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  32309. * var JST = {\
  32310. * "main": ' + _.template(mainText).source + '\
  32311. * };\
  32312. * ');
  32313. */
  32314. function template(string, options, guard) {
  32315. // Based on John Resig's `tmpl` implementation
  32316. // (http://ejohn.org/blog/javascript-micro-templating/)
  32317. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  32318. var settings = lodash.templateSettings;
  32319. if (guard && isIterateeCall(string, options, guard)) {
  32320. options = undefined;
  32321. }
  32322. string = toString(string);
  32323. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  32324. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  32325. importsKeys = keys(imports),
  32326. importsValues = baseValues(imports, importsKeys);
  32327. var isEscaping,
  32328. isEvaluating,
  32329. index = 0,
  32330. interpolate = options.interpolate || reNoMatch,
  32331. source = "__p += '";
  32332. // Compile the regexp to match each delimiter.
  32333. var reDelimiters = RegExp(
  32334. (options.escape || reNoMatch).source + '|' +
  32335. interpolate.source + '|' +
  32336. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  32337. (options.evaluate || reNoMatch).source + '|$'
  32338. , 'g');
  32339. // Use a sourceURL for easier debugging.
  32340. // The sourceURL gets injected into the source that's eval-ed, so be careful
  32341. // with lookup (in case of e.g. prototype pollution), and strip newlines if any.
  32342. // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection.
  32343. var sourceURL = '//# sourceURL=' +
  32344. (hasOwnProperty.call(options, 'sourceURL')
  32345. ? (options.sourceURL + '').replace(/[\r\n]/g, ' ')
  32346. : ('lodash.templateSources[' + (++templateCounter) + ']')
  32347. ) + '\n';
  32348. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  32349. interpolateValue || (interpolateValue = esTemplateValue);
  32350. // Escape characters that can't be included in string literals.
  32351. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  32352. // Replace delimiters with snippets.
  32353. if (escapeValue) {
  32354. isEscaping = true;
  32355. source += "' +\n__e(" + escapeValue + ") +\n'";
  32356. }
  32357. if (evaluateValue) {
  32358. isEvaluating = true;
  32359. source += "';\n" + evaluateValue + ";\n__p += '";
  32360. }
  32361. if (interpolateValue) {
  32362. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  32363. }
  32364. index = offset + match.length;
  32365. // The JS engine embedded in Adobe products needs `match` returned in
  32366. // order to produce the correct `offset` value.
  32367. return match;
  32368. });
  32369. source += "';\n";
  32370. // If `variable` is not specified wrap a with-statement around the generated
  32371. // code to add the data object to the top of the scope chain.
  32372. // Like with sourceURL, we take care to not check the option's prototype,
  32373. // as this configuration is a code injection vector.
  32374. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  32375. if (!variable) {
  32376. source = 'with (obj) {\n' + source + '\n}\n';
  32377. }
  32378. // Cleanup code by stripping empty strings.
  32379. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  32380. .replace(reEmptyStringMiddle, '$1')
  32381. .replace(reEmptyStringTrailing, '$1;');
  32382. // Frame code as the function body.
  32383. source = 'function(' + (variable || 'obj') + ') {\n' +
  32384. (variable
  32385. ? ''
  32386. : 'obj || (obj = {});\n'
  32387. ) +
  32388. "var __t, __p = ''" +
  32389. (isEscaping
  32390. ? ', __e = _.escape'
  32391. : ''
  32392. ) +
  32393. (isEvaluating
  32394. ? ', __j = Array.prototype.join;\n' +
  32395. "function print() { __p += __j.call(arguments, '') }\n"
  32396. : ';\n'
  32397. ) +
  32398. source +
  32399. 'return __p\n}';
  32400. var result = attempt(function() {
  32401. return Function(importsKeys, sourceURL + 'return ' + source)
  32402. .apply(undefined, importsValues);
  32403. });
  32404. // Provide the compiled function's source by its `toString` method or
  32405. // the `source` property as a convenience for inlining compiled templates.
  32406. result.source = source;
  32407. if (isError(result)) {
  32408. throw result;
  32409. }
  32410. return result;
  32411. }
  32412. /**
  32413. * Converts `string`, as a whole, to lower case just like
  32414. * [String#toLowerCase](https://mdn.io/toLowerCase).
  32415. *
  32416. * @static
  32417. * @memberOf _
  32418. * @since 4.0.0
  32419. * @category String
  32420. * @param {string} [string=''] The string to convert.
  32421. * @returns {string} Returns the lower cased string.
  32422. * @example
  32423. *
  32424. * _.toLower('--Foo-Bar--');
  32425. * // => '--foo-bar--'
  32426. *
  32427. * _.toLower('fooBar');
  32428. * // => 'foobar'
  32429. *
  32430. * _.toLower('__FOO_BAR__');
  32431. * // => '__foo_bar__'
  32432. */
  32433. function toLower(value) {
  32434. return toString(value).toLowerCase();
  32435. }
  32436. /**
  32437. * Converts `string`, as a whole, to upper case just like
  32438. * [String#toUpperCase](https://mdn.io/toUpperCase).
  32439. *
  32440. * @static
  32441. * @memberOf _
  32442. * @since 4.0.0
  32443. * @category String
  32444. * @param {string} [string=''] The string to convert.
  32445. * @returns {string} Returns the upper cased string.
  32446. * @example
  32447. *
  32448. * _.toUpper('--foo-bar--');
  32449. * // => '--FOO-BAR--'
  32450. *
  32451. * _.toUpper('fooBar');
  32452. * // => 'FOOBAR'
  32453. *
  32454. * _.toUpper('__foo_bar__');
  32455. * // => '__FOO_BAR__'
  32456. */
  32457. function toUpper(value) {
  32458. return toString(value).toUpperCase();
  32459. }
  32460. /**
  32461. * Removes leading and trailing whitespace or specified characters from `string`.
  32462. *
  32463. * @static
  32464. * @memberOf _
  32465. * @since 3.0.0
  32466. * @category String
  32467. * @param {string} [string=''] The string to trim.
  32468. * @param {string} [chars=whitespace] The characters to trim.
  32469. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32470. * @returns {string} Returns the trimmed string.
  32471. * @example
  32472. *
  32473. * _.trim(' abc ');
  32474. * // => 'abc'
  32475. *
  32476. * _.trim('-_-abc-_-', '_-');
  32477. * // => 'abc'
  32478. *
  32479. * _.map([' foo ', ' bar '], _.trim);
  32480. * // => ['foo', 'bar']
  32481. */
  32482. function trim(string, chars, guard) {
  32483. string = toString(string);
  32484. if (string && (guard || chars === undefined)) {
  32485. return string.replace(reTrim, '');
  32486. }
  32487. if (!string || !(chars = baseToString(chars))) {
  32488. return string;
  32489. }
  32490. var strSymbols = stringToArray(string),
  32491. chrSymbols = stringToArray(chars),
  32492. start = charsStartIndex(strSymbols, chrSymbols),
  32493. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  32494. return castSlice(strSymbols, start, end).join('');
  32495. }
  32496. /**
  32497. * Removes trailing whitespace or specified characters from `string`.
  32498. *
  32499. * @static
  32500. * @memberOf _
  32501. * @since 4.0.0
  32502. * @category String
  32503. * @param {string} [string=''] The string to trim.
  32504. * @param {string} [chars=whitespace] The characters to trim.
  32505. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32506. * @returns {string} Returns the trimmed string.
  32507. * @example
  32508. *
  32509. * _.trimEnd(' abc ');
  32510. * // => ' abc'
  32511. *
  32512. * _.trimEnd('-_-abc-_-', '_-');
  32513. * // => '-_-abc'
  32514. */
  32515. function trimEnd(string, chars, guard) {
  32516. string = toString(string);
  32517. if (string && (guard || chars === undefined)) {
  32518. return string.replace(reTrimEnd, '');
  32519. }
  32520. if (!string || !(chars = baseToString(chars))) {
  32521. return string;
  32522. }
  32523. var strSymbols = stringToArray(string),
  32524. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  32525. return castSlice(strSymbols, 0, end).join('');
  32526. }
  32527. /**
  32528. * Removes leading whitespace or specified characters from `string`.
  32529. *
  32530. * @static
  32531. * @memberOf _
  32532. * @since 4.0.0
  32533. * @category String
  32534. * @param {string} [string=''] The string to trim.
  32535. * @param {string} [chars=whitespace] The characters to trim.
  32536. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32537. * @returns {string} Returns the trimmed string.
  32538. * @example
  32539. *
  32540. * _.trimStart(' abc ');
  32541. * // => 'abc '
  32542. *
  32543. * _.trimStart('-_-abc-_-', '_-');
  32544. * // => 'abc-_-'
  32545. */
  32546. function trimStart(string, chars, guard) {
  32547. string = toString(string);
  32548. if (string && (guard || chars === undefined)) {
  32549. return string.replace(reTrimStart, '');
  32550. }
  32551. if (!string || !(chars = baseToString(chars))) {
  32552. return string;
  32553. }
  32554. var strSymbols = stringToArray(string),
  32555. start = charsStartIndex(strSymbols, stringToArray(chars));
  32556. return castSlice(strSymbols, start).join('');
  32557. }
  32558. /**
  32559. * Truncates `string` if it's longer than the given maximum string length.
  32560. * The last characters of the truncated string are replaced with the omission
  32561. * string which defaults to "...".
  32562. *
  32563. * @static
  32564. * @memberOf _
  32565. * @since 4.0.0
  32566. * @category String
  32567. * @param {string} [string=''] The string to truncate.
  32568. * @param {Object} [options={}] The options object.
  32569. * @param {number} [options.length=30] The maximum string length.
  32570. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  32571. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  32572. * @returns {string} Returns the truncated string.
  32573. * @example
  32574. *
  32575. * _.truncate('hi-diddly-ho there, neighborino');
  32576. * // => 'hi-diddly-ho there, neighbo...'
  32577. *
  32578. * _.truncate('hi-diddly-ho there, neighborino', {
  32579. * 'length': 24,
  32580. * 'separator': ' '
  32581. * });
  32582. * // => 'hi-diddly-ho there,...'
  32583. *
  32584. * _.truncate('hi-diddly-ho there, neighborino', {
  32585. * 'length': 24,
  32586. * 'separator': /,? +/
  32587. * });
  32588. * // => 'hi-diddly-ho there...'
  32589. *
  32590. * _.truncate('hi-diddly-ho there, neighborino', {
  32591. * 'omission': ' [...]'
  32592. * });
  32593. * // => 'hi-diddly-ho there, neig [...]'
  32594. */
  32595. function truncate(string, options) {
  32596. var length = DEFAULT_TRUNC_LENGTH,
  32597. omission = DEFAULT_TRUNC_OMISSION;
  32598. if (isObject(options)) {
  32599. var separator = 'separator' in options ? options.separator : separator;
  32600. length = 'length' in options ? toInteger(options.length) : length;
  32601. omission = 'omission' in options ? baseToString(options.omission) : omission;
  32602. }
  32603. string = toString(string);
  32604. var strLength = string.length;
  32605. if (hasUnicode(string)) {
  32606. var strSymbols = stringToArray(string);
  32607. strLength = strSymbols.length;
  32608. }
  32609. if (length >= strLength) {
  32610. return string;
  32611. }
  32612. var end = length - stringSize(omission);
  32613. if (end < 1) {
  32614. return omission;
  32615. }
  32616. var result = strSymbols
  32617. ? castSlice(strSymbols, 0, end).join('')
  32618. : string.slice(0, end);
  32619. if (separator === undefined) {
  32620. return result + omission;
  32621. }
  32622. if (strSymbols) {
  32623. end += (result.length - end);
  32624. }
  32625. if (isRegExp(separator)) {
  32626. if (string.slice(end).search(separator)) {
  32627. var match,
  32628. substring = result;
  32629. if (!separator.global) {
  32630. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  32631. }
  32632. separator.lastIndex = 0;
  32633. while ((match = separator.exec(substring))) {
  32634. var newEnd = match.index;
  32635. }
  32636. result = result.slice(0, newEnd === undefined ? end : newEnd);
  32637. }
  32638. } else if (string.indexOf(baseToString(separator), end) != end) {
  32639. var index = result.lastIndexOf(separator);
  32640. if (index > -1) {
  32641. result = result.slice(0, index);
  32642. }
  32643. }
  32644. return result + omission;
  32645. }
  32646. /**
  32647. * The inverse of `_.escape`; this method converts the HTML entities
  32648. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  32649. * their corresponding characters.
  32650. *
  32651. * **Note:** No other HTML entities are unescaped. To unescape additional
  32652. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  32653. *
  32654. * @static
  32655. * @memberOf _
  32656. * @since 0.6.0
  32657. * @category String
  32658. * @param {string} [string=''] The string to unescape.
  32659. * @returns {string} Returns the unescaped string.
  32660. * @example
  32661. *
  32662. * _.unescape('fred, barney, &amp; pebbles');
  32663. * // => 'fred, barney, & pebbles'
  32664. */
  32665. function unescape(string) {
  32666. string = toString(string);
  32667. return (string && reHasEscapedHtml.test(string))
  32668. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  32669. : string;
  32670. }
  32671. /**
  32672. * Converts `string`, as space separated words, to upper case.
  32673. *
  32674. * @static
  32675. * @memberOf _
  32676. * @since 4.0.0
  32677. * @category String
  32678. * @param {string} [string=''] The string to convert.
  32679. * @returns {string} Returns the upper cased string.
  32680. * @example
  32681. *
  32682. * _.upperCase('--foo-bar');
  32683. * // => 'FOO BAR'
  32684. *
  32685. * _.upperCase('fooBar');
  32686. * // => 'FOO BAR'
  32687. *
  32688. * _.upperCase('__foo_bar__');
  32689. * // => 'FOO BAR'
  32690. */
  32691. var upperCase = createCompounder(function(result, word, index) {
  32692. return result + (index ? ' ' : '') + word.toUpperCase();
  32693. });
  32694. /**
  32695. * Converts the first character of `string` to upper case.
  32696. *
  32697. * @static
  32698. * @memberOf _
  32699. * @since 4.0.0
  32700. * @category String
  32701. * @param {string} [string=''] The string to convert.
  32702. * @returns {string} Returns the converted string.
  32703. * @example
  32704. *
  32705. * _.upperFirst('fred');
  32706. * // => 'Fred'
  32707. *
  32708. * _.upperFirst('FRED');
  32709. * // => 'FRED'
  32710. */
  32711. var upperFirst = createCaseFirst('toUpperCase');
  32712. /**
  32713. * Splits `string` into an array of its words.
  32714. *
  32715. * @static
  32716. * @memberOf _
  32717. * @since 3.0.0
  32718. * @category String
  32719. * @param {string} [string=''] The string to inspect.
  32720. * @param {RegExp|string} [pattern] The pattern to match words.
  32721. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32722. * @returns {Array} Returns the words of `string`.
  32723. * @example
  32724. *
  32725. * _.words('fred, barney, & pebbles');
  32726. * // => ['fred', 'barney', 'pebbles']
  32727. *
  32728. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  32729. * // => ['fred', 'barney', '&', 'pebbles']
  32730. */
  32731. function words(string, pattern, guard) {
  32732. string = toString(string);
  32733. pattern = guard ? undefined : pattern;
  32734. if (pattern === undefined) {
  32735. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  32736. }
  32737. return string.match(pattern) || [];
  32738. }
  32739. /*------------------------------------------------------------------------*/
  32740. /**
  32741. * Attempts to invoke `func`, returning either the result or the caught error
  32742. * object. Any additional arguments are provided to `func` when it's invoked.
  32743. *
  32744. * @static
  32745. * @memberOf _
  32746. * @since 3.0.0
  32747. * @category Util
  32748. * @param {Function} func The function to attempt.
  32749. * @param {...*} [args] The arguments to invoke `func` with.
  32750. * @returns {*} Returns the `func` result or error object.
  32751. * @example
  32752. *
  32753. * // Avoid throwing errors for invalid selectors.
  32754. * var elements = _.attempt(function(selector) {
  32755. * return document.querySelectorAll(selector);
  32756. * }, '>_>');
  32757. *
  32758. * if (_.isError(elements)) {
  32759. * elements = [];
  32760. * }
  32761. */
  32762. var attempt = baseRest(function(func, args) {
  32763. try {
  32764. return apply(func, undefined, args);
  32765. } catch (e) {
  32766. return isError(e) ? e : new Error(e);
  32767. }
  32768. });
  32769. /**
  32770. * Binds methods of an object to the object itself, overwriting the existing
  32771. * method.
  32772. *
  32773. * **Note:** This method doesn't set the "length" property of bound functions.
  32774. *
  32775. * @static
  32776. * @since 0.1.0
  32777. * @memberOf _
  32778. * @category Util
  32779. * @param {Object} object The object to bind and assign the bound methods to.
  32780. * @param {...(string|string[])} methodNames The object method names to bind.
  32781. * @returns {Object} Returns `object`.
  32782. * @example
  32783. *
  32784. * var view = {
  32785. * 'label': 'docs',
  32786. * 'click': function() {
  32787. * console.log('clicked ' + this.label);
  32788. * }
  32789. * };
  32790. *
  32791. * _.bindAll(view, ['click']);
  32792. * jQuery(element).on('click', view.click);
  32793. * // => Logs 'clicked docs' when clicked.
  32794. */
  32795. var bindAll = flatRest(function(object, methodNames) {
  32796. arrayEach(methodNames, function(key) {
  32797. key = toKey(key);
  32798. baseAssignValue(object, key, bind(object[key], object));
  32799. });
  32800. return object;
  32801. });
  32802. /**
  32803. * Creates a function that iterates over `pairs` and invokes the corresponding
  32804. * function of the first predicate to return truthy. The predicate-function
  32805. * pairs are invoked with the `this` binding and arguments of the created
  32806. * function.
  32807. *
  32808. * @static
  32809. * @memberOf _
  32810. * @since 4.0.0
  32811. * @category Util
  32812. * @param {Array} pairs The predicate-function pairs.
  32813. * @returns {Function} Returns the new composite function.
  32814. * @example
  32815. *
  32816. * var func = _.cond([
  32817. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  32818. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  32819. * [_.stubTrue, _.constant('no match')]
  32820. * ]);
  32821. *
  32822. * func({ 'a': 1, 'b': 2 });
  32823. * // => 'matches A'
  32824. *
  32825. * func({ 'a': 0, 'b': 1 });
  32826. * // => 'matches B'
  32827. *
  32828. * func({ 'a': '1', 'b': '2' });
  32829. * // => 'no match'
  32830. */
  32831. function cond(pairs) {
  32832. var length = pairs == null ? 0 : pairs.length,
  32833. toIteratee = getIteratee();
  32834. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  32835. if (typeof pair[1] != 'function') {
  32836. throw new TypeError(FUNC_ERROR_TEXT);
  32837. }
  32838. return [toIteratee(pair[0]), pair[1]];
  32839. });
  32840. return baseRest(function(args) {
  32841. var index = -1;
  32842. while (++index < length) {
  32843. var pair = pairs[index];
  32844. if (apply(pair[0], this, args)) {
  32845. return apply(pair[1], this, args);
  32846. }
  32847. }
  32848. });
  32849. }
  32850. /**
  32851. * Creates a function that invokes the predicate properties of `source` with
  32852. * the corresponding property values of a given object, returning `true` if
  32853. * all predicates return truthy, else `false`.
  32854. *
  32855. * **Note:** The created function is equivalent to `_.conformsTo` with
  32856. * `source` partially applied.
  32857. *
  32858. * @static
  32859. * @memberOf _
  32860. * @since 4.0.0
  32861. * @category Util
  32862. * @param {Object} source The object of property predicates to conform to.
  32863. * @returns {Function} Returns the new spec function.
  32864. * @example
  32865. *
  32866. * var objects = [
  32867. * { 'a': 2, 'b': 1 },
  32868. * { 'a': 1, 'b': 2 }
  32869. * ];
  32870. *
  32871. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  32872. * // => [{ 'a': 1, 'b': 2 }]
  32873. */
  32874. function conforms(source) {
  32875. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  32876. }
  32877. /**
  32878. * Creates a function that returns `value`.
  32879. *
  32880. * @static
  32881. * @memberOf _
  32882. * @since 2.4.0
  32883. * @category Util
  32884. * @param {*} value The value to return from the new function.
  32885. * @returns {Function} Returns the new constant function.
  32886. * @example
  32887. *
  32888. * var objects = _.times(2, _.constant({ 'a': 1 }));
  32889. *
  32890. * console.log(objects);
  32891. * // => [{ 'a': 1 }, { 'a': 1 }]
  32892. *
  32893. * console.log(objects[0] === objects[1]);
  32894. * // => true
  32895. */
  32896. function constant(value) {
  32897. return function() {
  32898. return value;
  32899. };
  32900. }
  32901. /**
  32902. * Checks `value` to determine whether a default value should be returned in
  32903. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  32904. * or `undefined`.
  32905. *
  32906. * @static
  32907. * @memberOf _
  32908. * @since 4.14.0
  32909. * @category Util
  32910. * @param {*} value The value to check.
  32911. * @param {*} defaultValue The default value.
  32912. * @returns {*} Returns the resolved value.
  32913. * @example
  32914. *
  32915. * _.defaultTo(1, 10);
  32916. * // => 1
  32917. *
  32918. * _.defaultTo(undefined, 10);
  32919. * // => 10
  32920. */
  32921. function defaultTo(value, defaultValue) {
  32922. return (value == null || value !== value) ? defaultValue : value;
  32923. }
  32924. /**
  32925. * Creates a function that returns the result of invoking the given functions
  32926. * with the `this` binding of the created function, where each successive
  32927. * invocation is supplied the return value of the previous.
  32928. *
  32929. * @static
  32930. * @memberOf _
  32931. * @since 3.0.0
  32932. * @category Util
  32933. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  32934. * @returns {Function} Returns the new composite function.
  32935. * @see _.flowRight
  32936. * @example
  32937. *
  32938. * function square(n) {
  32939. * return n * n;
  32940. * }
  32941. *
  32942. * var addSquare = _.flow([_.add, square]);
  32943. * addSquare(1, 2);
  32944. * // => 9
  32945. */
  32946. var flow = createFlow();
  32947. /**
  32948. * This method is like `_.flow` except that it creates a function that
  32949. * invokes the given functions from right to left.
  32950. *
  32951. * @static
  32952. * @since 3.0.0
  32953. * @memberOf _
  32954. * @category Util
  32955. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  32956. * @returns {Function} Returns the new composite function.
  32957. * @see _.flow
  32958. * @example
  32959. *
  32960. * function square(n) {
  32961. * return n * n;
  32962. * }
  32963. *
  32964. * var addSquare = _.flowRight([square, _.add]);
  32965. * addSquare(1, 2);
  32966. * // => 9
  32967. */
  32968. var flowRight = createFlow(true);
  32969. /**
  32970. * This method returns the first argument it receives.
  32971. *
  32972. * @static
  32973. * @since 0.1.0
  32974. * @memberOf _
  32975. * @category Util
  32976. * @param {*} value Any value.
  32977. * @returns {*} Returns `value`.
  32978. * @example
  32979. *
  32980. * var object = { 'a': 1 };
  32981. *
  32982. * console.log(_.identity(object) === object);
  32983. * // => true
  32984. */
  32985. function identity(value) {
  32986. return value;
  32987. }
  32988. /**
  32989. * Creates a function that invokes `func` with the arguments of the created
  32990. * function. If `func` is a property name, the created function returns the
  32991. * property value for a given element. If `func` is an array or object, the
  32992. * created function returns `true` for elements that contain the equivalent
  32993. * source properties, otherwise it returns `false`.
  32994. *
  32995. * @static
  32996. * @since 4.0.0
  32997. * @memberOf _
  32998. * @category Util
  32999. * @param {*} [func=_.identity] The value to convert to a callback.
  33000. * @returns {Function} Returns the callback.
  33001. * @example
  33002. *
  33003. * var users = [
  33004. * { 'user': 'barney', 'age': 36, 'active': true },
  33005. * { 'user': 'fred', 'age': 40, 'active': false }
  33006. * ];
  33007. *
  33008. * // The `_.matches` iteratee shorthand.
  33009. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  33010. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  33011. *
  33012. * // The `_.matchesProperty` iteratee shorthand.
  33013. * _.filter(users, _.iteratee(['user', 'fred']));
  33014. * // => [{ 'user': 'fred', 'age': 40 }]
  33015. *
  33016. * // The `_.property` iteratee shorthand.
  33017. * _.map(users, _.iteratee('user'));
  33018. * // => ['barney', 'fred']
  33019. *
  33020. * // Create custom iteratee shorthands.
  33021. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  33022. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  33023. * return func.test(string);
  33024. * };
  33025. * });
  33026. *
  33027. * _.filter(['abc', 'def'], /ef/);
  33028. * // => ['def']
  33029. */
  33030. function iteratee(func) {
  33031. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  33032. }
  33033. /**
  33034. * Creates a function that performs a partial deep comparison between a given
  33035. * object and `source`, returning `true` if the given object has equivalent
  33036. * property values, else `false`.
  33037. *
  33038. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  33039. * partially applied.
  33040. *
  33041. * Partial comparisons will match empty array and empty object `source`
  33042. * values against any array or object value, respectively. See `_.isEqual`
  33043. * for a list of supported value comparisons.
  33044. *
  33045. * @static
  33046. * @memberOf _
  33047. * @since 3.0.0
  33048. * @category Util
  33049. * @param {Object} source The object of property values to match.
  33050. * @returns {Function} Returns the new spec function.
  33051. * @example
  33052. *
  33053. * var objects = [
  33054. * { 'a': 1, 'b': 2, 'c': 3 },
  33055. * { 'a': 4, 'b': 5, 'c': 6 }
  33056. * ];
  33057. *
  33058. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  33059. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  33060. */
  33061. function matches(source) {
  33062. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  33063. }
  33064. /**
  33065. * Creates a function that performs a partial deep comparison between the
  33066. * value at `path` of a given object to `srcValue`, returning `true` if the
  33067. * object value is equivalent, else `false`.
  33068. *
  33069. * **Note:** Partial comparisons will match empty array and empty object
  33070. * `srcValue` values against any array or object value, respectively. See
  33071. * `_.isEqual` for a list of supported value comparisons.
  33072. *
  33073. * @static
  33074. * @memberOf _
  33075. * @since 3.2.0
  33076. * @category Util
  33077. * @param {Array|string} path The path of the property to get.
  33078. * @param {*} srcValue The value to match.
  33079. * @returns {Function} Returns the new spec function.
  33080. * @example
  33081. *
  33082. * var objects = [
  33083. * { 'a': 1, 'b': 2, 'c': 3 },
  33084. * { 'a': 4, 'b': 5, 'c': 6 }
  33085. * ];
  33086. *
  33087. * _.find(objects, _.matchesProperty('a', 4));
  33088. * // => { 'a': 4, 'b': 5, 'c': 6 }
  33089. */
  33090. function matchesProperty(path, srcValue) {
  33091. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  33092. }
  33093. /**
  33094. * Creates a function that invokes the method at `path` of a given object.
  33095. * Any additional arguments are provided to the invoked method.
  33096. *
  33097. * @static
  33098. * @memberOf _
  33099. * @since 3.7.0
  33100. * @category Util
  33101. * @param {Array|string} path The path of the method to invoke.
  33102. * @param {...*} [args] The arguments to invoke the method with.
  33103. * @returns {Function} Returns the new invoker function.
  33104. * @example
  33105. *
  33106. * var objects = [
  33107. * { 'a': { 'b': _.constant(2) } },
  33108. * { 'a': { 'b': _.constant(1) } }
  33109. * ];
  33110. *
  33111. * _.map(objects, _.method('a.b'));
  33112. * // => [2, 1]
  33113. *
  33114. * _.map(objects, _.method(['a', 'b']));
  33115. * // => [2, 1]
  33116. */
  33117. var method = baseRest(function(path, args) {
  33118. return function(object) {
  33119. return baseInvoke(object, path, args);
  33120. };
  33121. });
  33122. /**
  33123. * The opposite of `_.method`; this method creates a function that invokes
  33124. * the method at a given path of `object`. Any additional arguments are
  33125. * provided to the invoked method.
  33126. *
  33127. * @static
  33128. * @memberOf _
  33129. * @since 3.7.0
  33130. * @category Util
  33131. * @param {Object} object The object to query.
  33132. * @param {...*} [args] The arguments to invoke the method with.
  33133. * @returns {Function} Returns the new invoker function.
  33134. * @example
  33135. *
  33136. * var array = _.times(3, _.constant),
  33137. * object = { 'a': array, 'b': array, 'c': array };
  33138. *
  33139. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  33140. * // => [2, 0]
  33141. *
  33142. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  33143. * // => [2, 0]
  33144. */
  33145. var methodOf = baseRest(function(object, args) {
  33146. return function(path) {
  33147. return baseInvoke(object, path, args);
  33148. };
  33149. });
  33150. /**
  33151. * Adds all own enumerable string keyed function properties of a source
  33152. * object to the destination object. If `object` is a function, then methods
  33153. * are added to its prototype as well.
  33154. *
  33155. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  33156. * avoid conflicts caused by modifying the original.
  33157. *
  33158. * @static
  33159. * @since 0.1.0
  33160. * @memberOf _
  33161. * @category Util
  33162. * @param {Function|Object} [object=lodash] The destination object.
  33163. * @param {Object} source The object of functions to add.
  33164. * @param {Object} [options={}] The options object.
  33165. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  33166. * @returns {Function|Object} Returns `object`.
  33167. * @example
  33168. *
  33169. * function vowels(string) {
  33170. * return _.filter(string, function(v) {
  33171. * return /[aeiou]/i.test(v);
  33172. * });
  33173. * }
  33174. *
  33175. * _.mixin({ 'vowels': vowels });
  33176. * _.vowels('fred');
  33177. * // => ['e']
  33178. *
  33179. * _('fred').vowels().value();
  33180. * // => ['e']
  33181. *
  33182. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  33183. * _('fred').vowels();
  33184. * // => ['e']
  33185. */
  33186. function mixin(object, source, options) {
  33187. var props = keys(source),
  33188. methodNames = baseFunctions(source, props);
  33189. if (options == null &&
  33190. !(isObject(source) && (methodNames.length || !props.length))) {
  33191. options = source;
  33192. source = object;
  33193. object = this;
  33194. methodNames = baseFunctions(source, keys(source));
  33195. }
  33196. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  33197. isFunc = isFunction(object);
  33198. arrayEach(methodNames, function(methodName) {
  33199. var func = source[methodName];
  33200. object[methodName] = func;
  33201. if (isFunc) {
  33202. object.prototype[methodName] = function() {
  33203. var chainAll = this.__chain__;
  33204. if (chain || chainAll) {
  33205. var result = object(this.__wrapped__),
  33206. actions = result.__actions__ = copyArray(this.__actions__);
  33207. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  33208. result.__chain__ = chainAll;
  33209. return result;
  33210. }
  33211. return func.apply(object, arrayPush([this.value()], arguments));
  33212. };
  33213. }
  33214. });
  33215. return object;
  33216. }
  33217. /**
  33218. * Reverts the `_` variable to its previous value and returns a reference to
  33219. * the `lodash` function.
  33220. *
  33221. * @static
  33222. * @since 0.1.0
  33223. * @memberOf _
  33224. * @category Util
  33225. * @returns {Function} Returns the `lodash` function.
  33226. * @example
  33227. *
  33228. * var lodash = _.noConflict();
  33229. */
  33230. function noConflict() {
  33231. if (root._ === this) {
  33232. root._ = oldDash;
  33233. }
  33234. return this;
  33235. }
  33236. /**
  33237. * This method returns `undefined`.
  33238. *
  33239. * @static
  33240. * @memberOf _
  33241. * @since 2.3.0
  33242. * @category Util
  33243. * @example
  33244. *
  33245. * _.times(2, _.noop);
  33246. * // => [undefined, undefined]
  33247. */
  33248. function noop() {
  33249. // No operation performed.
  33250. }
  33251. /**
  33252. * Creates a function that gets the argument at index `n`. If `n` is negative,
  33253. * the nth argument from the end is returned.
  33254. *
  33255. * @static
  33256. * @memberOf _
  33257. * @since 4.0.0
  33258. * @category Util
  33259. * @param {number} [n=0] The index of the argument to return.
  33260. * @returns {Function} Returns the new pass-thru function.
  33261. * @example
  33262. *
  33263. * var func = _.nthArg(1);
  33264. * func('a', 'b', 'c', 'd');
  33265. * // => 'b'
  33266. *
  33267. * var func = _.nthArg(-2);
  33268. * func('a', 'b', 'c', 'd');
  33269. * // => 'c'
  33270. */
  33271. function nthArg(n) {
  33272. n = toInteger(n);
  33273. return baseRest(function(args) {
  33274. return baseNth(args, n);
  33275. });
  33276. }
  33277. /**
  33278. * Creates a function that invokes `iteratees` with the arguments it receives
  33279. * and returns their results.
  33280. *
  33281. * @static
  33282. * @memberOf _
  33283. * @since 4.0.0
  33284. * @category Util
  33285. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  33286. * The iteratees to invoke.
  33287. * @returns {Function} Returns the new function.
  33288. * @example
  33289. *
  33290. * var func = _.over([Math.max, Math.min]);
  33291. *
  33292. * func(1, 2, 3, 4);
  33293. * // => [4, 1]
  33294. */
  33295. var over = createOver(arrayMap);
  33296. /**
  33297. * Creates a function that checks if **all** of the `predicates` return
  33298. * truthy when invoked with the arguments it receives.
  33299. *
  33300. * @static
  33301. * @memberOf _
  33302. * @since 4.0.0
  33303. * @category Util
  33304. * @param {...(Function|Function[])} [predicates=[_.identity]]
  33305. * The predicates to check.
  33306. * @returns {Function} Returns the new function.
  33307. * @example
  33308. *
  33309. * var func = _.overEvery([Boolean, isFinite]);
  33310. *
  33311. * func('1');
  33312. * // => true
  33313. *
  33314. * func(null);
  33315. * // => false
  33316. *
  33317. * func(NaN);
  33318. * // => false
  33319. */
  33320. var overEvery = createOver(arrayEvery);
  33321. /**
  33322. * Creates a function that checks if **any** of the `predicates` return
  33323. * truthy when invoked with the arguments it receives.
  33324. *
  33325. * @static
  33326. * @memberOf _
  33327. * @since 4.0.0
  33328. * @category Util
  33329. * @param {...(Function|Function[])} [predicates=[_.identity]]
  33330. * The predicates to check.
  33331. * @returns {Function} Returns the new function.
  33332. * @example
  33333. *
  33334. * var func = _.overSome([Boolean, isFinite]);
  33335. *
  33336. * func('1');
  33337. * // => true
  33338. *
  33339. * func(null);
  33340. * // => true
  33341. *
  33342. * func(NaN);
  33343. * // => false
  33344. */
  33345. var overSome = createOver(arraySome);
  33346. /**
  33347. * Creates a function that returns the value at `path` of a given object.
  33348. *
  33349. * @static
  33350. * @memberOf _
  33351. * @since 2.4.0
  33352. * @category Util
  33353. * @param {Array|string} path The path of the property to get.
  33354. * @returns {Function} Returns the new accessor function.
  33355. * @example
  33356. *
  33357. * var objects = [
  33358. * { 'a': { 'b': 2 } },
  33359. * { 'a': { 'b': 1 } }
  33360. * ];
  33361. *
  33362. * _.map(objects, _.property('a.b'));
  33363. * // => [2, 1]
  33364. *
  33365. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  33366. * // => [1, 2]
  33367. */
  33368. function property(path) {
  33369. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  33370. }
  33371. /**
  33372. * The opposite of `_.property`; this method creates a function that returns
  33373. * the value at a given path of `object`.
  33374. *
  33375. * @static
  33376. * @memberOf _
  33377. * @since 3.0.0
  33378. * @category Util
  33379. * @param {Object} object The object to query.
  33380. * @returns {Function} Returns the new accessor function.
  33381. * @example
  33382. *
  33383. * var array = [0, 1, 2],
  33384. * object = { 'a': array, 'b': array, 'c': array };
  33385. *
  33386. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  33387. * // => [2, 0]
  33388. *
  33389. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  33390. * // => [2, 0]
  33391. */
  33392. function propertyOf(object) {
  33393. return function(path) {
  33394. return object == null ? undefined : baseGet(object, path);
  33395. };
  33396. }
  33397. /**
  33398. * Creates an array of numbers (positive and/or negative) progressing from
  33399. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  33400. * `start` is specified without an `end` or `step`. If `end` is not specified,
  33401. * it's set to `start` with `start` then set to `0`.
  33402. *
  33403. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  33404. * floating-point values which can produce unexpected results.
  33405. *
  33406. * @static
  33407. * @since 0.1.0
  33408. * @memberOf _
  33409. * @category Util
  33410. * @param {number} [start=0] The start of the range.
  33411. * @param {number} end The end of the range.
  33412. * @param {number} [step=1] The value to increment or decrement by.
  33413. * @returns {Array} Returns the range of numbers.
  33414. * @see _.inRange, _.rangeRight
  33415. * @example
  33416. *
  33417. * _.range(4);
  33418. * // => [0, 1, 2, 3]
  33419. *
  33420. * _.range(-4);
  33421. * // => [0, -1, -2, -3]
  33422. *
  33423. * _.range(1, 5);
  33424. * // => [1, 2, 3, 4]
  33425. *
  33426. * _.range(0, 20, 5);
  33427. * // => [0, 5, 10, 15]
  33428. *
  33429. * _.range(0, -4, -1);
  33430. * // => [0, -1, -2, -3]
  33431. *
  33432. * _.range(1, 4, 0);
  33433. * // => [1, 1, 1]
  33434. *
  33435. * _.range(0);
  33436. * // => []
  33437. */
  33438. var range = createRange();
  33439. /**
  33440. * This method is like `_.range` except that it populates values in
  33441. * descending order.
  33442. *
  33443. * @static
  33444. * @memberOf _
  33445. * @since 4.0.0
  33446. * @category Util
  33447. * @param {number} [start=0] The start of the range.
  33448. * @param {number} end The end of the range.
  33449. * @param {number} [step=1] The value to increment or decrement by.
  33450. * @returns {Array} Returns the range of numbers.
  33451. * @see _.inRange, _.range
  33452. * @example
  33453. *
  33454. * _.rangeRight(4);
  33455. * // => [3, 2, 1, 0]
  33456. *
  33457. * _.rangeRight(-4);
  33458. * // => [-3, -2, -1, 0]
  33459. *
  33460. * _.rangeRight(1, 5);
  33461. * // => [4, 3, 2, 1]
  33462. *
  33463. * _.rangeRight(0, 20, 5);
  33464. * // => [15, 10, 5, 0]
  33465. *
  33466. * _.rangeRight(0, -4, -1);
  33467. * // => [-3, -2, -1, 0]
  33468. *
  33469. * _.rangeRight(1, 4, 0);
  33470. * // => [1, 1, 1]
  33471. *
  33472. * _.rangeRight(0);
  33473. * // => []
  33474. */
  33475. var rangeRight = createRange(true);
  33476. /**
  33477. * This method returns a new empty array.
  33478. *
  33479. * @static
  33480. * @memberOf _
  33481. * @since 4.13.0
  33482. * @category Util
  33483. * @returns {Array} Returns the new empty array.
  33484. * @example
  33485. *
  33486. * var arrays = _.times(2, _.stubArray);
  33487. *
  33488. * console.log(arrays);
  33489. * // => [[], []]
  33490. *
  33491. * console.log(arrays[0] === arrays[1]);
  33492. * // => false
  33493. */
  33494. function stubArray() {
  33495. return [];
  33496. }
  33497. /**
  33498. * This method returns `false`.
  33499. *
  33500. * @static
  33501. * @memberOf _
  33502. * @since 4.13.0
  33503. * @category Util
  33504. * @returns {boolean} Returns `false`.
  33505. * @example
  33506. *
  33507. * _.times(2, _.stubFalse);
  33508. * // => [false, false]
  33509. */
  33510. function stubFalse() {
  33511. return false;
  33512. }
  33513. /**
  33514. * This method returns a new empty object.
  33515. *
  33516. * @static
  33517. * @memberOf _
  33518. * @since 4.13.0
  33519. * @category Util
  33520. * @returns {Object} Returns the new empty object.
  33521. * @example
  33522. *
  33523. * var objects = _.times(2, _.stubObject);
  33524. *
  33525. * console.log(objects);
  33526. * // => [{}, {}]
  33527. *
  33528. * console.log(objects[0] === objects[1]);
  33529. * // => false
  33530. */
  33531. function stubObject() {
  33532. return {};
  33533. }
  33534. /**
  33535. * This method returns an empty string.
  33536. *
  33537. * @static
  33538. * @memberOf _
  33539. * @since 4.13.0
  33540. * @category Util
  33541. * @returns {string} Returns the empty string.
  33542. * @example
  33543. *
  33544. * _.times(2, _.stubString);
  33545. * // => ['', '']
  33546. */
  33547. function stubString() {
  33548. return '';
  33549. }
  33550. /**
  33551. * This method returns `true`.
  33552. *
  33553. * @static
  33554. * @memberOf _
  33555. * @since 4.13.0
  33556. * @category Util
  33557. * @returns {boolean} Returns `true`.
  33558. * @example
  33559. *
  33560. * _.times(2, _.stubTrue);
  33561. * // => [true, true]
  33562. */
  33563. function stubTrue() {
  33564. return true;
  33565. }
  33566. /**
  33567. * Invokes the iteratee `n` times, returning an array of the results of
  33568. * each invocation. The iteratee is invoked with one argument; (index).
  33569. *
  33570. * @static
  33571. * @since 0.1.0
  33572. * @memberOf _
  33573. * @category Util
  33574. * @param {number} n The number of times to invoke `iteratee`.
  33575. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  33576. * @returns {Array} Returns the array of results.
  33577. * @example
  33578. *
  33579. * _.times(3, String);
  33580. * // => ['0', '1', '2']
  33581. *
  33582. * _.times(4, _.constant(0));
  33583. * // => [0, 0, 0, 0]
  33584. */
  33585. function times(n, iteratee) {
  33586. n = toInteger(n);
  33587. if (n < 1 || n > MAX_SAFE_INTEGER) {
  33588. return [];
  33589. }
  33590. var index = MAX_ARRAY_LENGTH,
  33591. length = nativeMin(n, MAX_ARRAY_LENGTH);
  33592. iteratee = getIteratee(iteratee);
  33593. n -= MAX_ARRAY_LENGTH;
  33594. var result = baseTimes(length, iteratee);
  33595. while (++index < n) {
  33596. iteratee(index);
  33597. }
  33598. return result;
  33599. }
  33600. /**
  33601. * Converts `value` to a property path array.
  33602. *
  33603. * @static
  33604. * @memberOf _
  33605. * @since 4.0.0
  33606. * @category Util
  33607. * @param {*} value The value to convert.
  33608. * @returns {Array} Returns the new property path array.
  33609. * @example
  33610. *
  33611. * _.toPath('a.b.c');
  33612. * // => ['a', 'b', 'c']
  33613. *
  33614. * _.toPath('a[0].b.c');
  33615. * // => ['a', '0', 'b', 'c']
  33616. */
  33617. function toPath(value) {
  33618. if (isArray(value)) {
  33619. return arrayMap(value, toKey);
  33620. }
  33621. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  33622. }
  33623. /**
  33624. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  33625. *
  33626. * @static
  33627. * @since 0.1.0
  33628. * @memberOf _
  33629. * @category Util
  33630. * @param {string} [prefix=''] The value to prefix the ID with.
  33631. * @returns {string} Returns the unique ID.
  33632. * @example
  33633. *
  33634. * _.uniqueId('contact_');
  33635. * // => 'contact_104'
  33636. *
  33637. * _.uniqueId();
  33638. * // => '105'
  33639. */
  33640. function uniqueId(prefix) {
  33641. var id = ++idCounter;
  33642. return toString(prefix) + id;
  33643. }
  33644. /*------------------------------------------------------------------------*/
  33645. /**
  33646. * Adds two numbers.
  33647. *
  33648. * @static
  33649. * @memberOf _
  33650. * @since 3.4.0
  33651. * @category Math
  33652. * @param {number} augend The first number in an addition.
  33653. * @param {number} addend The second number in an addition.
  33654. * @returns {number} Returns the total.
  33655. * @example
  33656. *
  33657. * _.add(6, 4);
  33658. * // => 10
  33659. */
  33660. var add = createMathOperation(function(augend, addend) {
  33661. return augend + addend;
  33662. }, 0);
  33663. /**
  33664. * Computes `number` rounded up to `precision`.
  33665. *
  33666. * @static
  33667. * @memberOf _
  33668. * @since 3.10.0
  33669. * @category Math
  33670. * @param {number} number The number to round up.
  33671. * @param {number} [precision=0] The precision to round up to.
  33672. * @returns {number} Returns the rounded up number.
  33673. * @example
  33674. *
  33675. * _.ceil(4.006);
  33676. * // => 5
  33677. *
  33678. * _.ceil(6.004, 2);
  33679. * // => 6.01
  33680. *
  33681. * _.ceil(6040, -2);
  33682. * // => 6100
  33683. */
  33684. var ceil = createRound('ceil');
  33685. /**
  33686. * Divide two numbers.
  33687. *
  33688. * @static
  33689. * @memberOf _
  33690. * @since 4.7.0
  33691. * @category Math
  33692. * @param {number} dividend The first number in a division.
  33693. * @param {number} divisor The second number in a division.
  33694. * @returns {number} Returns the quotient.
  33695. * @example
  33696. *
  33697. * _.divide(6, 4);
  33698. * // => 1.5
  33699. */
  33700. var divide = createMathOperation(function(dividend, divisor) {
  33701. return dividend / divisor;
  33702. }, 1);
  33703. /**
  33704. * Computes `number` rounded down to `precision`.
  33705. *
  33706. * @static
  33707. * @memberOf _
  33708. * @since 3.10.0
  33709. * @category Math
  33710. * @param {number} number The number to round down.
  33711. * @param {number} [precision=0] The precision to round down to.
  33712. * @returns {number} Returns the rounded down number.
  33713. * @example
  33714. *
  33715. * _.floor(4.006);
  33716. * // => 4
  33717. *
  33718. * _.floor(0.046, 2);
  33719. * // => 0.04
  33720. *
  33721. * _.floor(4060, -2);
  33722. * // => 4000
  33723. */
  33724. var floor = createRound('floor');
  33725. /**
  33726. * Computes the maximum value of `array`. If `array` is empty or falsey,
  33727. * `undefined` is returned.
  33728. *
  33729. * @static
  33730. * @since 0.1.0
  33731. * @memberOf _
  33732. * @category Math
  33733. * @param {Array} array The array to iterate over.
  33734. * @returns {*} Returns the maximum value.
  33735. * @example
  33736. *
  33737. * _.max([4, 2, 8, 6]);
  33738. * // => 8
  33739. *
  33740. * _.max([]);
  33741. * // => undefined
  33742. */
  33743. function max(array) {
  33744. return (array && array.length)
  33745. ? baseExtremum(array, identity, baseGt)
  33746. : undefined;
  33747. }
  33748. /**
  33749. * This method is like `_.max` except that it accepts `iteratee` which is
  33750. * invoked for each element in `array` to generate the criterion by which
  33751. * the value is ranked. The iteratee is invoked with one argument: (value).
  33752. *
  33753. * @static
  33754. * @memberOf _
  33755. * @since 4.0.0
  33756. * @category Math
  33757. * @param {Array} array The array to iterate over.
  33758. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  33759. * @returns {*} Returns the maximum value.
  33760. * @example
  33761. *
  33762. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  33763. *
  33764. * _.maxBy(objects, function(o) { return o.n; });
  33765. * // => { 'n': 2 }
  33766. *
  33767. * // The `_.property` iteratee shorthand.
  33768. * _.maxBy(objects, 'n');
  33769. * // => { 'n': 2 }
  33770. */
  33771. function maxBy(array, iteratee) {
  33772. return (array && array.length)
  33773. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  33774. : undefined;
  33775. }
  33776. /**
  33777. * Computes the mean of the values in `array`.
  33778. *
  33779. * @static
  33780. * @memberOf _
  33781. * @since 4.0.0
  33782. * @category Math
  33783. * @param {Array} array The array to iterate over.
  33784. * @returns {number} Returns the mean.
  33785. * @example
  33786. *
  33787. * _.mean([4, 2, 8, 6]);
  33788. * // => 5
  33789. */
  33790. function mean(array) {
  33791. return baseMean(array, identity);
  33792. }
  33793. /**
  33794. * This method is like `_.mean` except that it accepts `iteratee` which is
  33795. * invoked for each element in `array` to generate the value to be averaged.
  33796. * The iteratee is invoked with one argument: (value).
  33797. *
  33798. * @static
  33799. * @memberOf _
  33800. * @since 4.7.0
  33801. * @category Math
  33802. * @param {Array} array The array to iterate over.
  33803. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  33804. * @returns {number} Returns the mean.
  33805. * @example
  33806. *
  33807. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  33808. *
  33809. * _.meanBy(objects, function(o) { return o.n; });
  33810. * // => 5
  33811. *
  33812. * // The `_.property` iteratee shorthand.
  33813. * _.meanBy(objects, 'n');
  33814. * // => 5
  33815. */
  33816. function meanBy(array, iteratee) {
  33817. return baseMean(array, getIteratee(iteratee, 2));
  33818. }
  33819. /**
  33820. * Computes the minimum value of `array`. If `array` is empty or falsey,
  33821. * `undefined` is returned.
  33822. *
  33823. * @static
  33824. * @since 0.1.0
  33825. * @memberOf _
  33826. * @category Math
  33827. * @param {Array} array The array to iterate over.
  33828. * @returns {*} Returns the minimum value.
  33829. * @example
  33830. *
  33831. * _.min([4, 2, 8, 6]);
  33832. * // => 2
  33833. *
  33834. * _.min([]);
  33835. * // => undefined
  33836. */
  33837. function min(array) {
  33838. return (array && array.length)
  33839. ? baseExtremum(array, identity, baseLt)
  33840. : undefined;
  33841. }
  33842. /**
  33843. * This method is like `_.min` except that it accepts `iteratee` which is
  33844. * invoked for each element in `array` to generate the criterion by which
  33845. * the value is ranked. The iteratee is invoked with one argument: (value).
  33846. *
  33847. * @static
  33848. * @memberOf _
  33849. * @since 4.0.0
  33850. * @category Math
  33851. * @param {Array} array The array to iterate over.
  33852. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  33853. * @returns {*} Returns the minimum value.
  33854. * @example
  33855. *
  33856. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  33857. *
  33858. * _.minBy(objects, function(o) { return o.n; });
  33859. * // => { 'n': 1 }
  33860. *
  33861. * // The `_.property` iteratee shorthand.
  33862. * _.minBy(objects, 'n');
  33863. * // => { 'n': 1 }
  33864. */
  33865. function minBy(array, iteratee) {
  33866. return (array && array.length)
  33867. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  33868. : undefined;
  33869. }
  33870. /**
  33871. * Multiply two numbers.
  33872. *
  33873. * @static
  33874. * @memberOf _
  33875. * @since 4.7.0
  33876. * @category Math
  33877. * @param {number} multiplier The first number in a multiplication.
  33878. * @param {number} multiplicand The second number in a multiplication.
  33879. * @returns {number} Returns the product.
  33880. * @example
  33881. *
  33882. * _.multiply(6, 4);
  33883. * // => 24
  33884. */
  33885. var multiply = createMathOperation(function(multiplier, multiplicand) {
  33886. return multiplier * multiplicand;
  33887. }, 1);
  33888. /**
  33889. * Computes `number` rounded to `precision`.
  33890. *
  33891. * @static
  33892. * @memberOf _
  33893. * @since 3.10.0
  33894. * @category Math
  33895. * @param {number} number The number to round.
  33896. * @param {number} [precision=0] The precision to round to.
  33897. * @returns {number} Returns the rounded number.
  33898. * @example
  33899. *
  33900. * _.round(4.006);
  33901. * // => 4
  33902. *
  33903. * _.round(4.006, 2);
  33904. * // => 4.01
  33905. *
  33906. * _.round(4060, -2);
  33907. * // => 4100
  33908. */
  33909. var round = createRound('round');
  33910. /**
  33911. * Subtract two numbers.
  33912. *
  33913. * @static
  33914. * @memberOf _
  33915. * @since 4.0.0
  33916. * @category Math
  33917. * @param {number} minuend The first number in a subtraction.
  33918. * @param {number} subtrahend The second number in a subtraction.
  33919. * @returns {number} Returns the difference.
  33920. * @example
  33921. *
  33922. * _.subtract(6, 4);
  33923. * // => 2
  33924. */
  33925. var subtract = createMathOperation(function(minuend, subtrahend) {
  33926. return minuend - subtrahend;
  33927. }, 0);
  33928. /**
  33929. * Computes the sum of the values in `array`.
  33930. *
  33931. * @static
  33932. * @memberOf _
  33933. * @since 3.4.0
  33934. * @category Math
  33935. * @param {Array} array The array to iterate over.
  33936. * @returns {number} Returns the sum.
  33937. * @example
  33938. *
  33939. * _.sum([4, 2, 8, 6]);
  33940. * // => 20
  33941. */
  33942. function sum(array) {
  33943. return (array && array.length)
  33944. ? baseSum(array, identity)
  33945. : 0;
  33946. }
  33947. /**
  33948. * This method is like `_.sum` except that it accepts `iteratee` which is
  33949. * invoked for each element in `array` to generate the value to be summed.
  33950. * The iteratee is invoked with one argument: (value).
  33951. *
  33952. * @static
  33953. * @memberOf _
  33954. * @since 4.0.0
  33955. * @category Math
  33956. * @param {Array} array The array to iterate over.
  33957. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  33958. * @returns {number} Returns the sum.
  33959. * @example
  33960. *
  33961. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  33962. *
  33963. * _.sumBy(objects, function(o) { return o.n; });
  33964. * // => 20
  33965. *
  33966. * // The `_.property` iteratee shorthand.
  33967. * _.sumBy(objects, 'n');
  33968. * // => 20
  33969. */
  33970. function sumBy(array, iteratee) {
  33971. return (array && array.length)
  33972. ? baseSum(array, getIteratee(iteratee, 2))
  33973. : 0;
  33974. }
  33975. /*------------------------------------------------------------------------*/
  33976. // Add methods that return wrapped values in chain sequences.
  33977. lodash.after = after;
  33978. lodash.ary = ary;
  33979. lodash.assign = assign;
  33980. lodash.assignIn = assignIn;
  33981. lodash.assignInWith = assignInWith;
  33982. lodash.assignWith = assignWith;
  33983. lodash.at = at;
  33984. lodash.before = before;
  33985. lodash.bind = bind;
  33986. lodash.bindAll = bindAll;
  33987. lodash.bindKey = bindKey;
  33988. lodash.castArray = castArray;
  33989. lodash.chain = chain;
  33990. lodash.chunk = chunk;
  33991. lodash.compact = compact;
  33992. lodash.concat = concat;
  33993. lodash.cond = cond;
  33994. lodash.conforms = conforms;
  33995. lodash.constant = constant;
  33996. lodash.countBy = countBy;
  33997. lodash.create = create;
  33998. lodash.curry = curry;
  33999. lodash.curryRight = curryRight;
  34000. lodash.debounce = debounce;
  34001. lodash.defaults = defaults;
  34002. lodash.defaultsDeep = defaultsDeep;
  34003. lodash.defer = defer;
  34004. lodash.delay = delay;
  34005. lodash.difference = difference;
  34006. lodash.differenceBy = differenceBy;
  34007. lodash.differenceWith = differenceWith;
  34008. lodash.drop = drop;
  34009. lodash.dropRight = dropRight;
  34010. lodash.dropRightWhile = dropRightWhile;
  34011. lodash.dropWhile = dropWhile;
  34012. lodash.fill = fill;
  34013. lodash.filter = filter;
  34014. lodash.flatMap = flatMap;
  34015. lodash.flatMapDeep = flatMapDeep;
  34016. lodash.flatMapDepth = flatMapDepth;
  34017. lodash.flatten = flatten;
  34018. lodash.flattenDeep = flattenDeep;
  34019. lodash.flattenDepth = flattenDepth;
  34020. lodash.flip = flip;
  34021. lodash.flow = flow;
  34022. lodash.flowRight = flowRight;
  34023. lodash.fromPairs = fromPairs;
  34024. lodash.functions = functions;
  34025. lodash.functionsIn = functionsIn;
  34026. lodash.groupBy = groupBy;
  34027. lodash.initial = initial;
  34028. lodash.intersection = intersection;
  34029. lodash.intersectionBy = intersectionBy;
  34030. lodash.intersectionWith = intersectionWith;
  34031. lodash.invert = invert;
  34032. lodash.invertBy = invertBy;
  34033. lodash.invokeMap = invokeMap;
  34034. lodash.iteratee = iteratee;
  34035. lodash.keyBy = keyBy;
  34036. lodash.keys = keys;
  34037. lodash.keysIn = keysIn;
  34038. lodash.map = map;
  34039. lodash.mapKeys = mapKeys;
  34040. lodash.mapValues = mapValues;
  34041. lodash.matches = matches;
  34042. lodash.matchesProperty = matchesProperty;
  34043. lodash.memoize = memoize;
  34044. lodash.merge = merge;
  34045. lodash.mergeWith = mergeWith;
  34046. lodash.method = method;
  34047. lodash.methodOf = methodOf;
  34048. lodash.mixin = mixin;
  34049. lodash.negate = negate;
  34050. lodash.nthArg = nthArg;
  34051. lodash.omit = omit;
  34052. lodash.omitBy = omitBy;
  34053. lodash.once = once;
  34054. lodash.orderBy = orderBy;
  34055. lodash.over = over;
  34056. lodash.overArgs = overArgs;
  34057. lodash.overEvery = overEvery;
  34058. lodash.overSome = overSome;
  34059. lodash.partial = partial;
  34060. lodash.partialRight = partialRight;
  34061. lodash.partition = partition;
  34062. lodash.pick = pick;
  34063. lodash.pickBy = pickBy;
  34064. lodash.property = property;
  34065. lodash.propertyOf = propertyOf;
  34066. lodash.pull = pull;
  34067. lodash.pullAll = pullAll;
  34068. lodash.pullAllBy = pullAllBy;
  34069. lodash.pullAllWith = pullAllWith;
  34070. lodash.pullAt = pullAt;
  34071. lodash.range = range;
  34072. lodash.rangeRight = rangeRight;
  34073. lodash.rearg = rearg;
  34074. lodash.reject = reject;
  34075. lodash.remove = remove;
  34076. lodash.rest = rest;
  34077. lodash.reverse = reverse;
  34078. lodash.sampleSize = sampleSize;
  34079. lodash.set = set;
  34080. lodash.setWith = setWith;
  34081. lodash.shuffle = shuffle;
  34082. lodash.slice = slice;
  34083. lodash.sortBy = sortBy;
  34084. lodash.sortedUniq = sortedUniq;
  34085. lodash.sortedUniqBy = sortedUniqBy;
  34086. lodash.split = split;
  34087. lodash.spread = spread;
  34088. lodash.tail = tail;
  34089. lodash.take = take;
  34090. lodash.takeRight = takeRight;
  34091. lodash.takeRightWhile = takeRightWhile;
  34092. lodash.takeWhile = takeWhile;
  34093. lodash.tap = tap;
  34094. lodash.throttle = throttle;
  34095. lodash.thru = thru;
  34096. lodash.toArray = toArray;
  34097. lodash.toPairs = toPairs;
  34098. lodash.toPairsIn = toPairsIn;
  34099. lodash.toPath = toPath;
  34100. lodash.toPlainObject = toPlainObject;
  34101. lodash.transform = transform;
  34102. lodash.unary = unary;
  34103. lodash.union = union;
  34104. lodash.unionBy = unionBy;
  34105. lodash.unionWith = unionWith;
  34106. lodash.uniq = uniq;
  34107. lodash.uniqBy = uniqBy;
  34108. lodash.uniqWith = uniqWith;
  34109. lodash.unset = unset;
  34110. lodash.unzip = unzip;
  34111. lodash.unzipWith = unzipWith;
  34112. lodash.update = update;
  34113. lodash.updateWith = updateWith;
  34114. lodash.values = values;
  34115. lodash.valuesIn = valuesIn;
  34116. lodash.without = without;
  34117. lodash.words = words;
  34118. lodash.wrap = wrap;
  34119. lodash.xor = xor;
  34120. lodash.xorBy = xorBy;
  34121. lodash.xorWith = xorWith;
  34122. lodash.zip = zip;
  34123. lodash.zipObject = zipObject;
  34124. lodash.zipObjectDeep = zipObjectDeep;
  34125. lodash.zipWith = zipWith;
  34126. // Add aliases.
  34127. lodash.entries = toPairs;
  34128. lodash.entriesIn = toPairsIn;
  34129. lodash.extend = assignIn;
  34130. lodash.extendWith = assignInWith;
  34131. // Add methods to `lodash.prototype`.
  34132. mixin(lodash, lodash);
  34133. /*------------------------------------------------------------------------*/
  34134. // Add methods that return unwrapped values in chain sequences.
  34135. lodash.add = add;
  34136. lodash.attempt = attempt;
  34137. lodash.camelCase = camelCase;
  34138. lodash.capitalize = capitalize;
  34139. lodash.ceil = ceil;
  34140. lodash.clamp = clamp;
  34141. lodash.clone = clone;
  34142. lodash.cloneDeep = cloneDeep;
  34143. lodash.cloneDeepWith = cloneDeepWith;
  34144. lodash.cloneWith = cloneWith;
  34145. lodash.conformsTo = conformsTo;
  34146. lodash.deburr = deburr;
  34147. lodash.defaultTo = defaultTo;
  34148. lodash.divide = divide;
  34149. lodash.endsWith = endsWith;
  34150. lodash.eq = eq;
  34151. lodash.escape = escape;
  34152. lodash.escapeRegExp = escapeRegExp;
  34153. lodash.every = every;
  34154. lodash.find = find;
  34155. lodash.findIndex = findIndex;
  34156. lodash.findKey = findKey;
  34157. lodash.findLast = findLast;
  34158. lodash.findLastIndex = findLastIndex;
  34159. lodash.findLastKey = findLastKey;
  34160. lodash.floor = floor;
  34161. lodash.forEach = forEach;
  34162. lodash.forEachRight = forEachRight;
  34163. lodash.forIn = forIn;
  34164. lodash.forInRight = forInRight;
  34165. lodash.forOwn = forOwn;
  34166. lodash.forOwnRight = forOwnRight;
  34167. lodash.get = get;
  34168. lodash.gt = gt;
  34169. lodash.gte = gte;
  34170. lodash.has = has;
  34171. lodash.hasIn = hasIn;
  34172. lodash.head = head;
  34173. lodash.identity = identity;
  34174. lodash.includes = includes;
  34175. lodash.indexOf = indexOf;
  34176. lodash.inRange = inRange;
  34177. lodash.invoke = invoke;
  34178. lodash.isArguments = isArguments;
  34179. lodash.isArray = isArray;
  34180. lodash.isArrayBuffer = isArrayBuffer;
  34181. lodash.isArrayLike = isArrayLike;
  34182. lodash.isArrayLikeObject = isArrayLikeObject;
  34183. lodash.isBoolean = isBoolean;
  34184. lodash.isBuffer = isBuffer;
  34185. lodash.isDate = isDate;
  34186. lodash.isElement = isElement;
  34187. lodash.isEmpty = isEmpty;
  34188. lodash.isEqual = isEqual;
  34189. lodash.isEqualWith = isEqualWith;
  34190. lodash.isError = isError;
  34191. lodash.isFinite = isFinite;
  34192. lodash.isFunction = isFunction;
  34193. lodash.isInteger = isInteger;
  34194. lodash.isLength = isLength;
  34195. lodash.isMap = isMap;
  34196. lodash.isMatch = isMatch;
  34197. lodash.isMatchWith = isMatchWith;
  34198. lodash.isNaN = isNaN;
  34199. lodash.isNative = isNative;
  34200. lodash.isNil = isNil;
  34201. lodash.isNull = isNull;
  34202. lodash.isNumber = isNumber;
  34203. lodash.isObject = isObject;
  34204. lodash.isObjectLike = isObjectLike;
  34205. lodash.isPlainObject = isPlainObject;
  34206. lodash.isRegExp = isRegExp;
  34207. lodash.isSafeInteger = isSafeInteger;
  34208. lodash.isSet = isSet;
  34209. lodash.isString = isString;
  34210. lodash.isSymbol = isSymbol;
  34211. lodash.isTypedArray = isTypedArray;
  34212. lodash.isUndefined = isUndefined;
  34213. lodash.isWeakMap = isWeakMap;
  34214. lodash.isWeakSet = isWeakSet;
  34215. lodash.join = join;
  34216. lodash.kebabCase = kebabCase;
  34217. lodash.last = last;
  34218. lodash.lastIndexOf = lastIndexOf;
  34219. lodash.lowerCase = lowerCase;
  34220. lodash.lowerFirst = lowerFirst;
  34221. lodash.lt = lt;
  34222. lodash.lte = lte;
  34223. lodash.max = max;
  34224. lodash.maxBy = maxBy;
  34225. lodash.mean = mean;
  34226. lodash.meanBy = meanBy;
  34227. lodash.min = min;
  34228. lodash.minBy = minBy;
  34229. lodash.stubArray = stubArray;
  34230. lodash.stubFalse = stubFalse;
  34231. lodash.stubObject = stubObject;
  34232. lodash.stubString = stubString;
  34233. lodash.stubTrue = stubTrue;
  34234. lodash.multiply = multiply;
  34235. lodash.nth = nth;
  34236. lodash.noConflict = noConflict;
  34237. lodash.noop = noop;
  34238. lodash.now = now;
  34239. lodash.pad = pad;
  34240. lodash.padEnd = padEnd;
  34241. lodash.padStart = padStart;
  34242. lodash.parseInt = parseInt;
  34243. lodash.random = random;
  34244. lodash.reduce = reduce;
  34245. lodash.reduceRight = reduceRight;
  34246. lodash.repeat = repeat;
  34247. lodash.replace = replace;
  34248. lodash.result = result;
  34249. lodash.round = round;
  34250. lodash.runInContext = runInContext;
  34251. lodash.sample = sample;
  34252. lodash.size = size;
  34253. lodash.snakeCase = snakeCase;
  34254. lodash.some = some;
  34255. lodash.sortedIndex = sortedIndex;
  34256. lodash.sortedIndexBy = sortedIndexBy;
  34257. lodash.sortedIndexOf = sortedIndexOf;
  34258. lodash.sortedLastIndex = sortedLastIndex;
  34259. lodash.sortedLastIndexBy = sortedLastIndexBy;
  34260. lodash.sortedLastIndexOf = sortedLastIndexOf;
  34261. lodash.startCase = startCase;
  34262. lodash.startsWith = startsWith;
  34263. lodash.subtract = subtract;
  34264. lodash.sum = sum;
  34265. lodash.sumBy = sumBy;
  34266. lodash.template = template;
  34267. lodash.times = times;
  34268. lodash.toFinite = toFinite;
  34269. lodash.toInteger = toInteger;
  34270. lodash.toLength = toLength;
  34271. lodash.toLower = toLower;
  34272. lodash.toNumber = toNumber;
  34273. lodash.toSafeInteger = toSafeInteger;
  34274. lodash.toString = toString;
  34275. lodash.toUpper = toUpper;
  34276. lodash.trim = trim;
  34277. lodash.trimEnd = trimEnd;
  34278. lodash.trimStart = trimStart;
  34279. lodash.truncate = truncate;
  34280. lodash.unescape = unescape;
  34281. lodash.uniqueId = uniqueId;
  34282. lodash.upperCase = upperCase;
  34283. lodash.upperFirst = upperFirst;
  34284. // Add aliases.
  34285. lodash.each = forEach;
  34286. lodash.eachRight = forEachRight;
  34287. lodash.first = head;
  34288. mixin(lodash, (function() {
  34289. var source = {};
  34290. baseForOwn(lodash, function(func, methodName) {
  34291. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  34292. source[methodName] = func;
  34293. }
  34294. });
  34295. return source;
  34296. }()), { 'chain': false });
  34297. /*------------------------------------------------------------------------*/
  34298. /**
  34299. * The semantic version number.
  34300. *
  34301. * @static
  34302. * @memberOf _
  34303. * @type {string}
  34304. */
  34305. lodash.VERSION = VERSION;
  34306. // Assign default placeholders.
  34307. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  34308. lodash[methodName].placeholder = lodash;
  34309. });
  34310. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  34311. arrayEach(['drop', 'take'], function(methodName, index) {
  34312. LazyWrapper.prototype[methodName] = function(n) {
  34313. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  34314. var result = (this.__filtered__ && !index)
  34315. ? new LazyWrapper(this)
  34316. : this.clone();
  34317. if (result.__filtered__) {
  34318. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  34319. } else {
  34320. result.__views__.push({
  34321. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  34322. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  34323. });
  34324. }
  34325. return result;
  34326. };
  34327. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  34328. return this.reverse()[methodName](n).reverse();
  34329. };
  34330. });
  34331. // Add `LazyWrapper` methods that accept an `iteratee` value.
  34332. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  34333. var type = index + 1,
  34334. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  34335. LazyWrapper.prototype[methodName] = function(iteratee) {
  34336. var result = this.clone();
  34337. result.__iteratees__.push({
  34338. 'iteratee': getIteratee(iteratee, 3),
  34339. 'type': type
  34340. });
  34341. result.__filtered__ = result.__filtered__ || isFilter;
  34342. return result;
  34343. };
  34344. });
  34345. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  34346. arrayEach(['head', 'last'], function(methodName, index) {
  34347. var takeName = 'take' + (index ? 'Right' : '');
  34348. LazyWrapper.prototype[methodName] = function() {
  34349. return this[takeName](1).value()[0];
  34350. };
  34351. });
  34352. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  34353. arrayEach(['initial', 'tail'], function(methodName, index) {
  34354. var dropName = 'drop' + (index ? '' : 'Right');
  34355. LazyWrapper.prototype[methodName] = function() {
  34356. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  34357. };
  34358. });
  34359. LazyWrapper.prototype.compact = function() {
  34360. return this.filter(identity);
  34361. };
  34362. LazyWrapper.prototype.find = function(predicate) {
  34363. return this.filter(predicate).head();
  34364. };
  34365. LazyWrapper.prototype.findLast = function(predicate) {
  34366. return this.reverse().find(predicate);
  34367. };
  34368. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  34369. if (typeof path == 'function') {
  34370. return new LazyWrapper(this);
  34371. }
  34372. return this.map(function(value) {
  34373. return baseInvoke(value, path, args);
  34374. });
  34375. });
  34376. LazyWrapper.prototype.reject = function(predicate) {
  34377. return this.filter(negate(getIteratee(predicate)));
  34378. };
  34379. LazyWrapper.prototype.slice = function(start, end) {
  34380. start = toInteger(start);
  34381. var result = this;
  34382. if (result.__filtered__ && (start > 0 || end < 0)) {
  34383. return new LazyWrapper(result);
  34384. }
  34385. if (start < 0) {
  34386. result = result.takeRight(-start);
  34387. } else if (start) {
  34388. result = result.drop(start);
  34389. }
  34390. if (end !== undefined) {
  34391. end = toInteger(end);
  34392. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  34393. }
  34394. return result;
  34395. };
  34396. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  34397. return this.reverse().takeWhile(predicate).reverse();
  34398. };
  34399. LazyWrapper.prototype.toArray = function() {
  34400. return this.take(MAX_ARRAY_LENGTH);
  34401. };
  34402. // Add `LazyWrapper` methods to `lodash.prototype`.
  34403. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  34404. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  34405. isTaker = /^(?:head|last)$/.test(methodName),
  34406. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  34407. retUnwrapped = isTaker || /^find/.test(methodName);
  34408. if (!lodashFunc) {
  34409. return;
  34410. }
  34411. lodash.prototype[methodName] = function() {
  34412. var value = this.__wrapped__,
  34413. args = isTaker ? [1] : arguments,
  34414. isLazy = value instanceof LazyWrapper,
  34415. iteratee = args[0],
  34416. useLazy = isLazy || isArray(value);
  34417. var interceptor = function(value) {
  34418. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  34419. return (isTaker && chainAll) ? result[0] : result;
  34420. };
  34421. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  34422. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  34423. isLazy = useLazy = false;
  34424. }
  34425. var chainAll = this.__chain__,
  34426. isHybrid = !!this.__actions__.length,
  34427. isUnwrapped = retUnwrapped && !chainAll,
  34428. onlyLazy = isLazy && !isHybrid;
  34429. if (!retUnwrapped && useLazy) {
  34430. value = onlyLazy ? value : new LazyWrapper(this);
  34431. var result = func.apply(value, args);
  34432. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  34433. return new LodashWrapper(result, chainAll);
  34434. }
  34435. if (isUnwrapped && onlyLazy) {
  34436. return func.apply(this, args);
  34437. }
  34438. result = this.thru(interceptor);
  34439. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  34440. };
  34441. });
  34442. // Add `Array` methods to `lodash.prototype`.
  34443. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  34444. var func = arrayProto[methodName],
  34445. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  34446. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  34447. lodash.prototype[methodName] = function() {
  34448. var args = arguments;
  34449. if (retUnwrapped && !this.__chain__) {
  34450. var value = this.value();
  34451. return func.apply(isArray(value) ? value : [], args);
  34452. }
  34453. return this[chainName](function(value) {
  34454. return func.apply(isArray(value) ? value : [], args);
  34455. });
  34456. };
  34457. });
  34458. // Map minified method names to their real names.
  34459. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  34460. var lodashFunc = lodash[methodName];
  34461. if (lodashFunc) {
  34462. var key = lodashFunc.name + '';
  34463. if (!hasOwnProperty.call(realNames, key)) {
  34464. realNames[key] = [];
  34465. }
  34466. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  34467. }
  34468. });
  34469. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  34470. 'name': 'wrapper',
  34471. 'func': undefined
  34472. }];
  34473. // Add methods to `LazyWrapper`.
  34474. LazyWrapper.prototype.clone = lazyClone;
  34475. LazyWrapper.prototype.reverse = lazyReverse;
  34476. LazyWrapper.prototype.value = lazyValue;
  34477. // Add chain sequence methods to the `lodash` wrapper.
  34478. lodash.prototype.at = wrapperAt;
  34479. lodash.prototype.chain = wrapperChain;
  34480. lodash.prototype.commit = wrapperCommit;
  34481. lodash.prototype.next = wrapperNext;
  34482. lodash.prototype.plant = wrapperPlant;
  34483. lodash.prototype.reverse = wrapperReverse;
  34484. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  34485. // Add lazy aliases.
  34486. lodash.prototype.first = lodash.prototype.head;
  34487. if (symIterator) {
  34488. lodash.prototype[symIterator] = wrapperToIterator;
  34489. }
  34490. return lodash;
  34491. });
  34492. /*--------------------------------------------------------------------------*/
  34493. // Export lodash.
  34494. var _ = runInContext();
  34495. // Some AMD build optimizers, like r.js, check for condition patterns like:
  34496. if (true) {
  34497. // Expose Lodash on the global object to prevent errors when Lodash is
  34498. // loaded by a script tag in the presence of an AMD loader.
  34499. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  34500. // Use `_.noConflict` to remove Lodash from the global object.
  34501. root._ = _;
  34502. // Define as an anonymous module so, through path mapping, it can be
  34503. // referenced as the "underscore" module.
  34504. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  34505. return _;
  34506. }).call(exports, __webpack_require__, exports, module),
  34507. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  34508. }
  34509. // Check for `exports` after `define` in case a build optimizer adds it.
  34510. else {}
  34511. }.call(this));
  34512. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  34513. /***/ }),
  34514. /***/ "./node_modules/object-assign/index.js":
  34515. /*!*********************************************!*\
  34516. !*** ./node_modules/object-assign/index.js ***!
  34517. \*********************************************/
  34518. /*! no static exports found */
  34519. /***/ (function(module, exports, __webpack_require__) {
  34520. "use strict";
  34521. /*
  34522. object-assign
  34523. (c) Sindre Sorhus
  34524. @license MIT
  34525. */
  34526. /* eslint-disable no-unused-vars */
  34527. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  34528. var hasOwnProperty = Object.prototype.hasOwnProperty;
  34529. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  34530. function toObject(val) {
  34531. if (val === null || val === undefined) {
  34532. throw new TypeError('Object.assign cannot be called with null or undefined');
  34533. }
  34534. return Object(val);
  34535. }
  34536. function shouldUseNative() {
  34537. try {
  34538. if (!Object.assign) {
  34539. return false;
  34540. }
  34541. // Detect buggy property enumeration order in older V8 versions.
  34542. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  34543. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  34544. test1[5] = 'de';
  34545. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  34546. return false;
  34547. }
  34548. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  34549. var test2 = {};
  34550. for (var i = 0; i < 10; i++) {
  34551. test2['_' + String.fromCharCode(i)] = i;
  34552. }
  34553. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  34554. return test2[n];
  34555. });
  34556. if (order2.join('') !== '0123456789') {
  34557. return false;
  34558. }
  34559. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  34560. var test3 = {};
  34561. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  34562. test3[letter] = letter;
  34563. });
  34564. if (Object.keys(Object.assign({}, test3)).join('') !==
  34565. 'abcdefghijklmnopqrst') {
  34566. return false;
  34567. }
  34568. return true;
  34569. } catch (err) {
  34570. // We don't expect any of the above to throw, but better to be safe.
  34571. return false;
  34572. }
  34573. }
  34574. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  34575. var from;
  34576. var to = toObject(target);
  34577. var symbols;
  34578. for (var s = 1; s < arguments.length; s++) {
  34579. from = Object(arguments[s]);
  34580. for (var key in from) {
  34581. if (hasOwnProperty.call(from, key)) {
  34582. to[key] = from[key];
  34583. }
  34584. }
  34585. if (getOwnPropertySymbols) {
  34586. symbols = getOwnPropertySymbols(from);
  34587. for (var i = 0; i < symbols.length; i++) {
  34588. if (propIsEnumerable.call(from, symbols[i])) {
  34589. to[symbols[i]] = from[symbols[i]];
  34590. }
  34591. }
  34592. }
  34593. }
  34594. return to;
  34595. };
  34596. /***/ }),
  34597. /***/ "./node_modules/popper.js/dist/esm/popper.js":
  34598. /*!***************************************************!*\
  34599. !*** ./node_modules/popper.js/dist/esm/popper.js ***!
  34600. \***************************************************/
  34601. /*! exports provided: default */
  34602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34603. "use strict";
  34604. __webpack_require__.r(__webpack_exports__);
  34605. /* WEBPACK VAR INJECTION */(function(global) {/**!
  34606. * @fileOverview Kickass library to create and place poppers near their reference elements.
  34607. * @version 1.16.0
  34608. * @license
  34609. * Copyright (c) 2016 Federico Zivolo and contributors
  34610. *
  34611. * Permission is hereby granted, free of charge, to any person obtaining a copy
  34612. * of this software and associated documentation files (the "Software"), to deal
  34613. * in the Software without restriction, including without limitation the rights
  34614. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  34615. * copies of the Software, and to permit persons to whom the Software is
  34616. * furnished to do so, subject to the following conditions:
  34617. *
  34618. * The above copyright notice and this permission notice shall be included in all
  34619. * copies or substantial portions of the Software.
  34620. *
  34621. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  34622. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  34623. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  34624. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  34625. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  34626. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  34627. * SOFTWARE.
  34628. */
  34629. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
  34630. var timeoutDuration = function () {
  34631. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  34632. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  34633. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  34634. return 1;
  34635. }
  34636. }
  34637. return 0;
  34638. }();
  34639. function microtaskDebounce(fn) {
  34640. var called = false;
  34641. return function () {
  34642. if (called) {
  34643. return;
  34644. }
  34645. called = true;
  34646. window.Promise.resolve().then(function () {
  34647. called = false;
  34648. fn();
  34649. });
  34650. };
  34651. }
  34652. function taskDebounce(fn) {
  34653. var scheduled = false;
  34654. return function () {
  34655. if (!scheduled) {
  34656. scheduled = true;
  34657. setTimeout(function () {
  34658. scheduled = false;
  34659. fn();
  34660. }, timeoutDuration);
  34661. }
  34662. };
  34663. }
  34664. var supportsMicroTasks = isBrowser && window.Promise;
  34665. /**
  34666. * Create a debounced version of a method, that's asynchronously deferred
  34667. * but called in the minimum time possible.
  34668. *
  34669. * @method
  34670. * @memberof Popper.Utils
  34671. * @argument {Function} fn
  34672. * @returns {Function}
  34673. */
  34674. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  34675. /**
  34676. * Check if the given variable is a function
  34677. * @method
  34678. * @memberof Popper.Utils
  34679. * @argument {Any} functionToCheck - variable to check
  34680. * @returns {Boolean} answer to: is a function?
  34681. */
  34682. function isFunction(functionToCheck) {
  34683. var getType = {};
  34684. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  34685. }
  34686. /**
  34687. * Get CSS computed property of the given element
  34688. * @method
  34689. * @memberof Popper.Utils
  34690. * @argument {Eement} element
  34691. * @argument {String} property
  34692. */
  34693. function getStyleComputedProperty(element, property) {
  34694. if (element.nodeType !== 1) {
  34695. return [];
  34696. }
  34697. // NOTE: 1 DOM access here
  34698. var window = element.ownerDocument.defaultView;
  34699. var css = window.getComputedStyle(element, null);
  34700. return property ? css[property] : css;
  34701. }
  34702. /**
  34703. * Returns the parentNode or the host of the element
  34704. * @method
  34705. * @memberof Popper.Utils
  34706. * @argument {Element} element
  34707. * @returns {Element} parent
  34708. */
  34709. function getParentNode(element) {
  34710. if (element.nodeName === 'HTML') {
  34711. return element;
  34712. }
  34713. return element.parentNode || element.host;
  34714. }
  34715. /**
  34716. * Returns the scrolling parent of the given element
  34717. * @method
  34718. * @memberof Popper.Utils
  34719. * @argument {Element} element
  34720. * @returns {Element} scroll parent
  34721. */
  34722. function getScrollParent(element) {
  34723. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  34724. if (!element) {
  34725. return document.body;
  34726. }
  34727. switch (element.nodeName) {
  34728. case 'HTML':
  34729. case 'BODY':
  34730. return element.ownerDocument.body;
  34731. case '#document':
  34732. return element.body;
  34733. }
  34734. // Firefox want us to check `-x` and `-y` variations as well
  34735. var _getStyleComputedProp = getStyleComputedProperty(element),
  34736. overflow = _getStyleComputedProp.overflow,
  34737. overflowX = _getStyleComputedProp.overflowX,
  34738. overflowY = _getStyleComputedProp.overflowY;
  34739. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  34740. return element;
  34741. }
  34742. return getScrollParent(getParentNode(element));
  34743. }
  34744. /**
  34745. * Returns the reference node of the reference object, or the reference object itself.
  34746. * @method
  34747. * @memberof Popper.Utils
  34748. * @param {Element|Object} reference - the reference element (the popper will be relative to this)
  34749. * @returns {Element} parent
  34750. */
  34751. function getReferenceNode(reference) {
  34752. return reference && reference.referenceNode ? reference.referenceNode : reference;
  34753. }
  34754. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  34755. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  34756. /**
  34757. * Determines if the browser is Internet Explorer
  34758. * @method
  34759. * @memberof Popper.Utils
  34760. * @param {Number} version to check
  34761. * @returns {Boolean} isIE
  34762. */
  34763. function isIE(version) {
  34764. if (version === 11) {
  34765. return isIE11;
  34766. }
  34767. if (version === 10) {
  34768. return isIE10;
  34769. }
  34770. return isIE11 || isIE10;
  34771. }
  34772. /**
  34773. * Returns the offset parent of the given element
  34774. * @method
  34775. * @memberof Popper.Utils
  34776. * @argument {Element} element
  34777. * @returns {Element} offset parent
  34778. */
  34779. function getOffsetParent(element) {
  34780. if (!element) {
  34781. return document.documentElement;
  34782. }
  34783. var noOffsetParent = isIE(10) ? document.body : null;
  34784. // NOTE: 1 DOM access here
  34785. var offsetParent = element.offsetParent || null;
  34786. // Skip hidden elements which don't have an offsetParent
  34787. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  34788. offsetParent = (element = element.nextElementSibling).offsetParent;
  34789. }
  34790. var nodeName = offsetParent && offsetParent.nodeName;
  34791. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  34792. return element ? element.ownerDocument.documentElement : document.documentElement;
  34793. }
  34794. // .offsetParent will return the closest TH, TD or TABLE in case
  34795. // no offsetParent is present, I hate this job...
  34796. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  34797. return getOffsetParent(offsetParent);
  34798. }
  34799. return offsetParent;
  34800. }
  34801. function isOffsetContainer(element) {
  34802. var nodeName = element.nodeName;
  34803. if (nodeName === 'BODY') {
  34804. return false;
  34805. }
  34806. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  34807. }
  34808. /**
  34809. * Finds the root node (document, shadowDOM root) of the given element
  34810. * @method
  34811. * @memberof Popper.Utils
  34812. * @argument {Element} node
  34813. * @returns {Element} root node
  34814. */
  34815. function getRoot(node) {
  34816. if (node.parentNode !== null) {
  34817. return getRoot(node.parentNode);
  34818. }
  34819. return node;
  34820. }
  34821. /**
  34822. * Finds the offset parent common to the two provided nodes
  34823. * @method
  34824. * @memberof Popper.Utils
  34825. * @argument {Element} element1
  34826. * @argument {Element} element2
  34827. * @returns {Element} common offset parent
  34828. */
  34829. function findCommonOffsetParent(element1, element2) {
  34830. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  34831. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  34832. return document.documentElement;
  34833. }
  34834. // Here we make sure to give as "start" the element that comes first in the DOM
  34835. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  34836. var start = order ? element1 : element2;
  34837. var end = order ? element2 : element1;
  34838. // Get common ancestor container
  34839. var range = document.createRange();
  34840. range.setStart(start, 0);
  34841. range.setEnd(end, 0);
  34842. var commonAncestorContainer = range.commonAncestorContainer;
  34843. // Both nodes are inside #document
  34844. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  34845. if (isOffsetContainer(commonAncestorContainer)) {
  34846. return commonAncestorContainer;
  34847. }
  34848. return getOffsetParent(commonAncestorContainer);
  34849. }
  34850. // one of the nodes is inside shadowDOM, find which one
  34851. var element1root = getRoot(element1);
  34852. if (element1root.host) {
  34853. return findCommonOffsetParent(element1root.host, element2);
  34854. } else {
  34855. return findCommonOffsetParent(element1, getRoot(element2).host);
  34856. }
  34857. }
  34858. /**
  34859. * Gets the scroll value of the given element in the given side (top and left)
  34860. * @method
  34861. * @memberof Popper.Utils
  34862. * @argument {Element} element
  34863. * @argument {String} side `top` or `left`
  34864. * @returns {number} amount of scrolled pixels
  34865. */
  34866. function getScroll(element) {
  34867. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  34868. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  34869. var nodeName = element.nodeName;
  34870. if (nodeName === 'BODY' || nodeName === 'HTML') {
  34871. var html = element.ownerDocument.documentElement;
  34872. var scrollingElement = element.ownerDocument.scrollingElement || html;
  34873. return scrollingElement[upperSide];
  34874. }
  34875. return element[upperSide];
  34876. }
  34877. /*
  34878. * Sum or subtract the element scroll values (left and top) from a given rect object
  34879. * @method
  34880. * @memberof Popper.Utils
  34881. * @param {Object} rect - Rect object you want to change
  34882. * @param {HTMLElement} element - The element from the function reads the scroll values
  34883. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  34884. * @return {Object} rect - The modifier rect object
  34885. */
  34886. function includeScroll(rect, element) {
  34887. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  34888. var scrollTop = getScroll(element, 'top');
  34889. var scrollLeft = getScroll(element, 'left');
  34890. var modifier = subtract ? -1 : 1;
  34891. rect.top += scrollTop * modifier;
  34892. rect.bottom += scrollTop * modifier;
  34893. rect.left += scrollLeft * modifier;
  34894. rect.right += scrollLeft * modifier;
  34895. return rect;
  34896. }
  34897. /*
  34898. * Helper to detect borders of a given element
  34899. * @method
  34900. * @memberof Popper.Utils
  34901. * @param {CSSStyleDeclaration} styles
  34902. * Result of `getStyleComputedProperty` on the given element
  34903. * @param {String} axis - `x` or `y`
  34904. * @return {number} borders - The borders size of the given axis
  34905. */
  34906. function getBordersSize(styles, axis) {
  34907. var sideA = axis === 'x' ? 'Left' : 'Top';
  34908. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  34909. return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
  34910. }
  34911. function getSize(axis, body, html, computedStyle) {
  34912. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  34913. }
  34914. function getWindowSizes(document) {
  34915. var body = document.body;
  34916. var html = document.documentElement;
  34917. var computedStyle = isIE(10) && getComputedStyle(html);
  34918. return {
  34919. height: getSize('Height', body, html, computedStyle),
  34920. width: getSize('Width', body, html, computedStyle)
  34921. };
  34922. }
  34923. var classCallCheck = function (instance, Constructor) {
  34924. if (!(instance instanceof Constructor)) {
  34925. throw new TypeError("Cannot call a class as a function");
  34926. }
  34927. };
  34928. var createClass = function () {
  34929. function defineProperties(target, props) {
  34930. for (var i = 0; i < props.length; i++) {
  34931. var descriptor = props[i];
  34932. descriptor.enumerable = descriptor.enumerable || false;
  34933. descriptor.configurable = true;
  34934. if ("value" in descriptor) descriptor.writable = true;
  34935. Object.defineProperty(target, descriptor.key, descriptor);
  34936. }
  34937. }
  34938. return function (Constructor, protoProps, staticProps) {
  34939. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  34940. if (staticProps) defineProperties(Constructor, staticProps);
  34941. return Constructor;
  34942. };
  34943. }();
  34944. var defineProperty = function (obj, key, value) {
  34945. if (key in obj) {
  34946. Object.defineProperty(obj, key, {
  34947. value: value,
  34948. enumerable: true,
  34949. configurable: true,
  34950. writable: true
  34951. });
  34952. } else {
  34953. obj[key] = value;
  34954. }
  34955. return obj;
  34956. };
  34957. var _extends = Object.assign || function (target) {
  34958. for (var i = 1; i < arguments.length; i++) {
  34959. var source = arguments[i];
  34960. for (var key in source) {
  34961. if (Object.prototype.hasOwnProperty.call(source, key)) {
  34962. target[key] = source[key];
  34963. }
  34964. }
  34965. }
  34966. return target;
  34967. };
  34968. /**
  34969. * Given element offsets, generate an output similar to getBoundingClientRect
  34970. * @method
  34971. * @memberof Popper.Utils
  34972. * @argument {Object} offsets
  34973. * @returns {Object} ClientRect like output
  34974. */
  34975. function getClientRect(offsets) {
  34976. return _extends({}, offsets, {
  34977. right: offsets.left + offsets.width,
  34978. bottom: offsets.top + offsets.height
  34979. });
  34980. }
  34981. /**
  34982. * Get bounding client rect of given element
  34983. * @method
  34984. * @memberof Popper.Utils
  34985. * @param {HTMLElement} element
  34986. * @return {Object} client rect
  34987. */
  34988. function getBoundingClientRect(element) {
  34989. var rect = {};
  34990. // IE10 10 FIX: Please, don't ask, the element isn't
  34991. // considered in DOM in some circumstances...
  34992. // This isn't reproducible in IE10 compatibility mode of IE11
  34993. try {
  34994. if (isIE(10)) {
  34995. rect = element.getBoundingClientRect();
  34996. var scrollTop = getScroll(element, 'top');
  34997. var scrollLeft = getScroll(element, 'left');
  34998. rect.top += scrollTop;
  34999. rect.left += scrollLeft;
  35000. rect.bottom += scrollTop;
  35001. rect.right += scrollLeft;
  35002. } else {
  35003. rect = element.getBoundingClientRect();
  35004. }
  35005. } catch (e) {}
  35006. var result = {
  35007. left: rect.left,
  35008. top: rect.top,
  35009. width: rect.right - rect.left,
  35010. height: rect.bottom - rect.top
  35011. };
  35012. // subtract scrollbar size from sizes
  35013. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  35014. var width = sizes.width || element.clientWidth || result.width;
  35015. var height = sizes.height || element.clientHeight || result.height;
  35016. var horizScrollbar = element.offsetWidth - width;
  35017. var vertScrollbar = element.offsetHeight - height;
  35018. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  35019. // we make this check conditional for performance reasons
  35020. if (horizScrollbar || vertScrollbar) {
  35021. var styles = getStyleComputedProperty(element);
  35022. horizScrollbar -= getBordersSize(styles, 'x');
  35023. vertScrollbar -= getBordersSize(styles, 'y');
  35024. result.width -= horizScrollbar;
  35025. result.height -= vertScrollbar;
  35026. }
  35027. return getClientRect(result);
  35028. }
  35029. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  35030. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35031. var isIE10 = isIE(10);
  35032. var isHTML = parent.nodeName === 'HTML';
  35033. var childrenRect = getBoundingClientRect(children);
  35034. var parentRect = getBoundingClientRect(parent);
  35035. var scrollParent = getScrollParent(children);
  35036. var styles = getStyleComputedProperty(parent);
  35037. var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
  35038. var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
  35039. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  35040. if (fixedPosition && isHTML) {
  35041. parentRect.top = Math.max(parentRect.top, 0);
  35042. parentRect.left = Math.max(parentRect.left, 0);
  35043. }
  35044. var offsets = getClientRect({
  35045. top: childrenRect.top - parentRect.top - borderTopWidth,
  35046. left: childrenRect.left - parentRect.left - borderLeftWidth,
  35047. width: childrenRect.width,
  35048. height: childrenRect.height
  35049. });
  35050. offsets.marginTop = 0;
  35051. offsets.marginLeft = 0;
  35052. // Subtract margins of documentElement in case it's being used as parent
  35053. // we do this only on HTML because it's the only element that behaves
  35054. // differently when margins are applied to it. The margins are included in
  35055. // the box of the documentElement, in the other cases not.
  35056. if (!isIE10 && isHTML) {
  35057. var marginTop = parseFloat(styles.marginTop, 10);
  35058. var marginLeft = parseFloat(styles.marginLeft, 10);
  35059. offsets.top -= borderTopWidth - marginTop;
  35060. offsets.bottom -= borderTopWidth - marginTop;
  35061. offsets.left -= borderLeftWidth - marginLeft;
  35062. offsets.right -= borderLeftWidth - marginLeft;
  35063. // Attach marginTop and marginLeft because in some circumstances we may need them
  35064. offsets.marginTop = marginTop;
  35065. offsets.marginLeft = marginLeft;
  35066. }
  35067. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  35068. offsets = includeScroll(offsets, parent);
  35069. }
  35070. return offsets;
  35071. }
  35072. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  35073. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  35074. var html = element.ownerDocument.documentElement;
  35075. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  35076. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  35077. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  35078. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  35079. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  35080. var offset = {
  35081. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  35082. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  35083. width: width,
  35084. height: height
  35085. };
  35086. return getClientRect(offset);
  35087. }
  35088. /**
  35089. * Check if the given element is fixed or is inside a fixed parent
  35090. * @method
  35091. * @memberof Popper.Utils
  35092. * @argument {Element} element
  35093. * @argument {Element} customContainer
  35094. * @returns {Boolean} answer to "isFixed?"
  35095. */
  35096. function isFixed(element) {
  35097. var nodeName = element.nodeName;
  35098. if (nodeName === 'BODY' || nodeName === 'HTML') {
  35099. return false;
  35100. }
  35101. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  35102. return true;
  35103. }
  35104. var parentNode = getParentNode(element);
  35105. if (!parentNode) {
  35106. return false;
  35107. }
  35108. return isFixed(parentNode);
  35109. }
  35110. /**
  35111. * Finds the first parent of an element that has a transformed property defined
  35112. * @method
  35113. * @memberof Popper.Utils
  35114. * @argument {Element} element
  35115. * @returns {Element} first transformed parent or documentElement
  35116. */
  35117. function getFixedPositionOffsetParent(element) {
  35118. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  35119. if (!element || !element.parentElement || isIE()) {
  35120. return document.documentElement;
  35121. }
  35122. var el = element.parentElement;
  35123. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  35124. el = el.parentElement;
  35125. }
  35126. return el || document.documentElement;
  35127. }
  35128. /**
  35129. * Computed the boundaries limits and return them
  35130. * @method
  35131. * @memberof Popper.Utils
  35132. * @param {HTMLElement} popper
  35133. * @param {HTMLElement} reference
  35134. * @param {number} padding
  35135. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  35136. * @param {Boolean} fixedPosition - Is in fixed position mode
  35137. * @returns {Object} Coordinates of the boundaries
  35138. */
  35139. function getBoundaries(popper, reference, padding, boundariesElement) {
  35140. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  35141. // NOTE: 1 DOM access here
  35142. var boundaries = { top: 0, left: 0 };
  35143. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  35144. // Handle viewport case
  35145. if (boundariesElement === 'viewport') {
  35146. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  35147. } else {
  35148. // Handle other cases based on DOM element used as boundaries
  35149. var boundariesNode = void 0;
  35150. if (boundariesElement === 'scrollParent') {
  35151. boundariesNode = getScrollParent(getParentNode(reference));
  35152. if (boundariesNode.nodeName === 'BODY') {
  35153. boundariesNode = popper.ownerDocument.documentElement;
  35154. }
  35155. } else if (boundariesElement === 'window') {
  35156. boundariesNode = popper.ownerDocument.documentElement;
  35157. } else {
  35158. boundariesNode = boundariesElement;
  35159. }
  35160. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  35161. // In case of HTML, we need a different computation
  35162. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  35163. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  35164. height = _getWindowSizes.height,
  35165. width = _getWindowSizes.width;
  35166. boundaries.top += offsets.top - offsets.marginTop;
  35167. boundaries.bottom = height + offsets.top;
  35168. boundaries.left += offsets.left - offsets.marginLeft;
  35169. boundaries.right = width + offsets.left;
  35170. } else {
  35171. // for all the other DOM elements, this one is good
  35172. boundaries = offsets;
  35173. }
  35174. }
  35175. // Add paddings
  35176. padding = padding || 0;
  35177. var isPaddingNumber = typeof padding === 'number';
  35178. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  35179. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  35180. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  35181. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  35182. return boundaries;
  35183. }
  35184. function getArea(_ref) {
  35185. var width = _ref.width,
  35186. height = _ref.height;
  35187. return width * height;
  35188. }
  35189. /**
  35190. * Utility used to transform the `auto` placement to the placement with more
  35191. * available space.
  35192. * @method
  35193. * @memberof Popper.Utils
  35194. * @argument {Object} data - The data object generated by update method
  35195. * @argument {Object} options - Modifiers configuration and options
  35196. * @returns {Object} The data object, properly modified
  35197. */
  35198. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  35199. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  35200. if (placement.indexOf('auto') === -1) {
  35201. return placement;
  35202. }
  35203. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  35204. var rects = {
  35205. top: {
  35206. width: boundaries.width,
  35207. height: refRect.top - boundaries.top
  35208. },
  35209. right: {
  35210. width: boundaries.right - refRect.right,
  35211. height: boundaries.height
  35212. },
  35213. bottom: {
  35214. width: boundaries.width,
  35215. height: boundaries.bottom - refRect.bottom
  35216. },
  35217. left: {
  35218. width: refRect.left - boundaries.left,
  35219. height: boundaries.height
  35220. }
  35221. };
  35222. var sortedAreas = Object.keys(rects).map(function (key) {
  35223. return _extends({
  35224. key: key
  35225. }, rects[key], {
  35226. area: getArea(rects[key])
  35227. });
  35228. }).sort(function (a, b) {
  35229. return b.area - a.area;
  35230. });
  35231. var filteredAreas = sortedAreas.filter(function (_ref2) {
  35232. var width = _ref2.width,
  35233. height = _ref2.height;
  35234. return width >= popper.clientWidth && height >= popper.clientHeight;
  35235. });
  35236. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  35237. var variation = placement.split('-')[1];
  35238. return computedPlacement + (variation ? '-' + variation : '');
  35239. }
  35240. /**
  35241. * Get offsets to the reference element
  35242. * @method
  35243. * @memberof Popper.Utils
  35244. * @param {Object} state
  35245. * @param {Element} popper - the popper element
  35246. * @param {Element} reference - the reference element (the popper will be relative to this)
  35247. * @param {Element} fixedPosition - is in fixed position mode
  35248. * @returns {Object} An object containing the offsets which will be applied to the popper
  35249. */
  35250. function getReferenceOffsets(state, popper, reference) {
  35251. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  35252. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  35253. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  35254. }
  35255. /**
  35256. * Get the outer sizes of the given element (offset size + margins)
  35257. * @method
  35258. * @memberof Popper.Utils
  35259. * @argument {Element} element
  35260. * @returns {Object} object containing width and height properties
  35261. */
  35262. function getOuterSizes(element) {
  35263. var window = element.ownerDocument.defaultView;
  35264. var styles = window.getComputedStyle(element);
  35265. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  35266. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  35267. var result = {
  35268. width: element.offsetWidth + y,
  35269. height: element.offsetHeight + x
  35270. };
  35271. return result;
  35272. }
  35273. /**
  35274. * Get the opposite placement of the given one
  35275. * @method
  35276. * @memberof Popper.Utils
  35277. * @argument {String} placement
  35278. * @returns {String} flipped placement
  35279. */
  35280. function getOppositePlacement(placement) {
  35281. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  35282. return placement.replace(/left|right|bottom|top/g, function (matched) {
  35283. return hash[matched];
  35284. });
  35285. }
  35286. /**
  35287. * Get offsets to the popper
  35288. * @method
  35289. * @memberof Popper.Utils
  35290. * @param {Object} position - CSS position the Popper will get applied
  35291. * @param {HTMLElement} popper - the popper element
  35292. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  35293. * @param {String} placement - one of the valid placement options
  35294. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  35295. */
  35296. function getPopperOffsets(popper, referenceOffsets, placement) {
  35297. placement = placement.split('-')[0];
  35298. // Get popper node sizes
  35299. var popperRect = getOuterSizes(popper);
  35300. // Add position, width and height to our offsets object
  35301. var popperOffsets = {
  35302. width: popperRect.width,
  35303. height: popperRect.height
  35304. };
  35305. // depending by the popper placement we have to compute its offsets slightly differently
  35306. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  35307. var mainSide = isHoriz ? 'top' : 'left';
  35308. var secondarySide = isHoriz ? 'left' : 'top';
  35309. var measurement = isHoriz ? 'height' : 'width';
  35310. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  35311. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  35312. if (placement === secondarySide) {
  35313. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  35314. } else {
  35315. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  35316. }
  35317. return popperOffsets;
  35318. }
  35319. /**
  35320. * Mimics the `find` method of Array
  35321. * @method
  35322. * @memberof Popper.Utils
  35323. * @argument {Array} arr
  35324. * @argument prop
  35325. * @argument value
  35326. * @returns index or -1
  35327. */
  35328. function find(arr, check) {
  35329. // use native find if supported
  35330. if (Array.prototype.find) {
  35331. return arr.find(check);
  35332. }
  35333. // use `filter` to obtain the same behavior of `find`
  35334. return arr.filter(check)[0];
  35335. }
  35336. /**
  35337. * Return the index of the matching object
  35338. * @method
  35339. * @memberof Popper.Utils
  35340. * @argument {Array} arr
  35341. * @argument prop
  35342. * @argument value
  35343. * @returns index or -1
  35344. */
  35345. function findIndex(arr, prop, value) {
  35346. // use native findIndex if supported
  35347. if (Array.prototype.findIndex) {
  35348. return arr.findIndex(function (cur) {
  35349. return cur[prop] === value;
  35350. });
  35351. }
  35352. // use `find` + `indexOf` if `findIndex` isn't supported
  35353. var match = find(arr, function (obj) {
  35354. return obj[prop] === value;
  35355. });
  35356. return arr.indexOf(match);
  35357. }
  35358. /**
  35359. * Loop trough the list of modifiers and run them in order,
  35360. * each of them will then edit the data object.
  35361. * @method
  35362. * @memberof Popper.Utils
  35363. * @param {dataObject} data
  35364. * @param {Array} modifiers
  35365. * @param {String} ends - Optional modifier name used as stopper
  35366. * @returns {dataObject}
  35367. */
  35368. function runModifiers(modifiers, data, ends) {
  35369. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  35370. modifiersToRun.forEach(function (modifier) {
  35371. if (modifier['function']) {
  35372. // eslint-disable-line dot-notation
  35373. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  35374. }
  35375. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  35376. if (modifier.enabled && isFunction(fn)) {
  35377. // Add properties to offsets to make them a complete clientRect object
  35378. // we do this before each modifier to make sure the previous one doesn't
  35379. // mess with these values
  35380. data.offsets.popper = getClientRect(data.offsets.popper);
  35381. data.offsets.reference = getClientRect(data.offsets.reference);
  35382. data = fn(data, modifier);
  35383. }
  35384. });
  35385. return data;
  35386. }
  35387. /**
  35388. * Updates the position of the popper, computing the new offsets and applying
  35389. * the new style.<br />
  35390. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  35391. * @method
  35392. * @memberof Popper
  35393. */
  35394. function update() {
  35395. // if popper is destroyed, don't perform any further update
  35396. if (this.state.isDestroyed) {
  35397. return;
  35398. }
  35399. var data = {
  35400. instance: this,
  35401. styles: {},
  35402. arrowStyles: {},
  35403. attributes: {},
  35404. flipped: false,
  35405. offsets: {}
  35406. };
  35407. // compute reference element offsets
  35408. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  35409. // compute auto placement, store placement inside the data object,
  35410. // modifiers will be able to edit `placement` if needed
  35411. // and refer to originalPlacement to know the original value
  35412. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  35413. // store the computed placement inside `originalPlacement`
  35414. data.originalPlacement = data.placement;
  35415. data.positionFixed = this.options.positionFixed;
  35416. // compute the popper offsets
  35417. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  35418. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  35419. // run the modifiers
  35420. data = runModifiers(this.modifiers, data);
  35421. // the first `update` will call `onCreate` callback
  35422. // the other ones will call `onUpdate` callback
  35423. if (!this.state.isCreated) {
  35424. this.state.isCreated = true;
  35425. this.options.onCreate(data);
  35426. } else {
  35427. this.options.onUpdate(data);
  35428. }
  35429. }
  35430. /**
  35431. * Helper used to know if the given modifier is enabled.
  35432. * @method
  35433. * @memberof Popper.Utils
  35434. * @returns {Boolean}
  35435. */
  35436. function isModifierEnabled(modifiers, modifierName) {
  35437. return modifiers.some(function (_ref) {
  35438. var name = _ref.name,
  35439. enabled = _ref.enabled;
  35440. return enabled && name === modifierName;
  35441. });
  35442. }
  35443. /**
  35444. * Get the prefixed supported property name
  35445. * @method
  35446. * @memberof Popper.Utils
  35447. * @argument {String} property (camelCase)
  35448. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  35449. */
  35450. function getSupportedPropertyName(property) {
  35451. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  35452. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  35453. for (var i = 0; i < prefixes.length; i++) {
  35454. var prefix = prefixes[i];
  35455. var toCheck = prefix ? '' + prefix + upperProp : property;
  35456. if (typeof document.body.style[toCheck] !== 'undefined') {
  35457. return toCheck;
  35458. }
  35459. }
  35460. return null;
  35461. }
  35462. /**
  35463. * Destroys the popper.
  35464. * @method
  35465. * @memberof Popper
  35466. */
  35467. function destroy() {
  35468. this.state.isDestroyed = true;
  35469. // touch DOM only if `applyStyle` modifier is enabled
  35470. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  35471. this.popper.removeAttribute('x-placement');
  35472. this.popper.style.position = '';
  35473. this.popper.style.top = '';
  35474. this.popper.style.left = '';
  35475. this.popper.style.right = '';
  35476. this.popper.style.bottom = '';
  35477. this.popper.style.willChange = '';
  35478. this.popper.style[getSupportedPropertyName('transform')] = '';
  35479. }
  35480. this.disableEventListeners();
  35481. // remove the popper if user explicitly asked for the deletion on destroy
  35482. // do not use `remove` because IE11 doesn't support it
  35483. if (this.options.removeOnDestroy) {
  35484. this.popper.parentNode.removeChild(this.popper);
  35485. }
  35486. return this;
  35487. }
  35488. /**
  35489. * Get the window associated with the element
  35490. * @argument {Element} element
  35491. * @returns {Window}
  35492. */
  35493. function getWindow(element) {
  35494. var ownerDocument = element.ownerDocument;
  35495. return ownerDocument ? ownerDocument.defaultView : window;
  35496. }
  35497. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  35498. var isBody = scrollParent.nodeName === 'BODY';
  35499. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  35500. target.addEventListener(event, callback, { passive: true });
  35501. if (!isBody) {
  35502. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  35503. }
  35504. scrollParents.push(target);
  35505. }
  35506. /**
  35507. * Setup needed event listeners used to update the popper position
  35508. * @method
  35509. * @memberof Popper.Utils
  35510. * @private
  35511. */
  35512. function setupEventListeners(reference, options, state, updateBound) {
  35513. // Resize event listener on window
  35514. state.updateBound = updateBound;
  35515. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  35516. // Scroll event listener on scroll parents
  35517. var scrollElement = getScrollParent(reference);
  35518. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  35519. state.scrollElement = scrollElement;
  35520. state.eventsEnabled = true;
  35521. return state;
  35522. }
  35523. /**
  35524. * It will add resize/scroll events and start recalculating
  35525. * position of the popper element when they are triggered.
  35526. * @method
  35527. * @memberof Popper
  35528. */
  35529. function enableEventListeners() {
  35530. if (!this.state.eventsEnabled) {
  35531. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  35532. }
  35533. }
  35534. /**
  35535. * Remove event listeners used to update the popper position
  35536. * @method
  35537. * @memberof Popper.Utils
  35538. * @private
  35539. */
  35540. function removeEventListeners(reference, state) {
  35541. // Remove resize event listener on window
  35542. getWindow(reference).removeEventListener('resize', state.updateBound);
  35543. // Remove scroll event listener on scroll parents
  35544. state.scrollParents.forEach(function (target) {
  35545. target.removeEventListener('scroll', state.updateBound);
  35546. });
  35547. // Reset state
  35548. state.updateBound = null;
  35549. state.scrollParents = [];
  35550. state.scrollElement = null;
  35551. state.eventsEnabled = false;
  35552. return state;
  35553. }
  35554. /**
  35555. * It will remove resize/scroll events and won't recalculate popper position
  35556. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  35557. * unless you call `update` method manually.
  35558. * @method
  35559. * @memberof Popper
  35560. */
  35561. function disableEventListeners() {
  35562. if (this.state.eventsEnabled) {
  35563. cancelAnimationFrame(this.scheduleUpdate);
  35564. this.state = removeEventListeners(this.reference, this.state);
  35565. }
  35566. }
  35567. /**
  35568. * Tells if a given input is a number
  35569. * @method
  35570. * @memberof Popper.Utils
  35571. * @param {*} input to check
  35572. * @return {Boolean}
  35573. */
  35574. function isNumeric(n) {
  35575. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  35576. }
  35577. /**
  35578. * Set the style to the given popper
  35579. * @method
  35580. * @memberof Popper.Utils
  35581. * @argument {Element} element - Element to apply the style to
  35582. * @argument {Object} styles
  35583. * Object with a list of properties and values which will be applied to the element
  35584. */
  35585. function setStyles(element, styles) {
  35586. Object.keys(styles).forEach(function (prop) {
  35587. var unit = '';
  35588. // add unit if the value is numeric and is one of the following
  35589. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  35590. unit = 'px';
  35591. }
  35592. element.style[prop] = styles[prop] + unit;
  35593. });
  35594. }
  35595. /**
  35596. * Set the attributes to the given popper
  35597. * @method
  35598. * @memberof Popper.Utils
  35599. * @argument {Element} element - Element to apply the attributes to
  35600. * @argument {Object} styles
  35601. * Object with a list of properties and values which will be applied to the element
  35602. */
  35603. function setAttributes(element, attributes) {
  35604. Object.keys(attributes).forEach(function (prop) {
  35605. var value = attributes[prop];
  35606. if (value !== false) {
  35607. element.setAttribute(prop, attributes[prop]);
  35608. } else {
  35609. element.removeAttribute(prop);
  35610. }
  35611. });
  35612. }
  35613. /**
  35614. * @function
  35615. * @memberof Modifiers
  35616. * @argument {Object} data - The data object generated by `update` method
  35617. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  35618. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  35619. * @argument {Object} options - Modifiers configuration and options
  35620. * @returns {Object} The same data object
  35621. */
  35622. function applyStyle(data) {
  35623. // any property present in `data.styles` will be applied to the popper,
  35624. // in this way we can make the 3rd party modifiers add custom styles to it
  35625. // Be aware, modifiers could override the properties defined in the previous
  35626. // lines of this modifier!
  35627. setStyles(data.instance.popper, data.styles);
  35628. // any property present in `data.attributes` will be applied to the popper,
  35629. // they will be set as HTML attributes of the element
  35630. setAttributes(data.instance.popper, data.attributes);
  35631. // if arrowElement is defined and arrowStyles has some properties
  35632. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  35633. setStyles(data.arrowElement, data.arrowStyles);
  35634. }
  35635. return data;
  35636. }
  35637. /**
  35638. * Set the x-placement attribute before everything else because it could be used
  35639. * to add margins to the popper margins needs to be calculated to get the
  35640. * correct popper offsets.
  35641. * @method
  35642. * @memberof Popper.modifiers
  35643. * @param {HTMLElement} reference - The reference element used to position the popper
  35644. * @param {HTMLElement} popper - The HTML element used as popper
  35645. * @param {Object} options - Popper.js options
  35646. */
  35647. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  35648. // compute reference element offsets
  35649. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  35650. // compute auto placement, store placement inside the data object,
  35651. // modifiers will be able to edit `placement` if needed
  35652. // and refer to originalPlacement to know the original value
  35653. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  35654. popper.setAttribute('x-placement', placement);
  35655. // Apply `position` to popper before anything else because
  35656. // without the position applied we can't guarantee correct computations
  35657. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  35658. return options;
  35659. }
  35660. /**
  35661. * @function
  35662. * @memberof Popper.Utils
  35663. * @argument {Object} data - The data object generated by `update` method
  35664. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  35665. * @returns {Object} The popper's position offsets rounded
  35666. *
  35667. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  35668. * good as it can be within reason.
  35669. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  35670. *
  35671. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  35672. * as well on High DPI screens).
  35673. *
  35674. * Firefox prefers no rounding for positioning and does not have blurriness on
  35675. * high DPI screens.
  35676. *
  35677. * Only horizontal placement and left/right values need to be considered.
  35678. */
  35679. function getRoundedOffsets(data, shouldRound) {
  35680. var _data$offsets = data.offsets,
  35681. popper = _data$offsets.popper,
  35682. reference = _data$offsets.reference;
  35683. var round = Math.round,
  35684. floor = Math.floor;
  35685. var noRound = function noRound(v) {
  35686. return v;
  35687. };
  35688. var referenceWidth = round(reference.width);
  35689. var popperWidth = round(popper.width);
  35690. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  35691. var isVariation = data.placement.indexOf('-') !== -1;
  35692. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  35693. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  35694. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  35695. var verticalToInteger = !shouldRound ? noRound : round;
  35696. return {
  35697. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  35698. top: verticalToInteger(popper.top),
  35699. bottom: verticalToInteger(popper.bottom),
  35700. right: horizontalToInteger(popper.right)
  35701. };
  35702. }
  35703. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  35704. /**
  35705. * @function
  35706. * @memberof Modifiers
  35707. * @argument {Object} data - The data object generated by `update` method
  35708. * @argument {Object} options - Modifiers configuration and options
  35709. * @returns {Object} The data object, properly modified
  35710. */
  35711. function computeStyle(data, options) {
  35712. var x = options.x,
  35713. y = options.y;
  35714. var popper = data.offsets.popper;
  35715. // Remove this legacy support in Popper.js v2
  35716. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  35717. return modifier.name === 'applyStyle';
  35718. }).gpuAcceleration;
  35719. if (legacyGpuAccelerationOption !== undefined) {
  35720. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  35721. }
  35722. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  35723. var offsetParent = getOffsetParent(data.instance.popper);
  35724. var offsetParentRect = getBoundingClientRect(offsetParent);
  35725. // Styles
  35726. var styles = {
  35727. position: popper.position
  35728. };
  35729. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  35730. var sideA = x === 'bottom' ? 'top' : 'bottom';
  35731. var sideB = y === 'right' ? 'left' : 'right';
  35732. // if gpuAcceleration is set to `true` and transform is supported,
  35733. // we use `translate3d` to apply the position to the popper we
  35734. // automatically use the supported prefixed version if needed
  35735. var prefixedProperty = getSupportedPropertyName('transform');
  35736. // now, let's make a step back and look at this code closely (wtf?)
  35737. // If the content of the popper grows once it's been positioned, it
  35738. // may happen that the popper gets misplaced because of the new content
  35739. // overflowing its reference element
  35740. // To avoid this problem, we provide two options (x and y), which allow
  35741. // the consumer to define the offset origin.
  35742. // If we position a popper on top of a reference element, we can set
  35743. // `x` to `top` to make the popper grow towards its top instead of
  35744. // its bottom.
  35745. var left = void 0,
  35746. top = void 0;
  35747. if (sideA === 'bottom') {
  35748. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  35749. // and not the bottom of the html element
  35750. if (offsetParent.nodeName === 'HTML') {
  35751. top = -offsetParent.clientHeight + offsets.bottom;
  35752. } else {
  35753. top = -offsetParentRect.height + offsets.bottom;
  35754. }
  35755. } else {
  35756. top = offsets.top;
  35757. }
  35758. if (sideB === 'right') {
  35759. if (offsetParent.nodeName === 'HTML') {
  35760. left = -offsetParent.clientWidth + offsets.right;
  35761. } else {
  35762. left = -offsetParentRect.width + offsets.right;
  35763. }
  35764. } else {
  35765. left = offsets.left;
  35766. }
  35767. if (gpuAcceleration && prefixedProperty) {
  35768. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  35769. styles[sideA] = 0;
  35770. styles[sideB] = 0;
  35771. styles.willChange = 'transform';
  35772. } else {
  35773. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  35774. var invertTop = sideA === 'bottom' ? -1 : 1;
  35775. var invertLeft = sideB === 'right' ? -1 : 1;
  35776. styles[sideA] = top * invertTop;
  35777. styles[sideB] = left * invertLeft;
  35778. styles.willChange = sideA + ', ' + sideB;
  35779. }
  35780. // Attributes
  35781. var attributes = {
  35782. 'x-placement': data.placement
  35783. };
  35784. // Update `data` attributes, styles and arrowStyles
  35785. data.attributes = _extends({}, attributes, data.attributes);
  35786. data.styles = _extends({}, styles, data.styles);
  35787. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  35788. return data;
  35789. }
  35790. /**
  35791. * Helper used to know if the given modifier depends from another one.<br />
  35792. * It checks if the needed modifier is listed and enabled.
  35793. * @method
  35794. * @memberof Popper.Utils
  35795. * @param {Array} modifiers - list of modifiers
  35796. * @param {String} requestingName - name of requesting modifier
  35797. * @param {String} requestedName - name of requested modifier
  35798. * @returns {Boolean}
  35799. */
  35800. function isModifierRequired(modifiers, requestingName, requestedName) {
  35801. var requesting = find(modifiers, function (_ref) {
  35802. var name = _ref.name;
  35803. return name === requestingName;
  35804. });
  35805. var isRequired = !!requesting && modifiers.some(function (modifier) {
  35806. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  35807. });
  35808. if (!isRequired) {
  35809. var _requesting = '`' + requestingName + '`';
  35810. var requested = '`' + requestedName + '`';
  35811. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  35812. }
  35813. return isRequired;
  35814. }
  35815. /**
  35816. * @function
  35817. * @memberof Modifiers
  35818. * @argument {Object} data - The data object generated by update method
  35819. * @argument {Object} options - Modifiers configuration and options
  35820. * @returns {Object} The data object, properly modified
  35821. */
  35822. function arrow(data, options) {
  35823. var _data$offsets$arrow;
  35824. // arrow depends on keepTogether in order to work
  35825. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  35826. return data;
  35827. }
  35828. var arrowElement = options.element;
  35829. // if arrowElement is a string, suppose it's a CSS selector
  35830. if (typeof arrowElement === 'string') {
  35831. arrowElement = data.instance.popper.querySelector(arrowElement);
  35832. // if arrowElement is not found, don't run the modifier
  35833. if (!arrowElement) {
  35834. return data;
  35835. }
  35836. } else {
  35837. // if the arrowElement isn't a query selector we must check that the
  35838. // provided DOM node is child of its popper node
  35839. if (!data.instance.popper.contains(arrowElement)) {
  35840. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  35841. return data;
  35842. }
  35843. }
  35844. var placement = data.placement.split('-')[0];
  35845. var _data$offsets = data.offsets,
  35846. popper = _data$offsets.popper,
  35847. reference = _data$offsets.reference;
  35848. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  35849. var len = isVertical ? 'height' : 'width';
  35850. var sideCapitalized = isVertical ? 'Top' : 'Left';
  35851. var side = sideCapitalized.toLowerCase();
  35852. var altSide = isVertical ? 'left' : 'top';
  35853. var opSide = isVertical ? 'bottom' : 'right';
  35854. var arrowElementSize = getOuterSizes(arrowElement)[len];
  35855. //
  35856. // extends keepTogether behavior making sure the popper and its
  35857. // reference have enough pixels in conjunction
  35858. //
  35859. // top/left side
  35860. if (reference[opSide] - arrowElementSize < popper[side]) {
  35861. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  35862. }
  35863. // bottom/right side
  35864. if (reference[side] + arrowElementSize > popper[opSide]) {
  35865. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  35866. }
  35867. data.offsets.popper = getClientRect(data.offsets.popper);
  35868. // compute center of the popper
  35869. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  35870. // Compute the sideValue using the updated popper offsets
  35871. // take popper margin in account because we don't have this info available
  35872. var css = getStyleComputedProperty(data.instance.popper);
  35873. var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
  35874. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
  35875. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  35876. // prevent arrowElement from being placed not contiguously to its popper
  35877. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  35878. data.arrowElement = arrowElement;
  35879. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  35880. return data;
  35881. }
  35882. /**
  35883. * Get the opposite placement variation of the given one
  35884. * @method
  35885. * @memberof Popper.Utils
  35886. * @argument {String} placement variation
  35887. * @returns {String} flipped placement variation
  35888. */
  35889. function getOppositeVariation(variation) {
  35890. if (variation === 'end') {
  35891. return 'start';
  35892. } else if (variation === 'start') {
  35893. return 'end';
  35894. }
  35895. return variation;
  35896. }
  35897. /**
  35898. * List of accepted placements to use as values of the `placement` option.<br />
  35899. * Valid placements are:
  35900. * - `auto`
  35901. * - `top`
  35902. * - `right`
  35903. * - `bottom`
  35904. * - `left`
  35905. *
  35906. * Each placement can have a variation from this list:
  35907. * - `-start`
  35908. * - `-end`
  35909. *
  35910. * Variations are interpreted easily if you think of them as the left to right
  35911. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  35912. * is right.<br />
  35913. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  35914. *
  35915. * Some valid examples are:
  35916. * - `top-end` (on top of reference, right aligned)
  35917. * - `right-start` (on right of reference, top aligned)
  35918. * - `bottom` (on bottom, centered)
  35919. * - `auto-end` (on the side with more space available, alignment depends by placement)
  35920. *
  35921. * @static
  35922. * @type {Array}
  35923. * @enum {String}
  35924. * @readonly
  35925. * @method placements
  35926. * @memberof Popper
  35927. */
  35928. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  35929. // Get rid of `auto` `auto-start` and `auto-end`
  35930. var validPlacements = placements.slice(3);
  35931. /**
  35932. * Given an initial placement, returns all the subsequent placements
  35933. * clockwise (or counter-clockwise).
  35934. *
  35935. * @method
  35936. * @memberof Popper.Utils
  35937. * @argument {String} placement - A valid placement (it accepts variations)
  35938. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  35939. * @returns {Array} placements including their variations
  35940. */
  35941. function clockwise(placement) {
  35942. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  35943. var index = validPlacements.indexOf(placement);
  35944. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  35945. return counter ? arr.reverse() : arr;
  35946. }
  35947. var BEHAVIORS = {
  35948. FLIP: 'flip',
  35949. CLOCKWISE: 'clockwise',
  35950. COUNTERCLOCKWISE: 'counterclockwise'
  35951. };
  35952. /**
  35953. * @function
  35954. * @memberof Modifiers
  35955. * @argument {Object} data - The data object generated by update method
  35956. * @argument {Object} options - Modifiers configuration and options
  35957. * @returns {Object} The data object, properly modified
  35958. */
  35959. function flip(data, options) {
  35960. // if `inner` modifier is enabled, we can't use the `flip` modifier
  35961. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  35962. return data;
  35963. }
  35964. if (data.flipped && data.placement === data.originalPlacement) {
  35965. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  35966. return data;
  35967. }
  35968. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  35969. var placement = data.placement.split('-')[0];
  35970. var placementOpposite = getOppositePlacement(placement);
  35971. var variation = data.placement.split('-')[1] || '';
  35972. var flipOrder = [];
  35973. switch (options.behavior) {
  35974. case BEHAVIORS.FLIP:
  35975. flipOrder = [placement, placementOpposite];
  35976. break;
  35977. case BEHAVIORS.CLOCKWISE:
  35978. flipOrder = clockwise(placement);
  35979. break;
  35980. case BEHAVIORS.COUNTERCLOCKWISE:
  35981. flipOrder = clockwise(placement, true);
  35982. break;
  35983. default:
  35984. flipOrder = options.behavior;
  35985. }
  35986. flipOrder.forEach(function (step, index) {
  35987. if (placement !== step || flipOrder.length === index + 1) {
  35988. return data;
  35989. }
  35990. placement = data.placement.split('-')[0];
  35991. placementOpposite = getOppositePlacement(placement);
  35992. var popperOffsets = data.offsets.popper;
  35993. var refOffsets = data.offsets.reference;
  35994. // using floor because the reference offsets may contain decimals we are not going to consider here
  35995. var floor = Math.floor;
  35996. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  35997. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  35998. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  35999. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  36000. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  36001. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  36002. // flip the variation if required
  36003. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  36004. // flips variation if reference element overflows boundaries
  36005. var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  36006. // flips variation if popper content overflows boundaries
  36007. var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
  36008. var flippedVariation = flippedVariationByRef || flippedVariationByContent;
  36009. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  36010. // this boolean to detect any flip loop
  36011. data.flipped = true;
  36012. if (overlapsRef || overflowsBoundaries) {
  36013. placement = flipOrder[index + 1];
  36014. }
  36015. if (flippedVariation) {
  36016. variation = getOppositeVariation(variation);
  36017. }
  36018. data.placement = placement + (variation ? '-' + variation : '');
  36019. // this object contains `position`, we want to preserve it along with
  36020. // any additional property we may add in the future
  36021. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  36022. data = runModifiers(data.instance.modifiers, data, 'flip');
  36023. }
  36024. });
  36025. return data;
  36026. }
  36027. /**
  36028. * @function
  36029. * @memberof Modifiers
  36030. * @argument {Object} data - The data object generated by update method
  36031. * @argument {Object} options - Modifiers configuration and options
  36032. * @returns {Object} The data object, properly modified
  36033. */
  36034. function keepTogether(data) {
  36035. var _data$offsets = data.offsets,
  36036. popper = _data$offsets.popper,
  36037. reference = _data$offsets.reference;
  36038. var placement = data.placement.split('-')[0];
  36039. var floor = Math.floor;
  36040. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  36041. var side = isVertical ? 'right' : 'bottom';
  36042. var opSide = isVertical ? 'left' : 'top';
  36043. var measurement = isVertical ? 'width' : 'height';
  36044. if (popper[side] < floor(reference[opSide])) {
  36045. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  36046. }
  36047. if (popper[opSide] > floor(reference[side])) {
  36048. data.offsets.popper[opSide] = floor(reference[side]);
  36049. }
  36050. return data;
  36051. }
  36052. /**
  36053. * Converts a string containing value + unit into a px value number
  36054. * @function
  36055. * @memberof {modifiers~offset}
  36056. * @private
  36057. * @argument {String} str - Value + unit string
  36058. * @argument {String} measurement - `height` or `width`
  36059. * @argument {Object} popperOffsets
  36060. * @argument {Object} referenceOffsets
  36061. * @returns {Number|String}
  36062. * Value in pixels, or original string if no values were extracted
  36063. */
  36064. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  36065. // separate value from unit
  36066. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  36067. var value = +split[1];
  36068. var unit = split[2];
  36069. // If it's not a number it's an operator, I guess
  36070. if (!value) {
  36071. return str;
  36072. }
  36073. if (unit.indexOf('%') === 0) {
  36074. var element = void 0;
  36075. switch (unit) {
  36076. case '%p':
  36077. element = popperOffsets;
  36078. break;
  36079. case '%':
  36080. case '%r':
  36081. default:
  36082. element = referenceOffsets;
  36083. }
  36084. var rect = getClientRect(element);
  36085. return rect[measurement] / 100 * value;
  36086. } else if (unit === 'vh' || unit === 'vw') {
  36087. // if is a vh or vw, we calculate the size based on the viewport
  36088. var size = void 0;
  36089. if (unit === 'vh') {
  36090. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  36091. } else {
  36092. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  36093. }
  36094. return size / 100 * value;
  36095. } else {
  36096. // if is an explicit pixel unit, we get rid of the unit and keep the value
  36097. // if is an implicit unit, it's px, and we return just the value
  36098. return value;
  36099. }
  36100. }
  36101. /**
  36102. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  36103. * @function
  36104. * @memberof {modifiers~offset}
  36105. * @private
  36106. * @argument {String} offset
  36107. * @argument {Object} popperOffsets
  36108. * @argument {Object} referenceOffsets
  36109. * @argument {String} basePlacement
  36110. * @returns {Array} a two cells array with x and y offsets in numbers
  36111. */
  36112. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  36113. var offsets = [0, 0];
  36114. // Use height if placement is left or right and index is 0 otherwise use width
  36115. // in this way the first offset will use an axis and the second one
  36116. // will use the other one
  36117. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  36118. // Split the offset string to obtain a list of values and operands
  36119. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  36120. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  36121. return frag.trim();
  36122. });
  36123. // Detect if the offset string contains a pair of values or a single one
  36124. // they could be separated by comma or space
  36125. var divider = fragments.indexOf(find(fragments, function (frag) {
  36126. return frag.search(/,|\s/) !== -1;
  36127. }));
  36128. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  36129. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  36130. }
  36131. // If divider is found, we divide the list of values and operands to divide
  36132. // them by ofset X and Y.
  36133. var splitRegex = /\s*,\s*|\s+/;
  36134. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  36135. // Convert the values with units to absolute pixels to allow our computations
  36136. ops = ops.map(function (op, index) {
  36137. // Most of the units rely on the orientation of the popper
  36138. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  36139. var mergeWithPrevious = false;
  36140. return op
  36141. // This aggregates any `+` or `-` sign that aren't considered operators
  36142. // e.g.: 10 + +5 => [10, +, +5]
  36143. .reduce(function (a, b) {
  36144. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  36145. a[a.length - 1] = b;
  36146. mergeWithPrevious = true;
  36147. return a;
  36148. } else if (mergeWithPrevious) {
  36149. a[a.length - 1] += b;
  36150. mergeWithPrevious = false;
  36151. return a;
  36152. } else {
  36153. return a.concat(b);
  36154. }
  36155. }, [])
  36156. // Here we convert the string values into number values (in px)
  36157. .map(function (str) {
  36158. return toValue(str, measurement, popperOffsets, referenceOffsets);
  36159. });
  36160. });
  36161. // Loop trough the offsets arrays and execute the operations
  36162. ops.forEach(function (op, index) {
  36163. op.forEach(function (frag, index2) {
  36164. if (isNumeric(frag)) {
  36165. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  36166. }
  36167. });
  36168. });
  36169. return offsets;
  36170. }
  36171. /**
  36172. * @function
  36173. * @memberof Modifiers
  36174. * @argument {Object} data - The data object generated by update method
  36175. * @argument {Object} options - Modifiers configuration and options
  36176. * @argument {Number|String} options.offset=0
  36177. * The offset value as described in the modifier description
  36178. * @returns {Object} The data object, properly modified
  36179. */
  36180. function offset(data, _ref) {
  36181. var offset = _ref.offset;
  36182. var placement = data.placement,
  36183. _data$offsets = data.offsets,
  36184. popper = _data$offsets.popper,
  36185. reference = _data$offsets.reference;
  36186. var basePlacement = placement.split('-')[0];
  36187. var offsets = void 0;
  36188. if (isNumeric(+offset)) {
  36189. offsets = [+offset, 0];
  36190. } else {
  36191. offsets = parseOffset(offset, popper, reference, basePlacement);
  36192. }
  36193. if (basePlacement === 'left') {
  36194. popper.top += offsets[0];
  36195. popper.left -= offsets[1];
  36196. } else if (basePlacement === 'right') {
  36197. popper.top += offsets[0];
  36198. popper.left += offsets[1];
  36199. } else if (basePlacement === 'top') {
  36200. popper.left += offsets[0];
  36201. popper.top -= offsets[1];
  36202. } else if (basePlacement === 'bottom') {
  36203. popper.left += offsets[0];
  36204. popper.top += offsets[1];
  36205. }
  36206. data.popper = popper;
  36207. return data;
  36208. }
  36209. /**
  36210. * @function
  36211. * @memberof Modifiers
  36212. * @argument {Object} data - The data object generated by `update` method
  36213. * @argument {Object} options - Modifiers configuration and options
  36214. * @returns {Object} The data object, properly modified
  36215. */
  36216. function preventOverflow(data, options) {
  36217. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  36218. // If offsetParent is the reference element, we really want to
  36219. // go one step up and use the next offsetParent as reference to
  36220. // avoid to make this modifier completely useless and look like broken
  36221. if (data.instance.reference === boundariesElement) {
  36222. boundariesElement = getOffsetParent(boundariesElement);
  36223. }
  36224. // NOTE: DOM access here
  36225. // resets the popper's position so that the document size can be calculated excluding
  36226. // the size of the popper element itself
  36227. var transformProp = getSupportedPropertyName('transform');
  36228. var popperStyles = data.instance.popper.style; // assignment to help minification
  36229. var top = popperStyles.top,
  36230. left = popperStyles.left,
  36231. transform = popperStyles[transformProp];
  36232. popperStyles.top = '';
  36233. popperStyles.left = '';
  36234. popperStyles[transformProp] = '';
  36235. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  36236. // NOTE: DOM access here
  36237. // restores the original style properties after the offsets have been computed
  36238. popperStyles.top = top;
  36239. popperStyles.left = left;
  36240. popperStyles[transformProp] = transform;
  36241. options.boundaries = boundaries;
  36242. var order = options.priority;
  36243. var popper = data.offsets.popper;
  36244. var check = {
  36245. primary: function primary(placement) {
  36246. var value = popper[placement];
  36247. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  36248. value = Math.max(popper[placement], boundaries[placement]);
  36249. }
  36250. return defineProperty({}, placement, value);
  36251. },
  36252. secondary: function secondary(placement) {
  36253. var mainSide = placement === 'right' ? 'left' : 'top';
  36254. var value = popper[mainSide];
  36255. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  36256. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  36257. }
  36258. return defineProperty({}, mainSide, value);
  36259. }
  36260. };
  36261. order.forEach(function (placement) {
  36262. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  36263. popper = _extends({}, popper, check[side](placement));
  36264. });
  36265. data.offsets.popper = popper;
  36266. return data;
  36267. }
  36268. /**
  36269. * @function
  36270. * @memberof Modifiers
  36271. * @argument {Object} data - The data object generated by `update` method
  36272. * @argument {Object} options - Modifiers configuration and options
  36273. * @returns {Object} The data object, properly modified
  36274. */
  36275. function shift(data) {
  36276. var placement = data.placement;
  36277. var basePlacement = placement.split('-')[0];
  36278. var shiftvariation = placement.split('-')[1];
  36279. // if shift shiftvariation is specified, run the modifier
  36280. if (shiftvariation) {
  36281. var _data$offsets = data.offsets,
  36282. reference = _data$offsets.reference,
  36283. popper = _data$offsets.popper;
  36284. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  36285. var side = isVertical ? 'left' : 'top';
  36286. var measurement = isVertical ? 'width' : 'height';
  36287. var shiftOffsets = {
  36288. start: defineProperty({}, side, reference[side]),
  36289. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  36290. };
  36291. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  36292. }
  36293. return data;
  36294. }
  36295. /**
  36296. * @function
  36297. * @memberof Modifiers
  36298. * @argument {Object} data - The data object generated by update method
  36299. * @argument {Object} options - Modifiers configuration and options
  36300. * @returns {Object} The data object, properly modified
  36301. */
  36302. function hide(data) {
  36303. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  36304. return data;
  36305. }
  36306. var refRect = data.offsets.reference;
  36307. var bound = find(data.instance.modifiers, function (modifier) {
  36308. return modifier.name === 'preventOverflow';
  36309. }).boundaries;
  36310. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  36311. // Avoid unnecessary DOM access if visibility hasn't changed
  36312. if (data.hide === true) {
  36313. return data;
  36314. }
  36315. data.hide = true;
  36316. data.attributes['x-out-of-boundaries'] = '';
  36317. } else {
  36318. // Avoid unnecessary DOM access if visibility hasn't changed
  36319. if (data.hide === false) {
  36320. return data;
  36321. }
  36322. data.hide = false;
  36323. data.attributes['x-out-of-boundaries'] = false;
  36324. }
  36325. return data;
  36326. }
  36327. /**
  36328. * @function
  36329. * @memberof Modifiers
  36330. * @argument {Object} data - The data object generated by `update` method
  36331. * @argument {Object} options - Modifiers configuration and options
  36332. * @returns {Object} The data object, properly modified
  36333. */
  36334. function inner(data) {
  36335. var placement = data.placement;
  36336. var basePlacement = placement.split('-')[0];
  36337. var _data$offsets = data.offsets,
  36338. popper = _data$offsets.popper,
  36339. reference = _data$offsets.reference;
  36340. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  36341. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  36342. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  36343. data.placement = getOppositePlacement(placement);
  36344. data.offsets.popper = getClientRect(popper);
  36345. return data;
  36346. }
  36347. /**
  36348. * Modifier function, each modifier can have a function of this type assigned
  36349. * to its `fn` property.<br />
  36350. * These functions will be called on each update, this means that you must
  36351. * make sure they are performant enough to avoid performance bottlenecks.
  36352. *
  36353. * @function ModifierFn
  36354. * @argument {dataObject} data - The data object generated by `update` method
  36355. * @argument {Object} options - Modifiers configuration and options
  36356. * @returns {dataObject} The data object, properly modified
  36357. */
  36358. /**
  36359. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  36360. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  36361. * needed by the library.
  36362. *
  36363. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  36364. * All the other properties are configurations that could be tweaked.
  36365. * @namespace modifiers
  36366. */
  36367. var modifiers = {
  36368. /**
  36369. * Modifier used to shift the popper on the start or end of its reference
  36370. * element.<br />
  36371. * It will read the variation of the `placement` property.<br />
  36372. * It can be one either `-end` or `-start`.
  36373. * @memberof modifiers
  36374. * @inner
  36375. */
  36376. shift: {
  36377. /** @prop {number} order=100 - Index used to define the order of execution */
  36378. order: 100,
  36379. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36380. enabled: true,
  36381. /** @prop {ModifierFn} */
  36382. fn: shift
  36383. },
  36384. /**
  36385. * The `offset` modifier can shift your popper on both its axis.
  36386. *
  36387. * It accepts the following units:
  36388. * - `px` or unit-less, interpreted as pixels
  36389. * - `%` or `%r`, percentage relative to the length of the reference element
  36390. * - `%p`, percentage relative to the length of the popper element
  36391. * - `vw`, CSS viewport width unit
  36392. * - `vh`, CSS viewport height unit
  36393. *
  36394. * For length is intended the main axis relative to the placement of the popper.<br />
  36395. * This means that if the placement is `top` or `bottom`, the length will be the
  36396. * `width`. In case of `left` or `right`, it will be the `height`.
  36397. *
  36398. * You can provide a single value (as `Number` or `String`), or a pair of values
  36399. * as `String` divided by a comma or one (or more) white spaces.<br />
  36400. * The latter is a deprecated method because it leads to confusion and will be
  36401. * removed in v2.<br />
  36402. * Additionally, it accepts additions and subtractions between different units.
  36403. * Note that multiplications and divisions aren't supported.
  36404. *
  36405. * Valid examples are:
  36406. * ```
  36407. * 10
  36408. * '10%'
  36409. * '10, 10'
  36410. * '10%, 10'
  36411. * '10 + 10%'
  36412. * '10 - 5vh + 3%'
  36413. * '-10px + 5vh, 5px - 6%'
  36414. * ```
  36415. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  36416. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  36417. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  36418. *
  36419. * @memberof modifiers
  36420. * @inner
  36421. */
  36422. offset: {
  36423. /** @prop {number} order=200 - Index used to define the order of execution */
  36424. order: 200,
  36425. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36426. enabled: true,
  36427. /** @prop {ModifierFn} */
  36428. fn: offset,
  36429. /** @prop {Number|String} offset=0
  36430. * The offset value as described in the modifier description
  36431. */
  36432. offset: 0
  36433. },
  36434. /**
  36435. * Modifier used to prevent the popper from being positioned outside the boundary.
  36436. *
  36437. * A scenario exists where the reference itself is not within the boundaries.<br />
  36438. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  36439. * In this case we need to decide whether the popper should either:
  36440. *
  36441. * - detach from the reference and remain "trapped" in the boundaries, or
  36442. * - if it should ignore the boundary and "escape with its reference"
  36443. *
  36444. * When `escapeWithReference` is set to`true` and reference is completely
  36445. * outside its boundaries, the popper will overflow (or completely leave)
  36446. * the boundaries in order to remain attached to the edge of the reference.
  36447. *
  36448. * @memberof modifiers
  36449. * @inner
  36450. */
  36451. preventOverflow: {
  36452. /** @prop {number} order=300 - Index used to define the order of execution */
  36453. order: 300,
  36454. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36455. enabled: true,
  36456. /** @prop {ModifierFn} */
  36457. fn: preventOverflow,
  36458. /**
  36459. * @prop {Array} [priority=['left','right','top','bottom']]
  36460. * Popper will try to prevent overflow following these priorities by default,
  36461. * then, it could overflow on the left and on top of the `boundariesElement`
  36462. */
  36463. priority: ['left', 'right', 'top', 'bottom'],
  36464. /**
  36465. * @prop {number} padding=5
  36466. * Amount of pixel used to define a minimum distance between the boundaries
  36467. * and the popper. This makes sure the popper always has a little padding
  36468. * between the edges of its container
  36469. */
  36470. padding: 5,
  36471. /**
  36472. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  36473. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  36474. * `viewport` or any DOM element.
  36475. */
  36476. boundariesElement: 'scrollParent'
  36477. },
  36478. /**
  36479. * Modifier used to make sure the reference and its popper stay near each other
  36480. * without leaving any gap between the two. Especially useful when the arrow is
  36481. * enabled and you want to ensure that it points to its reference element.
  36482. * It cares only about the first axis. You can still have poppers with margin
  36483. * between the popper and its reference element.
  36484. * @memberof modifiers
  36485. * @inner
  36486. */
  36487. keepTogether: {
  36488. /** @prop {number} order=400 - Index used to define the order of execution */
  36489. order: 400,
  36490. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36491. enabled: true,
  36492. /** @prop {ModifierFn} */
  36493. fn: keepTogether
  36494. },
  36495. /**
  36496. * This modifier is used to move the `arrowElement` of the popper to make
  36497. * sure it is positioned between the reference element and its popper element.
  36498. * It will read the outer size of the `arrowElement` node to detect how many
  36499. * pixels of conjunction are needed.
  36500. *
  36501. * It has no effect if no `arrowElement` is provided.
  36502. * @memberof modifiers
  36503. * @inner
  36504. */
  36505. arrow: {
  36506. /** @prop {number} order=500 - Index used to define the order of execution */
  36507. order: 500,
  36508. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36509. enabled: true,
  36510. /** @prop {ModifierFn} */
  36511. fn: arrow,
  36512. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  36513. element: '[x-arrow]'
  36514. },
  36515. /**
  36516. * Modifier used to flip the popper's placement when it starts to overlap its
  36517. * reference element.
  36518. *
  36519. * Requires the `preventOverflow` modifier before it in order to work.
  36520. *
  36521. * **NOTE:** this modifier will interrupt the current update cycle and will
  36522. * restart it if it detects the need to flip the placement.
  36523. * @memberof modifiers
  36524. * @inner
  36525. */
  36526. flip: {
  36527. /** @prop {number} order=600 - Index used to define the order of execution */
  36528. order: 600,
  36529. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36530. enabled: true,
  36531. /** @prop {ModifierFn} */
  36532. fn: flip,
  36533. /**
  36534. * @prop {String|Array} behavior='flip'
  36535. * The behavior used to change the popper's placement. It can be one of
  36536. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  36537. * placements (with optional variations)
  36538. */
  36539. behavior: 'flip',
  36540. /**
  36541. * @prop {number} padding=5
  36542. * The popper will flip if it hits the edges of the `boundariesElement`
  36543. */
  36544. padding: 5,
  36545. /**
  36546. * @prop {String|HTMLElement} boundariesElement='viewport'
  36547. * The element which will define the boundaries of the popper position.
  36548. * The popper will never be placed outside of the defined boundaries
  36549. * (except if `keepTogether` is enabled)
  36550. */
  36551. boundariesElement: 'viewport',
  36552. /**
  36553. * @prop {Boolean} flipVariations=false
  36554. * The popper will switch placement variation between `-start` and `-end` when
  36555. * the reference element overlaps its boundaries.
  36556. *
  36557. * The original placement should have a set variation.
  36558. */
  36559. flipVariations: false,
  36560. /**
  36561. * @prop {Boolean} flipVariationsByContent=false
  36562. * The popper will switch placement variation between `-start` and `-end` when
  36563. * the popper element overlaps its reference boundaries.
  36564. *
  36565. * The original placement should have a set variation.
  36566. */
  36567. flipVariationsByContent: false
  36568. },
  36569. /**
  36570. * Modifier used to make the popper flow toward the inner of the reference element.
  36571. * By default, when this modifier is disabled, the popper will be placed outside
  36572. * the reference element.
  36573. * @memberof modifiers
  36574. * @inner
  36575. */
  36576. inner: {
  36577. /** @prop {number} order=700 - Index used to define the order of execution */
  36578. order: 700,
  36579. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  36580. enabled: false,
  36581. /** @prop {ModifierFn} */
  36582. fn: inner
  36583. },
  36584. /**
  36585. * Modifier used to hide the popper when its reference element is outside of the
  36586. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  36587. * be used to hide with a CSS selector the popper when its reference is
  36588. * out of boundaries.
  36589. *
  36590. * Requires the `preventOverflow` modifier before it in order to work.
  36591. * @memberof modifiers
  36592. * @inner
  36593. */
  36594. hide: {
  36595. /** @prop {number} order=800 - Index used to define the order of execution */
  36596. order: 800,
  36597. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36598. enabled: true,
  36599. /** @prop {ModifierFn} */
  36600. fn: hide
  36601. },
  36602. /**
  36603. * Computes the style that will be applied to the popper element to gets
  36604. * properly positioned.
  36605. *
  36606. * Note that this modifier will not touch the DOM, it just prepares the styles
  36607. * so that `applyStyle` modifier can apply it. This separation is useful
  36608. * in case you need to replace `applyStyle` with a custom implementation.
  36609. *
  36610. * This modifier has `850` as `order` value to maintain backward compatibility
  36611. * with previous versions of Popper.js. Expect the modifiers ordering method
  36612. * to change in future major versions of the library.
  36613. *
  36614. * @memberof modifiers
  36615. * @inner
  36616. */
  36617. computeStyle: {
  36618. /** @prop {number} order=850 - Index used to define the order of execution */
  36619. order: 850,
  36620. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36621. enabled: true,
  36622. /** @prop {ModifierFn} */
  36623. fn: computeStyle,
  36624. /**
  36625. * @prop {Boolean} gpuAcceleration=true
  36626. * If true, it uses the CSS 3D transformation to position the popper.
  36627. * Otherwise, it will use the `top` and `left` properties
  36628. */
  36629. gpuAcceleration: true,
  36630. /**
  36631. * @prop {string} [x='bottom']
  36632. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  36633. * Change this if your popper should grow in a direction different from `bottom`
  36634. */
  36635. x: 'bottom',
  36636. /**
  36637. * @prop {string} [x='left']
  36638. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  36639. * Change this if your popper should grow in a direction different from `right`
  36640. */
  36641. y: 'right'
  36642. },
  36643. /**
  36644. * Applies the computed styles to the popper element.
  36645. *
  36646. * All the DOM manipulations are limited to this modifier. This is useful in case
  36647. * you want to integrate Popper.js inside a framework or view library and you
  36648. * want to delegate all the DOM manipulations to it.
  36649. *
  36650. * Note that if you disable this modifier, you must make sure the popper element
  36651. * has its position set to `absolute` before Popper.js can do its work!
  36652. *
  36653. * Just disable this modifier and define your own to achieve the desired effect.
  36654. *
  36655. * @memberof modifiers
  36656. * @inner
  36657. */
  36658. applyStyle: {
  36659. /** @prop {number} order=900 - Index used to define the order of execution */
  36660. order: 900,
  36661. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36662. enabled: true,
  36663. /** @prop {ModifierFn} */
  36664. fn: applyStyle,
  36665. /** @prop {Function} */
  36666. onLoad: applyStyleOnLoad,
  36667. /**
  36668. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  36669. * @prop {Boolean} gpuAcceleration=true
  36670. * If true, it uses the CSS 3D transformation to position the popper.
  36671. * Otherwise, it will use the `top` and `left` properties
  36672. */
  36673. gpuAcceleration: undefined
  36674. }
  36675. };
  36676. /**
  36677. * The `dataObject` is an object containing all the information used by Popper.js.
  36678. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  36679. * @name dataObject
  36680. * @property {Object} data.instance The Popper.js instance
  36681. * @property {String} data.placement Placement applied to popper
  36682. * @property {String} data.originalPlacement Placement originally defined on init
  36683. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  36684. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  36685. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  36686. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  36687. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  36688. * @property {Object} data.boundaries Offsets of the popper boundaries
  36689. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  36690. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  36691. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  36692. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  36693. */
  36694. /**
  36695. * Default options provided to Popper.js constructor.<br />
  36696. * These can be overridden using the `options` argument of Popper.js.<br />
  36697. * To override an option, simply pass an object with the same
  36698. * structure of the `options` object, as the 3rd argument. For example:
  36699. * ```
  36700. * new Popper(ref, pop, {
  36701. * modifiers: {
  36702. * preventOverflow: { enabled: false }
  36703. * }
  36704. * })
  36705. * ```
  36706. * @type {Object}
  36707. * @static
  36708. * @memberof Popper
  36709. */
  36710. var Defaults = {
  36711. /**
  36712. * Popper's placement.
  36713. * @prop {Popper.placements} placement='bottom'
  36714. */
  36715. placement: 'bottom',
  36716. /**
  36717. * Set this to true if you want popper to position it self in 'fixed' mode
  36718. * @prop {Boolean} positionFixed=false
  36719. */
  36720. positionFixed: false,
  36721. /**
  36722. * Whether events (resize, scroll) are initially enabled.
  36723. * @prop {Boolean} eventsEnabled=true
  36724. */
  36725. eventsEnabled: true,
  36726. /**
  36727. * Set to true if you want to automatically remove the popper when
  36728. * you call the `destroy` method.
  36729. * @prop {Boolean} removeOnDestroy=false
  36730. */
  36731. removeOnDestroy: false,
  36732. /**
  36733. * Callback called when the popper is created.<br />
  36734. * By default, it is set to no-op.<br />
  36735. * Access Popper.js instance with `data.instance`.
  36736. * @prop {onCreate}
  36737. */
  36738. onCreate: function onCreate() {},
  36739. /**
  36740. * Callback called when the popper is updated. This callback is not called
  36741. * on the initialization/creation of the popper, but only on subsequent
  36742. * updates.<br />
  36743. * By default, it is set to no-op.<br />
  36744. * Access Popper.js instance with `data.instance`.
  36745. * @prop {onUpdate}
  36746. */
  36747. onUpdate: function onUpdate() {},
  36748. /**
  36749. * List of modifiers used to modify the offsets before they are applied to the popper.
  36750. * They provide most of the functionalities of Popper.js.
  36751. * @prop {modifiers}
  36752. */
  36753. modifiers: modifiers
  36754. };
  36755. /**
  36756. * @callback onCreate
  36757. * @param {dataObject} data
  36758. */
  36759. /**
  36760. * @callback onUpdate
  36761. * @param {dataObject} data
  36762. */
  36763. // Utils
  36764. // Methods
  36765. var Popper = function () {
  36766. /**
  36767. * Creates a new Popper.js instance.
  36768. * @class Popper
  36769. * @param {Element|referenceObject} reference - The reference element used to position the popper
  36770. * @param {Element} popper - The HTML / XML element used as the popper
  36771. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  36772. * @return {Object} instance - The generated Popper.js instance
  36773. */
  36774. function Popper(reference, popper) {
  36775. var _this = this;
  36776. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  36777. classCallCheck(this, Popper);
  36778. this.scheduleUpdate = function () {
  36779. return requestAnimationFrame(_this.update);
  36780. };
  36781. // make update() debounced, so that it only runs at most once-per-tick
  36782. this.update = debounce(this.update.bind(this));
  36783. // with {} we create a new object with the options inside it
  36784. this.options = _extends({}, Popper.Defaults, options);
  36785. // init state
  36786. this.state = {
  36787. isDestroyed: false,
  36788. isCreated: false,
  36789. scrollParents: []
  36790. };
  36791. // get reference and popper elements (allow jQuery wrappers)
  36792. this.reference = reference && reference.jquery ? reference[0] : reference;
  36793. this.popper = popper && popper.jquery ? popper[0] : popper;
  36794. // Deep merge modifiers options
  36795. this.options.modifiers = {};
  36796. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  36797. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  36798. });
  36799. // Refactoring modifiers' list (Object => Array)
  36800. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  36801. return _extends({
  36802. name: name
  36803. }, _this.options.modifiers[name]);
  36804. })
  36805. // sort the modifiers by order
  36806. .sort(function (a, b) {
  36807. return a.order - b.order;
  36808. });
  36809. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  36810. // such code is executed in the same order of its modifier
  36811. // they could add new properties to their options configuration
  36812. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  36813. this.modifiers.forEach(function (modifierOptions) {
  36814. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  36815. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  36816. }
  36817. });
  36818. // fire the first update to position the popper in the right place
  36819. this.update();
  36820. var eventsEnabled = this.options.eventsEnabled;
  36821. if (eventsEnabled) {
  36822. // setup event listeners, they will take care of update the position in specific situations
  36823. this.enableEventListeners();
  36824. }
  36825. this.state.eventsEnabled = eventsEnabled;
  36826. }
  36827. // We can't use class properties because they don't get listed in the
  36828. // class prototype and break stuff like Sinon stubs
  36829. createClass(Popper, [{
  36830. key: 'update',
  36831. value: function update$$1() {
  36832. return update.call(this);
  36833. }
  36834. }, {
  36835. key: 'destroy',
  36836. value: function destroy$$1() {
  36837. return destroy.call(this);
  36838. }
  36839. }, {
  36840. key: 'enableEventListeners',
  36841. value: function enableEventListeners$$1() {
  36842. return enableEventListeners.call(this);
  36843. }
  36844. }, {
  36845. key: 'disableEventListeners',
  36846. value: function disableEventListeners$$1() {
  36847. return disableEventListeners.call(this);
  36848. }
  36849. /**
  36850. * Schedules an update. It will run on the next UI update available.
  36851. * @method scheduleUpdate
  36852. * @memberof Popper
  36853. */
  36854. /**
  36855. * Collection of utilities useful when writing custom modifiers.
  36856. * Starting from version 1.7, this method is available only if you
  36857. * include `popper-utils.js` before `popper.js`.
  36858. *
  36859. * **DEPRECATION**: This way to access PopperUtils is deprecated
  36860. * and will be removed in v2! Use the PopperUtils module directly instead.
  36861. * Due to the high instability of the methods contained in Utils, we can't
  36862. * guarantee them to follow semver. Use them at your own risk!
  36863. * @static
  36864. * @private
  36865. * @type {Object}
  36866. * @deprecated since version 1.8
  36867. * @member Utils
  36868. * @memberof Popper
  36869. */
  36870. }]);
  36871. return Popper;
  36872. }();
  36873. /**
  36874. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  36875. * and lets you use it as replacement of a real DOM node.<br />
  36876. * You can use this method to position a popper relatively to a set of coordinates
  36877. * in case you don't have a DOM node to use as reference.
  36878. *
  36879. * ```
  36880. * new Popper(referenceObject, popperNode);
  36881. * ```
  36882. *
  36883. * NB: This feature isn't supported in Internet Explorer 10.
  36884. * @name referenceObject
  36885. * @property {Function} data.getBoundingClientRect
  36886. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  36887. * @property {number} data.clientWidth
  36888. * An ES6 getter that will return the width of the virtual reference element.
  36889. * @property {number} data.clientHeight
  36890. * An ES6 getter that will return the height of the virtual reference element.
  36891. */
  36892. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  36893. Popper.placements = placements;
  36894. Popper.Defaults = Defaults;
  36895. /* harmony default export */ __webpack_exports__["default"] = (Popper);
  36896. //# sourceMappingURL=popper.js.map
  36897. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  36898. /***/ }),
  36899. /***/ "./node_modules/process/browser.js":
  36900. /*!*****************************************!*\
  36901. !*** ./node_modules/process/browser.js ***!
  36902. \*****************************************/
  36903. /*! no static exports found */
  36904. /***/ (function(module, exports) {
  36905. // shim for using process in browser
  36906. var process = module.exports = {};
  36907. // cached from whatever global is present so that test runners that stub it
  36908. // don't break things. But we need to wrap it in a try catch in case it is
  36909. // wrapped in strict mode code which doesn't define any globals. It's inside a
  36910. // function because try/catches deoptimize in certain engines.
  36911. var cachedSetTimeout;
  36912. var cachedClearTimeout;
  36913. function defaultSetTimout() {
  36914. throw new Error('setTimeout has not been defined');
  36915. }
  36916. function defaultClearTimeout () {
  36917. throw new Error('clearTimeout has not been defined');
  36918. }
  36919. (function () {
  36920. try {
  36921. if (typeof setTimeout === 'function') {
  36922. cachedSetTimeout = setTimeout;
  36923. } else {
  36924. cachedSetTimeout = defaultSetTimout;
  36925. }
  36926. } catch (e) {
  36927. cachedSetTimeout = defaultSetTimout;
  36928. }
  36929. try {
  36930. if (typeof clearTimeout === 'function') {
  36931. cachedClearTimeout = clearTimeout;
  36932. } else {
  36933. cachedClearTimeout = defaultClearTimeout;
  36934. }
  36935. } catch (e) {
  36936. cachedClearTimeout = defaultClearTimeout;
  36937. }
  36938. } ())
  36939. function runTimeout(fun) {
  36940. if (cachedSetTimeout === setTimeout) {
  36941. //normal enviroments in sane situations
  36942. return setTimeout(fun, 0);
  36943. }
  36944. // if setTimeout wasn't available but was latter defined
  36945. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  36946. cachedSetTimeout = setTimeout;
  36947. return setTimeout(fun, 0);
  36948. }
  36949. try {
  36950. // when when somebody has screwed with setTimeout but no I.E. maddness
  36951. return cachedSetTimeout(fun, 0);
  36952. } catch(e){
  36953. try {
  36954. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  36955. return cachedSetTimeout.call(null, fun, 0);
  36956. } catch(e){
  36957. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  36958. return cachedSetTimeout.call(this, fun, 0);
  36959. }
  36960. }
  36961. }
  36962. function runClearTimeout(marker) {
  36963. if (cachedClearTimeout === clearTimeout) {
  36964. //normal enviroments in sane situations
  36965. return clearTimeout(marker);
  36966. }
  36967. // if clearTimeout wasn't available but was latter defined
  36968. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  36969. cachedClearTimeout = clearTimeout;
  36970. return clearTimeout(marker);
  36971. }
  36972. try {
  36973. // when when somebody has screwed with setTimeout but no I.E. maddness
  36974. return cachedClearTimeout(marker);
  36975. } catch (e){
  36976. try {
  36977. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  36978. return cachedClearTimeout.call(null, marker);
  36979. } catch (e){
  36980. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  36981. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  36982. return cachedClearTimeout.call(this, marker);
  36983. }
  36984. }
  36985. }
  36986. var queue = [];
  36987. var draining = false;
  36988. var currentQueue;
  36989. var queueIndex = -1;
  36990. function cleanUpNextTick() {
  36991. if (!draining || !currentQueue) {
  36992. return;
  36993. }
  36994. draining = false;
  36995. if (currentQueue.length) {
  36996. queue = currentQueue.concat(queue);
  36997. } else {
  36998. queueIndex = -1;
  36999. }
  37000. if (queue.length) {
  37001. drainQueue();
  37002. }
  37003. }
  37004. function drainQueue() {
  37005. if (draining) {
  37006. return;
  37007. }
  37008. var timeout = runTimeout(cleanUpNextTick);
  37009. draining = true;
  37010. var len = queue.length;
  37011. while(len) {
  37012. currentQueue = queue;
  37013. queue = [];
  37014. while (++queueIndex < len) {
  37015. if (currentQueue) {
  37016. currentQueue[queueIndex].run();
  37017. }
  37018. }
  37019. queueIndex = -1;
  37020. len = queue.length;
  37021. }
  37022. currentQueue = null;
  37023. draining = false;
  37024. runClearTimeout(timeout);
  37025. }
  37026. process.nextTick = function (fun) {
  37027. var args = new Array(arguments.length - 1);
  37028. if (arguments.length > 1) {
  37029. for (var i = 1; i < arguments.length; i++) {
  37030. args[i - 1] = arguments[i];
  37031. }
  37032. }
  37033. queue.push(new Item(fun, args));
  37034. if (queue.length === 1 && !draining) {
  37035. runTimeout(drainQueue);
  37036. }
  37037. };
  37038. // v8 likes predictible objects
  37039. function Item(fun, array) {
  37040. this.fun = fun;
  37041. this.array = array;
  37042. }
  37043. Item.prototype.run = function () {
  37044. this.fun.apply(null, this.array);
  37045. };
  37046. process.title = 'browser';
  37047. process.browser = true;
  37048. process.env = {};
  37049. process.argv = [];
  37050. process.version = ''; // empty string to avoid regexp issues
  37051. process.versions = {};
  37052. function noop() {}
  37053. process.on = noop;
  37054. process.addListener = noop;
  37055. process.once = noop;
  37056. process.off = noop;
  37057. process.removeListener = noop;
  37058. process.removeAllListeners = noop;
  37059. process.emit = noop;
  37060. process.prependListener = noop;
  37061. process.prependOnceListener = noop;
  37062. process.listeners = function (name) { return [] }
  37063. process.binding = function (name) {
  37064. throw new Error('process.binding is not supported');
  37065. };
  37066. process.cwd = function () { return '/' };
  37067. process.chdir = function (dir) {
  37068. throw new Error('process.chdir is not supported');
  37069. };
  37070. process.umask = function() { return 0; };
  37071. /***/ }),
  37072. /***/ "./node_modules/prop-types-extra/lib/all.js":
  37073. /*!**************************************************!*\
  37074. !*** ./node_modules/prop-types-extra/lib/all.js ***!
  37075. \**************************************************/
  37076. /*! no static exports found */
  37077. /***/ (function(module, exports, __webpack_require__) {
  37078. "use strict";
  37079. Object.defineProperty(exports, "__esModule", {
  37080. value: true
  37081. });
  37082. exports.default = all;
  37083. var _createChainableTypeChecker = __webpack_require__(/*! ./utils/createChainableTypeChecker */ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js");
  37084. var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
  37085. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37086. function all() {
  37087. for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
  37088. validators[_key] = arguments[_key];
  37089. }
  37090. function allPropTypes() {
  37091. for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  37092. args[_key2] = arguments[_key2];
  37093. }
  37094. var error = null;
  37095. validators.forEach(function (validator) {
  37096. if (error != null) {
  37097. return;
  37098. }
  37099. var result = validator.apply(undefined, args);
  37100. if (result != null) {
  37101. error = result;
  37102. }
  37103. });
  37104. return error;
  37105. }
  37106. return (0, _createChainableTypeChecker2.default)(allPropTypes);
  37107. }
  37108. module.exports = exports['default'];
  37109. /***/ }),
  37110. /***/ "./node_modules/prop-types-extra/lib/componentOrElement.js":
  37111. /*!*****************************************************************!*\
  37112. !*** ./node_modules/prop-types-extra/lib/componentOrElement.js ***!
  37113. \*****************************************************************/
  37114. /*! no static exports found */
  37115. /***/ (function(module, exports, __webpack_require__) {
  37116. "use strict";
  37117. Object.defineProperty(exports, "__esModule", {
  37118. value: true
  37119. });
  37120. 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; };
  37121. var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  37122. var _react2 = _interopRequireDefault(_react);
  37123. var _createChainableTypeChecker = __webpack_require__(/*! ./utils/createChainableTypeChecker */ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js");
  37124. var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
  37125. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37126. function validate(props, propName, componentName, location, propFullName) {
  37127. var propValue = props[propName];
  37128. var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
  37129. if (_react2.default.isValidElement(propValue)) {
  37130. return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement. You can usually obtain a ReactComponent or DOMElement ' + 'from a ReactElement by attaching a ref to it.');
  37131. }
  37132. if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
  37133. return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
  37134. }
  37135. return null;
  37136. }
  37137. exports.default = (0, _createChainableTypeChecker2.default)(validate);
  37138. module.exports = exports['default'];
  37139. /***/ }),
  37140. /***/ "./node_modules/prop-types-extra/lib/elementType.js":
  37141. /*!**********************************************************!*\
  37142. !*** ./node_modules/prop-types-extra/lib/elementType.js ***!
  37143. \**********************************************************/
  37144. /*! no static exports found */
  37145. /***/ (function(module, exports, __webpack_require__) {
  37146. "use strict";
  37147. Object.defineProperty(exports, "__esModule", {
  37148. value: true
  37149. });
  37150. var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  37151. var _react2 = _interopRequireDefault(_react);
  37152. var _reactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
  37153. var _createChainableTypeChecker = __webpack_require__(/*! ./utils/createChainableTypeChecker */ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js");
  37154. var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
  37155. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37156. function elementType(props, propName, componentName, location, propFullName) {
  37157. var propValue = props[propName];
  37158. if (_react2.default.isValidElement(propValue)) {
  37159. return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`,expected an element type (a string ') + ', component class, or function component).');
  37160. }
  37161. if (!(0, _reactIs.isValidElementType)(propValue)) {
  37162. return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + ', component class, or function component).');
  37163. }
  37164. return null;
  37165. }
  37166. exports.default = (0, _createChainableTypeChecker2.default)(elementType);
  37167. module.exports = exports['default'];
  37168. /***/ }),
  37169. /***/ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js":
  37170. /*!****************************************************************!*\
  37171. !*** ./node_modules/prop-types-extra/lib/isRequiredForA11y.js ***!
  37172. \****************************************************************/
  37173. /*! no static exports found */
  37174. /***/ (function(module, exports, __webpack_require__) {
  37175. "use strict";
  37176. Object.defineProperty(exports, "__esModule", {
  37177. value: true
  37178. });
  37179. exports.default = isRequiredForA11y;
  37180. function isRequiredForA11y(validator) {
  37181. return function validate(props, propName, componentName, location, propFullName) {
  37182. var componentNameSafe = componentName || '<<anonymous>>';
  37183. var propFullNameSafe = propFullName || propName;
  37184. if (props[propName] == null) {
  37185. return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');
  37186. }
  37187. for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
  37188. args[_key - 5] = arguments[_key];
  37189. }
  37190. return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
  37191. };
  37192. }
  37193. module.exports = exports['default'];
  37194. /***/ }),
  37195. /***/ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js":
  37196. /*!*******************************************************************************!*\
  37197. !*** ./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js ***!
  37198. \*******************************************************************************/
  37199. /*! no static exports found */
  37200. /***/ (function(module, exports, __webpack_require__) {
  37201. "use strict";
  37202. Object.defineProperty(exports, "__esModule", {
  37203. value: true
  37204. });
  37205. exports.default = createChainableTypeChecker;
  37206. /**
  37207. * Copyright 2013-present, Facebook, Inc.
  37208. * All rights reserved.
  37209. *
  37210. * This source code is licensed under the BSD-style license found in the
  37211. * LICENSE file in the root directory of this source tree. An additional grant
  37212. * of patent rights can be found in the PATENTS file in the same directory.
  37213. */
  37214. // Mostly taken from ReactPropTypes.
  37215. function createChainableTypeChecker(validate) {
  37216. function checkType(isRequired, props, propName, componentName, location, propFullName) {
  37217. var componentNameSafe = componentName || '<<anonymous>>';
  37218. var propFullNameSafe = propFullName || propName;
  37219. if (props[propName] == null) {
  37220. if (isRequired) {
  37221. return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
  37222. }
  37223. return null;
  37224. }
  37225. for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
  37226. args[_key - 6] = arguments[_key];
  37227. }
  37228. return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
  37229. }
  37230. var chainedCheckType = checkType.bind(null, false);
  37231. chainedCheckType.isRequired = checkType.bind(null, true);
  37232. return chainedCheckType;
  37233. }
  37234. module.exports = exports['default'];
  37235. /***/ }),
  37236. /***/ "./node_modules/prop-types/checkPropTypes.js":
  37237. /*!***************************************************!*\
  37238. !*** ./node_modules/prop-types/checkPropTypes.js ***!
  37239. \***************************************************/
  37240. /*! no static exports found */
  37241. /***/ (function(module, exports, __webpack_require__) {
  37242. "use strict";
  37243. /**
  37244. * Copyright (c) 2013-present, Facebook, Inc.
  37245. *
  37246. * This source code is licensed under the MIT license found in the
  37247. * LICENSE file in the root directory of this source tree.
  37248. */
  37249. var printWarning = function() {};
  37250. if (true) {
  37251. var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
  37252. var loggedTypeFailures = {};
  37253. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  37254. printWarning = function(text) {
  37255. var message = 'Warning: ' + text;
  37256. if (typeof console !== 'undefined') {
  37257. console.error(message);
  37258. }
  37259. try {
  37260. // --- Welcome to debugging React ---
  37261. // This error was thrown as a convenience so that you can use this stack
  37262. // to find the callsite that caused this warning to fire.
  37263. throw new Error(message);
  37264. } catch (x) {}
  37265. };
  37266. }
  37267. /**
  37268. * Assert that the values match with the type specs.
  37269. * Error messages are memorized and will only be shown once.
  37270. *
  37271. * @param {object} typeSpecs Map of name to a ReactPropType
  37272. * @param {object} values Runtime values that need to be type-checked
  37273. * @param {string} location e.g. "prop", "context", "child context"
  37274. * @param {string} componentName Name of the component for error messages.
  37275. * @param {?Function} getStack Returns the component stack.
  37276. * @private
  37277. */
  37278. function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  37279. if (true) {
  37280. for (var typeSpecName in typeSpecs) {
  37281. if (has(typeSpecs, typeSpecName)) {
  37282. var error;
  37283. // Prop type validation may throw. In case they do, we don't want to
  37284. // fail the render phase where it didn't fail before. So we log it.
  37285. // After these have been cleaned up, we'll let them throw.
  37286. try {
  37287. // This is intentionally an invariant that gets caught. It's the same
  37288. // behavior as without this statement except with a better message.
  37289. if (typeof typeSpecs[typeSpecName] !== 'function') {
  37290. var err = Error(
  37291. (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
  37292. 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
  37293. );
  37294. err.name = 'Invariant Violation';
  37295. throw err;
  37296. }
  37297. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  37298. } catch (ex) {
  37299. error = ex;
  37300. }
  37301. if (error && !(error instanceof Error)) {
  37302. printWarning(
  37303. (componentName || 'React class') + ': type specification of ' +
  37304. location + ' `' + typeSpecName + '` is invalid; the type checker ' +
  37305. 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
  37306. 'You may have forgotten to pass an argument to the type checker ' +
  37307. 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
  37308. 'shape all require an argument).'
  37309. );
  37310. }
  37311. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  37312. // Only monitor this failure once because there tends to be a lot of the
  37313. // same error.
  37314. loggedTypeFailures[error.message] = true;
  37315. var stack = getStack ? getStack() : '';
  37316. printWarning(
  37317. 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
  37318. );
  37319. }
  37320. }
  37321. }
  37322. }
  37323. }
  37324. /**
  37325. * Resets warning cache when testing.
  37326. *
  37327. * @private
  37328. */
  37329. checkPropTypes.resetWarningCache = function() {
  37330. if (true) {
  37331. loggedTypeFailures = {};
  37332. }
  37333. }
  37334. module.exports = checkPropTypes;
  37335. /***/ }),
  37336. /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
  37337. /*!************************************************************!*\
  37338. !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
  37339. \************************************************************/
  37340. /*! no static exports found */
  37341. /***/ (function(module, exports, __webpack_require__) {
  37342. "use strict";
  37343. /**
  37344. * Copyright (c) 2013-present, Facebook, Inc.
  37345. *
  37346. * This source code is licensed under the MIT license found in the
  37347. * LICENSE file in the root directory of this source tree.
  37348. */
  37349. var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
  37350. var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
  37351. var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
  37352. var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
  37353. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  37354. var printWarning = function() {};
  37355. if (true) {
  37356. printWarning = function(text) {
  37357. var message = 'Warning: ' + text;
  37358. if (typeof console !== 'undefined') {
  37359. console.error(message);
  37360. }
  37361. try {
  37362. // --- Welcome to debugging React ---
  37363. // This error was thrown as a convenience so that you can use this stack
  37364. // to find the callsite that caused this warning to fire.
  37365. throw new Error(message);
  37366. } catch (x) {}
  37367. };
  37368. }
  37369. function emptyFunctionThatReturnsNull() {
  37370. return null;
  37371. }
  37372. module.exports = function(isValidElement, throwOnDirectAccess) {
  37373. /* global Symbol */
  37374. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  37375. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  37376. /**
  37377. * Returns the iterator method function contained on the iterable object.
  37378. *
  37379. * Be sure to invoke the function with the iterable as context:
  37380. *
  37381. * var iteratorFn = getIteratorFn(myIterable);
  37382. * if (iteratorFn) {
  37383. * var iterator = iteratorFn.call(myIterable);
  37384. * ...
  37385. * }
  37386. *
  37387. * @param {?object} maybeIterable
  37388. * @return {?function}
  37389. */
  37390. function getIteratorFn(maybeIterable) {
  37391. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  37392. if (typeof iteratorFn === 'function') {
  37393. return iteratorFn;
  37394. }
  37395. }
  37396. /**
  37397. * Collection of methods that allow declaration and validation of props that are
  37398. * supplied to React components. Example usage:
  37399. *
  37400. * var Props = require('ReactPropTypes');
  37401. * var MyArticle = React.createClass({
  37402. * propTypes: {
  37403. * // An optional string prop named "description".
  37404. * description: Props.string,
  37405. *
  37406. * // A required enum prop named "category".
  37407. * category: Props.oneOf(['News','Photos']).isRequired,
  37408. *
  37409. * // A prop named "dialog" that requires an instance of Dialog.
  37410. * dialog: Props.instanceOf(Dialog).isRequired
  37411. * },
  37412. * render: function() { ... }
  37413. * });
  37414. *
  37415. * A more formal specification of how these methods are used:
  37416. *
  37417. * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  37418. * decl := ReactPropTypes.{type}(.isRequired)?
  37419. *
  37420. * Each and every declaration produces a function with the same signature. This
  37421. * allows the creation of custom validation functions. For example:
  37422. *
  37423. * var MyLink = React.createClass({
  37424. * propTypes: {
  37425. * // An optional string or URI prop named "href".
  37426. * href: function(props, propName, componentName) {
  37427. * var propValue = props[propName];
  37428. * if (propValue != null && typeof propValue !== 'string' &&
  37429. * !(propValue instanceof URI)) {
  37430. * return new Error(
  37431. * 'Expected a string or an URI for ' + propName + ' in ' +
  37432. * componentName
  37433. * );
  37434. * }
  37435. * }
  37436. * },
  37437. * render: function() {...}
  37438. * });
  37439. *
  37440. * @internal
  37441. */
  37442. var ANONYMOUS = '<<anonymous>>';
  37443. // Important!
  37444. // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  37445. var ReactPropTypes = {
  37446. array: createPrimitiveTypeChecker('array'),
  37447. bool: createPrimitiveTypeChecker('boolean'),
  37448. func: createPrimitiveTypeChecker('function'),
  37449. number: createPrimitiveTypeChecker('number'),
  37450. object: createPrimitiveTypeChecker('object'),
  37451. string: createPrimitiveTypeChecker('string'),
  37452. symbol: createPrimitiveTypeChecker('symbol'),
  37453. any: createAnyTypeChecker(),
  37454. arrayOf: createArrayOfTypeChecker,
  37455. element: createElementTypeChecker(),
  37456. elementType: createElementTypeTypeChecker(),
  37457. instanceOf: createInstanceTypeChecker,
  37458. node: createNodeChecker(),
  37459. objectOf: createObjectOfTypeChecker,
  37460. oneOf: createEnumTypeChecker,
  37461. oneOfType: createUnionTypeChecker,
  37462. shape: createShapeTypeChecker,
  37463. exact: createStrictShapeTypeChecker,
  37464. };
  37465. /**
  37466. * inlined Object.is polyfill to avoid requiring consumers ship their own
  37467. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  37468. */
  37469. /*eslint-disable no-self-compare*/
  37470. function is(x, y) {
  37471. // SameValue algorithm
  37472. if (x === y) {
  37473. // Steps 1-5, 7-10
  37474. // Steps 6.b-6.e: +0 != -0
  37475. return x !== 0 || 1 / x === 1 / y;
  37476. } else {
  37477. // Step 6.a: NaN == NaN
  37478. return x !== x && y !== y;
  37479. }
  37480. }
  37481. /*eslint-enable no-self-compare*/
  37482. /**
  37483. * We use an Error-like object for backward compatibility as people may call
  37484. * PropTypes directly and inspect their output. However, we don't use real
  37485. * Errors anymore. We don't inspect their stack anyway, and creating them
  37486. * is prohibitively expensive if they are created too often, such as what
  37487. * happens in oneOfType() for any type before the one that matched.
  37488. */
  37489. function PropTypeError(message) {
  37490. this.message = message;
  37491. this.stack = '';
  37492. }
  37493. // Make `instanceof Error` still work for returned errors.
  37494. PropTypeError.prototype = Error.prototype;
  37495. function createChainableTypeChecker(validate) {
  37496. if (true) {
  37497. var manualPropTypeCallCache = {};
  37498. var manualPropTypeWarningCount = 0;
  37499. }
  37500. function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
  37501. componentName = componentName || ANONYMOUS;
  37502. propFullName = propFullName || propName;
  37503. if (secret !== ReactPropTypesSecret) {
  37504. if (throwOnDirectAccess) {
  37505. // New behavior only for users of `prop-types` package
  37506. var err = new Error(
  37507. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  37508. 'Use `PropTypes.checkPropTypes()` to call them. ' +
  37509. 'Read more at http://fb.me/use-check-prop-types'
  37510. );
  37511. err.name = 'Invariant Violation';
  37512. throw err;
  37513. } else if ( true && typeof console !== 'undefined') {
  37514. // Old behavior for people using React.PropTypes
  37515. var cacheKey = componentName + ':' + propName;
  37516. if (
  37517. !manualPropTypeCallCache[cacheKey] &&
  37518. // Avoid spamming the console because they are often not actionable except for lib authors
  37519. manualPropTypeWarningCount < 3
  37520. ) {
  37521. printWarning(
  37522. 'You are manually calling a React.PropTypes validation ' +
  37523. 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
  37524. 'and will throw in the standalone `prop-types` package. ' +
  37525. 'You may be seeing this warning due to a third-party PropTypes ' +
  37526. 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
  37527. );
  37528. manualPropTypeCallCache[cacheKey] = true;
  37529. manualPropTypeWarningCount++;
  37530. }
  37531. }
  37532. }
  37533. if (props[propName] == null) {
  37534. if (isRequired) {
  37535. if (props[propName] === null) {
  37536. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
  37537. }
  37538. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
  37539. }
  37540. return null;
  37541. } else {
  37542. return validate(props, propName, componentName, location, propFullName);
  37543. }
  37544. }
  37545. var chainedCheckType = checkType.bind(null, false);
  37546. chainedCheckType.isRequired = checkType.bind(null, true);
  37547. return chainedCheckType;
  37548. }
  37549. function createPrimitiveTypeChecker(expectedType) {
  37550. function validate(props, propName, componentName, location, propFullName, secret) {
  37551. var propValue = props[propName];
  37552. var propType = getPropType(propValue);
  37553. if (propType !== expectedType) {
  37554. // `propValue` being instance of, say, date/regexp, pass the 'object'
  37555. // check, but we can offer a more precise error message here rather than
  37556. // 'of type `object`'.
  37557. var preciseType = getPreciseType(propValue);
  37558. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
  37559. }
  37560. return null;
  37561. }
  37562. return createChainableTypeChecker(validate);
  37563. }
  37564. function createAnyTypeChecker() {
  37565. return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  37566. }
  37567. function createArrayOfTypeChecker(typeChecker) {
  37568. function validate(props, propName, componentName, location, propFullName) {
  37569. if (typeof typeChecker !== 'function') {
  37570. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
  37571. }
  37572. var propValue = props[propName];
  37573. if (!Array.isArray(propValue)) {
  37574. var propType = getPropType(propValue);
  37575. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
  37576. }
  37577. for (var i = 0; i < propValue.length; i++) {
  37578. var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
  37579. if (error instanceof Error) {
  37580. return error;
  37581. }
  37582. }
  37583. return null;
  37584. }
  37585. return createChainableTypeChecker(validate);
  37586. }
  37587. function createElementTypeChecker() {
  37588. function validate(props, propName, componentName, location, propFullName) {
  37589. var propValue = props[propName];
  37590. if (!isValidElement(propValue)) {
  37591. var propType = getPropType(propValue);
  37592. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
  37593. }
  37594. return null;
  37595. }
  37596. return createChainableTypeChecker(validate);
  37597. }
  37598. function createElementTypeTypeChecker() {
  37599. function validate(props, propName, componentName, location, propFullName) {
  37600. var propValue = props[propName];
  37601. if (!ReactIs.isValidElementType(propValue)) {
  37602. var propType = getPropType(propValue);
  37603. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
  37604. }
  37605. return null;
  37606. }
  37607. return createChainableTypeChecker(validate);
  37608. }
  37609. function createInstanceTypeChecker(expectedClass) {
  37610. function validate(props, propName, componentName, location, propFullName) {
  37611. if (!(props[propName] instanceof expectedClass)) {
  37612. var expectedClassName = expectedClass.name || ANONYMOUS;
  37613. var actualClassName = getClassName(props[propName]);
  37614. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
  37615. }
  37616. return null;
  37617. }
  37618. return createChainableTypeChecker(validate);
  37619. }
  37620. function createEnumTypeChecker(expectedValues) {
  37621. if (!Array.isArray(expectedValues)) {
  37622. if (true) {
  37623. if (arguments.length > 1) {
  37624. printWarning(
  37625. 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
  37626. 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
  37627. );
  37628. } else {
  37629. printWarning('Invalid argument supplied to oneOf, expected an array.');
  37630. }
  37631. }
  37632. return emptyFunctionThatReturnsNull;
  37633. }
  37634. function validate(props, propName, componentName, location, propFullName) {
  37635. var propValue = props[propName];
  37636. for (var i = 0; i < expectedValues.length; i++) {
  37637. if (is(propValue, expectedValues[i])) {
  37638. return null;
  37639. }
  37640. }
  37641. var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
  37642. var type = getPreciseType(value);
  37643. if (type === 'symbol') {
  37644. return String(value);
  37645. }
  37646. return value;
  37647. });
  37648. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
  37649. }
  37650. return createChainableTypeChecker(validate);
  37651. }
  37652. function createObjectOfTypeChecker(typeChecker) {
  37653. function validate(props, propName, componentName, location, propFullName) {
  37654. if (typeof typeChecker !== 'function') {
  37655. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
  37656. }
  37657. var propValue = props[propName];
  37658. var propType = getPropType(propValue);
  37659. if (propType !== 'object') {
  37660. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
  37661. }
  37662. for (var key in propValue) {
  37663. if (has(propValue, key)) {
  37664. var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  37665. if (error instanceof Error) {
  37666. return error;
  37667. }
  37668. }
  37669. }
  37670. return null;
  37671. }
  37672. return createChainableTypeChecker(validate);
  37673. }
  37674. function createUnionTypeChecker(arrayOfTypeCheckers) {
  37675. if (!Array.isArray(arrayOfTypeCheckers)) {
  37676. true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined;
  37677. return emptyFunctionThatReturnsNull;
  37678. }
  37679. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  37680. var checker = arrayOfTypeCheckers[i];
  37681. if (typeof checker !== 'function') {
  37682. printWarning(
  37683. 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
  37684. 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
  37685. );
  37686. return emptyFunctionThatReturnsNull;
  37687. }
  37688. }
  37689. function validate(props, propName, componentName, location, propFullName) {
  37690. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  37691. var checker = arrayOfTypeCheckers[i];
  37692. if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
  37693. return null;
  37694. }
  37695. }
  37696. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
  37697. }
  37698. return createChainableTypeChecker(validate);
  37699. }
  37700. function createNodeChecker() {
  37701. function validate(props, propName, componentName, location, propFullName) {
  37702. if (!isNode(props[propName])) {
  37703. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
  37704. }
  37705. return null;
  37706. }
  37707. return createChainableTypeChecker(validate);
  37708. }
  37709. function createShapeTypeChecker(shapeTypes) {
  37710. function validate(props, propName, componentName, location, propFullName) {
  37711. var propValue = props[propName];
  37712. var propType = getPropType(propValue);
  37713. if (propType !== 'object') {
  37714. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  37715. }
  37716. for (var key in shapeTypes) {
  37717. var checker = shapeTypes[key];
  37718. if (!checker) {
  37719. continue;
  37720. }
  37721. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  37722. if (error) {
  37723. return error;
  37724. }
  37725. }
  37726. return null;
  37727. }
  37728. return createChainableTypeChecker(validate);
  37729. }
  37730. function createStrictShapeTypeChecker(shapeTypes) {
  37731. function validate(props, propName, componentName, location, propFullName) {
  37732. var propValue = props[propName];
  37733. var propType = getPropType(propValue);
  37734. if (propType !== 'object') {
  37735. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  37736. }
  37737. // We need to check all keys in case some are required but missing from
  37738. // props.
  37739. var allKeys = assign({}, props[propName], shapeTypes);
  37740. for (var key in allKeys) {
  37741. var checker = shapeTypes[key];
  37742. if (!checker) {
  37743. return new PropTypeError(
  37744. 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
  37745. '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
  37746. '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
  37747. );
  37748. }
  37749. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  37750. if (error) {
  37751. return error;
  37752. }
  37753. }
  37754. return null;
  37755. }
  37756. return createChainableTypeChecker(validate);
  37757. }
  37758. function isNode(propValue) {
  37759. switch (typeof propValue) {
  37760. case 'number':
  37761. case 'string':
  37762. case 'undefined':
  37763. return true;
  37764. case 'boolean':
  37765. return !propValue;
  37766. case 'object':
  37767. if (Array.isArray(propValue)) {
  37768. return propValue.every(isNode);
  37769. }
  37770. if (propValue === null || isValidElement(propValue)) {
  37771. return true;
  37772. }
  37773. var iteratorFn = getIteratorFn(propValue);
  37774. if (iteratorFn) {
  37775. var iterator = iteratorFn.call(propValue);
  37776. var step;
  37777. if (iteratorFn !== propValue.entries) {
  37778. while (!(step = iterator.next()).done) {
  37779. if (!isNode(step.value)) {
  37780. return false;
  37781. }
  37782. }
  37783. } else {
  37784. // Iterator will provide entry [k,v] tuples rather than values.
  37785. while (!(step = iterator.next()).done) {
  37786. var entry = step.value;
  37787. if (entry) {
  37788. if (!isNode(entry[1])) {
  37789. return false;
  37790. }
  37791. }
  37792. }
  37793. }
  37794. } else {
  37795. return false;
  37796. }
  37797. return true;
  37798. default:
  37799. return false;
  37800. }
  37801. }
  37802. function isSymbol(propType, propValue) {
  37803. // Native Symbol.
  37804. if (propType === 'symbol') {
  37805. return true;
  37806. }
  37807. // falsy value can't be a Symbol
  37808. if (!propValue) {
  37809. return false;
  37810. }
  37811. // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
  37812. if (propValue['@@toStringTag'] === 'Symbol') {
  37813. return true;
  37814. }
  37815. // Fallback for non-spec compliant Symbols which are polyfilled.
  37816. if (typeof Symbol === 'function' && propValue instanceof Symbol) {
  37817. return true;
  37818. }
  37819. return false;
  37820. }
  37821. // Equivalent of `typeof` but with special handling for array and regexp.
  37822. function getPropType(propValue) {
  37823. var propType = typeof propValue;
  37824. if (Array.isArray(propValue)) {
  37825. return 'array';
  37826. }
  37827. if (propValue instanceof RegExp) {
  37828. // Old webkits (at least until Android 4.0) return 'function' rather than
  37829. // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
  37830. // passes PropTypes.object.
  37831. return 'object';
  37832. }
  37833. if (isSymbol(propType, propValue)) {
  37834. return 'symbol';
  37835. }
  37836. return propType;
  37837. }
  37838. // This handles more types than `getPropType`. Only used for error messages.
  37839. // See `createPrimitiveTypeChecker`.
  37840. function getPreciseType(propValue) {
  37841. if (typeof propValue === 'undefined' || propValue === null) {
  37842. return '' + propValue;
  37843. }
  37844. var propType = getPropType(propValue);
  37845. if (propType === 'object') {
  37846. if (propValue instanceof Date) {
  37847. return 'date';
  37848. } else if (propValue instanceof RegExp) {
  37849. return 'regexp';
  37850. }
  37851. }
  37852. return propType;
  37853. }
  37854. // Returns a string that is postfixed to a warning about an invalid type.
  37855. // For example, "undefined" or "of type array"
  37856. function getPostfixForTypeWarning(value) {
  37857. var type = getPreciseType(value);
  37858. switch (type) {
  37859. case 'array':
  37860. case 'object':
  37861. return 'an ' + type;
  37862. case 'boolean':
  37863. case 'date':
  37864. case 'regexp':
  37865. return 'a ' + type;
  37866. default:
  37867. return type;
  37868. }
  37869. }
  37870. // Returns class name of the object, if any.
  37871. function getClassName(propValue) {
  37872. if (!propValue.constructor || !propValue.constructor.name) {
  37873. return ANONYMOUS;
  37874. }
  37875. return propValue.constructor.name;
  37876. }
  37877. ReactPropTypes.checkPropTypes = checkPropTypes;
  37878. ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  37879. ReactPropTypes.PropTypes = ReactPropTypes;
  37880. return ReactPropTypes;
  37881. };
  37882. /***/ }),
  37883. /***/ "./node_modules/prop-types/index.js":
  37884. /*!******************************************!*\
  37885. !*** ./node_modules/prop-types/index.js ***!
  37886. \******************************************/
  37887. /*! no static exports found */
  37888. /***/ (function(module, exports, __webpack_require__) {
  37889. /**
  37890. * Copyright (c) 2013-present, Facebook, Inc.
  37891. *
  37892. * This source code is licensed under the MIT license found in the
  37893. * LICENSE file in the root directory of this source tree.
  37894. */
  37895. if (true) {
  37896. var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
  37897. // By explicitly using `prop-types` you are opting into new development behavior.
  37898. // http://fb.me/prop-types-in-prod
  37899. var throwOnDirectAccess = true;
  37900. module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
  37901. } else {}
  37902. /***/ }),
  37903. /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
  37904. /*!*************************************************************!*\
  37905. !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
  37906. \*************************************************************/
  37907. /*! no static exports found */
  37908. /***/ (function(module, exports, __webpack_require__) {
  37909. "use strict";
  37910. /**
  37911. * Copyright (c) 2013-present, Facebook, Inc.
  37912. *
  37913. * This source code is licensed under the MIT license found in the
  37914. * LICENSE file in the root directory of this source tree.
  37915. */
  37916. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  37917. module.exports = ReactPropTypesSecret;
  37918. /***/ }),
  37919. /***/ "./node_modules/react-bootstrap/esm/AbstractNav.js":
  37920. /*!*********************************************************!*\
  37921. !*** ./node_modules/react-bootstrap/esm/AbstractNav.js ***!
  37922. \*********************************************************/
  37923. /*! exports provided: default */
  37924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37925. "use strict";
  37926. __webpack_require__.r(__webpack_exports__);
  37927. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  37928. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  37929. /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dom-helpers/query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js");
  37930. /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2__);
  37931. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  37932. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  37933. /* harmony import */ var _restart_hooks_useForceUpdate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useForceUpdate */ "./node_modules/@restart/hooks/esm/useForceUpdate.js");
  37934. /* harmony import */ var _restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @restart/hooks/useMergedRefs */ "./node_modules/@restart/hooks/esm/useMergedRefs.js");
  37935. /* harmony import */ var _NavContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavContext */ "./node_modules/react-bootstrap/esm/NavContext.js");
  37936. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  37937. /* harmony import */ var _TabContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TabContext */ "./node_modules/react-bootstrap/esm/TabContext.js");
  37938. var noop = function noop() {};
  37939. var AbstractNav = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  37940. var _ref$as = _ref.as,
  37941. Component = _ref$as === void 0 ? 'ul' : _ref$as,
  37942. onSelect = _ref.onSelect,
  37943. activeKey = _ref.activeKey,
  37944. role = _ref.role,
  37945. onKeyDown = _ref.onKeyDown,
  37946. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "onSelect", "activeKey", "role", "onKeyDown"]);
  37947. // A ref and forceUpdate for refocus, b/c we only want to trigger when needed
  37948. // and don't want to reset the set in the effect
  37949. var forceUpdate = Object(_restart_hooks_useForceUpdate__WEBPACK_IMPORTED_MODULE_4__["default"])();
  37950. var needsRefocusRef = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(false);
  37951. var parentOnSelect = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
  37952. var tabContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_TabContext__WEBPACK_IMPORTED_MODULE_8__["default"]);
  37953. var getControlledId, getControllerId;
  37954. if (tabContext) {
  37955. role = role || 'tablist';
  37956. activeKey = tabContext.activeKey;
  37957. getControlledId = tabContext.getControlledId;
  37958. getControllerId = tabContext.getControllerId;
  37959. }
  37960. var listNode = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null);
  37961. var getNextActiveChild = function getNextActiveChild(offset) {
  37962. if (!listNode.current) return null;
  37963. var items = dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2___default()(listNode.current, '[data-rb-event-key]:not(.disabled)');
  37964. var activeChild = listNode.current.querySelector('.active');
  37965. var index = items.indexOf(activeChild);
  37966. if (index === -1) return null;
  37967. var nextIndex = index + offset;
  37968. if (nextIndex >= items.length) nextIndex = 0;
  37969. if (nextIndex < 0) nextIndex = items.length - 1;
  37970. return items[nextIndex];
  37971. };
  37972. var handleSelect = function handleSelect(key, event) {
  37973. if (key == null) return;
  37974. if (onSelect) onSelect(key, event);
  37975. if (parentOnSelect) parentOnSelect(key, event);
  37976. };
  37977. var handleKeyDown = function handleKeyDown(event) {
  37978. if (onKeyDown) onKeyDown(event);
  37979. var nextActiveChild;
  37980. switch (event.key) {
  37981. case 'ArrowLeft':
  37982. case 'ArrowUp':
  37983. nextActiveChild = getNextActiveChild(-1);
  37984. break;
  37985. case 'ArrowRight':
  37986. case 'ArrowDown':
  37987. nextActiveChild = getNextActiveChild(1);
  37988. break;
  37989. default:
  37990. return;
  37991. }
  37992. if (!nextActiveChild) return;
  37993. event.preventDefault();
  37994. handleSelect(nextActiveChild.dataset.rbEventKey, event);
  37995. needsRefocusRef.current = true;
  37996. forceUpdate();
  37997. };
  37998. Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
  37999. if (listNode.current && needsRefocusRef.current) {
  38000. var activeChild = listNode.current.querySelector('[data-rb-event-key].active');
  38001. if (activeChild) activeChild.focus();
  38002. }
  38003. needsRefocusRef.current = false;
  38004. });
  38005. var mergedRef = Object(_restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_5__["default"])(ref, listNode);
  38006. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
  38007. value: handleSelect
  38008. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_NavContext__WEBPACK_IMPORTED_MODULE_6__["default"].Provider, {
  38009. value: {
  38010. role: role,
  38011. // used by NavLink to determine it's role
  38012. activeKey: Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["makeEventKey"])(activeKey),
  38013. getControlledId: getControlledId || noop,
  38014. getControllerId: getControllerId || noop
  38015. }
  38016. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  38017. onKeyDown: handleKeyDown,
  38018. ref: mergedRef,
  38019. role: role
  38020. }))));
  38021. });
  38022. /* harmony default export */ __webpack_exports__["default"] = (AbstractNav);
  38023. /***/ }),
  38024. /***/ "./node_modules/react-bootstrap/esm/AbstractNavItem.js":
  38025. /*!*************************************************************!*\
  38026. !*** ./node_modules/react-bootstrap/esm/AbstractNavItem.js ***!
  38027. \*************************************************************/
  38028. /*! exports provided: default */
  38029. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38030. "use strict";
  38031. __webpack_require__.r(__webpack_exports__);
  38032. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38033. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38034. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38035. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38036. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38037. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38038. /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
  38039. /* harmony import */ var _NavContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NavContext */ "./node_modules/react-bootstrap/esm/NavContext.js");
  38040. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  38041. var defaultProps = {
  38042. disabled: false
  38043. };
  38044. var AbstractNavItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  38045. var active = _ref.active,
  38046. className = _ref.className,
  38047. tabIndex = _ref.tabIndex,
  38048. eventKey = _ref.eventKey,
  38049. onSelect = _ref.onSelect,
  38050. onClick = _ref.onClick,
  38051. Component = _ref.as,
  38052. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["active", "className", "tabIndex", "eventKey", "onSelect", "onClick", "as"]);
  38053. var navKey = Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(eventKey, props.href);
  38054. var parentOnSelect = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["default"]);
  38055. var navContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_NavContext__WEBPACK_IMPORTED_MODULE_5__["default"]);
  38056. var isActive = active;
  38057. if (navContext) {
  38058. if (!props.role && navContext.role === 'tablist') props.role = 'tab';
  38059. props['data-rb-event-key'] = navKey;
  38060. props.id = navContext.getControllerId(navKey);
  38061. props['aria-controls'] = navContext.getControlledId(navKey);
  38062. isActive = active == null && navKey != null ? navContext.activeKey === navKey : active;
  38063. }
  38064. if (props.role === 'tab') {
  38065. props.tabIndex = isActive ? tabIndex : -1;
  38066. props['aria-selected'] = isActive;
  38067. }
  38068. var handleOnclick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function (e) {
  38069. if (onClick) onClick(e);
  38070. if (navKey == null) return;
  38071. if (onSelect) onSelect(navKey, e);
  38072. if (parentOnSelect) parentOnSelect(navKey, e);
  38073. });
  38074. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  38075. ref: ref,
  38076. onClick: handleOnclick,
  38077. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, isActive && 'active')
  38078. }));
  38079. });
  38080. AbstractNavItem.defaultProps = defaultProps;
  38081. /* harmony default export */ __webpack_exports__["default"] = (AbstractNavItem);
  38082. /***/ }),
  38083. /***/ "./node_modules/react-bootstrap/esm/Accordion.js":
  38084. /*!*******************************************************!*\
  38085. !*** ./node_modules/react-bootstrap/esm/Accordion.js ***!
  38086. \*******************************************************/
  38087. /*! exports provided: default */
  38088. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38089. "use strict";
  38090. __webpack_require__.r(__webpack_exports__);
  38091. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38092. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38093. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38094. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38095. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38096. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38097. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  38098. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38099. /* harmony import */ var _AccordionToggle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AccordionToggle */ "./node_modules/react-bootstrap/esm/AccordionToggle.js");
  38100. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  38101. /* harmony import */ var _AccordionCollapse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./AccordionCollapse */ "./node_modules/react-bootstrap/esm/AccordionCollapse.js");
  38102. /* harmony import */ var _AccordionContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AccordionContext */ "./node_modules/react-bootstrap/esm/AccordionContext.js");
  38103. var Accordion = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  38104. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
  38105. activeKey: 'onSelect'
  38106. }),
  38107. _useUncontrolled$as = _useUncontrolled.as,
  38108. Component = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
  38109. activeKey = _useUncontrolled.activeKey,
  38110. bsPrefix = _useUncontrolled.bsPrefix,
  38111. children = _useUncontrolled.children,
  38112. className = _useUncontrolled.className,
  38113. onSelect = _useUncontrolled.onSelect,
  38114. controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["as", "activeKey", "bsPrefix", "children", "className", "onSelect"]);
  38115. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'accordion');
  38116. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AccordionContext__WEBPACK_IMPORTED_MODULE_9__["default"].Provider, {
  38117. value: activeKey
  38118. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
  38119. value: onSelect
  38120. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38121. ref: ref
  38122. }, controlledProps, {
  38123. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  38124. }), children)));
  38125. });
  38126. Accordion.Toggle = _AccordionToggle__WEBPACK_IMPORTED_MODULE_6__["default"];
  38127. Accordion.Collapse = _AccordionCollapse__WEBPACK_IMPORTED_MODULE_8__["default"];
  38128. /* harmony default export */ __webpack_exports__["default"] = (Accordion);
  38129. /***/ }),
  38130. /***/ "./node_modules/react-bootstrap/esm/AccordionCollapse.js":
  38131. /*!***************************************************************!*\
  38132. !*** ./node_modules/react-bootstrap/esm/AccordionCollapse.js ***!
  38133. \***************************************************************/
  38134. /*! exports provided: default */
  38135. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38136. "use strict";
  38137. __webpack_require__.r(__webpack_exports__);
  38138. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38139. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38140. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38141. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  38142. /* harmony import */ var _Collapse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Collapse */ "./node_modules/react-bootstrap/esm/Collapse.js");
  38143. /* harmony import */ var _AccordionContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AccordionContext */ "./node_modules/react-bootstrap/esm/AccordionContext.js");
  38144. var AccordionCollapse = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  38145. var children = _ref.children,
  38146. eventKey = _ref.eventKey,
  38147. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children", "eventKey"]);
  38148. var contextEventKey = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_AccordionContext__WEBPACK_IMPORTED_MODULE_4__["default"]);
  38149. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Collapse__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38150. ref: ref,
  38151. in: contextEventKey === eventKey
  38152. }, props), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.Children.only(children)));
  38153. });
  38154. AccordionCollapse.displayName = 'AccordionCollapse';
  38155. /* harmony default export */ __webpack_exports__["default"] = (AccordionCollapse);
  38156. /***/ }),
  38157. /***/ "./node_modules/react-bootstrap/esm/AccordionContext.js":
  38158. /*!**************************************************************!*\
  38159. !*** ./node_modules/react-bootstrap/esm/AccordionContext.js ***!
  38160. \**************************************************************/
  38161. /*! exports provided: default */
  38162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38163. "use strict";
  38164. __webpack_require__.r(__webpack_exports__);
  38165. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38166. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  38167. /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
  38168. /***/ }),
  38169. /***/ "./node_modules/react-bootstrap/esm/AccordionToggle.js":
  38170. /*!*************************************************************!*\
  38171. !*** ./node_modules/react-bootstrap/esm/AccordionToggle.js ***!
  38172. \*************************************************************/
  38173. /*! exports provided: useAccordionToggle, default */
  38174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38175. "use strict";
  38176. __webpack_require__.r(__webpack_exports__);
  38177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useAccordionToggle", function() { return useAccordionToggle; });
  38178. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38179. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38180. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38181. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  38182. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  38183. /* harmony import */ var _AccordionContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AccordionContext */ "./node_modules/react-bootstrap/esm/AccordionContext.js");
  38184. function useAccordionToggle(eventKey, onClick) {
  38185. var contextEventKey = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_AccordionContext__WEBPACK_IMPORTED_MODULE_4__["default"]);
  38186. var onSelect = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_3__["default"]);
  38187. return function (e) {
  38188. /*
  38189. Compare the event key in context with the given event key.
  38190. If they are the same, then collapse the component.
  38191. */
  38192. var eventKeyPassed = eventKey === contextEventKey ? null : eventKey;
  38193. onSelect(eventKeyPassed, e);
  38194. if (onClick) onClick(e);
  38195. };
  38196. }
  38197. var AccordionToggle = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  38198. var _ref$as = _ref.as,
  38199. Component = _ref$as === void 0 ? 'button' : _ref$as,
  38200. children = _ref.children,
  38201. eventKey = _ref.eventKey,
  38202. onClick = _ref.onClick,
  38203. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "children", "eventKey", "onClick"]);
  38204. var accordionOnClick = useAccordionToggle(eventKey, onClick);
  38205. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38206. ref: ref,
  38207. onClick: accordionOnClick
  38208. }, props), children);
  38209. });
  38210. /* harmony default export */ __webpack_exports__["default"] = (AccordionToggle);
  38211. /***/ }),
  38212. /***/ "./node_modules/react-bootstrap/esm/Alert.js":
  38213. /*!***************************************************!*\
  38214. !*** ./node_modules/react-bootstrap/esm/Alert.js ***!
  38215. \***************************************************/
  38216. /*! exports provided: default */
  38217. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38218. "use strict";
  38219. __webpack_require__.r(__webpack_exports__);
  38220. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38221. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38222. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38223. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38224. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38225. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38226. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  38227. /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
  38228. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  38229. /* harmony import */ var _utils_divWithClassName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/divWithClassName */ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js");
  38230. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38231. /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
  38232. /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
  38233. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  38234. var defaultProps = {
  38235. show: true,
  38236. transition: _Fade__WEBPACK_IMPORTED_MODULE_9__["default"],
  38237. closeLabel: 'Close alert'
  38238. };
  38239. var controllables = {
  38240. show: 'onClose'
  38241. };
  38242. var Alert = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (uncontrolledProps, ref) {
  38243. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(uncontrolledProps, controllables),
  38244. bsPrefix = _useUncontrolled.bsPrefix,
  38245. show = _useUncontrolled.show,
  38246. closeLabel = _useUncontrolled.closeLabel,
  38247. className = _useUncontrolled.className,
  38248. children = _useUncontrolled.children,
  38249. variant = _useUncontrolled.variant,
  38250. onClose = _useUncontrolled.onClose,
  38251. dismissible = _useUncontrolled.dismissible,
  38252. Transition = _useUncontrolled.transition,
  38253. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["bsPrefix", "show", "closeLabel", "className", "children", "variant", "onClose", "dismissible", "transition"]);
  38254. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_8__["useBootstrapPrefix"])(bsPrefix, 'alert');
  38255. var handleClose = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_5__["default"])(function (e) {
  38256. onClose(false, e);
  38257. });
  38258. var alert = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38259. role: "alert"
  38260. }, Transition ? props : undefined, {
  38261. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, variant && prefix + "-" + variant, dismissible && prefix + "-dismissible")
  38262. }), dismissible && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CloseButton__WEBPACK_IMPORTED_MODULE_10__["default"], {
  38263. onClick: handleClose,
  38264. label: closeLabel
  38265. }), children);
  38266. if (!Transition) return show ? alert : null;
  38267. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Transition, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38268. unmountOnExit: true,
  38269. ref: ref
  38270. }, props, {
  38271. in: show
  38272. }), alert);
  38273. });
  38274. var DivStyledAsH4 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_7__["default"])('h4');
  38275. DivStyledAsH4.displayName = 'DivStyledAsH4';
  38276. Alert.displayName = 'Alert';
  38277. Alert.defaultProps = defaultProps;
  38278. Alert.Link = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_6__["default"])('alert-link', {
  38279. Component: _SafeAnchor__WEBPACK_IMPORTED_MODULE_11__["default"]
  38280. });
  38281. Alert.Heading = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_6__["default"])('alert-heading', {
  38282. Component: DivStyledAsH4
  38283. });
  38284. /* harmony default export */ __webpack_exports__["default"] = (Alert);
  38285. /***/ }),
  38286. /***/ "./node_modules/react-bootstrap/esm/Badge.js":
  38287. /*!***************************************************!*\
  38288. !*** ./node_modules/react-bootstrap/esm/Badge.js ***!
  38289. \***************************************************/
  38290. /*! exports provided: default */
  38291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38292. "use strict";
  38293. __webpack_require__.r(__webpack_exports__);
  38294. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38295. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38296. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38297. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38298. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38299. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38300. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38301. var defaultProps = {
  38302. pill: false
  38303. };
  38304. var Badge = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  38305. var bsPrefix = _ref.bsPrefix,
  38306. variant = _ref.variant,
  38307. pill = _ref.pill,
  38308. className = _ref.className,
  38309. _ref$as = _ref.as,
  38310. Component = _ref$as === void 0 ? 'span' : _ref$as,
  38311. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "variant", "pill", "className", "as"]);
  38312. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'badge');
  38313. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38314. ref: ref
  38315. }, props, {
  38316. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, pill && prefix + "-pill", variant && prefix + "-" + variant)
  38317. }));
  38318. });
  38319. Badge.displayName = 'Badge';
  38320. Badge.defaultProps = defaultProps;
  38321. /* harmony default export */ __webpack_exports__["default"] = (Badge);
  38322. /***/ }),
  38323. /***/ "./node_modules/react-bootstrap/esm/Breadcrumb.js":
  38324. /*!********************************************************!*\
  38325. !*** ./node_modules/react-bootstrap/esm/Breadcrumb.js ***!
  38326. \********************************************************/
  38327. /*! exports provided: default */
  38328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38329. "use strict";
  38330. __webpack_require__.r(__webpack_exports__);
  38331. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38332. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38333. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38334. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38335. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38336. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38337. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38338. /* harmony import */ var _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./BreadcrumbItem */ "./node_modules/react-bootstrap/esm/BreadcrumbItem.js");
  38339. var defaultProps = {
  38340. label: 'breadcrumb',
  38341. listProps: {}
  38342. };
  38343. var Breadcrumb = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  38344. var bsPrefix = _ref.bsPrefix,
  38345. className = _ref.className,
  38346. listProps = _ref.listProps,
  38347. children = _ref.children,
  38348. label = _ref.label,
  38349. _ref$as = _ref.as,
  38350. Component = _ref$as === void 0 ? 'nav' : _ref$as,
  38351. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "listProps", "children", "label", "as"]);
  38352. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'breadcrumb');
  38353. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38354. "aria-label": label,
  38355. className: className,
  38356. ref: ref
  38357. }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("ol", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, listProps, {
  38358. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(prefix, listProps.className)
  38359. }), children));
  38360. });
  38361. Breadcrumb.displayName = 'Breadcrumb';
  38362. Breadcrumb.defaultProps = defaultProps;
  38363. Breadcrumb.Item = _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_5__["default"];
  38364. /* harmony default export */ __webpack_exports__["default"] = (Breadcrumb);
  38365. /***/ }),
  38366. /***/ "./node_modules/react-bootstrap/esm/BreadcrumbItem.js":
  38367. /*!************************************************************!*\
  38368. !*** ./node_modules/react-bootstrap/esm/BreadcrumbItem.js ***!
  38369. \************************************************************/
  38370. /*! exports provided: default */
  38371. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38372. "use strict";
  38373. __webpack_require__.r(__webpack_exports__);
  38374. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38375. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38376. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38377. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38378. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38379. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38380. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  38381. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38382. var defaultProps = {
  38383. active: false
  38384. };
  38385. var BreadcrumbItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  38386. function (_ref, ref) {
  38387. var bsPrefix = _ref.bsPrefix,
  38388. active = _ref.active,
  38389. className = _ref.className,
  38390. _ref$as = _ref.as,
  38391. Component = _ref$as === void 0 ? 'li' : _ref$as,
  38392. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "active", "className", "as"]);
  38393. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'breadcrumb-item');
  38394. var href = props.href,
  38395. title = props.title,
  38396. target = props.target,
  38397. elementProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["href", "title", "target"]);
  38398. var linkProps = {
  38399. href: href,
  38400. title: title,
  38401. target: target
  38402. };
  38403. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, {
  38404. ref: ref,
  38405. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(prefix, className, {
  38406. active: active
  38407. }),
  38408. "aria-current": active ? 'page' : undefined
  38409. }, active ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, elementProps, {
  38410. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()({
  38411. active: active
  38412. })
  38413. })) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, elementProps, linkProps)));
  38414. });
  38415. BreadcrumbItem.displayName = 'BreadcrumbItem';
  38416. BreadcrumbItem.defaultProps = defaultProps;
  38417. /* harmony default export */ __webpack_exports__["default"] = (BreadcrumbItem);
  38418. /***/ }),
  38419. /***/ "./node_modules/react-bootstrap/esm/Button.js":
  38420. /*!****************************************************!*\
  38421. !*** ./node_modules/react-bootstrap/esm/Button.js ***!
  38422. \****************************************************/
  38423. /*! exports provided: default */
  38424. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38425. "use strict";
  38426. __webpack_require__.r(__webpack_exports__);
  38427. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38428. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38429. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38430. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38431. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38432. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38433. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38434. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  38435. var defaultProps = {
  38436. variant: 'primary',
  38437. active: false,
  38438. disabled: false,
  38439. type: 'button'
  38440. };
  38441. var Button = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  38442. var bsPrefix = _ref.bsPrefix,
  38443. variant = _ref.variant,
  38444. size = _ref.size,
  38445. active = _ref.active,
  38446. className = _ref.className,
  38447. block = _ref.block,
  38448. type = _ref.type,
  38449. as = _ref.as,
  38450. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "variant", "size", "active", "className", "block", "type", "as"]);
  38451. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'btn');
  38452. var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, active && 'active', prefix + "-" + variant, block && prefix + "-block", size && prefix + "-" + size);
  38453. if (props.href) {
  38454. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  38455. as: as,
  38456. ref: ref,
  38457. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(classes, props.disabled && 'disabled')
  38458. }));
  38459. }
  38460. if (ref) {
  38461. props.ref = ref;
  38462. }
  38463. if (!as) {
  38464. props.type = type;
  38465. }
  38466. var Component = as || 'button';
  38467. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  38468. className: classes
  38469. }));
  38470. });
  38471. Button.displayName = 'Button';
  38472. Button.defaultProps = defaultProps;
  38473. /* harmony default export */ __webpack_exports__["default"] = (Button);
  38474. /***/ }),
  38475. /***/ "./node_modules/react-bootstrap/esm/ButtonGroup.js":
  38476. /*!*********************************************************!*\
  38477. !*** ./node_modules/react-bootstrap/esm/ButtonGroup.js ***!
  38478. \*********************************************************/
  38479. /*! exports provided: default */
  38480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38481. "use strict";
  38482. __webpack_require__.r(__webpack_exports__);
  38483. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38484. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38485. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38486. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38487. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38488. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38489. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38490. var defaultProps = {
  38491. vertical: false,
  38492. toggle: false,
  38493. role: 'group'
  38494. };
  38495. var ButtonGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  38496. var bsPrefix = props.bsPrefix,
  38497. size = props.size,
  38498. toggle = props.toggle,
  38499. vertical = props.vertical,
  38500. className = props.className,
  38501. _props$as = props.as,
  38502. Component = _props$as === void 0 ? 'div' : _props$as,
  38503. rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["bsPrefix", "size", "toggle", "vertical", "className", "as"]);
  38504. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'btn-group');
  38505. var baseClass = prefix;
  38506. if (vertical) baseClass = prefix + "-vertical";
  38507. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, {
  38508. ref: ref,
  38509. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, baseClass, size && prefix + "-" + size, toggle && prefix + "-toggle")
  38510. }));
  38511. });
  38512. ButtonGroup.displayName = 'ButtonGroup';
  38513. ButtonGroup.defaultProps = defaultProps;
  38514. /* harmony default export */ __webpack_exports__["default"] = (ButtonGroup);
  38515. /***/ }),
  38516. /***/ "./node_modules/react-bootstrap/esm/ButtonToolbar.js":
  38517. /*!***********************************************************!*\
  38518. !*** ./node_modules/react-bootstrap/esm/ButtonToolbar.js ***!
  38519. \***********************************************************/
  38520. /*! exports provided: default */
  38521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38522. "use strict";
  38523. __webpack_require__.r(__webpack_exports__);
  38524. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38525. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38526. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38527. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38528. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38529. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38530. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38531. var defaultProps = {
  38532. role: 'toolbar'
  38533. };
  38534. var ButtonToolbar = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  38535. var bsPrefix = _ref.bsPrefix,
  38536. className = _ref.className,
  38537. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className"]);
  38538. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'btn-toolbar');
  38539. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  38540. ref: ref,
  38541. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix)
  38542. }));
  38543. });
  38544. ButtonToolbar.displayName = 'ButtonToolbar';
  38545. ButtonToolbar.defaultProps = defaultProps;
  38546. /* harmony default export */ __webpack_exports__["default"] = (ButtonToolbar);
  38547. /***/ }),
  38548. /***/ "./node_modules/react-bootstrap/esm/Card.js":
  38549. /*!**************************************************!*\
  38550. !*** ./node_modules/react-bootstrap/esm/Card.js ***!
  38551. \**************************************************/
  38552. /*! exports provided: default */
  38553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38554. "use strict";
  38555. __webpack_require__.r(__webpack_exports__);
  38556. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38557. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38558. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38559. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38560. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38561. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38562. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38563. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  38564. /* harmony import */ var _utils_divWithClassName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/divWithClassName */ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js");
  38565. /* harmony import */ var _CardContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CardContext */ "./node_modules/react-bootstrap/esm/CardContext.js");
  38566. /* harmony import */ var _CardImg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CardImg */ "./node_modules/react-bootstrap/esm/CardImg.js");
  38567. var DivStyledAsH5 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_6__["default"])('h5');
  38568. var DivStyledAsH6 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_6__["default"])('h6');
  38569. var CardBody = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-body');
  38570. var defaultProps = {
  38571. body: false
  38572. };
  38573. var Card = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  38574. var bsPrefix = _ref.bsPrefix,
  38575. className = _ref.className,
  38576. bg = _ref.bg,
  38577. text = _ref.text,
  38578. border = _ref.border,
  38579. body = _ref.body,
  38580. children = _ref.children,
  38581. _ref$as = _ref.as,
  38582. Component = _ref$as === void 0 ? 'div' : _ref$as,
  38583. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "bg", "text", "border", "body", "children", "as"]);
  38584. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'card');
  38585. var cardContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
  38586. return {
  38587. cardHeaderBsPrefix: prefix + "-header"
  38588. };
  38589. }, [prefix]);
  38590. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CardContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
  38591. value: cardContext
  38592. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38593. ref: ref
  38594. }, props, {
  38595. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, bg && "bg-" + bg, text && "text-" + text, border && "border-" + border)
  38596. }), body ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(CardBody, null, children) : children));
  38597. });
  38598. Card.displayName = 'Card';
  38599. Card.defaultProps = defaultProps;
  38600. Card.Img = _CardImg__WEBPACK_IMPORTED_MODULE_8__["default"];
  38601. Card.Title = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-title', {
  38602. Component: DivStyledAsH5
  38603. });
  38604. Card.Subtitle = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-subtitle', {
  38605. Component: DivStyledAsH6
  38606. });
  38607. Card.Body = CardBody;
  38608. Card.Link = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-link', {
  38609. Component: 'a'
  38610. });
  38611. Card.Text = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-text', {
  38612. Component: 'p'
  38613. });
  38614. Card.Header = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-header');
  38615. Card.Footer = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-footer');
  38616. Card.ImgOverlay = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-img-overlay');
  38617. /* harmony default export */ __webpack_exports__["default"] = (Card);
  38618. /***/ }),
  38619. /***/ "./node_modules/react-bootstrap/esm/CardColumns.js":
  38620. /*!*********************************************************!*\
  38621. !*** ./node_modules/react-bootstrap/esm/CardColumns.js ***!
  38622. \*********************************************************/
  38623. /*! exports provided: default */
  38624. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38625. "use strict";
  38626. __webpack_require__.r(__webpack_exports__);
  38627. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  38628. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('card-columns'));
  38629. /***/ }),
  38630. /***/ "./node_modules/react-bootstrap/esm/CardContext.js":
  38631. /*!*********************************************************!*\
  38632. !*** ./node_modules/react-bootstrap/esm/CardContext.js ***!
  38633. \*********************************************************/
  38634. /*! exports provided: default */
  38635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38636. "use strict";
  38637. __webpack_require__.r(__webpack_exports__);
  38638. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38639. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  38640. /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
  38641. /***/ }),
  38642. /***/ "./node_modules/react-bootstrap/esm/CardDeck.js":
  38643. /*!******************************************************!*\
  38644. !*** ./node_modules/react-bootstrap/esm/CardDeck.js ***!
  38645. \******************************************************/
  38646. /*! exports provided: default */
  38647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38648. "use strict";
  38649. __webpack_require__.r(__webpack_exports__);
  38650. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  38651. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('card-deck'));
  38652. /***/ }),
  38653. /***/ "./node_modules/react-bootstrap/esm/CardGroup.js":
  38654. /*!*******************************************************!*\
  38655. !*** ./node_modules/react-bootstrap/esm/CardGroup.js ***!
  38656. \*******************************************************/
  38657. /*! exports provided: default */
  38658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38659. "use strict";
  38660. __webpack_require__.r(__webpack_exports__);
  38661. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  38662. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('card-group'));
  38663. /***/ }),
  38664. /***/ "./node_modules/react-bootstrap/esm/CardImg.js":
  38665. /*!*****************************************************!*\
  38666. !*** ./node_modules/react-bootstrap/esm/CardImg.js ***!
  38667. \*****************************************************/
  38668. /*! exports provided: default */
  38669. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38670. "use strict";
  38671. __webpack_require__.r(__webpack_exports__);
  38672. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38673. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38674. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38675. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  38676. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38677. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  38678. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38679. var defaultProps = {
  38680. variant: null
  38681. };
  38682. var CardImg = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  38683. function (_ref, ref) {
  38684. var bsPrefix = _ref.bsPrefix,
  38685. className = _ref.className,
  38686. variant = _ref.variant,
  38687. _ref$as = _ref.as,
  38688. Component = _ref$as === void 0 ? 'img' : _ref$as,
  38689. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "variant", "as"]);
  38690. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'card-img');
  38691. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  38692. ref: ref,
  38693. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(variant ? prefix + "-" + variant : prefix, className)
  38694. }, props));
  38695. });
  38696. CardImg.displayName = 'CardImg';
  38697. CardImg.defaultProps = defaultProps;
  38698. /* harmony default export */ __webpack_exports__["default"] = (CardImg);
  38699. /***/ }),
  38700. /***/ "./node_modules/react-bootstrap/esm/Carousel.js":
  38701. /*!******************************************************!*\
  38702. !*** ./node_modules/react-bootstrap/esm/Carousel.js ***!
  38703. \******************************************************/
  38704. /*! exports provided: default */
  38705. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38706. "use strict";
  38707. __webpack_require__.r(__webpack_exports__);
  38708. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  38709. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  38710. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  38711. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  38712. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  38713. /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js");
  38714. /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__);
  38715. /* harmony import */ var dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/transition */ "./node_modules/dom-helpers/transition/index.js");
  38716. /* harmony import */ var dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5__);
  38717. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  38718. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);
  38719. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  38720. /* harmony import */ var _CarouselCaption__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CarouselCaption */ "./node_modules/react-bootstrap/esm/CarouselCaption.js");
  38721. /* harmony import */ var _CarouselItem__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CarouselItem */ "./node_modules/react-bootstrap/esm/CarouselItem.js");
  38722. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  38723. /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
  38724. /* harmony import */ var _utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/triggerBrowserReflow */ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js");
  38725. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  38726. var countChildren = function countChildren(c) {
  38727. return react__WEBPACK_IMPORTED_MODULE_6___default.a.Children.toArray(c).filter(react__WEBPACK_IMPORTED_MODULE_6___default.a.isValidElement).length;
  38728. };
  38729. var SWIPE_THRESHOLD = 40; // TODO: `slide` should be `animate`.
  38730. var defaultProps = {
  38731. slide: true,
  38732. fade: false,
  38733. interval: 5000,
  38734. keyboard: true,
  38735. pauseOnHover: true,
  38736. wrap: true,
  38737. indicators: true,
  38738. controls: true,
  38739. activeIndex: 0,
  38740. prevIcon: react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
  38741. "aria-hidden": "true",
  38742. className: "carousel-control-prev-icon"
  38743. }),
  38744. prevLabel: 'Previous',
  38745. nextIcon: react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
  38746. "aria-hidden": "true",
  38747. className: "carousel-control-next-icon"
  38748. }),
  38749. nextLabel: 'Next',
  38750. touch: true
  38751. };
  38752. var Carousel =
  38753. /*#__PURE__*/
  38754. function (_React$Component) {
  38755. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Carousel, _React$Component);
  38756. function Carousel() {
  38757. var _this;
  38758. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  38759. args[_key] = arguments[_key];
  38760. }
  38761. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  38762. _this.state = {
  38763. prevClasses: '',
  38764. currentClasses: 'active',
  38765. touchStartX: 0
  38766. };
  38767. _this.isUnmounted = false;
  38768. _this.carousel = react__WEBPACK_IMPORTED_MODULE_6___default.a.createRef();
  38769. _this.handleTouchStart = function (e) {
  38770. _this.setState({
  38771. touchStartX: e.changedTouches[0].screenX
  38772. });
  38773. };
  38774. _this.handleTouchEnd = function (e) {
  38775. // If the swipe is under the threshold, don't do anything.
  38776. if (Math.abs(e.changedTouches[0].screenX - _this.state.touchStartX) < SWIPE_THRESHOLD) return;
  38777. if (e.changedTouches[0].screenX < _this.state.touchStartX) {
  38778. // Swiping left to navigate to next item.
  38779. _this.handleNext(e);
  38780. } else {
  38781. // Swiping right to navigate to previous item.
  38782. _this.handlePrev(e);
  38783. }
  38784. };
  38785. _this.handleSlideEnd = function () {
  38786. var pendingIndex = _this._pendingIndex;
  38787. _this._isSliding = false;
  38788. _this._pendingIndex = null;
  38789. if (pendingIndex != null) _this.to(pendingIndex);else _this.cycle();
  38790. };
  38791. _this.handleMouseOut = function () {
  38792. _this.cycle();
  38793. };
  38794. _this.handleMouseOver = function () {
  38795. if (_this.props.pauseOnHover) _this.pause();
  38796. };
  38797. _this.handleKeyDown = function (event) {
  38798. if (/input|textarea/i.test(event.target.tagName)) return;
  38799. switch (event.key) {
  38800. case 'ArrowLeft':
  38801. event.preventDefault();
  38802. _this.handlePrev(event);
  38803. break;
  38804. case 'ArrowRight':
  38805. event.preventDefault();
  38806. _this.handleNext(event);
  38807. break;
  38808. default:
  38809. break;
  38810. }
  38811. };
  38812. _this.handleNextWhenVisible = function () {
  38813. if (!_this.isUnmounted && !document.hidden && dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default()(_this.carousel.current, 'visibility') !== 'hidden') {
  38814. _this.handleNext();
  38815. }
  38816. };
  38817. _this.handleNext = function (e) {
  38818. if (_this._isSliding) return;
  38819. var _this$props = _this.props,
  38820. wrap = _this$props.wrap,
  38821. activeIndex = _this$props.activeIndex;
  38822. var index = activeIndex + 1;
  38823. var count = countChildren(_this.props.children);
  38824. if (index > count - 1) {
  38825. if (!wrap) return;
  38826. index = 0;
  38827. }
  38828. _this.select(index, e, 'next');
  38829. };
  38830. _this.handlePrev = function (e) {
  38831. if (_this._isSliding) return;
  38832. var _this$props2 = _this.props,
  38833. wrap = _this$props2.wrap,
  38834. activeIndex = _this$props2.activeIndex;
  38835. var index = activeIndex - 1;
  38836. if (index < 0) {
  38837. if (!wrap) return;
  38838. index = countChildren(_this.props.children) - 1;
  38839. }
  38840. _this.select(index, e, 'prev');
  38841. };
  38842. return _this;
  38843. }
  38844. var _proto = Carousel.prototype;
  38845. _proto.componentDidMount = function componentDidMount() {
  38846. this.cycle();
  38847. };
  38848. Carousel.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
  38849. var previousActiveIndex = _ref.activeIndex;
  38850. if (nextProps.activeIndex !== previousActiveIndex) {
  38851. var lastPossibleIndex = countChildren(nextProps.children) - 1;
  38852. var nextIndex = Math.max(0, Math.min(nextProps.activeIndex, lastPossibleIndex));
  38853. var direction;
  38854. if (nextIndex === 0 && previousActiveIndex >= lastPossibleIndex || previousActiveIndex <= nextIndex) {
  38855. direction = 'next';
  38856. } else {
  38857. direction = 'prev';
  38858. }
  38859. return {
  38860. direction: direction,
  38861. previousActiveIndex: previousActiveIndex,
  38862. activeIndex: nextIndex
  38863. };
  38864. }
  38865. return null;
  38866. };
  38867. _proto.componentDidUpdate = function componentDidUpdate(_, prevState) {
  38868. var _this2 = this;
  38869. var _this$props3 = this.props,
  38870. bsPrefix = _this$props3.bsPrefix,
  38871. slide = _this$props3.slide,
  38872. onSlideEnd = _this$props3.onSlideEnd;
  38873. if (!slide || this.state.activeIndex === prevState.activeIndex || this._isSliding) return;
  38874. var _this$state = this.state,
  38875. activeIndex = _this$state.activeIndex,
  38876. direction = _this$state.direction;
  38877. var orderClassName, directionalClassName;
  38878. if (direction === 'next') {
  38879. orderClassName = bsPrefix + "-item-next";
  38880. directionalClassName = bsPrefix + "-item-left";
  38881. } else if (direction === 'prev') {
  38882. orderClassName = bsPrefix + "-item-prev";
  38883. directionalClassName = bsPrefix + "-item-right";
  38884. }
  38885. this._isSliding = true;
  38886. this.pause(); // eslint-disable-next-line react/no-did-update-set-state
  38887. this.safeSetState({
  38888. prevClasses: 'active',
  38889. currentClasses: orderClassName
  38890. }, function () {
  38891. var items = _this2.carousel.current.children;
  38892. var nextElement = items[activeIndex];
  38893. Object(_utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_12__["default"])(nextElement);
  38894. _this2.safeSetState({
  38895. prevClasses: classnames__WEBPACK_IMPORTED_MODULE_3___default()('active', directionalClassName),
  38896. currentClasses: classnames__WEBPACK_IMPORTED_MODULE_3___default()(orderClassName, directionalClassName)
  38897. }, function () {
  38898. return dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5___default.a.end(nextElement, function () {
  38899. _this2.safeSetState({
  38900. prevClasses: '',
  38901. currentClasses: 'active'
  38902. }, _this2.handleSlideEnd);
  38903. if (onSlideEnd) {
  38904. onSlideEnd();
  38905. }
  38906. });
  38907. });
  38908. });
  38909. };
  38910. _proto.componentWillUnmount = function componentWillUnmount() {
  38911. clearTimeout(this.timeout);
  38912. this.isUnmounted = true;
  38913. };
  38914. _proto.safeSetState = function safeSetState(state, cb) {
  38915. var _this3 = this;
  38916. if (this.isUnmounted) return;
  38917. this.setState(state, function () {
  38918. return !_this3.isUnmounted && cb();
  38919. });
  38920. } // This might be a public API.
  38921. ;
  38922. _proto.pause = function pause() {
  38923. this._isPaused = true;
  38924. clearInterval(this._interval);
  38925. this._interval = null;
  38926. };
  38927. _proto.cycle = function cycle() {
  38928. this._isPaused = false;
  38929. clearInterval(this._interval);
  38930. this._interval = null;
  38931. if (this.props.interval && !this._isPaused) {
  38932. this._interval = setInterval(document.visibilityState ? this.handleNextWhenVisible : this.handleNext, this.props.interval);
  38933. }
  38934. };
  38935. _proto.to = function to(index, event) {
  38936. var children = this.props.children;
  38937. if (index < 0 || index > countChildren(children) - 1) {
  38938. return;
  38939. }
  38940. if (this._isSliding) {
  38941. this._pendingIndex = index;
  38942. return;
  38943. }
  38944. this.select(index, event);
  38945. };
  38946. _proto.select = function select(index, event, direction) {
  38947. var _this4 = this;
  38948. clearTimeout(this.selectThrottle);
  38949. if (event && event.persist) event.persist(); // The timeout throttles fast clicks, in order to give any pending state
  38950. // a chance to update and propagate back through props
  38951. this.selectThrottle = setTimeout(function () {
  38952. clearTimeout(_this4.timeout);
  38953. var _this4$props = _this4.props,
  38954. activeIndex = _this4$props.activeIndex,
  38955. onSelect = _this4$props.onSelect;
  38956. if (index === activeIndex || _this4._isSliding || _this4.isUnmounted) return;
  38957. onSelect(index, direction || (index < activeIndex ? 'prev' : 'next'), event);
  38958. }, 50);
  38959. };
  38960. _proto.renderControls = function renderControls(properties) {
  38961. var bsPrefix = this.props.bsPrefix;
  38962. var wrap = properties.wrap,
  38963. children = properties.children,
  38964. activeIndex = properties.activeIndex,
  38965. prevIcon = properties.prevIcon,
  38966. nextIcon = properties.nextIcon,
  38967. prevLabel = properties.prevLabel,
  38968. nextLabel = properties.nextLabel;
  38969. var count = countChildren(children);
  38970. return [(wrap || activeIndex !== 0) && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_10__["default"], {
  38971. key: "prev",
  38972. className: bsPrefix + "-control-prev",
  38973. onClick: this.handlePrev
  38974. }, prevIcon, prevLabel && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
  38975. className: "sr-only"
  38976. }, prevLabel)), (wrap || activeIndex !== count - 1) && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_10__["default"], {
  38977. key: "next",
  38978. className: bsPrefix + "-control-next",
  38979. onClick: this.handleNext
  38980. }, nextIcon, nextLabel && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
  38981. className: "sr-only"
  38982. }, nextLabel))];
  38983. };
  38984. _proto.renderIndicators = function renderIndicators(children, activeIndex) {
  38985. var _this5 = this;
  38986. var bsPrefix = this.props.bsPrefix;
  38987. var indicators = [];
  38988. Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["forEach"])(children, function (child, index) {
  38989. indicators.push(react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("li", {
  38990. key: index,
  38991. className: index === activeIndex ? 'active' : null,
  38992. onClick: function onClick(e) {
  38993. return _this5.to(index, e);
  38994. }
  38995. }), // Force whitespace between indicator elements. Bootstrap requires
  38996. // this for correct spacing of elements.
  38997. ' ');
  38998. });
  38999. return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("ol", {
  39000. className: bsPrefix + "-indicators"
  39001. }, indicators);
  39002. };
  39003. _proto.render = function render() {
  39004. var _this$props4 = this.props,
  39005. _this$props4$as = _this$props4.as,
  39006. Component = _this$props4$as === void 0 ? 'div' : _this$props4$as,
  39007. bsPrefix = _this$props4.bsPrefix,
  39008. slide = _this$props4.slide,
  39009. fade = _this$props4.fade,
  39010. indicators = _this$props4.indicators,
  39011. controls = _this$props4.controls,
  39012. wrap = _this$props4.wrap,
  39013. touch = _this$props4.touch,
  39014. prevIcon = _this$props4.prevIcon,
  39015. prevLabel = _this$props4.prevLabel,
  39016. nextIcon = _this$props4.nextIcon,
  39017. nextLabel = _this$props4.nextLabel,
  39018. className = _this$props4.className,
  39019. children = _this$props4.children,
  39020. keyboard = _this$props4.keyboard,
  39021. _5 = _this$props4.activeIndex,
  39022. _4 = _this$props4.pauseOnHover,
  39023. _3 = _this$props4.interval,
  39024. _2 = _this$props4.onSelect,
  39025. _1 = _this$props4.onSlideEnd,
  39026. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props4, ["as", "bsPrefix", "slide", "fade", "indicators", "controls", "wrap", "touch", "prevIcon", "prevLabel", "nextIcon", "nextLabel", "className", "children", "keyboard", "activeIndex", "pauseOnHover", "interval", "onSelect", "onSlideEnd"]);
  39027. var _this$state2 = this.state,
  39028. activeIndex = _this$state2.activeIndex,
  39029. previousActiveIndex = _this$state2.previousActiveIndex,
  39030. prevClasses = _this$state2.prevClasses,
  39031. currentClasses = _this$state2.currentClasses;
  39032. return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
  39033. react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39034. onTouchStart: touch ? this.handleTouchStart : undefined,
  39035. onTouchEnd: touch ? this.handleTouchEnd : undefined
  39036. }, props, {
  39037. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix, slide && 'slide', fade && bsPrefix + "-fade"),
  39038. onKeyDown: keyboard ? this.handleKeyDown : undefined,
  39039. onMouseOver: this.handleMouseOver,
  39040. onMouseOut: this.handleMouseOut
  39041. }), indicators && this.renderIndicators(children, activeIndex), react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("div", {
  39042. className: bsPrefix + "-inner",
  39043. ref: this.carousel
  39044. }, Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["map"])(children, function (child, index) {
  39045. var current = index === activeIndex;
  39046. var previous = index === previousActiveIndex;
  39047. return Object(react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"])(child, {
  39048. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(child.props.className, bsPrefix + "-item", current && currentClasses, previous && prevClasses)
  39049. });
  39050. })), controls && this.renderControls({
  39051. wrap: wrap,
  39052. children: children,
  39053. activeIndex: activeIndex,
  39054. prevIcon: prevIcon,
  39055. prevLabel: prevLabel,
  39056. nextIcon: nextIcon,
  39057. nextLabel: nextLabel
  39058. }))
  39059. );
  39060. };
  39061. return Carousel;
  39062. }(react__WEBPACK_IMPORTED_MODULE_6___default.a.Component);
  39063. Carousel.defaultProps = defaultProps;
  39064. var DecoratedCarousel = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_13__["createBootstrapComponent"])(Object(uncontrollable__WEBPACK_IMPORTED_MODULE_7__["uncontrollable"])(Carousel, {
  39065. activeIndex: 'onSelect'
  39066. }), 'carousel');
  39067. DecoratedCarousel.Caption = _CarouselCaption__WEBPACK_IMPORTED_MODULE_8__["default"];
  39068. DecoratedCarousel.Item = _CarouselItem__WEBPACK_IMPORTED_MODULE_9__["default"];
  39069. /* harmony default export */ __webpack_exports__["default"] = (DecoratedCarousel);
  39070. /***/ }),
  39071. /***/ "./node_modules/react-bootstrap/esm/CarouselCaption.js":
  39072. /*!*************************************************************!*\
  39073. !*** ./node_modules/react-bootstrap/esm/CarouselCaption.js ***!
  39074. \*************************************************************/
  39075. /*! exports provided: default */
  39076. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39077. "use strict";
  39078. __webpack_require__.r(__webpack_exports__);
  39079. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  39080. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('carousel-caption', {
  39081. Component: 'div'
  39082. }));
  39083. /***/ }),
  39084. /***/ "./node_modules/react-bootstrap/esm/CarouselItem.js":
  39085. /*!**********************************************************!*\
  39086. !*** ./node_modules/react-bootstrap/esm/CarouselItem.js ***!
  39087. \**********************************************************/
  39088. /*! exports provided: default */
  39089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39090. "use strict";
  39091. __webpack_require__.r(__webpack_exports__);
  39092. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  39093. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('carousel-item'));
  39094. /***/ }),
  39095. /***/ "./node_modules/react-bootstrap/esm/CloseButton.js":
  39096. /*!*********************************************************!*\
  39097. !*** ./node_modules/react-bootstrap/esm/CloseButton.js ***!
  39098. \*********************************************************/
  39099. /*! exports provided: default */
  39100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39101. "use strict";
  39102. __webpack_require__.r(__webpack_exports__);
  39103. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39104. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39105. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  39106. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
  39107. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39108. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39109. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39110. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
  39111. var propTypes = {
  39112. label: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired,
  39113. onClick: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func
  39114. };
  39115. var defaultProps = {
  39116. label: 'Close'
  39117. };
  39118. var CloseButton = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  39119. var label = _ref.label,
  39120. onClick = _ref.onClick,
  39121. className = _ref.className,
  39122. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["label", "onClick", "className"]);
  39123. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39124. ref: ref,
  39125. type: "button",
  39126. className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('close', className),
  39127. onClick: onClick
  39128. }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
  39129. "aria-hidden": "true"
  39130. }, "\xD7"), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
  39131. className: "sr-only"
  39132. }, label));
  39133. });
  39134. CloseButton.displayName = 'CloseButton';
  39135. CloseButton.propTypes = propTypes;
  39136. CloseButton.defaultProps = defaultProps;
  39137. /* harmony default export */ __webpack_exports__["default"] = (CloseButton);
  39138. /***/ }),
  39139. /***/ "./node_modules/react-bootstrap/esm/Col.js":
  39140. /*!*************************************************!*\
  39141. !*** ./node_modules/react-bootstrap/esm/Col.js ***!
  39142. \*************************************************/
  39143. /*! exports provided: default */
  39144. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39145. "use strict";
  39146. __webpack_require__.r(__webpack_exports__);
  39147. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39148. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39149. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39150. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39151. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39152. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39153. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39154. var DEVICE_SIZES = ['xl', 'lg', 'md', 'sm', 'xs'];
  39155. var Col = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  39156. function (_ref, ref) {
  39157. var bsPrefix = _ref.bsPrefix,
  39158. className = _ref.className,
  39159. _ref$as = _ref.as,
  39160. Component = _ref$as === void 0 ? 'div' : _ref$as,
  39161. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as"]);
  39162. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'col');
  39163. var spans = [];
  39164. var classes = [];
  39165. DEVICE_SIZES.forEach(function (brkPoint) {
  39166. var propValue = props[brkPoint];
  39167. delete props[brkPoint];
  39168. var span, offset, order;
  39169. if (propValue != null && typeof propValue === 'object') {
  39170. var _propValue$span = propValue.span;
  39171. span = _propValue$span === void 0 ? true : _propValue$span;
  39172. offset = propValue.offset;
  39173. order = propValue.order;
  39174. } else {
  39175. span = propValue;
  39176. }
  39177. var infix = brkPoint !== 'xs' ? "-" + brkPoint : '';
  39178. if (span != null) spans.push(span === true ? "" + prefix + infix : "" + prefix + infix + "-" + span);
  39179. if (order != null) classes.push("order" + infix + "-" + order);
  39180. if (offset != null) classes.push("offset" + infix + "-" + offset);
  39181. });
  39182. if (!spans.length) {
  39183. spans.push(prefix); // plain 'col'
  39184. }
  39185. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  39186. ref: ref,
  39187. className: classnames__WEBPACK_IMPORTED_MODULE_2___default.a.apply(void 0, [className].concat(spans, classes))
  39188. }));
  39189. });
  39190. Col.displayName = 'Col';
  39191. /* harmony default export */ __webpack_exports__["default"] = (Col);
  39192. /***/ }),
  39193. /***/ "./node_modules/react-bootstrap/esm/Collapse.js":
  39194. /*!******************************************************!*\
  39195. !*** ./node_modules/react-bootstrap/esm/Collapse.js ***!
  39196. \******************************************************/
  39197. /*! exports provided: default */
  39198. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39199. "use strict";
  39200. __webpack_require__.r(__webpack_exports__);
  39201. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39202. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39203. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  39204. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39205. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  39206. /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js");
  39207. /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__);
  39208. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39209. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
  39210. /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dom-helpers/transition/end */ "./node_modules/dom-helpers/transition/end.js");
  39211. /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6__);
  39212. /* harmony import */ var react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-transition-group/Transition */ "./node_modules/react-transition-group/esm/Transition.js");
  39213. /* harmony import */ var _utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/triggerBrowserReflow */ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js");
  39214. /* harmony import */ var _utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/createChainedFunction */ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js");
  39215. var _collapseStyles;
  39216. var MARGINS = {
  39217. height: ['marginTop', 'marginBottom'],
  39218. width: ['marginLeft', 'marginRight']
  39219. };
  39220. function getDimensionValue(dimension, elem) {
  39221. var offset = "offset" + dimension[0].toUpperCase() + dimension.slice(1);
  39222. var value = elem[offset];
  39223. var margins = MARGINS[dimension];
  39224. return value + parseInt(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default()(elem, margins[0]), 10) + parseInt(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default()(elem, margins[1]), 10);
  39225. }
  39226. var collapseStyles = (_collapseStyles = {}, _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["EXITED"]] = 'collapse', _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["EXITING"]] = 'collapsing', _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["ENTERING"]] = 'collapsing', _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["ENTERED"]] = 'collapse show', _collapseStyles);
  39227. var defaultProps = {
  39228. in: false,
  39229. timeout: 300,
  39230. mountOnEnter: false,
  39231. unmountOnExit: false,
  39232. appear: false,
  39233. dimension: 'height',
  39234. getDimensionValue: getDimensionValue
  39235. };
  39236. var Collapse =
  39237. /*#__PURE__*/
  39238. function (_React$Component) {
  39239. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Collapse, _React$Component);
  39240. function Collapse() {
  39241. var _this;
  39242. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  39243. args[_key] = arguments[_key];
  39244. }
  39245. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  39246. _this.handleEnter = function (elem) {
  39247. elem.style[_this.getDimension()] = '0';
  39248. };
  39249. _this.handleEntering = function (elem) {
  39250. var dimension = _this.getDimension();
  39251. elem.style[dimension] = _this._getScrollDimensionValue(elem, dimension);
  39252. };
  39253. _this.handleEntered = function (elem) {
  39254. elem.style[_this.getDimension()] = null;
  39255. };
  39256. _this.handleExit = function (elem) {
  39257. var dimension = _this.getDimension();
  39258. elem.style[dimension] = _this.props.getDimensionValue(dimension, elem) + "px";
  39259. Object(_utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_8__["default"])(elem);
  39260. };
  39261. _this.handleExiting = function (elem) {
  39262. elem.style[_this.getDimension()] = null;
  39263. };
  39264. return _this;
  39265. }
  39266. var _proto = Collapse.prototype;
  39267. _proto.getDimension = function getDimension() {
  39268. return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension;
  39269. }
  39270. /* -- Expanding -- */
  39271. ;
  39272. // for testing
  39273. _proto._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) {
  39274. var scroll = "scroll" + dimension[0].toUpperCase() + dimension.slice(1);
  39275. return elem[scroll] + "px";
  39276. };
  39277. _proto.render = function render() {
  39278. var _this2 = this;
  39279. var _this$props = this.props,
  39280. onEnter = _this$props.onEnter,
  39281. onEntering = _this$props.onEntering,
  39282. onEntered = _this$props.onEntered,
  39283. onExit = _this$props.onExit,
  39284. onExiting = _this$props.onExiting,
  39285. className = _this$props.className,
  39286. children = _this$props.children,
  39287. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["onEnter", "onEntering", "onEntered", "onExit", "onExiting", "className", "children"]);
  39288. delete props.dimension;
  39289. delete props.getDimensionValue;
  39290. var handleEnter = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleEnter, onEnter);
  39291. var handleEntering = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleEntering, onEntering);
  39292. var handleEntered = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleEntered, onEntered);
  39293. var handleExit = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleExit, onExit);
  39294. var handleExiting = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleExiting, onExiting);
  39295. return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39296. addEndListener: dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6___default.a
  39297. }, props, {
  39298. "aria-expanded": props.role ? props.in : null,
  39299. onEnter: handleEnter,
  39300. onEntering: handleEntering,
  39301. onEntered: handleEntered,
  39302. onExit: handleExit,
  39303. onExiting: handleExiting
  39304. }), function (state, innerProps) {
  39305. return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(children, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, innerProps, {
  39306. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, children.props.className, collapseStyles[state], _this2.getDimension() === 'width' && 'width')
  39307. }));
  39308. });
  39309. };
  39310. return Collapse;
  39311. }(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component);
  39312. Collapse.defaultProps = defaultProps;
  39313. /* harmony default export */ __webpack_exports__["default"] = (Collapse);
  39314. /***/ }),
  39315. /***/ "./node_modules/react-bootstrap/esm/Container.js":
  39316. /*!*******************************************************!*\
  39317. !*** ./node_modules/react-bootstrap/esm/Container.js ***!
  39318. \*******************************************************/
  39319. /*! exports provided: default */
  39320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39321. "use strict";
  39322. __webpack_require__.r(__webpack_exports__);
  39323. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39324. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39325. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39326. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39327. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39328. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39329. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39330. var defaultProps = {
  39331. fluid: false
  39332. };
  39333. var Container = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  39334. function (_ref, ref) {
  39335. var bsPrefix = _ref.bsPrefix,
  39336. fluid = _ref.fluid,
  39337. _ref$as = _ref.as,
  39338. Component = _ref$as === void 0 ? 'div' : _ref$as,
  39339. className = _ref.className,
  39340. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "fluid", "as", "className"]);
  39341. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'container');
  39342. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39343. ref: ref
  39344. }, props, {
  39345. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, fluid ? prefix + "-fluid" : prefix)
  39346. }));
  39347. });
  39348. Container.displayName = 'Container';
  39349. Container.defaultProps = defaultProps;
  39350. /* harmony default export */ __webpack_exports__["default"] = (Container);
  39351. /***/ }),
  39352. /***/ "./node_modules/react-bootstrap/esm/Dropdown.js":
  39353. /*!******************************************************!*\
  39354. !*** ./node_modules/react-bootstrap/esm/Dropdown.js ***!
  39355. \******************************************************/
  39356. /*! exports provided: default */
  39357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39358. "use strict";
  39359. __webpack_require__.r(__webpack_exports__);
  39360. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39361. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39362. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39363. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39364. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39365. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39366. /* harmony import */ var react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-overlays/Dropdown */ "./node_modules/react-overlays/Dropdown.js");
  39367. /* harmony import */ var react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4__);
  39368. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  39369. /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
  39370. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39371. /* harmony import */ var _DropdownMenu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./DropdownMenu */ "./node_modules/react-bootstrap/esm/DropdownMenu.js");
  39372. /* harmony import */ var _DropdownToggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./DropdownToggle */ "./node_modules/react-bootstrap/esm/DropdownToggle.js");
  39373. /* harmony import */ var _DropdownItem__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./DropdownItem */ "./node_modules/react-bootstrap/esm/DropdownItem.js");
  39374. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  39375. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  39376. var defaultProps = {
  39377. navbar: false
  39378. };
  39379. var Dropdown = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (uncontrolledProps, ref) {
  39380. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_5__["useUncontrolled"])(uncontrolledProps, {
  39381. show: 'onToggle'
  39382. }),
  39383. bsPrefix = _useUncontrolled.bsPrefix,
  39384. drop = _useUncontrolled.drop,
  39385. show = _useUncontrolled.show,
  39386. className = _useUncontrolled.className,
  39387. alignRight = _useUncontrolled.alignRight,
  39388. onSelect = _useUncontrolled.onSelect,
  39389. onToggle = _useUncontrolled.onToggle,
  39390. focusFirstItemOnShow = _useUncontrolled.focusFirstItemOnShow,
  39391. _useUncontrolled$as = _useUncontrolled.as,
  39392. Component = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
  39393. _4 = _useUncontrolled.navbar,
  39394. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["bsPrefix", "drop", "show", "className", "alignRight", "onSelect", "onToggle", "focusFirstItemOnShow", "as", "navbar"]);
  39395. var onSelectCtx = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_11__["default"]);
  39396. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'dropdown');
  39397. var handleToggle = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_6__["default"])(function (nextShow, event, source) {
  39398. if (source === void 0) {
  39399. source = event.type;
  39400. }
  39401. if (event.currentTarget === document) source = 'rootClose';
  39402. onToggle(nextShow, event, {
  39403. source: source
  39404. });
  39405. });
  39406. var handleSelect = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_6__["default"])(function (key, event) {
  39407. if (onSelectCtx) onSelectCtx(key, event);
  39408. if (onSelect) onSelect(key, event);
  39409. handleToggle(false, event, 'select');
  39410. });
  39411. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_11__["default"].Provider, {
  39412. value: handleSelect
  39413. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4___default.a.ControlledComponent, {
  39414. drop: drop,
  39415. show: show,
  39416. alignEnd: alignRight,
  39417. onToggle: handleToggle,
  39418. focusFirstItemOnShow: focusFirstItemOnShow,
  39419. itemSelector: "." + prefix + "-item:not(.disabled):not(:disabled)"
  39420. }, function (_ref) {
  39421. var dropdownProps = _ref.props;
  39422. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, dropdownProps, {
  39423. ref: ref,
  39424. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, show && 'show', (!drop || drop === 'down') && prefix, drop === 'up' && 'dropup', drop === 'right' && 'dropright', drop === 'left' && 'dropleft')
  39425. }));
  39426. }));
  39427. });
  39428. Dropdown.displayName = 'Dropdown';
  39429. Dropdown.defaultProps = defaultProps;
  39430. Dropdown.Toggle = _DropdownToggle__WEBPACK_IMPORTED_MODULE_9__["default"];
  39431. Dropdown.Menu = _DropdownMenu__WEBPACK_IMPORTED_MODULE_8__["default"];
  39432. Dropdown.Item = _DropdownItem__WEBPACK_IMPORTED_MODULE_10__["default"];
  39433. Dropdown.Header = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_12__["default"])('dropdown-header', {
  39434. defaultProps: {
  39435. role: 'heading'
  39436. }
  39437. });
  39438. Dropdown.Divider = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_12__["default"])('dropdown-divider', {
  39439. defaultProps: {
  39440. role: 'separator'
  39441. }
  39442. });
  39443. /* harmony default export */ __webpack_exports__["default"] = (Dropdown);
  39444. /***/ }),
  39445. /***/ "./node_modules/react-bootstrap/esm/DropdownButton.js":
  39446. /*!************************************************************!*\
  39447. !*** ./node_modules/react-bootstrap/esm/DropdownButton.js ***!
  39448. \************************************************************/
  39449. /*! exports provided: default */
  39450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39451. "use strict";
  39452. __webpack_require__.r(__webpack_exports__);
  39453. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39454. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39455. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39456. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  39457. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  39458. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
  39459. /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
  39460. var propTypes = {
  39461. /**
  39462. * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.
  39463. * @type {string|number}
  39464. * @required
  39465. */
  39466. id: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.any,
  39467. /** An `href` passed to the Toggle component */
  39468. href: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  39469. /** An `onClick` handler passed to the Toggle component */
  39470. onClick: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,
  39471. /** The content of the non-toggle Button. */
  39472. title: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.node.isRequired,
  39473. /** Disables both Buttons */
  39474. disabled: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
  39475. /** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
  39476. menuRole: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  39477. /**
  39478. * Which event when fired outside the component will cause it to be closed.
  39479. *
  39480. * _see [DropdownMenu](#menu-props) for more details_
  39481. */
  39482. rootCloseEvent: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  39483. /** @ignore */
  39484. bsPrefix: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  39485. /** @ignore */
  39486. variant: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  39487. /** @ignore */
  39488. size: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string
  39489. };
  39490. /**
  39491. * A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`
  39492. * are passed directly to the default `Dropdown.Menu`.
  39493. *
  39494. * _All unknown props are passed through to the `Dropdown` component._ Only
  39495. * the Button `variant`, `size` and `bsPrefix` props are passed to the toggle,
  39496. * along with menu related props are passed to the `Dropdown.Menu`
  39497. */
  39498. var DropdownButton = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  39499. var title = _ref.title,
  39500. children = _ref.children,
  39501. bsPrefix = _ref.bsPrefix,
  39502. rootCloseEvent = _ref.rootCloseEvent,
  39503. variant = _ref.variant,
  39504. size = _ref.size,
  39505. menuRole = _ref.menuRole,
  39506. disabled = _ref.disabled,
  39507. href = _ref.href,
  39508. id = _ref.id,
  39509. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["title", "children", "bsPrefix", "rootCloseEvent", "variant", "size", "menuRole", "disabled", "href", "id"]);
  39510. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39511. ref: ref
  39512. }, props), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Toggle, {
  39513. id: id,
  39514. href: href,
  39515. size: size,
  39516. variant: variant,
  39517. disabled: disabled,
  39518. childBsPrefix: bsPrefix
  39519. }, title), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Menu, {
  39520. role: menuRole,
  39521. rootCloseEvent: rootCloseEvent
  39522. }, children));
  39523. });
  39524. DropdownButton.displayName = 'DropdownButton';
  39525. DropdownButton.propTypes = propTypes;
  39526. /* harmony default export */ __webpack_exports__["default"] = (DropdownButton);
  39527. /***/ }),
  39528. /***/ "./node_modules/react-bootstrap/esm/DropdownItem.js":
  39529. /*!**********************************************************!*\
  39530. !*** ./node_modules/react-bootstrap/esm/DropdownItem.js ***!
  39531. \**********************************************************/
  39532. /*! exports provided: default */
  39533. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39534. "use strict";
  39535. __webpack_require__.r(__webpack_exports__);
  39536. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39537. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39538. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39539. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39540. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39541. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39542. /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
  39543. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  39544. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  39545. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39546. /* harmony import */ var _NavContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavContext */ "./node_modules/react-bootstrap/esm/NavContext.js");
  39547. var defaultProps = {
  39548. as: _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__["default"],
  39549. disabled: false
  39550. };
  39551. var DropdownItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  39552. var bsPrefix = _ref.bsPrefix,
  39553. className = _ref.className,
  39554. children = _ref.children,
  39555. eventKey = _ref.eventKey,
  39556. disabled = _ref.disabled,
  39557. href = _ref.href,
  39558. onClick = _ref.onClick,
  39559. onSelect = _ref.onSelect,
  39560. propActive = _ref.active,
  39561. Component = _ref.as,
  39562. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "eventKey", "disabled", "href", "onClick", "onSelect", "active", "as"]);
  39563. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'dropdown-item');
  39564. var onSelectCtx = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["default"]);
  39565. var navContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_NavContext__WEBPACK_IMPORTED_MODULE_8__["default"]);
  39566. var _ref2 = navContext || {},
  39567. activeKey = _ref2.activeKey;
  39568. var key = Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(eventKey, href);
  39569. var active = propActive == null && key != null ? Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(activeKey) === key : propActive;
  39570. var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function (event) {
  39571. // SafeAnchor handles the disabled case, but we handle it here
  39572. // for other components
  39573. if (disabled) return;
  39574. if (onClick) onClick(event);
  39575. if (onSelectCtx) onSelectCtx(key, event);
  39576. if (onSelect) onSelect(key, event);
  39577. });
  39578. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  39579. ref: ref,
  39580. href: href,
  39581. disabled: disabled,
  39582. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, active && 'active', disabled && 'disabled'),
  39583. onClick: handleClick
  39584. }), children);
  39585. });
  39586. DropdownItem.displayName = 'DropdownItem';
  39587. DropdownItem.defaultProps = defaultProps;
  39588. /* harmony default export */ __webpack_exports__["default"] = (DropdownItem);
  39589. /***/ }),
  39590. /***/ "./node_modules/react-bootstrap/esm/DropdownMenu.js":
  39591. /*!**********************************************************!*\
  39592. !*** ./node_modules/react-bootstrap/esm/DropdownMenu.js ***!
  39593. \**********************************************************/
  39594. /*! exports provided: default */
  39595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39596. "use strict";
  39597. __webpack_require__.r(__webpack_exports__);
  39598. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39599. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39600. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39601. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39602. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  39603. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_3__);
  39604. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39605. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  39606. /* harmony import */ var react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-overlays/DropdownMenu */ "./node_modules/react-overlays/DropdownMenu.js");
  39607. /* harmony import */ var react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5__);
  39608. /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
  39609. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39610. var wrapRef = function wrapRef(props) {
  39611. var ref = props.ref;
  39612. props.ref = ref.__wrapped || (ref.__wrapped = function (r) {
  39613. return ref(Object(react_dom__WEBPACK_IMPORTED_MODULE_3__["findDOMNode"])(r));
  39614. });
  39615. return props;
  39616. };
  39617. var defaultProps = {
  39618. alignRight: false,
  39619. flip: true
  39620. };
  39621. var DropdownMenu = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (_ref, ref) {
  39622. var bsPrefix = _ref.bsPrefix,
  39623. className = _ref.className,
  39624. alignRight = _ref.alignRight,
  39625. rootCloseEvent = _ref.rootCloseEvent,
  39626. flip = _ref.flip,
  39627. popperConfig = _ref.popperConfig,
  39628. showProps = _ref.show,
  39629. _ref$as = _ref.as,
  39630. Component = _ref$as === void 0 ? 'div' : _ref$as,
  39631. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "alignRight", "rootCloseEvent", "flip", "popperConfig", "show", "as"]);
  39632. var isNavbar = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_NavbarContext__WEBPACK_IMPORTED_MODULE_6__["default"]);
  39633. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'dropdown-menu');
  39634. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5___default.a, {
  39635. ref: ref // FIXME: the ref situation is out of hand here
  39636. ,
  39637. flip: flip,
  39638. show: showProps,
  39639. alignEnd: alignRight,
  39640. usePopper: !isNavbar,
  39641. popperConfig: popperConfig,
  39642. rootCloseEvent: rootCloseEvent
  39643. }, function (_ref2) {
  39644. var placement = _ref2.placement,
  39645. show = _ref2.show,
  39646. alignEnd = _ref2.alignEnd,
  39647. close = _ref2.close,
  39648. menuProps = _ref2.props;
  39649. wrapRef(menuProps); // For custom components provide additional, non-DOM, props;
  39650. if (typeof Component !== 'string') {
  39651. menuProps.show = show;
  39652. menuProps.close = close;
  39653. menuProps.alignRight = alignEnd;
  39654. }
  39655. var style = props.style;
  39656. if (placement) {
  39657. // we don't need the default popper style,
  39658. // menus are display: none when not shown.
  39659. style = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, style, {}, menuProps.style);
  39660. props['x-placement'] = placement;
  39661. }
  39662. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, menuProps, {
  39663. style: style,
  39664. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, show && 'show', alignEnd && prefix + "-right")
  39665. }));
  39666. });
  39667. });
  39668. DropdownMenu.displayName = 'DropdownMenu';
  39669. DropdownMenu.defaultProps = defaultProps;
  39670. /* harmony default export */ __webpack_exports__["default"] = (DropdownMenu);
  39671. /***/ }),
  39672. /***/ "./node_modules/react-bootstrap/esm/DropdownToggle.js":
  39673. /*!************************************************************!*\
  39674. !*** ./node_modules/react-bootstrap/esm/DropdownToggle.js ***!
  39675. \************************************************************/
  39676. /*! exports provided: default */
  39677. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39678. "use strict";
  39679. __webpack_require__.r(__webpack_exports__);
  39680. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39681. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39682. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  39683. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39684. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  39685. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  39686. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);
  39687. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
  39688. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_5__);
  39689. /* harmony import */ var react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-overlays/DropdownToggle */ "./node_modules/react-overlays/DropdownToggle.js");
  39690. /* harmony import */ var react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6__);
  39691. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39692. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
  39693. /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
  39694. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39695. var wrapRef = function wrapRef(props) {
  39696. var ref = props.ref;
  39697. props.ref = ref.__wrapped || (ref.__wrapped = function (r) {
  39698. return ref(Object(react_dom__WEBPACK_IMPORTED_MODULE_4__["findDOMNode"])(r));
  39699. });
  39700. return props;
  39701. };
  39702. var DropdownToggle =
  39703. /*#__PURE__*/
  39704. function (_React$Component) {
  39705. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(DropdownToggle, _React$Component);
  39706. function DropdownToggle() {
  39707. return _React$Component.apply(this, arguments) || this;
  39708. }
  39709. var _proto = DropdownToggle.prototype;
  39710. _proto.render = function render() {
  39711. var _this$props = this.props,
  39712. bsPrefix = _this$props.bsPrefix,
  39713. split = _this$props.split,
  39714. className = _this$props.className,
  39715. children = _this$props.children,
  39716. childBsPrefix = _this$props.childBsPrefix,
  39717. Component = _this$props.as,
  39718. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "split", "className", "children", "childBsPrefix", "as"]);
  39719. if (childBsPrefix !== undefined) {
  39720. props.bsPrefix = childBsPrefix;
  39721. } // This intentionally forwards size and variant (if set) to the
  39722. // underlying component, to allow it to render size and style variants.
  39723. return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6___default.a, null, function (_ref) {
  39724. var toggle = _ref.toggle,
  39725. toggleProps = _ref.props;
  39726. return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39727. onClick: toggle,
  39728. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix, split && bsPrefix + "-split")
  39729. }, wrapRef(toggleProps), props), children);
  39730. });
  39731. };
  39732. return DropdownToggle;
  39733. }(react__WEBPACK_IMPORTED_MODULE_7___default.a.Component); // Needs to be a class FTM, because it needs to accept a ref that can be used with findDOMNode
  39734. DropdownToggle.defaultProps = {
  39735. as: _Button__WEBPACK_IMPORTED_MODULE_8__["default"]
  39736. };
  39737. /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["createBootstrapComponent"])(DropdownToggle, 'dropdown-toggle'));
  39738. /***/ }),
  39739. /***/ "./node_modules/react-bootstrap/esm/Fade.js":
  39740. /*!**************************************************!*\
  39741. !*** ./node_modules/react-bootstrap/esm/Fade.js ***!
  39742. \**************************************************/
  39743. /*! exports provided: default */
  39744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39745. "use strict";
  39746. __webpack_require__.r(__webpack_exports__);
  39747. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39748. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39749. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39750. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39751. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39752. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39753. /* harmony import */ var react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-transition-group/Transition */ "./node_modules/react-transition-group/esm/Transition.js");
  39754. /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/transition/end */ "./node_modules/dom-helpers/transition/end.js");
  39755. /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5__);
  39756. /* harmony import */ var _utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/triggerBrowserReflow */ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js");
  39757. var _fadeStyles;
  39758. var defaultProps = {
  39759. in: false,
  39760. timeout: 300,
  39761. mountOnEnter: false,
  39762. unmountOnExit: false,
  39763. appear: false
  39764. };
  39765. var fadeStyles = (_fadeStyles = {}, _fadeStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__["ENTERING"]] = 'show', _fadeStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__["ENTERED"]] = 'show', _fadeStyles);
  39766. var Fade = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  39767. var className = _ref.className,
  39768. children = _ref.children,
  39769. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className", "children"]);
  39770. var handleEnter = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (node) {
  39771. Object(_utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_6__["default"])(node);
  39772. if (props.onEnter) props.onEnter(node);
  39773. }, [props]);
  39774. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39775. ref: ref,
  39776. addEndListener: dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5___default.a
  39777. }, props, {
  39778. onEnter: handleEnter
  39779. }), function (status, innerProps) {
  39780. return react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(children, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, innerProps, {
  39781. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('fade', className, children.props.className, fadeStyles[status])
  39782. }));
  39783. });
  39784. });
  39785. Fade.defaultProps = defaultProps;
  39786. Fade.displayName = 'Fade';
  39787. /* harmony default export */ __webpack_exports__["default"] = (Fade);
  39788. /***/ }),
  39789. /***/ "./node_modules/react-bootstrap/esm/Feedback.js":
  39790. /*!******************************************************!*\
  39791. !*** ./node_modules/react-bootstrap/esm/Feedback.js ***!
  39792. \******************************************************/
  39793. /*! exports provided: default */
  39794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39795. "use strict";
  39796. __webpack_require__.r(__webpack_exports__);
  39797. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39798. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39799. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39800. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39801. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39802. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39803. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  39804. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
  39805. var propTypes = {
  39806. /**
  39807. * Specify whether the feedback is for valid or invalid fields
  39808. *
  39809. * @type {('valid'|'invalid')}
  39810. */
  39811. type: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string.isRequired,
  39812. as: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.elementType
  39813. };
  39814. var defaultProps = {
  39815. type: 'valid'
  39816. };
  39817. var Feedback = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  39818. function (_ref, ref) {
  39819. var _ref$as = _ref.as,
  39820. Component = _ref$as === void 0 ? 'div' : _ref$as,
  39821. className = _ref.className,
  39822. type = _ref.type,
  39823. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "className", "type"]);
  39824. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  39825. ref: ref,
  39826. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, type && type + "-feedback")
  39827. }));
  39828. });
  39829. Feedback.displayName = 'Feedback';
  39830. Feedback.propTypes = propTypes;
  39831. Feedback.defaultProps = defaultProps;
  39832. /* harmony default export */ __webpack_exports__["default"] = (Feedback);
  39833. /***/ }),
  39834. /***/ "./node_modules/react-bootstrap/esm/Figure.js":
  39835. /*!****************************************************!*\
  39836. !*** ./node_modules/react-bootstrap/esm/Figure.js ***!
  39837. \****************************************************/
  39838. /*! exports provided: default */
  39839. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39840. "use strict";
  39841. __webpack_require__.r(__webpack_exports__);
  39842. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  39843. /* harmony import */ var _FigureImage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FigureImage */ "./node_modules/react-bootstrap/esm/FigureImage.js");
  39844. /* harmony import */ var _FigureCaption__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FigureCaption */ "./node_modules/react-bootstrap/esm/FigureCaption.js");
  39845. var Figure = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('figure', {
  39846. Component: 'figure'
  39847. });
  39848. Figure.Image = _FigureImage__WEBPACK_IMPORTED_MODULE_1__["default"];
  39849. Figure.Caption = _FigureCaption__WEBPACK_IMPORTED_MODULE_2__["default"];
  39850. /* harmony default export */ __webpack_exports__["default"] = (Figure);
  39851. /***/ }),
  39852. /***/ "./node_modules/react-bootstrap/esm/FigureCaption.js":
  39853. /*!***********************************************************!*\
  39854. !*** ./node_modules/react-bootstrap/esm/FigureCaption.js ***!
  39855. \***********************************************************/
  39856. /*! exports provided: default */
  39857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39858. "use strict";
  39859. __webpack_require__.r(__webpack_exports__);
  39860. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  39861. var FigureCaption = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('figure-caption', {
  39862. Component: 'figcaption'
  39863. });
  39864. /* harmony default export */ __webpack_exports__["default"] = (FigureCaption);
  39865. /***/ }),
  39866. /***/ "./node_modules/react-bootstrap/esm/FigureImage.js":
  39867. /*!*********************************************************!*\
  39868. !*** ./node_modules/react-bootstrap/esm/FigureImage.js ***!
  39869. \*********************************************************/
  39870. /*! exports provided: default */
  39871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39872. "use strict";
  39873. __webpack_require__.r(__webpack_exports__);
  39874. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39875. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39876. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39877. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39878. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  39879. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
  39880. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39881. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  39882. /* harmony import */ var _Image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Image */ "./node_modules/react-bootstrap/esm/Image.js");
  39883. var propTypes = {
  39884. /**
  39885. * @default 'img'
  39886. */
  39887. bsPrefix: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  39888. /**
  39889. * Sets image as fluid image.
  39890. */
  39891. fluid: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
  39892. /**
  39893. * Sets image shape as rounded.
  39894. */
  39895. rounded: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
  39896. /**
  39897. * Sets image shape as circle.
  39898. */
  39899. roundedCircle: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
  39900. /**
  39901. * Sets image shape as thumbnail.
  39902. */
  39903. thumbnail: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool
  39904. };
  39905. var defaultProps = {
  39906. fluid: true
  39907. };
  39908. var FigureImage = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (_ref, ref) {
  39909. var className = _ref.className,
  39910. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className"]);
  39911. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Image__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  39912. ref: ref
  39913. }, props, {
  39914. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'figure-img')
  39915. }));
  39916. });
  39917. FigureImage.displayName = 'FigureImage';
  39918. FigureImage.propTypes = propTypes;
  39919. FigureImage.defaultProps = defaultProps;
  39920. /* harmony default export */ __webpack_exports__["default"] = (FigureImage);
  39921. /***/ }),
  39922. /***/ "./node_modules/react-bootstrap/esm/Form.js":
  39923. /*!**************************************************!*\
  39924. !*** ./node_modules/react-bootstrap/esm/Form.js ***!
  39925. \**************************************************/
  39926. /*! exports provided: default */
  39927. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39928. "use strict";
  39929. __webpack_require__.r(__webpack_exports__);
  39930. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39931. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39932. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39933. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39934. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39935. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  39936. /* harmony import */ var _FormCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormCheck */ "./node_modules/react-bootstrap/esm/FormCheck.js");
  39937. /* harmony import */ var _FormControl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormControl */ "./node_modules/react-bootstrap/esm/FormControl.js");
  39938. /* harmony import */ var _FormGroup__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormGroup */ "./node_modules/react-bootstrap/esm/FormGroup.js");
  39939. /* harmony import */ var _FormLabel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FormLabel */ "./node_modules/react-bootstrap/esm/FormLabel.js");
  39940. /* harmony import */ var _FormText__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FormText */ "./node_modules/react-bootstrap/esm/FormText.js");
  39941. /* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Switch */ "./node_modules/react-bootstrap/esm/Switch.js");
  39942. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39943. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  39944. var defaultProps = {
  39945. inline: false
  39946. };
  39947. var Form = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  39948. var bsPrefix = _ref.bsPrefix,
  39949. inline = _ref.inline,
  39950. className = _ref.className,
  39951. validated = _ref.validated,
  39952. _ref$as = _ref.as,
  39953. Component = _ref$as === void 0 ? 'form' : _ref$as,
  39954. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "inline", "className", "validated", "as"]);
  39955. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_10__["useBootstrapPrefix"])(bsPrefix, 'form');
  39956. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  39957. ref: ref,
  39958. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, validated && 'was-validated', inline && bsPrefix + "-inline")
  39959. }));
  39960. });
  39961. Form.displayName = 'Form';
  39962. Form.defaultProps = defaultProps;
  39963. Form.Row = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_11__["default"])('form-row');
  39964. Form.Group = _FormGroup__WEBPACK_IMPORTED_MODULE_6__["default"];
  39965. Form.Control = _FormControl__WEBPACK_IMPORTED_MODULE_5__["default"];
  39966. Form.Check = _FormCheck__WEBPACK_IMPORTED_MODULE_4__["default"];
  39967. Form.Switch = _Switch__WEBPACK_IMPORTED_MODULE_9__["default"];
  39968. Form.Label = _FormLabel__WEBPACK_IMPORTED_MODULE_7__["default"];
  39969. Form.Text = _FormText__WEBPACK_IMPORTED_MODULE_8__["default"];
  39970. /* harmony default export */ __webpack_exports__["default"] = (Form);
  39971. /***/ }),
  39972. /***/ "./node_modules/react-bootstrap/esm/FormCheck.js":
  39973. /*!*******************************************************!*\
  39974. !*** ./node_modules/react-bootstrap/esm/FormCheck.js ***!
  39975. \*******************************************************/
  39976. /*! exports provided: default */
  39977. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39978. "use strict";
  39979. __webpack_require__.r(__webpack_exports__);
  39980. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  39981. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  39982. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  39983. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  39984. /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types-extra/lib/all */ "./node_modules/prop-types-extra/lib/all.js");
  39985. /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__);
  39986. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  39987. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  39988. /* harmony import */ var _Feedback__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Feedback */ "./node_modules/react-bootstrap/esm/Feedback.js");
  39989. /* harmony import */ var _FormCheckInput__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormCheckInput */ "./node_modules/react-bootstrap/esm/FormCheckInput.js");
  39990. /* harmony import */ var _FormCheckLabel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FormCheckLabel */ "./node_modules/react-bootstrap/esm/FormCheckLabel.js");
  39991. /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
  39992. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  39993. var defaultProps = {
  39994. type: 'checkbox',
  39995. inline: false,
  39996. disabled: false,
  39997. isValid: false,
  39998. isInvalid: false,
  39999. title: ''
  40000. };
  40001. var FormCheck = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (_ref, ref) {
  40002. var id = _ref.id,
  40003. bsPrefix = _ref.bsPrefix,
  40004. bsCustomPrefix = _ref.bsCustomPrefix,
  40005. inline = _ref.inline,
  40006. disabled = _ref.disabled,
  40007. isValid = _ref.isValid,
  40008. isInvalid = _ref.isInvalid,
  40009. feedback = _ref.feedback,
  40010. className = _ref.className,
  40011. style = _ref.style,
  40012. title = _ref.title,
  40013. type = _ref.type,
  40014. label = _ref.label,
  40015. children = _ref.children,
  40016. propCustom = _ref.custom,
  40017. _ref$as = _ref.as,
  40018. as = _ref$as === void 0 ? 'input' : _ref$as,
  40019. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["id", "bsPrefix", "bsCustomPrefix", "inline", "disabled", "isValid", "isInvalid", "feedback", "className", "style", "title", "type", "label", "children", "custom", "as"]);
  40020. var custom = type === 'switch' ? true : propCustom;
  40021. bsPrefix = custom ? Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["useBootstrapPrefix"])(bsCustomPrefix, 'custom-control') : Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["useBootstrapPrefix"])(bsPrefix, 'form-check');
  40022. var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_8__["default"]),
  40023. controlId = _useContext.controlId;
  40024. var innerFormContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useMemo"])(function () {
  40025. return {
  40026. controlId: id || controlId,
  40027. custom: custom
  40028. };
  40029. }, [controlId, custom, id]);
  40030. var hasLabel = label != null && label !== false && !children;
  40031. var input = react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_FormCheckInput__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40032. type: type === 'switch' ? 'checkbox' : type,
  40033. ref: ref,
  40034. isValid: isValid,
  40035. isInvalid: isInvalid,
  40036. isStatic: !hasLabel,
  40037. disabled: disabled,
  40038. as: as
  40039. }));
  40040. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_FormContext__WEBPACK_IMPORTED_MODULE_8__["default"].Provider, {
  40041. value: innerFormContext
  40042. }, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
  40043. style: style,
  40044. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, custom && "custom-" + type, inline && bsPrefix + "-inline")
  40045. }, children || react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_4___default.a.Fragment, null, input, hasLabel && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_FormCheckLabel__WEBPACK_IMPORTED_MODULE_7__["default"], {
  40046. title: title
  40047. }, label), (isValid || isInvalid) && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Feedback__WEBPACK_IMPORTED_MODULE_5__["default"], {
  40048. type: isValid ? 'valid' : 'invalid'
  40049. }, feedback))));
  40050. });
  40051. FormCheck.displayName = 'FormCheck';
  40052. FormCheck.defaultProps = defaultProps;
  40053. FormCheck.Input = _FormCheckInput__WEBPACK_IMPORTED_MODULE_6__["default"];
  40054. FormCheck.Label = _FormCheckLabel__WEBPACK_IMPORTED_MODULE_7__["default"];
  40055. /* harmony default export */ __webpack_exports__["default"] = (FormCheck);
  40056. /***/ }),
  40057. /***/ "./node_modules/react-bootstrap/esm/FormCheckInput.js":
  40058. /*!************************************************************!*\
  40059. !*** ./node_modules/react-bootstrap/esm/FormCheckInput.js ***!
  40060. \************************************************************/
  40061. /*! exports provided: default */
  40062. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40063. "use strict";
  40064. __webpack_require__.r(__webpack_exports__);
  40065. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40066. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40067. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40068. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40069. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40070. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40071. /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
  40072. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40073. var defaultProps = {
  40074. type: 'checkbox'
  40075. };
  40076. var FormCheckInput = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40077. var id = _ref.id,
  40078. bsPrefix = _ref.bsPrefix,
  40079. bsCustomPrefix = _ref.bsCustomPrefix,
  40080. className = _ref.className,
  40081. isValid = _ref.isValid,
  40082. isInvalid = _ref.isInvalid,
  40083. isStatic = _ref.isStatic,
  40084. _ref$as = _ref.as,
  40085. Component = _ref$as === void 0 ? 'input' : _ref$as,
  40086. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["id", "bsPrefix", "bsCustomPrefix", "className", "isValid", "isInvalid", "isStatic", "as"]);
  40087. var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_4__["default"]),
  40088. controlId = _useContext.controlId,
  40089. custom = _useContext.custom;
  40090. bsPrefix = custom ? Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsCustomPrefix, 'custom-control-input') : Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'form-check-input');
  40091. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40092. ref: ref,
  40093. id: id || controlId,
  40094. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, isValid && 'is-valid', isInvalid && 'is-invalid', isStatic && 'position-static')
  40095. }));
  40096. });
  40097. FormCheckInput.displayName = 'FormCheckInput';
  40098. FormCheckInput.defaultProps = defaultProps;
  40099. /* harmony default export */ __webpack_exports__["default"] = (FormCheckInput);
  40100. /***/ }),
  40101. /***/ "./node_modules/react-bootstrap/esm/FormCheckLabel.js":
  40102. /*!************************************************************!*\
  40103. !*** ./node_modules/react-bootstrap/esm/FormCheckLabel.js ***!
  40104. \************************************************************/
  40105. /*! exports provided: default */
  40106. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40107. "use strict";
  40108. __webpack_require__.r(__webpack_exports__);
  40109. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40110. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40111. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40112. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40113. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40114. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40115. /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
  40116. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40117. var FormCheckLabel = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40118. var bsPrefix = _ref.bsPrefix,
  40119. bsCustomPrefix = _ref.bsCustomPrefix,
  40120. className = _ref.className,
  40121. htmlFor = _ref.htmlFor,
  40122. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]);
  40123. var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_4__["default"]),
  40124. controlId = _useContext.controlId,
  40125. custom = _useContext.custom;
  40126. bsPrefix = custom ? Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsCustomPrefix, 'custom-control-label') : Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'form-check-label');
  40127. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("label", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40128. ref: ref,
  40129. htmlFor: htmlFor || controlId,
  40130. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  40131. }));
  40132. });
  40133. FormCheckLabel.displayName = 'FormCheckLabel';
  40134. /* harmony default export */ __webpack_exports__["default"] = (FormCheckLabel);
  40135. /***/ }),
  40136. /***/ "./node_modules/react-bootstrap/esm/FormContext.js":
  40137. /*!*********************************************************!*\
  40138. !*** ./node_modules/react-bootstrap/esm/FormContext.js ***!
  40139. \*********************************************************/
  40140. /*! exports provided: default */
  40141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40142. "use strict";
  40143. __webpack_require__.r(__webpack_exports__);
  40144. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40145. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  40146. var FormContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({
  40147. controlId: undefined
  40148. });
  40149. /* harmony default export */ __webpack_exports__["default"] = (FormContext);
  40150. /***/ }),
  40151. /***/ "./node_modules/react-bootstrap/esm/FormControl.js":
  40152. /*!*********************************************************!*\
  40153. !*** ./node_modules/react-bootstrap/esm/FormControl.js ***!
  40154. \*********************************************************/
  40155. /*! exports provided: default */
  40156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40157. "use strict";
  40158. __webpack_require__.r(__webpack_exports__);
  40159. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40160. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40161. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40162. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40163. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40164. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40165. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
  40166. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_4__);
  40167. /* harmony import */ var _Feedback__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Feedback */ "./node_modules/react-bootstrap/esm/Feedback.js");
  40168. /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
  40169. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40170. var FormControl = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40171. var bsPrefix = _ref.bsPrefix,
  40172. type = _ref.type,
  40173. size = _ref.size,
  40174. id = _ref.id,
  40175. className = _ref.className,
  40176. isValid = _ref.isValid,
  40177. isInvalid = _ref.isInvalid,
  40178. plaintext = _ref.plaintext,
  40179. readOnly = _ref.readOnly,
  40180. _ref$as = _ref.as,
  40181. Component = _ref$as === void 0 ? 'input' : _ref$as,
  40182. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "type", "size", "id", "className", "isValid", "isInvalid", "plaintext", "readOnly", "as"]);
  40183. var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_6__["default"]),
  40184. controlId = _useContext.controlId;
  40185. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'form-control');
  40186. var classes;
  40187. if (plaintext) {
  40188. var _classes;
  40189. classes = (_classes = {}, _classes[bsPrefix + "-plaintext"] = true, _classes);
  40190. } else if (type === 'file') {
  40191. var _classes2;
  40192. classes = (_classes2 = {}, _classes2[bsPrefix + "-file"] = true, _classes2);
  40193. } else {
  40194. var _classes3;
  40195. classes = (_classes3 = {}, _classes3[bsPrefix] = true, _classes3[bsPrefix + "-" + size] = size, _classes3);
  40196. }
  40197. true ? warning__WEBPACK_IMPORTED_MODULE_4___default()(controlId == null || !id, '`controlId` is ignored on `<FormControl>` when `id` is specified.') : undefined;
  40198. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40199. type: type,
  40200. ref: ref,
  40201. readOnly: readOnly,
  40202. id: id || controlId,
  40203. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, classes, isValid && "is-valid", isInvalid && "is-invalid")
  40204. }));
  40205. });
  40206. FormControl.displayName = 'FormControl';
  40207. FormControl.Feedback = _Feedback__WEBPACK_IMPORTED_MODULE_5__["default"];
  40208. /* harmony default export */ __webpack_exports__["default"] = (FormControl);
  40209. /***/ }),
  40210. /***/ "./node_modules/react-bootstrap/esm/FormGroup.js":
  40211. /*!*******************************************************!*\
  40212. !*** ./node_modules/react-bootstrap/esm/FormGroup.js ***!
  40213. \*******************************************************/
  40214. /*! exports provided: default */
  40215. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40216. "use strict";
  40217. __webpack_require__.r(__webpack_exports__);
  40218. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40219. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40220. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40221. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40222. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40223. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40224. /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
  40225. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40226. var FormGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40227. var bsPrefix = _ref.bsPrefix,
  40228. className = _ref.className,
  40229. children = _ref.children,
  40230. controlId = _ref.controlId,
  40231. _ref$as = _ref.as,
  40232. Component = _ref$as === void 0 ? 'div' : _ref$as,
  40233. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "controlId", "as"]);
  40234. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'form-group');
  40235. var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
  40236. return {
  40237. controlId: controlId
  40238. };
  40239. }, [controlId]);
  40240. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_FormContext__WEBPACK_IMPORTED_MODULE_4__["default"].Provider, {
  40241. value: context
  40242. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40243. ref: ref,
  40244. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  40245. }), children));
  40246. });
  40247. FormGroup.displayName = 'FormGroup';
  40248. /* harmony default export */ __webpack_exports__["default"] = (FormGroup);
  40249. /***/ }),
  40250. /***/ "./node_modules/react-bootstrap/esm/FormLabel.js":
  40251. /*!*******************************************************!*\
  40252. !*** ./node_modules/react-bootstrap/esm/FormLabel.js ***!
  40253. \*******************************************************/
  40254. /*! exports provided: default */
  40255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40256. "use strict";
  40257. __webpack_require__.r(__webpack_exports__);
  40258. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40259. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40260. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40261. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40262. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40263. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40264. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
  40265. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_4__);
  40266. /* harmony import */ var _Col__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Col */ "./node_modules/react-bootstrap/esm/Col.js");
  40267. /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
  40268. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40269. var defaultProps = {
  40270. column: false,
  40271. srOnly: false
  40272. };
  40273. var FormLabel = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40274. var bsPrefix = _ref.bsPrefix,
  40275. column = _ref.column,
  40276. srOnly = _ref.srOnly,
  40277. className = _ref.className,
  40278. htmlFor = _ref.htmlFor,
  40279. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "column", "srOnly", "className", "htmlFor"]);
  40280. var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_6__["default"]),
  40281. controlId = _useContext.controlId;
  40282. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'form-label');
  40283. var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, srOnly && 'sr-only', column && 'col-form-label');
  40284. true ? warning__WEBPACK_IMPORTED_MODULE_4___default()(controlId == null || !htmlFor, '`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified.') : undefined;
  40285. htmlFor = htmlFor || controlId;
  40286. if (column) return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Col__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40287. as: "label",
  40288. className: classes,
  40289. htmlFor: htmlFor
  40290. }, props));
  40291. return (// eslint-disable-next-line jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control
  40292. react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("label", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40293. ref: ref,
  40294. className: classes,
  40295. htmlFor: htmlFor
  40296. }, props))
  40297. );
  40298. });
  40299. FormLabel.displayName = 'FormLabel';
  40300. FormLabel.defaultProps = defaultProps;
  40301. /* harmony default export */ __webpack_exports__["default"] = (FormLabel);
  40302. /***/ }),
  40303. /***/ "./node_modules/react-bootstrap/esm/FormText.js":
  40304. /*!******************************************************!*\
  40305. !*** ./node_modules/react-bootstrap/esm/FormText.js ***!
  40306. \******************************************************/
  40307. /*! exports provided: default */
  40308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40309. "use strict";
  40310. __webpack_require__.r(__webpack_exports__);
  40311. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40312. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40313. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40314. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40315. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40316. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40317. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40318. var FormText = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  40319. function (_ref, ref) {
  40320. var bsPrefix = _ref.bsPrefix,
  40321. className = _ref.className,
  40322. _ref$as = _ref.as,
  40323. Component = _ref$as === void 0 ? 'small' : _ref$as,
  40324. muted = _ref.muted,
  40325. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as", "muted"]);
  40326. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'form-text');
  40327. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40328. ref: ref,
  40329. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, muted && 'text-muted')
  40330. }));
  40331. });
  40332. FormText.displayName = 'FormText';
  40333. /* harmony default export */ __webpack_exports__["default"] = (FormText);
  40334. /***/ }),
  40335. /***/ "./node_modules/react-bootstrap/esm/Image.js":
  40336. /*!***************************************************!*\
  40337. !*** ./node_modules/react-bootstrap/esm/Image.js ***!
  40338. \***************************************************/
  40339. /*! exports provided: default */
  40340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40341. "use strict";
  40342. __webpack_require__.r(__webpack_exports__);
  40343. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40344. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40345. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40346. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40347. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40348. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40349. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40350. var defaultProps = {
  40351. fluid: false,
  40352. rounded: false,
  40353. roundedCircle: false,
  40354. thumbnail: false
  40355. };
  40356. var Image = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40357. var bsPrefix = _ref.bsPrefix,
  40358. className = _ref.className,
  40359. fluid = _ref.fluid,
  40360. rounded = _ref.rounded,
  40361. roundedCircle = _ref.roundedCircle,
  40362. thumbnail = _ref.thumbnail,
  40363. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "fluid", "rounded", "roundedCircle", "thumbnail"]);
  40364. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'img');
  40365. var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(fluid && bsPrefix + "-fluid", rounded && "rounded", roundedCircle && "rounded-circle", thumbnail && bsPrefix + "-thumbnail");
  40366. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40367. // eslint-disable-line jsx-a11y/alt-text
  40368. ref: ref
  40369. }, props, {
  40370. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, classes)
  40371. }));
  40372. });
  40373. Image.displayName = 'Image';
  40374. Image.defaultProps = defaultProps;
  40375. /* harmony default export */ __webpack_exports__["default"] = (Image);
  40376. /***/ }),
  40377. /***/ "./node_modules/react-bootstrap/esm/InputGroup.js":
  40378. /*!********************************************************!*\
  40379. !*** ./node_modules/react-bootstrap/esm/InputGroup.js ***!
  40380. \********************************************************/
  40381. /*! exports provided: default */
  40382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40383. "use strict";
  40384. __webpack_require__.r(__webpack_exports__);
  40385. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40386. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40387. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40388. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40389. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40390. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40391. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  40392. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40393. /**
  40394. *
  40395. * @property {InputGroupAppend} Append
  40396. * @property {InputGroupPrepend} Prepend
  40397. * @property {InputGroupText} Text
  40398. * @property {InputGroupRadio} Radio
  40399. * @property {InputGroupCheckbox} Checkbox
  40400. */
  40401. var InputGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40402. var bsPrefix = _ref.bsPrefix,
  40403. size = _ref.size,
  40404. className = _ref.className,
  40405. _ref$as = _ref.as,
  40406. Component = _ref$as === void 0 ? 'div' : _ref$as,
  40407. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "size", "className", "as"]);
  40408. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'input-group');
  40409. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40410. ref: ref
  40411. }, props, {
  40412. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, size && bsPrefix + "-" + size)
  40413. }));
  40414. });
  40415. var InputGroupAppend = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('input-group-append');
  40416. var InputGroupPrepend = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('input-group-prepend');
  40417. var InputGroupText = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('input-group-text', {
  40418. Component: 'span'
  40419. });
  40420. var InputGroupCheckbox = function InputGroupCheckbox(props) {
  40421. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(InputGroupText, null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40422. type: "checkbox"
  40423. }, props)));
  40424. };
  40425. var InputGroupRadio = function InputGroupRadio(props) {
  40426. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(InputGroupText, null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40427. type: "radio"
  40428. }, props)));
  40429. };
  40430. InputGroup.displayName = 'InputGroup';
  40431. InputGroup.Text = InputGroupText;
  40432. InputGroup.Radio = InputGroupRadio;
  40433. InputGroup.Checkbox = InputGroupCheckbox;
  40434. InputGroup.Append = InputGroupAppend;
  40435. InputGroup.Prepend = InputGroupPrepend;
  40436. /* harmony default export */ __webpack_exports__["default"] = (InputGroup);
  40437. /***/ }),
  40438. /***/ "./node_modules/react-bootstrap/esm/Jumbotron.js":
  40439. /*!*******************************************************!*\
  40440. !*** ./node_modules/react-bootstrap/esm/Jumbotron.js ***!
  40441. \*******************************************************/
  40442. /*! exports provided: default */
  40443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40444. "use strict";
  40445. __webpack_require__.r(__webpack_exports__);
  40446. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40447. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40448. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40449. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  40450. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40451. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  40452. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40453. var defaultProps = {
  40454. fluid: false
  40455. };
  40456. var Jumbotron = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  40457. var _classes;
  40458. var _ref$as = _ref.as,
  40459. Component = _ref$as === void 0 ? 'div' : _ref$as,
  40460. className = _ref.className,
  40461. fluid = _ref.fluid,
  40462. bsPrefix = _ref.bsPrefix,
  40463. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "className", "fluid", "bsPrefix"]);
  40464. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'jumbotron');
  40465. var classes = (_classes = {}, _classes[bsPrefix] = true, _classes[bsPrefix + "-fluid"] = fluid, _classes);
  40466. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40467. ref: ref
  40468. }, props, {
  40469. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, classes)
  40470. }));
  40471. });
  40472. Jumbotron.defaultProps = defaultProps;
  40473. Jumbotron.displayName = 'Jumbotron';
  40474. /* harmony default export */ __webpack_exports__["default"] = (Jumbotron);
  40475. /***/ }),
  40476. /***/ "./node_modules/react-bootstrap/esm/ListGroup.js":
  40477. /*!*******************************************************!*\
  40478. !*** ./node_modules/react-bootstrap/esm/ListGroup.js ***!
  40479. \*******************************************************/
  40480. /*! exports provided: default */
  40481. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40482. "use strict";
  40483. __webpack_require__.r(__webpack_exports__);
  40484. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40485. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40486. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40487. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40488. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40489. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40490. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  40491. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40492. /* harmony import */ var _AbstractNav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AbstractNav */ "./node_modules/react-bootstrap/esm/AbstractNav.js");
  40493. /* harmony import */ var _ListGroupItem__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ListGroupItem */ "./node_modules/react-bootstrap/esm/ListGroupItem.js");
  40494. var defaultProps = {
  40495. variant: null
  40496. };
  40497. var ListGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  40498. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
  40499. activeKey: 'onSelect'
  40500. }),
  40501. className = _useUncontrolled.className,
  40502. bsPrefix = _useUncontrolled.bsPrefix,
  40503. variant = _useUncontrolled.variant,
  40504. _useUncontrolled$as = _useUncontrolled.as,
  40505. as = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
  40506. controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["className", "bsPrefix", "variant", "as"]);
  40507. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'list-group');
  40508. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AbstractNav__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40509. ref: ref
  40510. }, controlledProps, {
  40511. as: as,
  40512. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, variant && bsPrefix + "-" + variant)
  40513. }));
  40514. });
  40515. ListGroup.defaultProps = defaultProps;
  40516. ListGroup.displayName = 'ListGroup';
  40517. ListGroup.Item = _ListGroupItem__WEBPACK_IMPORTED_MODULE_7__["default"];
  40518. /* harmony default export */ __webpack_exports__["default"] = (ListGroup);
  40519. /***/ }),
  40520. /***/ "./node_modules/react-bootstrap/esm/ListGroupItem.js":
  40521. /*!***********************************************************!*\
  40522. !*** ./node_modules/react-bootstrap/esm/ListGroupItem.js ***!
  40523. \***********************************************************/
  40524. /*! exports provided: default */
  40525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40526. "use strict";
  40527. __webpack_require__.r(__webpack_exports__);
  40528. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40529. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40530. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40531. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40532. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40533. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40534. /* harmony import */ var _AbstractNavItem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AbstractNavItem */ "./node_modules/react-bootstrap/esm/AbstractNavItem.js");
  40535. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  40536. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40537. var defaultProps = {
  40538. variant: null,
  40539. active: false,
  40540. disabled: false
  40541. };
  40542. var ListGroupItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40543. var bsPrefix = _ref.bsPrefix,
  40544. active = _ref.active,
  40545. disabled = _ref.disabled,
  40546. className = _ref.className,
  40547. variant = _ref.variant,
  40548. action = _ref.action,
  40549. as = _ref.as,
  40550. eventKey = _ref.eventKey,
  40551. onClick = _ref.onClick,
  40552. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "active", "disabled", "className", "variant", "action", "as", "eventKey", "onClick"]);
  40553. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_6__["useBootstrapPrefix"])(bsPrefix, 'list-group-item');
  40554. var handleClick = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
  40555. if (disabled) {
  40556. event.preventDefault();
  40557. event.stopPropagation();
  40558. return;
  40559. }
  40560. if (onClick) onClick(event);
  40561. }, [disabled, onClick]);
  40562. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AbstractNavItem__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40563. ref: ref
  40564. }, props, {
  40565. eventKey: Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_5__["makeEventKey"])(eventKey, props.href) // eslint-disable-next-line
  40566. ,
  40567. as: as || (action ? props.href ? 'a' : 'button' : 'div'),
  40568. onClick: handleClick,
  40569. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, active && 'active', disabled && 'disabled', variant && bsPrefix + "-" + variant, action && bsPrefix + "-action")
  40570. }));
  40571. });
  40572. ListGroupItem.defaultProps = defaultProps;
  40573. ListGroupItem.displayName = 'ListGroupItem';
  40574. /* harmony default export */ __webpack_exports__["default"] = (ListGroupItem);
  40575. /***/ }),
  40576. /***/ "./node_modules/react-bootstrap/esm/Media.js":
  40577. /*!***************************************************!*\
  40578. !*** ./node_modules/react-bootstrap/esm/Media.js ***!
  40579. \***************************************************/
  40580. /*! exports provided: default */
  40581. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40582. "use strict";
  40583. __webpack_require__.r(__webpack_exports__);
  40584. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40585. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40586. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40587. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40588. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40589. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40590. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  40591. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40592. var Media = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  40593. function (_ref, ref) {
  40594. var bsPrefix = _ref.bsPrefix,
  40595. className = _ref.className,
  40596. _ref$as = _ref.as,
  40597. Component = _ref$as === void 0 ? 'div' : _ref$as,
  40598. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as"]);
  40599. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'media');
  40600. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40601. ref: ref,
  40602. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix)
  40603. }));
  40604. });
  40605. Media.displayName = 'Media';
  40606. Media.Body = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('media-body');
  40607. /* harmony default export */ __webpack_exports__["default"] = (Media);
  40608. /***/ }),
  40609. /***/ "./node_modules/react-bootstrap/esm/Modal.js":
  40610. /*!***************************************************!*\
  40611. !*** ./node_modules/react-bootstrap/esm/Modal.js ***!
  40612. \***************************************************/
  40613. /*! exports provided: default */
  40614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40615. "use strict";
  40616. __webpack_require__.r(__webpack_exports__);
  40617. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40618. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40619. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  40620. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40621. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  40622. /* harmony import */ var dom_helpers_events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/events */ "./node_modules/dom-helpers/events/index.js");
  40623. /* harmony import */ var dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_events__WEBPACK_IMPORTED_MODULE_4__);
  40624. /* harmony import */ var dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js");
  40625. /* harmony import */ var dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5__);
  40626. /* harmony import */ var dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dom-helpers/util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js");
  40627. /* harmony import */ var dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6__);
  40628. /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js");
  40629. /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7__);
  40630. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40631. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);
  40632. /* harmony import */ var react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-overlays/Modal */ "./node_modules/react-overlays/Modal.js");
  40633. /* harmony import */ var react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9__);
  40634. /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
  40635. /* harmony import */ var _ModalBody__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ModalBody */ "./node_modules/react-bootstrap/esm/ModalBody.js");
  40636. /* harmony import */ var _ModalDialog__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ModalDialog */ "./node_modules/react-bootstrap/esm/ModalDialog.js");
  40637. /* harmony import */ var _ModalFooter__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ModalFooter */ "./node_modules/react-bootstrap/esm/ModalFooter.js");
  40638. /* harmony import */ var _ModalHeader__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ModalHeader */ "./node_modules/react-bootstrap/esm/ModalHeader.js");
  40639. /* harmony import */ var _ModalTitle__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./ModalTitle */ "./node_modules/react-bootstrap/esm/ModalTitle.js");
  40640. /* harmony import */ var _utils_BootstrapModalManager__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/BootstrapModalManager */ "./node_modules/react-bootstrap/esm/utils/BootstrapModalManager.js");
  40641. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40642. /* harmony import */ var _ModalContext__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ModalContext */ "./node_modules/react-bootstrap/esm/ModalContext.js");
  40643. var defaultProps = {
  40644. show: false,
  40645. backdrop: true,
  40646. keyboard: true,
  40647. autoFocus: true,
  40648. enforceFocus: true,
  40649. restoreFocus: true,
  40650. animation: true,
  40651. dialogAs: _ModalDialog__WEBPACK_IMPORTED_MODULE_12__["default"],
  40652. manager: new _utils_BootstrapModalManager__WEBPACK_IMPORTED_MODULE_16__["default"]()
  40653. };
  40654. /* eslint-disable no-use-before-define, react/no-multi-comp */
  40655. function DialogTransition(props) {
  40656. return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(_Fade__WEBPACK_IMPORTED_MODULE_10__["default"], props);
  40657. }
  40658. function BackdropTransition(props) {
  40659. return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(_Fade__WEBPACK_IMPORTED_MODULE_10__["default"], props);
  40660. }
  40661. /* eslint-enable no-use-before-define */
  40662. var Modal =
  40663. /*#__PURE__*/
  40664. function (_React$Component) {
  40665. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Modal, _React$Component);
  40666. function Modal() {
  40667. var _this;
  40668. for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
  40669. _args[_key] = arguments[_key];
  40670. }
  40671. _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
  40672. _this.state = {
  40673. style: {}
  40674. };
  40675. _this.modalContext = {
  40676. onHide: function onHide() {
  40677. return _this.props.onHide();
  40678. }
  40679. };
  40680. _this.setModalRef = function (ref) {
  40681. _this._modal = ref;
  40682. };
  40683. _this.handleDialogMouseDown = function () {
  40684. _this._waitingForMouseUp = true;
  40685. };
  40686. _this.handleMouseUp = function (e) {
  40687. if (_this._waitingForMouseUp && e.target === _this._modal.dialog) {
  40688. _this._ignoreBackdropClick = true;
  40689. }
  40690. _this._waitingForMouseUp = false;
  40691. };
  40692. _this.handleClick = function (e) {
  40693. if (_this._ignoreBackdropClick || e.target !== e.currentTarget) {
  40694. _this._ignoreBackdropClick = false;
  40695. return;
  40696. }
  40697. _this.props.onHide();
  40698. };
  40699. _this.handleEnter = function (node) {
  40700. var _this$props;
  40701. if (node) {
  40702. node.style.display = 'block';
  40703. _this.updateDialogStyle(node);
  40704. }
  40705. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  40706. args[_key2 - 1] = arguments[_key2];
  40707. }
  40708. if (_this.props.onEnter) (_this$props = _this.props).onEnter.apply(_this$props, [node].concat(args));
  40709. };
  40710. _this.handleEntering = function (node) {
  40711. var _this$props2;
  40712. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  40713. args[_key3 - 1] = arguments[_key3];
  40714. }
  40715. if (_this.props.onEntering) (_this$props2 = _this.props).onEntering.apply(_this$props2, [node].concat(args)); // FIXME: This should work even when animation is disabled.
  40716. dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default.a.on(window, 'resize', _this.handleWindowResize);
  40717. };
  40718. _this.handleExited = function (node) {
  40719. var _this$props3;
  40720. if (node) node.style.display = ''; // RHL removes it sometimes
  40721. for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  40722. args[_key4 - 1] = arguments[_key4];
  40723. }
  40724. if (_this.props.onExited) (_this$props3 = _this.props).onExited.apply(_this$props3, args); // FIXME: This should work even when animation is disabled.
  40725. dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default.a.off(window, 'resize', _this.handleWindowResize);
  40726. };
  40727. _this.handleWindowResize = function () {
  40728. _this.updateDialogStyle(_this._modal.dialog);
  40729. };
  40730. _this.renderBackdrop = function (props) {
  40731. var _this$props4 = _this.props,
  40732. bsPrefix = _this$props4.bsPrefix,
  40733. backdropClassName = _this$props4.backdropClassName,
  40734. animation = _this$props4.animation;
  40735. return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, {
  40736. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix + "-backdrop", backdropClassName, !animation && 'show')
  40737. }));
  40738. };
  40739. return _this;
  40740. }
  40741. var _proto = Modal.prototype;
  40742. _proto.componentWillUnmount = function componentWillUnmount() {
  40743. // Clean up the listener if we need to.
  40744. dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default.a.off(window, 'resize', this.handleWindowResize);
  40745. };
  40746. _proto.updateDialogStyle = function updateDialogStyle(node) {
  40747. if (!dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6___default.a) return;
  40748. var manager = this.props.manager;
  40749. var containerIsOverflowing = manager.isContainerOverflowing(this._modal);
  40750. var modalIsOverflowing = node.scrollHeight > dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5___default()(node).documentElement.clientHeight;
  40751. this.setState({
  40752. style: {
  40753. paddingRight: containerIsOverflowing && !modalIsOverflowing ? dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7___default()() : undefined,
  40754. paddingLeft: !containerIsOverflowing && modalIsOverflowing ? dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7___default()() : undefined
  40755. }
  40756. });
  40757. };
  40758. _proto.render = function render() {
  40759. var _this$props5 = this.props,
  40760. bsPrefix = _this$props5.bsPrefix,
  40761. className = _this$props5.className,
  40762. style = _this$props5.style,
  40763. dialogClassName = _this$props5.dialogClassName,
  40764. children = _this$props5.children,
  40765. Dialog = _this$props5.dialogAs,
  40766. show = _this$props5.show,
  40767. animation = _this$props5.animation,
  40768. backdrop = _this$props5.backdrop,
  40769. keyboard = _this$props5.keyboard,
  40770. manager = _this$props5.manager,
  40771. onEscapeKeyDown = _this$props5.onEscapeKeyDown,
  40772. onShow = _this$props5.onShow,
  40773. onHide = _this$props5.onHide,
  40774. container = _this$props5.container,
  40775. autoFocus = _this$props5.autoFocus,
  40776. enforceFocus = _this$props5.enforceFocus,
  40777. restoreFocus = _this$props5.restoreFocus,
  40778. onEntered = _this$props5.onEntered,
  40779. onExit = _this$props5.onExit,
  40780. onExiting = _this$props5.onExiting,
  40781. _ = _this$props5.onExited,
  40782. _1 = _this$props5.onEntering,
  40783. _6 = _this$props5.onEnter,
  40784. _4 = _this$props5.onEntering,
  40785. _2 = _this$props5.backdropClassName,
  40786. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props5, ["bsPrefix", "className", "style", "dialogClassName", "children", "dialogAs", "show", "animation", "backdrop", "keyboard", "manager", "onEscapeKeyDown", "onShow", "onHide", "container", "autoFocus", "enforceFocus", "restoreFocus", "onEntered", "onExit", "onExiting", "onExited", "onEntering", "onEnter", "onEntering", "backdropClassName"]);
  40787. var clickHandler = backdrop === true ? this.handleClick : null;
  40788. var baseModalStyle = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, style, {}, this.state.style); // Sets `display` always block when `animation` is false
  40789. if (!animation) baseModalStyle.display = 'block';
  40790. return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(_ModalContext__WEBPACK_IMPORTED_MODULE_18__["default"].Provider, {
  40791. value: this.modalContext
  40792. }, react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9___default.a, {
  40793. show: show,
  40794. backdrop: backdrop,
  40795. container: container,
  40796. keyboard: keyboard,
  40797. autoFocus: autoFocus,
  40798. enforceFocus: enforceFocus,
  40799. restoreFocus: restoreFocus,
  40800. onEscapeKeyDown: onEscapeKeyDown,
  40801. onShow: onShow,
  40802. onHide: onHide,
  40803. onEntered: onEntered,
  40804. onExit: onExit,
  40805. onExiting: onExiting,
  40806. manager: manager,
  40807. ref: this.setModalRef,
  40808. style: baseModalStyle,
  40809. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix),
  40810. containerClassName: bsPrefix + "-open",
  40811. transition: animation ? DialogTransition : undefined,
  40812. backdropTransition: animation ? BackdropTransition : undefined,
  40813. renderBackdrop: this.renderBackdrop,
  40814. onClick: clickHandler,
  40815. onMouseUp: this.handleMouseUp,
  40816. onEnter: this.handleEnter,
  40817. onEntering: this.handleEntering,
  40818. onExited: this.handleExited
  40819. }, react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(Dialog, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, {
  40820. onMouseDown: this.handleDialogMouseDown,
  40821. className: dialogClassName
  40822. }), children)));
  40823. };
  40824. return Modal;
  40825. }(react__WEBPACK_IMPORTED_MODULE_8___default.a.Component);
  40826. Modal.defaultProps = defaultProps;
  40827. var DecoratedModal = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_17__["createBootstrapComponent"])(Modal, 'modal');
  40828. DecoratedModal.Body = _ModalBody__WEBPACK_IMPORTED_MODULE_11__["default"];
  40829. DecoratedModal.Header = _ModalHeader__WEBPACK_IMPORTED_MODULE_14__["default"];
  40830. DecoratedModal.Title = _ModalTitle__WEBPACK_IMPORTED_MODULE_15__["default"];
  40831. DecoratedModal.Footer = _ModalFooter__WEBPACK_IMPORTED_MODULE_13__["default"];
  40832. DecoratedModal.Dialog = _ModalDialog__WEBPACK_IMPORTED_MODULE_12__["default"];
  40833. DecoratedModal.TRANSITION_DURATION = 300;
  40834. DecoratedModal.BACKDROP_TRANSITION_DURATION = 150;
  40835. /* harmony default export */ __webpack_exports__["default"] = (DecoratedModal);
  40836. /***/ }),
  40837. /***/ "./node_modules/react-bootstrap/esm/ModalBody.js":
  40838. /*!*******************************************************!*\
  40839. !*** ./node_modules/react-bootstrap/esm/ModalBody.js ***!
  40840. \*******************************************************/
  40841. /*! exports provided: default */
  40842. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40843. "use strict";
  40844. __webpack_require__.r(__webpack_exports__);
  40845. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  40846. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('modal-body'));
  40847. /***/ }),
  40848. /***/ "./node_modules/react-bootstrap/esm/ModalContext.js":
  40849. /*!**********************************************************!*\
  40850. !*** ./node_modules/react-bootstrap/esm/ModalContext.js ***!
  40851. \**********************************************************/
  40852. /*! exports provided: default */
  40853. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40854. "use strict";
  40855. __webpack_require__.r(__webpack_exports__);
  40856. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40857. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  40858. var ModalContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({
  40859. onHide: function onHide() {}
  40860. });
  40861. /* harmony default export */ __webpack_exports__["default"] = (ModalContext);
  40862. /***/ }),
  40863. /***/ "./node_modules/react-bootstrap/esm/ModalDialog.js":
  40864. /*!*********************************************************!*\
  40865. !*** ./node_modules/react-bootstrap/esm/ModalDialog.js ***!
  40866. \*********************************************************/
  40867. /*! exports provided: default */
  40868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40869. "use strict";
  40870. __webpack_require__.r(__webpack_exports__);
  40871. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40872. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40873. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40874. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40875. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40876. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40877. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40878. var ModalDialog = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40879. var bsPrefix = _ref.bsPrefix,
  40880. className = _ref.className,
  40881. centered = _ref.centered,
  40882. size = _ref.size,
  40883. children = _ref.children,
  40884. scrollable = _ref.scrollable,
  40885. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "centered", "size", "children", "scrollable"]);
  40886. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'modal');
  40887. var dialogClass = bsPrefix + "-dialog";
  40888. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  40889. ref: ref,
  40890. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(dialogClass, className, size && bsPrefix + "-" + size, centered && dialogClass + "-centered", scrollable && dialogClass + "-scrollable")
  40891. }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
  40892. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(bsPrefix + "-content")
  40893. }, children));
  40894. });
  40895. ModalDialog.displayName = 'ModalDialog';
  40896. /* harmony default export */ __webpack_exports__["default"] = (ModalDialog);
  40897. /***/ }),
  40898. /***/ "./node_modules/react-bootstrap/esm/ModalFooter.js":
  40899. /*!*********************************************************!*\
  40900. !*** ./node_modules/react-bootstrap/esm/ModalFooter.js ***!
  40901. \*********************************************************/
  40902. /*! exports provided: default */
  40903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40904. "use strict";
  40905. __webpack_require__.r(__webpack_exports__);
  40906. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  40907. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('modal-footer'));
  40908. /***/ }),
  40909. /***/ "./node_modules/react-bootstrap/esm/ModalHeader.js":
  40910. /*!*********************************************************!*\
  40911. !*** ./node_modules/react-bootstrap/esm/ModalHeader.js ***!
  40912. \*********************************************************/
  40913. /*! exports provided: default */
  40914. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40915. "use strict";
  40916. __webpack_require__.r(__webpack_exports__);
  40917. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40918. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40919. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40920. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40921. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40922. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  40923. /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
  40924. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40925. /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
  40926. /* harmony import */ var _ModalContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ModalContext */ "./node_modules/react-bootstrap/esm/ModalContext.js");
  40927. var defaultProps = {
  40928. closeLabel: 'Close',
  40929. closeButton: false
  40930. };
  40931. var ModalHeader = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  40932. var bsPrefix = _ref.bsPrefix,
  40933. closeLabel = _ref.closeLabel,
  40934. closeButton = _ref.closeButton,
  40935. onHide = _ref.onHide,
  40936. className = _ref.className,
  40937. children = _ref.children,
  40938. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "closeLabel", "closeButton", "onHide", "className", "children"]);
  40939. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'modal-header');
  40940. var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_ModalContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
  40941. var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function () {
  40942. if (context) context.onHide();
  40943. if (onHide) onHide();
  40944. });
  40945. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  40946. ref: ref
  40947. }, props, {
  40948. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  40949. }), children, closeButton && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CloseButton__WEBPACK_IMPORTED_MODULE_6__["default"], {
  40950. label: closeLabel,
  40951. onClick: handleClick
  40952. }));
  40953. });
  40954. ModalHeader.displayName = 'ModalHeader';
  40955. ModalHeader.defaultProps = defaultProps;
  40956. /* harmony default export */ __webpack_exports__["default"] = (ModalHeader);
  40957. /***/ }),
  40958. /***/ "./node_modules/react-bootstrap/esm/ModalTitle.js":
  40959. /*!********************************************************!*\
  40960. !*** ./node_modules/react-bootstrap/esm/ModalTitle.js ***!
  40961. \********************************************************/
  40962. /*! exports provided: default */
  40963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40964. "use strict";
  40965. __webpack_require__.r(__webpack_exports__);
  40966. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  40967. /* harmony import */ var _utils_divWithClassName__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/divWithClassName */ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js");
  40968. var DivStyledAsH4 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_1__["default"])('h4');
  40969. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('modal-title', {
  40970. Component: DivStyledAsH4
  40971. }));
  40972. /***/ }),
  40973. /***/ "./node_modules/react-bootstrap/esm/Nav.js":
  40974. /*!*************************************************!*\
  40975. !*** ./node_modules/react-bootstrap/esm/Nav.js ***!
  40976. \*************************************************/
  40977. /*! exports provided: default */
  40978. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40979. "use strict";
  40980. __webpack_require__.r(__webpack_exports__);
  40981. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  40982. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  40983. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  40984. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  40985. /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types-extra/lib/all */ "./node_modules/prop-types-extra/lib/all.js");
  40986. /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__);
  40987. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  40988. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  40989. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  40990. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  40991. /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
  40992. /* harmony import */ var _CardContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CardContext */ "./node_modules/react-bootstrap/esm/CardContext.js");
  40993. /* harmony import */ var _AbstractNav__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AbstractNav */ "./node_modules/react-bootstrap/esm/AbstractNav.js");
  40994. /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
  40995. /* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./NavLink */ "./node_modules/react-bootstrap/esm/NavLink.js");
  40996. var defaultProps = {
  40997. justify: false,
  40998. fill: false
  40999. };
  41000. var Nav = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (uncontrolledProps, ref) {
  41001. var _classNames;
  41002. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_5__["useUncontrolled"])(uncontrolledProps, {
  41003. activeKey: 'onSelect'
  41004. }),
  41005. _useUncontrolled$as = _useUncontrolled.as,
  41006. as = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
  41007. bsPrefix = _useUncontrolled.bsPrefix,
  41008. variant = _useUncontrolled.variant,
  41009. fill = _useUncontrolled.fill,
  41010. justify = _useUncontrolled.justify,
  41011. navbar = _useUncontrolled.navbar,
  41012. className = _useUncontrolled.className,
  41013. children = _useUncontrolled.children,
  41014. activeKey = _useUncontrolled.activeKey,
  41015. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["as", "bsPrefix", "variant", "fill", "justify", "navbar", "className", "children", "activeKey"]);
  41016. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_6__["useBootstrapPrefix"])(bsPrefix, 'nav');
  41017. var navbarBsPrefix, cardHeaderBsPrefix;
  41018. var navbarContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_NavbarContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
  41019. var cardContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_CardContext__WEBPACK_IMPORTED_MODULE_8__["default"]);
  41020. if (navbarContext) {
  41021. navbarBsPrefix = navbarContext.bsPrefix;
  41022. navbar = navbar == null ? true : navbar;
  41023. } else if (cardContext) {
  41024. cardHeaderBsPrefix = cardContext.cardHeaderBsPrefix;
  41025. }
  41026. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_AbstractNav__WEBPACK_IMPORTED_MODULE_9__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41027. as: as,
  41028. ref: ref,
  41029. activeKey: activeKey,
  41030. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, (_classNames = {}, _classNames[bsPrefix] = !navbar, _classNames[navbarBsPrefix + "-nav"] = navbar, _classNames[cardHeaderBsPrefix + "-" + variant] = !!cardHeaderBsPrefix, _classNames[bsPrefix + "-" + variant] = !!variant, _classNames[bsPrefix + "-fill"] = fill, _classNames[bsPrefix + "-justified"] = justify, _classNames))
  41031. }, props), children);
  41032. });
  41033. Nav.displayName = 'Nav';
  41034. Nav.defaultProps = defaultProps;
  41035. Nav.Item = _NavItem__WEBPACK_IMPORTED_MODULE_10__["default"];
  41036. Nav.Link = _NavLink__WEBPACK_IMPORTED_MODULE_11__["default"];
  41037. /* harmony default export */ __webpack_exports__["default"] = (Nav);
  41038. /***/ }),
  41039. /***/ "./node_modules/react-bootstrap/esm/NavContext.js":
  41040. /*!********************************************************!*\
  41041. !*** ./node_modules/react-bootstrap/esm/NavContext.js ***!
  41042. \********************************************************/
  41043. /*! exports provided: default */
  41044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41045. "use strict";
  41046. __webpack_require__.r(__webpack_exports__);
  41047. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41048. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  41049. var NavContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null);
  41050. /* harmony default export */ __webpack_exports__["default"] = (NavContext);
  41051. /***/ }),
  41052. /***/ "./node_modules/react-bootstrap/esm/NavDropdown.js":
  41053. /*!*********************************************************!*\
  41054. !*** ./node_modules/react-bootstrap/esm/NavDropdown.js ***!
  41055. \*********************************************************/
  41056. /*! exports provided: default */
  41057. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41058. "use strict";
  41059. __webpack_require__.r(__webpack_exports__);
  41060. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41061. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41062. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  41063. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41064. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41065. /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
  41066. /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
  41067. /* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavLink */ "./node_modules/react-bootstrap/esm/NavLink.js");
  41068. var NavDropdown =
  41069. /*#__PURE__*/
  41070. function (_React$Component) {
  41071. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(NavDropdown, _React$Component);
  41072. function NavDropdown() {
  41073. return _React$Component.apply(this, arguments) || this;
  41074. }
  41075. var _proto = NavDropdown.prototype;
  41076. _proto.render = function render() {
  41077. var _this$props = this.props,
  41078. id = _this$props.id,
  41079. title = _this$props.title,
  41080. children = _this$props.children,
  41081. bsPrefix = _this$props.bsPrefix,
  41082. rootCloseEvent = _this$props.rootCloseEvent,
  41083. menuRole = _this$props.menuRole,
  41084. disabled = _this$props.disabled,
  41085. active = _this$props.active,
  41086. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["id", "title", "children", "bsPrefix", "rootCloseEvent", "menuRole", "disabled", "active"]);
  41087. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  41088. as: _NavItem__WEBPACK_IMPORTED_MODULE_5__["default"]
  41089. }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Toggle, {
  41090. id: id,
  41091. eventKey: null,
  41092. active: active,
  41093. disabled: disabled,
  41094. childBsPrefix: bsPrefix,
  41095. as: _NavLink__WEBPACK_IMPORTED_MODULE_6__["default"]
  41096. }, title), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Menu, {
  41097. role: menuRole,
  41098. rootCloseEvent: rootCloseEvent
  41099. }, children));
  41100. };
  41101. return NavDropdown;
  41102. }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
  41103. NavDropdown.Item = _Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Item;
  41104. NavDropdown.Divider = _Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Divider;
  41105. NavDropdown.Header = _Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Header;
  41106. /* harmony default export */ __webpack_exports__["default"] = (NavDropdown);
  41107. /***/ }),
  41108. /***/ "./node_modules/react-bootstrap/esm/NavItem.js":
  41109. /*!*****************************************************!*\
  41110. !*** ./node_modules/react-bootstrap/esm/NavItem.js ***!
  41111. \*****************************************************/
  41112. /*! exports provided: default */
  41113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41114. "use strict";
  41115. __webpack_require__.r(__webpack_exports__);
  41116. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41117. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41118. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41119. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41120. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41121. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41122. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41123. var NavItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  41124. function (_ref, ref) {
  41125. var bsPrefix = _ref.bsPrefix,
  41126. className = _ref.className,
  41127. children = _ref.children,
  41128. _ref$as = _ref.as,
  41129. Component = _ref$as === void 0 ? 'div' : _ref$as,
  41130. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "as"]);
  41131. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'nav-item');
  41132. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  41133. ref: ref,
  41134. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  41135. }), children);
  41136. });
  41137. NavItem.displayName = 'NavItem';
  41138. /* harmony default export */ __webpack_exports__["default"] = (NavItem);
  41139. /***/ }),
  41140. /***/ "./node_modules/react-bootstrap/esm/NavLink.js":
  41141. /*!*****************************************************!*\
  41142. !*** ./node_modules/react-bootstrap/esm/NavLink.js ***!
  41143. \*****************************************************/
  41144. /*! exports provided: default */
  41145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41146. "use strict";
  41147. __webpack_require__.r(__webpack_exports__);
  41148. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41149. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41150. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41151. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41152. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41153. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41154. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  41155. /* harmony import */ var _AbstractNavItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./AbstractNavItem */ "./node_modules/react-bootstrap/esm/AbstractNavItem.js");
  41156. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41157. var defaultProps = {
  41158. disabled: false,
  41159. as: _SafeAnchor__WEBPACK_IMPORTED_MODULE_4__["default"]
  41160. };
  41161. var NavLink = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  41162. var bsPrefix = _ref.bsPrefix,
  41163. disabled = _ref.disabled,
  41164. className = _ref.className,
  41165. href = _ref.href,
  41166. eventKey = _ref.eventKey,
  41167. onSelect = _ref.onSelect,
  41168. as = _ref.as,
  41169. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "disabled", "className", "href", "eventKey", "onSelect", "as"]);
  41170. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_6__["useBootstrapPrefix"])(bsPrefix, 'nav-link');
  41171. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AbstractNavItem__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  41172. href: href,
  41173. ref: ref,
  41174. eventKey: eventKey,
  41175. as: as,
  41176. disabled: disabled,
  41177. onSelect: onSelect,
  41178. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, disabled && 'disabled')
  41179. }));
  41180. });
  41181. NavLink.displayName = 'NavLink';
  41182. NavLink.defaultProps = defaultProps;
  41183. /* harmony default export */ __webpack_exports__["default"] = (NavLink);
  41184. /***/ }),
  41185. /***/ "./node_modules/react-bootstrap/esm/Navbar.js":
  41186. /*!****************************************************!*\
  41187. !*** ./node_modules/react-bootstrap/esm/Navbar.js ***!
  41188. \****************************************************/
  41189. /*! exports provided: default */
  41190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41191. "use strict";
  41192. __webpack_require__.r(__webpack_exports__);
  41193. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41194. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41195. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41196. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41197. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41198. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41199. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  41200. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  41201. /* harmony import */ var _NavbarBrand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavbarBrand */ "./node_modules/react-bootstrap/esm/NavbarBrand.js");
  41202. /* harmony import */ var _NavbarCollapse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./NavbarCollapse */ "./node_modules/react-bootstrap/esm/NavbarCollapse.js");
  41203. /* harmony import */ var _NavbarToggle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavbarToggle */ "./node_modules/react-bootstrap/esm/NavbarToggle.js");
  41204. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41205. /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
  41206. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  41207. var defaultProps = {
  41208. expand: true,
  41209. variant: 'light',
  41210. collapseOnSelect: false
  41211. };
  41212. var Navbar = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  41213. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
  41214. expanded: 'onToggle'
  41215. }),
  41216. bsPrefix = _useUncontrolled.bsPrefix,
  41217. expand = _useUncontrolled.expand,
  41218. variant = _useUncontrolled.variant,
  41219. bg = _useUncontrolled.bg,
  41220. fixed = _useUncontrolled.fixed,
  41221. sticky = _useUncontrolled.sticky,
  41222. className = _useUncontrolled.className,
  41223. children = _useUncontrolled.children,
  41224. _useUncontrolled$as = _useUncontrolled.as,
  41225. Component = _useUncontrolled$as === void 0 ? 'nav' : _useUncontrolled$as,
  41226. expanded = _useUncontrolled.expanded,
  41227. _onToggle = _useUncontrolled.onToggle,
  41228. onSelect = _useUncontrolled.onSelect,
  41229. collapseOnSelect = _useUncontrolled.collapseOnSelect,
  41230. controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["bsPrefix", "expand", "variant", "bg", "fixed", "sticky", "className", "children", "as", "expanded", "onToggle", "onSelect", "collapseOnSelect"]);
  41231. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["useBootstrapPrefix"])(bsPrefix, 'navbar');
  41232. var handleCollapse = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function () {
  41233. if (onSelect) onSelect.apply(void 0, arguments);
  41234. if (collapseOnSelect && expanded) {
  41235. _onToggle(false);
  41236. }
  41237. }, [onSelect, collapseOnSelect, expanded, _onToggle]); // will result in some false positives but that seems better
  41238. // than false negatives. strict `undefined` check allows explicit
  41239. // "nulling" of the role if the user really doesn't want one
  41240. if (controlledProps.role === undefined && Component !== 'nav') {
  41241. controlledProps.role = 'navigation';
  41242. }
  41243. var expandClass = bsPrefix + "-expand";
  41244. if (typeof expand === 'string') expandClass = expandClass + "-" + expand;
  41245. var navbarContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
  41246. return {
  41247. onToggle: function onToggle() {
  41248. return _onToggle(!expanded);
  41249. },
  41250. bsPrefix: bsPrefix,
  41251. expanded: expanded
  41252. };
  41253. }, [bsPrefix, expanded, _onToggle]);
  41254. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_NavbarContext__WEBPACK_IMPORTED_MODULE_10__["default"].Provider, {
  41255. value: navbarContext
  41256. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_11__["default"].Provider, {
  41257. value: handleCollapse
  41258. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41259. ref: ref
  41260. }, controlledProps, {
  41261. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, expand && expandClass, variant && bsPrefix + "-" + variant, bg && "bg-" + bg, sticky && "sticky-" + sticky, fixed && "fixed-" + fixed)
  41262. }), children)));
  41263. });
  41264. Navbar.defaultProps = defaultProps;
  41265. Navbar.displayName = 'Navbar';
  41266. Navbar.Brand = _NavbarBrand__WEBPACK_IMPORTED_MODULE_6__["default"];
  41267. Navbar.Toggle = _NavbarToggle__WEBPACK_IMPORTED_MODULE_8__["default"];
  41268. Navbar.Collapse = _NavbarCollapse__WEBPACK_IMPORTED_MODULE_7__["default"];
  41269. Navbar.Text = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('navbar-text', {
  41270. Component: 'span'
  41271. });
  41272. /* harmony default export */ __webpack_exports__["default"] = (Navbar);
  41273. /***/ }),
  41274. /***/ "./node_modules/react-bootstrap/esm/NavbarBrand.js":
  41275. /*!*********************************************************!*\
  41276. !*** ./node_modules/react-bootstrap/esm/NavbarBrand.js ***!
  41277. \*********************************************************/
  41278. /*! exports provided: default */
  41279. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41280. "use strict";
  41281. __webpack_require__.r(__webpack_exports__);
  41282. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41283. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41284. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41285. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41286. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41287. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41288. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41289. var NavbarBrand = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  41290. var bsPrefix = _ref.bsPrefix,
  41291. className = _ref.className,
  41292. as = _ref.as,
  41293. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as"]);
  41294. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'navbar-brand');
  41295. var Component = as || (props.href ? 'a' : 'span');
  41296. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  41297. ref: ref,
  41298. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  41299. }));
  41300. });
  41301. NavbarBrand.displayName = 'NavbarBrand';
  41302. /* harmony default export */ __webpack_exports__["default"] = (NavbarBrand);
  41303. /***/ }),
  41304. /***/ "./node_modules/react-bootstrap/esm/NavbarCollapse.js":
  41305. /*!************************************************************!*\
  41306. !*** ./node_modules/react-bootstrap/esm/NavbarCollapse.js ***!
  41307. \************************************************************/
  41308. /*! exports provided: default */
  41309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41310. "use strict";
  41311. __webpack_require__.r(__webpack_exports__);
  41312. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41313. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41314. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41315. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  41316. /* harmony import */ var _Collapse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Collapse */ "./node_modules/react-bootstrap/esm/Collapse.js");
  41317. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41318. /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
  41319. var NavbarCollapse = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  41320. var children = _ref.children,
  41321. bsPrefix = _ref.bsPrefix,
  41322. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children", "bsPrefix"]);
  41323. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'navbar-collapse');
  41324. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_NavbarContext__WEBPACK_IMPORTED_MODULE_5__["default"].Consumer, null, function (context) {
  41325. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Collapse__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41326. in: !!(context && context.expanded)
  41327. }, props), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
  41328. ref: ref,
  41329. className: bsPrefix
  41330. }, children));
  41331. });
  41332. });
  41333. NavbarCollapse.displayName = 'NavbarCollapse';
  41334. /* harmony default export */ __webpack_exports__["default"] = (NavbarCollapse);
  41335. /***/ }),
  41336. /***/ "./node_modules/react-bootstrap/esm/NavbarContext.js":
  41337. /*!***********************************************************!*\
  41338. !*** ./node_modules/react-bootstrap/esm/NavbarContext.js ***!
  41339. \***********************************************************/
  41340. /*! exports provided: default */
  41341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41342. "use strict";
  41343. __webpack_require__.r(__webpack_exports__);
  41344. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41345. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  41346. /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
  41347. /***/ }),
  41348. /***/ "./node_modules/react-bootstrap/esm/NavbarToggle.js":
  41349. /*!**********************************************************!*\
  41350. !*** ./node_modules/react-bootstrap/esm/NavbarToggle.js ***!
  41351. \**********************************************************/
  41352. /*! exports provided: default */
  41353. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41354. "use strict";
  41355. __webpack_require__.r(__webpack_exports__);
  41356. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41357. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41358. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41359. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41360. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41361. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41362. /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
  41363. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41364. /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
  41365. var defaultProps = {
  41366. label: 'Toggle navigation'
  41367. };
  41368. var NavbarToggle = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  41369. var bsPrefix = _ref.bsPrefix,
  41370. className = _ref.className,
  41371. children = _ref.children,
  41372. label = _ref.label,
  41373. _ref$as = _ref.as,
  41374. Component = _ref$as === void 0 ? 'button' : _ref$as,
  41375. onClick = _ref.onClick,
  41376. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "label", "as", "onClick"]);
  41377. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'navbar-toggler');
  41378. var _ref2 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_NavbarContext__WEBPACK_IMPORTED_MODULE_6__["default"]) || {},
  41379. onToggle = _ref2.onToggle,
  41380. expanded = _ref2.expanded;
  41381. var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function (e) {
  41382. if (onClick) onClick(e);
  41383. if (onToggle) onToggle();
  41384. });
  41385. if (Component === 'button') {
  41386. props.type = 'button';
  41387. }
  41388. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  41389. ref: ref,
  41390. onClick: handleClick,
  41391. "aria-label": label,
  41392. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, !expanded && 'collapsed')
  41393. }), children || react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
  41394. className: bsPrefix + "-icon"
  41395. }));
  41396. });
  41397. NavbarToggle.displayName = 'NavbarToggle';
  41398. NavbarToggle.defaultProps = defaultProps;
  41399. /* harmony default export */ __webpack_exports__["default"] = (NavbarToggle);
  41400. /***/ }),
  41401. /***/ "./node_modules/react-bootstrap/esm/Overlay.js":
  41402. /*!*****************************************************!*\
  41403. !*** ./node_modules/react-bootstrap/esm/Overlay.js ***!
  41404. \*****************************************************/
  41405. /*! exports provided: default */
  41406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41407. "use strict";
  41408. __webpack_require__.r(__webpack_exports__);
  41409. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41410. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41411. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41412. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  41413. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  41414. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_3__);
  41415. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41416. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
  41417. /* harmony import */ var react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-overlays/Overlay */ "./node_modules/react-overlays/Overlay.js");
  41418. /* harmony import */ var react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5__);
  41419. /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
  41420. var defaultProps = {
  41421. transition: _Fade__WEBPACK_IMPORTED_MODULE_6__["default"],
  41422. rootClose: false,
  41423. show: false,
  41424. placement: 'top'
  41425. };
  41426. function wrapRefs(props, arrowProps) {
  41427. var ref = props.ref;
  41428. var aRef = arrowProps.ref;
  41429. props.ref = ref.__wrapped || (ref.__wrapped = function (r) {
  41430. return ref(Object(react_dom__WEBPACK_IMPORTED_MODULE_3__["findDOMNode"])(r));
  41431. });
  41432. arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = function (r) {
  41433. return aRef(Object(react_dom__WEBPACK_IMPORTED_MODULE_3__["findDOMNode"])(r));
  41434. });
  41435. }
  41436. function Overlay(_ref) {
  41437. var overlay = _ref.children,
  41438. transition = _ref.transition,
  41439. outerProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children", "transition"]);
  41440. transition = transition === true ? _Fade__WEBPACK_IMPORTED_MODULE_6__["default"] : transition || null;
  41441. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5___default.a, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, outerProps, {
  41442. transition: transition
  41443. }), function (_ref2) {
  41444. var overlayProps = _ref2.props,
  41445. arrowProps = _ref2.arrowProps,
  41446. show = _ref2.show,
  41447. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["props", "arrowProps", "show"]);
  41448. wrapRefs(overlayProps, arrowProps);
  41449. if (typeof overlay === 'function') return overlay(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {}, overlayProps, {
  41450. show: show,
  41451. arrowProps: arrowProps
  41452. }));
  41453. return react__WEBPACK_IMPORTED_MODULE_2___default.a.cloneElement(overlay, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {}, overlayProps, {
  41454. arrowProps: arrowProps,
  41455. className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(overlay.props.className, !transition && show && 'show'),
  41456. style: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, overlay.props.style, {}, overlayProps.style)
  41457. }));
  41458. });
  41459. }
  41460. Overlay.defaultProps = defaultProps;
  41461. /* harmony default export */ __webpack_exports__["default"] = (Overlay);
  41462. /***/ }),
  41463. /***/ "./node_modules/react-bootstrap/esm/OverlayTrigger.js":
  41464. /*!************************************************************!*\
  41465. !*** ./node_modules/react-bootstrap/esm/OverlayTrigger.js ***!
  41466. \************************************************************/
  41467. /*! exports provided: default */
  41468. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41469. "use strict";
  41470. __webpack_require__.r(__webpack_exports__);
  41471. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41472. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41473. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  41474. /* harmony import */ var dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js");
  41475. /* harmony import */ var dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3__);
  41476. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41477. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  41478. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  41479. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_5__);
  41480. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
  41481. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_6__);
  41482. /* harmony import */ var _Overlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Overlay */ "./node_modules/react-bootstrap/esm/Overlay.js");
  41483. var RefHolder =
  41484. /*#__PURE__*/
  41485. function (_React$Component) {
  41486. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(RefHolder, _React$Component);
  41487. function RefHolder() {
  41488. return _React$Component.apply(this, arguments) || this;
  41489. }
  41490. var _proto = RefHolder.prototype;
  41491. _proto.render = function render() {
  41492. return this.props.children;
  41493. };
  41494. return RefHolder;
  41495. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
  41496. var normalizeDelay = function normalizeDelay(delay) {
  41497. return delay && typeof delay === 'object' ? delay : {
  41498. show: delay,
  41499. hide: delay
  41500. };
  41501. };
  41502. var defaultProps = {
  41503. defaultOverlayShown: false,
  41504. trigger: ['hover', 'focus']
  41505. }; // eslint-disable-next-line react/no-multi-comp
  41506. var OverlayTrigger =
  41507. /*#__PURE__*/
  41508. function (_React$Component2) {
  41509. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(OverlayTrigger, _React$Component2);
  41510. function OverlayTrigger(props, context) {
  41511. var _this;
  41512. _this = _React$Component2.call(this, props, context) || this;
  41513. _this.getTarget = function () {
  41514. return react_dom__WEBPACK_IMPORTED_MODULE_5___default.a.findDOMNode(_this.trigger.current);
  41515. };
  41516. _this.handleShow = function () {
  41517. clearTimeout(_this._timeout);
  41518. _this._hoverState = 'show';
  41519. var delay = normalizeDelay(_this.props.delay);
  41520. if (!delay.show) {
  41521. _this.show();
  41522. return;
  41523. }
  41524. _this._timeout = setTimeout(function () {
  41525. if (_this._hoverState === 'show') _this.show();
  41526. }, delay.show);
  41527. };
  41528. _this.handleHide = function () {
  41529. clearTimeout(_this._timeout);
  41530. _this._hoverState = 'hide';
  41531. var delay = normalizeDelay(_this.props.delay);
  41532. if (!delay.hide) {
  41533. _this.hide();
  41534. return;
  41535. }
  41536. _this._timeout = setTimeout(function () {
  41537. if (_this._hoverState === 'hide') _this.hide();
  41538. }, delay.hide);
  41539. };
  41540. _this.handleFocus = function (e) {
  41541. var _this$getChildProps = _this.getChildProps(),
  41542. onFocus = _this$getChildProps.onFocus;
  41543. _this.handleShow(e);
  41544. if (onFocus) onFocus(e);
  41545. };
  41546. _this.handleBlur = function (e) {
  41547. var _this$getChildProps2 = _this.getChildProps(),
  41548. onBlur = _this$getChildProps2.onBlur;
  41549. _this.handleHide(e);
  41550. if (onBlur) onBlur(e);
  41551. };
  41552. _this.handleClick = function (e) {
  41553. var _this$getChildProps3 = _this.getChildProps(),
  41554. onClick = _this$getChildProps3.onClick;
  41555. if (_this.state.show) _this.hide();else _this.show();
  41556. if (onClick) onClick(e);
  41557. };
  41558. _this.handleMouseOver = function (e) {
  41559. _this.handleMouseOverOut(_this.handleShow, e, 'fromElement');
  41560. };
  41561. _this.handleMouseOut = function (e) {
  41562. return _this.handleMouseOverOut(_this.handleHide, e, 'toElement');
  41563. };
  41564. _this.trigger = react__WEBPACK_IMPORTED_MODULE_4___default.a.createRef();
  41565. _this.state = {
  41566. show: !!props.defaultShow
  41567. }; // We add aria-describedby in the case where the overlay is a role="tooltip"
  41568. // for other cases describedby isn't appropriate (e.g. a popover with inputs) so we don't add it.
  41569. _this.ariaModifier = {
  41570. enabled: true,
  41571. order: 900,
  41572. fn: function fn(data) {
  41573. var popper = data.instance.popper;
  41574. var target = _this.getTarget();
  41575. if (!_this.state.show || !target) return data;
  41576. var role = popper.getAttribute('role') || '';
  41577. if (popper.id && role.toLowerCase() === 'tooltip') {
  41578. target.setAttribute('aria-describedby', popper.id);
  41579. }
  41580. return data;
  41581. }
  41582. };
  41583. return _this;
  41584. }
  41585. var _proto2 = OverlayTrigger.prototype;
  41586. _proto2.componentWillUnmount = function componentWillUnmount() {
  41587. clearTimeout(this._timeout);
  41588. };
  41589. _proto2.getChildProps = function getChildProps() {
  41590. return react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.only(this.props.children).props;
  41591. };
  41592. // Simple implementation of mouseEnter and mouseLeave.
  41593. // React's built version is broken: https://github.com/facebook/react/issues/4251
  41594. // for cases when the trigger is disabled and mouseOut/Over can cause flicker
  41595. // moving from one child element to another.
  41596. _proto2.handleMouseOverOut = function handleMouseOverOut(handler, e, relatedNative) {
  41597. var target = e.currentTarget;
  41598. var related = e.relatedTarget || e.nativeEvent[relatedNative];
  41599. if ((!related || related !== target) && !dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3___default()(target, related)) {
  41600. handler(e);
  41601. }
  41602. };
  41603. _proto2.hide = function hide() {
  41604. this.setState({
  41605. show: false
  41606. });
  41607. };
  41608. _proto2.show = function show() {
  41609. this.setState({
  41610. show: true
  41611. });
  41612. };
  41613. _proto2.render = function render() {
  41614. var _this$props = this.props,
  41615. trigger = _this$props.trigger,
  41616. overlay = _this$props.overlay,
  41617. children = _this$props.children,
  41618. _this$props$popperCon = _this$props.popperConfig,
  41619. popperConfig = _this$props$popperCon === void 0 ? {} : _this$props$popperCon,
  41620. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["trigger", "overlay", "children", "popperConfig"]);
  41621. delete props.delay;
  41622. delete props.defaultShow;
  41623. var child = react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.only(children);
  41624. var triggerProps = {};
  41625. var triggers = trigger == null ? [] : [].concat(trigger);
  41626. if (triggers.indexOf('click') !== -1) {
  41627. triggerProps.onClick = this.handleClick;
  41628. }
  41629. if (triggers.indexOf('focus') !== -1) {
  41630. triggerProps.onFocus = this.handleShow;
  41631. triggerProps.onBlur = this.handleHide;
  41632. }
  41633. if (triggers.indexOf('hover') !== -1) {
  41634. true ? warning__WEBPACK_IMPORTED_MODULE_6___default()(triggers.length >= 1, '[react-bootstrap] Specifying only the `"hover"` trigger limits the ' + 'visibility of the overlay to just mouse users. Consider also ' + 'including the `"focus"` trigger so that touch and keyboard only ' + 'users can see the overlay as well.') : undefined;
  41635. triggerProps.onMouseOver = this.handleMouseOver;
  41636. triggerProps.onMouseOut = this.handleMouseOut;
  41637. }
  41638. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_4___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(RefHolder, {
  41639. ref: this.trigger
  41640. }, Object(react__WEBPACK_IMPORTED_MODULE_4__["cloneElement"])(child, triggerProps)), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Overlay__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  41641. popperConfig: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, popperConfig, {
  41642. modifiers: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, popperConfig.modifiers, {
  41643. ariaModifier: this.ariaModifier
  41644. })
  41645. }),
  41646. show: this.state.show,
  41647. onHide: this.handleHide,
  41648. target: this.getTarget
  41649. }), overlay));
  41650. };
  41651. return OverlayTrigger;
  41652. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
  41653. OverlayTrigger.defaultProps = defaultProps;
  41654. /* harmony default export */ __webpack_exports__["default"] = (OverlayTrigger);
  41655. /***/ }),
  41656. /***/ "./node_modules/react-bootstrap/esm/PageItem.js":
  41657. /*!******************************************************!*\
  41658. !*** ./node_modules/react-bootstrap/esm/PageItem.js ***!
  41659. \******************************************************/
  41660. /*! exports provided: default, First, Prev, Ellipsis, Next, Last */
  41661. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41662. "use strict";
  41663. __webpack_require__.r(__webpack_exports__);
  41664. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PageItem; });
  41665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "First", function() { return First; });
  41666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Prev", function() { return Prev; });
  41667. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ellipsis", function() { return Ellipsis; });
  41668. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Next", function() { return Next; });
  41669. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Last", function() { return Last; });
  41670. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  41671. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41672. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41673. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41674. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  41675. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41676. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  41677. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  41678. /* eslint-disable react/no-multi-comp */
  41679. var defaultProps = {
  41680. active: false,
  41681. disabled: false,
  41682. activeLabel: '(current)'
  41683. };
  41684. function PageItem(_ref) {
  41685. var active = _ref.active,
  41686. disabled = _ref.disabled,
  41687. className = _ref.className,
  41688. style = _ref.style,
  41689. activeLabel = _ref.activeLabel,
  41690. children = _ref.children,
  41691. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["active", "disabled", "className", "style", "activeLabel", "children"]);
  41692. var Component = active || disabled ? 'span' : _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__["default"];
  41693. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("li", {
  41694. style: style,
  41695. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, 'page-item', {
  41696. active: active,
  41697. disabled: disabled
  41698. })
  41699. }, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
  41700. className: "page-link",
  41701. disabled: disabled
  41702. }, props), children, active && activeLabel && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {
  41703. className: "sr-only"
  41704. }, activeLabel)));
  41705. }
  41706. PageItem.defaultProps = defaultProps;
  41707. function createButton(name, defaultValue, label) {
  41708. var _class, _temp;
  41709. if (label === void 0) {
  41710. label = name;
  41711. }
  41712. return _temp = _class =
  41713. /*#__PURE__*/
  41714. function (_React$Component) {
  41715. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_class, _React$Component);
  41716. function _class() {
  41717. return _React$Component.apply(this, arguments) || this;
  41718. }
  41719. var _proto = _class.prototype;
  41720. _proto.render = function render() {
  41721. var _this$props = this.props,
  41722. children = _this$props.children,
  41723. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(_this$props, ["children"]);
  41724. delete props.active;
  41725. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(PageItem, props, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {
  41726. "aria-hidden": "true"
  41727. }, children || defaultValue), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {
  41728. className: "sr-only"
  41729. }, label));
  41730. };
  41731. return _class;
  41732. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component), _class.displayName = name, _temp;
  41733. }
  41734. var First = createButton('First', '«');
  41735. var Prev = createButton('Prev', '‹', 'Previous');
  41736. var Ellipsis = createButton('Ellipsis', '…', 'More');
  41737. var Next = createButton('Next', '›');
  41738. var Last = createButton('Last', '»');
  41739. /***/ }),
  41740. /***/ "./node_modules/react-bootstrap/esm/Pagination.js":
  41741. /*!********************************************************!*\
  41742. !*** ./node_modules/react-bootstrap/esm/Pagination.js ***!
  41743. \********************************************************/
  41744. /*! exports provided: default */
  41745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41746. "use strict";
  41747. __webpack_require__.r(__webpack_exports__);
  41748. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41749. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41750. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  41751. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41752. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  41753. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41754. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  41755. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41756. /* harmony import */ var _PageItem__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PageItem */ "./node_modules/react-bootstrap/esm/PageItem.js");
  41757. /**
  41758. * @property {PageItem} Item
  41759. * @property {PageItem} First
  41760. * @property {PageItem} Prev
  41761. * @property {PageItem} Ellipsis
  41762. * @property {PageItem} Next
  41763. * @property {PageItem} Last
  41764. */
  41765. var Pagination =
  41766. /*#__PURE__*/
  41767. function (_React$Component) {
  41768. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Pagination, _React$Component);
  41769. function Pagination() {
  41770. return _React$Component.apply(this, arguments) || this;
  41771. }
  41772. var _proto = Pagination.prototype;
  41773. _proto.render = function render() {
  41774. var _this$props = this.props,
  41775. bsPrefix = _this$props.bsPrefix,
  41776. className = _this$props.className,
  41777. children = _this$props.children,
  41778. size = _this$props.size,
  41779. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "className", "children", "size"]);
  41780. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("ul", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  41781. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix, size && bsPrefix + "-" + size)
  41782. }), children);
  41783. };
  41784. return Pagination;
  41785. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
  41786. var DecoratedPagination = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(Pagination, 'pagination');
  41787. DecoratedPagination.First = _PageItem__WEBPACK_IMPORTED_MODULE_6__["First"];
  41788. DecoratedPagination.Prev = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Prev"];
  41789. DecoratedPagination.Ellipsis = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Ellipsis"];
  41790. DecoratedPagination.Item = _PageItem__WEBPACK_IMPORTED_MODULE_6__["default"];
  41791. DecoratedPagination.Next = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Next"];
  41792. DecoratedPagination.Last = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Last"];
  41793. /* harmony default export */ __webpack_exports__["default"] = (DecoratedPagination);
  41794. /***/ }),
  41795. /***/ "./node_modules/react-bootstrap/esm/Popover.js":
  41796. /*!*****************************************************!*\
  41797. !*** ./node_modules/react-bootstrap/esm/Popover.js ***!
  41798. \*****************************************************/
  41799. /*! exports provided: default */
  41800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41801. "use strict";
  41802. __webpack_require__.r(__webpack_exports__);
  41803. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41804. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41805. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41806. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41807. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41808. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41809. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
  41810. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__);
  41811. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41812. /* harmony import */ var _PopoverTitle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PopoverTitle */ "./node_modules/react-bootstrap/esm/PopoverTitle.js");
  41813. /* harmony import */ var _PopoverContent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PopoverContent */ "./node_modules/react-bootstrap/esm/PopoverContent.js");
  41814. var defaultProps = {
  41815. placement: 'right'
  41816. };
  41817. function Popover(_ref) {
  41818. var bsPrefix = _ref.bsPrefix,
  41819. innerRef = _ref.innerRef,
  41820. placement = _ref.placement,
  41821. className = _ref.className,
  41822. style = _ref.style,
  41823. children = _ref.children,
  41824. content = _ref.content,
  41825. arrowProps = _ref.arrowProps,
  41826. _ = _ref.scheduleUpdate,
  41827. _1 = _ref.outOfBoundaries,
  41828. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "innerRef", "placement", "className", "style", "children", "content", "arrowProps", "scheduleUpdate", "outOfBoundaries"]);
  41829. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41830. role: "tooltip",
  41831. ref: innerRef,
  41832. style: style,
  41833. "x-placement": placement,
  41834. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, "bs-popover-" + placement)
  41835. }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41836. className: "arrow"
  41837. }, arrowProps)), content ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_PopoverContent__WEBPACK_IMPORTED_MODULE_7__["default"], null, children) : children);
  41838. }
  41839. Popover.defaultProps = defaultProps;
  41840. var DecoratedPopover = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(Popover, 'popover');
  41841. DecoratedPopover.Title = _PopoverTitle__WEBPACK_IMPORTED_MODULE_6__["default"];
  41842. DecoratedPopover.Content = _PopoverContent__WEBPACK_IMPORTED_MODULE_7__["default"];
  41843. /* harmony default export */ __webpack_exports__["default"] = (DecoratedPopover);
  41844. /***/ }),
  41845. /***/ "./node_modules/react-bootstrap/esm/PopoverContent.js":
  41846. /*!************************************************************!*\
  41847. !*** ./node_modules/react-bootstrap/esm/PopoverContent.js ***!
  41848. \************************************************************/
  41849. /*! exports provided: default */
  41850. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41851. "use strict";
  41852. __webpack_require__.r(__webpack_exports__);
  41853. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41854. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41855. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41856. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41857. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41858. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41859. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41860. var PopoverContent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  41861. var _ref$as = _ref.as,
  41862. Component = _ref$as === void 0 ? 'div' : _ref$as,
  41863. bsPrefix = _ref.bsPrefix,
  41864. className = _ref.className,
  41865. children = _ref.children,
  41866. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "bsPrefix", "className", "children"]);
  41867. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'popover-body');
  41868. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41869. ref: ref
  41870. }, props, {
  41871. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  41872. }), children);
  41873. });
  41874. /* harmony default export */ __webpack_exports__["default"] = (PopoverContent);
  41875. /***/ }),
  41876. /***/ "./node_modules/react-bootstrap/esm/PopoverTitle.js":
  41877. /*!**********************************************************!*\
  41878. !*** ./node_modules/react-bootstrap/esm/PopoverTitle.js ***!
  41879. \**********************************************************/
  41880. /*! exports provided: default */
  41881. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41882. "use strict";
  41883. __webpack_require__.r(__webpack_exports__);
  41884. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41885. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41886. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41887. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41888. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41889. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41890. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41891. var PopoverTitle = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  41892. var _ref$as = _ref.as,
  41893. Component = _ref$as === void 0 ? 'div' : _ref$as,
  41894. bsPrefix = _ref.bsPrefix,
  41895. className = _ref.className,
  41896. children = _ref.children,
  41897. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "bsPrefix", "className", "children"]);
  41898. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'popover-header');
  41899. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41900. ref: ref
  41901. }, props, {
  41902. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(bsPrefix, className)
  41903. }), children);
  41904. });
  41905. /* harmony default export */ __webpack_exports__["default"] = (PopoverTitle);
  41906. /***/ }),
  41907. /***/ "./node_modules/react-bootstrap/esm/ProgressBar.js":
  41908. /*!*********************************************************!*\
  41909. !*** ./node_modules/react-bootstrap/esm/ProgressBar.js ***!
  41910. \*********************************************************/
  41911. /*! exports provided: default */
  41912. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41913. "use strict";
  41914. __webpack_require__.r(__webpack_exports__);
  41915. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  41916. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  41917. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  41918. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  41919. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  41920. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  41921. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  41922. /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
  41923. var ROUND_PRECISION = 1000;
  41924. /**
  41925. * Validate that children, if any, are instances of `<ProgressBar>`.
  41926. */
  41927. function onlyProgressBar(props, propName, componentName) {
  41928. var children = props[propName];
  41929. if (!children) {
  41930. return null;
  41931. }
  41932. var error = null;
  41933. react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.forEach(children, function (child) {
  41934. if (error) {
  41935. return;
  41936. }
  41937. /**
  41938. * Compare types in a way that works with libraries that patch and proxy
  41939. * components like react-hot-loader.
  41940. *
  41941. * see https://github.com/gaearon/react-hot-loader#checking-element-types
  41942. */
  41943. var element = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ProgressBar, null);
  41944. if (child.type === element.type) return;
  41945. var childIdentifier = react__WEBPACK_IMPORTED_MODULE_3___default.a.isValidElement(child) ? child.type.displayName || child.type.name || child.type : child;
  41946. error = new Error("Children of " + componentName + " can contain only ProgressBar " + ("components. Found " + childIdentifier + "."));
  41947. });
  41948. return error;
  41949. }
  41950. var defaultProps = {
  41951. min: 0,
  41952. max: 100,
  41953. animated: false,
  41954. isChild: false,
  41955. srOnly: false,
  41956. striped: false
  41957. };
  41958. function getPercentage(now, min, max) {
  41959. var percentage = (now - min) / (max - min) * 100;
  41960. return Math.round(percentage * ROUND_PRECISION) / ROUND_PRECISION;
  41961. }
  41962. function renderProgressBar(_ref, ref) {
  41963. var _classNames;
  41964. var min = _ref.min,
  41965. now = _ref.now,
  41966. max = _ref.max,
  41967. label = _ref.label,
  41968. srOnly = _ref.srOnly,
  41969. striped = _ref.striped,
  41970. animated = _ref.animated,
  41971. className = _ref.className,
  41972. style = _ref.style,
  41973. variant = _ref.variant,
  41974. bsPrefix = _ref.bsPrefix,
  41975. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["min", "now", "max", "label", "srOnly", "striped", "animated", "className", "style", "variant", "bsPrefix"]);
  41976. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41977. ref: ref
  41978. }, props, {
  41979. role: "progressbar",
  41980. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix + "-bar", (_classNames = {}, _classNames["bg-" + variant] = variant, _classNames[bsPrefix + "-bar-animated"] = animated, _classNames[bsPrefix + "-bar-striped"] = animated || striped, _classNames)),
  41981. style: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  41982. width: getPercentage(now, min, max) + "%"
  41983. }, style),
  41984. "aria-valuenow": now,
  41985. "aria-valuemin": min,
  41986. "aria-valuemax": max
  41987. }), srOnly ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
  41988. className: "sr-only"
  41989. }, label) : label);
  41990. }
  41991. var ProgressBar = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref2, ref) {
  41992. var isChild = _ref2.isChild,
  41993. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["isChild"]);
  41994. props.bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(props.bsPrefix, 'progress');
  41995. if (isChild) {
  41996. return renderProgressBar(props, ref);
  41997. }
  41998. var min = props.min,
  41999. now = props.now,
  42000. max = props.max,
  42001. label = props.label,
  42002. srOnly = props.srOnly,
  42003. striped = props.striped,
  42004. animated = props.animated,
  42005. bsPrefix = props.bsPrefix,
  42006. variant = props.variant,
  42007. className = props.className,
  42008. children = props.children,
  42009. wrapperProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["min", "now", "max", "label", "srOnly", "striped", "animated", "bsPrefix", "variant", "className", "children"]);
  42010. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  42011. ref: ref
  42012. }, wrapperProps, {
  42013. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
  42014. }), children ? Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_5__["map"])(children, function (child) {
  42015. return Object(react__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(child, {
  42016. isChild: true
  42017. });
  42018. }) : renderProgressBar({
  42019. min: min,
  42020. now: now,
  42021. max: max,
  42022. label: label,
  42023. srOnly: srOnly,
  42024. striped: striped,
  42025. animated: animated,
  42026. bsPrefix: bsPrefix,
  42027. variant: variant
  42028. }, ref));
  42029. });
  42030. ProgressBar.displayName = 'ProgressBar';
  42031. ProgressBar.defaultProps = defaultProps;
  42032. /* harmony default export */ __webpack_exports__["default"] = (ProgressBar);
  42033. /***/ }),
  42034. /***/ "./node_modules/react-bootstrap/esm/ResponsiveEmbed.js":
  42035. /*!*************************************************************!*\
  42036. !*** ./node_modules/react-bootstrap/esm/ResponsiveEmbed.js ***!
  42037. \*************************************************************/
  42038. /*! exports provided: default */
  42039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42040. "use strict";
  42041. __webpack_require__.r(__webpack_exports__);
  42042. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42043. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42044. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  42045. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42046. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  42047. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42048. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  42049. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42050. var defaultProps = {
  42051. aspectRatio: '1by1'
  42052. };
  42053. var ResponsiveEmbed =
  42054. /*#__PURE__*/
  42055. function (_React$Component) {
  42056. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(ResponsiveEmbed, _React$Component);
  42057. function ResponsiveEmbed() {
  42058. return _React$Component.apply(this, arguments) || this;
  42059. }
  42060. var _proto = ResponsiveEmbed.prototype;
  42061. _proto.render = function render() {
  42062. var _this$props = this.props,
  42063. bsPrefix = _this$props.bsPrefix,
  42064. className = _this$props.className,
  42065. children = _this$props.children,
  42066. aspectRatio = _this$props.aspectRatio,
  42067. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "className", "children", "aspectRatio"]);
  42068. var child = react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.only(children);
  42069. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42070. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix, className, aspectRatio && bsPrefix + "-" + aspectRatio)
  42071. }), react__WEBPACK_IMPORTED_MODULE_4___default.a.cloneElement(child, {
  42072. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(child.props.className, bsPrefix + "-item")
  42073. }));
  42074. };
  42075. return ResponsiveEmbed;
  42076. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
  42077. ResponsiveEmbed.defaultProps = defaultProps;
  42078. /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(ResponsiveEmbed, 'embed-responsive'));
  42079. /***/ }),
  42080. /***/ "./node_modules/react-bootstrap/esm/Row.js":
  42081. /*!*************************************************!*\
  42082. !*** ./node_modules/react-bootstrap/esm/Row.js ***!
  42083. \*************************************************/
  42084. /*! exports provided: default */
  42085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42086. "use strict";
  42087. __webpack_require__.r(__webpack_exports__);
  42088. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42089. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42090. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42091. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  42092. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42093. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  42094. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42095. var defaultProps = {
  42096. noGutters: false
  42097. };
  42098. var Row = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  42099. var bsPrefix = props.bsPrefix,
  42100. noGutters = props.noGutters,
  42101. _props$as = props.as,
  42102. Component = _props$as === void 0 ? 'div' : _props$as,
  42103. className = props.className,
  42104. otherProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["bsPrefix", "noGutters", "as", "className"]);
  42105. var decoratedBsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'row');
  42106. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  42107. ref: ref
  42108. }, otherProps, {
  42109. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, decoratedBsPrefix, noGutters && 'no-gutters')
  42110. }));
  42111. });
  42112. Row.defaultProps = defaultProps;
  42113. /* harmony default export */ __webpack_exports__["default"] = (Row);
  42114. /***/ }),
  42115. /***/ "./node_modules/react-bootstrap/esm/SafeAnchor.js":
  42116. /*!********************************************************!*\
  42117. !*** ./node_modules/react-bootstrap/esm/SafeAnchor.js ***!
  42118. \********************************************************/
  42119. /*! exports provided: default */
  42120. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42121. "use strict";
  42122. __webpack_require__.r(__webpack_exports__);
  42123. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42124. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42125. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42126. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  42127. /* harmony import */ var _utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/createChainedFunction */ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js");
  42128. function isTrivialHref(href) {
  42129. return !href || href.trim() === '#';
  42130. }
  42131. /**
  42132. * There are situations due to browser quirks or Bootstrap CSS where
  42133. * an anchor tag is needed, when semantically a button tag is the
  42134. * better choice. SafeAnchor ensures that when an anchor is used like a
  42135. * button its accessible. It also emulates input `disabled` behavior for
  42136. * links, which is usually desirable for Buttons, NavItems, DropdownItems, etc.
  42137. */
  42138. var SafeAnchor = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  42139. var _ref$as = _ref.as,
  42140. Component = _ref$as === void 0 ? 'a' : _ref$as,
  42141. disabled = _ref.disabled,
  42142. onKeyDown = _ref.onKeyDown,
  42143. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "disabled", "onKeyDown"]);
  42144. var handleClick = function handleClick(event) {
  42145. var href = props.href,
  42146. onClick = props.onClick;
  42147. if (disabled || isTrivialHref(href)) {
  42148. event.preventDefault();
  42149. }
  42150. if (disabled) {
  42151. event.stopPropagation();
  42152. return;
  42153. }
  42154. if (onClick) {
  42155. onClick(event);
  42156. }
  42157. };
  42158. var handleKeyDown = function handleKeyDown(event) {
  42159. if (event.key === ' ') {
  42160. event.preventDefault();
  42161. handleClick(event);
  42162. }
  42163. };
  42164. if (isTrivialHref(props.href)) {
  42165. props.role = props.role || 'button'; // we want to make sure there is a href attribute on the node
  42166. // otherwise, the cursor incorrectly styled (except with role='button')
  42167. props.href = props.href || '#';
  42168. }
  42169. if (disabled) {
  42170. props.tabIndex = -1;
  42171. props['aria-disabled'] = true;
  42172. }
  42173. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  42174. ref: ref
  42175. }, props, {
  42176. onClick: handleClick,
  42177. onKeyDown: Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_3__["default"])(handleKeyDown, onKeyDown)
  42178. }));
  42179. });
  42180. SafeAnchor.displayName = 'SafeAnchor';
  42181. /* harmony default export */ __webpack_exports__["default"] = (SafeAnchor);
  42182. /***/ }),
  42183. /***/ "./node_modules/react-bootstrap/esm/SelectableContext.js":
  42184. /*!***************************************************************!*\
  42185. !*** ./node_modules/react-bootstrap/esm/SelectableContext.js ***!
  42186. \***************************************************************/
  42187. /*! exports provided: makeEventKey, default */
  42188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42189. "use strict";
  42190. __webpack_require__.r(__webpack_exports__);
  42191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeEventKey", function() { return makeEventKey; });
  42192. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42193. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  42194. var SelectableContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext();
  42195. var makeEventKey = function makeEventKey(eventKey, href) {
  42196. if (eventKey != null) return String(eventKey);
  42197. return href || null;
  42198. };
  42199. /* harmony default export */ __webpack_exports__["default"] = (SelectableContext);
  42200. /***/ }),
  42201. /***/ "./node_modules/react-bootstrap/esm/Spinner.js":
  42202. /*!*****************************************************!*\
  42203. !*** ./node_modules/react-bootstrap/esm/Spinner.js ***!
  42204. \*****************************************************/
  42205. /*! exports provided: default */
  42206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42207. "use strict";
  42208. __webpack_require__.r(__webpack_exports__);
  42209. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42210. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42211. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42212. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  42213. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42214. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  42215. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42216. var Spinner = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  42217. var bsPrefix = _ref.bsPrefix,
  42218. variant = _ref.variant,
  42219. animation = _ref.animation,
  42220. size = _ref.size,
  42221. children = _ref.children,
  42222. _ref$as = _ref.as,
  42223. Component = _ref$as === void 0 ? 'div' : _ref$as,
  42224. className = _ref.className,
  42225. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "variant", "animation", "size", "children", "as", "className"]);
  42226. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'spinner');
  42227. var bsSpinnerPrefix = bsPrefix + "-" + animation;
  42228. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  42229. ref: ref
  42230. }, props, {
  42231. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsSpinnerPrefix, size && bsSpinnerPrefix + "-" + size, variant && "text-" + variant)
  42232. }), children);
  42233. });
  42234. Spinner.displayName = 'Spinner';
  42235. /* harmony default export */ __webpack_exports__["default"] = (Spinner);
  42236. /***/ }),
  42237. /***/ "./node_modules/react-bootstrap/esm/SplitButton.js":
  42238. /*!*********************************************************!*\
  42239. !*** ./node_modules/react-bootstrap/esm/SplitButton.js ***!
  42240. \*********************************************************/
  42241. /*! exports provided: default */
  42242. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42243. "use strict";
  42244. __webpack_require__.r(__webpack_exports__);
  42245. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42246. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42247. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42248. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  42249. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  42250. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
  42251. /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
  42252. /* harmony import */ var _ButtonGroup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ButtonGroup */ "./node_modules/react-bootstrap/esm/ButtonGroup.js");
  42253. /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
  42254. var propTypes = {
  42255. /**
  42256. * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.
  42257. * @type {string|number}
  42258. * @required
  42259. */
  42260. id: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.any,
  42261. /**
  42262. * Accessible label for the toggle; the value of `title` if not specified.
  42263. */
  42264. toggleLabel: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  42265. /** An `href` passed to the non-toggle Button */
  42266. href: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  42267. /** An anchor `target` passed to the non-toggle Button */
  42268. target: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  42269. /** An `onClick` handler passed to the non-toggle Button */
  42270. onClick: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,
  42271. /** The content of the non-toggle Button. */
  42272. title: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.node.isRequired,
  42273. /** Disables both Buttons */
  42274. disabled: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
  42275. /** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
  42276. menuRole: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  42277. /**
  42278. * Which event when fired outside the component will cause it to be closed.
  42279. *
  42280. * _see [DropdownMenu](#menu-props) for more details_
  42281. */
  42282. rootCloseEvent: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  42283. /** @ignore */
  42284. bsPrefix: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  42285. /** @ignore */
  42286. variant: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
  42287. /** @ignore */
  42288. size: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string
  42289. };
  42290. var defaultProps = {
  42291. toggleLabel: 'Toggle dropdown'
  42292. };
  42293. var SplitButton = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  42294. var id = _ref.id,
  42295. bsPrefix = _ref.bsPrefix,
  42296. size = _ref.size,
  42297. variant = _ref.variant,
  42298. title = _ref.title,
  42299. toggleLabel = _ref.toggleLabel,
  42300. children = _ref.children,
  42301. onClick = _ref.onClick,
  42302. href = _ref.href,
  42303. target = _ref.target,
  42304. menuRole = _ref.menuRole,
  42305. rootCloseEvent = _ref.rootCloseEvent,
  42306. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["id", "bsPrefix", "size", "variant", "title", "toggleLabel", "children", "onClick", "href", "target", "menuRole", "rootCloseEvent"]);
  42307. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  42308. ref: ref
  42309. }, props, {
  42310. as: _ButtonGroup__WEBPACK_IMPORTED_MODULE_5__["default"]
  42311. }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Button__WEBPACK_IMPORTED_MODULE_4__["default"], {
  42312. size: size,
  42313. variant: variant,
  42314. disabled: props.disabled,
  42315. bsPrefix: bsPrefix,
  42316. href: href,
  42317. target: target,
  42318. onClick: onClick
  42319. }, title), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_6__["default"].Toggle, {
  42320. split: true,
  42321. id: id,
  42322. size: size,
  42323. variant: variant,
  42324. disabled: props.disabled,
  42325. childBsPrefix: bsPrefix
  42326. }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("span", {
  42327. className: "sr-only"
  42328. }, toggleLabel)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_6__["default"].Menu, {
  42329. role: menuRole,
  42330. rootCloseEvent: rootCloseEvent
  42331. }, children));
  42332. });
  42333. SplitButton.propTypes = propTypes;
  42334. SplitButton.defaultProps = defaultProps;
  42335. SplitButton.displayName = 'SplitButton';
  42336. /* harmony default export */ __webpack_exports__["default"] = (SplitButton);
  42337. /***/ }),
  42338. /***/ "./node_modules/react-bootstrap/esm/Switch.js":
  42339. /*!****************************************************!*\
  42340. !*** ./node_modules/react-bootstrap/esm/Switch.js ***!
  42341. \****************************************************/
  42342. /*! exports provided: default */
  42343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42344. "use strict";
  42345. __webpack_require__.r(__webpack_exports__);
  42346. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42347. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42348. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  42349. /* harmony import */ var _FormCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FormCheck */ "./node_modules/react-bootstrap/esm/FormCheck.js");
  42350. var Switch = react__WEBPACK_IMPORTED_MODULE_1___default.a.forwardRef(function (props, ref) {
  42351. return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_FormCheck__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42352. ref: ref,
  42353. type: "switch"
  42354. }));
  42355. });
  42356. Switch.displayName = 'Switch';
  42357. Switch.Input = _FormCheck__WEBPACK_IMPORTED_MODULE_2__["default"].Input;
  42358. Switch.Label = _FormCheck__WEBPACK_IMPORTED_MODULE_2__["default"].Label;
  42359. /* harmony default export */ __webpack_exports__["default"] = (Switch);
  42360. /***/ }),
  42361. /***/ "./node_modules/react-bootstrap/esm/Tab.js":
  42362. /*!*************************************************!*\
  42363. !*** ./node_modules/react-bootstrap/esm/Tab.js ***!
  42364. \*************************************************/
  42365. /*! exports provided: default */
  42366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42367. "use strict";
  42368. __webpack_require__.r(__webpack_exports__);
  42369. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  42370. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42371. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  42372. /* harmony import */ var _TabContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TabContainer */ "./node_modules/react-bootstrap/esm/TabContainer.js");
  42373. /* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./TabContent */ "./node_modules/react-bootstrap/esm/TabContent.js");
  42374. /* harmony import */ var _TabPane__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TabPane */ "./node_modules/react-bootstrap/esm/TabPane.js");
  42375. /* eslint-disable react/require-render-return, react/no-unused-prop-types */
  42376. var Tab =
  42377. /*#__PURE__*/
  42378. function (_React$Component) {
  42379. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Tab, _React$Component);
  42380. function Tab() {
  42381. return _React$Component.apply(this, arguments) || this;
  42382. }
  42383. var _proto = Tab.prototype;
  42384. _proto.render = function render() {
  42385. throw new Error('ReactBootstrap: The `Tab` component is not meant to be rendered! ' + "It's an abstract component that is only valid as a direct Child of the `Tabs` Component. " + 'For custom tabs components use TabPane and TabsContainer directly');
  42386. };
  42387. return Tab;
  42388. }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);
  42389. Tab.Container = _TabContainer__WEBPACK_IMPORTED_MODULE_2__["default"];
  42390. Tab.Content = _TabContent__WEBPACK_IMPORTED_MODULE_3__["default"];
  42391. Tab.Pane = _TabPane__WEBPACK_IMPORTED_MODULE_4__["default"];
  42392. /* harmony default export */ __webpack_exports__["default"] = (Tab);
  42393. /***/ }),
  42394. /***/ "./node_modules/react-bootstrap/esm/TabContainer.js":
  42395. /*!**********************************************************!*\
  42396. !*** ./node_modules/react-bootstrap/esm/TabContainer.js ***!
  42397. \**********************************************************/
  42398. /*! exports provided: default */
  42399. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42400. "use strict";
  42401. __webpack_require__.r(__webpack_exports__);
  42402. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42403. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  42404. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  42405. /* harmony import */ var _TabContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TabContext */ "./node_modules/react-bootstrap/esm/TabContext.js");
  42406. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  42407. /* eslint-disable react/no-unused-prop-types */
  42408. var TabContainer = function TabContainer(props) {
  42409. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_1__["useUncontrolled"])(props, {
  42410. activeKey: 'onSelect'
  42411. }),
  42412. id = _useUncontrolled.id,
  42413. generateCustomChildId = _useUncontrolled.generateChildId,
  42414. onSelect = _useUncontrolled.onSelect,
  42415. activeKey = _useUncontrolled.activeKey,
  42416. transition = _useUncontrolled.transition,
  42417. mountOnEnter = _useUncontrolled.mountOnEnter,
  42418. unmountOnExit = _useUncontrolled.unmountOnExit,
  42419. children = _useUncontrolled.children;
  42420. var generateChildId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
  42421. return generateCustomChildId || function (key, type) {
  42422. return id ? id + "-" + type + "-" + key : null;
  42423. };
  42424. }, [id, generateCustomChildId]);
  42425. var tabContext = Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
  42426. return {
  42427. onSelect: onSelect,
  42428. activeKey: activeKey,
  42429. transition: transition,
  42430. mountOnEnter: mountOnEnter,
  42431. unmountOnExit: unmountOnExit,
  42432. getControlledId: function getControlledId(key) {
  42433. return generateChildId(key, 'tabpane');
  42434. },
  42435. getControllerId: function getControllerId(key) {
  42436. return generateChildId(key, 'tab');
  42437. }
  42438. };
  42439. }, [onSelect, activeKey, transition, mountOnEnter, unmountOnExit, generateChildId]);
  42440. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TabContext__WEBPACK_IMPORTED_MODULE_2__["default"].Provider, {
  42441. value: tabContext
  42442. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_3__["default"].Provider, {
  42443. value: onSelect
  42444. }, children));
  42445. };
  42446. /* harmony default export */ __webpack_exports__["default"] = (TabContainer);
  42447. /***/ }),
  42448. /***/ "./node_modules/react-bootstrap/esm/TabContent.js":
  42449. /*!********************************************************!*\
  42450. !*** ./node_modules/react-bootstrap/esm/TabContent.js ***!
  42451. \********************************************************/
  42452. /*! exports provided: default */
  42453. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42454. "use strict";
  42455. __webpack_require__.r(__webpack_exports__);
  42456. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42457. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42458. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  42459. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42460. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  42461. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42462. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  42463. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42464. var TabContent =
  42465. /*#__PURE__*/
  42466. function (_React$Component) {
  42467. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(TabContent, _React$Component);
  42468. function TabContent() {
  42469. return _React$Component.apply(this, arguments) || this;
  42470. }
  42471. var _proto = TabContent.prototype;
  42472. _proto.render = function render() {
  42473. // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
  42474. var _this$props = this.props,
  42475. bsPrefix = _this$props.bsPrefix,
  42476. _this$props$as = _this$props.as,
  42477. Component = _this$props$as === void 0 ? 'div' : _this$props$as,
  42478. className = _this$props.className,
  42479. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "as", "className"]);
  42480. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42481. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix)
  42482. }));
  42483. };
  42484. return TabContent;
  42485. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
  42486. /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(TabContent, 'tab-content'));
  42487. /***/ }),
  42488. /***/ "./node_modules/react-bootstrap/esm/TabContext.js":
  42489. /*!********************************************************!*\
  42490. !*** ./node_modules/react-bootstrap/esm/TabContext.js ***!
  42491. \********************************************************/
  42492. /*! exports provided: default */
  42493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42494. "use strict";
  42495. __webpack_require__.r(__webpack_exports__);
  42496. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42497. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  42498. var TabContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null);
  42499. /* harmony default export */ __webpack_exports__["default"] = (TabContext);
  42500. /***/ }),
  42501. /***/ "./node_modules/react-bootstrap/esm/TabPane.js":
  42502. /*!*****************************************************!*\
  42503. !*** ./node_modules/react-bootstrap/esm/TabPane.js ***!
  42504. \*****************************************************/
  42505. /*! exports provided: default */
  42506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42507. "use strict";
  42508. __webpack_require__.r(__webpack_exports__);
  42509. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42510. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42511. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42512. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  42513. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42514. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  42515. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42516. /* harmony import */ var _TabContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TabContext */ "./node_modules/react-bootstrap/esm/TabContext.js");
  42517. /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
  42518. /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
  42519. function useTabContext(props) {
  42520. var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_TabContext__WEBPACK_IMPORTED_MODULE_5__["default"]);
  42521. if (!context) return props;
  42522. var activeKey = context.activeKey,
  42523. getControlledId = context.getControlledId,
  42524. getControllerId = context.getControllerId,
  42525. rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(context, ["activeKey", "getControlledId", "getControllerId"]);
  42526. var shouldTransition = props.transition !== false && rest.transition !== false;
  42527. var key = Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(props.eventKey);
  42528. return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42529. active: props.active == null && key != null ? Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(activeKey) === key : props.active,
  42530. id: getControlledId(props.eventKey),
  42531. 'aria-labelledby': getControllerId(props.eventKey),
  42532. transition: shouldTransition && (props.transition || rest.transition || _Fade__WEBPACK_IMPORTED_MODULE_7__["default"]),
  42533. mountOnEnter: props.mountOnEnter != null ? props.mountOnEnter : rest.mountOnEnter,
  42534. unmountOnExit: props.unmountOnExit != null ? props.unmountOnExit : rest.unmountOnExit
  42535. });
  42536. }
  42537. var TabPane = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  42538. var _useTabContext = useTabContext(props),
  42539. bsPrefix = _useTabContext.bsPrefix,
  42540. className = _useTabContext.className,
  42541. active = _useTabContext.active,
  42542. onEnter = _useTabContext.onEnter,
  42543. onEntering = _useTabContext.onEntering,
  42544. onEntered = _useTabContext.onEntered,
  42545. onExit = _useTabContext.onExit,
  42546. onExiting = _useTabContext.onExiting,
  42547. onExited = _useTabContext.onExited,
  42548. mountOnEnter = _useTabContext.mountOnEnter,
  42549. unmountOnExit = _useTabContext.unmountOnExit,
  42550. Transition = _useTabContext.transition,
  42551. _useTabContext$as = _useTabContext.as,
  42552. Component = _useTabContext$as === void 0 ? 'div' : _useTabContext$as,
  42553. _ = _useTabContext.eventKey,
  42554. rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useTabContext, ["bsPrefix", "className", "active", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "mountOnEnter", "unmountOnExit", "transition", "as", "eventKey"]);
  42555. var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'tab-pane');
  42556. if (!active && unmountOnExit) return null;
  42557. var pane = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, {
  42558. ref: ref,
  42559. role: "tabpanel",
  42560. "aria-hidden": !active,
  42561. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, {
  42562. active: active
  42563. })
  42564. }));
  42565. if (Transition) pane = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Transition, {
  42566. in: active,
  42567. onEnter: onEnter,
  42568. onEntering: onEntering,
  42569. onEntered: onEntered,
  42570. onExit: onExit,
  42571. onExiting: onExiting,
  42572. onExited: onExited,
  42573. mountOnEnter: mountOnEnter,
  42574. unmountOnExit: unmountOnExit
  42575. }, pane); // We provide an empty the TabContext so `<Nav>`s in `<TabPane>`s don't
  42576. // conflict with the top level one.
  42577. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TabContext__WEBPACK_IMPORTED_MODULE_5__["default"].Provider, {
  42578. value: null
  42579. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["default"].Provider, {
  42580. value: null
  42581. }, pane));
  42582. });
  42583. TabPane.displayName = 'TabPane';
  42584. /* harmony default export */ __webpack_exports__["default"] = (TabPane);
  42585. /***/ }),
  42586. /***/ "./node_modules/react-bootstrap/esm/Table.js":
  42587. /*!***************************************************!*\
  42588. !*** ./node_modules/react-bootstrap/esm/Table.js ***!
  42589. \***************************************************/
  42590. /*! exports provided: default */
  42591. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42592. "use strict";
  42593. __webpack_require__.r(__webpack_exports__);
  42594. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42595. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42596. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  42597. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42598. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  42599. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42600. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  42601. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42602. var Table =
  42603. /*#__PURE__*/
  42604. function (_React$Component) {
  42605. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Table, _React$Component);
  42606. function Table() {
  42607. return _React$Component.apply(this, arguments) || this;
  42608. }
  42609. var _proto = Table.prototype;
  42610. _proto.render = function render() {
  42611. var _this$props = this.props,
  42612. bsPrefix = _this$props.bsPrefix,
  42613. className = _this$props.className,
  42614. striped = _this$props.striped,
  42615. bordered = _this$props.bordered,
  42616. borderless = _this$props.borderless,
  42617. hover = _this$props.hover,
  42618. size = _this$props.size,
  42619. variant = _this$props.variant,
  42620. responsive = _this$props.responsive,
  42621. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "className", "striped", "bordered", "borderless", "hover", "size", "variant", "responsive"]);
  42622. var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix, className, variant && bsPrefix + "-" + variant, size && bsPrefix + "-" + size, striped && bsPrefix + "-striped", bordered && bsPrefix + "-bordered", borderless && bsPrefix + "-borderless", hover && bsPrefix + "-hover");
  42623. var table = react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("table", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42624. className: classes
  42625. }));
  42626. if (responsive) {
  42627. var responsiveClass = bsPrefix + "-responsive";
  42628. if (typeof responsive === 'string') {
  42629. responsiveClass = responsiveClass + "-" + responsive;
  42630. }
  42631. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
  42632. className: responsiveClass
  42633. }, table);
  42634. }
  42635. return table;
  42636. };
  42637. return Table;
  42638. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
  42639. /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(Table, 'table'));
  42640. /***/ }),
  42641. /***/ "./node_modules/react-bootstrap/esm/Tabs.js":
  42642. /*!**************************************************!*\
  42643. !*** ./node_modules/react-bootstrap/esm/Tabs.js ***!
  42644. \**************************************************/
  42645. /*! exports provided: default */
  42646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42647. "use strict";
  42648. __webpack_require__.r(__webpack_exports__);
  42649. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42650. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42651. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42652. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  42653. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
  42654. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_3__);
  42655. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  42656. /* harmony import */ var _Nav__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Nav */ "./node_modules/react-bootstrap/esm/Nav.js");
  42657. /* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavLink */ "./node_modules/react-bootstrap/esm/NavLink.js");
  42658. /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
  42659. /* harmony import */ var _TabContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TabContainer */ "./node_modules/react-bootstrap/esm/TabContainer.js");
  42660. /* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./TabContent */ "./node_modules/react-bootstrap/esm/TabContent.js");
  42661. /* harmony import */ var _TabPane__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./TabPane */ "./node_modules/react-bootstrap/esm/TabPane.js");
  42662. /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
  42663. var defaultProps = {
  42664. variant: 'tabs',
  42665. mountOnEnter: false,
  42666. unmountOnExit: false
  42667. };
  42668. function getDefaultActiveKey(children) {
  42669. var defaultActiveKey;
  42670. Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["forEach"])(children, function (child) {
  42671. if (defaultActiveKey == null) {
  42672. defaultActiveKey = child.props.eventKey;
  42673. }
  42674. });
  42675. return defaultActiveKey;
  42676. }
  42677. function renderTab(child) {
  42678. var _child$props = child.props,
  42679. title = _child$props.title,
  42680. eventKey = _child$props.eventKey,
  42681. disabled = _child$props.disabled,
  42682. tabClassName = _child$props.tabClassName;
  42683. if (title == null) {
  42684. return null;
  42685. }
  42686. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_NavItem__WEBPACK_IMPORTED_MODULE_7__["default"], {
  42687. as: _NavLink__WEBPACK_IMPORTED_MODULE_6__["default"],
  42688. eventKey: eventKey,
  42689. disabled: disabled,
  42690. className: tabClassName
  42691. }, title);
  42692. }
  42693. var Tabs = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (props, ref) {
  42694. var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
  42695. activeKey: 'onSelect'
  42696. }),
  42697. id = _useUncontrolled.id,
  42698. onSelect = _useUncontrolled.onSelect,
  42699. transition = _useUncontrolled.transition,
  42700. mountOnEnter = _useUncontrolled.mountOnEnter,
  42701. unmountOnExit = _useUncontrolled.unmountOnExit,
  42702. children = _useUncontrolled.children,
  42703. _useUncontrolled$acti = _useUncontrolled.activeKey,
  42704. activeKey = _useUncontrolled$acti === void 0 ? getDefaultActiveKey(children) : _useUncontrolled$acti,
  42705. controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["id", "onSelect", "transition", "mountOnEnter", "unmountOnExit", "children", "activeKey"]);
  42706. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TabContainer__WEBPACK_IMPORTED_MODULE_8__["default"], {
  42707. ref: ref,
  42708. id: id,
  42709. activeKey: activeKey,
  42710. onSelect: onSelect,
  42711. transition: transition,
  42712. mountOnEnter: mountOnEnter,
  42713. unmountOnExit: unmountOnExit
  42714. }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Nav__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, controlledProps, {
  42715. role: "tablist",
  42716. as: "nav"
  42717. }), Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["map"])(children, renderTab)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TabContent__WEBPACK_IMPORTED_MODULE_9__["default"], null, Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["map"])(children, function (child) {
  42718. var childProps = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, child.props);
  42719. delete childProps.title;
  42720. delete childProps.disabled;
  42721. delete childProps.tabClassName;
  42722. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TabPane__WEBPACK_IMPORTED_MODULE_10__["default"], childProps);
  42723. })));
  42724. });
  42725. Tabs.defaultProps = defaultProps;
  42726. Tabs.displayName = 'Tabs';
  42727. /* harmony default export */ __webpack_exports__["default"] = (Tabs);
  42728. /***/ }),
  42729. /***/ "./node_modules/react-bootstrap/esm/ThemeProvider.js":
  42730. /*!***********************************************************!*\
  42731. !*** ./node_modules/react-bootstrap/esm/ThemeProvider.js ***!
  42732. \***********************************************************/
  42733. /*! exports provided: useBootstrapPrefix, createBootstrapComponent, ThemeConsumer, default */
  42734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42735. "use strict";
  42736. __webpack_require__.r(__webpack_exports__);
  42737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useBootstrapPrefix", function() { return useBootstrapPrefix; });
  42738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBootstrapComponent", function() { return createBootstrapComponent; });
  42739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeConsumer", function() { return Consumer; });
  42740. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42741. /* harmony import */ var _restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @restart/context/forwardRef */ "./node_modules/@restart/context/forwardRef.js");
  42742. /* harmony import */ var _restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1__);
  42743. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42744. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  42745. var ThemeContext = react__WEBPACK_IMPORTED_MODULE_2___default.a.createContext({});
  42746. var Consumer = ThemeContext.Consumer,
  42747. Provider = ThemeContext.Provider;
  42748. function ThemeProvider(_ref) {
  42749. var prefixes = _ref.prefixes,
  42750. children = _ref.children;
  42751. var copiedPrefixes = Object(react__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () {
  42752. return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, prefixes);
  42753. }, [prefixes]);
  42754. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Provider, {
  42755. value: copiedPrefixes
  42756. }, children);
  42757. }
  42758. function useBootstrapPrefix(prefix, defaultPrefix) {
  42759. var prefixes = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(ThemeContext);
  42760. return prefix || prefixes[defaultPrefix] || defaultPrefix;
  42761. }
  42762. function createBootstrapComponent(Component, opts) {
  42763. if (typeof opts === 'string') opts = {
  42764. prefix: opts
  42765. };
  42766. var isClassy = Component.prototype && Component.prototype.isReactComponent; // If it's a functional component make sure we don't break it with a ref
  42767. var _opts = opts,
  42768. prefix = _opts.prefix,
  42769. _opts$forwardRefAs = _opts.forwardRefAs,
  42770. forwardRefAs = _opts$forwardRefAs === void 0 ? isClassy ? 'ref' : 'innerRef' : _opts$forwardRefAs;
  42771. return _restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1___default()(function (_ref2, ref) {
  42772. var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _ref2);
  42773. props[forwardRefAs] = ref; // eslint-disable-next-line react/prop-types
  42774. var bsPrefix = useBootstrapPrefix(props.bsPrefix, prefix);
  42775. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42776. bsPrefix: bsPrefix
  42777. }));
  42778. }, {
  42779. displayName: "Bootstrap(" + (Component.displayName || Component.name) + ")"
  42780. });
  42781. }
  42782. /* harmony default export */ __webpack_exports__["default"] = (ThemeProvider);
  42783. /***/ }),
  42784. /***/ "./node_modules/react-bootstrap/esm/Toast.js":
  42785. /*!***************************************************!*\
  42786. !*** ./node_modules/react-bootstrap/esm/Toast.js ***!
  42787. \***************************************************/
  42788. /*! exports provided: default */
  42789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42790. "use strict";
  42791. __webpack_require__.r(__webpack_exports__);
  42792. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42793. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42794. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42795. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  42796. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42797. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  42798. /* harmony import */ var _restart_hooks_useTimeout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useTimeout */ "./node_modules/@restart/hooks/esm/useTimeout.js");
  42799. /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
  42800. /* harmony import */ var _ToastHeader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ToastHeader */ "./node_modules/react-bootstrap/esm/ToastHeader.js");
  42801. /* harmony import */ var _ToastBody__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ToastBody */ "./node_modules/react-bootstrap/esm/ToastBody.js");
  42802. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42803. /* harmony import */ var _ToastContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ToastContext */ "./node_modules/react-bootstrap/esm/ToastContext.js");
  42804. var defaultProps = {
  42805. animation: true,
  42806. autohide: false,
  42807. delay: 3000,
  42808. show: true,
  42809. transition: _Fade__WEBPACK_IMPORTED_MODULE_5__["default"]
  42810. };
  42811. var Toast = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
  42812. var bsPrefix = _ref.bsPrefix,
  42813. className = _ref.className,
  42814. children = _ref.children,
  42815. Transition = _ref.transition,
  42816. show = _ref.show,
  42817. animation = _ref.animation,
  42818. delay = _ref.delay,
  42819. autohide = _ref.autohide,
  42820. onClose = _ref.onClose,
  42821. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "transition", "show", "animation", "delay", "autohide", "onClose"]);
  42822. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_8__["useBootstrapPrefix"])('toast');
  42823. var delayRef = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(delay);
  42824. var onCloseRef = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(onClose);
  42825. Object(react__WEBPACK_IMPORTED_MODULE_2__["useEffect"])(function () {
  42826. // We use refs for these, because we don't want to restart the autohide
  42827. // timer in case these values change.
  42828. delayRef.current = delay;
  42829. onCloseRef.current = onClose;
  42830. }, [delay, onClose]);
  42831. var autohideTimeout = Object(_restart_hooks_useTimeout__WEBPACK_IMPORTED_MODULE_4__["default"])();
  42832. var autohideFunc = Object(react__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () {
  42833. if (!(autohide && show)) {
  42834. return;
  42835. }
  42836. onCloseRef.current();
  42837. }, [autohide, show]);
  42838. autohideTimeout.set(autohideFunc, delayRef.current);
  42839. var useAnimation = Object(react__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () {
  42840. return Transition && animation;
  42841. }, [Transition, animation]);
  42842. var toast = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42843. ref: ref,
  42844. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix, className, !useAnimation && show && 'show'),
  42845. role: "alert",
  42846. "aria-live": "assertive",
  42847. "aria-atomic": "true"
  42848. }), children);
  42849. var toastContext = {
  42850. onClose: onClose
  42851. };
  42852. return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_ToastContext__WEBPACK_IMPORTED_MODULE_9__["default"].Provider, {
  42853. value: toastContext
  42854. }, useAnimation ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Transition, {
  42855. in: show
  42856. }, toast) : toast);
  42857. });
  42858. Toast.defaultProps = defaultProps;
  42859. Toast.displayName = 'Toast';
  42860. Toast.Body = _ToastBody__WEBPACK_IMPORTED_MODULE_7__["default"];
  42861. Toast.Header = _ToastHeader__WEBPACK_IMPORTED_MODULE_6__["default"];
  42862. /* harmony default export */ __webpack_exports__["default"] = (Toast);
  42863. /***/ }),
  42864. /***/ "./node_modules/react-bootstrap/esm/ToastBody.js":
  42865. /*!*******************************************************!*\
  42866. !*** ./node_modules/react-bootstrap/esm/ToastBody.js ***!
  42867. \*******************************************************/
  42868. /*! exports provided: default */
  42869. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42870. "use strict";
  42871. __webpack_require__.r(__webpack_exports__);
  42872. /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
  42873. /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('toast-body'));
  42874. /***/ }),
  42875. /***/ "./node_modules/react-bootstrap/esm/ToastContext.js":
  42876. /*!**********************************************************!*\
  42877. !*** ./node_modules/react-bootstrap/esm/ToastContext.js ***!
  42878. \**********************************************************/
  42879. /*! exports provided: default */
  42880. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42881. "use strict";
  42882. __webpack_require__.r(__webpack_exports__);
  42883. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42884. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  42885. var ToastContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({
  42886. onClose: function onClose() {}
  42887. });
  42888. /* harmony default export */ __webpack_exports__["default"] = (ToastContext);
  42889. /***/ }),
  42890. /***/ "./node_modules/react-bootstrap/esm/ToastHeader.js":
  42891. /*!*********************************************************!*\
  42892. !*** ./node_modules/react-bootstrap/esm/ToastHeader.js ***!
  42893. \*********************************************************/
  42894. /*! exports provided: default */
  42895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42896. "use strict";
  42897. __webpack_require__.r(__webpack_exports__);
  42898. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42899. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42900. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42901. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  42902. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42903. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  42904. /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
  42905. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  42906. /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
  42907. /* harmony import */ var _ToastContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ToastContext */ "./node_modules/react-bootstrap/esm/ToastContext.js");
  42908. var defaultProps = {
  42909. closeLabel: 'Close',
  42910. closeButton: true
  42911. };
  42912. var ToastHeader = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  42913. var bsPrefix = _ref.bsPrefix,
  42914. closeLabel = _ref.closeLabel,
  42915. closeButton = _ref.closeButton,
  42916. className = _ref.className,
  42917. children = _ref.children,
  42918. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "closeLabel", "closeButton", "className", "children"]);
  42919. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'toast-header');
  42920. var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_ToastContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
  42921. var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function () {
  42922. if (context) {
  42923. context.onClose();
  42924. }
  42925. });
  42926. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  42927. ref: ref
  42928. }, props, {
  42929. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(bsPrefix, className)
  42930. }), children, closeButton && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CloseButton__WEBPACK_IMPORTED_MODULE_6__["default"], {
  42931. label: closeLabel,
  42932. onClick: handleClick,
  42933. className: "ml-2 mb-1",
  42934. "data-dismiss": "toast"
  42935. }));
  42936. });
  42937. ToastHeader.displayName = 'ToastHeader';
  42938. ToastHeader.defaultProps = defaultProps;
  42939. /* harmony default export */ __webpack_exports__["default"] = (ToastHeader);
  42940. /***/ }),
  42941. /***/ "./node_modules/react-bootstrap/esm/ToggleButton.js":
  42942. /*!**********************************************************!*\
  42943. !*** ./node_modules/react-bootstrap/esm/ToggleButton.js ***!
  42944. \**********************************************************/
  42945. /*! exports provided: default */
  42946. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42947. "use strict";
  42948. __webpack_require__.r(__webpack_exports__);
  42949. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  42950. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  42951. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  42952. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  42953. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  42954. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  42955. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  42956. /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
  42957. var noop = function noop() {};
  42958. var ToggleButton =
  42959. /*#__PURE__*/
  42960. function (_React$Component) {
  42961. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(ToggleButton, _React$Component);
  42962. function ToggleButton() {
  42963. var _this;
  42964. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  42965. args[_key] = arguments[_key];
  42966. }
  42967. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  42968. _this.state = {
  42969. focused: false
  42970. };
  42971. _this.handleFocus = function (e) {
  42972. if (e.target.tagName === 'INPUT') _this.setState({
  42973. focused: true
  42974. });
  42975. };
  42976. _this.handleBlur = function (e) {
  42977. if (e.target.tagName === 'INPUT') _this.setState({
  42978. focused: false
  42979. });
  42980. };
  42981. return _this;
  42982. }
  42983. var _proto = ToggleButton.prototype;
  42984. _proto.render = function render() {
  42985. var _this$props = this.props,
  42986. children = _this$props.children,
  42987. name = _this$props.name,
  42988. className = _this$props.className,
  42989. checked = _this$props.checked,
  42990. type = _this$props.type,
  42991. onChange = _this$props.onChange,
  42992. value = _this$props.value,
  42993. disabled = _this$props.disabled,
  42994. inputRef = _this$props.inputRef,
  42995. innerRef = _this$props.innerRef,
  42996. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef", "innerRef"]);
  42997. var focused = this.state.focused;
  42998. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Button__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  42999. ref: innerRef,
  43000. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, focused && 'focus', disabled && 'disabled'),
  43001. type: null,
  43002. active: !!checked,
  43003. as: "label"
  43004. }), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("input", {
  43005. name: name,
  43006. type: type,
  43007. value: value,
  43008. ref: inputRef,
  43009. autoComplete: "off",
  43010. checked: !!checked,
  43011. disabled: !!disabled,
  43012. onFocus: this.handleFocus,
  43013. onBlur: this.handleBlur,
  43014. onChange: onChange || noop
  43015. }), children);
  43016. };
  43017. return ToggleButton;
  43018. }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
  43019. /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (props, ref) {
  43020. return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ToggleButton, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  43021. innerRef: ref
  43022. }, props));
  43023. }));
  43024. /***/ }),
  43025. /***/ "./node_modules/react-bootstrap/esm/ToggleButtonGroup.js":
  43026. /*!***************************************************************!*\
  43027. !*** ./node_modules/react-bootstrap/esm/ToggleButtonGroup.js ***!
  43028. \***************************************************************/
  43029. /*! exports provided: default */
  43030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43031. "use strict";
  43032. __webpack_require__.r(__webpack_exports__);
  43033. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  43034. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  43035. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  43036. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  43037. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  43038. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
  43039. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_4__);
  43040. /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
  43041. /* harmony import */ var _utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/createChainedFunction */ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js");
  43042. /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
  43043. /* harmony import */ var _ButtonGroup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ButtonGroup */ "./node_modules/react-bootstrap/esm/ButtonGroup.js");
  43044. /* harmony import */ var _ToggleButton__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ToggleButton */ "./node_modules/react-bootstrap/esm/ToggleButton.js");
  43045. var defaultProps = {
  43046. type: 'radio'
  43047. };
  43048. var ToggleButtonGroup =
  43049. /*#__PURE__*/
  43050. function (_React$Component) {
  43051. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(ToggleButtonGroup, _React$Component);
  43052. function ToggleButtonGroup() {
  43053. return _React$Component.apply(this, arguments) || this;
  43054. }
  43055. var _proto = ToggleButtonGroup.prototype;
  43056. _proto.getValues = function getValues() {
  43057. var value = this.props.value;
  43058. return value == null ? [] : [].concat(value);
  43059. };
  43060. _proto.handleToggle = function handleToggle(value, event) {
  43061. var _this$props = this.props,
  43062. type = _this$props.type,
  43063. onChange = _this$props.onChange;
  43064. var values = this.getValues();
  43065. var isActive = values.indexOf(value) !== -1;
  43066. if (type === 'radio') {
  43067. if (!isActive) onChange(value, event);
  43068. return;
  43069. }
  43070. if (isActive) {
  43071. onChange(values.filter(function (n) {
  43072. return n !== value;
  43073. }), event);
  43074. } else {
  43075. onChange([].concat(values, [value]), event);
  43076. }
  43077. };
  43078. _proto.render = function render() {
  43079. var _this = this;
  43080. var _this$props2 = this.props,
  43081. children = _this$props2.children,
  43082. type = _this$props2.type,
  43083. name = _this$props2.name,
  43084. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["children", "type", "name"]);
  43085. delete props.onChange;
  43086. delete props.value;
  43087. var values = this.getValues();
  43088. !(type !== 'radio' || !!name) ? true ? invariant__WEBPACK_IMPORTED_MODULE_4___default()(false, 'A `name` is required to group the toggle buttons when the `type` ' + 'is set to "radio"') : undefined : void 0;
  43089. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_ButtonGroup__WEBPACK_IMPORTED_MODULE_8__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  43090. toggle: true
  43091. }), Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_7__["map"])(children, function (child) {
  43092. var _child$props = child.props,
  43093. value = _child$props.value,
  43094. onChange = _child$props.onChange;
  43095. var handler = function handler(e) {
  43096. return _this.handleToggle(value, e);
  43097. };
  43098. return react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(child, {
  43099. type: type,
  43100. name: child.name || name,
  43101. checked: values.indexOf(value) !== -1,
  43102. onChange: Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_6__["default"])(onChange, handler)
  43103. });
  43104. }));
  43105. };
  43106. return ToggleButtonGroup;
  43107. }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
  43108. ToggleButtonGroup.defaultProps = defaultProps;
  43109. var UncontrolledToggleButtonGroup = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_5__["uncontrollable"])(ToggleButtonGroup, {
  43110. value: 'onChange'
  43111. });
  43112. UncontrolledToggleButtonGroup.Button = _ToggleButton__WEBPACK_IMPORTED_MODULE_9__["default"];
  43113. /* harmony default export */ __webpack_exports__["default"] = (UncontrolledToggleButtonGroup);
  43114. /***/ }),
  43115. /***/ "./node_modules/react-bootstrap/esm/Tooltip.js":
  43116. /*!*****************************************************!*\
  43117. !*** ./node_modules/react-bootstrap/esm/Tooltip.js ***!
  43118. \*****************************************************/
  43119. /*! exports provided: default */
  43120. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43121. "use strict";
  43122. __webpack_require__.r(__webpack_exports__);
  43123. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  43124. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  43125. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  43126. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  43127. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  43128. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  43129. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
  43130. /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__);
  43131. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  43132. var defaultProps = {
  43133. placement: 'right'
  43134. };
  43135. var Tooltip = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
  43136. var bsPrefix = _ref.bsPrefix,
  43137. placement = _ref.placement,
  43138. className = _ref.className,
  43139. style = _ref.style,
  43140. children = _ref.children,
  43141. arrowProps = _ref.arrowProps,
  43142. _ = _ref.scheduleUpdate,
  43143. _1 = _ref.outOfBoundaries,
  43144. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "placement", "className", "style", "children", "arrowProps", "scheduleUpdate", "outOfBoundaries"]);
  43145. bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'tooltip');
  43146. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  43147. ref: ref,
  43148. style: style,
  43149. role: "tooltip",
  43150. "x-placement": placement,
  43151. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, "bs-tooltip-" + placement)
  43152. }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  43153. className: "arrow"
  43154. }, arrowProps)), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
  43155. className: bsPrefix + "-inner"
  43156. }, children));
  43157. });
  43158. Tooltip.defaultProps = defaultProps;
  43159. Tooltip.displayName = 'Tooltip';
  43160. /* harmony default export */ __webpack_exports__["default"] = (Tooltip);
  43161. /***/ }),
  43162. /***/ "./node_modules/react-bootstrap/esm/index.js":
  43163. /*!***************************************************!*\
  43164. !*** ./node_modules/react-bootstrap/esm/index.js ***!
  43165. \***************************************************/
  43166. /*! exports provided: Accordion, AccordionToggle, useAccordionToggle, AccordionCollapse, Alert, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, ButtonToolbar, Card, CardColumns, CardDeck, CardImg, CardGroup, Carousel, CarouselItem, CloseButton, Col, Collapse, Dropdown, DropdownButton, DropdownItem, Fade, Form, FormControl, FormCheck, Switch, FormGroup, FormLabel, FormText, Container, Image, Figure, InputGroup, Jumbotron, ListGroup, ListGroupItem, Media, Modal, ModalBody, ModalDialog, ModalFooter, ModalTitle, Nav, Navbar, NavbarBrand, NavDropdown, NavItem, Overlay, OverlayTrigger, PageItem, Pagination, Popover, PopoverContent, PopoverTitle, ProgressBar, ResponsiveEmbed, Row, SafeAnchor, Spinner, SplitButton, Tab, TabContainer, TabContent, Table, TabPane, Tabs, ThemeProvider, ToggleButton, ToggleButtonGroup, Tooltip, Toast, ToastBody, ToastHeader */
  43167. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43168. "use strict";
  43169. __webpack_require__.r(__webpack_exports__);
  43170. /* harmony import */ var _Accordion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Accordion */ "./node_modules/react-bootstrap/esm/Accordion.js");
  43171. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _Accordion__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  43172. /* harmony import */ var _AccordionToggle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AccordionToggle */ "./node_modules/react-bootstrap/esm/AccordionToggle.js");
  43173. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionToggle", function() { return _AccordionToggle__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  43174. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useAccordionToggle", function() { return _AccordionToggle__WEBPACK_IMPORTED_MODULE_1__["useAccordionToggle"]; });
  43175. /* harmony import */ var _AccordionCollapse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AccordionCollapse */ "./node_modules/react-bootstrap/esm/AccordionCollapse.js");
  43176. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionCollapse", function() { return _AccordionCollapse__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  43177. /* harmony import */ var _Alert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Alert */ "./node_modules/react-bootstrap/esm/Alert.js");
  43178. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Alert", function() { return _Alert__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  43179. /* harmony import */ var _Badge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Badge */ "./node_modules/react-bootstrap/esm/Badge.js");
  43180. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Badge", function() { return _Badge__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  43181. /* harmony import */ var _Breadcrumb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Breadcrumb */ "./node_modules/react-bootstrap/esm/Breadcrumb.js");
  43182. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumb", function() { return _Breadcrumb__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  43183. /* harmony import */ var _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./BreadcrumbItem */ "./node_modules/react-bootstrap/esm/BreadcrumbItem.js");
  43184. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BreadcrumbItem", function() { return _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  43185. /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
  43186. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return _Button__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  43187. /* harmony import */ var _ButtonGroup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ButtonGroup */ "./node_modules/react-bootstrap/esm/ButtonGroup.js");
  43188. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return _ButtonGroup__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  43189. /* harmony import */ var _ButtonToolbar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ButtonToolbar */ "./node_modules/react-bootstrap/esm/ButtonToolbar.js");
  43190. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonToolbar", function() { return _ButtonToolbar__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  43191. /* harmony import */ var _Card__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Card */ "./node_modules/react-bootstrap/esm/Card.js");
  43192. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Card", function() { return _Card__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  43193. /* harmony import */ var _CardColumns__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./CardColumns */ "./node_modules/react-bootstrap/esm/CardColumns.js");
  43194. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardColumns", function() { return _CardColumns__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  43195. /* harmony import */ var _CardDeck__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CardDeck */ "./node_modules/react-bootstrap/esm/CardDeck.js");
  43196. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardDeck", function() { return _CardDeck__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  43197. /* harmony import */ var _CardImg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./CardImg */ "./node_modules/react-bootstrap/esm/CardImg.js");
  43198. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardImg", function() { return _CardImg__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  43199. /* harmony import */ var _CardGroup__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./CardGroup */ "./node_modules/react-bootstrap/esm/CardGroup.js");
  43200. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardGroup", function() { return _CardGroup__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  43201. /* harmony import */ var _Carousel__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Carousel */ "./node_modules/react-bootstrap/esm/Carousel.js");
  43202. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Carousel", function() { return _Carousel__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  43203. /* harmony import */ var _CarouselItem__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./CarouselItem */ "./node_modules/react-bootstrap/esm/CarouselItem.js");
  43204. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CarouselItem", function() { return _CarouselItem__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  43205. /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
  43206. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CloseButton", function() { return _CloseButton__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  43207. /* harmony import */ var _Col__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Col */ "./node_modules/react-bootstrap/esm/Col.js");
  43208. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Col", function() { return _Col__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  43209. /* harmony import */ var _Collapse__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./Collapse */ "./node_modules/react-bootstrap/esm/Collapse.js");
  43210. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collapse", function() { return _Collapse__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  43211. /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
  43212. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return _Dropdown__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  43213. /* harmony import */ var _DropdownButton__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./DropdownButton */ "./node_modules/react-bootstrap/esm/DropdownButton.js");
  43214. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButton", function() { return _DropdownButton__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  43215. /* harmony import */ var _DropdownItem__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./DropdownItem */ "./node_modules/react-bootstrap/esm/DropdownItem.js");
  43216. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownItem", function() { return _DropdownItem__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  43217. /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
  43218. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fade", function() { return _Fade__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  43219. /* harmony import */ var _Form__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./Form */ "./node_modules/react-bootstrap/esm/Form.js");
  43220. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Form", function() { return _Form__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  43221. /* harmony import */ var _FormControl__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./FormControl */ "./node_modules/react-bootstrap/esm/FormControl.js");
  43222. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormControl", function() { return _FormControl__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  43223. /* harmony import */ var _FormCheck__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./FormCheck */ "./node_modules/react-bootstrap/esm/FormCheck.js");
  43224. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormCheck", function() { return _FormCheck__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  43225. /* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./Switch */ "./node_modules/react-bootstrap/esm/Switch.js");
  43226. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _Switch__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  43227. /* harmony import */ var _FormGroup__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./FormGroup */ "./node_modules/react-bootstrap/esm/FormGroup.js");
  43228. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormGroup", function() { return _FormGroup__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  43229. /* harmony import */ var _FormLabel__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./FormLabel */ "./node_modules/react-bootstrap/esm/FormLabel.js");
  43230. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormLabel", function() { return _FormLabel__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  43231. /* harmony import */ var _FormText__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./FormText */ "./node_modules/react-bootstrap/esm/FormText.js");
  43232. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormText", function() { return _FormText__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  43233. /* harmony import */ var _Container__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Container */ "./node_modules/react-bootstrap/esm/Container.js");
  43234. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Container", function() { return _Container__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  43235. /* harmony import */ var _Image__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./Image */ "./node_modules/react-bootstrap/esm/Image.js");
  43236. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Image", function() { return _Image__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  43237. /* harmony import */ var _Figure__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./Figure */ "./node_modules/react-bootstrap/esm/Figure.js");
  43238. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Figure", function() { return _Figure__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  43239. /* harmony import */ var _InputGroup__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./InputGroup */ "./node_modules/react-bootstrap/esm/InputGroup.js");
  43240. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputGroup", function() { return _InputGroup__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  43241. /* harmony import */ var _Jumbotron__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./Jumbotron */ "./node_modules/react-bootstrap/esm/Jumbotron.js");
  43242. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Jumbotron", function() { return _Jumbotron__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  43243. /* harmony import */ var _ListGroup__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./ListGroup */ "./node_modules/react-bootstrap/esm/ListGroup.js");
  43244. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListGroup", function() { return _ListGroup__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  43245. /* harmony import */ var _ListGroupItem__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./ListGroupItem */ "./node_modules/react-bootstrap/esm/ListGroupItem.js");
  43246. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListGroupItem", function() { return _ListGroupItem__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  43247. /* harmony import */ var _Media__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./Media */ "./node_modules/react-bootstrap/esm/Media.js");
  43248. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Media", function() { return _Media__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  43249. /* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./Modal */ "./node_modules/react-bootstrap/esm/Modal.js");
  43250. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Modal", function() { return _Modal__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  43251. /* harmony import */ var _ModalBody__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./ModalBody */ "./node_modules/react-bootstrap/esm/ModalBody.js");
  43252. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalBody", function() { return _ModalBody__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  43253. /* harmony import */ var _ModalDialog__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./ModalDialog */ "./node_modules/react-bootstrap/esm/ModalDialog.js");
  43254. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalDialog", function() { return _ModalDialog__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  43255. /* harmony import */ var _ModalFooter__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./ModalFooter */ "./node_modules/react-bootstrap/esm/ModalFooter.js");
  43256. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalFooter", function() { return _ModalFooter__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  43257. /* harmony import */ var _ModalTitle__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./ModalTitle */ "./node_modules/react-bootstrap/esm/ModalTitle.js");
  43258. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalTitle", function() { return _ModalTitle__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  43259. /* harmony import */ var _Nav__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./Nav */ "./node_modules/react-bootstrap/esm/Nav.js");
  43260. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Nav", function() { return _Nav__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  43261. /* harmony import */ var _Navbar__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./Navbar */ "./node_modules/react-bootstrap/esm/Navbar.js");
  43262. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Navbar", function() { return _Navbar__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  43263. /* harmony import */ var _NavbarBrand__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./NavbarBrand */ "./node_modules/react-bootstrap/esm/NavbarBrand.js");
  43264. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavbarBrand", function() { return _NavbarBrand__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  43265. /* harmony import */ var _NavDropdown__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./NavDropdown */ "./node_modules/react-bootstrap/esm/NavDropdown.js");
  43266. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavDropdown", function() { return _NavDropdown__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  43267. /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
  43268. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavItem", function() { return _NavItem__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  43269. /* harmony import */ var _Overlay__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./Overlay */ "./node_modules/react-bootstrap/esm/Overlay.js");
  43270. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Overlay", function() { return _Overlay__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  43271. /* harmony import */ var _OverlayTrigger__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./OverlayTrigger */ "./node_modules/react-bootstrap/esm/OverlayTrigger.js");
  43272. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OverlayTrigger", function() { return _OverlayTrigger__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  43273. /* harmony import */ var _PageItem__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./PageItem */ "./node_modules/react-bootstrap/esm/PageItem.js");
  43274. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageItem", function() { return _PageItem__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  43275. /* harmony import */ var _Pagination__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./Pagination */ "./node_modules/react-bootstrap/esm/Pagination.js");
  43276. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Pagination", function() { return _Pagination__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  43277. /* harmony import */ var _Popover__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./Popover */ "./node_modules/react-bootstrap/esm/Popover.js");
  43278. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popover", function() { return _Popover__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  43279. /* harmony import */ var _PopoverContent__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./PopoverContent */ "./node_modules/react-bootstrap/esm/PopoverContent.js");
  43280. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopoverContent", function() { return _PopoverContent__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  43281. /* harmony import */ var _PopoverTitle__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./PopoverTitle */ "./node_modules/react-bootstrap/esm/PopoverTitle.js");
  43282. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopoverTitle", function() { return _PopoverTitle__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  43283. /* harmony import */ var _ProgressBar__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./ProgressBar */ "./node_modules/react-bootstrap/esm/ProgressBar.js");
  43284. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProgressBar", function() { return _ProgressBar__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  43285. /* harmony import */ var _ResponsiveEmbed__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./ResponsiveEmbed */ "./node_modules/react-bootstrap/esm/ResponsiveEmbed.js");
  43286. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveEmbed", function() { return _ResponsiveEmbed__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  43287. /* harmony import */ var _Row__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./Row */ "./node_modules/react-bootstrap/esm/Row.js");
  43288. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Row", function() { return _Row__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  43289. /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
  43290. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SafeAnchor", function() { return _SafeAnchor__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  43291. /* harmony import */ var _Spinner__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./Spinner */ "./node_modules/react-bootstrap/esm/Spinner.js");
  43292. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Spinner", function() { return _Spinner__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  43293. /* harmony import */ var _SplitButton__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./SplitButton */ "./node_modules/react-bootstrap/esm/SplitButton.js");
  43294. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButton", function() { return _SplitButton__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  43295. /* harmony import */ var _Tab__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./Tab */ "./node_modules/react-bootstrap/esm/Tab.js");
  43296. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tab", function() { return _Tab__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  43297. /* harmony import */ var _TabContainer__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./TabContainer */ "./node_modules/react-bootstrap/esm/TabContainer.js");
  43298. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabContainer", function() { return _TabContainer__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  43299. /* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./TabContent */ "./node_modules/react-bootstrap/esm/TabContent.js");
  43300. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabContent", function() { return _TabContent__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  43301. /* harmony import */ var _Table__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./Table */ "./node_modules/react-bootstrap/esm/Table.js");
  43302. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Table", function() { return _Table__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  43303. /* harmony import */ var _TabPane__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./TabPane */ "./node_modules/react-bootstrap/esm/TabPane.js");
  43304. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabPane", function() { return _TabPane__WEBPACK_IMPORTED_MODULE_66__["default"]; });
  43305. /* harmony import */ var _Tabs__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./Tabs */ "./node_modules/react-bootstrap/esm/Tabs.js");
  43306. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return _Tabs__WEBPACK_IMPORTED_MODULE_67__["default"]; });
  43307. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  43308. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ThemeProvider", function() { return _ThemeProvider__WEBPACK_IMPORTED_MODULE_68__["default"]; });
  43309. /* harmony import */ var _ToggleButton__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./ToggleButton */ "./node_modules/react-bootstrap/esm/ToggleButton.js");
  43310. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToggleButton", function() { return _ToggleButton__WEBPACK_IMPORTED_MODULE_69__["default"]; });
  43311. /* harmony import */ var _ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./ToggleButtonGroup */ "./node_modules/react-bootstrap/esm/ToggleButtonGroup.js");
  43312. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToggleButtonGroup", function() { return _ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_70__["default"]; });
  43313. /* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./Tooltip */ "./node_modules/react-bootstrap/esm/Tooltip.js");
  43314. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _Tooltip__WEBPACK_IMPORTED_MODULE_71__["default"]; });
  43315. /* harmony import */ var _Toast__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./Toast */ "./node_modules/react-bootstrap/esm/Toast.js");
  43316. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toast", function() { return _Toast__WEBPACK_IMPORTED_MODULE_72__["default"]; });
  43317. /* harmony import */ var _ToastBody__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./ToastBody */ "./node_modules/react-bootstrap/esm/ToastBody.js");
  43318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToastBody", function() { return _ToastBody__WEBPACK_IMPORTED_MODULE_73__["default"]; });
  43319. /* harmony import */ var _ToastHeader__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./ToastHeader */ "./node_modules/react-bootstrap/esm/ToastHeader.js");
  43320. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToastHeader", function() { return _ToastHeader__WEBPACK_IMPORTED_MODULE_74__["default"]; });
  43321. /***/ }),
  43322. /***/ "./node_modules/react-bootstrap/esm/utils/BootstrapModalManager.js":
  43323. /*!*************************************************************************!*\
  43324. !*** ./node_modules/react-bootstrap/esm/utils/BootstrapModalManager.js ***!
  43325. \*************************************************************************/
  43326. /*! exports provided: default */
  43327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43328. "use strict";
  43329. __webpack_require__.r(__webpack_exports__);
  43330. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BootstrapModalManager; });
  43331. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  43332. /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dom-helpers/query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js");
  43333. /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1__);
  43334. /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js");
  43335. /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_style__WEBPACK_IMPORTED_MODULE_2__);
  43336. /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js");
  43337. /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3__);
  43338. /* harmony import */ var react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-overlays/ModalManager */ "./node_modules/react-overlays/ModalManager.js");
  43339. /* harmony import */ var react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4__);
  43340. var Selector = {
  43341. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  43342. STICKY_CONTENT: '.sticky-top',
  43343. NAVBAR_TOGGLER: '.navbar-toggler'
  43344. };
  43345. var BootstrapModalManager =
  43346. /*#__PURE__*/
  43347. function (_ModalManager) {
  43348. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BootstrapModalManager, _ModalManager);
  43349. function BootstrapModalManager() {
  43350. var _this;
  43351. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  43352. args[_key] = arguments[_key];
  43353. }
  43354. _this = _ModalManager.call.apply(_ModalManager, [this].concat(args)) || this;
  43355. _this.adjustAndStore = function (prop, element, adjust) {
  43356. var actual = element.style[prop];
  43357. element.dataset[prop] = actual;
  43358. dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default()(element, prop, parseFloat(dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default()(element, prop)) + adjust + "px");
  43359. };
  43360. _this.restore = function (prop, element) {
  43361. var value = element.dataset[prop];
  43362. if (value !== undefined) {
  43363. delete element.dataset[prop];
  43364. dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default()(element, prop, value);
  43365. }
  43366. };
  43367. return _this;
  43368. }
  43369. var _proto = BootstrapModalManager.prototype;
  43370. _proto.setContainerStyle = function setContainerStyle(containerState, container) {
  43371. var _this2 = this;
  43372. _ModalManager.prototype.setContainerStyle.call(this, containerState, container);
  43373. if (!containerState.overflowing) return;
  43374. var size = dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3___default()();
  43375. dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.FIXED_CONTENT).forEach(function (el) {
  43376. return _this2.adjustAndStore('paddingRight', el, size);
  43377. });
  43378. dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.STICKY_CONTENT).forEach(function (el) {
  43379. return _this2.adjustAndStore('margingRight', el, -size);
  43380. });
  43381. dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.NAVBAR_TOGGLER).forEach(function (el) {
  43382. return _this2.adjustAndStore('margingRight', el, size);
  43383. });
  43384. };
  43385. _proto.removeContainerStyle = function removeContainerStyle(containerState, container) {
  43386. var _this3 = this;
  43387. _ModalManager.prototype.removeContainerStyle.call(this, containerState, container);
  43388. dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.FIXED_CONTENT).forEach(function (el) {
  43389. return _this3.restore('paddingRight', el);
  43390. });
  43391. dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.STICKY_CONTENT).forEach(function (el) {
  43392. return _this3.restore('margingRight', el);
  43393. });
  43394. dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.NAVBAR_TOGGLER).forEach(function (el) {
  43395. return _this3.restore('margingRight', el);
  43396. });
  43397. };
  43398. return BootstrapModalManager;
  43399. }(react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4___default.a);
  43400. /***/ }),
  43401. /***/ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js":
  43402. /*!*******************************************************************!*\
  43403. !*** ./node_modules/react-bootstrap/esm/utils/ElementChildren.js ***!
  43404. \*******************************************************************/
  43405. /*! exports provided: map, forEach */
  43406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43407. "use strict";
  43408. __webpack_require__.r(__webpack_exports__);
  43409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
  43410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  43411. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  43412. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  43413. /**
  43414. * Iterates through children that are typically specified as `props.children`,
  43415. * but only maps over children that are "valid elements".
  43416. *
  43417. * The mapFunction provided index will be normalised to the components mapped,
  43418. * so an invalid component would not increase the index.
  43419. *
  43420. */
  43421. function map(children, func) {
  43422. var index = 0;
  43423. return react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.map(children, function (child) {
  43424. return react__WEBPACK_IMPORTED_MODULE_0___default.a.isValidElement(child) ? func(child, index++) : child;
  43425. });
  43426. }
  43427. /**
  43428. * Iterates through children that are "valid elements".
  43429. *
  43430. * The provided forEachFunc(child, index) will be called for each
  43431. * leaf child with the index reflecting the position relative to "valid components".
  43432. */
  43433. function forEach(children, func) {
  43434. var index = 0;
  43435. react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.forEach(children, function (child) {
  43436. if (react__WEBPACK_IMPORTED_MODULE_0___default.a.isValidElement(child)) func(child, index++);
  43437. });
  43438. }
  43439. /***/ }),
  43440. /***/ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js":
  43441. /*!*************************************************************************!*\
  43442. !*** ./node_modules/react-bootstrap/esm/utils/createChainedFunction.js ***!
  43443. \*************************************************************************/
  43444. /*! exports provided: default */
  43445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43446. "use strict";
  43447. __webpack_require__.r(__webpack_exports__);
  43448. /**
  43449. * Safe chained function
  43450. *
  43451. * Will only create a new function if needed,
  43452. * otherwise will pass back existing functions or null.
  43453. *
  43454. * @param {function} functions to chain
  43455. * @returns {function|null}
  43456. */
  43457. function createChainedFunction() {
  43458. for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
  43459. funcs[_key] = arguments[_key];
  43460. }
  43461. return funcs.filter(function (f) {
  43462. return f != null;
  43463. }).reduce(function (acc, f) {
  43464. if (typeof f !== 'function') {
  43465. throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
  43466. }
  43467. if (acc === null) return f;
  43468. return function chainedFunction() {
  43469. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  43470. args[_key2] = arguments[_key2];
  43471. }
  43472. acc.apply(this, args);
  43473. f.apply(this, args);
  43474. };
  43475. }, null);
  43476. }
  43477. /* harmony default export */ __webpack_exports__["default"] = (createChainedFunction);
  43478. /***/ }),
  43479. /***/ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js":
  43480. /*!**********************************************************************!*\
  43481. !*** ./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js ***!
  43482. \**********************************************************************/
  43483. /*! exports provided: default */
  43484. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43485. "use strict";
  43486. __webpack_require__.r(__webpack_exports__);
  43487. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createWithBsPrefix; });
  43488. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  43489. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  43490. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  43491. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  43492. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  43493. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  43494. /* harmony import */ var dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/util/camelize */ "./node_modules/dom-helpers/util/camelize.js");
  43495. /* harmony import */ var dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4__);
  43496. /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
  43497. var pascalCase = function pascalCase(str) {
  43498. return str[0].toUpperCase() + dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4___default()(str).slice(1);
  43499. };
  43500. function createWithBsPrefix(prefix, _temp) {
  43501. var _ref = _temp === void 0 ? {} : _temp,
  43502. _ref$displayName = _ref.displayName,
  43503. displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,
  43504. _ref$Component = _ref.Component,
  43505. Component = _ref$Component === void 0 ? 'div' : _ref$Component,
  43506. defaultProps = _ref.defaultProps;
  43507. var BsComponent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // eslint-disable-next-line react/prop-types
  43508. function (_ref2, ref) {
  43509. var className = _ref2.className,
  43510. bsPrefix = _ref2.bsPrefix,
  43511. _ref2$as = _ref2.as,
  43512. Tag = _ref2$as === void 0 ? Component : _ref2$as,
  43513. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["className", "bsPrefix", "as"]);
  43514. var resolvedPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, prefix);
  43515. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Tag, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  43516. ref: ref,
  43517. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, resolvedPrefix)
  43518. }, props));
  43519. });
  43520. BsComponent.defaultProps = defaultProps;
  43521. BsComponent.displayName = displayName;
  43522. return BsComponent;
  43523. }
  43524. /***/ }),
  43525. /***/ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js":
  43526. /*!********************************************************************!*\
  43527. !*** ./node_modules/react-bootstrap/esm/utils/divWithClassName.js ***!
  43528. \********************************************************************/
  43529. /*! exports provided: default */
  43530. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43531. "use strict";
  43532. __webpack_require__.r(__webpack_exports__);
  43533. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  43534. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  43535. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  43536. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
  43537. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  43538. /* harmony default export */ __webpack_exports__["default"] = (function (className) {
  43539. return react__WEBPACK_IMPORTED_MODULE_1___default.a.forwardRef(function (p, ref) {
  43540. return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, p, {
  43541. ref: ref,
  43542. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(p.className, className)
  43543. }));
  43544. });
  43545. });
  43546. /***/ }),
  43547. /***/ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js":
  43548. /*!************************************************************************!*\
  43549. !*** ./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js ***!
  43550. \************************************************************************/
  43551. /*! exports provided: default */
  43552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43553. "use strict";
  43554. __webpack_require__.r(__webpack_exports__);
  43555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return triggerBrowserReflow; });
  43556. // reading a dimension prop will cause the browser to recalculate,
  43557. // which will let our animations work
  43558. function triggerBrowserReflow(node) {
  43559. node.offsetHeight; // eslint-disable-line no-unused-expressions
  43560. }
  43561. /***/ }),
  43562. /***/ "./node_modules/react-context-toolbox/forwardRef.js":
  43563. /*!**********************************************************!*\
  43564. !*** ./node_modules/react-context-toolbox/forwardRef.js ***!
  43565. \**********************************************************/
  43566. /*! no static exports found */
  43567. /***/ (function(module, exports, __webpack_require__) {
  43568. "use strict";
  43569. exports.__esModule = true;
  43570. exports.default = forwardRef;
  43571. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  43572. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  43573. function forwardRef(renderFn, _ref) {
  43574. var displayName = _ref.displayName,
  43575. propTypes = _ref.propTypes,
  43576. defaultProps = _ref.defaultProps,
  43577. _ref$allowFallback = _ref.allowFallback,
  43578. allowFallback = _ref$allowFallback === void 0 ? false : _ref$allowFallback;
  43579. var render = function render(props, ref) {
  43580. return renderFn(props, ref);
  43581. };
  43582. Object.assign(render, {
  43583. displayName: displayName
  43584. });
  43585. if (_react.default.forwardRef || !allowFallback) return Object.assign(_react.default.forwardRef(render), {
  43586. propTypes: propTypes,
  43587. defaultProps: defaultProps
  43588. });
  43589. return Object.assign(function (props) {
  43590. return render(props, null);
  43591. }, {
  43592. displayName: displayName,
  43593. propTypes: propTypes,
  43594. defaultProps: defaultProps
  43595. });
  43596. }
  43597. /***/ }),
  43598. /***/ "./node_modules/react-context-toolbox/mapContextToProps.js":
  43599. /*!*****************************************************************!*\
  43600. !*** ./node_modules/react-context-toolbox/mapContextToProps.js ***!
  43601. \*****************************************************************/
  43602. /*! no static exports found */
  43603. /***/ (function(module, exports, __webpack_require__) {
  43604. "use strict";
  43605. exports.__esModule = true;
  43606. exports.default = mapContextToProps;
  43607. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  43608. var _forwardRef = _interopRequireDefault(__webpack_require__(/*! ./forwardRef */ "./node_modules/react-context-toolbox/forwardRef.js"));
  43609. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  43610. function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  43611. var getDisplayName = function getDisplayName(Component) {
  43612. var name = typeof Component === 'string' ? Component : Component.name || Component.displayName;
  43613. return name ? "ContextTransform(" + name + ")" : 'ContextTransform';
  43614. };
  43615. var ensureConsumer = function ensureConsumer(c) {
  43616. return c.Consumer || c;
  43617. };
  43618. function $mapContextToProps(_ref, Component) {
  43619. var maybeArrayOfConsumers = _ref.consumers,
  43620. mapToProps = _ref.mapToProps,
  43621. displayName = _ref.displayName,
  43622. _ref$forwardRefAs = _ref.forwardRefAs,
  43623. forwardRefAs = _ref$forwardRefAs === void 0 ? 'ref' : _ref$forwardRefAs;
  43624. var consumers = maybeArrayOfConsumers;
  43625. if (!Array.isArray(maybeArrayOfConsumers)) {
  43626. consumers = [maybeArrayOfConsumers];
  43627. }
  43628. var SingleConsumer = ensureConsumer(consumers[0]);
  43629. function singleRender(props, ref) {
  43630. var _extends2;
  43631. var propsWithRef = _extends((_extends2 = {}, _extends2[forwardRefAs] = ref, _extends2), props);
  43632. return _react.default.createElement(SingleConsumer, null, function (value) {
  43633. return _react.default.createElement(Component, _extends({}, propsWithRef, mapToProps(value, props)));
  43634. });
  43635. }
  43636. function multiRender(props, ref) {
  43637. var _extends3;
  43638. var propsWithRef = _extends((_extends3 = {}, _extends3[forwardRefAs] = ref, _extends3), props);
  43639. return consumers.reduceRight(function (inner, Context) {
  43640. return function () {
  43641. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  43642. args[_key] = arguments[_key];
  43643. }
  43644. var Consumer = ensureConsumer(Context);
  43645. return _react.default.createElement(Consumer, null, function (value) {
  43646. return inner.apply(void 0, args.concat([value]));
  43647. });
  43648. };
  43649. }, function () {
  43650. for (var _len2 = arguments.length, contexts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  43651. contexts[_key2] = arguments[_key2];
  43652. }
  43653. return _react.default.createElement(Component, _extends({}, propsWithRef, mapToProps.apply(void 0, contexts.concat([props]))));
  43654. })();
  43655. }
  43656. var contextTransform = consumers.length === 1 ? singleRender : multiRender;
  43657. return (0, _forwardRef.default)(contextTransform, {
  43658. displayName: displayName || getDisplayName(Component)
  43659. });
  43660. }
  43661. function mapContextToProps(maybeOpts, mapToProps, Component) {
  43662. if (arguments.length === 2) return $mapContextToProps(maybeOpts, mapToProps);
  43663. return $mapContextToProps({
  43664. consumers: maybeOpts,
  43665. mapToProps: mapToProps
  43666. }, Component);
  43667. }
  43668. /***/ }),
  43669. /***/ "./node_modules/react-dom/cjs/react-dom.development.js":
  43670. /*!*************************************************************!*\
  43671. !*** ./node_modules/react-dom/cjs/react-dom.development.js ***!
  43672. \*************************************************************/
  43673. /*! no static exports found */
  43674. /***/ (function(module, exports, __webpack_require__) {
  43675. "use strict";
  43676. /** @license React v16.12.0
  43677. * react-dom.development.js
  43678. *
  43679. * Copyright (c) Facebook, Inc. and its affiliates.
  43680. *
  43681. * This source code is licensed under the MIT license found in the
  43682. * LICENSE file in the root directory of this source tree.
  43683. */
  43684. if (true) {
  43685. (function() {
  43686. 'use strict';
  43687. var React = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  43688. var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
  43689. var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js");
  43690. var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
  43691. var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/scheduler/tracing.js");
  43692. // Do not require this module directly! Use normal `invariant` calls with
  43693. // template literal strings. The messages will be replaced with error codes
  43694. // during build.
  43695. /**
  43696. * Use invariant() to assert state which your program assumes to be true.
  43697. *
  43698. * Provide sprintf-style format (only %s is supported) and arguments
  43699. * to provide information about what broke and what you were
  43700. * expecting.
  43701. *
  43702. * The invariant message will be stripped in production, but the invariant
  43703. * will remain to ensure logic does not differ in production.
  43704. */
  43705. if (!React) {
  43706. {
  43707. throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
  43708. }
  43709. }
  43710. /**
  43711. * Injectable ordering of event plugins.
  43712. */
  43713. var eventPluginOrder = null;
  43714. /**
  43715. * Injectable mapping from names to event plugin modules.
  43716. */
  43717. var namesToPlugins = {};
  43718. /**
  43719. * Recomputes the plugin list using the injected plugins and plugin ordering.
  43720. *
  43721. * @private
  43722. */
  43723. function recomputePluginOrdering() {
  43724. if (!eventPluginOrder) {
  43725. // Wait until an `eventPluginOrder` is injected.
  43726. return;
  43727. }
  43728. for (var pluginName in namesToPlugins) {
  43729. var pluginModule = namesToPlugins[pluginName];
  43730. var pluginIndex = eventPluginOrder.indexOf(pluginName);
  43731. if (!(pluginIndex > -1)) {
  43732. {
  43733. throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`.");
  43734. }
  43735. }
  43736. if (plugins[pluginIndex]) {
  43737. continue;
  43738. }
  43739. if (!pluginModule.extractEvents) {
  43740. {
  43741. throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not.");
  43742. }
  43743. }
  43744. plugins[pluginIndex] = pluginModule;
  43745. var publishedEvents = pluginModule.eventTypes;
  43746. for (var eventName in publishedEvents) {
  43747. if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
  43748. {
  43749. throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`.");
  43750. }
  43751. }
  43752. }
  43753. }
  43754. }
  43755. /**
  43756. * Publishes an event so that it can be dispatched by the supplied plugin.
  43757. *
  43758. * @param {object} dispatchConfig Dispatch configuration for the event.
  43759. * @param {object} PluginModule Plugin publishing the event.
  43760. * @return {boolean} True if the event was successfully published.
  43761. * @private
  43762. */
  43763. function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
  43764. if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {
  43765. {
  43766. throw Error("EventPluginHub: More than one plugin attempted to publish the same event name, `" + eventName + "`.");
  43767. }
  43768. }
  43769. eventNameDispatchConfigs[eventName] = dispatchConfig;
  43770. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  43771. if (phasedRegistrationNames) {
  43772. for (var phaseName in phasedRegistrationNames) {
  43773. if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
  43774. var phasedRegistrationName = phasedRegistrationNames[phaseName];
  43775. publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
  43776. }
  43777. }
  43778. return true;
  43779. } else if (dispatchConfig.registrationName) {
  43780. publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
  43781. return true;
  43782. }
  43783. return false;
  43784. }
  43785. /**
  43786. * Publishes a registration name that is used to identify dispatched events.
  43787. *
  43788. * @param {string} registrationName Registration name to add.
  43789. * @param {object} PluginModule Plugin publishing the event.
  43790. * @private
  43791. */
  43792. function publishRegistrationName(registrationName, pluginModule, eventName) {
  43793. if (!!registrationNameModules[registrationName]) {
  43794. {
  43795. throw Error("EventPluginHub: More than one plugin attempted to publish the same registration name, `" + registrationName + "`.");
  43796. }
  43797. }
  43798. registrationNameModules[registrationName] = pluginModule;
  43799. registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
  43800. {
  43801. var lowerCasedName = registrationName.toLowerCase();
  43802. possibleRegistrationNames[lowerCasedName] = registrationName;
  43803. if (registrationName === 'onDoubleClick') {
  43804. possibleRegistrationNames.ondblclick = registrationName;
  43805. }
  43806. }
  43807. }
  43808. /**
  43809. * Registers plugins so that they can extract and dispatch events.
  43810. *
  43811. * @see {EventPluginHub}
  43812. */
  43813. /**
  43814. * Ordered list of injected plugins.
  43815. */
  43816. var plugins = [];
  43817. /**
  43818. * Mapping from event name to dispatch config
  43819. */
  43820. var eventNameDispatchConfigs = {};
  43821. /**
  43822. * Mapping from registration name to plugin module
  43823. */
  43824. var registrationNameModules = {};
  43825. /**
  43826. * Mapping from registration name to event name
  43827. */
  43828. var registrationNameDependencies = {};
  43829. /**
  43830. * Mapping from lowercase registration names to the properly cased version,
  43831. * used to warn in the case of missing event handlers. Available
  43832. * only in true.
  43833. * @type {Object}
  43834. */
  43835. var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true
  43836. /**
  43837. * Injects an ordering of plugins (by plugin name). This allows the ordering
  43838. * to be decoupled from injection of the actual plugins so that ordering is
  43839. * always deterministic regardless of packaging, on-the-fly injection, etc.
  43840. *
  43841. * @param {array} InjectedEventPluginOrder
  43842. * @internal
  43843. * @see {EventPluginHub.injection.injectEventPluginOrder}
  43844. */
  43845. function injectEventPluginOrder(injectedEventPluginOrder) {
  43846. if (!!eventPluginOrder) {
  43847. {
  43848. throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.");
  43849. }
  43850. } // Clone the ordering so it cannot be dynamically mutated.
  43851. eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
  43852. recomputePluginOrdering();
  43853. }
  43854. /**
  43855. * Injects plugins to be used by `EventPluginHub`. The plugin names must be
  43856. * in the ordering injected by `injectEventPluginOrder`.
  43857. *
  43858. * Plugins can be injected as part of page initialization or on-the-fly.
  43859. *
  43860. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  43861. * @internal
  43862. * @see {EventPluginHub.injection.injectEventPluginsByName}
  43863. */
  43864. function injectEventPluginsByName(injectedNamesToPlugins) {
  43865. var isOrderingDirty = false;
  43866. for (var pluginName in injectedNamesToPlugins) {
  43867. if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
  43868. continue;
  43869. }
  43870. var pluginModule = injectedNamesToPlugins[pluginName];
  43871. if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
  43872. if (!!namesToPlugins[pluginName]) {
  43873. {
  43874. throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`.");
  43875. }
  43876. }
  43877. namesToPlugins[pluginName] = pluginModule;
  43878. isOrderingDirty = true;
  43879. }
  43880. }
  43881. if (isOrderingDirty) {
  43882. recomputePluginOrdering();
  43883. }
  43884. }
  43885. var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
  43886. var funcArgs = Array.prototype.slice.call(arguments, 3);
  43887. try {
  43888. func.apply(context, funcArgs);
  43889. } catch (error) {
  43890. this.onError(error);
  43891. }
  43892. };
  43893. {
  43894. // In DEV mode, we swap out invokeGuardedCallback for a special version
  43895. // that plays more nicely with the browser's DevTools. The idea is to preserve
  43896. // "Pause on exceptions" behavior. Because React wraps all user-provided
  43897. // functions in invokeGuardedCallback, and the production version of
  43898. // invokeGuardedCallback uses a try-catch, all user exceptions are treated
  43899. // like caught exceptions, and the DevTools won't pause unless the developer
  43900. // takes the extra step of enabling pause on caught exceptions. This is
  43901. // unintuitive, though, because even though React has caught the error, from
  43902. // the developer's perspective, the error is uncaught.
  43903. //
  43904. // To preserve the expected "Pause on exceptions" behavior, we don't use a
  43905. // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
  43906. // DOM node, and call the user-provided callback from inside an event handler
  43907. // for that fake event. If the callback throws, the error is "captured" using
  43908. // a global event handler. But because the error happens in a different
  43909. // event loop context, it does not interrupt the normal program flow.
  43910. // Effectively, this gives us try-catch behavior without actually using
  43911. // try-catch. Neat!
  43912. // Check that the browser supports the APIs we need to implement our special
  43913. // DEV version of invokeGuardedCallback
  43914. if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
  43915. var fakeNode = document.createElement('react');
  43916. var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
  43917. // If document doesn't exist we know for sure we will crash in this method
  43918. // when we call document.createEvent(). However this can cause confusing
  43919. // errors: https://github.com/facebookincubator/create-react-app/issues/3482
  43920. // So we preemptively throw with a better message instead.
  43921. if (!(typeof document !== 'undefined')) {
  43922. {
  43923. throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
  43924. }
  43925. }
  43926. var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We
  43927. // set this to true at the beginning, then set it to false right after
  43928. // calling the function. If the function errors, `didError` will never be
  43929. // set to false. This strategy works even if the browser is flaky and
  43930. // fails to call our global error handler, because it doesn't rely on
  43931. // the error event at all.
  43932. var didError = true; // Keeps track of the value of window.event so that we can reset it
  43933. // during the callback to let user code access window.event in the
  43934. // browsers that support it.
  43935. var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event
  43936. // dispatching: https://github.com/facebook/react/issues/13688
  43937. var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously
  43938. // dispatch our fake event using `dispatchEvent`. Inside the handler, we
  43939. // call the user-provided callback.
  43940. var funcArgs = Array.prototype.slice.call(arguments, 3);
  43941. function callCallback() {
  43942. // We immediately remove the callback from event listeners so that
  43943. // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
  43944. // nested call would trigger the fake event handlers of any call higher
  43945. // in the stack.
  43946. fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the
  43947. // window.event assignment in both IE <= 10 as they throw an error
  43948. // "Member not found" in strict mode, and in Firefox which does not
  43949. // support window.event.
  43950. if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
  43951. window.event = windowEvent;
  43952. }
  43953. func.apply(context, funcArgs);
  43954. didError = false;
  43955. } // Create a global error event handler. We use this to capture the value
  43956. // that was thrown. It's possible that this error handler will fire more
  43957. // than once; for example, if non-React code also calls `dispatchEvent`
  43958. // and a handler for that event throws. We should be resilient to most of
  43959. // those cases. Even if our error event handler fires more than once, the
  43960. // last error event is always used. If the callback actually does error,
  43961. // we know that the last error event is the correct one, because it's not
  43962. // possible for anything else to have happened in between our callback
  43963. // erroring and the code that follows the `dispatchEvent` call below. If
  43964. // the callback doesn't error, but the error event was fired, we know to
  43965. // ignore it because `didError` will be false, as described above.
  43966. var error; // Use this to track whether the error event is ever called.
  43967. var didSetError = false;
  43968. var isCrossOriginError = false;
  43969. function handleWindowError(event) {
  43970. error = event.error;
  43971. didSetError = true;
  43972. if (error === null && event.colno === 0 && event.lineno === 0) {
  43973. isCrossOriginError = true;
  43974. }
  43975. if (event.defaultPrevented) {
  43976. // Some other error handler has prevented default.
  43977. // Browsers silence the error report if this happens.
  43978. // We'll remember this to later decide whether to log it or not.
  43979. if (error != null && typeof error === 'object') {
  43980. try {
  43981. error._suppressLogging = true;
  43982. } catch (inner) {// Ignore.
  43983. }
  43984. }
  43985. }
  43986. } // Create a fake event type.
  43987. var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers
  43988. window.addEventListener('error', handleWindowError);
  43989. fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function
  43990. // errors, it will trigger our global error handler.
  43991. evt.initEvent(evtType, false, false);
  43992. fakeNode.dispatchEvent(evt);
  43993. if (windowEventDescriptor) {
  43994. Object.defineProperty(window, 'event', windowEventDescriptor);
  43995. }
  43996. if (didError) {
  43997. if (!didSetError) {
  43998. // The callback errored, but the error event never fired.
  43999. error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
  44000. } else if (isCrossOriginError) {
  44001. error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
  44002. }
  44003. this.onError(error);
  44004. } // Remove our event listeners
  44005. window.removeEventListener('error', handleWindowError);
  44006. };
  44007. invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
  44008. }
  44009. }
  44010. var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
  44011. var hasError = false;
  44012. var caughtError = null; // Used by event system to capture/rethrow the first error.
  44013. var hasRethrowError = false;
  44014. var rethrowError = null;
  44015. var reporter = {
  44016. onError: function (error) {
  44017. hasError = true;
  44018. caughtError = error;
  44019. }
  44020. };
  44021. /**
  44022. * Call a function while guarding against errors that happens within it.
  44023. * Returns an error if it throws, otherwise null.
  44024. *
  44025. * In production, this is implemented using a try-catch. The reason we don't
  44026. * use a try-catch directly is so that we can swap out a different
  44027. * implementation in DEV mode.
  44028. *
  44029. * @param {String} name of the guard to use for logging or debugging
  44030. * @param {Function} func The function to invoke
  44031. * @param {*} context The context to use when calling the function
  44032. * @param {...*} args Arguments for function
  44033. */
  44034. function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  44035. hasError = false;
  44036. caughtError = null;
  44037. invokeGuardedCallbackImpl$1.apply(reporter, arguments);
  44038. }
  44039. /**
  44040. * Same as invokeGuardedCallback, but instead of returning an error, it stores
  44041. * it in a global so it can be rethrown by `rethrowCaughtError` later.
  44042. * TODO: See if caughtError and rethrowError can be unified.
  44043. *
  44044. * @param {String} name of the guard to use for logging or debugging
  44045. * @param {Function} func The function to invoke
  44046. * @param {*} context The context to use when calling the function
  44047. * @param {...*} args Arguments for function
  44048. */
  44049. function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
  44050. invokeGuardedCallback.apply(this, arguments);
  44051. if (hasError) {
  44052. var error = clearCaughtError();
  44053. if (!hasRethrowError) {
  44054. hasRethrowError = true;
  44055. rethrowError = error;
  44056. }
  44057. }
  44058. }
  44059. /**
  44060. * During execution of guarded functions we will capture the first error which
  44061. * we will rethrow to be handled by the top level error handler.
  44062. */
  44063. function rethrowCaughtError() {
  44064. if (hasRethrowError) {
  44065. var error = rethrowError;
  44066. hasRethrowError = false;
  44067. rethrowError = null;
  44068. throw error;
  44069. }
  44070. }
  44071. function hasCaughtError() {
  44072. return hasError;
  44073. }
  44074. function clearCaughtError() {
  44075. if (hasError) {
  44076. var error = caughtError;
  44077. hasError = false;
  44078. caughtError = null;
  44079. return error;
  44080. } else {
  44081. {
  44082. {
  44083. throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
  44084. }
  44085. }
  44086. }
  44087. }
  44088. /**
  44089. * Similar to invariant but only logs a warning if the condition is not met.
  44090. * This can be used to log issues in development environments in critical
  44091. * paths. Removing the logging code for production environments will keep the
  44092. * same logic and follow the same code paths.
  44093. */
  44094. var warningWithoutStack = function () {};
  44095. {
  44096. warningWithoutStack = function (condition, format) {
  44097. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  44098. args[_key - 2] = arguments[_key];
  44099. }
  44100. if (format === undefined) {
  44101. throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  44102. }
  44103. if (args.length > 8) {
  44104. // Check before the condition to catch violations early.
  44105. throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
  44106. }
  44107. if (condition) {
  44108. return;
  44109. }
  44110. if (typeof console !== 'undefined') {
  44111. var argsWithFormat = args.map(function (item) {
  44112. return '' + item;
  44113. });
  44114. argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
  44115. // breaks IE9: https://github.com/facebook/react/issues/13610
  44116. Function.prototype.apply.call(console.error, console, argsWithFormat);
  44117. }
  44118. try {
  44119. // --- Welcome to debugging React ---
  44120. // This error was thrown as a convenience so that you can use this stack
  44121. // to find the callsite that caused this warning to fire.
  44122. var argIndex = 0;
  44123. var message = 'Warning: ' + format.replace(/%s/g, function () {
  44124. return args[argIndex++];
  44125. });
  44126. throw new Error(message);
  44127. } catch (x) {}
  44128. };
  44129. }
  44130. var warningWithoutStack$1 = warningWithoutStack;
  44131. var getFiberCurrentPropsFromNode = null;
  44132. var getInstanceFromNode = null;
  44133. var getNodeFromInstance = null;
  44134. function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
  44135. getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
  44136. getInstanceFromNode = getInstanceFromNodeImpl;
  44137. getNodeFromInstance = getNodeFromInstanceImpl;
  44138. {
  44139. !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
  44140. }
  44141. }
  44142. var validateEventDispatches;
  44143. {
  44144. validateEventDispatches = function (event) {
  44145. var dispatchListeners = event._dispatchListeners;
  44146. var dispatchInstances = event._dispatchInstances;
  44147. var listenersIsArr = Array.isArray(dispatchListeners);
  44148. var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
  44149. var instancesIsArr = Array.isArray(dispatchInstances);
  44150. var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
  44151. !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
  44152. };
  44153. }
  44154. /**
  44155. * Dispatch the event to the listener.
  44156. * @param {SyntheticEvent} event SyntheticEvent to handle
  44157. * @param {function} listener Application-level callback
  44158. * @param {*} inst Internal component instance
  44159. */
  44160. function executeDispatch(event, listener, inst) {
  44161. var type = event.type || 'unknown-event';
  44162. event.currentTarget = getNodeFromInstance(inst);
  44163. invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
  44164. event.currentTarget = null;
  44165. }
  44166. /**
  44167. * Standard/simple iteration through an event's collected dispatches.
  44168. */
  44169. function executeDispatchesInOrder(event) {
  44170. var dispatchListeners = event._dispatchListeners;
  44171. var dispatchInstances = event._dispatchInstances;
  44172. {
  44173. validateEventDispatches(event);
  44174. }
  44175. if (Array.isArray(dispatchListeners)) {
  44176. for (var i = 0; i < dispatchListeners.length; i++) {
  44177. if (event.isPropagationStopped()) {
  44178. break;
  44179. } // Listeners and Instances are two parallel arrays that are always in sync.
  44180. executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
  44181. }
  44182. } else if (dispatchListeners) {
  44183. executeDispatch(event, dispatchListeners, dispatchInstances);
  44184. }
  44185. event._dispatchListeners = null;
  44186. event._dispatchInstances = null;
  44187. }
  44188. /**
  44189. * @see executeDispatchesInOrderStopAtTrueImpl
  44190. */
  44191. /**
  44192. * Execution of a "direct" dispatch - there must be at most one dispatch
  44193. * accumulated on the event or it is considered an error. It doesn't really make
  44194. * sense for an event with multiple dispatches (bubbled) to keep track of the
  44195. * return values at each dispatch execution, but it does tend to make sense when
  44196. * dealing with "direct" dispatches.
  44197. *
  44198. * @return {*} The return value of executing the single dispatch.
  44199. */
  44200. /**
  44201. * @param {SyntheticEvent} event
  44202. * @return {boolean} True iff number of dispatches accumulated is greater than 0.
  44203. */
  44204. /**
  44205. * Accumulates items that must not be null or undefined into the first one. This
  44206. * is used to conserve memory by avoiding array allocations, and thus sacrifices
  44207. * API cleanness. Since `current` can be null before being passed in and not
  44208. * null after this function, make sure to assign it back to `current`:
  44209. *
  44210. * `a = accumulateInto(a, b);`
  44211. *
  44212. * This API should be sparingly used. Try `accumulate` for something cleaner.
  44213. *
  44214. * @return {*|array<*>} An accumulation of items.
  44215. */
  44216. function accumulateInto(current, next) {
  44217. if (!(next != null)) {
  44218. {
  44219. throw Error("accumulateInto(...): Accumulated items must not be null or undefined.");
  44220. }
  44221. }
  44222. if (current == null) {
  44223. return next;
  44224. } // Both are not empty. Warning: Never call x.concat(y) when you are not
  44225. // certain that x is an Array (x could be a string with concat method).
  44226. if (Array.isArray(current)) {
  44227. if (Array.isArray(next)) {
  44228. current.push.apply(current, next);
  44229. return current;
  44230. }
  44231. current.push(next);
  44232. return current;
  44233. }
  44234. if (Array.isArray(next)) {
  44235. // A bit too dangerous to mutate `next`.
  44236. return [current].concat(next);
  44237. }
  44238. return [current, next];
  44239. }
  44240. /**
  44241. * @param {array} arr an "accumulation" of items which is either an Array or
  44242. * a single item. Useful when paired with the `accumulate` module. This is a
  44243. * simple utility that allows us to reason about a collection of items, but
  44244. * handling the case when there is exactly one item (and we do not need to
  44245. * allocate an array).
  44246. * @param {function} cb Callback invoked with each element or a collection.
  44247. * @param {?} [scope] Scope used as `this` in a callback.
  44248. */
  44249. function forEachAccumulated(arr, cb, scope) {
  44250. if (Array.isArray(arr)) {
  44251. arr.forEach(cb, scope);
  44252. } else if (arr) {
  44253. cb.call(scope, arr);
  44254. }
  44255. }
  44256. /**
  44257. * Internal queue of events that have accumulated their dispatches and are
  44258. * waiting to have their dispatches executed.
  44259. */
  44260. var eventQueue = null;
  44261. /**
  44262. * Dispatches an event and releases it back into the pool, unless persistent.
  44263. *
  44264. * @param {?object} event Synthetic event to be dispatched.
  44265. * @private
  44266. */
  44267. var executeDispatchesAndRelease = function (event) {
  44268. if (event) {
  44269. executeDispatchesInOrder(event);
  44270. if (!event.isPersistent()) {
  44271. event.constructor.release(event);
  44272. }
  44273. }
  44274. };
  44275. var executeDispatchesAndReleaseTopLevel = function (e) {
  44276. return executeDispatchesAndRelease(e);
  44277. };
  44278. function runEventsInBatch(events) {
  44279. if (events !== null) {
  44280. eventQueue = accumulateInto(eventQueue, events);
  44281. } // Set `eventQueue` to null before processing it so that we can tell if more
  44282. // events get enqueued while processing.
  44283. var processingEventQueue = eventQueue;
  44284. eventQueue = null;
  44285. if (!processingEventQueue) {
  44286. return;
  44287. }
  44288. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
  44289. if (!!eventQueue) {
  44290. {
  44291. throw Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.");
  44292. }
  44293. } // This would be a good time to rethrow if any of the event handlers threw.
  44294. rethrowCaughtError();
  44295. }
  44296. function isInteractive(tag) {
  44297. return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
  44298. }
  44299. function shouldPreventMouseEvent(name, type, props) {
  44300. switch (name) {
  44301. case 'onClick':
  44302. case 'onClickCapture':
  44303. case 'onDoubleClick':
  44304. case 'onDoubleClickCapture':
  44305. case 'onMouseDown':
  44306. case 'onMouseDownCapture':
  44307. case 'onMouseMove':
  44308. case 'onMouseMoveCapture':
  44309. case 'onMouseUp':
  44310. case 'onMouseUpCapture':
  44311. return !!(props.disabled && isInteractive(type));
  44312. default:
  44313. return false;
  44314. }
  44315. }
  44316. /**
  44317. * This is a unified interface for event plugins to be installed and configured.
  44318. *
  44319. * Event plugins can implement the following properties:
  44320. *
  44321. * `extractEvents` {function(string, DOMEventTarget, string, object): *}
  44322. * Required. When a top-level event is fired, this method is expected to
  44323. * extract synthetic events that will in turn be queued and dispatched.
  44324. *
  44325. * `eventTypes` {object}
  44326. * Optional, plugins that fire events must publish a mapping of registration
  44327. * names that are used to register listeners. Values of this mapping must
  44328. * be objects that contain `registrationName` or `phasedRegistrationNames`.
  44329. *
  44330. * `executeDispatch` {function(object, function, string)}
  44331. * Optional, allows plugins to override how an event gets dispatched. By
  44332. * default, the listener is simply invoked.
  44333. *
  44334. * Each plugin that is injected into `EventsPluginHub` is immediately operable.
  44335. *
  44336. * @public
  44337. */
  44338. /**
  44339. * Methods for injecting dependencies.
  44340. */
  44341. var injection = {
  44342. /**
  44343. * @param {array} InjectedEventPluginOrder
  44344. * @public
  44345. */
  44346. injectEventPluginOrder: injectEventPluginOrder,
  44347. /**
  44348. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  44349. */
  44350. injectEventPluginsByName: injectEventPluginsByName
  44351. };
  44352. /**
  44353. * @param {object} inst The instance, which is the source of events.
  44354. * @param {string} registrationName Name of listener (e.g. `onClick`).
  44355. * @return {?function} The stored callback.
  44356. */
  44357. function getListener(inst, registrationName) {
  44358. var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
  44359. // live here; needs to be moved to a better place soon
  44360. var stateNode = inst.stateNode;
  44361. if (!stateNode) {
  44362. // Work in progress (ex: onload events in incremental mode).
  44363. return null;
  44364. }
  44365. var props = getFiberCurrentPropsFromNode(stateNode);
  44366. if (!props) {
  44367. // Work in progress.
  44368. return null;
  44369. }
  44370. listener = props[registrationName];
  44371. if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
  44372. return null;
  44373. }
  44374. if (!(!listener || typeof listener === 'function')) {
  44375. {
  44376. throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
  44377. }
  44378. }
  44379. return listener;
  44380. }
  44381. /**
  44382. * Allows registered plugins an opportunity to extract events from top-level
  44383. * native browser events.
  44384. *
  44385. * @return {*} An accumulation of synthetic events.
  44386. * @internal
  44387. */
  44388. function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  44389. var events = null;
  44390. for (var i = 0; i < plugins.length; i++) {
  44391. // Not every plugin in the ordering may be loaded at runtime.
  44392. var possiblePlugin = plugins[i];
  44393. if (possiblePlugin) {
  44394. var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  44395. if (extractedEvents) {
  44396. events = accumulateInto(events, extractedEvents);
  44397. }
  44398. }
  44399. }
  44400. return events;
  44401. }
  44402. function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  44403. var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  44404. runEventsInBatch(events);
  44405. }
  44406. var FunctionComponent = 0;
  44407. var ClassComponent = 1;
  44408. var IndeterminateComponent = 2; // Before we know whether it is function or class
  44409. var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
  44410. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
  44411. var HostComponent = 5;
  44412. var HostText = 6;
  44413. var Fragment = 7;
  44414. var Mode = 8;
  44415. var ContextConsumer = 9;
  44416. var ContextProvider = 10;
  44417. var ForwardRef = 11;
  44418. var Profiler = 12;
  44419. var SuspenseComponent = 13;
  44420. var MemoComponent = 14;
  44421. var SimpleMemoComponent = 15;
  44422. var LazyComponent = 16;
  44423. var IncompleteClassComponent = 17;
  44424. var DehydratedFragment = 18;
  44425. var SuspenseListComponent = 19;
  44426. var FundamentalComponent = 20;
  44427. var ScopeComponent = 21;
  44428. var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
  44429. // Current owner and dispatcher used to share the same ref,
  44430. // but PR #14548 split them out to better support the react-debug-tools package.
  44431. if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
  44432. ReactSharedInternals.ReactCurrentDispatcher = {
  44433. current: null
  44434. };
  44435. }
  44436. if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
  44437. ReactSharedInternals.ReactCurrentBatchConfig = {
  44438. suspense: null
  44439. };
  44440. }
  44441. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  44442. var describeComponentFrame = function (name, source, ownerName) {
  44443. var sourceInfo = '';
  44444. if (source) {
  44445. var path = source.fileName;
  44446. var fileName = path.replace(BEFORE_SLASH_RE, '');
  44447. {
  44448. // In DEV, include code for a common special case:
  44449. // prefer "folder/index.js" instead of just "index.js".
  44450. if (/^index\./.test(fileName)) {
  44451. var match = path.match(BEFORE_SLASH_RE);
  44452. if (match) {
  44453. var pathBeforeSlash = match[1];
  44454. if (pathBeforeSlash) {
  44455. var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
  44456. fileName = folderName + '/' + fileName;
  44457. }
  44458. }
  44459. }
  44460. }
  44461. sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  44462. } else if (ownerName) {
  44463. sourceInfo = ' (created by ' + ownerName + ')';
  44464. }
  44465. return '\n in ' + (name || 'Unknown') + sourceInfo;
  44466. };
  44467. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  44468. // nor polyfill, then a plain number is used for performance.
  44469. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  44470. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  44471. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  44472. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  44473. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  44474. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  44475. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  44476. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  44477. // (unstable) APIs that have been removed. Can we remove the symbols?
  44478. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  44479. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  44480. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  44481. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  44482. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  44483. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  44484. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  44485. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  44486. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  44487. var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  44488. var FAUX_ITERATOR_SYMBOL = '@@iterator';
  44489. function getIteratorFn(maybeIterable) {
  44490. if (maybeIterable === null || typeof maybeIterable !== 'object') {
  44491. return null;
  44492. }
  44493. var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  44494. if (typeof maybeIterator === 'function') {
  44495. return maybeIterator;
  44496. }
  44497. return null;
  44498. }
  44499. /**
  44500. * Similar to invariant but only logs a warning if the condition is not met.
  44501. * This can be used to log issues in development environments in critical
  44502. * paths. Removing the logging code for production environments will keep the
  44503. * same logic and follow the same code paths.
  44504. */
  44505. var warning = warningWithoutStack$1;
  44506. {
  44507. warning = function (condition, format) {
  44508. if (condition) {
  44509. return;
  44510. }
  44511. var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  44512. var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
  44513. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  44514. args[_key - 2] = arguments[_key];
  44515. }
  44516. warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
  44517. };
  44518. }
  44519. var warning$1 = warning;
  44520. var Uninitialized = -1;
  44521. var Pending = 0;
  44522. var Resolved = 1;
  44523. var Rejected = 2;
  44524. function refineResolvedLazyComponent(lazyComponent) {
  44525. return lazyComponent._status === Resolved ? lazyComponent._result : null;
  44526. }
  44527. function initializeLazyComponentType(lazyComponent) {
  44528. if (lazyComponent._status === Uninitialized) {
  44529. lazyComponent._status = Pending;
  44530. var ctor = lazyComponent._ctor;
  44531. var thenable = ctor();
  44532. lazyComponent._result = thenable;
  44533. thenable.then(function (moduleObject) {
  44534. if (lazyComponent._status === Pending) {
  44535. var defaultExport = moduleObject.default;
  44536. {
  44537. if (defaultExport === undefined) {
  44538. warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
  44539. }
  44540. }
  44541. lazyComponent._status = Resolved;
  44542. lazyComponent._result = defaultExport;
  44543. }
  44544. }, function (error) {
  44545. if (lazyComponent._status === Pending) {
  44546. lazyComponent._status = Rejected;
  44547. lazyComponent._result = error;
  44548. }
  44549. });
  44550. }
  44551. }
  44552. function getWrappedName(outerType, innerType, wrapperName) {
  44553. var functionName = innerType.displayName || innerType.name || '';
  44554. return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
  44555. }
  44556. function getComponentName(type) {
  44557. if (type == null) {
  44558. // Host root, text node or just invalid type.
  44559. return null;
  44560. }
  44561. {
  44562. if (typeof type.tag === 'number') {
  44563. warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
  44564. }
  44565. }
  44566. if (typeof type === 'function') {
  44567. return type.displayName || type.name || null;
  44568. }
  44569. if (typeof type === 'string') {
  44570. return type;
  44571. }
  44572. switch (type) {
  44573. case REACT_FRAGMENT_TYPE:
  44574. return 'Fragment';
  44575. case REACT_PORTAL_TYPE:
  44576. return 'Portal';
  44577. case REACT_PROFILER_TYPE:
  44578. return "Profiler";
  44579. case REACT_STRICT_MODE_TYPE:
  44580. return 'StrictMode';
  44581. case REACT_SUSPENSE_TYPE:
  44582. return 'Suspense';
  44583. case REACT_SUSPENSE_LIST_TYPE:
  44584. return 'SuspenseList';
  44585. }
  44586. if (typeof type === 'object') {
  44587. switch (type.$$typeof) {
  44588. case REACT_CONTEXT_TYPE:
  44589. return 'Context.Consumer';
  44590. case REACT_PROVIDER_TYPE:
  44591. return 'Context.Provider';
  44592. case REACT_FORWARD_REF_TYPE:
  44593. return getWrappedName(type, type.render, 'ForwardRef');
  44594. case REACT_MEMO_TYPE:
  44595. return getComponentName(type.type);
  44596. case REACT_LAZY_TYPE:
  44597. {
  44598. var thenable = type;
  44599. var resolvedThenable = refineResolvedLazyComponent(thenable);
  44600. if (resolvedThenable) {
  44601. return getComponentName(resolvedThenable);
  44602. }
  44603. break;
  44604. }
  44605. }
  44606. }
  44607. return null;
  44608. }
  44609. var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  44610. function describeFiber(fiber) {
  44611. switch (fiber.tag) {
  44612. case HostRoot:
  44613. case HostPortal:
  44614. case HostText:
  44615. case Fragment:
  44616. case ContextProvider:
  44617. case ContextConsumer:
  44618. return '';
  44619. default:
  44620. var owner = fiber._debugOwner;
  44621. var source = fiber._debugSource;
  44622. var name = getComponentName(fiber.type);
  44623. var ownerName = null;
  44624. if (owner) {
  44625. ownerName = getComponentName(owner.type);
  44626. }
  44627. return describeComponentFrame(name, source, ownerName);
  44628. }
  44629. }
  44630. function getStackByFiberInDevAndProd(workInProgress) {
  44631. var info = '';
  44632. var node = workInProgress;
  44633. do {
  44634. info += describeFiber(node);
  44635. node = node.return;
  44636. } while (node);
  44637. return info;
  44638. }
  44639. var current = null;
  44640. var phase = null;
  44641. function getCurrentFiberOwnerNameInDevOrNull() {
  44642. {
  44643. if (current === null) {
  44644. return null;
  44645. }
  44646. var owner = current._debugOwner;
  44647. if (owner !== null && typeof owner !== 'undefined') {
  44648. return getComponentName(owner.type);
  44649. }
  44650. }
  44651. return null;
  44652. }
  44653. function getCurrentFiberStackInDev() {
  44654. {
  44655. if (current === null) {
  44656. return '';
  44657. } // Safe because if current fiber exists, we are reconciling,
  44658. // and it is guaranteed to be the work-in-progress version.
  44659. return getStackByFiberInDevAndProd(current);
  44660. }
  44661. return '';
  44662. }
  44663. function resetCurrentFiber() {
  44664. {
  44665. ReactDebugCurrentFrame.getCurrentStack = null;
  44666. current = null;
  44667. phase = null;
  44668. }
  44669. }
  44670. function setCurrentFiber(fiber) {
  44671. {
  44672. ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
  44673. current = fiber;
  44674. phase = null;
  44675. }
  44676. }
  44677. function setCurrentPhase(lifeCyclePhase) {
  44678. {
  44679. phase = lifeCyclePhase;
  44680. }
  44681. }
  44682. var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
  44683. function endsWith(subject, search) {
  44684. var length = subject.length;
  44685. return subject.substring(length - search.length, length) === search;
  44686. }
  44687. var PLUGIN_EVENT_SYSTEM = 1;
  44688. var RESPONDER_EVENT_SYSTEM = 1 << 1;
  44689. var IS_PASSIVE = 1 << 2;
  44690. var IS_ACTIVE = 1 << 3;
  44691. var PASSIVE_NOT_SUPPORTED = 1 << 4;
  44692. var IS_REPLAYED = 1 << 5;
  44693. var restoreImpl = null;
  44694. var restoreTarget = null;
  44695. var restoreQueue = null;
  44696. function restoreStateOfTarget(target) {
  44697. // We perform this translation at the end of the event loop so that we
  44698. // always receive the correct fiber here
  44699. var internalInstance = getInstanceFromNode(target);
  44700. if (!internalInstance) {
  44701. // Unmounted
  44702. return;
  44703. }
  44704. if (!(typeof restoreImpl === 'function')) {
  44705. {
  44706. throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
  44707. }
  44708. }
  44709. var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
  44710. restoreImpl(internalInstance.stateNode, internalInstance.type, props);
  44711. }
  44712. function setRestoreImplementation(impl) {
  44713. restoreImpl = impl;
  44714. }
  44715. function enqueueStateRestore(target) {
  44716. if (restoreTarget) {
  44717. if (restoreQueue) {
  44718. restoreQueue.push(target);
  44719. } else {
  44720. restoreQueue = [target];
  44721. }
  44722. } else {
  44723. restoreTarget = target;
  44724. }
  44725. }
  44726. function needsStateRestore() {
  44727. return restoreTarget !== null || restoreQueue !== null;
  44728. }
  44729. function restoreStateIfNeeded() {
  44730. if (!restoreTarget) {
  44731. return;
  44732. }
  44733. var target = restoreTarget;
  44734. var queuedTargets = restoreQueue;
  44735. restoreTarget = null;
  44736. restoreQueue = null;
  44737. restoreStateOfTarget(target);
  44738. if (queuedTargets) {
  44739. for (var i = 0; i < queuedTargets.length; i++) {
  44740. restoreStateOfTarget(queuedTargets[i]);
  44741. }
  44742. }
  44743. }
  44744. var enableUserTimingAPI = true; // Helps identify side effects in render-phase lifecycle hooks and setState
  44745. // reducers by double invoking them in Strict Mode.
  44746. var debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the "Pause on caught exceptions" behavior of the debugger, we
  44747. // replay the begin phase of a failed component inside invokeGuardedCallback.
  44748. var replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
  44749. var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.
  44750. var enableProfilerTimer = true; // Trace which interactions trigger each commit.
  44751. var enableSchedulerTracing = true; // SSR experiments
  44752. var enableSuspenseServerRenderer = false;
  44753. var enableSelectiveHydration = false; // Only used in www builds.
  44754. // Only used in www builds.
  44755. // Disable javascript: URL strings in href for XSS protection.
  44756. var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing
  44757. // with their related DOM properties
  44758. var disableInputAttributeSyncing = false; // These APIs will no longer be "unstable" in the upcoming 16.7 release,
  44759. // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
  44760. var exposeConcurrentModeAPIs = false;
  44761. var warnAboutShorthandPropertyCollision = false; // Experimental React Flare event system and event components support.
  44762. var enableFlareAPI = false; // Experimental Host Component support.
  44763. var enableFundamentalAPI = false; // Experimental Scope support.
  44764. var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
  44765. // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
  44766. // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
  44767. var warnAboutUnmockedScheduler = false; // For tests, we flush suspense fallbacks in an act scope;
  44768. // *except* in some of our own tests, where we test incremental loading states.
  44769. var flushSuspenseFallbacksInTests = true; // Add a callback property to suspense to notify which promises are currently
  44770. // in the update queue. This allows reporting and tracing of what is causing
  44771. // the user to see a loading state.
  44772. // Also allows hydration callbacks to fire when a dehydrated boundary gets
  44773. // hydrated or deleted.
  44774. var enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move
  44775. // from React.createElement to React.jsx
  44776. // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
  44777. var warnAboutDefaultPropsOnFunctionComponents = false;
  44778. var warnAboutStringRefs = false;
  44779. var disableLegacyContext = false;
  44780. var disableSchedulerTimeoutBasedOnReactExpirationTime = false;
  44781. var enableTrustedTypesIntegration = false; // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
  44782. // the renderer. Such as when we're dispatching events or if third party
  44783. // libraries need to call batchedUpdates. Eventually, this API will go away when
  44784. // everything is batched by default. We'll then have a similar API to opt-out of
  44785. // scheduled work and instead do synchronous work.
  44786. // Defaults
  44787. var batchedUpdatesImpl = function (fn, bookkeeping) {
  44788. return fn(bookkeeping);
  44789. };
  44790. var discreteUpdatesImpl = function (fn, a, b, c) {
  44791. return fn(a, b, c);
  44792. };
  44793. var flushDiscreteUpdatesImpl = function () {};
  44794. var batchedEventUpdatesImpl = batchedUpdatesImpl;
  44795. var isInsideEventHandler = false;
  44796. var isBatchingEventUpdates = false;
  44797. function finishEventHandler() {
  44798. // Here we wait until all updates have propagated, which is important
  44799. // when using controlled components within layers:
  44800. // https://github.com/facebook/react/issues/1698
  44801. // Then we restore state of any controlled component.
  44802. var controlledComponentsHavePendingUpdates = needsStateRestore();
  44803. if (controlledComponentsHavePendingUpdates) {
  44804. // If a controlled event was fired, we may need to restore the state of
  44805. // the DOM node back to the controlled value. This is necessary when React
  44806. // bails out of the update without touching the DOM.
  44807. flushDiscreteUpdatesImpl();
  44808. restoreStateIfNeeded();
  44809. }
  44810. }
  44811. function batchedUpdates(fn, bookkeeping) {
  44812. if (isInsideEventHandler) {
  44813. // If we are currently inside another batch, we need to wait until it
  44814. // fully completes before restoring state.
  44815. return fn(bookkeeping);
  44816. }
  44817. isInsideEventHandler = true;
  44818. try {
  44819. return batchedUpdatesImpl(fn, bookkeeping);
  44820. } finally {
  44821. isInsideEventHandler = false;
  44822. finishEventHandler();
  44823. }
  44824. }
  44825. function batchedEventUpdates(fn, a, b) {
  44826. if (isBatchingEventUpdates) {
  44827. // If we are currently inside another batch, we need to wait until it
  44828. // fully completes before restoring state.
  44829. return fn(a, b);
  44830. }
  44831. isBatchingEventUpdates = true;
  44832. try {
  44833. return batchedEventUpdatesImpl(fn, a, b);
  44834. } finally {
  44835. isBatchingEventUpdates = false;
  44836. finishEventHandler();
  44837. }
  44838. } // This is for the React Flare event system
  44839. function executeUserEventHandler(fn, value) {
  44840. var previouslyInEventHandler = isInsideEventHandler;
  44841. try {
  44842. isInsideEventHandler = true;
  44843. var type = typeof value === 'object' && value !== null ? value.type : '';
  44844. invokeGuardedCallbackAndCatchFirstError(type, fn, undefined, value);
  44845. } finally {
  44846. isInsideEventHandler = previouslyInEventHandler;
  44847. }
  44848. }
  44849. function discreteUpdates(fn, a, b, c) {
  44850. var prevIsInsideEventHandler = isInsideEventHandler;
  44851. isInsideEventHandler = true;
  44852. try {
  44853. return discreteUpdatesImpl(fn, a, b, c);
  44854. } finally {
  44855. isInsideEventHandler = prevIsInsideEventHandler;
  44856. if (!isInsideEventHandler) {
  44857. finishEventHandler();
  44858. }
  44859. }
  44860. }
  44861. var lastFlushedEventTimeStamp = 0;
  44862. function flushDiscreteUpdatesIfNeeded(timeStamp) {
  44863. // event.timeStamp isn't overly reliable due to inconsistencies in
  44864. // how different browsers have historically provided the time stamp.
  44865. // Some browsers provide high-resolution time stamps for all events,
  44866. // some provide low-resolution time stamps for all events. FF < 52
  44867. // even mixes both time stamps together. Some browsers even report
  44868. // negative time stamps or time stamps that are 0 (iOS9) in some cases.
  44869. // Given we are only comparing two time stamps with equality (!==),
  44870. // we are safe from the resolution differences. If the time stamp is 0
  44871. // we bail-out of preventing the flush, which can affect semantics,
  44872. // such as if an earlier flush removes or adds event listeners that
  44873. // are fired in the subsequent flush. However, this is the same
  44874. // behaviour as we had before this change, so the risks are low.
  44875. if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) {
  44876. lastFlushedEventTimeStamp = timeStamp;
  44877. flushDiscreteUpdatesImpl();
  44878. }
  44879. }
  44880. function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
  44881. batchedUpdatesImpl = _batchedUpdatesImpl;
  44882. discreteUpdatesImpl = _discreteUpdatesImpl;
  44883. flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
  44884. batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
  44885. }
  44886. var DiscreteEvent = 0;
  44887. var UserBlockingEvent = 1;
  44888. var ContinuousEvent = 2;
  44889. // CommonJS interop named imports.
  44890. var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
  44891. var runWithPriority = Scheduler.unstable_runWithPriority;
  44892. var listenToResponderEventTypesImpl;
  44893. function setListenToResponderEventTypes(_listenToResponderEventTypesImpl) {
  44894. listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl;
  44895. }
  44896. var rootEventTypesToEventResponderInstances = new Map();
  44897. var DoNotPropagateToNextResponder = 0;
  44898. var PropagateToNextResponder = 1;
  44899. var currentTimeStamp = 0;
  44900. var currentInstance = null;
  44901. var currentDocument = null;
  44902. var currentPropagationBehavior = DoNotPropagateToNextResponder;
  44903. var eventResponderContext = {
  44904. dispatchEvent: function (eventValue, eventListener, eventPriority) {
  44905. validateResponderContext();
  44906. validateEventValue(eventValue);
  44907. switch (eventPriority) {
  44908. case DiscreteEvent:
  44909. {
  44910. flushDiscreteUpdatesIfNeeded(currentTimeStamp);
  44911. discreteUpdates(function () {
  44912. return executeUserEventHandler(eventListener, eventValue);
  44913. });
  44914. break;
  44915. }
  44916. case UserBlockingEvent:
  44917. {
  44918. runWithPriority(UserBlockingPriority, function () {
  44919. return executeUserEventHandler(eventListener, eventValue);
  44920. });
  44921. break;
  44922. }
  44923. case ContinuousEvent:
  44924. {
  44925. executeUserEventHandler(eventListener, eventValue);
  44926. break;
  44927. }
  44928. }
  44929. },
  44930. isTargetWithinResponder: function (target) {
  44931. validateResponderContext();
  44932. if (target != null) {
  44933. var fiber = getClosestInstanceFromNode(target);
  44934. var responderFiber = currentInstance.fiber;
  44935. while (fiber !== null) {
  44936. if (fiber === responderFiber || fiber.alternate === responderFiber) {
  44937. return true;
  44938. }
  44939. fiber = fiber.return;
  44940. }
  44941. }
  44942. return false;
  44943. },
  44944. isTargetWithinResponderScope: function (target) {
  44945. validateResponderContext();
  44946. var componentInstance = currentInstance;
  44947. var responder = componentInstance.responder;
  44948. if (target != null) {
  44949. var fiber = getClosestInstanceFromNode(target);
  44950. var responderFiber = currentInstance.fiber;
  44951. while (fiber !== null) {
  44952. if (fiber === responderFiber || fiber.alternate === responderFiber) {
  44953. return true;
  44954. }
  44955. if (doesFiberHaveResponder(fiber, responder)) {
  44956. return false;
  44957. }
  44958. fiber = fiber.return;
  44959. }
  44960. }
  44961. return false;
  44962. },
  44963. isTargetWithinNode: function (childTarget, parentTarget) {
  44964. validateResponderContext();
  44965. var childFiber = getClosestInstanceFromNode(childTarget);
  44966. var parentFiber = getClosestInstanceFromNode(parentTarget);
  44967. if (childFiber != null && parentFiber != null) {
  44968. var parentAlternateFiber = parentFiber.alternate;
  44969. var node = childFiber;
  44970. while (node !== null) {
  44971. if (node === parentFiber || node === parentAlternateFiber) {
  44972. return true;
  44973. }
  44974. node = node.return;
  44975. }
  44976. return false;
  44977. } // Fallback to DOM APIs
  44978. return parentTarget.contains(childTarget);
  44979. },
  44980. addRootEventTypes: function (rootEventTypes) {
  44981. validateResponderContext();
  44982. listenToResponderEventTypesImpl(rootEventTypes, currentDocument);
  44983. for (var i = 0; i < rootEventTypes.length; i++) {
  44984. var rootEventType = rootEventTypes[i];
  44985. var eventResponderInstance = currentInstance;
  44986. registerRootEventType(rootEventType, eventResponderInstance);
  44987. }
  44988. },
  44989. removeRootEventTypes: function (rootEventTypes) {
  44990. validateResponderContext();
  44991. for (var i = 0; i < rootEventTypes.length; i++) {
  44992. var rootEventType = rootEventTypes[i];
  44993. var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType);
  44994. var rootEventTypesSet = currentInstance.rootEventTypes;
  44995. if (rootEventTypesSet !== null) {
  44996. rootEventTypesSet.delete(rootEventType);
  44997. }
  44998. if (rootEventResponders !== undefined) {
  44999. rootEventResponders.delete(currentInstance);
  45000. }
  45001. }
  45002. },
  45003. getActiveDocument: getActiveDocument,
  45004. objectAssign: _assign,
  45005. getTimeStamp: function () {
  45006. validateResponderContext();
  45007. return currentTimeStamp;
  45008. },
  45009. isTargetWithinHostComponent: function (target, elementType) {
  45010. validateResponderContext();
  45011. var fiber = getClosestInstanceFromNode(target);
  45012. while (fiber !== null) {
  45013. if (fiber.tag === HostComponent && fiber.type === elementType) {
  45014. return true;
  45015. }
  45016. fiber = fiber.return;
  45017. }
  45018. return false;
  45019. },
  45020. continuePropagation: function () {
  45021. currentPropagationBehavior = PropagateToNextResponder;
  45022. },
  45023. enqueueStateRestore: enqueueStateRestore,
  45024. getResponderNode: function () {
  45025. validateResponderContext();
  45026. var responderFiber = currentInstance.fiber;
  45027. if (responderFiber.tag === ScopeComponent) {
  45028. return null;
  45029. }
  45030. return responderFiber.stateNode;
  45031. }
  45032. };
  45033. function validateEventValue(eventValue) {
  45034. if (typeof eventValue === 'object' && eventValue !== null) {
  45035. var target = eventValue.target,
  45036. type = eventValue.type,
  45037. timeStamp = eventValue.timeStamp;
  45038. if (target == null || type == null || timeStamp == null) {
  45039. throw new Error('context.dispatchEvent: "target", "timeStamp", and "type" fields on event object are required.');
  45040. }
  45041. var showWarning = function (name) {
  45042. {
  45043. warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.%s }`', name, name);
  45044. }
  45045. };
  45046. eventValue.isDefaultPrevented = function () {
  45047. {
  45048. showWarning('isDefaultPrevented()');
  45049. }
  45050. };
  45051. eventValue.isPropagationStopped = function () {
  45052. {
  45053. showWarning('isPropagationStopped()');
  45054. }
  45055. }; // $FlowFixMe: we don't need value, Flow thinks we do
  45056. Object.defineProperty(eventValue, 'nativeEvent', {
  45057. get: function () {
  45058. {
  45059. showWarning('nativeEvent');
  45060. }
  45061. }
  45062. });
  45063. }
  45064. }
  45065. function doesFiberHaveResponder(fiber, responder) {
  45066. var tag = fiber.tag;
  45067. if (tag === HostComponent || tag === ScopeComponent) {
  45068. var dependencies = fiber.dependencies;
  45069. if (dependencies !== null) {
  45070. var respondersMap = dependencies.responders;
  45071. if (respondersMap !== null && respondersMap.has(responder)) {
  45072. return true;
  45073. }
  45074. }
  45075. }
  45076. return false;
  45077. }
  45078. function getActiveDocument() {
  45079. return currentDocument;
  45080. }
  45081. function createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) {
  45082. var _ref = nativeEvent,
  45083. buttons = _ref.buttons,
  45084. pointerType = _ref.pointerType;
  45085. var eventPointerType = '';
  45086. if (pointerType !== undefined) {
  45087. eventPointerType = pointerType;
  45088. } else if (nativeEvent.key !== undefined) {
  45089. eventPointerType = 'keyboard';
  45090. } else if (buttons !== undefined) {
  45091. eventPointerType = 'mouse';
  45092. } else if (nativeEvent.changedTouches !== undefined) {
  45093. eventPointerType = 'touch';
  45094. }
  45095. return {
  45096. nativeEvent: nativeEvent,
  45097. passive: passive,
  45098. passiveSupported: passiveSupported,
  45099. pointerType: eventPointerType,
  45100. target: nativeEventTarget,
  45101. type: topLevelType
  45102. };
  45103. }
  45104. function responderEventTypesContainType(eventTypes, type) {
  45105. for (var i = 0, len = eventTypes.length; i < len; i++) {
  45106. if (eventTypes[i] === type) {
  45107. return true;
  45108. }
  45109. }
  45110. return false;
  45111. }
  45112. function validateResponderTargetEventTypes(eventType, responder) {
  45113. var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder
  45114. if (targetEventTypes !== null) {
  45115. return responderEventTypesContainType(targetEventTypes, eventType);
  45116. }
  45117. return false;
  45118. }
  45119. function traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
  45120. var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0;
  45121. var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0;
  45122. var isPassive = isPassiveEvent || !isPassiveSupported;
  45123. var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order:
  45124. // - Bubble target responder phase
  45125. // - Root responder phase
  45126. var visitedResponders = new Set();
  45127. var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported);
  45128. var node = targetFiber;
  45129. var insidePortal = false;
  45130. while (node !== null) {
  45131. var _node = node,
  45132. dependencies = _node.dependencies,
  45133. tag = _node.tag;
  45134. if (tag === HostPortal) {
  45135. insidePortal = true;
  45136. } else if ((tag === HostComponent || tag === ScopeComponent) && dependencies !== null) {
  45137. var respondersMap = dependencies.responders;
  45138. if (respondersMap !== null) {
  45139. var responderInstances = Array.from(respondersMap.values());
  45140. for (var i = 0, length = responderInstances.length; i < length; i++) {
  45141. var responderInstance = responderInstances[i];
  45142. var props = responderInstance.props,
  45143. responder = responderInstance.responder,
  45144. state = responderInstance.state;
  45145. if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder) && (!insidePortal || responder.targetPortalPropagation)) {
  45146. visitedResponders.add(responder);
  45147. var onEvent = responder.onEvent;
  45148. if (onEvent !== null) {
  45149. currentInstance = responderInstance;
  45150. onEvent(responderEvent, eventResponderContext, props, state);
  45151. if (currentPropagationBehavior === PropagateToNextResponder) {
  45152. visitedResponders.delete(responder);
  45153. currentPropagationBehavior = DoNotPropagateToNextResponder;
  45154. }
  45155. }
  45156. }
  45157. }
  45158. }
  45159. }
  45160. node = node.return;
  45161. } // Root phase
  45162. var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType);
  45163. if (rootEventResponderInstances !== undefined) {
  45164. var _responderInstances = Array.from(rootEventResponderInstances);
  45165. for (var _i = 0; _i < _responderInstances.length; _i++) {
  45166. var _responderInstance = _responderInstances[_i];
  45167. var props = _responderInstance.props,
  45168. responder = _responderInstance.responder,
  45169. state = _responderInstance.state;
  45170. var onRootEvent = responder.onRootEvent;
  45171. if (onRootEvent !== null) {
  45172. currentInstance = _responderInstance;
  45173. onRootEvent(responderEvent, eventResponderContext, props, state);
  45174. }
  45175. }
  45176. }
  45177. }
  45178. function mountEventResponder(responder, responderInstance, props, state) {
  45179. var onMount = responder.onMount;
  45180. if (onMount !== null) {
  45181. var previousInstance = currentInstance;
  45182. currentInstance = responderInstance;
  45183. try {
  45184. batchedEventUpdates(function () {
  45185. onMount(eventResponderContext, props, state);
  45186. });
  45187. } finally {
  45188. currentInstance = previousInstance;
  45189. }
  45190. }
  45191. }
  45192. function unmountEventResponder(responderInstance) {
  45193. var responder = responderInstance.responder;
  45194. var onUnmount = responder.onUnmount;
  45195. if (onUnmount !== null) {
  45196. var props = responderInstance.props,
  45197. state = responderInstance.state;
  45198. var previousInstance = currentInstance;
  45199. currentInstance = responderInstance;
  45200. try {
  45201. batchedEventUpdates(function () {
  45202. onUnmount(eventResponderContext, props, state);
  45203. });
  45204. } finally {
  45205. currentInstance = previousInstance;
  45206. }
  45207. }
  45208. var rootEventTypesSet = responderInstance.rootEventTypes;
  45209. if (rootEventTypesSet !== null) {
  45210. var rootEventTypes = Array.from(rootEventTypesSet);
  45211. for (var i = 0; i < rootEventTypes.length; i++) {
  45212. var topLevelEventType = rootEventTypes[i];
  45213. var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType);
  45214. if (rootEventResponderInstances !== undefined) {
  45215. rootEventResponderInstances.delete(responderInstance);
  45216. }
  45217. }
  45218. }
  45219. }
  45220. function validateResponderContext() {
  45221. if (!(currentInstance !== null)) {
  45222. {
  45223. throw Error("An event responder context was used outside of an event cycle.");
  45224. }
  45225. }
  45226. }
  45227. function dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
  45228. if (enableFlareAPI) {
  45229. var previousInstance = currentInstance;
  45230. var previousTimeStamp = currentTimeStamp;
  45231. var previousDocument = currentDocument;
  45232. var previousPropagationBehavior = currentPropagationBehavior;
  45233. currentPropagationBehavior = DoNotPropagateToNextResponder; // nodeType 9 is DOCUMENT_NODE
  45234. currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here
  45235. currentTimeStamp = nativeEvent.timeStamp;
  45236. try {
  45237. batchedEventUpdates(function () {
  45238. traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags);
  45239. });
  45240. } finally {
  45241. currentInstance = previousInstance;
  45242. currentTimeStamp = previousTimeStamp;
  45243. currentDocument = previousDocument;
  45244. currentPropagationBehavior = previousPropagationBehavior;
  45245. }
  45246. }
  45247. }
  45248. function addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) {
  45249. for (var i = 0; i < rootEventTypes.length; i++) {
  45250. var rootEventType = rootEventTypes[i];
  45251. registerRootEventType(rootEventType, responderInstance);
  45252. }
  45253. }
  45254. function registerRootEventType(rootEventType, eventResponderInstance) {
  45255. var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType);
  45256. if (rootEventResponderInstances === undefined) {
  45257. rootEventResponderInstances = new Set();
  45258. rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances);
  45259. }
  45260. var rootEventTypesSet = eventResponderInstance.rootEventTypes;
  45261. if (rootEventTypesSet === null) {
  45262. rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set();
  45263. }
  45264. if (!!rootEventTypesSet.has(rootEventType)) {
  45265. {
  45266. throw Error("addRootEventTypes() found a duplicate root event type of \"" + rootEventType + "\". This might be because the event type exists in the event responder \"rootEventTypes\" array or because of a previous addRootEventTypes() using this root event type.");
  45267. }
  45268. }
  45269. rootEventTypesSet.add(rootEventType);
  45270. rootEventResponderInstances.add(eventResponderInstance);
  45271. }
  45272. // A reserved attribute.
  45273. // It is handled by React separately and shouldn't be written to the DOM.
  45274. var RESERVED = 0; // A simple string attribute.
  45275. // Attributes that aren't in the whitelist are presumed to have this type.
  45276. var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
  45277. // "enumerated" attributes with "true" and "false" as possible values.
  45278. // When true, it should be set to a "true" string.
  45279. // When false, it should be set to a "false" string.
  45280. var BOOLEANISH_STRING = 2; // A real boolean attribute.
  45281. // When true, it should be present (set either to an empty string or its name).
  45282. // When false, it should be omitted.
  45283. var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
  45284. // When true, it should be present (set either to an empty string or its name).
  45285. // When false, it should be omitted.
  45286. // For any other value, should be present with that value.
  45287. var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
  45288. // When falsy, it should be removed.
  45289. var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
  45290. // When falsy, it should be removed.
  45291. var POSITIVE_NUMERIC = 6;
  45292. /* eslint-disable max-len */
  45293. var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
  45294. /* eslint-enable max-len */
  45295. var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
  45296. var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
  45297. var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
  45298. var hasOwnProperty = Object.prototype.hasOwnProperty;
  45299. var illegalAttributeNameCache = {};
  45300. var validatedAttributeNameCache = {};
  45301. function isAttributeNameSafe(attributeName) {
  45302. if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
  45303. return true;
  45304. }
  45305. if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
  45306. return false;
  45307. }
  45308. if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
  45309. validatedAttributeNameCache[attributeName] = true;
  45310. return true;
  45311. }
  45312. illegalAttributeNameCache[attributeName] = true;
  45313. {
  45314. warning$1(false, 'Invalid attribute name: `%s`', attributeName);
  45315. }
  45316. return false;
  45317. }
  45318. function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  45319. if (propertyInfo !== null) {
  45320. return propertyInfo.type === RESERVED;
  45321. }
  45322. if (isCustomComponentTag) {
  45323. return false;
  45324. }
  45325. if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
  45326. return true;
  45327. }
  45328. return false;
  45329. }
  45330. function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  45331. if (propertyInfo !== null && propertyInfo.type === RESERVED) {
  45332. return false;
  45333. }
  45334. switch (typeof value) {
  45335. case 'function': // $FlowIssue symbol is perfectly valid here
  45336. case 'symbol':
  45337. // eslint-disable-line
  45338. return true;
  45339. case 'boolean':
  45340. {
  45341. if (isCustomComponentTag) {
  45342. return false;
  45343. }
  45344. if (propertyInfo !== null) {
  45345. return !propertyInfo.acceptsBooleans;
  45346. } else {
  45347. var prefix = name.toLowerCase().slice(0, 5);
  45348. return prefix !== 'data-' && prefix !== 'aria-';
  45349. }
  45350. }
  45351. default:
  45352. return false;
  45353. }
  45354. }
  45355. function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  45356. if (value === null || typeof value === 'undefined') {
  45357. return true;
  45358. }
  45359. if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
  45360. return true;
  45361. }
  45362. if (isCustomComponentTag) {
  45363. return false;
  45364. }
  45365. if (propertyInfo !== null) {
  45366. switch (propertyInfo.type) {
  45367. case BOOLEAN:
  45368. return !value;
  45369. case OVERLOADED_BOOLEAN:
  45370. return value === false;
  45371. case NUMERIC:
  45372. return isNaN(value);
  45373. case POSITIVE_NUMERIC:
  45374. return isNaN(value) || value < 1;
  45375. }
  45376. }
  45377. return false;
  45378. }
  45379. function getPropertyInfo(name) {
  45380. return properties.hasOwnProperty(name) ? properties[name] : null;
  45381. }
  45382. function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
  45383. this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  45384. this.attributeName = attributeName;
  45385. this.attributeNamespace = attributeNamespace;
  45386. this.mustUseProperty = mustUseProperty;
  45387. this.propertyName = name;
  45388. this.type = type;
  45389. this.sanitizeURL = sanitizeURL;
  45390. } // When adding attributes to this list, be sure to also add them to
  45391. // the `possibleStandardNames` module to ensure casing and incorrect
  45392. // name warnings.
  45393. var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
  45394. ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
  45395. // elements (not just inputs). Now that ReactDOMInput assigns to the
  45396. // defaultValue property -- do we need this?
  45397. 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
  45398. properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  45399. name, // attributeName
  45400. null, // attributeNamespace
  45401. false);
  45402. }); // A few React string attributes have a different name.
  45403. // This is a mapping from React prop names to the attribute names.
  45404. [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  45405. var name = _ref[0],
  45406. attributeName = _ref[1];
  45407. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  45408. attributeName, // attributeName
  45409. null, // attributeNamespace
  45410. false);
  45411. }); // These are "enumerated" HTML attributes that accept "true" and "false".
  45412. // In React, we let users pass `true` and `false` even though technically
  45413. // these aren't boolean attributes (they are coerced to strings).
  45414. ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  45415. properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  45416. name.toLowerCase(), // attributeName
  45417. null, // attributeNamespace
  45418. false);
  45419. }); // These are "enumerated" SVG attributes that accept "true" and "false".
  45420. // In React, we let users pass `true` and `false` even though technically
  45421. // these aren't boolean attributes (they are coerced to strings).
  45422. // Since these are SVG attributes, their attribute names are case-sensitive.
  45423. ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  45424. properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  45425. name, // attributeName
  45426. null, // attributeNamespace
  45427. false);
  45428. }); // These are HTML boolean attributes.
  45429. ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
  45430. // on the client side because the browsers are inconsistent. Instead we call focus().
  45431. 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
  45432. 'itemScope'].forEach(function (name) {
  45433. properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  45434. name.toLowerCase(), // attributeName
  45435. null, // attributeNamespace
  45436. false);
  45437. }); // These are the few React props that we set as DOM properties
  45438. // rather than attributes. These are all booleans.
  45439. ['checked', // Note: `option.selected` is not updated if `select.multiple` is
  45440. // disabled with `removeAttribute`. We have special logic for handling this.
  45441. 'multiple', 'muted', 'selected'].forEach(function (name) {
  45442. properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  45443. name, // attributeName
  45444. null, // attributeNamespace
  45445. false);
  45446. }); // These are HTML attributes that are "overloaded booleans": they behave like
  45447. // booleans, but can also accept a string value.
  45448. ['capture', 'download'].forEach(function (name) {
  45449. properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  45450. name, // attributeName
  45451. null, // attributeNamespace
  45452. false);
  45453. }); // These are HTML attributes that must be positive numbers.
  45454. ['cols', 'rows', 'size', 'span'].forEach(function (name) {
  45455. properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  45456. name, // attributeName
  45457. null, // attributeNamespace
  45458. false);
  45459. }); // These are HTML attributes that must be numbers.
  45460. ['rowSpan', 'start'].forEach(function (name) {
  45461. properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  45462. name.toLowerCase(), // attributeName
  45463. null, // attributeNamespace
  45464. false);
  45465. });
  45466. var CAMELIZE = /[\-\:]([a-z])/g;
  45467. var capitalize = function (token) {
  45468. return token[1].toUpperCase();
  45469. }; // This is a list of all SVG attributes that need special casing, namespacing,
  45470. // or boolean value assignment. Regular attributes that just accept strings
  45471. // and have the same names are omitted, just like in the HTML whitelist.
  45472. // Some of these attributes can be hard to find. This list was created by
  45473. // scrapping the MDN documentation.
  45474. ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
  45475. var name = attributeName.replace(CAMELIZE, capitalize);
  45476. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  45477. attributeName, null, // attributeNamespace
  45478. false);
  45479. }); // String SVG attributes with the xlink namespace.
  45480. ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
  45481. var name = attributeName.replace(CAMELIZE, capitalize);
  45482. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  45483. attributeName, 'http://www.w3.org/1999/xlink', false);
  45484. }); // String SVG attributes with the xml namespace.
  45485. ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
  45486. var name = attributeName.replace(CAMELIZE, capitalize);
  45487. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  45488. attributeName, 'http://www.w3.org/XML/1998/namespace', false);
  45489. }); // These attribute exists both in HTML and SVG.
  45490. // The attribute name is case-sensitive in SVG so we can't just use
  45491. // the React name like we do for attributes that exist only in HTML.
  45492. ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  45493. properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  45494. attributeName.toLowerCase(), // attributeName
  45495. null, // attributeNamespace
  45496. false);
  45497. }); // These attributes accept URLs. These must not allow javascript: URLS.
  45498. // These will also need to accept Trusted Types object in the future.
  45499. var xlinkHref = 'xlinkHref';
  45500. properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
  45501. 'xlink:href', 'http://www.w3.org/1999/xlink', true);
  45502. ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
  45503. properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  45504. attributeName.toLowerCase(), // attributeName
  45505. null, // attributeNamespace
  45506. true);
  45507. });
  45508. var ReactDebugCurrentFrame$1 = null;
  45509. {
  45510. ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
  45511. } // A javascript: URL can contain leading C0 control or \u0020 SPACE,
  45512. // and any newline or tab are filtered out as if they're not part of the URL.
  45513. // https://url.spec.whatwg.org/#url-parsing
  45514. // Tab or newline are defined as \r\n\t:
  45515. // https://infra.spec.whatwg.org/#ascii-tab-or-newline
  45516. // A C0 control is a code point in the range \u0000 NULL to \u001F
  45517. // INFORMATION SEPARATOR ONE, inclusive:
  45518. // https://infra.spec.whatwg.org/#c0-control-or-space
  45519. /* eslint-disable max-len */
  45520. var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
  45521. var didWarn = false;
  45522. function sanitizeURL(url) {
  45523. if (disableJavaScriptURLs) {
  45524. if (!!isJavaScriptProtocol.test(url)) {
  45525. {
  45526. throw Error("React has blocked a javascript: URL as a security precaution." + (ReactDebugCurrentFrame$1.getStackAddendum()));
  45527. }
  45528. }
  45529. } else if ( true && !didWarn && isJavaScriptProtocol.test(url)) {
  45530. didWarn = true;
  45531. warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
  45532. }
  45533. }
  45534. // Flow does not allow string concatenation of most non-string types. To work
  45535. // around this limitation, we use an opaque type that can only be obtained by
  45536. // passing the value through getToStringValue first.
  45537. function toString(value) {
  45538. return '' + value;
  45539. }
  45540. function getToStringValue(value) {
  45541. switch (typeof value) {
  45542. case 'boolean':
  45543. case 'number':
  45544. case 'object':
  45545. case 'string':
  45546. case 'undefined':
  45547. return value;
  45548. default:
  45549. // function, symbol are assigned as empty strings
  45550. return '';
  45551. }
  45552. }
  45553. /** Trusted value is a wrapper for "safe" values which can be assigned to DOM execution sinks. */
  45554. /**
  45555. * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML
  45556. * and we do validations that the value is safe. Once we do validation we want to use the validated
  45557. * value instead of the object (because object.toString may return something else on next call).
  45558. *
  45559. * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects.
  45560. */
  45561. var toStringOrTrustedType = toString;
  45562. if (enableTrustedTypesIntegration && typeof trustedTypes !== 'undefined') {
  45563. toStringOrTrustedType = function (value) {
  45564. if (typeof value === 'object' && (trustedTypes.isHTML(value) || trustedTypes.isScript(value) || trustedTypes.isScriptURL(value) ||
  45565. /* TrustedURLs are deprecated and will be removed soon: https://github.com/WICG/trusted-types/pull/204 */
  45566. trustedTypes.isURL && trustedTypes.isURL(value))) {
  45567. // Pass Trusted Types through.
  45568. return value;
  45569. }
  45570. return toString(value);
  45571. };
  45572. }
  45573. /**
  45574. * Set attribute for a node. The attribute value can be either string or
  45575. * Trusted value (if application uses Trusted Types).
  45576. */
  45577. function setAttribute(node, attributeName, attributeValue) {
  45578. node.setAttribute(attributeName, attributeValue);
  45579. }
  45580. /**
  45581. * Set attribute with namespace for a node. The attribute value can be either string or
  45582. * Trusted value (if application uses Trusted Types).
  45583. */
  45584. function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {
  45585. node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
  45586. }
  45587. /**
  45588. * Get the value for a property on a node. Only used in DEV for SSR validation.
  45589. * The "expected" argument is used as a hint of what the expected value is.
  45590. * Some properties have multiple equivalent values.
  45591. */
  45592. function getValueForProperty(node, name, expected, propertyInfo) {
  45593. {
  45594. if (propertyInfo.mustUseProperty) {
  45595. var propertyName = propertyInfo.propertyName;
  45596. return node[propertyName];
  45597. } else {
  45598. if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) {
  45599. // If we haven't fully disabled javascript: URLs, and if
  45600. // the hydration is successful of a javascript: URL, we
  45601. // still want to warn on the client.
  45602. sanitizeURL('' + expected);
  45603. }
  45604. var attributeName = propertyInfo.attributeName;
  45605. var stringValue = null;
  45606. if (propertyInfo.type === OVERLOADED_BOOLEAN) {
  45607. if (node.hasAttribute(attributeName)) {
  45608. var value = node.getAttribute(attributeName);
  45609. if (value === '') {
  45610. return true;
  45611. }
  45612. if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
  45613. return value;
  45614. }
  45615. if (value === '' + expected) {
  45616. return expected;
  45617. }
  45618. return value;
  45619. }
  45620. } else if (node.hasAttribute(attributeName)) {
  45621. if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
  45622. // We had an attribute but shouldn't have had one, so read it
  45623. // for the error message.
  45624. return node.getAttribute(attributeName);
  45625. }
  45626. if (propertyInfo.type === BOOLEAN) {
  45627. // If this was a boolean, it doesn't matter what the value is
  45628. // the fact that we have it is the same as the expected.
  45629. return expected;
  45630. } // Even if this property uses a namespace we use getAttribute
  45631. // because we assume its namespaced name is the same as our config.
  45632. // To use getAttributeNS we need the local name which we don't have
  45633. // in our config atm.
  45634. stringValue = node.getAttribute(attributeName);
  45635. }
  45636. if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
  45637. return stringValue === null ? expected : stringValue;
  45638. } else if (stringValue === '' + expected) {
  45639. return expected;
  45640. } else {
  45641. return stringValue;
  45642. }
  45643. }
  45644. }
  45645. }
  45646. /**
  45647. * Get the value for a attribute on a node. Only used in DEV for SSR validation.
  45648. * The third argument is used as a hint of what the expected value is. Some
  45649. * attributes have multiple equivalent values.
  45650. */
  45651. function getValueForAttribute(node, name, expected) {
  45652. {
  45653. if (!isAttributeNameSafe(name)) {
  45654. return;
  45655. }
  45656. if (!node.hasAttribute(name)) {
  45657. return expected === undefined ? undefined : null;
  45658. }
  45659. var value = node.getAttribute(name);
  45660. if (value === '' + expected) {
  45661. return expected;
  45662. }
  45663. return value;
  45664. }
  45665. }
  45666. /**
  45667. * Sets the value for a property on a node.
  45668. *
  45669. * @param {DOMElement} node
  45670. * @param {string} name
  45671. * @param {*} value
  45672. */
  45673. function setValueForProperty(node, name, value, isCustomComponentTag) {
  45674. var propertyInfo = getPropertyInfo(name);
  45675. if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
  45676. return;
  45677. }
  45678. if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
  45679. value = null;
  45680. } // If the prop isn't in the special list, treat it as a simple attribute.
  45681. if (isCustomComponentTag || propertyInfo === null) {
  45682. if (isAttributeNameSafe(name)) {
  45683. var _attributeName = name;
  45684. if (value === null) {
  45685. node.removeAttribute(_attributeName);
  45686. } else {
  45687. setAttribute(node, _attributeName, toStringOrTrustedType(value));
  45688. }
  45689. }
  45690. return;
  45691. }
  45692. var mustUseProperty = propertyInfo.mustUseProperty;
  45693. if (mustUseProperty) {
  45694. var propertyName = propertyInfo.propertyName;
  45695. if (value === null) {
  45696. var type = propertyInfo.type;
  45697. node[propertyName] = type === BOOLEAN ? false : '';
  45698. } else {
  45699. // Contrary to `setAttribute`, object properties are properly
  45700. // `toString`ed by IE8/9.
  45701. node[propertyName] = value;
  45702. }
  45703. return;
  45704. } // The rest are treated as attributes with special cases.
  45705. var attributeName = propertyInfo.attributeName,
  45706. attributeNamespace = propertyInfo.attributeNamespace;
  45707. if (value === null) {
  45708. node.removeAttribute(attributeName);
  45709. } else {
  45710. var _type = propertyInfo.type;
  45711. var attributeValue;
  45712. if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
  45713. // If attribute type is boolean, we know for sure it won't be an execution sink
  45714. // and we won't require Trusted Type here.
  45715. attributeValue = '';
  45716. } else {
  45717. // `setAttribute` with objects becomes only `[object]` in IE8/9,
  45718. // ('' + value) makes it output the correct toString()-value.
  45719. attributeValue = toStringOrTrustedType(value);
  45720. if (propertyInfo.sanitizeURL) {
  45721. sanitizeURL(attributeValue.toString());
  45722. }
  45723. }
  45724. if (attributeNamespace) {
  45725. setAttributeNS(node, attributeNamespace, attributeName, attributeValue);
  45726. } else {
  45727. setAttribute(node, attributeName, attributeValue);
  45728. }
  45729. }
  45730. }
  45731. var ReactDebugCurrentFrame$2 = null;
  45732. var ReactControlledValuePropTypes = {
  45733. checkPropTypes: null
  45734. };
  45735. {
  45736. ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
  45737. var hasReadOnlyValue = {
  45738. button: true,
  45739. checkbox: true,
  45740. image: true,
  45741. hidden: true,
  45742. radio: true,
  45743. reset: true,
  45744. submit: true
  45745. };
  45746. var propTypes = {
  45747. value: function (props, propName, componentName) {
  45748. if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
  45749. return null;
  45750. }
  45751. return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  45752. },
  45753. checked: function (props, propName, componentName) {
  45754. if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
  45755. return null;
  45756. }
  45757. return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  45758. }
  45759. };
  45760. /**
  45761. * Provide a linked `value` attribute for controlled forms. You should not use
  45762. * this outside of the ReactDOM controlled form components.
  45763. */
  45764. ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
  45765. checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
  45766. };
  45767. }
  45768. function isCheckable(elem) {
  45769. var type = elem.type;
  45770. var nodeName = elem.nodeName;
  45771. return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
  45772. }
  45773. function getTracker(node) {
  45774. return node._valueTracker;
  45775. }
  45776. function detachTracker(node) {
  45777. node._valueTracker = null;
  45778. }
  45779. function getValueFromNode(node) {
  45780. var value = '';
  45781. if (!node) {
  45782. return value;
  45783. }
  45784. if (isCheckable(node)) {
  45785. value = node.checked ? 'true' : 'false';
  45786. } else {
  45787. value = node.value;
  45788. }
  45789. return value;
  45790. }
  45791. function trackValueOnNode(node) {
  45792. var valueField = isCheckable(node) ? 'checked' : 'value';
  45793. var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
  45794. var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail
  45795. // and don't track value will cause over reporting of changes,
  45796. // but it's better then a hard failure
  45797. // (needed for certain tests that spyOn input values and Safari)
  45798. if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
  45799. return;
  45800. }
  45801. var get = descriptor.get,
  45802. set = descriptor.set;
  45803. Object.defineProperty(node, valueField, {
  45804. configurable: true,
  45805. get: function () {
  45806. return get.call(this);
  45807. },
  45808. set: function (value) {
  45809. currentValue = '' + value;
  45810. set.call(this, value);
  45811. }
  45812. }); // We could've passed this the first time
  45813. // but it triggers a bug in IE11 and Edge 14/15.
  45814. // Calling defineProperty() again should be equivalent.
  45815. // https://github.com/facebook/react/issues/11768
  45816. Object.defineProperty(node, valueField, {
  45817. enumerable: descriptor.enumerable
  45818. });
  45819. var tracker = {
  45820. getValue: function () {
  45821. return currentValue;
  45822. },
  45823. setValue: function (value) {
  45824. currentValue = '' + value;
  45825. },
  45826. stopTracking: function () {
  45827. detachTracker(node);
  45828. delete node[valueField];
  45829. }
  45830. };
  45831. return tracker;
  45832. }
  45833. function track(node) {
  45834. if (getTracker(node)) {
  45835. return;
  45836. } // TODO: Once it's just Fiber we can move this to node._wrapperState
  45837. node._valueTracker = trackValueOnNode(node);
  45838. }
  45839. function updateValueIfChanged(node) {
  45840. if (!node) {
  45841. return false;
  45842. }
  45843. var tracker = getTracker(node); // if there is no tracker at this point it's unlikely
  45844. // that trying again will succeed
  45845. if (!tracker) {
  45846. return true;
  45847. }
  45848. var lastValue = tracker.getValue();
  45849. var nextValue = getValueFromNode(node);
  45850. if (nextValue !== lastValue) {
  45851. tracker.setValue(nextValue);
  45852. return true;
  45853. }
  45854. return false;
  45855. }
  45856. // TODO: direct imports like some-package/src/* are bad. Fix me.
  45857. var didWarnValueDefaultValue = false;
  45858. var didWarnCheckedDefaultChecked = false;
  45859. var didWarnControlledToUncontrolled = false;
  45860. var didWarnUncontrolledToControlled = false;
  45861. function isControlled(props) {
  45862. var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  45863. return usesChecked ? props.checked != null : props.value != null;
  45864. }
  45865. /**
  45866. * Implements an <input> host component that allows setting these optional
  45867. * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
  45868. *
  45869. * If `checked` or `value` are not supplied (or null/undefined), user actions
  45870. * that affect the checked state or value will trigger updates to the element.
  45871. *
  45872. * If they are supplied (and not null/undefined), the rendered element will not
  45873. * trigger updates to the element. Instead, the props must change in order for
  45874. * the rendered element to be updated.
  45875. *
  45876. * The rendered element will be initialized as unchecked (or `defaultChecked`)
  45877. * with an empty value (or `defaultValue`).
  45878. *
  45879. * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
  45880. */
  45881. function getHostProps(element, props) {
  45882. var node = element;
  45883. var checked = props.checked;
  45884. var hostProps = _assign({}, props, {
  45885. defaultChecked: undefined,
  45886. defaultValue: undefined,
  45887. value: undefined,
  45888. checked: checked != null ? checked : node._wrapperState.initialChecked
  45889. });
  45890. return hostProps;
  45891. }
  45892. function initWrapperState(element, props) {
  45893. {
  45894. ReactControlledValuePropTypes.checkPropTypes('input', props);
  45895. if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
  45896. warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
  45897. didWarnCheckedDefaultChecked = true;
  45898. }
  45899. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  45900. warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
  45901. didWarnValueDefaultValue = true;
  45902. }
  45903. }
  45904. var node = element;
  45905. var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
  45906. node._wrapperState = {
  45907. initialChecked: props.checked != null ? props.checked : props.defaultChecked,
  45908. initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
  45909. controlled: isControlled(props)
  45910. };
  45911. }
  45912. function updateChecked(element, props) {
  45913. var node = element;
  45914. var checked = props.checked;
  45915. if (checked != null) {
  45916. setValueForProperty(node, 'checked', checked, false);
  45917. }
  45918. }
  45919. function updateWrapper(element, props) {
  45920. var node = element;
  45921. {
  45922. var controlled = isControlled(props);
  45923. if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
  45924. warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
  45925. didWarnUncontrolledToControlled = true;
  45926. }
  45927. if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
  45928. warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
  45929. didWarnControlledToUncontrolled = true;
  45930. }
  45931. }
  45932. updateChecked(element, props);
  45933. var value = getToStringValue(props.value);
  45934. var type = props.type;
  45935. if (value != null) {
  45936. if (type === 'number') {
  45937. if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.
  45938. // eslint-disable-next-line
  45939. node.value != value) {
  45940. node.value = toString(value);
  45941. }
  45942. } else if (node.value !== toString(value)) {
  45943. node.value = toString(value);
  45944. }
  45945. } else if (type === 'submit' || type === 'reset') {
  45946. // Submit/reset inputs need the attribute removed completely to avoid
  45947. // blank-text buttons.
  45948. node.removeAttribute('value');
  45949. return;
  45950. }
  45951. if (disableInputAttributeSyncing) {
  45952. // When not syncing the value attribute, React only assigns a new value
  45953. // whenever the defaultValue React prop has changed. When not present,
  45954. // React does nothing
  45955. if (props.hasOwnProperty('defaultValue')) {
  45956. setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
  45957. }
  45958. } else {
  45959. // When syncing the value attribute, the value comes from a cascade of
  45960. // properties:
  45961. // 1. The value React property
  45962. // 2. The defaultValue React property
  45963. // 3. Otherwise there should be no change
  45964. if (props.hasOwnProperty('value')) {
  45965. setDefaultValue(node, props.type, value);
  45966. } else if (props.hasOwnProperty('defaultValue')) {
  45967. setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
  45968. }
  45969. }
  45970. if (disableInputAttributeSyncing) {
  45971. // When not syncing the checked attribute, the attribute is directly
  45972. // controllable from the defaultValue React property. It needs to be
  45973. // updated as new props come in.
  45974. if (props.defaultChecked == null) {
  45975. node.removeAttribute('checked');
  45976. } else {
  45977. node.defaultChecked = !!props.defaultChecked;
  45978. }
  45979. } else {
  45980. // When syncing the checked attribute, it only changes when it needs
  45981. // to be removed, such as transitioning from a checkbox into a text input
  45982. if (props.checked == null && props.defaultChecked != null) {
  45983. node.defaultChecked = !!props.defaultChecked;
  45984. }
  45985. }
  45986. }
  45987. function postMountWrapper(element, props, isHydrating) {
  45988. var node = element; // Do not assign value if it is already set. This prevents user text input
  45989. // from being lost during SSR hydration.
  45990. if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
  45991. var type = props.type;
  45992. var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the
  45993. // default value provided by the browser. See: #12872
  45994. if (isButton && (props.value === undefined || props.value === null)) {
  45995. return;
  45996. }
  45997. var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input
  45998. // from being lost during SSR hydration.
  45999. if (!isHydrating) {
  46000. if (disableInputAttributeSyncing) {
  46001. var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points
  46002. // directly to the React prop. Only assign it if it exists.
  46003. if (value != null) {
  46004. // Always assign on buttons so that it is possible to assign an
  46005. // empty string to clear button text.
  46006. //
  46007. // Otherwise, do not re-assign the value property if is empty. This
  46008. // potentially avoids a DOM write and prevents Firefox (~60.0.1) from
  46009. // prematurely marking required inputs as invalid. Equality is compared
  46010. // to the current value in case the browser provided value is not an
  46011. // empty string.
  46012. if (isButton || value !== node.value) {
  46013. node.value = toString(value);
  46014. }
  46015. }
  46016. } else {
  46017. // When syncing the value attribute, the value property should use
  46018. // the wrapperState._initialValue property. This uses:
  46019. //
  46020. // 1. The value React property when present
  46021. // 2. The defaultValue React property when present
  46022. // 3. An empty string
  46023. if (initialValue !== node.value) {
  46024. node.value = initialValue;
  46025. }
  46026. }
  46027. }
  46028. if (disableInputAttributeSyncing) {
  46029. // When not syncing the value attribute, assign the value attribute
  46030. // directly from the defaultValue React property (when present)
  46031. var defaultValue = getToStringValue(props.defaultValue);
  46032. if (defaultValue != null) {
  46033. node.defaultValue = toString(defaultValue);
  46034. }
  46035. } else {
  46036. // Otherwise, the value attribute is synchronized to the property,
  46037. // so we assign defaultValue to the same thing as the value property
  46038. // assignment step above.
  46039. node.defaultValue = initialValue;
  46040. }
  46041. } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  46042. // this is needed to work around a chrome bug where setting defaultChecked
  46043. // will sometimes influence the value of checked (even after detachment).
  46044. // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  46045. // We need to temporarily unset name to avoid disrupting radio button groups.
  46046. var name = node.name;
  46047. if (name !== '') {
  46048. node.name = '';
  46049. }
  46050. if (disableInputAttributeSyncing) {
  46051. // When not syncing the checked attribute, the checked property
  46052. // never gets assigned. It must be manually set. We don't want
  46053. // to do this when hydrating so that existing user input isn't
  46054. // modified
  46055. if (!isHydrating) {
  46056. updateChecked(element, props);
  46057. } // Only assign the checked attribute if it is defined. This saves
  46058. // a DOM write when controlling the checked attribute isn't needed
  46059. // (text inputs, submit/reset)
  46060. if (props.hasOwnProperty('defaultChecked')) {
  46061. node.defaultChecked = !node.defaultChecked;
  46062. node.defaultChecked = !!props.defaultChecked;
  46063. }
  46064. } else {
  46065. // When syncing the checked attribute, both the checked property and
  46066. // attribute are assigned at the same time using defaultChecked. This uses:
  46067. //
  46068. // 1. The checked React property when present
  46069. // 2. The defaultChecked React property when present
  46070. // 3. Otherwise, false
  46071. node.defaultChecked = !node.defaultChecked;
  46072. node.defaultChecked = !!node._wrapperState.initialChecked;
  46073. }
  46074. if (name !== '') {
  46075. node.name = name;
  46076. }
  46077. }
  46078. function restoreControlledState$1(element, props) {
  46079. var node = element;
  46080. updateWrapper(node, props);
  46081. updateNamedCousins(node, props);
  46082. }
  46083. function updateNamedCousins(rootNode, props) {
  46084. var name = props.name;
  46085. if (props.type === 'radio' && name != null) {
  46086. var queryRoot = rootNode;
  46087. while (queryRoot.parentNode) {
  46088. queryRoot = queryRoot.parentNode;
  46089. } // If `rootNode.form` was non-null, then we could try `form.elements`,
  46090. // but that sometimes behaves strangely in IE8. We could also try using
  46091. // `form.getElementsByName`, but that will only return direct children
  46092. // and won't include inputs that use the HTML5 `form=` attribute. Since
  46093. // the input might not even be in a form. It might not even be in the
  46094. // document. Let's just use the local `querySelectorAll` to ensure we don't
  46095. // miss anything.
  46096. var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
  46097. for (var i = 0; i < group.length; i++) {
  46098. var otherNode = group[i];
  46099. if (otherNode === rootNode || otherNode.form !== rootNode.form) {
  46100. continue;
  46101. } // This will throw if radio buttons rendered by different copies of React
  46102. // and the same name are rendered into the same form (same as #1939).
  46103. // That's probably okay; we don't support it just as we don't support
  46104. // mixing React radio buttons with non-React ones.
  46105. var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
  46106. if (!otherProps) {
  46107. {
  46108. throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
  46109. }
  46110. } // We need update the tracked value on the named cousin since the value
  46111. // was changed but the input saw no event or value set
  46112. updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that
  46113. // was previously checked to update will cause it to be come re-checked
  46114. // as appropriate.
  46115. updateWrapper(otherNode, otherProps);
  46116. }
  46117. }
  46118. } // In Chrome, assigning defaultValue to certain input types triggers input validation.
  46119. // For number inputs, the display value loses trailing decimal points. For email inputs,
  46120. // Chrome raises "The specified value <x> is not a valid email address".
  46121. //
  46122. // Here we check to see if the defaultValue has actually changed, avoiding these problems
  46123. // when the user is inputting text
  46124. //
  46125. // https://github.com/facebook/react/issues/7253
  46126. function setDefaultValue(node, type, value) {
  46127. if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
  46128. type !== 'number' || node.ownerDocument.activeElement !== node) {
  46129. if (value == null) {
  46130. node.defaultValue = toString(node._wrapperState.initialValue);
  46131. } else if (node.defaultValue !== toString(value)) {
  46132. node.defaultValue = toString(value);
  46133. }
  46134. }
  46135. }
  46136. var didWarnSelectedSetOnOption = false;
  46137. var didWarnInvalidChild = false;
  46138. function flattenChildren(children) {
  46139. var content = ''; // Flatten children. We'll warn if they are invalid
  46140. // during validateProps() which runs for hydration too.
  46141. // Note that this would throw on non-element objects.
  46142. // Elements are stringified (which is normally irrelevant
  46143. // but matters for <fbt>).
  46144. React.Children.forEach(children, function (child) {
  46145. if (child == null) {
  46146. return;
  46147. }
  46148. content += child; // Note: we don't warn about invalid children here.
  46149. // Instead, this is done separately below so that
  46150. // it happens during the hydration codepath too.
  46151. });
  46152. return content;
  46153. }
  46154. /**
  46155. * Implements an <option> host component that warns when `selected` is set.
  46156. */
  46157. function validateProps(element, props) {
  46158. {
  46159. // This mirrors the codepath above, but runs for hydration too.
  46160. // Warn about invalid children here so that client and hydration are consistent.
  46161. // TODO: this seems like it could cause a DEV-only throw for hydration
  46162. // if children contains a non-element object. We should try to avoid that.
  46163. if (typeof props.children === 'object' && props.children !== null) {
  46164. React.Children.forEach(props.children, function (child) {
  46165. if (child == null) {
  46166. return;
  46167. }
  46168. if (typeof child === 'string' || typeof child === 'number') {
  46169. return;
  46170. }
  46171. if (typeof child.type !== 'string') {
  46172. return;
  46173. }
  46174. if (!didWarnInvalidChild) {
  46175. didWarnInvalidChild = true;
  46176. warning$1(false, 'Only strings and numbers are supported as <option> children.');
  46177. }
  46178. });
  46179. } // TODO: Remove support for `selected` in <option>.
  46180. if (props.selected != null && !didWarnSelectedSetOnOption) {
  46181. warning$1(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
  46182. didWarnSelectedSetOnOption = true;
  46183. }
  46184. }
  46185. }
  46186. function postMountWrapper$1(element, props) {
  46187. // value="" should make a value attribute (#6219)
  46188. if (props.value != null) {
  46189. element.setAttribute('value', toString(getToStringValue(props.value)));
  46190. }
  46191. }
  46192. function getHostProps$1(element, props) {
  46193. var hostProps = _assign({
  46194. children: undefined
  46195. }, props);
  46196. var content = flattenChildren(props.children);
  46197. if (content) {
  46198. hostProps.children = content;
  46199. }
  46200. return hostProps;
  46201. }
  46202. // TODO: direct imports like some-package/src/* are bad. Fix me.
  46203. var didWarnValueDefaultValue$1;
  46204. {
  46205. didWarnValueDefaultValue$1 = false;
  46206. }
  46207. function getDeclarationErrorAddendum() {
  46208. var ownerName = getCurrentFiberOwnerNameInDevOrNull();
  46209. if (ownerName) {
  46210. return '\n\nCheck the render method of `' + ownerName + '`.';
  46211. }
  46212. return '';
  46213. }
  46214. var valuePropNames = ['value', 'defaultValue'];
  46215. /**
  46216. * Validation function for `value` and `defaultValue`.
  46217. */
  46218. function checkSelectPropTypes(props) {
  46219. ReactControlledValuePropTypes.checkPropTypes('select', props);
  46220. for (var i = 0; i < valuePropNames.length; i++) {
  46221. var propName = valuePropNames[i];
  46222. if (props[propName] == null) {
  46223. continue;
  46224. }
  46225. var isArray = Array.isArray(props[propName]);
  46226. if (props.multiple && !isArray) {
  46227. warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
  46228. } else if (!props.multiple && isArray) {
  46229. warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
  46230. }
  46231. }
  46232. }
  46233. function updateOptions(node, multiple, propValue, setDefaultSelected) {
  46234. var options = node.options;
  46235. if (multiple) {
  46236. var selectedValues = propValue;
  46237. var selectedValue = {};
  46238. for (var i = 0; i < selectedValues.length; i++) {
  46239. // Prefix to avoid chaos with special keys.
  46240. selectedValue['$' + selectedValues[i]] = true;
  46241. }
  46242. for (var _i = 0; _i < options.length; _i++) {
  46243. var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
  46244. if (options[_i].selected !== selected) {
  46245. options[_i].selected = selected;
  46246. }
  46247. if (selected && setDefaultSelected) {
  46248. options[_i].defaultSelected = true;
  46249. }
  46250. }
  46251. } else {
  46252. // Do not set `select.value` as exact behavior isn't consistent across all
  46253. // browsers for all cases.
  46254. var _selectedValue = toString(getToStringValue(propValue));
  46255. var defaultSelected = null;
  46256. for (var _i2 = 0; _i2 < options.length; _i2++) {
  46257. if (options[_i2].value === _selectedValue) {
  46258. options[_i2].selected = true;
  46259. if (setDefaultSelected) {
  46260. options[_i2].defaultSelected = true;
  46261. }
  46262. return;
  46263. }
  46264. if (defaultSelected === null && !options[_i2].disabled) {
  46265. defaultSelected = options[_i2];
  46266. }
  46267. }
  46268. if (defaultSelected !== null) {
  46269. defaultSelected.selected = true;
  46270. }
  46271. }
  46272. }
  46273. /**
  46274. * Implements a <select> host component that allows optionally setting the
  46275. * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
  46276. * stringable. If `multiple` is true, the prop must be an array of stringables.
  46277. *
  46278. * If `value` is not supplied (or null/undefined), user actions that change the
  46279. * selected option will trigger updates to the rendered options.
  46280. *
  46281. * If it is supplied (and not null/undefined), the rendered options will not
  46282. * update in response to user actions. Instead, the `value` prop must change in
  46283. * order for the rendered options to update.
  46284. *
  46285. * If `defaultValue` is provided, any options with the supplied values will be
  46286. * selected.
  46287. */
  46288. function getHostProps$2(element, props) {
  46289. return _assign({}, props, {
  46290. value: undefined
  46291. });
  46292. }
  46293. function initWrapperState$1(element, props) {
  46294. var node = element;
  46295. {
  46296. checkSelectPropTypes(props);
  46297. }
  46298. node._wrapperState = {
  46299. wasMultiple: !!props.multiple
  46300. };
  46301. {
  46302. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
  46303. warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
  46304. didWarnValueDefaultValue$1 = true;
  46305. }
  46306. }
  46307. }
  46308. function postMountWrapper$2(element, props) {
  46309. var node = element;
  46310. node.multiple = !!props.multiple;
  46311. var value = props.value;
  46312. if (value != null) {
  46313. updateOptions(node, !!props.multiple, value, false);
  46314. } else if (props.defaultValue != null) {
  46315. updateOptions(node, !!props.multiple, props.defaultValue, true);
  46316. }
  46317. }
  46318. function postUpdateWrapper(element, props) {
  46319. var node = element;
  46320. var wasMultiple = node._wrapperState.wasMultiple;
  46321. node._wrapperState.wasMultiple = !!props.multiple;
  46322. var value = props.value;
  46323. if (value != null) {
  46324. updateOptions(node, !!props.multiple, value, false);
  46325. } else if (wasMultiple !== !!props.multiple) {
  46326. // For simplicity, reapply `defaultValue` if `multiple` is toggled.
  46327. if (props.defaultValue != null) {
  46328. updateOptions(node, !!props.multiple, props.defaultValue, true);
  46329. } else {
  46330. // Revert the select back to its default unselected state.
  46331. updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
  46332. }
  46333. }
  46334. }
  46335. function restoreControlledState$2(element, props) {
  46336. var node = element;
  46337. var value = props.value;
  46338. if (value != null) {
  46339. updateOptions(node, !!props.multiple, value, false);
  46340. }
  46341. }
  46342. var didWarnValDefaultVal = false;
  46343. /**
  46344. * Implements a <textarea> host component that allows setting `value`, and
  46345. * `defaultValue`. This differs from the traditional DOM API because value is
  46346. * usually set as PCDATA children.
  46347. *
  46348. * If `value` is not supplied (or null/undefined), user actions that affect the
  46349. * value will trigger updates to the element.
  46350. *
  46351. * If `value` is supplied (and not null/undefined), the rendered element will
  46352. * not trigger updates to the element. Instead, the `value` prop must change in
  46353. * order for the rendered element to be updated.
  46354. *
  46355. * The rendered element will be initialized with an empty value, the prop
  46356. * `defaultValue` if specified, or the children content (deprecated).
  46357. */
  46358. function getHostProps$3(element, props) {
  46359. var node = element;
  46360. if (!(props.dangerouslySetInnerHTML == null)) {
  46361. {
  46362. throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
  46363. }
  46364. } // Always set children to the same thing. In IE9, the selection range will
  46365. // get reset if `textContent` is mutated. We could add a check in setTextContent
  46366. // to only set the value if/when the value differs from the node value (which would
  46367. // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
  46368. // solution. The value can be a boolean or object so that's why it's forced
  46369. // to be a string.
  46370. var hostProps = _assign({}, props, {
  46371. value: undefined,
  46372. defaultValue: undefined,
  46373. children: toString(node._wrapperState.initialValue)
  46374. });
  46375. return hostProps;
  46376. }
  46377. function initWrapperState$2(element, props) {
  46378. var node = element;
  46379. {
  46380. ReactControlledValuePropTypes.checkPropTypes('textarea', props);
  46381. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
  46382. warning$1(false, '%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
  46383. didWarnValDefaultVal = true;
  46384. }
  46385. }
  46386. var initialValue = props.value; // Only bother fetching default value if we're going to use it
  46387. if (initialValue == null) {
  46388. var defaultValue = props.defaultValue; // TODO (yungsters): Remove support for children content in <textarea>.
  46389. var children = props.children;
  46390. if (children != null) {
  46391. {
  46392. warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
  46393. }
  46394. if (!(defaultValue == null)) {
  46395. {
  46396. throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
  46397. }
  46398. }
  46399. if (Array.isArray(children)) {
  46400. if (!(children.length <= 1)) {
  46401. {
  46402. throw Error("<textarea> can only have at most one child.");
  46403. }
  46404. }
  46405. children = children[0];
  46406. }
  46407. defaultValue = children;
  46408. }
  46409. if (defaultValue == null) {
  46410. defaultValue = '';
  46411. }
  46412. initialValue = defaultValue;
  46413. }
  46414. node._wrapperState = {
  46415. initialValue: getToStringValue(initialValue)
  46416. };
  46417. }
  46418. function updateWrapper$1(element, props) {
  46419. var node = element;
  46420. var value = getToStringValue(props.value);
  46421. var defaultValue = getToStringValue(props.defaultValue);
  46422. if (value != null) {
  46423. // Cast `value` to a string to ensure the value is set correctly. While
  46424. // browsers typically do this as necessary, jsdom doesn't.
  46425. var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed
  46426. if (newValue !== node.value) {
  46427. node.value = newValue;
  46428. }
  46429. if (props.defaultValue == null && node.defaultValue !== newValue) {
  46430. node.defaultValue = newValue;
  46431. }
  46432. }
  46433. if (defaultValue != null) {
  46434. node.defaultValue = toString(defaultValue);
  46435. }
  46436. }
  46437. function postMountWrapper$3(element, props) {
  46438. var node = element; // This is in postMount because we need access to the DOM node, which is not
  46439. // available until after the component has mounted.
  46440. var textContent = node.textContent; // Only set node.value if textContent is equal to the expected
  46441. // initial value. In IE10/IE11 there is a bug where the placeholder attribute
  46442. // will populate textContent as well.
  46443. // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
  46444. if (textContent === node._wrapperState.initialValue) {
  46445. if (textContent !== '' && textContent !== null) {
  46446. node.value = textContent;
  46447. }
  46448. }
  46449. }
  46450. function restoreControlledState$3(element, props) {
  46451. // DOM component is still mounted; update
  46452. updateWrapper$1(element, props);
  46453. }
  46454. var HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';
  46455. var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
  46456. var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
  46457. var Namespaces = {
  46458. html: HTML_NAMESPACE$1,
  46459. mathml: MATH_NAMESPACE,
  46460. svg: SVG_NAMESPACE
  46461. }; // Assumes there is no parent namespace.
  46462. function getIntrinsicNamespace(type) {
  46463. switch (type) {
  46464. case 'svg':
  46465. return SVG_NAMESPACE;
  46466. case 'math':
  46467. return MATH_NAMESPACE;
  46468. default:
  46469. return HTML_NAMESPACE$1;
  46470. }
  46471. }
  46472. function getChildNamespace(parentNamespace, type) {
  46473. if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {
  46474. // No (or default) parent namespace: potential entry point.
  46475. return getIntrinsicNamespace(type);
  46476. }
  46477. if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
  46478. // We're leaving SVG.
  46479. return HTML_NAMESPACE$1;
  46480. } // By default, pass namespace below.
  46481. return parentNamespace;
  46482. }
  46483. /* globals MSApp */
  46484. /**
  46485. * Create a function which has 'unsafe' privileges (required by windows8 apps)
  46486. */
  46487. var createMicrosoftUnsafeLocalFunction = function (func) {
  46488. if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
  46489. return function (arg0, arg1, arg2, arg3) {
  46490. MSApp.execUnsafeLocalFunction(function () {
  46491. return func(arg0, arg1, arg2, arg3);
  46492. });
  46493. };
  46494. } else {
  46495. return func;
  46496. }
  46497. };
  46498. var reusableSVGContainer;
  46499. /**
  46500. * Set the innerHTML property of a node
  46501. *
  46502. * @param {DOMElement} node
  46503. * @param {string} html
  46504. * @internal
  46505. */
  46506. var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  46507. if (node.namespaceURI === Namespaces.svg) {
  46508. {
  46509. if (enableTrustedTypesIntegration) {
  46510. // TODO: reconsider the text of this warning and when it should show
  46511. // before enabling the feature flag.
  46512. !(typeof trustedTypes === 'undefined') ? warning$1(false, "Using 'dangerouslySetInnerHTML' in an svg element with " + 'Trusted Types enabled in an Internet Explorer will cause ' + 'the trusted value to be converted to string. Assigning string ' + "to 'innerHTML' will throw an error if Trusted Types are enforced. " + "You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' " + 'on the enclosing div instead.') : void 0;
  46513. }
  46514. }
  46515. if (!('innerHTML' in node)) {
  46516. // IE does not have innerHTML for SVG nodes, so instead we inject the
  46517. // new markup in a temp node and then move the child nodes across into
  46518. // the target node
  46519. reusableSVGContainer = reusableSVGContainer || document.createElement('div');
  46520. reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';
  46521. var svgNode = reusableSVGContainer.firstChild;
  46522. while (node.firstChild) {
  46523. node.removeChild(node.firstChild);
  46524. }
  46525. while (svgNode.firstChild) {
  46526. node.appendChild(svgNode.firstChild);
  46527. }
  46528. return;
  46529. }
  46530. }
  46531. node.innerHTML = html;
  46532. });
  46533. /**
  46534. * HTML nodeType values that represent the type of the node
  46535. */
  46536. var ELEMENT_NODE = 1;
  46537. var TEXT_NODE = 3;
  46538. var COMMENT_NODE = 8;
  46539. var DOCUMENT_NODE = 9;
  46540. var DOCUMENT_FRAGMENT_NODE = 11;
  46541. /**
  46542. * Set the textContent property of a node. For text updates, it's faster
  46543. * to set the `nodeValue` of the Text node directly instead of using
  46544. * `.textContent` which will remove the existing node and create a new one.
  46545. *
  46546. * @param {DOMElement} node
  46547. * @param {string} text
  46548. * @internal
  46549. */
  46550. var setTextContent = function (node, text) {
  46551. if (text) {
  46552. var firstChild = node.firstChild;
  46553. if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
  46554. firstChild.nodeValue = text;
  46555. return;
  46556. }
  46557. }
  46558. node.textContent = text;
  46559. };
  46560. // Do not use the below two methods directly!
  46561. // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
  46562. // (It is the only module that is allowed to access these methods.)
  46563. function unsafeCastStringToDOMTopLevelType(topLevelType) {
  46564. return topLevelType;
  46565. }
  46566. function unsafeCastDOMTopLevelTypeToString(topLevelType) {
  46567. return topLevelType;
  46568. }
  46569. /**
  46570. * Generate a mapping of standard vendor prefixes using the defined style property and event name.
  46571. *
  46572. * @param {string} styleProp
  46573. * @param {string} eventName
  46574. * @returns {object}
  46575. */
  46576. function makePrefixMap(styleProp, eventName) {
  46577. var prefixes = {};
  46578. prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  46579. prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  46580. prefixes['Moz' + styleProp] = 'moz' + eventName;
  46581. return prefixes;
  46582. }
  46583. /**
  46584. * A list of event names to a configurable list of vendor prefixes.
  46585. */
  46586. var vendorPrefixes = {
  46587. animationend: makePrefixMap('Animation', 'AnimationEnd'),
  46588. animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  46589. animationstart: makePrefixMap('Animation', 'AnimationStart'),
  46590. transitionend: makePrefixMap('Transition', 'TransitionEnd')
  46591. };
  46592. /**
  46593. * Event names that have already been detected and prefixed (if applicable).
  46594. */
  46595. var prefixedEventNames = {};
  46596. /**
  46597. * Element to check for prefixes on.
  46598. */
  46599. var style = {};
  46600. /**
  46601. * Bootstrap if a DOM exists.
  46602. */
  46603. if (canUseDOM) {
  46604. style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,
  46605. // the un-prefixed "animation" and "transition" properties are defined on the
  46606. // style object but the events that fire will still be prefixed, so we need
  46607. // to check if the un-prefixed events are usable, and if not remove them from the map.
  46608. if (!('AnimationEvent' in window)) {
  46609. delete vendorPrefixes.animationend.animation;
  46610. delete vendorPrefixes.animationiteration.animation;
  46611. delete vendorPrefixes.animationstart.animation;
  46612. } // Same as above
  46613. if (!('TransitionEvent' in window)) {
  46614. delete vendorPrefixes.transitionend.transition;
  46615. }
  46616. }
  46617. /**
  46618. * Attempts to determine the correct vendor prefixed event name.
  46619. *
  46620. * @param {string} eventName
  46621. * @returns {string}
  46622. */
  46623. function getVendorPrefixedEventName(eventName) {
  46624. if (prefixedEventNames[eventName]) {
  46625. return prefixedEventNames[eventName];
  46626. } else if (!vendorPrefixes[eventName]) {
  46627. return eventName;
  46628. }
  46629. var prefixMap = vendorPrefixes[eventName];
  46630. for (var styleProp in prefixMap) {
  46631. if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
  46632. return prefixedEventNames[eventName] = prefixMap[styleProp];
  46633. }
  46634. }
  46635. return eventName;
  46636. }
  46637. /**
  46638. * To identify top level events in ReactDOM, we use constants defined by this
  46639. * module. This is the only module that uses the unsafe* methods to express
  46640. * that the constants actually correspond to the browser event names. This lets
  46641. * us save some bundle size by avoiding a top level type -> event name map.
  46642. * The rest of ReactDOM code should import top level types from this file.
  46643. */
  46644. var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
  46645. var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
  46646. var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
  46647. var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
  46648. var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
  46649. var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
  46650. var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
  46651. var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
  46652. var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
  46653. var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
  46654. var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
  46655. var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
  46656. var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
  46657. var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
  46658. var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
  46659. var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
  46660. var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
  46661. var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
  46662. var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
  46663. var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
  46664. var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
  46665. var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
  46666. var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
  46667. var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
  46668. var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
  46669. var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
  46670. var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
  46671. var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
  46672. var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
  46673. var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
  46674. var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
  46675. var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
  46676. var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
  46677. var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
  46678. var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
  46679. var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
  46680. var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
  46681. var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
  46682. var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
  46683. var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
  46684. var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
  46685. var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
  46686. var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
  46687. var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
  46688. var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
  46689. var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
  46690. var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
  46691. var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
  46692. var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
  46693. var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
  46694. var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
  46695. var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
  46696. var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
  46697. var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
  46698. var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
  46699. var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
  46700. var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
  46701. var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
  46702. var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
  46703. var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
  46704. var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
  46705. var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
  46706. var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
  46707. var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
  46708. var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
  46709. var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
  46710. var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
  46711. var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
  46712. var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
  46713. var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
  46714. var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
  46715. var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
  46716. var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
  46717. var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
  46718. var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
  46719. var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
  46720. var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
  46721. var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
  46722. var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
  46723. var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.
  46724. // Note that events in this list will *not* be listened to at the top level
  46725. // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
  46726. var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
  46727. function getRawEventName(topLevelType) {
  46728. return unsafeCastDOMTopLevelTypeToString(topLevelType);
  46729. }
  46730. /**
  46731. * `ReactInstanceMap` maintains a mapping from a public facing stateful
  46732. * instance (key) and the internal representation (value). This allows public
  46733. * methods to accept the user facing instance as an argument and map them back
  46734. * to internal methods.
  46735. *
  46736. * Note that this module is currently shared and assumed to be stateless.
  46737. * If this becomes an actual Map, that will break.
  46738. */
  46739. /**
  46740. * This API should be called `delete` but we'd have to make sure to always
  46741. * transform these to strings for IE support. When this transform is fully
  46742. * supported we can rename it.
  46743. */
  46744. function get(key) {
  46745. return key._reactInternalFiber;
  46746. }
  46747. function has(key) {
  46748. return key._reactInternalFiber !== undefined;
  46749. }
  46750. function set(key, value) {
  46751. key._reactInternalFiber = value;
  46752. }
  46753. // Don't change these two values. They're used by React Dev Tools.
  46754. var NoEffect =
  46755. /* */
  46756. 0;
  46757. var PerformedWork =
  46758. /* */
  46759. 1; // You can change the rest (and add more).
  46760. var Placement =
  46761. /* */
  46762. 2;
  46763. var Update =
  46764. /* */
  46765. 4;
  46766. var PlacementAndUpdate =
  46767. /* */
  46768. 6;
  46769. var Deletion =
  46770. /* */
  46771. 8;
  46772. var ContentReset =
  46773. /* */
  46774. 16;
  46775. var Callback =
  46776. /* */
  46777. 32;
  46778. var DidCapture =
  46779. /* */
  46780. 64;
  46781. var Ref =
  46782. /* */
  46783. 128;
  46784. var Snapshot =
  46785. /* */
  46786. 256;
  46787. var Passive =
  46788. /* */
  46789. 512;
  46790. var Hydrating =
  46791. /* */
  46792. 1024;
  46793. var HydratingAndUpdate =
  46794. /* */
  46795. 1028; // Passive & Update & Callback & Ref & Snapshot
  46796. var LifecycleEffectMask =
  46797. /* */
  46798. 932; // Union of all host effects
  46799. var HostEffectMask =
  46800. /* */
  46801. 2047;
  46802. var Incomplete =
  46803. /* */
  46804. 2048;
  46805. var ShouldCapture =
  46806. /* */
  46807. 4096;
  46808. var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
  46809. function getNearestMountedFiber(fiber) {
  46810. var node = fiber;
  46811. var nearestMounted = fiber;
  46812. if (!fiber.alternate) {
  46813. // If there is no alternate, this might be a new tree that isn't inserted
  46814. // yet. If it is, then it will have a pending insertion effect on it.
  46815. var nextNode = node;
  46816. do {
  46817. node = nextNode;
  46818. if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {
  46819. // This is an insertion or in-progress hydration. The nearest possible
  46820. // mounted fiber is the parent but we need to continue to figure out
  46821. // if that one is still mounted.
  46822. nearestMounted = node.return;
  46823. }
  46824. nextNode = node.return;
  46825. } while (nextNode);
  46826. } else {
  46827. while (node.return) {
  46828. node = node.return;
  46829. }
  46830. }
  46831. if (node.tag === HostRoot) {
  46832. // TODO: Check if this was a nested HostRoot when used with
  46833. // renderContainerIntoSubtree.
  46834. return nearestMounted;
  46835. } // If we didn't hit the root, that means that we're in an disconnected tree
  46836. // that has been unmounted.
  46837. return null;
  46838. }
  46839. function getSuspenseInstanceFromFiber(fiber) {
  46840. if (fiber.tag === SuspenseComponent) {
  46841. var suspenseState = fiber.memoizedState;
  46842. if (suspenseState === null) {
  46843. var current = fiber.alternate;
  46844. if (current !== null) {
  46845. suspenseState = current.memoizedState;
  46846. }
  46847. }
  46848. if (suspenseState !== null) {
  46849. return suspenseState.dehydrated;
  46850. }
  46851. }
  46852. return null;
  46853. }
  46854. function getContainerFromFiber(fiber) {
  46855. return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
  46856. }
  46857. function isFiberMounted(fiber) {
  46858. return getNearestMountedFiber(fiber) === fiber;
  46859. }
  46860. function isMounted(component) {
  46861. {
  46862. var owner = ReactCurrentOwner.current;
  46863. if (owner !== null && owner.tag === ClassComponent) {
  46864. var ownerFiber = owner;
  46865. var instance = ownerFiber.stateNode;
  46866. !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
  46867. instance._warnedAboutRefsInRender = true;
  46868. }
  46869. }
  46870. var fiber = get(component);
  46871. if (!fiber) {
  46872. return false;
  46873. }
  46874. return getNearestMountedFiber(fiber) === fiber;
  46875. }
  46876. function assertIsMounted(fiber) {
  46877. if (!(getNearestMountedFiber(fiber) === fiber)) {
  46878. {
  46879. throw Error("Unable to find node on an unmounted component.");
  46880. }
  46881. }
  46882. }
  46883. function findCurrentFiberUsingSlowPath(fiber) {
  46884. var alternate = fiber.alternate;
  46885. if (!alternate) {
  46886. // If there is no alternate, then we only need to check if it is mounted.
  46887. var nearestMounted = getNearestMountedFiber(fiber);
  46888. if (!(nearestMounted !== null)) {
  46889. {
  46890. throw Error("Unable to find node on an unmounted component.");
  46891. }
  46892. }
  46893. if (nearestMounted !== fiber) {
  46894. return null;
  46895. }
  46896. return fiber;
  46897. } // If we have two possible branches, we'll walk backwards up to the root
  46898. // to see what path the root points to. On the way we may hit one of the
  46899. // special cases and we'll deal with them.
  46900. var a = fiber;
  46901. var b = alternate;
  46902. while (true) {
  46903. var parentA = a.return;
  46904. if (parentA === null) {
  46905. // We're at the root.
  46906. break;
  46907. }
  46908. var parentB = parentA.alternate;
  46909. if (parentB === null) {
  46910. // There is no alternate. This is an unusual case. Currently, it only
  46911. // happens when a Suspense component is hidden. An extra fragment fiber
  46912. // is inserted in between the Suspense fiber and its children. Skip
  46913. // over this extra fragment fiber and proceed to the next parent.
  46914. var nextParent = parentA.return;
  46915. if (nextParent !== null) {
  46916. a = b = nextParent;
  46917. continue;
  46918. } // If there's no parent, we're at the root.
  46919. break;
  46920. } // If both copies of the parent fiber point to the same child, we can
  46921. // assume that the child is current. This happens when we bailout on low
  46922. // priority: the bailed out fiber's child reuses the current child.
  46923. if (parentA.child === parentB.child) {
  46924. var child = parentA.child;
  46925. while (child) {
  46926. if (child === a) {
  46927. // We've determined that A is the current branch.
  46928. assertIsMounted(parentA);
  46929. return fiber;
  46930. }
  46931. if (child === b) {
  46932. // We've determined that B is the current branch.
  46933. assertIsMounted(parentA);
  46934. return alternate;
  46935. }
  46936. child = child.sibling;
  46937. } // We should never have an alternate for any mounting node. So the only
  46938. // way this could possibly happen is if this was unmounted, if at all.
  46939. {
  46940. {
  46941. throw Error("Unable to find node on an unmounted component.");
  46942. }
  46943. }
  46944. }
  46945. if (a.return !== b.return) {
  46946. // The return pointer of A and the return pointer of B point to different
  46947. // fibers. We assume that return pointers never criss-cross, so A must
  46948. // belong to the child set of A.return, and B must belong to the child
  46949. // set of B.return.
  46950. a = parentA;
  46951. b = parentB;
  46952. } else {
  46953. // The return pointers point to the same fiber. We'll have to use the
  46954. // default, slow path: scan the child sets of each parent alternate to see
  46955. // which child belongs to which set.
  46956. //
  46957. // Search parent A's child set
  46958. var didFindChild = false;
  46959. var _child = parentA.child;
  46960. while (_child) {
  46961. if (_child === a) {
  46962. didFindChild = true;
  46963. a = parentA;
  46964. b = parentB;
  46965. break;
  46966. }
  46967. if (_child === b) {
  46968. didFindChild = true;
  46969. b = parentA;
  46970. a = parentB;
  46971. break;
  46972. }
  46973. _child = _child.sibling;
  46974. }
  46975. if (!didFindChild) {
  46976. // Search parent B's child set
  46977. _child = parentB.child;
  46978. while (_child) {
  46979. if (_child === a) {
  46980. didFindChild = true;
  46981. a = parentB;
  46982. b = parentA;
  46983. break;
  46984. }
  46985. if (_child === b) {
  46986. didFindChild = true;
  46987. b = parentB;
  46988. a = parentA;
  46989. break;
  46990. }
  46991. _child = _child.sibling;
  46992. }
  46993. if (!didFindChild) {
  46994. {
  46995. throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
  46996. }
  46997. }
  46998. }
  46999. }
  47000. if (!(a.alternate === b)) {
  47001. {
  47002. throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
  47003. }
  47004. }
  47005. } // If the root is not a host container, we're in a disconnected tree. I.e.
  47006. // unmounted.
  47007. if (!(a.tag === HostRoot)) {
  47008. {
  47009. throw Error("Unable to find node on an unmounted component.");
  47010. }
  47011. }
  47012. if (a.stateNode.current === a) {
  47013. // We've determined that A is the current branch.
  47014. return fiber;
  47015. } // Otherwise B has to be current branch.
  47016. return alternate;
  47017. }
  47018. function findCurrentHostFiber(parent) {
  47019. var currentParent = findCurrentFiberUsingSlowPath(parent);
  47020. if (!currentParent) {
  47021. return null;
  47022. } // Next we'll drill down this component to find the first HostComponent/Text.
  47023. var node = currentParent;
  47024. while (true) {
  47025. if (node.tag === HostComponent || node.tag === HostText) {
  47026. return node;
  47027. } else if (node.child) {
  47028. node.child.return = node;
  47029. node = node.child;
  47030. continue;
  47031. }
  47032. if (node === currentParent) {
  47033. return null;
  47034. }
  47035. while (!node.sibling) {
  47036. if (!node.return || node.return === currentParent) {
  47037. return null;
  47038. }
  47039. node = node.return;
  47040. }
  47041. node.sibling.return = node.return;
  47042. node = node.sibling;
  47043. } // Flow needs the return null here, but ESLint complains about it.
  47044. // eslint-disable-next-line no-unreachable
  47045. return null;
  47046. }
  47047. function findCurrentHostFiberWithNoPortals(parent) {
  47048. var currentParent = findCurrentFiberUsingSlowPath(parent);
  47049. if (!currentParent) {
  47050. return null;
  47051. } // Next we'll drill down this component to find the first HostComponent/Text.
  47052. var node = currentParent;
  47053. while (true) {
  47054. if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI && node.tag === FundamentalComponent) {
  47055. return node;
  47056. } else if (node.child && node.tag !== HostPortal) {
  47057. node.child.return = node;
  47058. node = node.child;
  47059. continue;
  47060. }
  47061. if (node === currentParent) {
  47062. return null;
  47063. }
  47064. while (!node.sibling) {
  47065. if (!node.return || node.return === currentParent) {
  47066. return null;
  47067. }
  47068. node = node.return;
  47069. }
  47070. node.sibling.return = node.return;
  47071. node = node.sibling;
  47072. } // Flow needs the return null here, but ESLint complains about it.
  47073. // eslint-disable-next-line no-unreachable
  47074. return null;
  47075. }
  47076. var attemptSynchronousHydration;
  47077. function setAttemptSynchronousHydration(fn) {
  47078. attemptSynchronousHydration = fn;
  47079. }
  47080. var attemptUserBlockingHydration;
  47081. function setAttemptUserBlockingHydration(fn) {
  47082. attemptUserBlockingHydration = fn;
  47083. }
  47084. var attemptContinuousHydration;
  47085. function setAttemptContinuousHydration(fn) {
  47086. attemptContinuousHydration = fn;
  47087. }
  47088. var attemptHydrationAtCurrentPriority;
  47089. function setAttemptHydrationAtCurrentPriority(fn) {
  47090. attemptHydrationAtCurrentPriority = fn;
  47091. } // TODO: Upgrade this definition once we're on a newer version of Flow that
  47092. // has this definition built-in.
  47093. var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.
  47094. var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
  47095. // if the last target was dehydrated.
  47096. var queuedFocus = null;
  47097. var queuedDrag = null;
  47098. var queuedMouse = null; // For pointer events there can be one latest event per pointerId.
  47099. var queuedPointers = new Map();
  47100. var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.
  47101. var queuedExplicitHydrationTargets = [];
  47102. function hasQueuedDiscreteEvents() {
  47103. return queuedDiscreteEvents.length > 0;
  47104. }
  47105. var discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];
  47106. var continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];
  47107. function isReplayableDiscreteEvent(eventType) {
  47108. return discreteReplayableEvents.indexOf(eventType) > -1;
  47109. }
  47110. function trapReplayableEvent(topLevelType, document, listeningSet) {
  47111. listenToTopLevel(topLevelType, document, listeningSet);
  47112. if (enableFlareAPI) {
  47113. // Trap events for the responder system.
  47114. var passiveEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_passive';
  47115. if (!listeningSet.has(passiveEventKey)) {
  47116. trapEventForResponderEventSystem(document, topLevelType, true);
  47117. listeningSet.add(passiveEventKey);
  47118. } // TODO: This listens to all events as active which might have
  47119. // undesirable effects. It's also unnecessary to have both
  47120. // passive and active listeners. Instead, we could start with
  47121. // a passive and upgrade it to an active one if needed.
  47122. // For replaying purposes the active is never needed since we
  47123. // currently don't preventDefault.
  47124. var activeEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_active';
  47125. if (!listeningSet.has(activeEventKey)) {
  47126. trapEventForResponderEventSystem(document, topLevelType, false);
  47127. listeningSet.add(activeEventKey);
  47128. }
  47129. }
  47130. }
  47131. function eagerlyTrapReplayableEvents(document) {
  47132. var listeningSet = getListeningSetForElement(document); // Discrete
  47133. discreteReplayableEvents.forEach(function (topLevelType) {
  47134. trapReplayableEvent(topLevelType, document, listeningSet);
  47135. }); // Continuous
  47136. continuousReplayableEvents.forEach(function (topLevelType) {
  47137. trapReplayableEvent(topLevelType, document, listeningSet);
  47138. });
  47139. }
  47140. function createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
  47141. return {
  47142. blockedOn: blockedOn,
  47143. topLevelType: topLevelType,
  47144. eventSystemFlags: eventSystemFlags | IS_REPLAYED,
  47145. nativeEvent: nativeEvent
  47146. };
  47147. }
  47148. function queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
  47149. var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
  47150. queuedDiscreteEvents.push(queuedEvent);
  47151. if (enableSelectiveHydration) {
  47152. if (queuedDiscreteEvents.length === 1) {
  47153. // If this was the first discrete event, we might be able to
  47154. // synchronously unblock it so that preventDefault still works.
  47155. while (queuedEvent.blockedOn !== null) {
  47156. var _fiber = getInstanceFromNode$1(queuedEvent.blockedOn);
  47157. if (_fiber === null) {
  47158. break;
  47159. }
  47160. attemptSynchronousHydration(_fiber);
  47161. if (queuedEvent.blockedOn === null) {
  47162. // We got unblocked by hydration. Let's try again.
  47163. replayUnblockedEvents(); // If we're reblocked, on an inner boundary, we might need
  47164. // to attempt hydrating that one.
  47165. continue;
  47166. } else {
  47167. // We're still blocked from hydation, we have to give up
  47168. // and replay later.
  47169. break;
  47170. }
  47171. }
  47172. }
  47173. }
  47174. } // Resets the replaying for this type of continuous event to no event.
  47175. function clearIfContinuousEvent(topLevelType, nativeEvent) {
  47176. switch (topLevelType) {
  47177. case TOP_FOCUS:
  47178. case TOP_BLUR:
  47179. queuedFocus = null;
  47180. break;
  47181. case TOP_DRAG_ENTER:
  47182. case TOP_DRAG_LEAVE:
  47183. queuedDrag = null;
  47184. break;
  47185. case TOP_MOUSE_OVER:
  47186. case TOP_MOUSE_OUT:
  47187. queuedMouse = null;
  47188. break;
  47189. case TOP_POINTER_OVER:
  47190. case TOP_POINTER_OUT:
  47191. {
  47192. var pointerId = nativeEvent.pointerId;
  47193. queuedPointers.delete(pointerId);
  47194. break;
  47195. }
  47196. case TOP_GOT_POINTER_CAPTURE:
  47197. case TOP_LOST_POINTER_CAPTURE:
  47198. {
  47199. var _pointerId = nativeEvent.pointerId;
  47200. queuedPointerCaptures.delete(_pointerId);
  47201. break;
  47202. }
  47203. }
  47204. }
  47205. function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
  47206. if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
  47207. var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
  47208. if (blockedOn !== null) {
  47209. var _fiber2 = getInstanceFromNode$1(blockedOn);
  47210. if (_fiber2 !== null) {
  47211. // Attempt to increase the priority of this target.
  47212. attemptContinuousHydration(_fiber2);
  47213. }
  47214. }
  47215. return queuedEvent;
  47216. } // If we have already queued this exact event, then it's because
  47217. // the different event systems have different DOM event listeners.
  47218. // We can accumulate the flags and store a single event to be
  47219. // replayed.
  47220. existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
  47221. return existingQueuedEvent;
  47222. }
  47223. function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
  47224. // These set relatedTarget to null because the replayed event will be treated as if we
  47225. // moved from outside the window (no target) onto the target once it hydrates.
  47226. // Instead of mutating we could clone the event.
  47227. switch (topLevelType) {
  47228. case TOP_FOCUS:
  47229. {
  47230. var focusEvent = nativeEvent;
  47231. queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, focusEvent);
  47232. return true;
  47233. }
  47234. case TOP_DRAG_ENTER:
  47235. {
  47236. var dragEvent = nativeEvent;
  47237. queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, dragEvent);
  47238. return true;
  47239. }
  47240. case TOP_MOUSE_OVER:
  47241. {
  47242. var mouseEvent = nativeEvent;
  47243. queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, mouseEvent);
  47244. return true;
  47245. }
  47246. case TOP_POINTER_OVER:
  47247. {
  47248. var pointerEvent = nativeEvent;
  47249. var pointerId = pointerEvent.pointerId;
  47250. queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, pointerEvent));
  47251. return true;
  47252. }
  47253. case TOP_GOT_POINTER_CAPTURE:
  47254. {
  47255. var _pointerEvent = nativeEvent;
  47256. var _pointerId2 = _pointerEvent.pointerId;
  47257. queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, _pointerEvent));
  47258. return true;
  47259. }
  47260. }
  47261. return false;
  47262. } // Check if this target is unblocked. Returns true if it's unblocked.
  47263. function attemptExplicitHydrationTarget(queuedTarget) {
  47264. // TODO: This function shares a lot of logic with attemptToDispatchEvent.
  47265. // Try to unify them. It's a bit tricky since it would require two return
  47266. // values.
  47267. var targetInst = getClosestInstanceFromNode(queuedTarget.target);
  47268. if (targetInst !== null) {
  47269. var nearestMounted = getNearestMountedFiber(targetInst);
  47270. if (nearestMounted !== null) {
  47271. var tag = nearestMounted.tag;
  47272. if (tag === SuspenseComponent) {
  47273. var instance = getSuspenseInstanceFromFiber(nearestMounted);
  47274. if (instance !== null) {
  47275. // We're blocked on hydrating this boundary.
  47276. // Increase its priority.
  47277. queuedTarget.blockedOn = instance;
  47278. Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {
  47279. attemptHydrationAtCurrentPriority(nearestMounted);
  47280. });
  47281. return;
  47282. }
  47283. } else if (tag === HostRoot) {
  47284. var root = nearestMounted.stateNode;
  47285. if (root.hydrate) {
  47286. queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of
  47287. // a root other than sync.
  47288. return;
  47289. }
  47290. }
  47291. }
  47292. }
  47293. queuedTarget.blockedOn = null;
  47294. }
  47295. function queueExplicitHydrationTarget(target) {
  47296. if (enableSelectiveHydration) {
  47297. var priority = Scheduler.unstable_getCurrentPriorityLevel();
  47298. var queuedTarget = {
  47299. blockedOn: null,
  47300. target: target,
  47301. priority: priority
  47302. };
  47303. var i = 0;
  47304. for (; i < queuedExplicitHydrationTargets.length; i++) {
  47305. if (priority <= queuedExplicitHydrationTargets[i].priority) {
  47306. break;
  47307. }
  47308. }
  47309. queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
  47310. if (i === 0) {
  47311. attemptExplicitHydrationTarget(queuedTarget);
  47312. }
  47313. }
  47314. }
  47315. function attemptReplayContinuousQueuedEvent(queuedEvent) {
  47316. if (queuedEvent.blockedOn !== null) {
  47317. return false;
  47318. }
  47319. var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.nativeEvent);
  47320. if (nextBlockedOn !== null) {
  47321. // We're still blocked. Try again later.
  47322. var _fiber3 = getInstanceFromNode$1(nextBlockedOn);
  47323. if (_fiber3 !== null) {
  47324. attemptContinuousHydration(_fiber3);
  47325. }
  47326. queuedEvent.blockedOn = nextBlockedOn;
  47327. return false;
  47328. }
  47329. return true;
  47330. }
  47331. function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
  47332. if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
  47333. map.delete(key);
  47334. }
  47335. }
  47336. function replayUnblockedEvents() {
  47337. hasScheduledReplayAttempt = false; // First replay discrete events.
  47338. while (queuedDiscreteEvents.length > 0) {
  47339. var nextDiscreteEvent = queuedDiscreteEvents[0];
  47340. if (nextDiscreteEvent.blockedOn !== null) {
  47341. // We're still blocked.
  47342. // Increase the priority of this boundary to unblock
  47343. // the next discrete event.
  47344. var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);
  47345. if (_fiber4 !== null) {
  47346. attemptUserBlockingHydration(_fiber4);
  47347. }
  47348. break;
  47349. }
  47350. var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.nativeEvent);
  47351. if (nextBlockedOn !== null) {
  47352. // We're still blocked. Try again later.
  47353. nextDiscreteEvent.blockedOn = nextBlockedOn;
  47354. } else {
  47355. // We've successfully replayed the first event. Let's try the next one.
  47356. queuedDiscreteEvents.shift();
  47357. }
  47358. } // Next replay any continuous events.
  47359. if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
  47360. queuedFocus = null;
  47361. }
  47362. if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
  47363. queuedDrag = null;
  47364. }
  47365. if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
  47366. queuedMouse = null;
  47367. }
  47368. queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
  47369. queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
  47370. }
  47371. function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
  47372. if (queuedEvent.blockedOn === unblocked) {
  47373. queuedEvent.blockedOn = null;
  47374. if (!hasScheduledReplayAttempt) {
  47375. hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are
  47376. // now unblocked. This first might not actually be unblocked yet.
  47377. // We could check it early to avoid scheduling an unnecessary callback.
  47378. Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
  47379. }
  47380. }
  47381. }
  47382. function retryIfBlockedOn(unblocked) {
  47383. // Mark anything that was blocked on this as no longer blocked
  47384. // and eligible for a replay.
  47385. if (queuedDiscreteEvents.length > 0) {
  47386. scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
  47387. // worth it because we expect very few discrete events to queue up and once
  47388. // we are actually fully unblocked it will be fast to replay them.
  47389. for (var i = 1; i < queuedDiscreteEvents.length; i++) {
  47390. var queuedEvent = queuedDiscreteEvents[i];
  47391. if (queuedEvent.blockedOn === unblocked) {
  47392. queuedEvent.blockedOn = null;
  47393. }
  47394. }
  47395. }
  47396. if (queuedFocus !== null) {
  47397. scheduleCallbackIfUnblocked(queuedFocus, unblocked);
  47398. }
  47399. if (queuedDrag !== null) {
  47400. scheduleCallbackIfUnblocked(queuedDrag, unblocked);
  47401. }
  47402. if (queuedMouse !== null) {
  47403. scheduleCallbackIfUnblocked(queuedMouse, unblocked);
  47404. }
  47405. var unblock = function (queuedEvent) {
  47406. return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
  47407. };
  47408. queuedPointers.forEach(unblock);
  47409. queuedPointerCaptures.forEach(unblock);
  47410. for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
  47411. var queuedTarget = queuedExplicitHydrationTargets[_i];
  47412. if (queuedTarget.blockedOn === unblocked) {
  47413. queuedTarget.blockedOn = null;
  47414. }
  47415. }
  47416. while (queuedExplicitHydrationTargets.length > 0) {
  47417. var nextExplicitTarget = queuedExplicitHydrationTargets[0];
  47418. if (nextExplicitTarget.blockedOn !== null) {
  47419. // We're still blocked.
  47420. break;
  47421. } else {
  47422. attemptExplicitHydrationTarget(nextExplicitTarget);
  47423. if (nextExplicitTarget.blockedOn === null) {
  47424. // We're unblocked.
  47425. queuedExplicitHydrationTargets.shift();
  47426. }
  47427. }
  47428. }
  47429. }
  47430. function addEventBubbleListener(element, eventType, listener) {
  47431. element.addEventListener(eventType, listener, false);
  47432. }
  47433. function addEventCaptureListener(element, eventType, listener) {
  47434. element.addEventListener(eventType, listener, true);
  47435. }
  47436. function addEventCaptureListenerWithPassiveFlag(element, eventType, listener, passive) {
  47437. element.addEventListener(eventType, listener, {
  47438. capture: true,
  47439. passive: passive
  47440. });
  47441. }
  47442. /**
  47443. * Gets the target node from a native browser event by accounting for
  47444. * inconsistencies in browser DOM APIs.
  47445. *
  47446. * @param {object} nativeEvent Native browser event.
  47447. * @return {DOMEventTarget} Target node.
  47448. */
  47449. function getEventTarget(nativeEvent) {
  47450. // Fallback to nativeEvent.srcElement for IE9
  47451. // https://github.com/facebook/react/issues/12506
  47452. var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963
  47453. if (target.correspondingUseElement) {
  47454. target = target.correspondingUseElement;
  47455. } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  47456. // @see http://www.quirksmode.org/js/events_properties.html
  47457. return target.nodeType === TEXT_NODE ? target.parentNode : target;
  47458. }
  47459. function getParent(inst) {
  47460. do {
  47461. inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
  47462. // That is depending on if we want nested subtrees (layers) to bubble
  47463. // events to their parent. We could also go through parentNode on the
  47464. // host node but that wouldn't work for React Native and doesn't let us
  47465. // do the portal feature.
  47466. } while (inst && inst.tag !== HostComponent);
  47467. if (inst) {
  47468. return inst;
  47469. }
  47470. return null;
  47471. }
  47472. /**
  47473. * Return the lowest common ancestor of A and B, or null if they are in
  47474. * different trees.
  47475. */
  47476. function getLowestCommonAncestor(instA, instB) {
  47477. var depthA = 0;
  47478. for (var tempA = instA; tempA; tempA = getParent(tempA)) {
  47479. depthA++;
  47480. }
  47481. var depthB = 0;
  47482. for (var tempB = instB; tempB; tempB = getParent(tempB)) {
  47483. depthB++;
  47484. } // If A is deeper, crawl up.
  47485. while (depthA - depthB > 0) {
  47486. instA = getParent(instA);
  47487. depthA--;
  47488. } // If B is deeper, crawl up.
  47489. while (depthB - depthA > 0) {
  47490. instB = getParent(instB);
  47491. depthB--;
  47492. } // Walk in lockstep until we find a match.
  47493. var depth = depthA;
  47494. while (depth--) {
  47495. if (instA === instB || instA === instB.alternate) {
  47496. return instA;
  47497. }
  47498. instA = getParent(instA);
  47499. instB = getParent(instB);
  47500. }
  47501. return null;
  47502. }
  47503. /**
  47504. * Return if A is an ancestor of B.
  47505. */
  47506. /**
  47507. * Return the parent instance of the passed-in instance.
  47508. */
  47509. /**
  47510. * Simulates the traversal of a two-phase, capture/bubble event dispatch.
  47511. */
  47512. function traverseTwoPhase(inst, fn, arg) {
  47513. var path = [];
  47514. while (inst) {
  47515. path.push(inst);
  47516. inst = getParent(inst);
  47517. }
  47518. var i;
  47519. for (i = path.length; i-- > 0;) {
  47520. fn(path[i], 'captured', arg);
  47521. }
  47522. for (i = 0; i < path.length; i++) {
  47523. fn(path[i], 'bubbled', arg);
  47524. }
  47525. }
  47526. /**
  47527. * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
  47528. * should would receive a `mouseEnter` or `mouseLeave` event.
  47529. *
  47530. * Does not invoke the callback on the nearest common ancestor because nothing
  47531. * "entered" or "left" that element.
  47532. */
  47533. function traverseEnterLeave(from, to, fn, argFrom, argTo) {
  47534. var common = from && to ? getLowestCommonAncestor(from, to) : null;
  47535. var pathFrom = [];
  47536. while (true) {
  47537. if (!from) {
  47538. break;
  47539. }
  47540. if (from === common) {
  47541. break;
  47542. }
  47543. var alternate = from.alternate;
  47544. if (alternate !== null && alternate === common) {
  47545. break;
  47546. }
  47547. pathFrom.push(from);
  47548. from = getParent(from);
  47549. }
  47550. var pathTo = [];
  47551. while (true) {
  47552. if (!to) {
  47553. break;
  47554. }
  47555. if (to === common) {
  47556. break;
  47557. }
  47558. var _alternate = to.alternate;
  47559. if (_alternate !== null && _alternate === common) {
  47560. break;
  47561. }
  47562. pathTo.push(to);
  47563. to = getParent(to);
  47564. }
  47565. for (var i = 0; i < pathFrom.length; i++) {
  47566. fn(pathFrom[i], 'bubbled', argFrom);
  47567. }
  47568. for (var _i = pathTo.length; _i-- > 0;) {
  47569. fn(pathTo[_i], 'captured', argTo);
  47570. }
  47571. }
  47572. /**
  47573. * Some event types have a notion of different registration names for different
  47574. * "phases" of propagation. This finds listeners by a given phase.
  47575. */
  47576. function listenerAtPhase(inst, event, propagationPhase) {
  47577. var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  47578. return getListener(inst, registrationName);
  47579. }
  47580. /**
  47581. * A small set of propagation patterns, each of which will accept a small amount
  47582. * of information, and generate a set of "dispatch ready event objects" - which
  47583. * are sets of events that have already been annotated with a set of dispatched
  47584. * listener functions/ids. The API is designed this way to discourage these
  47585. * propagation strategies from actually executing the dispatches, since we
  47586. * always want to collect the entire set of dispatches before executing even a
  47587. * single one.
  47588. */
  47589. /**
  47590. * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
  47591. * here, allows us to not have to bind or create functions for each event.
  47592. * Mutating the event's members allows us to not have to create a wrapping
  47593. * "dispatch" object that pairs the event with the listener.
  47594. */
  47595. function accumulateDirectionalDispatches(inst, phase, event) {
  47596. {
  47597. !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
  47598. }
  47599. var listener = listenerAtPhase(inst, event, phase);
  47600. if (listener) {
  47601. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  47602. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  47603. }
  47604. }
  47605. /**
  47606. * Collect dispatches (must be entirely collected before dispatching - see unit
  47607. * tests). Lazily allocate the array to conserve memory. We must loop through
  47608. * each event and perform the traversal for each one. We cannot perform a
  47609. * single traversal for the entire collection of events because each event may
  47610. * have a different target.
  47611. */
  47612. function accumulateTwoPhaseDispatchesSingle(event) {
  47613. if (event && event.dispatchConfig.phasedRegistrationNames) {
  47614. traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  47615. }
  47616. }
  47617. /**
  47618. * Accumulates without regard to direction, does not look for phased
  47619. * registration names. Same as `accumulateDirectDispatchesSingle` but without
  47620. * requiring that the `dispatchMarker` be the same as the dispatched ID.
  47621. */
  47622. function accumulateDispatches(inst, ignoredDirection, event) {
  47623. if (inst && event && event.dispatchConfig.registrationName) {
  47624. var registrationName = event.dispatchConfig.registrationName;
  47625. var listener = getListener(inst, registrationName);
  47626. if (listener) {
  47627. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  47628. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  47629. }
  47630. }
  47631. }
  47632. /**
  47633. * Accumulates dispatches on an `SyntheticEvent`, but only for the
  47634. * `dispatchMarker`.
  47635. * @param {SyntheticEvent} event
  47636. */
  47637. function accumulateDirectDispatchesSingle(event) {
  47638. if (event && event.dispatchConfig.registrationName) {
  47639. accumulateDispatches(event._targetInst, null, event);
  47640. }
  47641. }
  47642. function accumulateTwoPhaseDispatches(events) {
  47643. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
  47644. }
  47645. function accumulateEnterLeaveDispatches(leave, enter, from, to) {
  47646. traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
  47647. }
  47648. function accumulateDirectDispatches(events) {
  47649. forEachAccumulated(events, accumulateDirectDispatchesSingle);
  47650. }
  47651. /* eslint valid-typeof: 0 */
  47652. var EVENT_POOL_SIZE = 10;
  47653. /**
  47654. * @interface Event
  47655. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  47656. */
  47657. var EventInterface = {
  47658. type: null,
  47659. target: null,
  47660. // currentTarget is set when dispatching; no use in copying it here
  47661. currentTarget: function () {
  47662. return null;
  47663. },
  47664. eventPhase: null,
  47665. bubbles: null,
  47666. cancelable: null,
  47667. timeStamp: function (event) {
  47668. return event.timeStamp || Date.now();
  47669. },
  47670. defaultPrevented: null,
  47671. isTrusted: null
  47672. };
  47673. function functionThatReturnsTrue() {
  47674. return true;
  47675. }
  47676. function functionThatReturnsFalse() {
  47677. return false;
  47678. }
  47679. /**
  47680. * Synthetic events are dispatched by event plugins, typically in response to a
  47681. * top-level event delegation handler.
  47682. *
  47683. * These systems should generally use pooling to reduce the frequency of garbage
  47684. * collection. The system should check `isPersistent` to determine whether the
  47685. * event should be released into the pool after being dispatched. Users that
  47686. * need a persisted event should invoke `persist`.
  47687. *
  47688. * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
  47689. * normalizing browser quirks. Subclasses do not necessarily have to implement a
  47690. * DOM interface; custom application-specific events can also subclass this.
  47691. *
  47692. * @param {object} dispatchConfig Configuration used to dispatch this event.
  47693. * @param {*} targetInst Marker identifying the event target.
  47694. * @param {object} nativeEvent Native browser event.
  47695. * @param {DOMEventTarget} nativeEventTarget Target node.
  47696. */
  47697. function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
  47698. {
  47699. // these have a getter/setter for warnings
  47700. delete this.nativeEvent;
  47701. delete this.preventDefault;
  47702. delete this.stopPropagation;
  47703. delete this.isDefaultPrevented;
  47704. delete this.isPropagationStopped;
  47705. }
  47706. this.dispatchConfig = dispatchConfig;
  47707. this._targetInst = targetInst;
  47708. this.nativeEvent = nativeEvent;
  47709. var Interface = this.constructor.Interface;
  47710. for (var propName in Interface) {
  47711. if (!Interface.hasOwnProperty(propName)) {
  47712. continue;
  47713. }
  47714. {
  47715. delete this[propName]; // this has a getter/setter for warnings
  47716. }
  47717. var normalize = Interface[propName];
  47718. if (normalize) {
  47719. this[propName] = normalize(nativeEvent);
  47720. } else {
  47721. if (propName === 'target') {
  47722. this.target = nativeEventTarget;
  47723. } else {
  47724. this[propName] = nativeEvent[propName];
  47725. }
  47726. }
  47727. }
  47728. var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
  47729. if (defaultPrevented) {
  47730. this.isDefaultPrevented = functionThatReturnsTrue;
  47731. } else {
  47732. this.isDefaultPrevented = functionThatReturnsFalse;
  47733. }
  47734. this.isPropagationStopped = functionThatReturnsFalse;
  47735. return this;
  47736. }
  47737. _assign(SyntheticEvent.prototype, {
  47738. preventDefault: function () {
  47739. this.defaultPrevented = true;
  47740. var event = this.nativeEvent;
  47741. if (!event) {
  47742. return;
  47743. }
  47744. if (event.preventDefault) {
  47745. event.preventDefault();
  47746. } else if (typeof event.returnValue !== 'unknown') {
  47747. event.returnValue = false;
  47748. }
  47749. this.isDefaultPrevented = functionThatReturnsTrue;
  47750. },
  47751. stopPropagation: function () {
  47752. var event = this.nativeEvent;
  47753. if (!event) {
  47754. return;
  47755. }
  47756. if (event.stopPropagation) {
  47757. event.stopPropagation();
  47758. } else if (typeof event.cancelBubble !== 'unknown') {
  47759. // The ChangeEventPlugin registers a "propertychange" event for
  47760. // IE. This event does not support bubbling or cancelling, and
  47761. // any references to cancelBubble throw "Member not found". A
  47762. // typeof check of "unknown" circumvents this issue (and is also
  47763. // IE specific).
  47764. event.cancelBubble = true;
  47765. }
  47766. this.isPropagationStopped = functionThatReturnsTrue;
  47767. },
  47768. /**
  47769. * We release all dispatched `SyntheticEvent`s after each event loop, adding
  47770. * them back into the pool. This allows a way to hold onto a reference that
  47771. * won't be added back into the pool.
  47772. */
  47773. persist: function () {
  47774. this.isPersistent = functionThatReturnsTrue;
  47775. },
  47776. /**
  47777. * Checks if this event should be released back into the pool.
  47778. *
  47779. * @return {boolean} True if this should not be released, false otherwise.
  47780. */
  47781. isPersistent: functionThatReturnsFalse,
  47782. /**
  47783. * `PooledClass` looks for `destructor` on each instance it releases.
  47784. */
  47785. destructor: function () {
  47786. var Interface = this.constructor.Interface;
  47787. for (var propName in Interface) {
  47788. {
  47789. Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
  47790. }
  47791. }
  47792. this.dispatchConfig = null;
  47793. this._targetInst = null;
  47794. this.nativeEvent = null;
  47795. this.isDefaultPrevented = functionThatReturnsFalse;
  47796. this.isPropagationStopped = functionThatReturnsFalse;
  47797. this._dispatchListeners = null;
  47798. this._dispatchInstances = null;
  47799. {
  47800. Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
  47801. Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
  47802. Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
  47803. Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
  47804. Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
  47805. }
  47806. }
  47807. });
  47808. SyntheticEvent.Interface = EventInterface;
  47809. /**
  47810. * Helper to reduce boilerplate when creating subclasses.
  47811. */
  47812. SyntheticEvent.extend = function (Interface) {
  47813. var Super = this;
  47814. var E = function () {};
  47815. E.prototype = Super.prototype;
  47816. var prototype = new E();
  47817. function Class() {
  47818. return Super.apply(this, arguments);
  47819. }
  47820. _assign(prototype, Class.prototype);
  47821. Class.prototype = prototype;
  47822. Class.prototype.constructor = Class;
  47823. Class.Interface = _assign({}, Super.Interface, Interface);
  47824. Class.extend = Super.extend;
  47825. addEventPoolingTo(Class);
  47826. return Class;
  47827. };
  47828. addEventPoolingTo(SyntheticEvent);
  47829. /**
  47830. * Helper to nullify syntheticEvent instance properties when destructing
  47831. *
  47832. * @param {String} propName
  47833. * @param {?object} getVal
  47834. * @return {object} defineProperty object
  47835. */
  47836. function getPooledWarningPropertyDefinition(propName, getVal) {
  47837. var isFunction = typeof getVal === 'function';
  47838. return {
  47839. configurable: true,
  47840. set: set,
  47841. get: get
  47842. };
  47843. function set(val) {
  47844. var action = isFunction ? 'setting the method' : 'setting the property';
  47845. warn(action, 'This is effectively a no-op');
  47846. return val;
  47847. }
  47848. function get() {
  47849. var action = isFunction ? 'accessing the method' : 'accessing the property';
  47850. var result = isFunction ? 'This is a no-op function' : 'This is set to null';
  47851. warn(action, result);
  47852. return getVal;
  47853. }
  47854. function warn(action, result) {
  47855. var warningCondition = false;
  47856. !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
  47857. }
  47858. }
  47859. function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
  47860. var EventConstructor = this;
  47861. if (EventConstructor.eventPool.length) {
  47862. var instance = EventConstructor.eventPool.pop();
  47863. EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
  47864. return instance;
  47865. }
  47866. return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
  47867. }
  47868. function releasePooledEvent(event) {
  47869. var EventConstructor = this;
  47870. if (!(event instanceof EventConstructor)) {
  47871. {
  47872. throw Error("Trying to release an event instance into a pool of a different type.");
  47873. }
  47874. }
  47875. event.destructor();
  47876. if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
  47877. EventConstructor.eventPool.push(event);
  47878. }
  47879. }
  47880. function addEventPoolingTo(EventConstructor) {
  47881. EventConstructor.eventPool = [];
  47882. EventConstructor.getPooled = getPooledEvent;
  47883. EventConstructor.release = releasePooledEvent;
  47884. }
  47885. /**
  47886. * @interface Event
  47887. * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
  47888. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
  47889. */
  47890. var SyntheticAnimationEvent = SyntheticEvent.extend({
  47891. animationName: null,
  47892. elapsedTime: null,
  47893. pseudoElement: null
  47894. });
  47895. /**
  47896. * @interface Event
  47897. * @see http://www.w3.org/TR/clipboard-apis/
  47898. */
  47899. var SyntheticClipboardEvent = SyntheticEvent.extend({
  47900. clipboardData: function (event) {
  47901. return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  47902. }
  47903. });
  47904. var SyntheticUIEvent = SyntheticEvent.extend({
  47905. view: null,
  47906. detail: null
  47907. });
  47908. /**
  47909. * @interface FocusEvent
  47910. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  47911. */
  47912. var SyntheticFocusEvent = SyntheticUIEvent.extend({
  47913. relatedTarget: null
  47914. });
  47915. /**
  47916. * `charCode` represents the actual "character code" and is safe to use with
  47917. * `String.fromCharCode`. As such, only keys that correspond to printable
  47918. * characters produce a valid `charCode`, the only exception to this is Enter.
  47919. * The Tab-key is considered non-printable and does not have a `charCode`,
  47920. * presumably because it does not produce a tab-character in browsers.
  47921. *
  47922. * @param {object} nativeEvent Native browser event.
  47923. * @return {number} Normalized `charCode` property.
  47924. */
  47925. function getEventCharCode(nativeEvent) {
  47926. var charCode;
  47927. var keyCode = nativeEvent.keyCode;
  47928. if ('charCode' in nativeEvent) {
  47929. charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.
  47930. if (charCode === 0 && keyCode === 13) {
  47931. charCode = 13;
  47932. }
  47933. } else {
  47934. // IE8 does not implement `charCode`, but `keyCode` has the correct value.
  47935. charCode = keyCode;
  47936. } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
  47937. // report Enter as charCode 10 when ctrl is pressed.
  47938. if (charCode === 10) {
  47939. charCode = 13;
  47940. } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  47941. // Must not discard the (non-)printable Enter-key.
  47942. if (charCode >= 32 || charCode === 13) {
  47943. return charCode;
  47944. }
  47945. return 0;
  47946. }
  47947. /**
  47948. * Normalization of deprecated HTML5 `key` values
  47949. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  47950. */
  47951. var normalizeKey = {
  47952. Esc: 'Escape',
  47953. Spacebar: ' ',
  47954. Left: 'ArrowLeft',
  47955. Up: 'ArrowUp',
  47956. Right: 'ArrowRight',
  47957. Down: 'ArrowDown',
  47958. Del: 'Delete',
  47959. Win: 'OS',
  47960. Menu: 'ContextMenu',
  47961. Apps: 'ContextMenu',
  47962. Scroll: 'ScrollLock',
  47963. MozPrintableKey: 'Unidentified'
  47964. };
  47965. /**
  47966. * Translation from legacy `keyCode` to HTML5 `key`
  47967. * Only special keys supported, all others depend on keyboard layout or browser
  47968. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  47969. */
  47970. var translateToKey = {
  47971. '8': 'Backspace',
  47972. '9': 'Tab',
  47973. '12': 'Clear',
  47974. '13': 'Enter',
  47975. '16': 'Shift',
  47976. '17': 'Control',
  47977. '18': 'Alt',
  47978. '19': 'Pause',
  47979. '20': 'CapsLock',
  47980. '27': 'Escape',
  47981. '32': ' ',
  47982. '33': 'PageUp',
  47983. '34': 'PageDown',
  47984. '35': 'End',
  47985. '36': 'Home',
  47986. '37': 'ArrowLeft',
  47987. '38': 'ArrowUp',
  47988. '39': 'ArrowRight',
  47989. '40': 'ArrowDown',
  47990. '45': 'Insert',
  47991. '46': 'Delete',
  47992. '112': 'F1',
  47993. '113': 'F2',
  47994. '114': 'F3',
  47995. '115': 'F4',
  47996. '116': 'F5',
  47997. '117': 'F6',
  47998. '118': 'F7',
  47999. '119': 'F8',
  48000. '120': 'F9',
  48001. '121': 'F10',
  48002. '122': 'F11',
  48003. '123': 'F12',
  48004. '144': 'NumLock',
  48005. '145': 'ScrollLock',
  48006. '224': 'Meta'
  48007. };
  48008. /**
  48009. * @param {object} nativeEvent Native browser event.
  48010. * @return {string} Normalized `key` property.
  48011. */
  48012. function getEventKey(nativeEvent) {
  48013. if (nativeEvent.key) {
  48014. // Normalize inconsistent values reported by browsers due to
  48015. // implementations of a working draft specification.
  48016. // FireFox implements `key` but returns `MozPrintableKey` for all
  48017. // printable characters (normalized to `Unidentified`), ignore it.
  48018. var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
  48019. if (key !== 'Unidentified') {
  48020. return key;
  48021. }
  48022. } // Browser does not implement `key`, polyfill as much of it as we can.
  48023. if (nativeEvent.type === 'keypress') {
  48024. var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can
  48025. // thus be captured by `keypress`, no other non-printable key should.
  48026. return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  48027. }
  48028. if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
  48029. // While user keyboard layout determines the actual meaning of each
  48030. // `keyCode` value, almost all function keys have a universal value.
  48031. return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  48032. }
  48033. return '';
  48034. }
  48035. /**
  48036. * Translation from modifier key to the associated property in the event.
  48037. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
  48038. */
  48039. var modifierKeyToProp = {
  48040. Alt: 'altKey',
  48041. Control: 'ctrlKey',
  48042. Meta: 'metaKey',
  48043. Shift: 'shiftKey'
  48044. }; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
  48045. // getModifierState. If getModifierState is not supported, we map it to a set of
  48046. // modifier keys exposed by the event. In this case, Lock-keys are not supported.
  48047. function modifierStateGetter(keyArg) {
  48048. var syntheticEvent = this;
  48049. var nativeEvent = syntheticEvent.nativeEvent;
  48050. if (nativeEvent.getModifierState) {
  48051. return nativeEvent.getModifierState(keyArg);
  48052. }
  48053. var keyProp = modifierKeyToProp[keyArg];
  48054. return keyProp ? !!nativeEvent[keyProp] : false;
  48055. }
  48056. function getEventModifierState(nativeEvent) {
  48057. return modifierStateGetter;
  48058. }
  48059. /**
  48060. * @interface KeyboardEvent
  48061. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  48062. */
  48063. var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
  48064. key: getEventKey,
  48065. location: null,
  48066. ctrlKey: null,
  48067. shiftKey: null,
  48068. altKey: null,
  48069. metaKey: null,
  48070. repeat: null,
  48071. locale: null,
  48072. getModifierState: getEventModifierState,
  48073. // Legacy Interface
  48074. charCode: function (event) {
  48075. // `charCode` is the result of a KeyPress event and represents the value of
  48076. // the actual printable character.
  48077. // KeyPress is deprecated, but its replacement is not yet final and not
  48078. // implemented in any major browser. Only KeyPress has charCode.
  48079. if (event.type === 'keypress') {
  48080. return getEventCharCode(event);
  48081. }
  48082. return 0;
  48083. },
  48084. keyCode: function (event) {
  48085. // `keyCode` is the result of a KeyDown/Up event and represents the value of
  48086. // physical keyboard key.
  48087. // The actual meaning of the value depends on the users' keyboard layout
  48088. // which cannot be detected. Assuming that it is a US keyboard layout
  48089. // provides a surprisingly accurate mapping for US and European users.
  48090. // Due to this, it is left to the user to implement at this time.
  48091. if (event.type === 'keydown' || event.type === 'keyup') {
  48092. return event.keyCode;
  48093. }
  48094. return 0;
  48095. },
  48096. which: function (event) {
  48097. // `which` is an alias for either `keyCode` or `charCode` depending on the
  48098. // type of the event.
  48099. if (event.type === 'keypress') {
  48100. return getEventCharCode(event);
  48101. }
  48102. if (event.type === 'keydown' || event.type === 'keyup') {
  48103. return event.keyCode;
  48104. }
  48105. return 0;
  48106. }
  48107. });
  48108. var previousScreenX = 0;
  48109. var previousScreenY = 0; // Use flags to signal movementX/Y has already been set
  48110. var isMovementXSet = false;
  48111. var isMovementYSet = false;
  48112. /**
  48113. * @interface MouseEvent
  48114. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  48115. */
  48116. var SyntheticMouseEvent = SyntheticUIEvent.extend({
  48117. screenX: null,
  48118. screenY: null,
  48119. clientX: null,
  48120. clientY: null,
  48121. pageX: null,
  48122. pageY: null,
  48123. ctrlKey: null,
  48124. shiftKey: null,
  48125. altKey: null,
  48126. metaKey: null,
  48127. getModifierState: getEventModifierState,
  48128. button: null,
  48129. buttons: null,
  48130. relatedTarget: function (event) {
  48131. return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
  48132. },
  48133. movementX: function (event) {
  48134. if ('movementX' in event) {
  48135. return event.movementX;
  48136. }
  48137. var screenX = previousScreenX;
  48138. previousScreenX = event.screenX;
  48139. if (!isMovementXSet) {
  48140. isMovementXSet = true;
  48141. return 0;
  48142. }
  48143. return event.type === 'mousemove' ? event.screenX - screenX : 0;
  48144. },
  48145. movementY: function (event) {
  48146. if ('movementY' in event) {
  48147. return event.movementY;
  48148. }
  48149. var screenY = previousScreenY;
  48150. previousScreenY = event.screenY;
  48151. if (!isMovementYSet) {
  48152. isMovementYSet = true;
  48153. return 0;
  48154. }
  48155. return event.type === 'mousemove' ? event.screenY - screenY : 0;
  48156. }
  48157. });
  48158. /**
  48159. * @interface PointerEvent
  48160. * @see http://www.w3.org/TR/pointerevents/
  48161. */
  48162. var SyntheticPointerEvent = SyntheticMouseEvent.extend({
  48163. pointerId: null,
  48164. width: null,
  48165. height: null,
  48166. pressure: null,
  48167. tangentialPressure: null,
  48168. tiltX: null,
  48169. tiltY: null,
  48170. twist: null,
  48171. pointerType: null,
  48172. isPrimary: null
  48173. });
  48174. /**
  48175. * @interface DragEvent
  48176. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  48177. */
  48178. var SyntheticDragEvent = SyntheticMouseEvent.extend({
  48179. dataTransfer: null
  48180. });
  48181. /**
  48182. * @interface TouchEvent
  48183. * @see http://www.w3.org/TR/touch-events/
  48184. */
  48185. var SyntheticTouchEvent = SyntheticUIEvent.extend({
  48186. touches: null,
  48187. targetTouches: null,
  48188. changedTouches: null,
  48189. altKey: null,
  48190. metaKey: null,
  48191. ctrlKey: null,
  48192. shiftKey: null,
  48193. getModifierState: getEventModifierState
  48194. });
  48195. /**
  48196. * @interface Event
  48197. * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
  48198. * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
  48199. */
  48200. var SyntheticTransitionEvent = SyntheticEvent.extend({
  48201. propertyName: null,
  48202. elapsedTime: null,
  48203. pseudoElement: null
  48204. });
  48205. /**
  48206. * @interface WheelEvent
  48207. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  48208. */
  48209. var SyntheticWheelEvent = SyntheticMouseEvent.extend({
  48210. deltaX: function (event) {
  48211. return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
  48212. 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  48213. },
  48214. deltaY: function (event) {
  48215. return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
  48216. 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
  48217. 'wheelDelta' in event ? -event.wheelDelta : 0;
  48218. },
  48219. deltaZ: null,
  48220. // Browsers without "deltaMode" is reporting in raw wheel delta where one
  48221. // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  48222. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  48223. // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  48224. deltaMode: null
  48225. });
  48226. /**
  48227. * Turns
  48228. * ['abort', ...]
  48229. * into
  48230. * eventTypes = {
  48231. * 'abort': {
  48232. * phasedRegistrationNames: {
  48233. * bubbled: 'onAbort',
  48234. * captured: 'onAbortCapture',
  48235. * },
  48236. * dependencies: [TOP_ABORT],
  48237. * },
  48238. * ...
  48239. * };
  48240. * topLevelEventsToDispatchConfig = new Map([
  48241. * [TOP_ABORT, { sameConfig }],
  48242. * ]);
  48243. */
  48244. var eventTuples = [// Discrete events
  48245. [TOP_BLUR, 'blur', DiscreteEvent], [TOP_CANCEL, 'cancel', DiscreteEvent], [TOP_CLICK, 'click', DiscreteEvent], [TOP_CLOSE, 'close', DiscreteEvent], [TOP_CONTEXT_MENU, 'contextMenu', DiscreteEvent], [TOP_COPY, 'copy', DiscreteEvent], [TOP_CUT, 'cut', DiscreteEvent], [TOP_AUX_CLICK, 'auxClick', DiscreteEvent], [TOP_DOUBLE_CLICK, 'doubleClick', DiscreteEvent], [TOP_DRAG_END, 'dragEnd', DiscreteEvent], [TOP_DRAG_START, 'dragStart', DiscreteEvent], [TOP_DROP, 'drop', DiscreteEvent], [TOP_FOCUS, 'focus', DiscreteEvent], [TOP_INPUT, 'input', DiscreteEvent], [TOP_INVALID, 'invalid', DiscreteEvent], [TOP_KEY_DOWN, 'keyDown', DiscreteEvent], [TOP_KEY_PRESS, 'keyPress', DiscreteEvent], [TOP_KEY_UP, 'keyUp', DiscreteEvent], [TOP_MOUSE_DOWN, 'mouseDown', DiscreteEvent], [TOP_MOUSE_UP, 'mouseUp', DiscreteEvent], [TOP_PASTE, 'paste', DiscreteEvent], [TOP_PAUSE, 'pause', DiscreteEvent], [TOP_PLAY, 'play', DiscreteEvent], [TOP_POINTER_CANCEL, 'pointerCancel', DiscreteEvent], [TOP_POINTER_DOWN, 'pointerDown', DiscreteEvent], [TOP_POINTER_UP, 'pointerUp', DiscreteEvent], [TOP_RATE_CHANGE, 'rateChange', DiscreteEvent], [TOP_RESET, 'reset', DiscreteEvent], [TOP_SEEKED, 'seeked', DiscreteEvent], [TOP_SUBMIT, 'submit', DiscreteEvent], [TOP_TOUCH_CANCEL, 'touchCancel', DiscreteEvent], [TOP_TOUCH_END, 'touchEnd', DiscreteEvent], [TOP_TOUCH_START, 'touchStart', DiscreteEvent], [TOP_VOLUME_CHANGE, 'volumeChange', DiscreteEvent], // User-blocking events
  48246. [TOP_DRAG, 'drag', UserBlockingEvent], [TOP_DRAG_ENTER, 'dragEnter', UserBlockingEvent], [TOP_DRAG_EXIT, 'dragExit', UserBlockingEvent], [TOP_DRAG_LEAVE, 'dragLeave', UserBlockingEvent], [TOP_DRAG_OVER, 'dragOver', UserBlockingEvent], [TOP_MOUSE_MOVE, 'mouseMove', UserBlockingEvent], [TOP_MOUSE_OUT, 'mouseOut', UserBlockingEvent], [TOP_MOUSE_OVER, 'mouseOver', UserBlockingEvent], [TOP_POINTER_MOVE, 'pointerMove', UserBlockingEvent], [TOP_POINTER_OUT, 'pointerOut', UserBlockingEvent], [TOP_POINTER_OVER, 'pointerOver', UserBlockingEvent], [TOP_SCROLL, 'scroll', UserBlockingEvent], [TOP_TOGGLE, 'toggle', UserBlockingEvent], [TOP_TOUCH_MOVE, 'touchMove', UserBlockingEvent], [TOP_WHEEL, 'wheel', UserBlockingEvent], // Continuous events
  48247. [TOP_ABORT, 'abort', ContinuousEvent], [TOP_ANIMATION_END, 'animationEnd', ContinuousEvent], [TOP_ANIMATION_ITERATION, 'animationIteration', ContinuousEvent], [TOP_ANIMATION_START, 'animationStart', ContinuousEvent], [TOP_CAN_PLAY, 'canPlay', ContinuousEvent], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough', ContinuousEvent], [TOP_DURATION_CHANGE, 'durationChange', ContinuousEvent], [TOP_EMPTIED, 'emptied', ContinuousEvent], [TOP_ENCRYPTED, 'encrypted', ContinuousEvent], [TOP_ENDED, 'ended', ContinuousEvent], [TOP_ERROR, 'error', ContinuousEvent], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', ContinuousEvent], [TOP_LOAD, 'load', ContinuousEvent], [TOP_LOADED_DATA, 'loadedData', ContinuousEvent], [TOP_LOADED_METADATA, 'loadedMetadata', ContinuousEvent], [TOP_LOAD_START, 'loadStart', ContinuousEvent], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', ContinuousEvent], [TOP_PLAYING, 'playing', ContinuousEvent], [TOP_PROGRESS, 'progress', ContinuousEvent], [TOP_SEEKING, 'seeking', ContinuousEvent], [TOP_STALLED, 'stalled', ContinuousEvent], [TOP_SUSPEND, 'suspend', ContinuousEvent], [TOP_TIME_UPDATE, 'timeUpdate', ContinuousEvent], [TOP_TRANSITION_END, 'transitionEnd', ContinuousEvent], [TOP_WAITING, 'waiting', ContinuousEvent]];
  48248. var eventTypes = {};
  48249. var topLevelEventsToDispatchConfig = {};
  48250. for (var i = 0; i < eventTuples.length; i++) {
  48251. var eventTuple = eventTuples[i];
  48252. var topEvent = eventTuple[0];
  48253. var event = eventTuple[1];
  48254. var eventPriority = eventTuple[2];
  48255. var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
  48256. var onEvent = 'on' + capitalizedEvent;
  48257. var config = {
  48258. phasedRegistrationNames: {
  48259. bubbled: onEvent,
  48260. captured: onEvent + 'Capture'
  48261. },
  48262. dependencies: [topEvent],
  48263. eventPriority: eventPriority
  48264. };
  48265. eventTypes[event] = config;
  48266. topLevelEventsToDispatchConfig[topEvent] = config;
  48267. } // Only used in DEV for exhaustiveness validation.
  48268. var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
  48269. var SimpleEventPlugin = {
  48270. eventTypes: eventTypes,
  48271. getEventPriority: function (topLevelType) {
  48272. var config = topLevelEventsToDispatchConfig[topLevelType];
  48273. return config !== undefined ? config.eventPriority : ContinuousEvent;
  48274. },
  48275. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  48276. var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
  48277. if (!dispatchConfig) {
  48278. return null;
  48279. }
  48280. var EventConstructor;
  48281. switch (topLevelType) {
  48282. case TOP_KEY_PRESS:
  48283. // Firefox creates a keypress event for function keys too. This removes
  48284. // the unwanted keypress events. Enter is however both printable and
  48285. // non-printable. One would expect Tab to be as well (but it isn't).
  48286. if (getEventCharCode(nativeEvent) === 0) {
  48287. return null;
  48288. }
  48289. /* falls through */
  48290. case TOP_KEY_DOWN:
  48291. case TOP_KEY_UP:
  48292. EventConstructor = SyntheticKeyboardEvent;
  48293. break;
  48294. case TOP_BLUR:
  48295. case TOP_FOCUS:
  48296. EventConstructor = SyntheticFocusEvent;
  48297. break;
  48298. case TOP_CLICK:
  48299. // Firefox creates a click event on right mouse clicks. This removes the
  48300. // unwanted click events.
  48301. if (nativeEvent.button === 2) {
  48302. return null;
  48303. }
  48304. /* falls through */
  48305. case TOP_AUX_CLICK:
  48306. case TOP_DOUBLE_CLICK:
  48307. case TOP_MOUSE_DOWN:
  48308. case TOP_MOUSE_MOVE:
  48309. case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events
  48310. /* falls through */
  48311. case TOP_MOUSE_OUT:
  48312. case TOP_MOUSE_OVER:
  48313. case TOP_CONTEXT_MENU:
  48314. EventConstructor = SyntheticMouseEvent;
  48315. break;
  48316. case TOP_DRAG:
  48317. case TOP_DRAG_END:
  48318. case TOP_DRAG_ENTER:
  48319. case TOP_DRAG_EXIT:
  48320. case TOP_DRAG_LEAVE:
  48321. case TOP_DRAG_OVER:
  48322. case TOP_DRAG_START:
  48323. case TOP_DROP:
  48324. EventConstructor = SyntheticDragEvent;
  48325. break;
  48326. case TOP_TOUCH_CANCEL:
  48327. case TOP_TOUCH_END:
  48328. case TOP_TOUCH_MOVE:
  48329. case TOP_TOUCH_START:
  48330. EventConstructor = SyntheticTouchEvent;
  48331. break;
  48332. case TOP_ANIMATION_END:
  48333. case TOP_ANIMATION_ITERATION:
  48334. case TOP_ANIMATION_START:
  48335. EventConstructor = SyntheticAnimationEvent;
  48336. break;
  48337. case TOP_TRANSITION_END:
  48338. EventConstructor = SyntheticTransitionEvent;
  48339. break;
  48340. case TOP_SCROLL:
  48341. EventConstructor = SyntheticUIEvent;
  48342. break;
  48343. case TOP_WHEEL:
  48344. EventConstructor = SyntheticWheelEvent;
  48345. break;
  48346. case TOP_COPY:
  48347. case TOP_CUT:
  48348. case TOP_PASTE:
  48349. EventConstructor = SyntheticClipboardEvent;
  48350. break;
  48351. case TOP_GOT_POINTER_CAPTURE:
  48352. case TOP_LOST_POINTER_CAPTURE:
  48353. case TOP_POINTER_CANCEL:
  48354. case TOP_POINTER_DOWN:
  48355. case TOP_POINTER_MOVE:
  48356. case TOP_POINTER_OUT:
  48357. case TOP_POINTER_OVER:
  48358. case TOP_POINTER_UP:
  48359. EventConstructor = SyntheticPointerEvent;
  48360. break;
  48361. default:
  48362. {
  48363. if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
  48364. warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
  48365. }
  48366. } // HTML Events
  48367. // @see http://www.w3.org/TR/html5/index.html#events-0
  48368. EventConstructor = SyntheticEvent;
  48369. break;
  48370. }
  48371. var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
  48372. accumulateTwoPhaseDispatches(event);
  48373. return event;
  48374. }
  48375. };
  48376. var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners
  48377. // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
  48378. if (enableFlareAPI && canUseDOM) {
  48379. try {
  48380. var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value
  48381. Object.defineProperty(options, 'passive', {
  48382. get: function () {
  48383. passiveBrowserEventsSupported = true;
  48384. }
  48385. });
  48386. window.addEventListener('test', options, options);
  48387. window.removeEventListener('test', options, options);
  48388. } catch (e) {
  48389. passiveBrowserEventsSupported = false;
  48390. }
  48391. }
  48392. // Intentionally not named imports because Rollup would use dynamic dispatch for
  48393. // CommonJS interop named imports.
  48394. var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority;
  48395. var runWithPriority$1 = Scheduler.unstable_runWithPriority;
  48396. var getEventPriority = SimpleEventPlugin.getEventPriority;
  48397. var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
  48398. var callbackBookkeepingPool = [];
  48399. /**
  48400. * Find the deepest React component completely containing the root of the
  48401. * passed-in instance (for use when entire React trees are nested within each
  48402. * other). If React trees are not nested, returns null.
  48403. */
  48404. function findRootContainerNode(inst) {
  48405. if (inst.tag === HostRoot) {
  48406. return inst.stateNode.containerInfo;
  48407. } // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  48408. // traversal, but caching is difficult to do correctly without using a
  48409. // mutation observer to listen for all DOM changes.
  48410. while (inst.return) {
  48411. inst = inst.return;
  48412. }
  48413. if (inst.tag !== HostRoot) {
  48414. // This can happen if we're in a detached tree.
  48415. return null;
  48416. }
  48417. return inst.stateNode.containerInfo;
  48418. } // Used to store ancestor hierarchy in top level callback
  48419. function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {
  48420. if (callbackBookkeepingPool.length) {
  48421. var instance = callbackBookkeepingPool.pop();
  48422. instance.topLevelType = topLevelType;
  48423. instance.eventSystemFlags = eventSystemFlags;
  48424. instance.nativeEvent = nativeEvent;
  48425. instance.targetInst = targetInst;
  48426. return instance;
  48427. }
  48428. return {
  48429. topLevelType: topLevelType,
  48430. eventSystemFlags: eventSystemFlags,
  48431. nativeEvent: nativeEvent,
  48432. targetInst: targetInst,
  48433. ancestors: []
  48434. };
  48435. }
  48436. function releaseTopLevelCallbackBookKeeping(instance) {
  48437. instance.topLevelType = null;
  48438. instance.nativeEvent = null;
  48439. instance.targetInst = null;
  48440. instance.ancestors.length = 0;
  48441. if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
  48442. callbackBookkeepingPool.push(instance);
  48443. }
  48444. }
  48445. function handleTopLevel(bookKeeping) {
  48446. var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.
  48447. // It's important that we build the array of ancestors before calling any
  48448. // event handlers, because event handlers can modify the DOM, leading to
  48449. // inconsistencies with ReactMount's node cache. See #1105.
  48450. var ancestor = targetInst;
  48451. do {
  48452. if (!ancestor) {
  48453. var ancestors = bookKeeping.ancestors;
  48454. ancestors.push(ancestor);
  48455. break;
  48456. }
  48457. var root = findRootContainerNode(ancestor);
  48458. if (!root) {
  48459. break;
  48460. }
  48461. var tag = ancestor.tag;
  48462. if (tag === HostComponent || tag === HostText) {
  48463. bookKeeping.ancestors.push(ancestor);
  48464. }
  48465. ancestor = getClosestInstanceFromNode(root);
  48466. } while (ancestor);
  48467. for (var i = 0; i < bookKeeping.ancestors.length; i++) {
  48468. targetInst = bookKeeping.ancestors[i];
  48469. var eventTarget = getEventTarget(bookKeeping.nativeEvent);
  48470. var topLevelType = bookKeeping.topLevelType;
  48471. var nativeEvent = bookKeeping.nativeEvent;
  48472. runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, bookKeeping.eventSystemFlags);
  48473. }
  48474. } // TODO: can we stop exporting these?
  48475. var _enabled = true;
  48476. function setEnabled(enabled) {
  48477. _enabled = !!enabled;
  48478. }
  48479. function isEnabled() {
  48480. return _enabled;
  48481. }
  48482. function trapBubbledEvent(topLevelType, element) {
  48483. trapEventForPluginEventSystem(element, topLevelType, false);
  48484. }
  48485. function trapCapturedEvent(topLevelType, element) {
  48486. trapEventForPluginEventSystem(element, topLevelType, true);
  48487. }
  48488. function trapEventForResponderEventSystem(element, topLevelType, passive) {
  48489. if (enableFlareAPI) {
  48490. var rawEventName = getRawEventName(topLevelType);
  48491. var eventFlags = RESPONDER_EVENT_SYSTEM; // If passive option is not supported, then the event will be
  48492. // active and not passive, but we flag it as using not being
  48493. // supported too. This way the responder event plugins know,
  48494. // and can provide polyfills if needed.
  48495. if (passive) {
  48496. if (passiveBrowserEventsSupported) {
  48497. eventFlags |= IS_PASSIVE;
  48498. } else {
  48499. eventFlags |= IS_ACTIVE;
  48500. eventFlags |= PASSIVE_NOT_SUPPORTED;
  48501. passive = false;
  48502. }
  48503. } else {
  48504. eventFlags |= IS_ACTIVE;
  48505. } // Check if interactive and wrap in discreteUpdates
  48506. var listener = dispatchEvent.bind(null, topLevelType, eventFlags);
  48507. if (passiveBrowserEventsSupported) {
  48508. addEventCaptureListenerWithPassiveFlag(element, rawEventName, listener, passive);
  48509. } else {
  48510. addEventCaptureListener(element, rawEventName, listener);
  48511. }
  48512. }
  48513. }
  48514. function trapEventForPluginEventSystem(element, topLevelType, capture) {
  48515. var listener;
  48516. switch (getEventPriority(topLevelType)) {
  48517. case DiscreteEvent:
  48518. listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
  48519. break;
  48520. case UserBlockingEvent:
  48521. listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
  48522. break;
  48523. case ContinuousEvent:
  48524. default:
  48525. listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
  48526. break;
  48527. }
  48528. var rawEventName = getRawEventName(topLevelType);
  48529. if (capture) {
  48530. addEventCaptureListener(element, rawEventName, listener);
  48531. } else {
  48532. addEventBubbleListener(element, rawEventName, listener);
  48533. }
  48534. }
  48535. function dispatchDiscreteEvent(topLevelType, eventSystemFlags, nativeEvent) {
  48536. flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
  48537. discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, nativeEvent);
  48538. }
  48539. function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, nativeEvent) {
  48540. runWithPriority$1(UserBlockingPriority$1, dispatchEvent.bind(null, topLevelType, eventSystemFlags, nativeEvent));
  48541. }
  48542. function dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {
  48543. var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);
  48544. try {
  48545. // Event queue being processed in the same cycle allows
  48546. // `preventDefault`.
  48547. batchedEventUpdates(handleTopLevel, bookKeeping);
  48548. } finally {
  48549. releaseTopLevelCallbackBookKeeping(bookKeeping);
  48550. }
  48551. }
  48552. function dispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {
  48553. if (!_enabled) {
  48554. return;
  48555. }
  48556. if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {
  48557. // If we already have a queue of discrete events, and this is another discrete
  48558. // event, then we can't dispatch it regardless of its target, since they
  48559. // need to dispatch in order.
  48560. queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.
  48561. topLevelType, eventSystemFlags, nativeEvent);
  48562. return;
  48563. }
  48564. var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent);
  48565. if (blockedOn === null) {
  48566. // We successfully dispatched this event.
  48567. clearIfContinuousEvent(topLevelType, nativeEvent);
  48568. return;
  48569. }
  48570. if (isReplayableDiscreteEvent(topLevelType)) {
  48571. // This this to be replayed later once the target is available.
  48572. queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
  48573. return;
  48574. }
  48575. if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent)) {
  48576. return;
  48577. } // We need to clear only if we didn't queue because
  48578. // queueing is accummulative.
  48579. clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,
  48580. // in case the event system needs to trace it.
  48581. if (enableFlareAPI) {
  48582. if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {
  48583. dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
  48584. }
  48585. if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {
  48586. // React Flare event system
  48587. dispatchEventForResponderEventSystem(topLevelType, null, nativeEvent, getEventTarget(nativeEvent), eventSystemFlags);
  48588. }
  48589. } else {
  48590. dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
  48591. }
  48592. } // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.
  48593. function attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {
  48594. // TODO: Warn if _enabled is false.
  48595. var nativeEventTarget = getEventTarget(nativeEvent);
  48596. var targetInst = getClosestInstanceFromNode(nativeEventTarget);
  48597. if (targetInst !== null) {
  48598. var nearestMounted = getNearestMountedFiber(targetInst);
  48599. if (nearestMounted === null) {
  48600. // This tree has been unmounted already. Dispatch without a target.
  48601. targetInst = null;
  48602. } else {
  48603. var tag = nearestMounted.tag;
  48604. if (tag === SuspenseComponent) {
  48605. var instance = getSuspenseInstanceFromFiber(nearestMounted);
  48606. if (instance !== null) {
  48607. // Queue the event to be replayed later. Abort dispatching since we
  48608. // don't want this event dispatched twice through the event system.
  48609. // TODO: If this is the first discrete event in the queue. Schedule an increased
  48610. // priority for this boundary.
  48611. return instance;
  48612. } // This shouldn't happen, something went wrong but to avoid blocking
  48613. // the whole system, dispatch the event without a target.
  48614. // TODO: Warn.
  48615. targetInst = null;
  48616. } else if (tag === HostRoot) {
  48617. var root = nearestMounted.stateNode;
  48618. if (root.hydrate) {
  48619. // If this happens during a replay something went wrong and it might block
  48620. // the whole system.
  48621. return getContainerFromFiber(nearestMounted);
  48622. }
  48623. targetInst = null;
  48624. } else if (nearestMounted !== targetInst) {
  48625. // If we get an event (ex: img onload) before committing that
  48626. // component's mount, ignore it for now (that is, treat it as if it was an
  48627. // event on a non-React tree). We might also consider queueing events and
  48628. // dispatching them after the mount.
  48629. targetInst = null;
  48630. }
  48631. }
  48632. }
  48633. if (enableFlareAPI) {
  48634. if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {
  48635. dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
  48636. }
  48637. if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {
  48638. // React Flare event system
  48639. dispatchEventForResponderEventSystem(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
  48640. }
  48641. } else {
  48642. dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
  48643. } // We're not blocked on anything.
  48644. return null;
  48645. }
  48646. /**
  48647. * Checks if an event is supported in the current execution environment.
  48648. *
  48649. * NOTE: This will not work correctly for non-generic events such as `change`,
  48650. * `reset`, `load`, `error`, and `select`.
  48651. *
  48652. * Borrows from Modernizr.
  48653. *
  48654. * @param {string} eventNameSuffix Event name, e.g. "click".
  48655. * @return {boolean} True if the event is supported.
  48656. * @internal
  48657. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  48658. */
  48659. function isEventSupported(eventNameSuffix) {
  48660. if (!canUseDOM) {
  48661. return false;
  48662. }
  48663. var eventName = 'on' + eventNameSuffix;
  48664. var isSupported = eventName in document;
  48665. if (!isSupported) {
  48666. var element = document.createElement('div');
  48667. element.setAttribute(eventName, 'return;');
  48668. isSupported = typeof element[eventName] === 'function';
  48669. }
  48670. return isSupported;
  48671. }
  48672. /**
  48673. * Summary of `ReactBrowserEventEmitter` event handling:
  48674. *
  48675. * - Top-level delegation is used to trap most native browser events. This
  48676. * may only occur in the main thread and is the responsibility of
  48677. * ReactDOMEventListener, which is injected and can therefore support
  48678. * pluggable event sources. This is the only work that occurs in the main
  48679. * thread.
  48680. *
  48681. * - We normalize and de-duplicate events to account for browser quirks. This
  48682. * may be done in the worker thread.
  48683. *
  48684. * - Forward these native events (with the associated top-level type used to
  48685. * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
  48686. * to extract any synthetic events.
  48687. *
  48688. * - The `EventPluginHub` will then process each event by annotating them with
  48689. * "dispatches", a sequence of listeners and IDs that care about that event.
  48690. *
  48691. * - The `EventPluginHub` then dispatches the events.
  48692. *
  48693. * Overview of React and the event system:
  48694. *
  48695. * +------------+ .
  48696. * | DOM | .
  48697. * +------------+ .
  48698. * | .
  48699. * v .
  48700. * +------------+ .
  48701. * | ReactEvent | .
  48702. * | Listener | .
  48703. * +------------+ . +-----------+
  48704. * | . +--------+|SimpleEvent|
  48705. * | . | |Plugin |
  48706. * +-----|------+ . v +-----------+
  48707. * | | | . +--------------+ +------------+
  48708. * | +-----------.--->|EventPluginHub| | Event |
  48709. * | | . | | +-----------+ | Propagators|
  48710. * | ReactEvent | . | | |TapEvent | |------------|
  48711. * | Emitter | . | |<---+|Plugin | |other plugin|
  48712. * | | . | | +-----------+ | utilities |
  48713. * | +-----------.--->| | +------------+
  48714. * | | | . +--------------+
  48715. * +-----|------+ . ^ +-----------+
  48716. * | . | |Enter/Leave|
  48717. * + . +-------+|Plugin |
  48718. * +-------------+ . +-----------+
  48719. * | application | .
  48720. * |-------------| .
  48721. * | | .
  48722. * | | .
  48723. * +-------------+ .
  48724. * .
  48725. * React Core . General Purpose Event Plugin System
  48726. */
  48727. var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  48728. var elementListeningSets = new PossiblyWeakMap();
  48729. function getListeningSetForElement(element) {
  48730. var listeningSet = elementListeningSets.get(element);
  48731. if (listeningSet === undefined) {
  48732. listeningSet = new Set();
  48733. elementListeningSets.set(element, listeningSet);
  48734. }
  48735. return listeningSet;
  48736. }
  48737. /**
  48738. * We listen for bubbled touch events on the document object.
  48739. *
  48740. * Firefox v8.01 (and possibly others) exhibited strange behavior when
  48741. * mounting `onmousemove` events at some node that was not the document
  48742. * element. The symptoms were that if your mouse is not moving over something
  48743. * contained within that mount point (for example on the background) the
  48744. * top-level listeners for `onmousemove` won't be called. However, if you
  48745. * register the `mousemove` on the document object, then it will of course
  48746. * catch all `mousemove`s. This along with iOS quirks, justifies restricting
  48747. * top-level listeners to the document object only, at least for these
  48748. * movement types of events and possibly all events.
  48749. *
  48750. * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  48751. *
  48752. * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
  48753. * they bubble to document.
  48754. *
  48755. * @param {string} registrationName Name of listener (e.g. `onClick`).
  48756. * @param {object} mountAt Container where to mount the listener
  48757. */
  48758. function listenTo(registrationName, mountAt) {
  48759. var listeningSet = getListeningSetForElement(mountAt);
  48760. var dependencies = registrationNameDependencies[registrationName];
  48761. for (var i = 0; i < dependencies.length; i++) {
  48762. var dependency = dependencies[i];
  48763. listenToTopLevel(dependency, mountAt, listeningSet);
  48764. }
  48765. }
  48766. function listenToTopLevel(topLevelType, mountAt, listeningSet) {
  48767. if (!listeningSet.has(topLevelType)) {
  48768. switch (topLevelType) {
  48769. case TOP_SCROLL:
  48770. trapCapturedEvent(TOP_SCROLL, mountAt);
  48771. break;
  48772. case TOP_FOCUS:
  48773. case TOP_BLUR:
  48774. trapCapturedEvent(TOP_FOCUS, mountAt);
  48775. trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,
  48776. // but this ensures we mark both as attached rather than just one.
  48777. listeningSet.add(TOP_BLUR);
  48778. listeningSet.add(TOP_FOCUS);
  48779. break;
  48780. case TOP_CANCEL:
  48781. case TOP_CLOSE:
  48782. if (isEventSupported(getRawEventName(topLevelType))) {
  48783. trapCapturedEvent(topLevelType, mountAt);
  48784. }
  48785. break;
  48786. case TOP_INVALID:
  48787. case TOP_SUBMIT:
  48788. case TOP_RESET:
  48789. // We listen to them on the target DOM elements.
  48790. // Some of them bubble so we don't want them to fire twice.
  48791. break;
  48792. default:
  48793. // By default, listen on the top level to all non-media events.
  48794. // Media events don't bubble so adding the listener wouldn't do anything.
  48795. var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;
  48796. if (!isMediaEvent) {
  48797. trapBubbledEvent(topLevelType, mountAt);
  48798. }
  48799. break;
  48800. }
  48801. listeningSet.add(topLevelType);
  48802. }
  48803. }
  48804. function isListeningToAllDependencies(registrationName, mountAt) {
  48805. var listeningSet = getListeningSetForElement(mountAt);
  48806. var dependencies = registrationNameDependencies[registrationName];
  48807. for (var i = 0; i < dependencies.length; i++) {
  48808. var dependency = dependencies[i];
  48809. if (!listeningSet.has(dependency)) {
  48810. return false;
  48811. }
  48812. }
  48813. return true;
  48814. }
  48815. // List derived from Gecko source code:
  48816. // https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
  48817. var shorthandToLonghand = {
  48818. animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
  48819. background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
  48820. backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
  48821. border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  48822. borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
  48823. borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
  48824. borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
  48825. borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
  48826. borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
  48827. borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
  48828. borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
  48829. borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
  48830. borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
  48831. borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
  48832. borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
  48833. borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  48834. borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
  48835. columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
  48836. columns: ['columnCount', 'columnWidth'],
  48837. flex: ['flexBasis', 'flexGrow', 'flexShrink'],
  48838. flexFlow: ['flexDirection', 'flexWrap'],
  48839. font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
  48840. fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
  48841. gap: ['columnGap', 'rowGap'],
  48842. grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  48843. gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
  48844. gridColumn: ['gridColumnEnd', 'gridColumnStart'],
  48845. gridColumnGap: ['columnGap'],
  48846. gridGap: ['columnGap', 'rowGap'],
  48847. gridRow: ['gridRowEnd', 'gridRowStart'],
  48848. gridRowGap: ['rowGap'],
  48849. gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  48850. listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
  48851. margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
  48852. marker: ['markerEnd', 'markerMid', 'markerStart'],
  48853. mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
  48854. maskPosition: ['maskPositionX', 'maskPositionY'],
  48855. outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
  48856. overflow: ['overflowX', 'overflowY'],
  48857. padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
  48858. placeContent: ['alignContent', 'justifyContent'],
  48859. placeItems: ['alignItems', 'justifyItems'],
  48860. placeSelf: ['alignSelf', 'justifySelf'],
  48861. textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
  48862. textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
  48863. transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
  48864. wordWrap: ['overflowWrap']
  48865. };
  48866. /**
  48867. * CSS properties which accept numbers but are not in units of "px".
  48868. */
  48869. var isUnitlessNumber = {
  48870. animationIterationCount: true,
  48871. borderImageOutset: true,
  48872. borderImageSlice: true,
  48873. borderImageWidth: true,
  48874. boxFlex: true,
  48875. boxFlexGroup: true,
  48876. boxOrdinalGroup: true,
  48877. columnCount: true,
  48878. columns: true,
  48879. flex: true,
  48880. flexGrow: true,
  48881. flexPositive: true,
  48882. flexShrink: true,
  48883. flexNegative: true,
  48884. flexOrder: true,
  48885. gridArea: true,
  48886. gridRow: true,
  48887. gridRowEnd: true,
  48888. gridRowSpan: true,
  48889. gridRowStart: true,
  48890. gridColumn: true,
  48891. gridColumnEnd: true,
  48892. gridColumnSpan: true,
  48893. gridColumnStart: true,
  48894. fontWeight: true,
  48895. lineClamp: true,
  48896. lineHeight: true,
  48897. opacity: true,
  48898. order: true,
  48899. orphans: true,
  48900. tabSize: true,
  48901. widows: true,
  48902. zIndex: true,
  48903. zoom: true,
  48904. // SVG-related properties
  48905. fillOpacity: true,
  48906. floodOpacity: true,
  48907. stopOpacity: true,
  48908. strokeDasharray: true,
  48909. strokeDashoffset: true,
  48910. strokeMiterlimit: true,
  48911. strokeOpacity: true,
  48912. strokeWidth: true
  48913. };
  48914. /**
  48915. * @param {string} prefix vendor-specific prefix, eg: Webkit
  48916. * @param {string} key style name, eg: transitionDuration
  48917. * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
  48918. * WebkitTransitionDuration
  48919. */
  48920. function prefixKey(prefix, key) {
  48921. return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  48922. }
  48923. /**
  48924. * Support style names that may come passed in prefixed by adding permutations
  48925. * of vendor prefixes.
  48926. */
  48927. var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
  48928. // infinite loop, because it iterates over the newly added props too.
  48929. Object.keys(isUnitlessNumber).forEach(function (prop) {
  48930. prefixes.forEach(function (prefix) {
  48931. isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  48932. });
  48933. });
  48934. /**
  48935. * Convert a value into the proper css writable value. The style name `name`
  48936. * should be logical (no hyphens), as specified
  48937. * in `CSSProperty.isUnitlessNumber`.
  48938. *
  48939. * @param {string} name CSS property name such as `topMargin`.
  48940. * @param {*} value CSS property value such as `10px`.
  48941. * @return {string} Normalized style value with dimensions applied.
  48942. */
  48943. function dangerousStyleValue(name, value, isCustomProperty) {
  48944. // Note that we've removed escapeTextForBrowser() calls here since the
  48945. // whole string will be escaped when the attribute is injected into
  48946. // the markup. If you provide unsafe user data here they can inject
  48947. // arbitrary CSS which may be problematic (I couldn't repro this):
  48948. // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  48949. // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  48950. // This is not an XSS hole but instead a potential CSS injection issue
  48951. // which has lead to a greater discussion about how we're going to
  48952. // trust URLs moving forward. See #2115901
  48953. var isEmpty = value == null || typeof value === 'boolean' || value === '';
  48954. if (isEmpty) {
  48955. return '';
  48956. }
  48957. if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
  48958. return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  48959. }
  48960. return ('' + value).trim();
  48961. }
  48962. var uppercasePattern = /([A-Z])/g;
  48963. var msPattern = /^ms-/;
  48964. /**
  48965. * Hyphenates a camelcased CSS property name, for example:
  48966. *
  48967. * > hyphenateStyleName('backgroundColor')
  48968. * < "background-color"
  48969. * > hyphenateStyleName('MozTransition')
  48970. * < "-moz-transition"
  48971. * > hyphenateStyleName('msTransition')
  48972. * < "-ms-transition"
  48973. *
  48974. * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
  48975. * is converted to `-ms-`.
  48976. */
  48977. function hyphenateStyleName(name) {
  48978. return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
  48979. }
  48980. var warnValidStyle = function () {};
  48981. {
  48982. // 'msTransform' is correct, but the other prefixes should be capitalized
  48983. var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  48984. var msPattern$1 = /^-ms-/;
  48985. var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon
  48986. var badStyleValueWithSemicolonPattern = /;\s*$/;
  48987. var warnedStyleNames = {};
  48988. var warnedStyleValues = {};
  48989. var warnedForNaNValue = false;
  48990. var warnedForInfinityValue = false;
  48991. var camelize = function (string) {
  48992. return string.replace(hyphenPattern, function (_, character) {
  48993. return character.toUpperCase();
  48994. });
  48995. };
  48996. var warnHyphenatedStyleName = function (name) {
  48997. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  48998. return;
  48999. }
  49000. warnedStyleNames[name] = true;
  49001. warning$1(false, 'Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
  49002. // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
  49003. // is converted to lowercase `ms`.
  49004. camelize(name.replace(msPattern$1, 'ms-')));
  49005. };
  49006. var warnBadVendoredStyleName = function (name) {
  49007. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  49008. return;
  49009. }
  49010. warnedStyleNames[name] = true;
  49011. warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  49012. };
  49013. var warnStyleValueWithSemicolon = function (name, value) {
  49014. if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
  49015. return;
  49016. }
  49017. warnedStyleValues[value] = true;
  49018. warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  49019. };
  49020. var warnStyleValueIsNaN = function (name, value) {
  49021. if (warnedForNaNValue) {
  49022. return;
  49023. }
  49024. warnedForNaNValue = true;
  49025. warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
  49026. };
  49027. var warnStyleValueIsInfinity = function (name, value) {
  49028. if (warnedForInfinityValue) {
  49029. return;
  49030. }
  49031. warnedForInfinityValue = true;
  49032. warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
  49033. };
  49034. warnValidStyle = function (name, value) {
  49035. if (name.indexOf('-') > -1) {
  49036. warnHyphenatedStyleName(name);
  49037. } else if (badVendoredStyleNamePattern.test(name)) {
  49038. warnBadVendoredStyleName(name);
  49039. } else if (badStyleValueWithSemicolonPattern.test(value)) {
  49040. warnStyleValueWithSemicolon(name, value);
  49041. }
  49042. if (typeof value === 'number') {
  49043. if (isNaN(value)) {
  49044. warnStyleValueIsNaN(name, value);
  49045. } else if (!isFinite(value)) {
  49046. warnStyleValueIsInfinity(name, value);
  49047. }
  49048. }
  49049. };
  49050. }
  49051. var warnValidStyle$1 = warnValidStyle;
  49052. /**
  49053. * Operations for dealing with CSS properties.
  49054. */
  49055. /**
  49056. * This creates a string that is expected to be equivalent to the style
  49057. * attribute generated by server-side rendering. It by-passes warnings and
  49058. * security checks so it's not safe to use this value for anything other than
  49059. * comparison. It is only used in DEV for SSR validation.
  49060. */
  49061. function createDangerousStringForStyles(styles) {
  49062. {
  49063. var serialized = '';
  49064. var delimiter = '';
  49065. for (var styleName in styles) {
  49066. if (!styles.hasOwnProperty(styleName)) {
  49067. continue;
  49068. }
  49069. var styleValue = styles[styleName];
  49070. if (styleValue != null) {
  49071. var isCustomProperty = styleName.indexOf('--') === 0;
  49072. serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
  49073. serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
  49074. delimiter = ';';
  49075. }
  49076. }
  49077. return serialized || null;
  49078. }
  49079. }
  49080. /**
  49081. * Sets the value for multiple styles on a node. If a value is specified as
  49082. * '' (empty string), the corresponding style property will be unset.
  49083. *
  49084. * @param {DOMElement} node
  49085. * @param {object} styles
  49086. */
  49087. function setValueForStyles(node, styles) {
  49088. var style = node.style;
  49089. for (var styleName in styles) {
  49090. if (!styles.hasOwnProperty(styleName)) {
  49091. continue;
  49092. }
  49093. var isCustomProperty = styleName.indexOf('--') === 0;
  49094. {
  49095. if (!isCustomProperty) {
  49096. warnValidStyle$1(styleName, styles[styleName]);
  49097. }
  49098. }
  49099. var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
  49100. if (styleName === 'float') {
  49101. styleName = 'cssFloat';
  49102. }
  49103. if (isCustomProperty) {
  49104. style.setProperty(styleName, styleValue);
  49105. } else {
  49106. style[styleName] = styleValue;
  49107. }
  49108. }
  49109. }
  49110. function isValueEmpty(value) {
  49111. return value == null || typeof value === 'boolean' || value === '';
  49112. }
  49113. /**
  49114. * Given {color: 'red', overflow: 'hidden'} returns {
  49115. * color: 'color',
  49116. * overflowX: 'overflow',
  49117. * overflowY: 'overflow',
  49118. * }. This can be read as "the overflowY property was set by the overflow
  49119. * shorthand". That is, the values are the property that each was derived from.
  49120. */
  49121. function expandShorthandMap(styles) {
  49122. var expanded = {};
  49123. for (var key in styles) {
  49124. var longhands = shorthandToLonghand[key] || [key];
  49125. for (var i = 0; i < longhands.length; i++) {
  49126. expanded[longhands[i]] = key;
  49127. }
  49128. }
  49129. return expanded;
  49130. }
  49131. /**
  49132. * When mixing shorthand and longhand property names, we warn during updates if
  49133. * we expect an incorrect result to occur. In particular, we warn for:
  49134. *
  49135. * Updating a shorthand property (longhand gets overwritten):
  49136. * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
  49137. * becomes .style.font = 'baz'
  49138. * Removing a shorthand property (longhand gets lost too):
  49139. * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
  49140. * becomes .style.font = ''
  49141. * Removing a longhand property (should revert to shorthand; doesn't):
  49142. * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
  49143. * becomes .style.fontVariant = ''
  49144. */
  49145. function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
  49146. if (!warnAboutShorthandPropertyCollision) {
  49147. return;
  49148. }
  49149. if (!nextStyles) {
  49150. return;
  49151. }
  49152. var expandedUpdates = expandShorthandMap(styleUpdates);
  49153. var expandedStyles = expandShorthandMap(nextStyles);
  49154. var warnedAbout = {};
  49155. for (var key in expandedUpdates) {
  49156. var originalKey = expandedUpdates[key];
  49157. var correctOriginalKey = expandedStyles[key];
  49158. if (correctOriginalKey && originalKey !== correctOriginalKey) {
  49159. var warningKey = originalKey + ',' + correctOriginalKey;
  49160. if (warnedAbout[warningKey]) {
  49161. continue;
  49162. }
  49163. warnedAbout[warningKey] = true;
  49164. warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
  49165. }
  49166. }
  49167. }
  49168. // For HTML, certain tags should omit their close tag. We keep a whitelist for
  49169. // those special-case tags.
  49170. var omittedCloseTags = {
  49171. area: true,
  49172. base: true,
  49173. br: true,
  49174. col: true,
  49175. embed: true,
  49176. hr: true,
  49177. img: true,
  49178. input: true,
  49179. keygen: true,
  49180. link: true,
  49181. meta: true,
  49182. param: true,
  49183. source: true,
  49184. track: true,
  49185. wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.
  49186. };
  49187. // `omittedCloseTags` except that `menuitem` should still have its closing tag.
  49188. var voidElementTags = _assign({
  49189. menuitem: true
  49190. }, omittedCloseTags);
  49191. // or add stack by default to invariants where possible.
  49192. var HTML$1 = '__html';
  49193. var ReactDebugCurrentFrame$3 = null;
  49194. {
  49195. ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
  49196. }
  49197. function assertValidProps(tag, props) {
  49198. if (!props) {
  49199. return;
  49200. } // Note the use of `==` which checks for null or undefined.
  49201. if (voidElementTags[tag]) {
  49202. if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
  49203. {
  49204. throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + (ReactDebugCurrentFrame$3.getStackAddendum()));
  49205. }
  49206. }
  49207. }
  49208. if (props.dangerouslySetInnerHTML != null) {
  49209. if (!(props.children == null)) {
  49210. {
  49211. throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
  49212. }
  49213. }
  49214. if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML)) {
  49215. {
  49216. throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.");
  49217. }
  49218. }
  49219. }
  49220. {
  49221. !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
  49222. }
  49223. if (!(props.style == null || typeof props.style === 'object')) {
  49224. {
  49225. throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + (ReactDebugCurrentFrame$3.getStackAddendum()));
  49226. }
  49227. }
  49228. }
  49229. function isCustomComponent(tagName, props) {
  49230. if (tagName.indexOf('-') === -1) {
  49231. return typeof props.is === 'string';
  49232. }
  49233. switch (tagName) {
  49234. // These are reserved SVG and MathML elements.
  49235. // We don't mind this whitelist too much because we expect it to never grow.
  49236. // The alternative is to track the namespace in a few places which is convoluted.
  49237. // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
  49238. case 'annotation-xml':
  49239. case 'color-profile':
  49240. case 'font-face':
  49241. case 'font-face-src':
  49242. case 'font-face-uri':
  49243. case 'font-face-format':
  49244. case 'font-face-name':
  49245. case 'missing-glyph':
  49246. return false;
  49247. default:
  49248. return true;
  49249. }
  49250. }
  49251. // When adding attributes to the HTML or SVG whitelist, be sure to
  49252. // also add them to this module to ensure casing and incorrect name
  49253. // warnings.
  49254. var possibleStandardNames = {
  49255. // HTML
  49256. accept: 'accept',
  49257. acceptcharset: 'acceptCharset',
  49258. 'accept-charset': 'acceptCharset',
  49259. accesskey: 'accessKey',
  49260. action: 'action',
  49261. allowfullscreen: 'allowFullScreen',
  49262. alt: 'alt',
  49263. as: 'as',
  49264. async: 'async',
  49265. autocapitalize: 'autoCapitalize',
  49266. autocomplete: 'autoComplete',
  49267. autocorrect: 'autoCorrect',
  49268. autofocus: 'autoFocus',
  49269. autoplay: 'autoPlay',
  49270. autosave: 'autoSave',
  49271. capture: 'capture',
  49272. cellpadding: 'cellPadding',
  49273. cellspacing: 'cellSpacing',
  49274. challenge: 'challenge',
  49275. charset: 'charSet',
  49276. checked: 'checked',
  49277. children: 'children',
  49278. cite: 'cite',
  49279. class: 'className',
  49280. classid: 'classID',
  49281. classname: 'className',
  49282. cols: 'cols',
  49283. colspan: 'colSpan',
  49284. content: 'content',
  49285. contenteditable: 'contentEditable',
  49286. contextmenu: 'contextMenu',
  49287. controls: 'controls',
  49288. controlslist: 'controlsList',
  49289. coords: 'coords',
  49290. crossorigin: 'crossOrigin',
  49291. dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  49292. data: 'data',
  49293. datetime: 'dateTime',
  49294. default: 'default',
  49295. defaultchecked: 'defaultChecked',
  49296. defaultvalue: 'defaultValue',
  49297. defer: 'defer',
  49298. dir: 'dir',
  49299. disabled: 'disabled',
  49300. disablepictureinpicture: 'disablePictureInPicture',
  49301. download: 'download',
  49302. draggable: 'draggable',
  49303. enctype: 'encType',
  49304. for: 'htmlFor',
  49305. form: 'form',
  49306. formmethod: 'formMethod',
  49307. formaction: 'formAction',
  49308. formenctype: 'formEncType',
  49309. formnovalidate: 'formNoValidate',
  49310. formtarget: 'formTarget',
  49311. frameborder: 'frameBorder',
  49312. headers: 'headers',
  49313. height: 'height',
  49314. hidden: 'hidden',
  49315. high: 'high',
  49316. href: 'href',
  49317. hreflang: 'hrefLang',
  49318. htmlfor: 'htmlFor',
  49319. httpequiv: 'httpEquiv',
  49320. 'http-equiv': 'httpEquiv',
  49321. icon: 'icon',
  49322. id: 'id',
  49323. innerhtml: 'innerHTML',
  49324. inputmode: 'inputMode',
  49325. integrity: 'integrity',
  49326. is: 'is',
  49327. itemid: 'itemID',
  49328. itemprop: 'itemProp',
  49329. itemref: 'itemRef',
  49330. itemscope: 'itemScope',
  49331. itemtype: 'itemType',
  49332. keyparams: 'keyParams',
  49333. keytype: 'keyType',
  49334. kind: 'kind',
  49335. label: 'label',
  49336. lang: 'lang',
  49337. list: 'list',
  49338. loop: 'loop',
  49339. low: 'low',
  49340. manifest: 'manifest',
  49341. marginwidth: 'marginWidth',
  49342. marginheight: 'marginHeight',
  49343. max: 'max',
  49344. maxlength: 'maxLength',
  49345. media: 'media',
  49346. mediagroup: 'mediaGroup',
  49347. method: 'method',
  49348. min: 'min',
  49349. minlength: 'minLength',
  49350. multiple: 'multiple',
  49351. muted: 'muted',
  49352. name: 'name',
  49353. nomodule: 'noModule',
  49354. nonce: 'nonce',
  49355. novalidate: 'noValidate',
  49356. open: 'open',
  49357. optimum: 'optimum',
  49358. pattern: 'pattern',
  49359. placeholder: 'placeholder',
  49360. playsinline: 'playsInline',
  49361. poster: 'poster',
  49362. preload: 'preload',
  49363. profile: 'profile',
  49364. radiogroup: 'radioGroup',
  49365. readonly: 'readOnly',
  49366. referrerpolicy: 'referrerPolicy',
  49367. rel: 'rel',
  49368. required: 'required',
  49369. reversed: 'reversed',
  49370. role: 'role',
  49371. rows: 'rows',
  49372. rowspan: 'rowSpan',
  49373. sandbox: 'sandbox',
  49374. scope: 'scope',
  49375. scoped: 'scoped',
  49376. scrolling: 'scrolling',
  49377. seamless: 'seamless',
  49378. selected: 'selected',
  49379. shape: 'shape',
  49380. size: 'size',
  49381. sizes: 'sizes',
  49382. span: 'span',
  49383. spellcheck: 'spellCheck',
  49384. src: 'src',
  49385. srcdoc: 'srcDoc',
  49386. srclang: 'srcLang',
  49387. srcset: 'srcSet',
  49388. start: 'start',
  49389. step: 'step',
  49390. style: 'style',
  49391. summary: 'summary',
  49392. tabindex: 'tabIndex',
  49393. target: 'target',
  49394. title: 'title',
  49395. type: 'type',
  49396. usemap: 'useMap',
  49397. value: 'value',
  49398. width: 'width',
  49399. wmode: 'wmode',
  49400. wrap: 'wrap',
  49401. // SVG
  49402. about: 'about',
  49403. accentheight: 'accentHeight',
  49404. 'accent-height': 'accentHeight',
  49405. accumulate: 'accumulate',
  49406. additive: 'additive',
  49407. alignmentbaseline: 'alignmentBaseline',
  49408. 'alignment-baseline': 'alignmentBaseline',
  49409. allowreorder: 'allowReorder',
  49410. alphabetic: 'alphabetic',
  49411. amplitude: 'amplitude',
  49412. arabicform: 'arabicForm',
  49413. 'arabic-form': 'arabicForm',
  49414. ascent: 'ascent',
  49415. attributename: 'attributeName',
  49416. attributetype: 'attributeType',
  49417. autoreverse: 'autoReverse',
  49418. azimuth: 'azimuth',
  49419. basefrequency: 'baseFrequency',
  49420. baselineshift: 'baselineShift',
  49421. 'baseline-shift': 'baselineShift',
  49422. baseprofile: 'baseProfile',
  49423. bbox: 'bbox',
  49424. begin: 'begin',
  49425. bias: 'bias',
  49426. by: 'by',
  49427. calcmode: 'calcMode',
  49428. capheight: 'capHeight',
  49429. 'cap-height': 'capHeight',
  49430. clip: 'clip',
  49431. clippath: 'clipPath',
  49432. 'clip-path': 'clipPath',
  49433. clippathunits: 'clipPathUnits',
  49434. cliprule: 'clipRule',
  49435. 'clip-rule': 'clipRule',
  49436. color: 'color',
  49437. colorinterpolation: 'colorInterpolation',
  49438. 'color-interpolation': 'colorInterpolation',
  49439. colorinterpolationfilters: 'colorInterpolationFilters',
  49440. 'color-interpolation-filters': 'colorInterpolationFilters',
  49441. colorprofile: 'colorProfile',
  49442. 'color-profile': 'colorProfile',
  49443. colorrendering: 'colorRendering',
  49444. 'color-rendering': 'colorRendering',
  49445. contentscripttype: 'contentScriptType',
  49446. contentstyletype: 'contentStyleType',
  49447. cursor: 'cursor',
  49448. cx: 'cx',
  49449. cy: 'cy',
  49450. d: 'd',
  49451. datatype: 'datatype',
  49452. decelerate: 'decelerate',
  49453. descent: 'descent',
  49454. diffuseconstant: 'diffuseConstant',
  49455. direction: 'direction',
  49456. display: 'display',
  49457. divisor: 'divisor',
  49458. dominantbaseline: 'dominantBaseline',
  49459. 'dominant-baseline': 'dominantBaseline',
  49460. dur: 'dur',
  49461. dx: 'dx',
  49462. dy: 'dy',
  49463. edgemode: 'edgeMode',
  49464. elevation: 'elevation',
  49465. enablebackground: 'enableBackground',
  49466. 'enable-background': 'enableBackground',
  49467. end: 'end',
  49468. exponent: 'exponent',
  49469. externalresourcesrequired: 'externalResourcesRequired',
  49470. fill: 'fill',
  49471. fillopacity: 'fillOpacity',
  49472. 'fill-opacity': 'fillOpacity',
  49473. fillrule: 'fillRule',
  49474. 'fill-rule': 'fillRule',
  49475. filter: 'filter',
  49476. filterres: 'filterRes',
  49477. filterunits: 'filterUnits',
  49478. floodopacity: 'floodOpacity',
  49479. 'flood-opacity': 'floodOpacity',
  49480. floodcolor: 'floodColor',
  49481. 'flood-color': 'floodColor',
  49482. focusable: 'focusable',
  49483. fontfamily: 'fontFamily',
  49484. 'font-family': 'fontFamily',
  49485. fontsize: 'fontSize',
  49486. 'font-size': 'fontSize',
  49487. fontsizeadjust: 'fontSizeAdjust',
  49488. 'font-size-adjust': 'fontSizeAdjust',
  49489. fontstretch: 'fontStretch',
  49490. 'font-stretch': 'fontStretch',
  49491. fontstyle: 'fontStyle',
  49492. 'font-style': 'fontStyle',
  49493. fontvariant: 'fontVariant',
  49494. 'font-variant': 'fontVariant',
  49495. fontweight: 'fontWeight',
  49496. 'font-weight': 'fontWeight',
  49497. format: 'format',
  49498. from: 'from',
  49499. fx: 'fx',
  49500. fy: 'fy',
  49501. g1: 'g1',
  49502. g2: 'g2',
  49503. glyphname: 'glyphName',
  49504. 'glyph-name': 'glyphName',
  49505. glyphorientationhorizontal: 'glyphOrientationHorizontal',
  49506. 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  49507. glyphorientationvertical: 'glyphOrientationVertical',
  49508. 'glyph-orientation-vertical': 'glyphOrientationVertical',
  49509. glyphref: 'glyphRef',
  49510. gradienttransform: 'gradientTransform',
  49511. gradientunits: 'gradientUnits',
  49512. hanging: 'hanging',
  49513. horizadvx: 'horizAdvX',
  49514. 'horiz-adv-x': 'horizAdvX',
  49515. horizoriginx: 'horizOriginX',
  49516. 'horiz-origin-x': 'horizOriginX',
  49517. ideographic: 'ideographic',
  49518. imagerendering: 'imageRendering',
  49519. 'image-rendering': 'imageRendering',
  49520. in2: 'in2',
  49521. in: 'in',
  49522. inlist: 'inlist',
  49523. intercept: 'intercept',
  49524. k1: 'k1',
  49525. k2: 'k2',
  49526. k3: 'k3',
  49527. k4: 'k4',
  49528. k: 'k',
  49529. kernelmatrix: 'kernelMatrix',
  49530. kernelunitlength: 'kernelUnitLength',
  49531. kerning: 'kerning',
  49532. keypoints: 'keyPoints',
  49533. keysplines: 'keySplines',
  49534. keytimes: 'keyTimes',
  49535. lengthadjust: 'lengthAdjust',
  49536. letterspacing: 'letterSpacing',
  49537. 'letter-spacing': 'letterSpacing',
  49538. lightingcolor: 'lightingColor',
  49539. 'lighting-color': 'lightingColor',
  49540. limitingconeangle: 'limitingConeAngle',
  49541. local: 'local',
  49542. markerend: 'markerEnd',
  49543. 'marker-end': 'markerEnd',
  49544. markerheight: 'markerHeight',
  49545. markermid: 'markerMid',
  49546. 'marker-mid': 'markerMid',
  49547. markerstart: 'markerStart',
  49548. 'marker-start': 'markerStart',
  49549. markerunits: 'markerUnits',
  49550. markerwidth: 'markerWidth',
  49551. mask: 'mask',
  49552. maskcontentunits: 'maskContentUnits',
  49553. maskunits: 'maskUnits',
  49554. mathematical: 'mathematical',
  49555. mode: 'mode',
  49556. numoctaves: 'numOctaves',
  49557. offset: 'offset',
  49558. opacity: 'opacity',
  49559. operator: 'operator',
  49560. order: 'order',
  49561. orient: 'orient',
  49562. orientation: 'orientation',
  49563. origin: 'origin',
  49564. overflow: 'overflow',
  49565. overlineposition: 'overlinePosition',
  49566. 'overline-position': 'overlinePosition',
  49567. overlinethickness: 'overlineThickness',
  49568. 'overline-thickness': 'overlineThickness',
  49569. paintorder: 'paintOrder',
  49570. 'paint-order': 'paintOrder',
  49571. panose1: 'panose1',
  49572. 'panose-1': 'panose1',
  49573. pathlength: 'pathLength',
  49574. patterncontentunits: 'patternContentUnits',
  49575. patterntransform: 'patternTransform',
  49576. patternunits: 'patternUnits',
  49577. pointerevents: 'pointerEvents',
  49578. 'pointer-events': 'pointerEvents',
  49579. points: 'points',
  49580. pointsatx: 'pointsAtX',
  49581. pointsaty: 'pointsAtY',
  49582. pointsatz: 'pointsAtZ',
  49583. prefix: 'prefix',
  49584. preservealpha: 'preserveAlpha',
  49585. preserveaspectratio: 'preserveAspectRatio',
  49586. primitiveunits: 'primitiveUnits',
  49587. property: 'property',
  49588. r: 'r',
  49589. radius: 'radius',
  49590. refx: 'refX',
  49591. refy: 'refY',
  49592. renderingintent: 'renderingIntent',
  49593. 'rendering-intent': 'renderingIntent',
  49594. repeatcount: 'repeatCount',
  49595. repeatdur: 'repeatDur',
  49596. requiredextensions: 'requiredExtensions',
  49597. requiredfeatures: 'requiredFeatures',
  49598. resource: 'resource',
  49599. restart: 'restart',
  49600. result: 'result',
  49601. results: 'results',
  49602. rotate: 'rotate',
  49603. rx: 'rx',
  49604. ry: 'ry',
  49605. scale: 'scale',
  49606. security: 'security',
  49607. seed: 'seed',
  49608. shaperendering: 'shapeRendering',
  49609. 'shape-rendering': 'shapeRendering',
  49610. slope: 'slope',
  49611. spacing: 'spacing',
  49612. specularconstant: 'specularConstant',
  49613. specularexponent: 'specularExponent',
  49614. speed: 'speed',
  49615. spreadmethod: 'spreadMethod',
  49616. startoffset: 'startOffset',
  49617. stddeviation: 'stdDeviation',
  49618. stemh: 'stemh',
  49619. stemv: 'stemv',
  49620. stitchtiles: 'stitchTiles',
  49621. stopcolor: 'stopColor',
  49622. 'stop-color': 'stopColor',
  49623. stopopacity: 'stopOpacity',
  49624. 'stop-opacity': 'stopOpacity',
  49625. strikethroughposition: 'strikethroughPosition',
  49626. 'strikethrough-position': 'strikethroughPosition',
  49627. strikethroughthickness: 'strikethroughThickness',
  49628. 'strikethrough-thickness': 'strikethroughThickness',
  49629. string: 'string',
  49630. stroke: 'stroke',
  49631. strokedasharray: 'strokeDasharray',
  49632. 'stroke-dasharray': 'strokeDasharray',
  49633. strokedashoffset: 'strokeDashoffset',
  49634. 'stroke-dashoffset': 'strokeDashoffset',
  49635. strokelinecap: 'strokeLinecap',
  49636. 'stroke-linecap': 'strokeLinecap',
  49637. strokelinejoin: 'strokeLinejoin',
  49638. 'stroke-linejoin': 'strokeLinejoin',
  49639. strokemiterlimit: 'strokeMiterlimit',
  49640. 'stroke-miterlimit': 'strokeMiterlimit',
  49641. strokewidth: 'strokeWidth',
  49642. 'stroke-width': 'strokeWidth',
  49643. strokeopacity: 'strokeOpacity',
  49644. 'stroke-opacity': 'strokeOpacity',
  49645. suppresscontenteditablewarning: 'suppressContentEditableWarning',
  49646. suppresshydrationwarning: 'suppressHydrationWarning',
  49647. surfacescale: 'surfaceScale',
  49648. systemlanguage: 'systemLanguage',
  49649. tablevalues: 'tableValues',
  49650. targetx: 'targetX',
  49651. targety: 'targetY',
  49652. textanchor: 'textAnchor',
  49653. 'text-anchor': 'textAnchor',
  49654. textdecoration: 'textDecoration',
  49655. 'text-decoration': 'textDecoration',
  49656. textlength: 'textLength',
  49657. textrendering: 'textRendering',
  49658. 'text-rendering': 'textRendering',
  49659. to: 'to',
  49660. transform: 'transform',
  49661. typeof: 'typeof',
  49662. u1: 'u1',
  49663. u2: 'u2',
  49664. underlineposition: 'underlinePosition',
  49665. 'underline-position': 'underlinePosition',
  49666. underlinethickness: 'underlineThickness',
  49667. 'underline-thickness': 'underlineThickness',
  49668. unicode: 'unicode',
  49669. unicodebidi: 'unicodeBidi',
  49670. 'unicode-bidi': 'unicodeBidi',
  49671. unicoderange: 'unicodeRange',
  49672. 'unicode-range': 'unicodeRange',
  49673. unitsperem: 'unitsPerEm',
  49674. 'units-per-em': 'unitsPerEm',
  49675. unselectable: 'unselectable',
  49676. valphabetic: 'vAlphabetic',
  49677. 'v-alphabetic': 'vAlphabetic',
  49678. values: 'values',
  49679. vectoreffect: 'vectorEffect',
  49680. 'vector-effect': 'vectorEffect',
  49681. version: 'version',
  49682. vertadvy: 'vertAdvY',
  49683. 'vert-adv-y': 'vertAdvY',
  49684. vertoriginx: 'vertOriginX',
  49685. 'vert-origin-x': 'vertOriginX',
  49686. vertoriginy: 'vertOriginY',
  49687. 'vert-origin-y': 'vertOriginY',
  49688. vhanging: 'vHanging',
  49689. 'v-hanging': 'vHanging',
  49690. videographic: 'vIdeographic',
  49691. 'v-ideographic': 'vIdeographic',
  49692. viewbox: 'viewBox',
  49693. viewtarget: 'viewTarget',
  49694. visibility: 'visibility',
  49695. vmathematical: 'vMathematical',
  49696. 'v-mathematical': 'vMathematical',
  49697. vocab: 'vocab',
  49698. widths: 'widths',
  49699. wordspacing: 'wordSpacing',
  49700. 'word-spacing': 'wordSpacing',
  49701. writingmode: 'writingMode',
  49702. 'writing-mode': 'writingMode',
  49703. x1: 'x1',
  49704. x2: 'x2',
  49705. x: 'x',
  49706. xchannelselector: 'xChannelSelector',
  49707. xheight: 'xHeight',
  49708. 'x-height': 'xHeight',
  49709. xlinkactuate: 'xlinkActuate',
  49710. 'xlink:actuate': 'xlinkActuate',
  49711. xlinkarcrole: 'xlinkArcrole',
  49712. 'xlink:arcrole': 'xlinkArcrole',
  49713. xlinkhref: 'xlinkHref',
  49714. 'xlink:href': 'xlinkHref',
  49715. xlinkrole: 'xlinkRole',
  49716. 'xlink:role': 'xlinkRole',
  49717. xlinkshow: 'xlinkShow',
  49718. 'xlink:show': 'xlinkShow',
  49719. xlinktitle: 'xlinkTitle',
  49720. 'xlink:title': 'xlinkTitle',
  49721. xlinktype: 'xlinkType',
  49722. 'xlink:type': 'xlinkType',
  49723. xmlbase: 'xmlBase',
  49724. 'xml:base': 'xmlBase',
  49725. xmllang: 'xmlLang',
  49726. 'xml:lang': 'xmlLang',
  49727. xmlns: 'xmlns',
  49728. 'xml:space': 'xmlSpace',
  49729. xmlnsxlink: 'xmlnsXlink',
  49730. 'xmlns:xlink': 'xmlnsXlink',
  49731. xmlspace: 'xmlSpace',
  49732. y1: 'y1',
  49733. y2: 'y2',
  49734. y: 'y',
  49735. ychannelselector: 'yChannelSelector',
  49736. z: 'z',
  49737. zoomandpan: 'zoomAndPan'
  49738. };
  49739. var ariaProperties = {
  49740. 'aria-current': 0,
  49741. // state
  49742. 'aria-details': 0,
  49743. 'aria-disabled': 0,
  49744. // state
  49745. 'aria-hidden': 0,
  49746. // state
  49747. 'aria-invalid': 0,
  49748. // state
  49749. 'aria-keyshortcuts': 0,
  49750. 'aria-label': 0,
  49751. 'aria-roledescription': 0,
  49752. // Widget Attributes
  49753. 'aria-autocomplete': 0,
  49754. 'aria-checked': 0,
  49755. 'aria-expanded': 0,
  49756. 'aria-haspopup': 0,
  49757. 'aria-level': 0,
  49758. 'aria-modal': 0,
  49759. 'aria-multiline': 0,
  49760. 'aria-multiselectable': 0,
  49761. 'aria-orientation': 0,
  49762. 'aria-placeholder': 0,
  49763. 'aria-pressed': 0,
  49764. 'aria-readonly': 0,
  49765. 'aria-required': 0,
  49766. 'aria-selected': 0,
  49767. 'aria-sort': 0,
  49768. 'aria-valuemax': 0,
  49769. 'aria-valuemin': 0,
  49770. 'aria-valuenow': 0,
  49771. 'aria-valuetext': 0,
  49772. // Live Region Attributes
  49773. 'aria-atomic': 0,
  49774. 'aria-busy': 0,
  49775. 'aria-live': 0,
  49776. 'aria-relevant': 0,
  49777. // Drag-and-Drop Attributes
  49778. 'aria-dropeffect': 0,
  49779. 'aria-grabbed': 0,
  49780. // Relationship Attributes
  49781. 'aria-activedescendant': 0,
  49782. 'aria-colcount': 0,
  49783. 'aria-colindex': 0,
  49784. 'aria-colspan': 0,
  49785. 'aria-controls': 0,
  49786. 'aria-describedby': 0,
  49787. 'aria-errormessage': 0,
  49788. 'aria-flowto': 0,
  49789. 'aria-labelledby': 0,
  49790. 'aria-owns': 0,
  49791. 'aria-posinset': 0,
  49792. 'aria-rowcount': 0,
  49793. 'aria-rowindex': 0,
  49794. 'aria-rowspan': 0,
  49795. 'aria-setsize': 0
  49796. };
  49797. var warnedProperties = {};
  49798. var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  49799. var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
  49800. var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  49801. function validateProperty(tagName, name) {
  49802. if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
  49803. return true;
  49804. }
  49805. if (rARIACamel.test(name)) {
  49806. var ariaName = 'aria-' + name.slice(4).toLowerCase();
  49807. var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
  49808. // DOM properties, then it is an invalid aria-* attribute.
  49809. if (correctName == null) {
  49810. warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
  49811. warnedProperties[name] = true;
  49812. return true;
  49813. } // aria-* attributes should be lowercase; suggest the lowercase version.
  49814. if (name !== correctName) {
  49815. warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
  49816. warnedProperties[name] = true;
  49817. return true;
  49818. }
  49819. }
  49820. if (rARIA.test(name)) {
  49821. var lowerCasedName = name.toLowerCase();
  49822. var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
  49823. // DOM properties, then it is an invalid aria-* attribute.
  49824. if (standardName == null) {
  49825. warnedProperties[name] = true;
  49826. return false;
  49827. } // aria-* attributes should be lowercase; suggest the lowercase version.
  49828. if (name !== standardName) {
  49829. warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
  49830. warnedProperties[name] = true;
  49831. return true;
  49832. }
  49833. }
  49834. return true;
  49835. }
  49836. function warnInvalidARIAProps(type, props) {
  49837. var invalidProps = [];
  49838. for (var key in props) {
  49839. var isValid = validateProperty(type, key);
  49840. if (!isValid) {
  49841. invalidProps.push(key);
  49842. }
  49843. }
  49844. var unknownPropString = invalidProps.map(function (prop) {
  49845. return '`' + prop + '`';
  49846. }).join(', ');
  49847. if (invalidProps.length === 1) {
  49848. warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  49849. } else if (invalidProps.length > 1) {
  49850. warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  49851. }
  49852. }
  49853. function validateProperties(type, props) {
  49854. if (isCustomComponent(type, props)) {
  49855. return;
  49856. }
  49857. warnInvalidARIAProps(type, props);
  49858. }
  49859. var didWarnValueNull = false;
  49860. function validateProperties$1(type, props) {
  49861. if (type !== 'input' && type !== 'textarea' && type !== 'select') {
  49862. return;
  49863. }
  49864. if (props != null && props.value === null && !didWarnValueNull) {
  49865. didWarnValueNull = true;
  49866. if (type === 'select' && props.multiple) {
  49867. warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
  49868. } else {
  49869. warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
  49870. }
  49871. }
  49872. }
  49873. var validateProperty$1 = function () {};
  49874. {
  49875. var warnedProperties$1 = {};
  49876. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  49877. var EVENT_NAME_REGEX = /^on./;
  49878. var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  49879. var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  49880. var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
  49881. validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
  49882. if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
  49883. return true;
  49884. }
  49885. var lowerCasedName = name.toLowerCase();
  49886. if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
  49887. warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
  49888. warnedProperties$1[name] = true;
  49889. return true;
  49890. } // We can't rely on the event system being injected on the server.
  49891. if (canUseEventSystem) {
  49892. if (registrationNameModules.hasOwnProperty(name)) {
  49893. return true;
  49894. }
  49895. var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
  49896. if (registrationName != null) {
  49897. warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
  49898. warnedProperties$1[name] = true;
  49899. return true;
  49900. }
  49901. if (EVENT_NAME_REGEX.test(name)) {
  49902. warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
  49903. warnedProperties$1[name] = true;
  49904. return true;
  49905. }
  49906. } else if (EVENT_NAME_REGEX.test(name)) {
  49907. // If no event plugins have been injected, we are in a server environment.
  49908. // So we can't tell if the event name is correct for sure, but we can filter
  49909. // out known bad ones like `onclick`. We can't suggest a specific replacement though.
  49910. if (INVALID_EVENT_NAME_REGEX.test(name)) {
  49911. warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
  49912. }
  49913. warnedProperties$1[name] = true;
  49914. return true;
  49915. } // Let the ARIA attribute hook validate ARIA attributes
  49916. if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
  49917. return true;
  49918. }
  49919. if (lowerCasedName === 'innerhtml') {
  49920. warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
  49921. warnedProperties$1[name] = true;
  49922. return true;
  49923. }
  49924. if (lowerCasedName === 'aria') {
  49925. warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
  49926. warnedProperties$1[name] = true;
  49927. return true;
  49928. }
  49929. if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
  49930. warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
  49931. warnedProperties$1[name] = true;
  49932. return true;
  49933. }
  49934. if (typeof value === 'number' && isNaN(value)) {
  49935. warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
  49936. warnedProperties$1[name] = true;
  49937. return true;
  49938. }
  49939. var propertyInfo = getPropertyInfo(name);
  49940. var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.
  49941. if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
  49942. var standardName = possibleStandardNames[lowerCasedName];
  49943. if (standardName !== name) {
  49944. warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
  49945. warnedProperties$1[name] = true;
  49946. return true;
  49947. }
  49948. } else if (!isReserved && name !== lowerCasedName) {
  49949. // Unknown attributes should have lowercase casing since that's how they
  49950. // will be cased anyway with server rendering.
  49951. warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
  49952. warnedProperties$1[name] = true;
  49953. return true;
  49954. }
  49955. if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
  49956. if (value) {
  49957. warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
  49958. } else {
  49959. warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
  49960. }
  49961. warnedProperties$1[name] = true;
  49962. return true;
  49963. } // Now that we've validated casing, do not validate
  49964. // data types for reserved props
  49965. if (isReserved) {
  49966. return true;
  49967. } // Warn when a known attribute is a bad type
  49968. if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
  49969. warnedProperties$1[name] = true;
  49970. return false;
  49971. } // Warn when passing the strings 'false' or 'true' into a boolean prop
  49972. if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
  49973. warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
  49974. warnedProperties$1[name] = true;
  49975. return true;
  49976. }
  49977. return true;
  49978. };
  49979. }
  49980. var warnUnknownProperties = function (type, props, canUseEventSystem) {
  49981. var unknownProps = [];
  49982. for (var key in props) {
  49983. var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
  49984. if (!isValid) {
  49985. unknownProps.push(key);
  49986. }
  49987. }
  49988. var unknownPropString = unknownProps.map(function (prop) {
  49989. return '`' + prop + '`';
  49990. }).join(', ');
  49991. if (unknownProps.length === 1) {
  49992. warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  49993. } else if (unknownProps.length > 1) {
  49994. warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  49995. }
  49996. };
  49997. function validateProperties$2(type, props, canUseEventSystem) {
  49998. if (isCustomComponent(type, props)) {
  49999. return;
  50000. }
  50001. warnUnknownProperties(type, props, canUseEventSystem);
  50002. }
  50003. // TODO: direct imports like some-package/src/* are bad. Fix me.
  50004. var didWarnInvalidHydration = false;
  50005. var didWarnShadyDOM = false;
  50006. var didWarnScriptTags = false;
  50007. var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
  50008. var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
  50009. var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
  50010. var AUTOFOCUS = 'autoFocus';
  50011. var CHILDREN = 'children';
  50012. var STYLE$1 = 'style';
  50013. var HTML = '__html';
  50014. var LISTENERS = 'listeners';
  50015. var HTML_NAMESPACE = Namespaces.html;
  50016. var warnedUnknownTags;
  50017. var suppressHydrationWarning;
  50018. var validatePropertiesInDevelopment;
  50019. var warnForTextDifference;
  50020. var warnForPropDifference;
  50021. var warnForExtraAttributes;
  50022. var warnForInvalidEventListener;
  50023. var canDiffStyleForHydrationWarning;
  50024. var normalizeMarkupForTextOrAttribute;
  50025. var normalizeHTML;
  50026. {
  50027. warnedUnknownTags = {
  50028. // Chrome is the only major browser not shipping <time>. But as of July
  50029. // 2017 it intends to ship it due to widespread usage. We intentionally
  50030. // *don't* warn for <time> even if it's unrecognized by Chrome because
  50031. // it soon will be, and many apps have been using it anyway.
  50032. time: true,
  50033. // There are working polyfills for <dialog>. Let people use it.
  50034. dialog: true,
  50035. // Electron ships a custom <webview> tag to display external web content in
  50036. // an isolated frame and process.
  50037. // This tag is not present in non Electron environments such as JSDom which
  50038. // is often used for testing purposes.
  50039. // @see https://electronjs.org/docs/api/webview-tag
  50040. webview: true
  50041. };
  50042. validatePropertiesInDevelopment = function (type, props) {
  50043. validateProperties(type, props);
  50044. validateProperties$1(type, props);
  50045. validateProperties$2(type, props,
  50046. /* canUseEventSystem */
  50047. true);
  50048. }; // IE 11 parses & normalizes the style attribute as opposed to other
  50049. // browsers. It adds spaces and sorts the properties in some
  50050. // non-alphabetical order. Handling that would require sorting CSS
  50051. // properties in the client & server versions or applying
  50052. // `expectedStyle` to a temporary DOM node to read its `style` attribute
  50053. // normalized. Since it only affects IE, we're skipping style warnings
  50054. // in that browser completely in favor of doing all that work.
  50055. // See https://github.com/facebook/react/issues/11807
  50056. canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.
  50057. // It also can turn \u0000 into \uFFFD inside attributes.
  50058. // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
  50059. // If we have a mismatch, it might be caused by that.
  50060. // We will still patch up in this case but not fire the warning.
  50061. var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
  50062. var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
  50063. normalizeMarkupForTextOrAttribute = function (markup) {
  50064. var markupString = typeof markup === 'string' ? markup : '' + markup;
  50065. return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
  50066. };
  50067. warnForTextDifference = function (serverText, clientText) {
  50068. if (didWarnInvalidHydration) {
  50069. return;
  50070. }
  50071. var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
  50072. var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
  50073. if (normalizedServerText === normalizedClientText) {
  50074. return;
  50075. }
  50076. didWarnInvalidHydration = true;
  50077. warningWithoutStack$1(false, 'Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
  50078. };
  50079. warnForPropDifference = function (propName, serverValue, clientValue) {
  50080. if (didWarnInvalidHydration) {
  50081. return;
  50082. }
  50083. var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
  50084. var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
  50085. if (normalizedServerValue === normalizedClientValue) {
  50086. return;
  50087. }
  50088. didWarnInvalidHydration = true;
  50089. warningWithoutStack$1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
  50090. };
  50091. warnForExtraAttributes = function (attributeNames) {
  50092. if (didWarnInvalidHydration) {
  50093. return;
  50094. }
  50095. didWarnInvalidHydration = true;
  50096. var names = [];
  50097. attributeNames.forEach(function (name) {
  50098. names.push(name);
  50099. });
  50100. warningWithoutStack$1(false, 'Extra attributes from the server: %s', names);
  50101. };
  50102. warnForInvalidEventListener = function (registrationName, listener) {
  50103. if (listener === false) {
  50104. warning$1(false, 'Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
  50105. } else {
  50106. warning$1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
  50107. }
  50108. }; // Parse the HTML and read it back to normalize the HTML string so that it
  50109. // can be used for comparison.
  50110. normalizeHTML = function (parent, html) {
  50111. // We could have created a separate document here to avoid
  50112. // re-initializing custom elements if they exist. But this breaks
  50113. // how <noscript> is being handled. So we use the same document.
  50114. // See the discussion in https://github.com/facebook/react/pull/11157.
  50115. var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
  50116. testElement.innerHTML = html;
  50117. return testElement.innerHTML;
  50118. };
  50119. }
  50120. function ensureListeningTo(rootContainerElement, registrationName) {
  50121. var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
  50122. var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
  50123. listenTo(registrationName, doc);
  50124. }
  50125. function getOwnerDocumentFromRootContainer(rootContainerElement) {
  50126. return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
  50127. }
  50128. function noop() {}
  50129. function trapClickOnNonInteractiveElement(node) {
  50130. // Mobile Safari does not fire properly bubble click events on
  50131. // non-interactive elements, which means delegated click listeners do not
  50132. // fire. The workaround for this bug involves attaching an empty click
  50133. // listener on the target node.
  50134. // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  50135. // Just set it using the onclick property so that we don't have to manage any
  50136. // bookkeeping for it. Not sure if we need to clear it when the listener is
  50137. // removed.
  50138. // TODO: Only do this for the relevant Safaris maybe?
  50139. node.onclick = noop;
  50140. }
  50141. function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
  50142. for (var propKey in nextProps) {
  50143. if (!nextProps.hasOwnProperty(propKey)) {
  50144. continue;
  50145. }
  50146. var nextProp = nextProps[propKey];
  50147. if (propKey === STYLE$1) {
  50148. {
  50149. if (nextProp) {
  50150. // Freeze the next style object so that we can assume it won't be
  50151. // mutated. We have already warned for this in the past.
  50152. Object.freeze(nextProp);
  50153. }
  50154. } // Relies on `updateStylesByID` not mutating `styleUpdates`.
  50155. setValueForStyles(domElement, nextProp);
  50156. } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  50157. var nextHtml = nextProp ? nextProp[HTML] : undefined;
  50158. if (nextHtml != null) {
  50159. setInnerHTML(domElement, nextHtml);
  50160. }
  50161. } else if (propKey === CHILDREN) {
  50162. if (typeof nextProp === 'string') {
  50163. // Avoid setting initial textContent when the text is empty. In IE11 setting
  50164. // textContent on a <textarea> will cause the placeholder to not
  50165. // show within the <textarea> until it has been focused and blurred again.
  50166. // https://github.com/facebook/react/issues/6731#issuecomment-254874553
  50167. var canSetTextContent = tag !== 'textarea' || nextProp !== '';
  50168. if (canSetTextContent) {
  50169. setTextContent(domElement, nextProp);
  50170. }
  50171. } else if (typeof nextProp === 'number') {
  50172. setTextContent(domElement, '' + nextProp);
  50173. }
  50174. } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
  50175. } else if (propKey === AUTOFOCUS) {// We polyfill it separately on the client during commit.
  50176. // We could have excluded it in the property list instead of
  50177. // adding a special case here, but then it wouldn't be emitted
  50178. // on server rendering (but we *do* want to emit it in SSR).
  50179. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  50180. if (nextProp != null) {
  50181. if ( true && typeof nextProp !== 'function') {
  50182. warnForInvalidEventListener(propKey, nextProp);
  50183. }
  50184. ensureListeningTo(rootContainerElement, propKey);
  50185. }
  50186. } else if (nextProp != null) {
  50187. setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
  50188. }
  50189. }
  50190. }
  50191. function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
  50192. // TODO: Handle wasCustomComponentTag
  50193. for (var i = 0; i < updatePayload.length; i += 2) {
  50194. var propKey = updatePayload[i];
  50195. var propValue = updatePayload[i + 1];
  50196. if (propKey === STYLE$1) {
  50197. setValueForStyles(domElement, propValue);
  50198. } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  50199. setInnerHTML(domElement, propValue);
  50200. } else if (propKey === CHILDREN) {
  50201. setTextContent(domElement, propValue);
  50202. } else {
  50203. setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
  50204. }
  50205. }
  50206. }
  50207. function createElement(type, props, rootContainerElement, parentNamespace) {
  50208. var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML
  50209. // tags get no namespace.
  50210. var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
  50211. var domElement;
  50212. var namespaceURI = parentNamespace;
  50213. if (namespaceURI === HTML_NAMESPACE) {
  50214. namespaceURI = getIntrinsicNamespace(type);
  50215. }
  50216. if (namespaceURI === HTML_NAMESPACE) {
  50217. {
  50218. isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to
  50219. // allow <SVG> or <mATH>.
  50220. !(isCustomComponentTag || type === type.toLowerCase()) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;
  50221. }
  50222. if (type === 'script') {
  50223. // Create the script via .innerHTML so its "parser-inserted" flag is
  50224. // set to true and it does not execute
  50225. var div = ownerDocument.createElement('div');
  50226. {
  50227. if (enableTrustedTypesIntegration && !didWarnScriptTags) {
  50228. warning$1(false, 'Encountered a script tag while rendering React component. ' + 'Scripts inside React components are never executed when rendering ' + 'on the client. Consider using template tag instead ' + '(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template).');
  50229. didWarnScriptTags = true;
  50230. }
  50231. }
  50232. div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
  50233. // This is guaranteed to yield a script element.
  50234. var firstChild = div.firstChild;
  50235. domElement = div.removeChild(firstChild);
  50236. } else if (typeof props.is === 'string') {
  50237. // $FlowIssue `createElement` should be updated for Web Components
  50238. domElement = ownerDocument.createElement(type, {
  50239. is: props.is
  50240. });
  50241. } else {
  50242. // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
  50243. // See discussion in https://github.com/facebook/react/pull/6896
  50244. // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
  50245. domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
  50246. // attributes on `select`s needs to be added before `option`s are inserted.
  50247. // This prevents:
  50248. // - a bug where the `select` does not scroll to the correct option because singular
  50249. // `select` elements automatically pick the first item #13222
  50250. // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
  50251. // See https://github.com/facebook/react/issues/13222
  50252. // and https://github.com/facebook/react/issues/14239
  50253. if (type === 'select') {
  50254. var node = domElement;
  50255. if (props.multiple) {
  50256. node.multiple = true;
  50257. } else if (props.size) {
  50258. // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
  50259. // it is possible that no option is selected.
  50260. //
  50261. // This is only necessary when a select in "single selection mode".
  50262. node.size = props.size;
  50263. }
  50264. }
  50265. }
  50266. } else {
  50267. domElement = ownerDocument.createElementNS(namespaceURI, type);
  50268. }
  50269. {
  50270. if (namespaceURI === HTML_NAMESPACE) {
  50271. if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
  50272. warnedUnknownTags[type] = true;
  50273. warning$1(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
  50274. }
  50275. }
  50276. }
  50277. return domElement;
  50278. }
  50279. function createTextNode(text, rootContainerElement) {
  50280. return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
  50281. }
  50282. function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
  50283. var isCustomComponentTag = isCustomComponent(tag, rawProps);
  50284. {
  50285. validatePropertiesInDevelopment(tag, rawProps);
  50286. if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
  50287. warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
  50288. didWarnShadyDOM = true;
  50289. }
  50290. } // TODO: Make sure that we check isMounted before firing any of these events.
  50291. var props;
  50292. switch (tag) {
  50293. case 'iframe':
  50294. case 'object':
  50295. case 'embed':
  50296. trapBubbledEvent(TOP_LOAD, domElement);
  50297. props = rawProps;
  50298. break;
  50299. case 'video':
  50300. case 'audio':
  50301. // Create listener for each media event
  50302. for (var i = 0; i < mediaEventTypes.length; i++) {
  50303. trapBubbledEvent(mediaEventTypes[i], domElement);
  50304. }
  50305. props = rawProps;
  50306. break;
  50307. case 'source':
  50308. trapBubbledEvent(TOP_ERROR, domElement);
  50309. props = rawProps;
  50310. break;
  50311. case 'img':
  50312. case 'image':
  50313. case 'link':
  50314. trapBubbledEvent(TOP_ERROR, domElement);
  50315. trapBubbledEvent(TOP_LOAD, domElement);
  50316. props = rawProps;
  50317. break;
  50318. case 'form':
  50319. trapBubbledEvent(TOP_RESET, domElement);
  50320. trapBubbledEvent(TOP_SUBMIT, domElement);
  50321. props = rawProps;
  50322. break;
  50323. case 'details':
  50324. trapBubbledEvent(TOP_TOGGLE, domElement);
  50325. props = rawProps;
  50326. break;
  50327. case 'input':
  50328. initWrapperState(domElement, rawProps);
  50329. props = getHostProps(domElement, rawProps);
  50330. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  50331. // to onChange. Even if there is no listener.
  50332. ensureListeningTo(rootContainerElement, 'onChange');
  50333. break;
  50334. case 'option':
  50335. validateProps(domElement, rawProps);
  50336. props = getHostProps$1(domElement, rawProps);
  50337. break;
  50338. case 'select':
  50339. initWrapperState$1(domElement, rawProps);
  50340. props = getHostProps$2(domElement, rawProps);
  50341. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  50342. // to onChange. Even if there is no listener.
  50343. ensureListeningTo(rootContainerElement, 'onChange');
  50344. break;
  50345. case 'textarea':
  50346. initWrapperState$2(domElement, rawProps);
  50347. props = getHostProps$3(domElement, rawProps);
  50348. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  50349. // to onChange. Even if there is no listener.
  50350. ensureListeningTo(rootContainerElement, 'onChange');
  50351. break;
  50352. default:
  50353. props = rawProps;
  50354. }
  50355. assertValidProps(tag, props);
  50356. setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
  50357. switch (tag) {
  50358. case 'input':
  50359. // TODO: Make sure we check if this is still unmounted or do any clean
  50360. // up necessary since we never stop tracking anymore.
  50361. track(domElement);
  50362. postMountWrapper(domElement, rawProps, false);
  50363. break;
  50364. case 'textarea':
  50365. // TODO: Make sure we check if this is still unmounted or do any clean
  50366. // up necessary since we never stop tracking anymore.
  50367. track(domElement);
  50368. postMountWrapper$3(domElement, rawProps);
  50369. break;
  50370. case 'option':
  50371. postMountWrapper$1(domElement, rawProps);
  50372. break;
  50373. case 'select':
  50374. postMountWrapper$2(domElement, rawProps);
  50375. break;
  50376. default:
  50377. if (typeof props.onClick === 'function') {
  50378. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  50379. trapClickOnNonInteractiveElement(domElement);
  50380. }
  50381. break;
  50382. }
  50383. } // Calculate the diff between the two objects.
  50384. function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
  50385. {
  50386. validatePropertiesInDevelopment(tag, nextRawProps);
  50387. }
  50388. var updatePayload = null;
  50389. var lastProps;
  50390. var nextProps;
  50391. switch (tag) {
  50392. case 'input':
  50393. lastProps = getHostProps(domElement, lastRawProps);
  50394. nextProps = getHostProps(domElement, nextRawProps);
  50395. updatePayload = [];
  50396. break;
  50397. case 'option':
  50398. lastProps = getHostProps$1(domElement, lastRawProps);
  50399. nextProps = getHostProps$1(domElement, nextRawProps);
  50400. updatePayload = [];
  50401. break;
  50402. case 'select':
  50403. lastProps = getHostProps$2(domElement, lastRawProps);
  50404. nextProps = getHostProps$2(domElement, nextRawProps);
  50405. updatePayload = [];
  50406. break;
  50407. case 'textarea':
  50408. lastProps = getHostProps$3(domElement, lastRawProps);
  50409. nextProps = getHostProps$3(domElement, nextRawProps);
  50410. updatePayload = [];
  50411. break;
  50412. default:
  50413. lastProps = lastRawProps;
  50414. nextProps = nextRawProps;
  50415. if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
  50416. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  50417. trapClickOnNonInteractiveElement(domElement);
  50418. }
  50419. break;
  50420. }
  50421. assertValidProps(tag, nextProps);
  50422. var propKey;
  50423. var styleName;
  50424. var styleUpdates = null;
  50425. for (propKey in lastProps) {
  50426. if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
  50427. continue;
  50428. }
  50429. if (propKey === STYLE$1) {
  50430. var lastStyle = lastProps[propKey];
  50431. for (styleName in lastStyle) {
  50432. if (lastStyle.hasOwnProperty(styleName)) {
  50433. if (!styleUpdates) {
  50434. styleUpdates = {};
  50435. }
  50436. styleUpdates[styleName] = '';
  50437. }
  50438. }
  50439. } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {// Noop. This is handled by the clear text mechanism.
  50440. } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
  50441. } else if (propKey === AUTOFOCUS) {// Noop. It doesn't work on updates anyway.
  50442. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  50443. // This is a special case. If any listener updates we need to ensure
  50444. // that the "current" fiber pointer gets updated so we need a commit
  50445. // to update this element.
  50446. if (!updatePayload) {
  50447. updatePayload = [];
  50448. }
  50449. } else {
  50450. // For all other deleted properties we add it to the queue. We use
  50451. // the whitelist in the commit phase instead.
  50452. (updatePayload = updatePayload || []).push(propKey, null);
  50453. }
  50454. }
  50455. for (propKey in nextProps) {
  50456. var nextProp = nextProps[propKey];
  50457. var lastProp = lastProps != null ? lastProps[propKey] : undefined;
  50458. if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
  50459. continue;
  50460. }
  50461. if (propKey === STYLE$1) {
  50462. {
  50463. if (nextProp) {
  50464. // Freeze the next style object so that we can assume it won't be
  50465. // mutated. We have already warned for this in the past.
  50466. Object.freeze(nextProp);
  50467. }
  50468. }
  50469. if (lastProp) {
  50470. // Unset styles on `lastProp` but not on `nextProp`.
  50471. for (styleName in lastProp) {
  50472. if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
  50473. if (!styleUpdates) {
  50474. styleUpdates = {};
  50475. }
  50476. styleUpdates[styleName] = '';
  50477. }
  50478. } // Update styles that changed since `lastProp`.
  50479. for (styleName in nextProp) {
  50480. if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
  50481. if (!styleUpdates) {
  50482. styleUpdates = {};
  50483. }
  50484. styleUpdates[styleName] = nextProp[styleName];
  50485. }
  50486. }
  50487. } else {
  50488. // Relies on `updateStylesByID` not mutating `styleUpdates`.
  50489. if (!styleUpdates) {
  50490. if (!updatePayload) {
  50491. updatePayload = [];
  50492. }
  50493. updatePayload.push(propKey, styleUpdates);
  50494. }
  50495. styleUpdates = nextProp;
  50496. }
  50497. } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  50498. var nextHtml = nextProp ? nextProp[HTML] : undefined;
  50499. var lastHtml = lastProp ? lastProp[HTML] : undefined;
  50500. if (nextHtml != null) {
  50501. if (lastHtml !== nextHtml) {
  50502. (updatePayload = updatePayload || []).push(propKey, toStringOrTrustedType(nextHtml));
  50503. }
  50504. } else {// TODO: It might be too late to clear this if we have children
  50505. // inserted already.
  50506. }
  50507. } else if (propKey === CHILDREN) {
  50508. if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
  50509. (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
  50510. }
  50511. } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
  50512. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  50513. if (nextProp != null) {
  50514. // We eagerly listen to this even though we haven't committed yet.
  50515. if ( true && typeof nextProp !== 'function') {
  50516. warnForInvalidEventListener(propKey, nextProp);
  50517. }
  50518. ensureListeningTo(rootContainerElement, propKey);
  50519. }
  50520. if (!updatePayload && lastProp !== nextProp) {
  50521. // This is a special case. If any listener updates we need to ensure
  50522. // that the "current" props pointer gets updated so we need a commit
  50523. // to update this element.
  50524. updatePayload = [];
  50525. }
  50526. } else {
  50527. // For any other property we always add it to the queue and then we
  50528. // filter it out using the whitelist during the commit.
  50529. (updatePayload = updatePayload || []).push(propKey, nextProp);
  50530. }
  50531. }
  50532. if (styleUpdates) {
  50533. {
  50534. validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]);
  50535. }
  50536. (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates);
  50537. }
  50538. return updatePayload;
  50539. } // Apply the diff.
  50540. function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
  50541. // Update checked *before* name.
  50542. // In the middle of an update, it is possible to have multiple checked.
  50543. // When a checked radio tries to change name, browser makes another radio's checked false.
  50544. if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
  50545. updateChecked(domElement, nextRawProps);
  50546. }
  50547. var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
  50548. var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.
  50549. updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props
  50550. // changed.
  50551. switch (tag) {
  50552. case 'input':
  50553. // Update the wrapper around inputs *after* updating props. This has to
  50554. // happen after `updateDOMProperties`. Otherwise HTML5 input validations
  50555. // raise warnings and prevent the new value from being assigned.
  50556. updateWrapper(domElement, nextRawProps);
  50557. break;
  50558. case 'textarea':
  50559. updateWrapper$1(domElement, nextRawProps);
  50560. break;
  50561. case 'select':
  50562. // <select> value update needs to occur after <option> children
  50563. // reconciliation
  50564. postUpdateWrapper(domElement, nextRawProps);
  50565. break;
  50566. }
  50567. }
  50568. function getPossibleStandardName(propName) {
  50569. {
  50570. var lowerCasedName = propName.toLowerCase();
  50571. if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
  50572. return null;
  50573. }
  50574. return possibleStandardNames[lowerCasedName] || null;
  50575. }
  50576. return null;
  50577. }
  50578. function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
  50579. var isCustomComponentTag;
  50580. var extraAttributeNames;
  50581. {
  50582. suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;
  50583. isCustomComponentTag = isCustomComponent(tag, rawProps);
  50584. validatePropertiesInDevelopment(tag, rawProps);
  50585. if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
  50586. warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
  50587. didWarnShadyDOM = true;
  50588. }
  50589. } // TODO: Make sure that we check isMounted before firing any of these events.
  50590. switch (tag) {
  50591. case 'iframe':
  50592. case 'object':
  50593. case 'embed':
  50594. trapBubbledEvent(TOP_LOAD, domElement);
  50595. break;
  50596. case 'video':
  50597. case 'audio':
  50598. // Create listener for each media event
  50599. for (var i = 0; i < mediaEventTypes.length; i++) {
  50600. trapBubbledEvent(mediaEventTypes[i], domElement);
  50601. }
  50602. break;
  50603. case 'source':
  50604. trapBubbledEvent(TOP_ERROR, domElement);
  50605. break;
  50606. case 'img':
  50607. case 'image':
  50608. case 'link':
  50609. trapBubbledEvent(TOP_ERROR, domElement);
  50610. trapBubbledEvent(TOP_LOAD, domElement);
  50611. break;
  50612. case 'form':
  50613. trapBubbledEvent(TOP_RESET, domElement);
  50614. trapBubbledEvent(TOP_SUBMIT, domElement);
  50615. break;
  50616. case 'details':
  50617. trapBubbledEvent(TOP_TOGGLE, domElement);
  50618. break;
  50619. case 'input':
  50620. initWrapperState(domElement, rawProps);
  50621. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  50622. // to onChange. Even if there is no listener.
  50623. ensureListeningTo(rootContainerElement, 'onChange');
  50624. break;
  50625. case 'option':
  50626. validateProps(domElement, rawProps);
  50627. break;
  50628. case 'select':
  50629. initWrapperState$1(domElement, rawProps);
  50630. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  50631. // to onChange. Even if there is no listener.
  50632. ensureListeningTo(rootContainerElement, 'onChange');
  50633. break;
  50634. case 'textarea':
  50635. initWrapperState$2(domElement, rawProps);
  50636. trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
  50637. // to onChange. Even if there is no listener.
  50638. ensureListeningTo(rootContainerElement, 'onChange');
  50639. break;
  50640. }
  50641. assertValidProps(tag, rawProps);
  50642. {
  50643. extraAttributeNames = new Set();
  50644. var attributes = domElement.attributes;
  50645. for (var _i = 0; _i < attributes.length; _i++) {
  50646. var name = attributes[_i].name.toLowerCase();
  50647. switch (name) {
  50648. // Built-in SSR attribute is whitelisted
  50649. case 'data-reactroot':
  50650. break;
  50651. // Controlled attributes are not validated
  50652. // TODO: Only ignore them on controlled tags.
  50653. case 'value':
  50654. break;
  50655. case 'checked':
  50656. break;
  50657. case 'selected':
  50658. break;
  50659. default:
  50660. // Intentionally use the original name.
  50661. // See discussion in https://github.com/facebook/react/pull/10676.
  50662. extraAttributeNames.add(attributes[_i].name);
  50663. }
  50664. }
  50665. }
  50666. var updatePayload = null;
  50667. for (var propKey in rawProps) {
  50668. if (!rawProps.hasOwnProperty(propKey)) {
  50669. continue;
  50670. }
  50671. var nextProp = rawProps[propKey];
  50672. if (propKey === CHILDREN) {
  50673. // For text content children we compare against textContent. This
  50674. // might match additional HTML that is hidden when we read it using
  50675. // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
  50676. // satisfies our requirement. Our requirement is not to produce perfect
  50677. // HTML and attributes. Ideally we should preserve structure but it's
  50678. // ok not to if the visible content is still enough to indicate what
  50679. // even listeners these nodes might be wired up to.
  50680. // TODO: Warn if there is more than a single textNode as a child.
  50681. // TODO: Should we use domElement.firstChild.nodeValue to compare?
  50682. if (typeof nextProp === 'string') {
  50683. if (domElement.textContent !== nextProp) {
  50684. if ( true && !suppressHydrationWarning) {
  50685. warnForTextDifference(domElement.textContent, nextProp);
  50686. }
  50687. updatePayload = [CHILDREN, nextProp];
  50688. }
  50689. } else if (typeof nextProp === 'number') {
  50690. if (domElement.textContent !== '' + nextProp) {
  50691. if ( true && !suppressHydrationWarning) {
  50692. warnForTextDifference(domElement.textContent, nextProp);
  50693. }
  50694. updatePayload = [CHILDREN, '' + nextProp];
  50695. }
  50696. }
  50697. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  50698. if (nextProp != null) {
  50699. if ( true && typeof nextProp !== 'function') {
  50700. warnForInvalidEventListener(propKey, nextProp);
  50701. }
  50702. ensureListeningTo(rootContainerElement, propKey);
  50703. }
  50704. } else if ( true && // Convince Flow we've calculated it (it's DEV-only in this method.)
  50705. typeof isCustomComponentTag === 'boolean') {
  50706. // Validate that the properties correspond to their expected values.
  50707. var serverValue = void 0;
  50708. var propertyInfo = getPropertyInfo(propKey);
  50709. if (suppressHydrationWarning) {// Don't bother comparing. We're ignoring all these warnings.
  50710. } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 || // Controlled attributes are not validated
  50711. // TODO: Only ignore them on controlled tags.
  50712. propKey === 'value' || propKey === 'checked' || propKey === 'selected') {// Noop
  50713. } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
  50714. var serverHTML = domElement.innerHTML;
  50715. var nextHtml = nextProp ? nextProp[HTML] : undefined;
  50716. var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
  50717. if (expectedHTML !== serverHTML) {
  50718. warnForPropDifference(propKey, serverHTML, expectedHTML);
  50719. }
  50720. } else if (propKey === STYLE$1) {
  50721. // $FlowFixMe - Should be inferred as not undefined.
  50722. extraAttributeNames.delete(propKey);
  50723. if (canDiffStyleForHydrationWarning) {
  50724. var expectedStyle = createDangerousStringForStyles(nextProp);
  50725. serverValue = domElement.getAttribute('style');
  50726. if (expectedStyle !== serverValue) {
  50727. warnForPropDifference(propKey, serverValue, expectedStyle);
  50728. }
  50729. }
  50730. } else if (isCustomComponentTag) {
  50731. // $FlowFixMe - Should be inferred as not undefined.
  50732. extraAttributeNames.delete(propKey.toLowerCase());
  50733. serverValue = getValueForAttribute(domElement, propKey, nextProp);
  50734. if (nextProp !== serverValue) {
  50735. warnForPropDifference(propKey, serverValue, nextProp);
  50736. }
  50737. } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
  50738. var isMismatchDueToBadCasing = false;
  50739. if (propertyInfo !== null) {
  50740. // $FlowFixMe - Should be inferred as not undefined.
  50741. extraAttributeNames.delete(propertyInfo.attributeName);
  50742. serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
  50743. } else {
  50744. var ownNamespace = parentNamespace;
  50745. if (ownNamespace === HTML_NAMESPACE) {
  50746. ownNamespace = getIntrinsicNamespace(tag);
  50747. }
  50748. if (ownNamespace === HTML_NAMESPACE) {
  50749. // $FlowFixMe - Should be inferred as not undefined.
  50750. extraAttributeNames.delete(propKey.toLowerCase());
  50751. } else {
  50752. var standardName = getPossibleStandardName(propKey);
  50753. if (standardName !== null && standardName !== propKey) {
  50754. // If an SVG prop is supplied with bad casing, it will
  50755. // be successfully parsed from HTML, but will produce a mismatch
  50756. // (and would be incorrectly rendered on the client).
  50757. // However, we already warn about bad casing elsewhere.
  50758. // So we'll skip the misleading extra mismatch warning in this case.
  50759. isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.
  50760. extraAttributeNames.delete(standardName);
  50761. } // $FlowFixMe - Should be inferred as not undefined.
  50762. extraAttributeNames.delete(propKey);
  50763. }
  50764. serverValue = getValueForAttribute(domElement, propKey, nextProp);
  50765. }
  50766. if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
  50767. warnForPropDifference(propKey, serverValue, nextProp);
  50768. }
  50769. }
  50770. }
  50771. }
  50772. {
  50773. // $FlowFixMe - Should be inferred as not undefined.
  50774. if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
  50775. // $FlowFixMe - Should be inferred as not undefined.
  50776. warnForExtraAttributes(extraAttributeNames);
  50777. }
  50778. }
  50779. switch (tag) {
  50780. case 'input':
  50781. // TODO: Make sure we check if this is still unmounted or do any clean
  50782. // up necessary since we never stop tracking anymore.
  50783. track(domElement);
  50784. postMountWrapper(domElement, rawProps, true);
  50785. break;
  50786. case 'textarea':
  50787. // TODO: Make sure we check if this is still unmounted or do any clean
  50788. // up necessary since we never stop tracking anymore.
  50789. track(domElement);
  50790. postMountWrapper$3(domElement, rawProps);
  50791. break;
  50792. case 'select':
  50793. case 'option':
  50794. // For input and textarea we current always set the value property at
  50795. // post mount to force it to diverge from attributes. However, for
  50796. // option and select we don't quite do the same thing and select
  50797. // is not resilient to the DOM state changing so we don't do that here.
  50798. // TODO: Consider not doing this for input and textarea.
  50799. break;
  50800. default:
  50801. if (typeof rawProps.onClick === 'function') {
  50802. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  50803. trapClickOnNonInteractiveElement(domElement);
  50804. }
  50805. break;
  50806. }
  50807. return updatePayload;
  50808. }
  50809. function diffHydratedText(textNode, text) {
  50810. var isDifferent = textNode.nodeValue !== text;
  50811. return isDifferent;
  50812. }
  50813. function warnForUnmatchedText(textNode, text) {
  50814. {
  50815. warnForTextDifference(textNode.nodeValue, text);
  50816. }
  50817. }
  50818. function warnForDeletedHydratableElement(parentNode, child) {
  50819. {
  50820. if (didWarnInvalidHydration) {
  50821. return;
  50822. }
  50823. didWarnInvalidHydration = true;
  50824. warningWithoutStack$1(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
  50825. }
  50826. }
  50827. function warnForDeletedHydratableText(parentNode, child) {
  50828. {
  50829. if (didWarnInvalidHydration) {
  50830. return;
  50831. }
  50832. didWarnInvalidHydration = true;
  50833. warningWithoutStack$1(false, 'Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
  50834. }
  50835. }
  50836. function warnForInsertedHydratedElement(parentNode, tag, props) {
  50837. {
  50838. if (didWarnInvalidHydration) {
  50839. return;
  50840. }
  50841. didWarnInvalidHydration = true;
  50842. warningWithoutStack$1(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
  50843. }
  50844. }
  50845. function warnForInsertedHydratedText(parentNode, text) {
  50846. {
  50847. if (text === '') {
  50848. // We expect to insert empty text nodes since they're not represented in
  50849. // the HTML.
  50850. // TODO: Remove this special case if we can just avoid inserting empty
  50851. // text nodes.
  50852. return;
  50853. }
  50854. if (didWarnInvalidHydration) {
  50855. return;
  50856. }
  50857. didWarnInvalidHydration = true;
  50858. warningWithoutStack$1(false, 'Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
  50859. }
  50860. }
  50861. function restoreControlledState$$1(domElement, tag, props) {
  50862. switch (tag) {
  50863. case 'input':
  50864. restoreControlledState$1(domElement, props);
  50865. return;
  50866. case 'textarea':
  50867. restoreControlledState$3(domElement, props);
  50868. return;
  50869. case 'select':
  50870. restoreControlledState$2(domElement, props);
  50871. return;
  50872. }
  50873. }
  50874. function listenToEventResponderEventTypes(eventTypes, element) {
  50875. if (enableFlareAPI) {
  50876. // Get the listening Set for this element. We use this to track
  50877. // what events we're listening to.
  50878. var listeningSet = getListeningSetForElement(element); // Go through each target event type of the event responder
  50879. for (var i = 0, length = eventTypes.length; i < length; ++i) {
  50880. var eventType = eventTypes[i];
  50881. var isPassive = !endsWith(eventType, '_active');
  50882. var eventKey = isPassive ? eventType + '_passive' : eventType;
  50883. var targetEventType = isPassive ? eventType : eventType.substring(0, eventType.length - 7);
  50884. if (!listeningSet.has(eventKey)) {
  50885. trapEventForResponderEventSystem(element, targetEventType, isPassive);
  50886. listeningSet.add(eventKey);
  50887. }
  50888. }
  50889. }
  50890. } // We can remove this once the event API is stable and out of a flag
  50891. if (enableFlareAPI) {
  50892. setListenToResponderEventTypes(listenToEventResponderEventTypes);
  50893. }
  50894. function getActiveElement(doc) {
  50895. doc = doc || (typeof document !== 'undefined' ? document : undefined);
  50896. if (typeof doc === 'undefined') {
  50897. return null;
  50898. }
  50899. try {
  50900. return doc.activeElement || doc.body;
  50901. } catch (e) {
  50902. return doc.body;
  50903. }
  50904. }
  50905. /**
  50906. * Given any node return the first leaf node without children.
  50907. *
  50908. * @param {DOMElement|DOMTextNode} node
  50909. * @return {DOMElement|DOMTextNode}
  50910. */
  50911. function getLeafNode(node) {
  50912. while (node && node.firstChild) {
  50913. node = node.firstChild;
  50914. }
  50915. return node;
  50916. }
  50917. /**
  50918. * Get the next sibling within a container. This will walk up the
  50919. * DOM if a node's siblings have been exhausted.
  50920. *
  50921. * @param {DOMElement|DOMTextNode} node
  50922. * @return {?DOMElement|DOMTextNode}
  50923. */
  50924. function getSiblingNode(node) {
  50925. while (node) {
  50926. if (node.nextSibling) {
  50927. return node.nextSibling;
  50928. }
  50929. node = node.parentNode;
  50930. }
  50931. }
  50932. /**
  50933. * Get object describing the nodes which contain characters at offset.
  50934. *
  50935. * @param {DOMElement|DOMTextNode} root
  50936. * @param {number} offset
  50937. * @return {?object}
  50938. */
  50939. function getNodeForCharacterOffset(root, offset) {
  50940. var node = getLeafNode(root);
  50941. var nodeStart = 0;
  50942. var nodeEnd = 0;
  50943. while (node) {
  50944. if (node.nodeType === TEXT_NODE) {
  50945. nodeEnd = nodeStart + node.textContent.length;
  50946. if (nodeStart <= offset && nodeEnd >= offset) {
  50947. return {
  50948. node: node,
  50949. offset: offset - nodeStart
  50950. };
  50951. }
  50952. nodeStart = nodeEnd;
  50953. }
  50954. node = getLeafNode(getSiblingNode(node));
  50955. }
  50956. }
  50957. /**
  50958. * @param {DOMElement} outerNode
  50959. * @return {?object}
  50960. */
  50961. function getOffsets(outerNode) {
  50962. var ownerDocument = outerNode.ownerDocument;
  50963. var win = ownerDocument && ownerDocument.defaultView || window;
  50964. var selection = win.getSelection && win.getSelection();
  50965. if (!selection || selection.rangeCount === 0) {
  50966. return null;
  50967. }
  50968. var anchorNode = selection.anchorNode,
  50969. anchorOffset = selection.anchorOffset,
  50970. focusNode = selection.focusNode,
  50971. focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
  50972. // up/down buttons on an <input type="number">. Anonymous divs do not seem to
  50973. // expose properties, triggering a "Permission denied error" if any of its
  50974. // properties are accessed. The only seemingly possible way to avoid erroring
  50975. // is to access a property that typically works for non-anonymous divs and
  50976. // catch any error that may otherwise arise. See
  50977. // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
  50978. try {
  50979. /* eslint-disable no-unused-expressions */
  50980. anchorNode.nodeType;
  50981. focusNode.nodeType;
  50982. /* eslint-enable no-unused-expressions */
  50983. } catch (e) {
  50984. return null;
  50985. }
  50986. return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
  50987. }
  50988. /**
  50989. * Returns {start, end} where `start` is the character/codepoint index of
  50990. * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
  50991. * `end` is the index of (focusNode, focusOffset).
  50992. *
  50993. * Returns null if you pass in garbage input but we should probably just crash.
  50994. *
  50995. * Exported only for testing.
  50996. */
  50997. function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
  50998. var length = 0;
  50999. var start = -1;
  51000. var end = -1;
  51001. var indexWithinAnchor = 0;
  51002. var indexWithinFocus = 0;
  51003. var node = outerNode;
  51004. var parentNode = null;
  51005. outer: while (true) {
  51006. var next = null;
  51007. while (true) {
  51008. if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
  51009. start = length + anchorOffset;
  51010. }
  51011. if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
  51012. end = length + focusOffset;
  51013. }
  51014. if (node.nodeType === TEXT_NODE) {
  51015. length += node.nodeValue.length;
  51016. }
  51017. if ((next = node.firstChild) === null) {
  51018. break;
  51019. } // Moving from `node` to its first child `next`.
  51020. parentNode = node;
  51021. node = next;
  51022. }
  51023. while (true) {
  51024. if (node === outerNode) {
  51025. // If `outerNode` has children, this is always the second time visiting
  51026. // it. If it has no children, this is still the first loop, and the only
  51027. // valid selection is anchorNode and focusNode both equal to this node
  51028. // and both offsets 0, in which case we will have handled above.
  51029. break outer;
  51030. }
  51031. if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
  51032. start = length;
  51033. }
  51034. if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
  51035. end = length;
  51036. }
  51037. if ((next = node.nextSibling) !== null) {
  51038. break;
  51039. }
  51040. node = parentNode;
  51041. parentNode = node.parentNode;
  51042. } // Moving from `node` to its next sibling `next`.
  51043. node = next;
  51044. }
  51045. if (start === -1 || end === -1) {
  51046. // This should never happen. (Would happen if the anchor/focus nodes aren't
  51047. // actually inside the passed-in node.)
  51048. return null;
  51049. }
  51050. return {
  51051. start: start,
  51052. end: end
  51053. };
  51054. }
  51055. /**
  51056. * In modern non-IE browsers, we can support both forward and backward
  51057. * selections.
  51058. *
  51059. * Note: IE10+ supports the Selection object, but it does not support
  51060. * the `extend` method, which means that even in modern IE, it's not possible
  51061. * to programmatically create a backward selection. Thus, for all IE
  51062. * versions, we use the old IE API to create our selections.
  51063. *
  51064. * @param {DOMElement|DOMTextNode} node
  51065. * @param {object} offsets
  51066. */
  51067. function setOffsets(node, offsets) {
  51068. var doc = node.ownerDocument || document;
  51069. var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios.
  51070. // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
  51071. // fails when pasting 100+ items)
  51072. if (!win.getSelection) {
  51073. return;
  51074. }
  51075. var selection = win.getSelection();
  51076. var length = node.textContent.length;
  51077. var start = Math.min(offsets.start, length);
  51078. var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.
  51079. // Flip backward selections, so we can set with a single range.
  51080. if (!selection.extend && start > end) {
  51081. var temp = end;
  51082. end = start;
  51083. start = temp;
  51084. }
  51085. var startMarker = getNodeForCharacterOffset(node, start);
  51086. var endMarker = getNodeForCharacterOffset(node, end);
  51087. if (startMarker && endMarker) {
  51088. if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
  51089. return;
  51090. }
  51091. var range = doc.createRange();
  51092. range.setStart(startMarker.node, startMarker.offset);
  51093. selection.removeAllRanges();
  51094. if (start > end) {
  51095. selection.addRange(range);
  51096. selection.extend(endMarker.node, endMarker.offset);
  51097. } else {
  51098. range.setEnd(endMarker.node, endMarker.offset);
  51099. selection.addRange(range);
  51100. }
  51101. }
  51102. }
  51103. function isTextNode(node) {
  51104. return node && node.nodeType === TEXT_NODE;
  51105. }
  51106. function containsNode(outerNode, innerNode) {
  51107. if (!outerNode || !innerNode) {
  51108. return false;
  51109. } else if (outerNode === innerNode) {
  51110. return true;
  51111. } else if (isTextNode(outerNode)) {
  51112. return false;
  51113. } else if (isTextNode(innerNode)) {
  51114. return containsNode(outerNode, innerNode.parentNode);
  51115. } else if ('contains' in outerNode) {
  51116. return outerNode.contains(innerNode);
  51117. } else if (outerNode.compareDocumentPosition) {
  51118. return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  51119. } else {
  51120. return false;
  51121. }
  51122. }
  51123. function isInDocument(node) {
  51124. return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
  51125. }
  51126. function isSameOriginFrame(iframe) {
  51127. try {
  51128. // Accessing the contentDocument of a HTMLIframeElement can cause the browser
  51129. // to throw, e.g. if it has a cross-origin src attribute.
  51130. // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
  51131. // iframe.contentDocument.defaultView;
  51132. // A safety way is to access one of the cross origin properties: Window or Location
  51133. // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
  51134. // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
  51135. return typeof iframe.contentWindow.location.href === 'string';
  51136. } catch (err) {
  51137. return false;
  51138. }
  51139. }
  51140. function getActiveElementDeep() {
  51141. var win = window;
  51142. var element = getActiveElement();
  51143. while (element instanceof win.HTMLIFrameElement) {
  51144. if (isSameOriginFrame(element)) {
  51145. win = element.contentWindow;
  51146. } else {
  51147. return element;
  51148. }
  51149. element = getActiveElement(win.document);
  51150. }
  51151. return element;
  51152. }
  51153. /**
  51154. * @ReactInputSelection: React input selection module. Based on Selection.js,
  51155. * but modified to be suitable for react and has a couple of bug fixes (doesn't
  51156. * assume buttons have range selections allowed).
  51157. * Input selection module for React.
  51158. */
  51159. /**
  51160. * @hasSelectionCapabilities: we get the element types that support selection
  51161. * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
  51162. * and `selectionEnd` rows.
  51163. */
  51164. function hasSelectionCapabilities(elem) {
  51165. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  51166. return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
  51167. }
  51168. function getSelectionInformation() {
  51169. var focusedElem = getActiveElementDeep();
  51170. return {
  51171. focusedElem: focusedElem,
  51172. selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
  51173. };
  51174. }
  51175. /**
  51176. * @restoreSelection: If any selection information was potentially lost,
  51177. * restore it. This is useful when performing operations that could remove dom
  51178. * nodes and place them back in, resulting in focus being lost.
  51179. */
  51180. function restoreSelection(priorSelectionInformation) {
  51181. var curFocusedElem = getActiveElementDeep();
  51182. var priorFocusedElem = priorSelectionInformation.focusedElem;
  51183. var priorSelectionRange = priorSelectionInformation.selectionRange;
  51184. if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
  51185. if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
  51186. setSelection(priorFocusedElem, priorSelectionRange);
  51187. } // Focusing a node can change the scroll position, which is undesirable
  51188. var ancestors = [];
  51189. var ancestor = priorFocusedElem;
  51190. while (ancestor = ancestor.parentNode) {
  51191. if (ancestor.nodeType === ELEMENT_NODE) {
  51192. ancestors.push({
  51193. element: ancestor,
  51194. left: ancestor.scrollLeft,
  51195. top: ancestor.scrollTop
  51196. });
  51197. }
  51198. }
  51199. if (typeof priorFocusedElem.focus === 'function') {
  51200. priorFocusedElem.focus();
  51201. }
  51202. for (var i = 0; i < ancestors.length; i++) {
  51203. var info = ancestors[i];
  51204. info.element.scrollLeft = info.left;
  51205. info.element.scrollTop = info.top;
  51206. }
  51207. }
  51208. }
  51209. /**
  51210. * @getSelection: Gets the selection bounds of a focused textarea, input or
  51211. * contentEditable node.
  51212. * -@input: Look up selection bounds of this input
  51213. * -@return {start: selectionStart, end: selectionEnd}
  51214. */
  51215. function getSelection(input) {
  51216. var selection;
  51217. if ('selectionStart' in input) {
  51218. // Modern browser with input or textarea.
  51219. selection = {
  51220. start: input.selectionStart,
  51221. end: input.selectionEnd
  51222. };
  51223. } else {
  51224. // Content editable or old IE textarea.
  51225. selection = getOffsets(input);
  51226. }
  51227. return selection || {
  51228. start: 0,
  51229. end: 0
  51230. };
  51231. }
  51232. /**
  51233. * @setSelection: Sets the selection bounds of a textarea or input and focuses
  51234. * the input.
  51235. * -@input Set selection bounds of this input or textarea
  51236. * -@offsets Object of same form that is returned from get*
  51237. */
  51238. function setSelection(input, offsets) {
  51239. var start = offsets.start,
  51240. end = offsets.end;
  51241. if (end === undefined) {
  51242. end = start;
  51243. }
  51244. if ('selectionStart' in input) {
  51245. input.selectionStart = start;
  51246. input.selectionEnd = Math.min(end, input.value.length);
  51247. } else {
  51248. setOffsets(input, offsets);
  51249. }
  51250. }
  51251. var validateDOMNesting = function () {};
  51252. var updatedAncestorInfo = function () {};
  51253. {
  51254. // This validation code was written based on the HTML5 parsing spec:
  51255. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  51256. //
  51257. // Note: this does not catch all invalid nesting, nor does it try to (as it's
  51258. // not clear what practical benefit doing so provides); instead, we warn only
  51259. // for cases where the parser will give a parse tree differing from what React
  51260. // intended. For example, <b><div></div></b> is invalid but we don't warn
  51261. // because it still parses correctly; we do warn for other cases like nested
  51262. // <p> tags where the beginning of the second element implicitly closes the
  51263. // first, causing a confusing mess.
  51264. // https://html.spec.whatwg.org/multipage/syntax.html#special
  51265. var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  51266. var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  51267. // TODO: Distinguish by namespace here -- for <title>, including it here
  51268. // errs on the side of fewer warnings
  51269. 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
  51270. var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
  51271. var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
  51272. var emptyAncestorInfo = {
  51273. current: null,
  51274. formTag: null,
  51275. aTagInScope: null,
  51276. buttonTagInScope: null,
  51277. nobrTagInScope: null,
  51278. pTagInButtonScope: null,
  51279. listItemTagAutoclosing: null,
  51280. dlItemTagAutoclosing: null
  51281. };
  51282. updatedAncestorInfo = function (oldInfo, tag) {
  51283. var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
  51284. var info = {
  51285. tag: tag
  51286. };
  51287. if (inScopeTags.indexOf(tag) !== -1) {
  51288. ancestorInfo.aTagInScope = null;
  51289. ancestorInfo.buttonTagInScope = null;
  51290. ancestorInfo.nobrTagInScope = null;
  51291. }
  51292. if (buttonScopeTags.indexOf(tag) !== -1) {
  51293. ancestorInfo.pTagInButtonScope = null;
  51294. } // See rules for 'li', 'dd', 'dt' start tags in
  51295. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  51296. if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
  51297. ancestorInfo.listItemTagAutoclosing = null;
  51298. ancestorInfo.dlItemTagAutoclosing = null;
  51299. }
  51300. ancestorInfo.current = info;
  51301. if (tag === 'form') {
  51302. ancestorInfo.formTag = info;
  51303. }
  51304. if (tag === 'a') {
  51305. ancestorInfo.aTagInScope = info;
  51306. }
  51307. if (tag === 'button') {
  51308. ancestorInfo.buttonTagInScope = info;
  51309. }
  51310. if (tag === 'nobr') {
  51311. ancestorInfo.nobrTagInScope = info;
  51312. }
  51313. if (tag === 'p') {
  51314. ancestorInfo.pTagInButtonScope = info;
  51315. }
  51316. if (tag === 'li') {
  51317. ancestorInfo.listItemTagAutoclosing = info;
  51318. }
  51319. if (tag === 'dd' || tag === 'dt') {
  51320. ancestorInfo.dlItemTagAutoclosing = info;
  51321. }
  51322. return ancestorInfo;
  51323. };
  51324. /**
  51325. * Returns whether
  51326. */
  51327. var isTagValidWithParent = function (tag, parentTag) {
  51328. // First, let's check if we're in an unusual parsing mode...
  51329. switch (parentTag) {
  51330. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
  51331. case 'select':
  51332. return tag === 'option' || tag === 'optgroup' || tag === '#text';
  51333. case 'optgroup':
  51334. return tag === 'option' || tag === '#text';
  51335. // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
  51336. // but
  51337. case 'option':
  51338. return tag === '#text';
  51339. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
  51340. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
  51341. // No special behavior since these rules fall back to "in body" mode for
  51342. // all except special table nodes which cause bad parsing behavior anyway.
  51343. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
  51344. case 'tr':
  51345. return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
  51346. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
  51347. case 'tbody':
  51348. case 'thead':
  51349. case 'tfoot':
  51350. return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
  51351. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
  51352. case 'colgroup':
  51353. return tag === 'col' || tag === 'template';
  51354. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
  51355. case 'table':
  51356. return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
  51357. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
  51358. case 'head':
  51359. return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
  51360. // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
  51361. case 'html':
  51362. return tag === 'head' || tag === 'body' || tag === 'frameset';
  51363. case 'frameset':
  51364. return tag === 'frame';
  51365. case '#document':
  51366. return tag === 'html';
  51367. } // Probably in the "in body" parsing mode, so we outlaw only tag combos
  51368. // where the parsing rules cause implicit opens or closes to be added.
  51369. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  51370. switch (tag) {
  51371. case 'h1':
  51372. case 'h2':
  51373. case 'h3':
  51374. case 'h4':
  51375. case 'h5':
  51376. case 'h6':
  51377. return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
  51378. case 'rp':
  51379. case 'rt':
  51380. return impliedEndTags.indexOf(parentTag) === -1;
  51381. case 'body':
  51382. case 'caption':
  51383. case 'col':
  51384. case 'colgroup':
  51385. case 'frameset':
  51386. case 'frame':
  51387. case 'head':
  51388. case 'html':
  51389. case 'tbody':
  51390. case 'td':
  51391. case 'tfoot':
  51392. case 'th':
  51393. case 'thead':
  51394. case 'tr':
  51395. // These tags are only valid with a few parents that have special child
  51396. // parsing rules -- if we're down here, then none of those matched and
  51397. // so we allow it only if we don't know what the parent is, as all other
  51398. // cases are invalid.
  51399. return parentTag == null;
  51400. }
  51401. return true;
  51402. };
  51403. /**
  51404. * Returns whether
  51405. */
  51406. var findInvalidAncestorForTag = function (tag, ancestorInfo) {
  51407. switch (tag) {
  51408. case 'address':
  51409. case 'article':
  51410. case 'aside':
  51411. case 'blockquote':
  51412. case 'center':
  51413. case 'details':
  51414. case 'dialog':
  51415. case 'dir':
  51416. case 'div':
  51417. case 'dl':
  51418. case 'fieldset':
  51419. case 'figcaption':
  51420. case 'figure':
  51421. case 'footer':
  51422. case 'header':
  51423. case 'hgroup':
  51424. case 'main':
  51425. case 'menu':
  51426. case 'nav':
  51427. case 'ol':
  51428. case 'p':
  51429. case 'section':
  51430. case 'summary':
  51431. case 'ul':
  51432. case 'pre':
  51433. case 'listing':
  51434. case 'table':
  51435. case 'hr':
  51436. case 'xmp':
  51437. case 'h1':
  51438. case 'h2':
  51439. case 'h3':
  51440. case 'h4':
  51441. case 'h5':
  51442. case 'h6':
  51443. return ancestorInfo.pTagInButtonScope;
  51444. case 'form':
  51445. return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
  51446. case 'li':
  51447. return ancestorInfo.listItemTagAutoclosing;
  51448. case 'dd':
  51449. case 'dt':
  51450. return ancestorInfo.dlItemTagAutoclosing;
  51451. case 'button':
  51452. return ancestorInfo.buttonTagInScope;
  51453. case 'a':
  51454. // Spec says something about storing a list of markers, but it sounds
  51455. // equivalent to this check.
  51456. return ancestorInfo.aTagInScope;
  51457. case 'nobr':
  51458. return ancestorInfo.nobrTagInScope;
  51459. }
  51460. return null;
  51461. };
  51462. var didWarn$1 = {};
  51463. validateDOMNesting = function (childTag, childText, ancestorInfo) {
  51464. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  51465. var parentInfo = ancestorInfo.current;
  51466. var parentTag = parentInfo && parentInfo.tag;
  51467. if (childText != null) {
  51468. !(childTag == null) ? warningWithoutStack$1(false, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
  51469. childTag = '#text';
  51470. }
  51471. var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
  51472. var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
  51473. var invalidParentOrAncestor = invalidParent || invalidAncestor;
  51474. if (!invalidParentOrAncestor) {
  51475. return;
  51476. }
  51477. var ancestorTag = invalidParentOrAncestor.tag;
  51478. var addendum = getCurrentFiberStackInDev();
  51479. var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
  51480. if (didWarn$1[warnKey]) {
  51481. return;
  51482. }
  51483. didWarn$1[warnKey] = true;
  51484. var tagDisplayName = childTag;
  51485. var whitespaceInfo = '';
  51486. if (childTag === '#text') {
  51487. if (/\S/.test(childText)) {
  51488. tagDisplayName = 'Text nodes';
  51489. } else {
  51490. tagDisplayName = 'Whitespace text nodes';
  51491. whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
  51492. }
  51493. } else {
  51494. tagDisplayName = '<' + childTag + '>';
  51495. }
  51496. if (invalidParent) {
  51497. var info = '';
  51498. if (ancestorTag === 'table' && childTag === 'tr') {
  51499. info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';
  51500. }
  51501. warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);
  51502. } else {
  51503. warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);
  51504. }
  51505. };
  51506. }
  51507. // can re-export everything from this module.
  51508. function shim() {
  51509. {
  51510. {
  51511. throw Error("The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.");
  51512. }
  51513. }
  51514. } // Persistence (when unsupported)
  51515. var supportsPersistence = false;
  51516. var cloneInstance = shim;
  51517. var cloneFundamentalInstance = shim;
  51518. var createContainerChildSet = shim;
  51519. var appendChildToContainerChildSet = shim;
  51520. var finalizeContainerChildren = shim;
  51521. var replaceContainerChildren = shim;
  51522. var cloneHiddenInstance = shim;
  51523. var cloneHiddenTextInstance = shim;
  51524. var SUPPRESS_HYDRATION_WARNING;
  51525. {
  51526. SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
  51527. }
  51528. var SUSPENSE_START_DATA = '$';
  51529. var SUSPENSE_END_DATA = '/$';
  51530. var SUSPENSE_PENDING_START_DATA = '$?';
  51531. var SUSPENSE_FALLBACK_START_DATA = '$!';
  51532. var STYLE = 'style';
  51533. var eventsEnabled = null;
  51534. var selectionInformation = null;
  51535. function shouldAutoFocusHostComponent(type, props) {
  51536. switch (type) {
  51537. case 'button':
  51538. case 'input':
  51539. case 'select':
  51540. case 'textarea':
  51541. return !!props.autoFocus;
  51542. }
  51543. return false;
  51544. }
  51545. function getRootHostContext(rootContainerInstance) {
  51546. var type;
  51547. var namespace;
  51548. var nodeType = rootContainerInstance.nodeType;
  51549. switch (nodeType) {
  51550. case DOCUMENT_NODE:
  51551. case DOCUMENT_FRAGMENT_NODE:
  51552. {
  51553. type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
  51554. var root = rootContainerInstance.documentElement;
  51555. namespace = root ? root.namespaceURI : getChildNamespace(null, '');
  51556. break;
  51557. }
  51558. default:
  51559. {
  51560. var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
  51561. var ownNamespace = container.namespaceURI || null;
  51562. type = container.tagName;
  51563. namespace = getChildNamespace(ownNamespace, type);
  51564. break;
  51565. }
  51566. }
  51567. {
  51568. var validatedTag = type.toLowerCase();
  51569. var ancestorInfo = updatedAncestorInfo(null, validatedTag);
  51570. return {
  51571. namespace: namespace,
  51572. ancestorInfo: ancestorInfo
  51573. };
  51574. }
  51575. return namespace;
  51576. }
  51577. function getChildHostContext(parentHostContext, type, rootContainerInstance) {
  51578. {
  51579. var parentHostContextDev = parentHostContext;
  51580. var namespace = getChildNamespace(parentHostContextDev.namespace, type);
  51581. var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
  51582. return {
  51583. namespace: namespace,
  51584. ancestorInfo: ancestorInfo
  51585. };
  51586. }
  51587. var parentNamespace = parentHostContext;
  51588. return getChildNamespace(parentNamespace, type);
  51589. }
  51590. function getPublicInstance(instance) {
  51591. return instance;
  51592. }
  51593. function prepareForCommit(containerInfo) {
  51594. eventsEnabled = isEnabled();
  51595. selectionInformation = getSelectionInformation();
  51596. setEnabled(false);
  51597. }
  51598. function resetAfterCommit(containerInfo) {
  51599. restoreSelection(selectionInformation);
  51600. selectionInformation = null;
  51601. setEnabled(eventsEnabled);
  51602. eventsEnabled = null;
  51603. }
  51604. function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  51605. var parentNamespace;
  51606. {
  51607. // TODO: take namespace into account when validating.
  51608. var hostContextDev = hostContext;
  51609. validateDOMNesting(type, null, hostContextDev.ancestorInfo);
  51610. if (typeof props.children === 'string' || typeof props.children === 'number') {
  51611. var string = '' + props.children;
  51612. var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
  51613. validateDOMNesting(null, string, ownAncestorInfo);
  51614. }
  51615. parentNamespace = hostContextDev.namespace;
  51616. }
  51617. var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
  51618. precacheFiberNode(internalInstanceHandle, domElement);
  51619. updateFiberProps(domElement, props);
  51620. return domElement;
  51621. }
  51622. function appendInitialChild(parentInstance, child) {
  51623. parentInstance.appendChild(child);
  51624. }
  51625. function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
  51626. setInitialProperties(domElement, type, props, rootContainerInstance);
  51627. return shouldAutoFocusHostComponent(type, props);
  51628. }
  51629. function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
  51630. {
  51631. var hostContextDev = hostContext;
  51632. if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
  51633. var string = '' + newProps.children;
  51634. var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
  51635. validateDOMNesting(null, string, ownAncestorInfo);
  51636. }
  51637. }
  51638. return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
  51639. }
  51640. function shouldSetTextContent(type, props) {
  51641. return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
  51642. }
  51643. function shouldDeprioritizeSubtree(type, props) {
  51644. return !!props.hidden;
  51645. }
  51646. function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
  51647. {
  51648. var hostContextDev = hostContext;
  51649. validateDOMNesting(null, text, hostContextDev.ancestorInfo);
  51650. }
  51651. var textNode = createTextNode(text, rootContainerInstance);
  51652. precacheFiberNode(internalInstanceHandle, textNode);
  51653. return textNode;
  51654. }
  51655. var isPrimaryRenderer = true;
  51656. var warnsIfNotActing = true; // This initialization code may run even on server environments
  51657. // if a component just imports ReactDOM (e.g. for findDOMNode).
  51658. // Some environments might not have setTimeout or clearTimeout.
  51659. var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
  51660. var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
  51661. var noTimeout = -1; // -------------------
  51662. // Mutation
  51663. // -------------------
  51664. var supportsMutation = true;
  51665. function commitMount(domElement, type, newProps, internalInstanceHandle) {
  51666. // Despite the naming that might imply otherwise, this method only
  51667. // fires if there is an `Update` effect scheduled during mounting.
  51668. // This happens if `finalizeInitialChildren` returns `true` (which it
  51669. // does to implement the `autoFocus` attribute on the client). But
  51670. // there are also other cases when this might happen (such as patching
  51671. // up text content during hydration mismatch). So we'll check this again.
  51672. if (shouldAutoFocusHostComponent(type, newProps)) {
  51673. domElement.focus();
  51674. }
  51675. }
  51676. function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
  51677. // Update the props handle so that we know which props are the ones with
  51678. // with current event handlers.
  51679. updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.
  51680. updateProperties(domElement, updatePayload, type, oldProps, newProps);
  51681. }
  51682. function resetTextContent(domElement) {
  51683. setTextContent(domElement, '');
  51684. }
  51685. function commitTextUpdate(textInstance, oldText, newText) {
  51686. textInstance.nodeValue = newText;
  51687. }
  51688. function appendChild(parentInstance, child) {
  51689. parentInstance.appendChild(child);
  51690. }
  51691. function appendChildToContainer(container, child) {
  51692. var parentNode;
  51693. if (container.nodeType === COMMENT_NODE) {
  51694. parentNode = container.parentNode;
  51695. parentNode.insertBefore(child, container);
  51696. } else {
  51697. parentNode = container;
  51698. parentNode.appendChild(child);
  51699. } // This container might be used for a portal.
  51700. // If something inside a portal is clicked, that click should bubble
  51701. // through the React tree. However, on Mobile Safari the click would
  51702. // never bubble through the *DOM* tree unless an ancestor with onclick
  51703. // event exists. So we wouldn't see it and dispatch it.
  51704. // This is why we ensure that non React root containers have inline onclick
  51705. // defined.
  51706. // https://github.com/facebook/react/issues/11918
  51707. var reactRootContainer = container._reactRootContainer;
  51708. if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
  51709. // TODO: This cast may not be sound for SVG, MathML or custom elements.
  51710. trapClickOnNonInteractiveElement(parentNode);
  51711. }
  51712. }
  51713. function insertBefore(parentInstance, child, beforeChild) {
  51714. parentInstance.insertBefore(child, beforeChild);
  51715. }
  51716. function insertInContainerBefore(container, child, beforeChild) {
  51717. if (container.nodeType === COMMENT_NODE) {
  51718. container.parentNode.insertBefore(child, beforeChild);
  51719. } else {
  51720. container.insertBefore(child, beforeChild);
  51721. }
  51722. } // This is a specific event for the React Flare
  51723. // event system, so event responders can act
  51724. // accordingly to a DOM node being unmounted that
  51725. // previously had active document focus.
  51726. function dispatchDetachedVisibleNodeEvent(child) {
  51727. if (enableFlareAPI && selectionInformation && child === selectionInformation.focusedElem) {
  51728. var targetFiber = getClosestInstanceFromNode(child); // Simlulate a blur event to the React Flare responder system.
  51729. dispatchEventForResponderEventSystem('detachedvisiblenode', targetFiber, {
  51730. target: child,
  51731. timeStamp: Date.now()
  51732. }, child, RESPONDER_EVENT_SYSTEM | IS_PASSIVE);
  51733. }
  51734. }
  51735. function removeChild(parentInstance, child) {
  51736. dispatchDetachedVisibleNodeEvent(child);
  51737. parentInstance.removeChild(child);
  51738. }
  51739. function removeChildFromContainer(container, child) {
  51740. if (container.nodeType === COMMENT_NODE) {
  51741. container.parentNode.removeChild(child);
  51742. } else {
  51743. dispatchDetachedVisibleNodeEvent(child);
  51744. container.removeChild(child);
  51745. }
  51746. }
  51747. function clearSuspenseBoundary(parentInstance, suspenseInstance) {
  51748. var node = suspenseInstance; // Delete all nodes within this suspense boundary.
  51749. // There might be nested nodes so we need to keep track of how
  51750. // deep we are and only break out when we're back on top.
  51751. var depth = 0;
  51752. do {
  51753. var nextNode = node.nextSibling;
  51754. parentInstance.removeChild(node);
  51755. if (nextNode && nextNode.nodeType === COMMENT_NODE) {
  51756. var data = nextNode.data;
  51757. if (data === SUSPENSE_END_DATA) {
  51758. if (depth === 0) {
  51759. parentInstance.removeChild(nextNode); // Retry if any event replaying was blocked on this.
  51760. retryIfBlockedOn(suspenseInstance);
  51761. return;
  51762. } else {
  51763. depth--;
  51764. }
  51765. } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
  51766. depth++;
  51767. }
  51768. }
  51769. node = nextNode;
  51770. } while (node); // TODO: Warn, we didn't find the end comment boundary.
  51771. // Retry if any event replaying was blocked on this.
  51772. retryIfBlockedOn(suspenseInstance);
  51773. }
  51774. function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
  51775. if (container.nodeType === COMMENT_NODE) {
  51776. clearSuspenseBoundary(container.parentNode, suspenseInstance);
  51777. } else if (container.nodeType === ELEMENT_NODE) {
  51778. clearSuspenseBoundary(container, suspenseInstance);
  51779. } else {} // Document nodes should never contain suspense boundaries.
  51780. // Retry if any event replaying was blocked on this.
  51781. retryIfBlockedOn(container);
  51782. }
  51783. function hideInstance(instance) {
  51784. // TODO: Does this work for all element types? What about MathML? Should we
  51785. // pass host context to this method?
  51786. instance = instance;
  51787. var style = instance.style;
  51788. if (typeof style.setProperty === 'function') {
  51789. style.setProperty('display', 'none', 'important');
  51790. } else {
  51791. style.display = 'none';
  51792. }
  51793. }
  51794. function hideTextInstance(textInstance) {
  51795. textInstance.nodeValue = '';
  51796. }
  51797. function unhideInstance(instance, props) {
  51798. instance = instance;
  51799. var styleProp = props[STYLE];
  51800. var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
  51801. instance.style.display = dangerousStyleValue('display', display);
  51802. }
  51803. function unhideTextInstance(textInstance, text) {
  51804. textInstance.nodeValue = text;
  51805. } // -------------------
  51806. // Hydration
  51807. // -------------------
  51808. var supportsHydration = true;
  51809. function canHydrateInstance(instance, type, props) {
  51810. if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
  51811. return null;
  51812. } // This has now been refined to an element node.
  51813. return instance;
  51814. }
  51815. function canHydrateTextInstance(instance, text) {
  51816. if (text === '' || instance.nodeType !== TEXT_NODE) {
  51817. // Empty strings are not parsed by HTML so there won't be a correct match here.
  51818. return null;
  51819. } // This has now been refined to a text node.
  51820. return instance;
  51821. }
  51822. function canHydrateSuspenseInstance(instance) {
  51823. if (instance.nodeType !== COMMENT_NODE) {
  51824. // Empty strings are not parsed by HTML so there won't be a correct match here.
  51825. return null;
  51826. } // This has now been refined to a suspense node.
  51827. return instance;
  51828. }
  51829. function isSuspenseInstancePending(instance) {
  51830. return instance.data === SUSPENSE_PENDING_START_DATA;
  51831. }
  51832. function isSuspenseInstanceFallback(instance) {
  51833. return instance.data === SUSPENSE_FALLBACK_START_DATA;
  51834. }
  51835. function registerSuspenseInstanceRetry(instance, callback) {
  51836. instance._reactRetry = callback;
  51837. }
  51838. function getNextHydratable(node) {
  51839. // Skip non-hydratable nodes.
  51840. for (; node != null; node = node.nextSibling) {
  51841. var nodeType = node.nodeType;
  51842. if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
  51843. break;
  51844. }
  51845. if (enableSuspenseServerRenderer) {
  51846. if (nodeType === COMMENT_NODE) {
  51847. var nodeData = node.data;
  51848. if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
  51849. break;
  51850. }
  51851. }
  51852. }
  51853. }
  51854. return node;
  51855. }
  51856. function getNextHydratableSibling(instance) {
  51857. return getNextHydratable(instance.nextSibling);
  51858. }
  51859. function getFirstHydratableChild(parentInstance) {
  51860. return getNextHydratable(parentInstance.firstChild);
  51861. }
  51862. function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  51863. precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
  51864. // get attached.
  51865. updateFiberProps(instance, props);
  51866. var parentNamespace;
  51867. {
  51868. var hostContextDev = hostContext;
  51869. parentNamespace = hostContextDev.namespace;
  51870. }
  51871. return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
  51872. }
  51873. function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
  51874. precacheFiberNode(internalInstanceHandle, textInstance);
  51875. return diffHydratedText(textInstance, text);
  51876. }
  51877. function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
  51878. precacheFiberNode(internalInstanceHandle, suspenseInstance);
  51879. }
  51880. function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
  51881. var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.
  51882. // There might be nested nodes so we need to keep track of how
  51883. // deep we are and only break out when we're back on top.
  51884. var depth = 0;
  51885. while (node) {
  51886. if (node.nodeType === COMMENT_NODE) {
  51887. var data = node.data;
  51888. if (data === SUSPENSE_END_DATA) {
  51889. if (depth === 0) {
  51890. return getNextHydratableSibling(node);
  51891. } else {
  51892. depth--;
  51893. }
  51894. } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
  51895. depth++;
  51896. }
  51897. }
  51898. node = node.nextSibling;
  51899. } // TODO: Warn, we didn't find the end comment boundary.
  51900. return null;
  51901. } // Returns the SuspenseInstance if this node is a direct child of a
  51902. // SuspenseInstance. I.e. if its previous sibling is a Comment with
  51903. // SUSPENSE_x_START_DATA. Otherwise, null.
  51904. function getParentSuspenseInstance(targetInstance) {
  51905. var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.
  51906. // There might be nested nodes so we need to keep track of how
  51907. // deep we are and only break out when we're back on top.
  51908. var depth = 0;
  51909. while (node) {
  51910. if (node.nodeType === COMMENT_NODE) {
  51911. var data = node.data;
  51912. if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
  51913. if (depth === 0) {
  51914. return node;
  51915. } else {
  51916. depth--;
  51917. }
  51918. } else if (data === SUSPENSE_END_DATA) {
  51919. depth++;
  51920. }
  51921. }
  51922. node = node.previousSibling;
  51923. }
  51924. return null;
  51925. }
  51926. function commitHydratedContainer(container) {
  51927. // Retry if any event replaying was blocked on this.
  51928. retryIfBlockedOn(container);
  51929. }
  51930. function commitHydratedSuspenseInstance(suspenseInstance) {
  51931. // Retry if any event replaying was blocked on this.
  51932. retryIfBlockedOn(suspenseInstance);
  51933. }
  51934. function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
  51935. {
  51936. warnForUnmatchedText(textInstance, text);
  51937. }
  51938. }
  51939. function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
  51940. if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
  51941. warnForUnmatchedText(textInstance, text);
  51942. }
  51943. }
  51944. function didNotHydrateContainerInstance(parentContainer, instance) {
  51945. {
  51946. if (instance.nodeType === ELEMENT_NODE) {
  51947. warnForDeletedHydratableElement(parentContainer, instance);
  51948. } else if (instance.nodeType === COMMENT_NODE) {// TODO: warnForDeletedHydratableSuspenseBoundary
  51949. } else {
  51950. warnForDeletedHydratableText(parentContainer, instance);
  51951. }
  51952. }
  51953. }
  51954. function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
  51955. if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
  51956. if (instance.nodeType === ELEMENT_NODE) {
  51957. warnForDeletedHydratableElement(parentInstance, instance);
  51958. } else if (instance.nodeType === COMMENT_NODE) {// TODO: warnForDeletedHydratableSuspenseBoundary
  51959. } else {
  51960. warnForDeletedHydratableText(parentInstance, instance);
  51961. }
  51962. }
  51963. }
  51964. function didNotFindHydratableContainerInstance(parentContainer, type, props) {
  51965. {
  51966. warnForInsertedHydratedElement(parentContainer, type, props);
  51967. }
  51968. }
  51969. function didNotFindHydratableContainerTextInstance(parentContainer, text) {
  51970. {
  51971. warnForInsertedHydratedText(parentContainer, text);
  51972. }
  51973. }
  51974. function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
  51975. if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
  51976. warnForInsertedHydratedElement(parentInstance, type, props);
  51977. }
  51978. }
  51979. function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
  51980. if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
  51981. warnForInsertedHydratedText(parentInstance, text);
  51982. }
  51983. }
  51984. function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
  51985. if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {// TODO: warnForInsertedHydratedSuspense(parentInstance);
  51986. }
  51987. }
  51988. function mountResponderInstance(responder, responderInstance, responderProps, responderState, instance) {
  51989. // Listen to events
  51990. var doc = instance.ownerDocument;
  51991. var _ref = responder,
  51992. rootEventTypes = _ref.rootEventTypes,
  51993. targetEventTypes = _ref.targetEventTypes;
  51994. if (targetEventTypes !== null) {
  51995. listenToEventResponderEventTypes(targetEventTypes, doc);
  51996. }
  51997. if (rootEventTypes !== null) {
  51998. addRootEventTypesForResponderInstance(responderInstance, rootEventTypes);
  51999. listenToEventResponderEventTypes(rootEventTypes, doc);
  52000. }
  52001. mountEventResponder(responder, responderInstance, responderProps, responderState);
  52002. return responderInstance;
  52003. }
  52004. function unmountResponderInstance(responderInstance) {
  52005. if (enableFlareAPI) {
  52006. // TODO stop listening to targetEventTypes
  52007. unmountEventResponder(responderInstance);
  52008. }
  52009. }
  52010. function getFundamentalComponentInstance(fundamentalInstance) {
  52011. if (enableFundamentalAPI) {
  52012. var currentFiber = fundamentalInstance.currentFiber,
  52013. impl = fundamentalInstance.impl,
  52014. props = fundamentalInstance.props,
  52015. state = fundamentalInstance.state;
  52016. var instance = impl.getInstance(null, props, state);
  52017. precacheFiberNode(currentFiber, instance);
  52018. return instance;
  52019. } // Because of the flag above, this gets around the Flow error;
  52020. return null;
  52021. }
  52022. function mountFundamentalComponent(fundamentalInstance) {
  52023. if (enableFundamentalAPI) {
  52024. var impl = fundamentalInstance.impl,
  52025. instance = fundamentalInstance.instance,
  52026. props = fundamentalInstance.props,
  52027. state = fundamentalInstance.state;
  52028. var onMount = impl.onMount;
  52029. if (onMount !== undefined) {
  52030. onMount(null, instance, props, state);
  52031. }
  52032. }
  52033. }
  52034. function shouldUpdateFundamentalComponent(fundamentalInstance) {
  52035. if (enableFundamentalAPI) {
  52036. var impl = fundamentalInstance.impl,
  52037. prevProps = fundamentalInstance.prevProps,
  52038. props = fundamentalInstance.props,
  52039. state = fundamentalInstance.state;
  52040. var shouldUpdate = impl.shouldUpdate;
  52041. if (shouldUpdate !== undefined) {
  52042. return shouldUpdate(null, prevProps, props, state);
  52043. }
  52044. }
  52045. return true;
  52046. }
  52047. function updateFundamentalComponent(fundamentalInstance) {
  52048. if (enableFundamentalAPI) {
  52049. var impl = fundamentalInstance.impl,
  52050. instance = fundamentalInstance.instance,
  52051. prevProps = fundamentalInstance.prevProps,
  52052. props = fundamentalInstance.props,
  52053. state = fundamentalInstance.state;
  52054. var onUpdate = impl.onUpdate;
  52055. if (onUpdate !== undefined) {
  52056. onUpdate(null, instance, prevProps, props, state);
  52057. }
  52058. }
  52059. }
  52060. function unmountFundamentalComponent(fundamentalInstance) {
  52061. if (enableFundamentalAPI) {
  52062. var impl = fundamentalInstance.impl,
  52063. instance = fundamentalInstance.instance,
  52064. props = fundamentalInstance.props,
  52065. state = fundamentalInstance.state;
  52066. var onUnmount = impl.onUnmount;
  52067. if (onUnmount !== undefined) {
  52068. onUnmount(null, instance, props, state);
  52069. }
  52070. }
  52071. }
  52072. function getInstanceFromNode$2(node) {
  52073. return getClosestInstanceFromNode(node) || null;
  52074. }
  52075. var randomKey = Math.random().toString(36).slice(2);
  52076. var internalInstanceKey = '__reactInternalInstance$' + randomKey;
  52077. var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
  52078. var internalContainerInstanceKey = '__reactContainere$' + randomKey;
  52079. function precacheFiberNode(hostInst, node) {
  52080. node[internalInstanceKey] = hostInst;
  52081. }
  52082. function markContainerAsRoot(hostRoot, node) {
  52083. node[internalContainerInstanceKey] = hostRoot;
  52084. }
  52085. function unmarkContainerAsRoot(node) {
  52086. node[internalContainerInstanceKey] = null;
  52087. }
  52088. function isContainerMarkedAsRoot(node) {
  52089. return !!node[internalContainerInstanceKey];
  52090. } // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.
  52091. // If the target node is part of a hydrated or not yet rendered subtree, then
  52092. // this may also return a SuspenseComponent or HostRoot to indicate that.
  52093. // Conceptually the HostRoot fiber is a child of the Container node. So if you
  52094. // pass the Container node as the targetNode, you will not actually get the
  52095. // HostRoot back. To get to the HostRoot, you need to pass a child of it.
  52096. // The same thing applies to Suspense boundaries.
  52097. function getClosestInstanceFromNode(targetNode) {
  52098. var targetInst = targetNode[internalInstanceKey];
  52099. if (targetInst) {
  52100. // Don't return HostRoot or SuspenseComponent here.
  52101. return targetInst;
  52102. } // If the direct event target isn't a React owned DOM node, we need to look
  52103. // to see if one of its parents is a React owned DOM node.
  52104. var parentNode = targetNode.parentNode;
  52105. while (parentNode) {
  52106. // We'll check if this is a container root that could include
  52107. // React nodes in the future. We need to check this first because
  52108. // if we're a child of a dehydrated container, we need to first
  52109. // find that inner container before moving on to finding the parent
  52110. // instance. Note that we don't check this field on the targetNode
  52111. // itself because the fibers are conceptually between the container
  52112. // node and the first child. It isn't surrounding the container node.
  52113. // If it's not a container, we check if it's an instance.
  52114. targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
  52115. if (targetInst) {
  52116. // Since this wasn't the direct target of the event, we might have
  52117. // stepped past dehydrated DOM nodes to get here. However they could
  52118. // also have been non-React nodes. We need to answer which one.
  52119. // If we the instance doesn't have any children, then there can't be
  52120. // a nested suspense boundary within it. So we can use this as a fast
  52121. // bailout. Most of the time, when people add non-React children to
  52122. // the tree, it is using a ref to a child-less DOM node.
  52123. // Normally we'd only need to check one of the fibers because if it
  52124. // has ever gone from having children to deleting them or vice versa
  52125. // it would have deleted the dehydrated boundary nested inside already.
  52126. // However, since the HostRoot starts out with an alternate it might
  52127. // have one on the alternate so we need to check in case this was a
  52128. // root.
  52129. var alternate = targetInst.alternate;
  52130. if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
  52131. // Next we need to figure out if the node that skipped past is
  52132. // nested within a dehydrated boundary and if so, which one.
  52133. var suspenseInstance = getParentSuspenseInstance(targetNode);
  52134. while (suspenseInstance !== null) {
  52135. // We found a suspense instance. That means that we haven't
  52136. // hydrated it yet. Even though we leave the comments in the
  52137. // DOM after hydrating, and there are boundaries in the DOM
  52138. // that could already be hydrated, we wouldn't have found them
  52139. // through this pass since if the target is hydrated it would
  52140. // have had an internalInstanceKey on it.
  52141. // Let's get the fiber associated with the SuspenseComponent
  52142. // as the deepest instance.
  52143. var targetSuspenseInst = suspenseInstance[internalInstanceKey];
  52144. if (targetSuspenseInst) {
  52145. return targetSuspenseInst;
  52146. } // If we don't find a Fiber on the comment, it might be because
  52147. // we haven't gotten to hydrate it yet. There might still be a
  52148. // parent boundary that hasn't above this one so we need to find
  52149. // the outer most that is known.
  52150. suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent
  52151. // host component also hasn't hydrated yet. We can return it
  52152. // below since it will bail out on the isMounted check later.
  52153. }
  52154. }
  52155. return targetInst;
  52156. }
  52157. targetNode = parentNode;
  52158. parentNode = targetNode.parentNode;
  52159. }
  52160. return null;
  52161. }
  52162. /**
  52163. * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
  52164. * instance, or null if the node was not rendered by this React.
  52165. */
  52166. function getInstanceFromNode$1(node) {
  52167. var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
  52168. if (inst) {
  52169. if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
  52170. return inst;
  52171. } else {
  52172. return null;
  52173. }
  52174. }
  52175. return null;
  52176. }
  52177. /**
  52178. * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
  52179. * DOM node.
  52180. */
  52181. function getNodeFromInstance$1(inst) {
  52182. if (inst.tag === HostComponent || inst.tag === HostText) {
  52183. // In Fiber this, is just the state node right now. We assume it will be
  52184. // a host component or host text.
  52185. return inst.stateNode;
  52186. } // Without this first invariant, passing a non-DOM-component triggers the next
  52187. // invariant for a missing parent, which is super confusing.
  52188. {
  52189. {
  52190. throw Error("getNodeFromInstance: Invalid argument.");
  52191. }
  52192. }
  52193. }
  52194. function getFiberCurrentPropsFromNode$1(node) {
  52195. return node[internalEventHandlersKey] || null;
  52196. }
  52197. function updateFiberProps(node, props) {
  52198. node[internalEventHandlersKey] = props;
  52199. }
  52200. /**
  52201. * These variables store information about text content of a target node,
  52202. * allowing comparison of content before and after a given event.
  52203. *
  52204. * Identify the node where selection currently begins, then observe
  52205. * both its text content and its current position in the DOM. Since the
  52206. * browser may natively replace the target node during composition, we can
  52207. * use its position to find its replacement.
  52208. *
  52209. *
  52210. */
  52211. var root = null;
  52212. var startText = null;
  52213. var fallbackText = null;
  52214. function initialize(nativeEventTarget) {
  52215. root = nativeEventTarget;
  52216. startText = getText();
  52217. return true;
  52218. }
  52219. function reset() {
  52220. root = null;
  52221. startText = null;
  52222. fallbackText = null;
  52223. }
  52224. function getData() {
  52225. if (fallbackText) {
  52226. return fallbackText;
  52227. }
  52228. var start;
  52229. var startValue = startText;
  52230. var startLength = startValue.length;
  52231. var end;
  52232. var endValue = getText();
  52233. var endLength = endValue.length;
  52234. for (start = 0; start < startLength; start++) {
  52235. if (startValue[start] !== endValue[start]) {
  52236. break;
  52237. }
  52238. }
  52239. var minEnd = startLength - start;
  52240. for (end = 1; end <= minEnd; end++) {
  52241. if (startValue[startLength - end] !== endValue[endLength - end]) {
  52242. break;
  52243. }
  52244. }
  52245. var sliceTail = end > 1 ? 1 - end : undefined;
  52246. fallbackText = endValue.slice(start, sliceTail);
  52247. return fallbackText;
  52248. }
  52249. function getText() {
  52250. if ('value' in root) {
  52251. return root.value;
  52252. }
  52253. return root.textContent;
  52254. }
  52255. /**
  52256. * @interface Event
  52257. * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
  52258. */
  52259. var SyntheticCompositionEvent = SyntheticEvent.extend({
  52260. data: null
  52261. });
  52262. /**
  52263. * @interface Event
  52264. * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
  52265. * /#events-inputevents
  52266. */
  52267. var SyntheticInputEvent = SyntheticEvent.extend({
  52268. data: null
  52269. });
  52270. var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
  52271. var START_KEYCODE = 229;
  52272. var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
  52273. var documentMode = null;
  52274. if (canUseDOM && 'documentMode' in document) {
  52275. documentMode = document.documentMode;
  52276. } // Webkit offers a very useful `textInput` event that can be used to
  52277. // directly represent `beforeInput`. The IE `textinput` event is not as
  52278. // useful, so we don't use it.
  52279. var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied
  52280. // by the native compositionend event may be incorrect. Japanese ideographic
  52281. // spaces, for instance (\u3000) are not recorded correctly.
  52282. var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
  52283. var SPACEBAR_CODE = 32;
  52284. var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names.
  52285. var eventTypes$1 = {
  52286. beforeInput: {
  52287. phasedRegistrationNames: {
  52288. bubbled: 'onBeforeInput',
  52289. captured: 'onBeforeInputCapture'
  52290. },
  52291. dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
  52292. },
  52293. compositionEnd: {
  52294. phasedRegistrationNames: {
  52295. bubbled: 'onCompositionEnd',
  52296. captured: 'onCompositionEndCapture'
  52297. },
  52298. dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  52299. },
  52300. compositionStart: {
  52301. phasedRegistrationNames: {
  52302. bubbled: 'onCompositionStart',
  52303. captured: 'onCompositionStartCapture'
  52304. },
  52305. dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  52306. },
  52307. compositionUpdate: {
  52308. phasedRegistrationNames: {
  52309. bubbled: 'onCompositionUpdate',
  52310. captured: 'onCompositionUpdateCapture'
  52311. },
  52312. dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  52313. }
  52314. }; // Track whether we've ever handled a keypress on the space key.
  52315. var hasSpaceKeypress = false;
  52316. /**
  52317. * Return whether a native keypress event is assumed to be a command.
  52318. * This is required because Firefox fires `keypress` events for key commands
  52319. * (cut, copy, select-all, etc.) even though no character is inserted.
  52320. */
  52321. function isKeypressCommand(nativeEvent) {
  52322. return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  52323. !(nativeEvent.ctrlKey && nativeEvent.altKey);
  52324. }
  52325. /**
  52326. * Translate native top level events into event types.
  52327. *
  52328. * @param {string} topLevelType
  52329. * @return {object}
  52330. */
  52331. function getCompositionEventType(topLevelType) {
  52332. switch (topLevelType) {
  52333. case TOP_COMPOSITION_START:
  52334. return eventTypes$1.compositionStart;
  52335. case TOP_COMPOSITION_END:
  52336. return eventTypes$1.compositionEnd;
  52337. case TOP_COMPOSITION_UPDATE:
  52338. return eventTypes$1.compositionUpdate;
  52339. }
  52340. }
  52341. /**
  52342. * Does our fallback best-guess model think this event signifies that
  52343. * composition has begun?
  52344. *
  52345. * @param {string} topLevelType
  52346. * @param {object} nativeEvent
  52347. * @return {boolean}
  52348. */
  52349. function isFallbackCompositionStart(topLevelType, nativeEvent) {
  52350. return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
  52351. }
  52352. /**
  52353. * Does our fallback mode think that this event is the end of composition?
  52354. *
  52355. * @param {string} topLevelType
  52356. * @param {object} nativeEvent
  52357. * @return {boolean}
  52358. */
  52359. function isFallbackCompositionEnd(topLevelType, nativeEvent) {
  52360. switch (topLevelType) {
  52361. case TOP_KEY_UP:
  52362. // Command keys insert or clear IME input.
  52363. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
  52364. case TOP_KEY_DOWN:
  52365. // Expect IME keyCode on each keydown. If we get any other
  52366. // code we must have exited earlier.
  52367. return nativeEvent.keyCode !== START_KEYCODE;
  52368. case TOP_KEY_PRESS:
  52369. case TOP_MOUSE_DOWN:
  52370. case TOP_BLUR:
  52371. // Events are not possible without cancelling IME.
  52372. return true;
  52373. default:
  52374. return false;
  52375. }
  52376. }
  52377. /**
  52378. * Google Input Tools provides composition data via a CustomEvent,
  52379. * with the `data` property populated in the `detail` object. If this
  52380. * is available on the event object, use it. If not, this is a plain
  52381. * composition event and we have nothing special to extract.
  52382. *
  52383. * @param {object} nativeEvent
  52384. * @return {?string}
  52385. */
  52386. function getDataFromCustomEvent(nativeEvent) {
  52387. var detail = nativeEvent.detail;
  52388. if (typeof detail === 'object' && 'data' in detail) {
  52389. return detail.data;
  52390. }
  52391. return null;
  52392. }
  52393. /**
  52394. * Check if a composition event was triggered by Korean IME.
  52395. * Our fallback mode does not work well with IE's Korean IME,
  52396. * so just use native composition events when Korean IME is used.
  52397. * Although CompositionEvent.locale property is deprecated,
  52398. * it is available in IE, where our fallback mode is enabled.
  52399. *
  52400. * @param {object} nativeEvent
  52401. * @return {boolean}
  52402. */
  52403. function isUsingKoreanIME(nativeEvent) {
  52404. return nativeEvent.locale === 'ko';
  52405. } // Track the current IME composition status, if any.
  52406. var isComposing = false;
  52407. /**
  52408. * @return {?object} A SyntheticCompositionEvent.
  52409. */
  52410. function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  52411. var eventType;
  52412. var fallbackData;
  52413. if (canUseCompositionEvent) {
  52414. eventType = getCompositionEventType(topLevelType);
  52415. } else if (!isComposing) {
  52416. if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
  52417. eventType = eventTypes$1.compositionStart;
  52418. }
  52419. } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  52420. eventType = eventTypes$1.compositionEnd;
  52421. }
  52422. if (!eventType) {
  52423. return null;
  52424. }
  52425. if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
  52426. // The current composition is stored statically and must not be
  52427. // overwritten while composition continues.
  52428. if (!isComposing && eventType === eventTypes$1.compositionStart) {
  52429. isComposing = initialize(nativeEventTarget);
  52430. } else if (eventType === eventTypes$1.compositionEnd) {
  52431. if (isComposing) {
  52432. fallbackData = getData();
  52433. }
  52434. }
  52435. }
  52436. var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
  52437. if (fallbackData) {
  52438. // Inject data generated from fallback path into the synthetic event.
  52439. // This matches the property of native CompositionEventInterface.
  52440. event.data = fallbackData;
  52441. } else {
  52442. var customData = getDataFromCustomEvent(nativeEvent);
  52443. if (customData !== null) {
  52444. event.data = customData;
  52445. }
  52446. }
  52447. accumulateTwoPhaseDispatches(event);
  52448. return event;
  52449. }
  52450. /**
  52451. * @param {TopLevelType} topLevelType Number from `TopLevelType`.
  52452. * @param {object} nativeEvent Native browser event.
  52453. * @return {?string} The string corresponding to this `beforeInput` event.
  52454. */
  52455. function getNativeBeforeInputChars(topLevelType, nativeEvent) {
  52456. switch (topLevelType) {
  52457. case TOP_COMPOSITION_END:
  52458. return getDataFromCustomEvent(nativeEvent);
  52459. case TOP_KEY_PRESS:
  52460. /**
  52461. * If native `textInput` events are available, our goal is to make
  52462. * use of them. However, there is a special case: the spacebar key.
  52463. * In Webkit, preventing default on a spacebar `textInput` event
  52464. * cancels character insertion, but it *also* causes the browser
  52465. * to fall back to its default spacebar behavior of scrolling the
  52466. * page.
  52467. *
  52468. * Tracking at:
  52469. * https://code.google.com/p/chromium/issues/detail?id=355103
  52470. *
  52471. * To avoid this issue, use the keypress event as if no `textInput`
  52472. * event is available.
  52473. */
  52474. var which = nativeEvent.which;
  52475. if (which !== SPACEBAR_CODE) {
  52476. return null;
  52477. }
  52478. hasSpaceKeypress = true;
  52479. return SPACEBAR_CHAR;
  52480. case TOP_TEXT_INPUT:
  52481. // Record the characters to be added to the DOM.
  52482. var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled
  52483. // it at the keypress level and bail immediately. Android Chrome
  52484. // doesn't give us keycodes, so we need to ignore it.
  52485. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
  52486. return null;
  52487. }
  52488. return chars;
  52489. default:
  52490. // For other native event types, do nothing.
  52491. return null;
  52492. }
  52493. }
  52494. /**
  52495. * For browsers that do not provide the `textInput` event, extract the
  52496. * appropriate string to use for SyntheticInputEvent.
  52497. *
  52498. * @param {number} topLevelType Number from `TopLevelEventTypes`.
  52499. * @param {object} nativeEvent Native browser event.
  52500. * @return {?string} The fallback string for this `beforeInput` event.
  52501. */
  52502. function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
  52503. // If we are currently composing (IME) and using a fallback to do so,
  52504. // try to extract the composed characters from the fallback object.
  52505. // If composition event is available, we extract a string only at
  52506. // compositionevent, otherwise extract it at fallback events.
  52507. if (isComposing) {
  52508. if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  52509. var chars = getData();
  52510. reset();
  52511. isComposing = false;
  52512. return chars;
  52513. }
  52514. return null;
  52515. }
  52516. switch (topLevelType) {
  52517. case TOP_PASTE:
  52518. // If a paste event occurs after a keypress, throw out the input
  52519. // chars. Paste events should not lead to BeforeInput events.
  52520. return null;
  52521. case TOP_KEY_PRESS:
  52522. /**
  52523. * As of v27, Firefox may fire keypress events even when no character
  52524. * will be inserted. A few possibilities:
  52525. *
  52526. * - `which` is `0`. Arrow keys, Esc key, etc.
  52527. *
  52528. * - `which` is the pressed key code, but no char is available.
  52529. * Ex: 'AltGr + d` in Polish. There is no modified character for
  52530. * this key combination and no character is inserted into the
  52531. * document, but FF fires the keypress for char code `100` anyway.
  52532. * No `input` event will occur.
  52533. *
  52534. * - `which` is the pressed key code, but a command combination is
  52535. * being used. Ex: `Cmd+C`. No character is inserted, and no
  52536. * `input` event will occur.
  52537. */
  52538. if (!isKeypressCommand(nativeEvent)) {
  52539. // IE fires the `keypress` event when a user types an emoji via
  52540. // Touch keyboard of Windows. In such a case, the `char` property
  52541. // holds an emoji character like `\uD83D\uDE0A`. Because its length
  52542. // is 2, the property `which` does not represent an emoji correctly.
  52543. // In such a case, we directly return the `char` property instead of
  52544. // using `which`.
  52545. if (nativeEvent.char && nativeEvent.char.length > 1) {
  52546. return nativeEvent.char;
  52547. } else if (nativeEvent.which) {
  52548. return String.fromCharCode(nativeEvent.which);
  52549. }
  52550. }
  52551. return null;
  52552. case TOP_COMPOSITION_END:
  52553. return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
  52554. default:
  52555. return null;
  52556. }
  52557. }
  52558. /**
  52559. * Extract a SyntheticInputEvent for `beforeInput`, based on either native
  52560. * `textInput` or fallback behavior.
  52561. *
  52562. * @return {?object} A SyntheticInputEvent.
  52563. */
  52564. function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  52565. var chars;
  52566. if (canUseTextInputEvent) {
  52567. chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
  52568. } else {
  52569. chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
  52570. } // If no characters are being inserted, no BeforeInput event should
  52571. // be fired.
  52572. if (!chars) {
  52573. return null;
  52574. }
  52575. var event = SyntheticInputEvent.getPooled(eventTypes$1.beforeInput, targetInst, nativeEvent, nativeEventTarget);
  52576. event.data = chars;
  52577. accumulateTwoPhaseDispatches(event);
  52578. return event;
  52579. }
  52580. /**
  52581. * Create an `onBeforeInput` event to match
  52582. * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
  52583. *
  52584. * This event plugin is based on the native `textInput` event
  52585. * available in Chrome, Safari, Opera, and IE. This event fires after
  52586. * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
  52587. *
  52588. * `beforeInput` is spec'd but not implemented in any browsers, and
  52589. * the `input` event does not provide any useful information about what has
  52590. * actually been added, contrary to the spec. Thus, `textInput` is the best
  52591. * available event to identify the characters that have actually been inserted
  52592. * into the target node.
  52593. *
  52594. * This plugin is also responsible for emitting `composition` events, thus
  52595. * allowing us to share composition fallback code for both `beforeInput` and
  52596. * `composition` event types.
  52597. */
  52598. var BeforeInputEventPlugin = {
  52599. eventTypes: eventTypes$1,
  52600. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  52601. var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  52602. var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  52603. if (composition === null) {
  52604. return beforeInput;
  52605. }
  52606. if (beforeInput === null) {
  52607. return composition;
  52608. }
  52609. return [composition, beforeInput];
  52610. }
  52611. };
  52612. /**
  52613. * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
  52614. */
  52615. var supportedInputTypes = {
  52616. color: true,
  52617. date: true,
  52618. datetime: true,
  52619. 'datetime-local': true,
  52620. email: true,
  52621. month: true,
  52622. number: true,
  52623. password: true,
  52624. range: true,
  52625. search: true,
  52626. tel: true,
  52627. text: true,
  52628. time: true,
  52629. url: true,
  52630. week: true
  52631. };
  52632. function isTextInputElement(elem) {
  52633. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  52634. if (nodeName === 'input') {
  52635. return !!supportedInputTypes[elem.type];
  52636. }
  52637. if (nodeName === 'textarea') {
  52638. return true;
  52639. }
  52640. return false;
  52641. }
  52642. var eventTypes$2 = {
  52643. change: {
  52644. phasedRegistrationNames: {
  52645. bubbled: 'onChange',
  52646. captured: 'onChangeCapture'
  52647. },
  52648. dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
  52649. }
  52650. };
  52651. function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
  52652. var event = SyntheticEvent.getPooled(eventTypes$2.change, inst, nativeEvent, target);
  52653. event.type = 'change'; // Flag this event loop as needing state restore.
  52654. enqueueStateRestore(target);
  52655. accumulateTwoPhaseDispatches(event);
  52656. return event;
  52657. }
  52658. /**
  52659. * For IE shims
  52660. */
  52661. var activeElement = null;
  52662. var activeElementInst = null;
  52663. /**
  52664. * SECTION: handle `change` event
  52665. */
  52666. function shouldUseChangeEvent(elem) {
  52667. var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  52668. return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
  52669. }
  52670. function manualDispatchChangeEvent(nativeEvent) {
  52671. var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the
  52672. // other events and have it go through ReactBrowserEventEmitter. Since it
  52673. // doesn't, we manually listen for the events and so we have to enqueue and
  52674. // process the abstract event manually.
  52675. //
  52676. // Batching is necessary here in order to ensure that all event handlers run
  52677. // before the next rerender (including event handlers attached to ancestor
  52678. // elements instead of directly on the input). Without this, controlled
  52679. // components don't work properly in conjunction with event bubbling because
  52680. // the component is rerendered and the value reverted before all the event
  52681. // handlers can run. See https://github.com/facebook/react/issues/708.
  52682. batchedUpdates(runEventInBatch, event);
  52683. }
  52684. function runEventInBatch(event) {
  52685. runEventsInBatch(event);
  52686. }
  52687. function getInstIfValueChanged(targetInst) {
  52688. var targetNode = getNodeFromInstance$1(targetInst);
  52689. if (updateValueIfChanged(targetNode)) {
  52690. return targetInst;
  52691. }
  52692. }
  52693. function getTargetInstForChangeEvent(topLevelType, targetInst) {
  52694. if (topLevelType === TOP_CHANGE) {
  52695. return targetInst;
  52696. }
  52697. }
  52698. /**
  52699. * SECTION: handle `input` event
  52700. */
  52701. var isInputEventSupported = false;
  52702. if (canUseDOM) {
  52703. // IE9 claims to support the input event but fails to trigger it when
  52704. // deleting text, so we ignore its input events.
  52705. isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
  52706. }
  52707. /**
  52708. * (For IE <=9) Starts tracking propertychange events on the passed-in element
  52709. * and override the value property so that we can distinguish user events from
  52710. * value changes in JS.
  52711. */
  52712. function startWatchingForValueChange(target, targetInst) {
  52713. activeElement = target;
  52714. activeElementInst = targetInst;
  52715. activeElement.attachEvent('onpropertychange', handlePropertyChange);
  52716. }
  52717. /**
  52718. * (For IE <=9) Removes the event listeners from the currently-tracked element,
  52719. * if any exists.
  52720. */
  52721. function stopWatchingForValueChange() {
  52722. if (!activeElement) {
  52723. return;
  52724. }
  52725. activeElement.detachEvent('onpropertychange', handlePropertyChange);
  52726. activeElement = null;
  52727. activeElementInst = null;
  52728. }
  52729. /**
  52730. * (For IE <=9) Handles a propertychange event, sending a `change` event if
  52731. * the value of the active element has changed.
  52732. */
  52733. function handlePropertyChange(nativeEvent) {
  52734. if (nativeEvent.propertyName !== 'value') {
  52735. return;
  52736. }
  52737. if (getInstIfValueChanged(activeElementInst)) {
  52738. manualDispatchChangeEvent(nativeEvent);
  52739. }
  52740. }
  52741. function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
  52742. if (topLevelType === TOP_FOCUS) {
  52743. // In IE9, propertychange fires for most input events but is buggy and
  52744. // doesn't fire when text is deleted, but conveniently, selectionchange
  52745. // appears to fire in all of the remaining cases so we catch those and
  52746. // forward the event if the value has changed
  52747. // In either case, we don't want to call the event handler if the value
  52748. // is changed from JS so we redefine a setter for `.value` that updates
  52749. // our activeElementValue variable, allowing us to ignore those changes
  52750. //
  52751. // stopWatching() should be a noop here but we call it just in case we
  52752. // missed a blur event somehow.
  52753. stopWatchingForValueChange();
  52754. startWatchingForValueChange(target, targetInst);
  52755. } else if (topLevelType === TOP_BLUR) {
  52756. stopWatchingForValueChange();
  52757. }
  52758. } // For IE8 and IE9.
  52759. function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
  52760. if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
  52761. // On the selectionchange event, the target is just document which isn't
  52762. // helpful for us so just check activeElement instead.
  52763. //
  52764. // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
  52765. // propertychange on the first input event after setting `value` from a
  52766. // script and fires only keydown, keypress, keyup. Catching keyup usually
  52767. // gets it and catching keydown lets us fire an event for the first
  52768. // keystroke if user does a key repeat (it'll be a little delayed: right
  52769. // before the second keystroke). Other input methods (e.g., paste) seem to
  52770. // fire selectionchange normally.
  52771. return getInstIfValueChanged(activeElementInst);
  52772. }
  52773. }
  52774. /**
  52775. * SECTION: handle `click` event
  52776. */
  52777. function shouldUseClickEvent(elem) {
  52778. // Use the `click` event to detect changes to checkbox and radio inputs.
  52779. // This approach works across all browsers, whereas `change` does not fire
  52780. // until `blur` in IE8.
  52781. var nodeName = elem.nodeName;
  52782. return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
  52783. }
  52784. function getTargetInstForClickEvent(topLevelType, targetInst) {
  52785. if (topLevelType === TOP_CLICK) {
  52786. return getInstIfValueChanged(targetInst);
  52787. }
  52788. }
  52789. function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
  52790. if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
  52791. return getInstIfValueChanged(targetInst);
  52792. }
  52793. }
  52794. function handleControlledInputBlur(node) {
  52795. var state = node._wrapperState;
  52796. if (!state || !state.controlled || node.type !== 'number') {
  52797. return;
  52798. }
  52799. if (!disableInputAttributeSyncing) {
  52800. // If controlled, assign the value attribute to the current value on blur
  52801. setDefaultValue(node, 'number', node.value);
  52802. }
  52803. }
  52804. /**
  52805. * This plugin creates an `onChange` event that normalizes change events
  52806. * across form elements. This event fires at a time when it's possible to
  52807. * change the element's value without seeing a flicker.
  52808. *
  52809. * Supported elements are:
  52810. * - input (see `isTextInputElement`)
  52811. * - textarea
  52812. * - select
  52813. */
  52814. var ChangeEventPlugin = {
  52815. eventTypes: eventTypes$2,
  52816. _isInputEventSupported: isInputEventSupported,
  52817. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  52818. var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
  52819. var getTargetInstFunc, handleEventFunc;
  52820. if (shouldUseChangeEvent(targetNode)) {
  52821. getTargetInstFunc = getTargetInstForChangeEvent;
  52822. } else if (isTextInputElement(targetNode)) {
  52823. if (isInputEventSupported) {
  52824. getTargetInstFunc = getTargetInstForInputOrChangeEvent;
  52825. } else {
  52826. getTargetInstFunc = getTargetInstForInputEventPolyfill;
  52827. handleEventFunc = handleEventsForInputEventPolyfill;
  52828. }
  52829. } else if (shouldUseClickEvent(targetNode)) {
  52830. getTargetInstFunc = getTargetInstForClickEvent;
  52831. }
  52832. if (getTargetInstFunc) {
  52833. var inst = getTargetInstFunc(topLevelType, targetInst);
  52834. if (inst) {
  52835. var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
  52836. return event;
  52837. }
  52838. }
  52839. if (handleEventFunc) {
  52840. handleEventFunc(topLevelType, targetNode, targetInst);
  52841. } // When blurring, set the value attribute for number inputs
  52842. if (topLevelType === TOP_BLUR) {
  52843. handleControlledInputBlur(targetNode);
  52844. }
  52845. }
  52846. };
  52847. /**
  52848. * Module that is injectable into `EventPluginHub`, that specifies a
  52849. * deterministic ordering of `EventPlugin`s. A convenient way to reason about
  52850. * plugins, without having to package every one of them. This is better than
  52851. * having plugins be ordered in the same order that they are injected because
  52852. * that ordering would be influenced by the packaging order.
  52853. * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
  52854. * preventing default on events is convenient in `SimpleEventPlugin` handlers.
  52855. */
  52856. var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
  52857. var eventTypes$3 = {
  52858. mouseEnter: {
  52859. registrationName: 'onMouseEnter',
  52860. dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  52861. },
  52862. mouseLeave: {
  52863. registrationName: 'onMouseLeave',
  52864. dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  52865. },
  52866. pointerEnter: {
  52867. registrationName: 'onPointerEnter',
  52868. dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  52869. },
  52870. pointerLeave: {
  52871. registrationName: 'onPointerLeave',
  52872. dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  52873. }
  52874. }; // We track the lastNativeEvent to ensure that when we encounter
  52875. // cases where we process the same nativeEvent multiple times,
  52876. // which can happen when have multiple ancestors, that we don't
  52877. // duplicate enter
  52878. var lastNativeEvent;
  52879. var EnterLeaveEventPlugin = {
  52880. eventTypes: eventTypes$3,
  52881. /**
  52882. * For almost every interaction we care about, there will be both a top-level
  52883. * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
  52884. * we do not extract duplicate events. However, moving the mouse into the
  52885. * browser from outside will not fire a `mouseout` event. In this case, we use
  52886. * the `mouseover` top-level event.
  52887. */
  52888. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  52889. var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
  52890. var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
  52891. if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
  52892. // If this is an over event with a target, then we've already dispatched
  52893. // the event in the out event of the other target. If this is replayed,
  52894. // then it's because we couldn't dispatch against this target previously
  52895. // so we have to do it now instead.
  52896. return null;
  52897. }
  52898. if (!isOutEvent && !isOverEvent) {
  52899. // Must not be a mouse or pointer in or out - ignoring.
  52900. return null;
  52901. }
  52902. var win;
  52903. if (nativeEventTarget.window === nativeEventTarget) {
  52904. // `nativeEventTarget` is probably a window object.
  52905. win = nativeEventTarget;
  52906. } else {
  52907. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  52908. var doc = nativeEventTarget.ownerDocument;
  52909. if (doc) {
  52910. win = doc.defaultView || doc.parentWindow;
  52911. } else {
  52912. win = window;
  52913. }
  52914. }
  52915. var from;
  52916. var to;
  52917. if (isOutEvent) {
  52918. from = targetInst;
  52919. var related = nativeEvent.relatedTarget || nativeEvent.toElement;
  52920. to = related ? getClosestInstanceFromNode(related) : null;
  52921. if (to !== null) {
  52922. var nearestMounted = getNearestMountedFiber(to);
  52923. if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
  52924. to = null;
  52925. }
  52926. }
  52927. } else {
  52928. // Moving to a node from outside the window.
  52929. from = null;
  52930. to = targetInst;
  52931. }
  52932. if (from === to) {
  52933. // Nothing pertains to our managed components.
  52934. return null;
  52935. }
  52936. var eventInterface, leaveEventType, enterEventType, eventTypePrefix;
  52937. if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
  52938. eventInterface = SyntheticMouseEvent;
  52939. leaveEventType = eventTypes$3.mouseLeave;
  52940. enterEventType = eventTypes$3.mouseEnter;
  52941. eventTypePrefix = 'mouse';
  52942. } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
  52943. eventInterface = SyntheticPointerEvent;
  52944. leaveEventType = eventTypes$3.pointerLeave;
  52945. enterEventType = eventTypes$3.pointerEnter;
  52946. eventTypePrefix = 'pointer';
  52947. }
  52948. var fromNode = from == null ? win : getNodeFromInstance$1(from);
  52949. var toNode = to == null ? win : getNodeFromInstance$1(to);
  52950. var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
  52951. leave.type = eventTypePrefix + 'leave';
  52952. leave.target = fromNode;
  52953. leave.relatedTarget = toNode;
  52954. var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
  52955. enter.type = eventTypePrefix + 'enter';
  52956. enter.target = toNode;
  52957. enter.relatedTarget = fromNode;
  52958. accumulateEnterLeaveDispatches(leave, enter, from, to);
  52959. if (nativeEvent === lastNativeEvent) {
  52960. lastNativeEvent = null;
  52961. return [leave];
  52962. }
  52963. lastNativeEvent = nativeEvent;
  52964. return [leave, enter];
  52965. }
  52966. };
  52967. /**
  52968. * inlined Object.is polyfill to avoid requiring consumers ship their own
  52969. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  52970. */
  52971. function is(x, y) {
  52972. return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  52973. ;
  52974. }
  52975. var is$1 = typeof Object.is === 'function' ? Object.is : is;
  52976. var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  52977. /**
  52978. * Performs equality by iterating through keys on an object and returning false
  52979. * when any key has values which are not strictly equal between the arguments.
  52980. * Returns true when the values of all keys are strictly equal.
  52981. */
  52982. function shallowEqual(objA, objB) {
  52983. if (is$1(objA, objB)) {
  52984. return true;
  52985. }
  52986. if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
  52987. return false;
  52988. }
  52989. var keysA = Object.keys(objA);
  52990. var keysB = Object.keys(objB);
  52991. if (keysA.length !== keysB.length) {
  52992. return false;
  52993. } // Test for A's keys different from B.
  52994. for (var i = 0; i < keysA.length; i++) {
  52995. if (!hasOwnProperty$2.call(objB, keysA[i]) || !is$1(objA[keysA[i]], objB[keysA[i]])) {
  52996. return false;
  52997. }
  52998. }
  52999. return true;
  53000. }
  53001. var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;
  53002. var eventTypes$4 = {
  53003. select: {
  53004. phasedRegistrationNames: {
  53005. bubbled: 'onSelect',
  53006. captured: 'onSelectCapture'
  53007. },
  53008. dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
  53009. }
  53010. };
  53011. var activeElement$1 = null;
  53012. var activeElementInst$1 = null;
  53013. var lastSelection = null;
  53014. var mouseDown = false;
  53015. /**
  53016. * Get an object which is a unique representation of the current selection.
  53017. *
  53018. * The return value will not be consistent across nodes or browsers, but
  53019. * two identical selections on the same node will return identical objects.
  53020. *
  53021. * @param {DOMElement} node
  53022. * @return {object}
  53023. */
  53024. function getSelection$1(node) {
  53025. if ('selectionStart' in node && hasSelectionCapabilities(node)) {
  53026. return {
  53027. start: node.selectionStart,
  53028. end: node.selectionEnd
  53029. };
  53030. } else {
  53031. var win = node.ownerDocument && node.ownerDocument.defaultView || window;
  53032. var selection = win.getSelection();
  53033. return {
  53034. anchorNode: selection.anchorNode,
  53035. anchorOffset: selection.anchorOffset,
  53036. focusNode: selection.focusNode,
  53037. focusOffset: selection.focusOffset
  53038. };
  53039. }
  53040. }
  53041. /**
  53042. * Get document associated with the event target.
  53043. *
  53044. * @param {object} nativeEventTarget
  53045. * @return {Document}
  53046. */
  53047. function getEventTargetDocument(eventTarget) {
  53048. return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
  53049. }
  53050. /**
  53051. * Poll selection to see whether it's changed.
  53052. *
  53053. * @param {object} nativeEvent
  53054. * @param {object} nativeEventTarget
  53055. * @return {?SyntheticEvent}
  53056. */
  53057. function constructSelectEvent(nativeEvent, nativeEventTarget) {
  53058. // Ensure we have the right element, and that the user is not dragging a
  53059. // selection (this matches native `select` event behavior). In HTML5, select
  53060. // fires only on input and textarea thus if there's no focused element we
  53061. // won't dispatch.
  53062. var doc = getEventTargetDocument(nativeEventTarget);
  53063. if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
  53064. return null;
  53065. } // Only fire when selection has actually changed.
  53066. var currentSelection = getSelection$1(activeElement$1);
  53067. if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
  53068. lastSelection = currentSelection;
  53069. var syntheticEvent = SyntheticEvent.getPooled(eventTypes$4.select, activeElementInst$1, nativeEvent, nativeEventTarget);
  53070. syntheticEvent.type = 'select';
  53071. syntheticEvent.target = activeElement$1;
  53072. accumulateTwoPhaseDispatches(syntheticEvent);
  53073. return syntheticEvent;
  53074. }
  53075. return null;
  53076. }
  53077. /**
  53078. * This plugin creates an `onSelect` event that normalizes select events
  53079. * across form elements.
  53080. *
  53081. * Supported elements are:
  53082. * - input (see `isTextInputElement`)
  53083. * - textarea
  53084. * - contentEditable
  53085. *
  53086. * This differs from native browser implementations in the following ways:
  53087. * - Fires on contentEditable fields as well as inputs.
  53088. * - Fires for collapsed selection.
  53089. * - Fires after user input.
  53090. */
  53091. var SelectEventPlugin = {
  53092. eventTypes: eventTypes$4,
  53093. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
  53094. var doc = getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do
  53095. // not extract events. See #3639.
  53096. if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
  53097. return null;
  53098. }
  53099. var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
  53100. switch (topLevelType) {
  53101. // Track the input node that has focus.
  53102. case TOP_FOCUS:
  53103. if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
  53104. activeElement$1 = targetNode;
  53105. activeElementInst$1 = targetInst;
  53106. lastSelection = null;
  53107. }
  53108. break;
  53109. case TOP_BLUR:
  53110. activeElement$1 = null;
  53111. activeElementInst$1 = null;
  53112. lastSelection = null;
  53113. break;
  53114. // Don't fire the event while the user is dragging. This matches the
  53115. // semantics of the native select event.
  53116. case TOP_MOUSE_DOWN:
  53117. mouseDown = true;
  53118. break;
  53119. case TOP_CONTEXT_MENU:
  53120. case TOP_MOUSE_UP:
  53121. case TOP_DRAG_END:
  53122. mouseDown = false;
  53123. return constructSelectEvent(nativeEvent, nativeEventTarget);
  53124. // Chrome and IE fire non-standard event when selection is changed (and
  53125. // sometimes when it hasn't). IE's event fires out of order with respect
  53126. // to key and input events on deletion, so we discard it.
  53127. //
  53128. // Firefox doesn't support selectionchange, so check selection status
  53129. // after each key entry. The selection changes after keydown and before
  53130. // keyup, but we check on keydown as well in the case of holding down a
  53131. // key, when multiple keydown events are fired but only one keyup is.
  53132. // This is also our approach for IE handling, for the reason above.
  53133. case TOP_SELECTION_CHANGE:
  53134. if (skipSelectionChangeEvent) {
  53135. break;
  53136. }
  53137. // falls through
  53138. case TOP_KEY_DOWN:
  53139. case TOP_KEY_UP:
  53140. return constructSelectEvent(nativeEvent, nativeEventTarget);
  53141. }
  53142. return null;
  53143. }
  53144. };
  53145. /**
  53146. * Inject modules for resolving DOM hierarchy and plugin ordering.
  53147. */
  53148. injection.injectEventPluginOrder(DOMEventPluginOrder);
  53149. setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
  53150. /**
  53151. * Some important event plugins included by default (without having to require
  53152. * them).
  53153. */
  53154. injection.injectEventPluginsByName({
  53155. SimpleEventPlugin: SimpleEventPlugin,
  53156. EnterLeaveEventPlugin: EnterLeaveEventPlugin,
  53157. ChangeEventPlugin: ChangeEventPlugin,
  53158. SelectEventPlugin: SelectEventPlugin,
  53159. BeforeInputEventPlugin: BeforeInputEventPlugin
  53160. });
  53161. // Prefix measurements so that it's possible to filter them.
  53162. // Longer prefixes are hard to read in DevTools.
  53163. var reactEmoji = "\u269B";
  53164. var warningEmoji = "\u26D4";
  53165. var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause.
  53166. // TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?
  53167. var currentFiber = null; // If we're in the middle of user code, which fiber and method is it?
  53168. // Reusing `currentFiber` would be confusing for this because user code fiber
  53169. // can change during commit phase too, but we don't need to unwind it (since
  53170. // lifecycles in the commit phase don't resemble a tree).
  53171. var currentPhase = null;
  53172. var currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem,
  53173. // so we will keep track of it, and include it in the report.
  53174. // Track commits caused by cascading updates.
  53175. var isCommitting = false;
  53176. var hasScheduledUpdateInCurrentCommit = false;
  53177. var hasScheduledUpdateInCurrentPhase = false;
  53178. var commitCountInCurrentWorkLoop = 0;
  53179. var effectCountInCurrentCommit = 0;
  53180. // to avoid stretch the commit phase with measurement overhead.
  53181. var labelsInCurrentCommit = new Set();
  53182. var formatMarkName = function (markName) {
  53183. return reactEmoji + " " + markName;
  53184. };
  53185. var formatLabel = function (label, warning) {
  53186. var prefix = warning ? warningEmoji + " " : reactEmoji + " ";
  53187. var suffix = warning ? " Warning: " + warning : '';
  53188. return "" + prefix + label + suffix;
  53189. };
  53190. var beginMark = function (markName) {
  53191. performance.mark(formatMarkName(markName));
  53192. };
  53193. var clearMark = function (markName) {
  53194. performance.clearMarks(formatMarkName(markName));
  53195. };
  53196. var endMark = function (label, markName, warning) {
  53197. var formattedMarkName = formatMarkName(markName);
  53198. var formattedLabel = formatLabel(label, warning);
  53199. try {
  53200. performance.measure(formattedLabel, formattedMarkName);
  53201. } catch (err) {} // If previous mark was missing for some reason, this will throw.
  53202. // This could only happen if React crashed in an unexpected place earlier.
  53203. // Don't pile on with more errors.
  53204. // Clear marks immediately to avoid growing buffer.
  53205. performance.clearMarks(formattedMarkName);
  53206. performance.clearMeasures(formattedLabel);
  53207. };
  53208. var getFiberMarkName = function (label, debugID) {
  53209. return label + " (#" + debugID + ")";
  53210. };
  53211. var getFiberLabel = function (componentName, isMounted, phase) {
  53212. if (phase === null) {
  53213. // These are composite component total time measurements.
  53214. return componentName + " [" + (isMounted ? 'update' : 'mount') + "]";
  53215. } else {
  53216. // Composite component methods.
  53217. return componentName + "." + phase;
  53218. }
  53219. };
  53220. var beginFiberMark = function (fiber, phase) {
  53221. var componentName = getComponentName(fiber.type) || 'Unknown';
  53222. var debugID = fiber._debugID;
  53223. var isMounted = fiber.alternate !== null;
  53224. var label = getFiberLabel(componentName, isMounted, phase);
  53225. if (isCommitting && labelsInCurrentCommit.has(label)) {
  53226. // During the commit phase, we don't show duplicate labels because
  53227. // there is a fixed overhead for every measurement, and we don't
  53228. // want to stretch the commit phase beyond necessary.
  53229. return false;
  53230. }
  53231. labelsInCurrentCommit.add(label);
  53232. var markName = getFiberMarkName(label, debugID);
  53233. beginMark(markName);
  53234. return true;
  53235. };
  53236. var clearFiberMark = function (fiber, phase) {
  53237. var componentName = getComponentName(fiber.type) || 'Unknown';
  53238. var debugID = fiber._debugID;
  53239. var isMounted = fiber.alternate !== null;
  53240. var label = getFiberLabel(componentName, isMounted, phase);
  53241. var markName = getFiberMarkName(label, debugID);
  53242. clearMark(markName);
  53243. };
  53244. var endFiberMark = function (fiber, phase, warning) {
  53245. var componentName = getComponentName(fiber.type) || 'Unknown';
  53246. var debugID = fiber._debugID;
  53247. var isMounted = fiber.alternate !== null;
  53248. var label = getFiberLabel(componentName, isMounted, phase);
  53249. var markName = getFiberMarkName(label, debugID);
  53250. endMark(label, markName, warning);
  53251. };
  53252. var shouldIgnoreFiber = function (fiber) {
  53253. // Host components should be skipped in the timeline.
  53254. // We could check typeof fiber.type, but does this work with RN?
  53255. switch (fiber.tag) {
  53256. case HostRoot:
  53257. case HostComponent:
  53258. case HostText:
  53259. case HostPortal:
  53260. case Fragment:
  53261. case ContextProvider:
  53262. case ContextConsumer:
  53263. case Mode:
  53264. return true;
  53265. default:
  53266. return false;
  53267. }
  53268. };
  53269. var clearPendingPhaseMeasurement = function () {
  53270. if (currentPhase !== null && currentPhaseFiber !== null) {
  53271. clearFiberMark(currentPhaseFiber, currentPhase);
  53272. }
  53273. currentPhaseFiber = null;
  53274. currentPhase = null;
  53275. hasScheduledUpdateInCurrentPhase = false;
  53276. };
  53277. var pauseTimers = function () {
  53278. // Stops all currently active measurements so that they can be resumed
  53279. // if we continue in a later deferred loop from the same unit of work.
  53280. var fiber = currentFiber;
  53281. while (fiber) {
  53282. if (fiber._debugIsCurrentlyTiming) {
  53283. endFiberMark(fiber, null, null);
  53284. }
  53285. fiber = fiber.return;
  53286. }
  53287. };
  53288. var resumeTimersRecursively = function (fiber) {
  53289. if (fiber.return !== null) {
  53290. resumeTimersRecursively(fiber.return);
  53291. }
  53292. if (fiber._debugIsCurrentlyTiming) {
  53293. beginFiberMark(fiber, null);
  53294. }
  53295. };
  53296. var resumeTimers = function () {
  53297. // Resumes all measurements that were active during the last deferred loop.
  53298. if (currentFiber !== null) {
  53299. resumeTimersRecursively(currentFiber);
  53300. }
  53301. };
  53302. function recordEffect() {
  53303. if (enableUserTimingAPI) {
  53304. effectCountInCurrentCommit++;
  53305. }
  53306. }
  53307. function recordScheduleUpdate() {
  53308. if (enableUserTimingAPI) {
  53309. if (isCommitting) {
  53310. hasScheduledUpdateInCurrentCommit = true;
  53311. }
  53312. if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
  53313. hasScheduledUpdateInCurrentPhase = true;
  53314. }
  53315. }
  53316. }
  53317. function startWorkTimer(fiber) {
  53318. if (enableUserTimingAPI) {
  53319. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  53320. return;
  53321. } // If we pause, this is the fiber to unwind from.
  53322. currentFiber = fiber;
  53323. if (!beginFiberMark(fiber, null)) {
  53324. return;
  53325. }
  53326. fiber._debugIsCurrentlyTiming = true;
  53327. }
  53328. }
  53329. function cancelWorkTimer(fiber) {
  53330. if (enableUserTimingAPI) {
  53331. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  53332. return;
  53333. } // Remember we shouldn't complete measurement for this fiber.
  53334. // Otherwise flamechart will be deep even for small updates.
  53335. fiber._debugIsCurrentlyTiming = false;
  53336. clearFiberMark(fiber, null);
  53337. }
  53338. }
  53339. function stopWorkTimer(fiber) {
  53340. if (enableUserTimingAPI) {
  53341. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  53342. return;
  53343. } // If we pause, its parent is the fiber to unwind from.
  53344. currentFiber = fiber.return;
  53345. if (!fiber._debugIsCurrentlyTiming) {
  53346. return;
  53347. }
  53348. fiber._debugIsCurrentlyTiming = false;
  53349. endFiberMark(fiber, null, null);
  53350. }
  53351. }
  53352. function stopFailedWorkTimer(fiber) {
  53353. if (enableUserTimingAPI) {
  53354. if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
  53355. return;
  53356. } // If we pause, its parent is the fiber to unwind from.
  53357. currentFiber = fiber.return;
  53358. if (!fiber._debugIsCurrentlyTiming) {
  53359. return;
  53360. }
  53361. fiber._debugIsCurrentlyTiming = false;
  53362. var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
  53363. endFiberMark(fiber, null, warning);
  53364. }
  53365. }
  53366. function startPhaseTimer(fiber, phase) {
  53367. if (enableUserTimingAPI) {
  53368. if (!supportsUserTiming) {
  53369. return;
  53370. }
  53371. clearPendingPhaseMeasurement();
  53372. if (!beginFiberMark(fiber, phase)) {
  53373. return;
  53374. }
  53375. currentPhaseFiber = fiber;
  53376. currentPhase = phase;
  53377. }
  53378. }
  53379. function stopPhaseTimer() {
  53380. if (enableUserTimingAPI) {
  53381. if (!supportsUserTiming) {
  53382. return;
  53383. }
  53384. if (currentPhase !== null && currentPhaseFiber !== null) {
  53385. var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
  53386. endFiberMark(currentPhaseFiber, currentPhase, warning);
  53387. }
  53388. currentPhase = null;
  53389. currentPhaseFiber = null;
  53390. }
  53391. }
  53392. function startWorkLoopTimer(nextUnitOfWork) {
  53393. if (enableUserTimingAPI) {
  53394. currentFiber = nextUnitOfWork;
  53395. if (!supportsUserTiming) {
  53396. return;
  53397. }
  53398. commitCountInCurrentWorkLoop = 0; // This is top level call.
  53399. // Any other measurements are performed within.
  53400. beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop.
  53401. resumeTimers();
  53402. }
  53403. }
  53404. function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
  53405. if (enableUserTimingAPI) {
  53406. if (!supportsUserTiming) {
  53407. return;
  53408. }
  53409. var warning = null;
  53410. if (interruptedBy !== null) {
  53411. if (interruptedBy.tag === HostRoot) {
  53412. warning = 'A top-level update interrupted the previous render';
  53413. } else {
  53414. var componentName = getComponentName(interruptedBy.type) || 'Unknown';
  53415. warning = "An update to " + componentName + " interrupted the previous render";
  53416. }
  53417. } else if (commitCountInCurrentWorkLoop > 1) {
  53418. warning = 'There were cascading updates';
  53419. }
  53420. commitCountInCurrentWorkLoop = 0;
  53421. var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop.
  53422. pauseTimers();
  53423. endMark(label, '(React Tree Reconciliation)', warning);
  53424. }
  53425. }
  53426. function startCommitTimer() {
  53427. if (enableUserTimingAPI) {
  53428. if (!supportsUserTiming) {
  53429. return;
  53430. }
  53431. isCommitting = true;
  53432. hasScheduledUpdateInCurrentCommit = false;
  53433. labelsInCurrentCommit.clear();
  53434. beginMark('(Committing Changes)');
  53435. }
  53436. }
  53437. function stopCommitTimer() {
  53438. if (enableUserTimingAPI) {
  53439. if (!supportsUserTiming) {
  53440. return;
  53441. }
  53442. var warning = null;
  53443. if (hasScheduledUpdateInCurrentCommit) {
  53444. warning = 'Lifecycle hook scheduled a cascading update';
  53445. } else if (commitCountInCurrentWorkLoop > 0) {
  53446. warning = 'Caused by a cascading update in earlier commit';
  53447. }
  53448. hasScheduledUpdateInCurrentCommit = false;
  53449. commitCountInCurrentWorkLoop++;
  53450. isCommitting = false;
  53451. labelsInCurrentCommit.clear();
  53452. endMark('(Committing Changes)', '(Committing Changes)', warning);
  53453. }
  53454. }
  53455. function startCommitSnapshotEffectsTimer() {
  53456. if (enableUserTimingAPI) {
  53457. if (!supportsUserTiming) {
  53458. return;
  53459. }
  53460. effectCountInCurrentCommit = 0;
  53461. beginMark('(Committing Snapshot Effects)');
  53462. }
  53463. }
  53464. function stopCommitSnapshotEffectsTimer() {
  53465. if (enableUserTimingAPI) {
  53466. if (!supportsUserTiming) {
  53467. return;
  53468. }
  53469. var count = effectCountInCurrentCommit;
  53470. effectCountInCurrentCommit = 0;
  53471. endMark("(Committing Snapshot Effects: " + count + " Total)", '(Committing Snapshot Effects)', null);
  53472. }
  53473. }
  53474. function startCommitHostEffectsTimer() {
  53475. if (enableUserTimingAPI) {
  53476. if (!supportsUserTiming) {
  53477. return;
  53478. }
  53479. effectCountInCurrentCommit = 0;
  53480. beginMark('(Committing Host Effects)');
  53481. }
  53482. }
  53483. function stopCommitHostEffectsTimer() {
  53484. if (enableUserTimingAPI) {
  53485. if (!supportsUserTiming) {
  53486. return;
  53487. }
  53488. var count = effectCountInCurrentCommit;
  53489. effectCountInCurrentCommit = 0;
  53490. endMark("(Committing Host Effects: " + count + " Total)", '(Committing Host Effects)', null);
  53491. }
  53492. }
  53493. function startCommitLifeCyclesTimer() {
  53494. if (enableUserTimingAPI) {
  53495. if (!supportsUserTiming) {
  53496. return;
  53497. }
  53498. effectCountInCurrentCommit = 0;
  53499. beginMark('(Calling Lifecycle Methods)');
  53500. }
  53501. }
  53502. function stopCommitLifeCyclesTimer() {
  53503. if (enableUserTimingAPI) {
  53504. if (!supportsUserTiming) {
  53505. return;
  53506. }
  53507. var count = effectCountInCurrentCommit;
  53508. effectCountInCurrentCommit = 0;
  53509. endMark("(Calling Lifecycle Methods: " + count + " Total)", '(Calling Lifecycle Methods)', null);
  53510. }
  53511. }
  53512. var valueStack = [];
  53513. var fiberStack;
  53514. {
  53515. fiberStack = [];
  53516. }
  53517. var index = -1;
  53518. function createCursor(defaultValue) {
  53519. return {
  53520. current: defaultValue
  53521. };
  53522. }
  53523. function pop(cursor, fiber) {
  53524. if (index < 0) {
  53525. {
  53526. warningWithoutStack$1(false, 'Unexpected pop.');
  53527. }
  53528. return;
  53529. }
  53530. {
  53531. if (fiber !== fiberStack[index]) {
  53532. warningWithoutStack$1(false, 'Unexpected Fiber popped.');
  53533. }
  53534. }
  53535. cursor.current = valueStack[index];
  53536. valueStack[index] = null;
  53537. {
  53538. fiberStack[index] = null;
  53539. }
  53540. index--;
  53541. }
  53542. function push(cursor, value, fiber) {
  53543. index++;
  53544. valueStack[index] = cursor.current;
  53545. {
  53546. fiberStack[index] = fiber;
  53547. }
  53548. cursor.current = value;
  53549. }
  53550. var warnedAboutMissingGetChildContext;
  53551. {
  53552. warnedAboutMissingGetChildContext = {};
  53553. }
  53554. var emptyContextObject = {};
  53555. {
  53556. Object.freeze(emptyContextObject);
  53557. } // A cursor to the current merged context object on the stack.
  53558. var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.
  53559. var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.
  53560. // We use this to get access to the parent context after we have already
  53561. // pushed the next context provider, and now need to merge their contexts.
  53562. var previousContext = emptyContextObject;
  53563. function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
  53564. if (disableLegacyContext) {
  53565. return emptyContextObject;
  53566. } else {
  53567. if (didPushOwnContextIfProvider && isContextProvider(Component)) {
  53568. // If the fiber is a context provider itself, when we read its context
  53569. // we may have already pushed its own child context on the stack. A context
  53570. // provider should not "see" its own child context. Therefore we read the
  53571. // previous (parent) context instead for a context provider.
  53572. return previousContext;
  53573. }
  53574. return contextStackCursor.current;
  53575. }
  53576. }
  53577. function cacheContext(workInProgress, unmaskedContext, maskedContext) {
  53578. if (disableLegacyContext) {
  53579. return;
  53580. } else {
  53581. var instance = workInProgress.stateNode;
  53582. instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
  53583. instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
  53584. }
  53585. }
  53586. function getMaskedContext(workInProgress, unmaskedContext) {
  53587. if (disableLegacyContext) {
  53588. return emptyContextObject;
  53589. } else {
  53590. var type = workInProgress.type;
  53591. var contextTypes = type.contextTypes;
  53592. if (!contextTypes) {
  53593. return emptyContextObject;
  53594. } // Avoid recreating masked context unless unmasked context has changed.
  53595. // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
  53596. // This may trigger infinite loops if componentWillReceiveProps calls setState.
  53597. var instance = workInProgress.stateNode;
  53598. if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
  53599. return instance.__reactInternalMemoizedMaskedChildContext;
  53600. }
  53601. var context = {};
  53602. for (var key in contextTypes) {
  53603. context[key] = unmaskedContext[key];
  53604. }
  53605. {
  53606. var name = getComponentName(type) || 'Unknown';
  53607. checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
  53608. } // Cache unmasked context so we can avoid recreating masked context unless necessary.
  53609. // Context is created before the class component is instantiated so check for instance.
  53610. if (instance) {
  53611. cacheContext(workInProgress, unmaskedContext, context);
  53612. }
  53613. return context;
  53614. }
  53615. }
  53616. function hasContextChanged() {
  53617. if (disableLegacyContext) {
  53618. return false;
  53619. } else {
  53620. return didPerformWorkStackCursor.current;
  53621. }
  53622. }
  53623. function isContextProvider(type) {
  53624. if (disableLegacyContext) {
  53625. return false;
  53626. } else {
  53627. var childContextTypes = type.childContextTypes;
  53628. return childContextTypes !== null && childContextTypes !== undefined;
  53629. }
  53630. }
  53631. function popContext(fiber) {
  53632. if (disableLegacyContext) {
  53633. return;
  53634. } else {
  53635. pop(didPerformWorkStackCursor, fiber);
  53636. pop(contextStackCursor, fiber);
  53637. }
  53638. }
  53639. function popTopLevelContextObject(fiber) {
  53640. if (disableLegacyContext) {
  53641. return;
  53642. } else {
  53643. pop(didPerformWorkStackCursor, fiber);
  53644. pop(contextStackCursor, fiber);
  53645. }
  53646. }
  53647. function pushTopLevelContextObject(fiber, context, didChange) {
  53648. if (disableLegacyContext) {
  53649. return;
  53650. } else {
  53651. if (!(contextStackCursor.current === emptyContextObject)) {
  53652. {
  53653. throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
  53654. }
  53655. }
  53656. push(contextStackCursor, context, fiber);
  53657. push(didPerformWorkStackCursor, didChange, fiber);
  53658. }
  53659. }
  53660. function processChildContext(fiber, type, parentContext) {
  53661. if (disableLegacyContext) {
  53662. return parentContext;
  53663. } else {
  53664. var instance = fiber.stateNode;
  53665. var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.
  53666. // It has only been added in Fiber to match the (unintentional) behavior in Stack.
  53667. if (typeof instance.getChildContext !== 'function') {
  53668. {
  53669. var componentName = getComponentName(type) || 'Unknown';
  53670. if (!warnedAboutMissingGetChildContext[componentName]) {
  53671. warnedAboutMissingGetChildContext[componentName] = true;
  53672. warningWithoutStack$1(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
  53673. }
  53674. }
  53675. return parentContext;
  53676. }
  53677. var childContext;
  53678. {
  53679. setCurrentPhase('getChildContext');
  53680. }
  53681. startPhaseTimer(fiber, 'getChildContext');
  53682. childContext = instance.getChildContext();
  53683. stopPhaseTimer();
  53684. {
  53685. setCurrentPhase(null);
  53686. }
  53687. for (var contextKey in childContext) {
  53688. if (!(contextKey in childContextTypes)) {
  53689. {
  53690. throw Error((getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes.");
  53691. }
  53692. }
  53693. }
  53694. {
  53695. var name = getComponentName(type) || 'Unknown';
  53696. checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when
  53697. // somebody calls unstable_renderSubtreeIntoContainer() and we process
  53698. // context from the parent component instance. The stack will be missing
  53699. // because it's outside of the reconciliation, and so the pointer has not
  53700. // been set. This is rare and doesn't matter. We'll also remove that API.
  53701. getCurrentFiberStackInDev);
  53702. }
  53703. return _assign({}, parentContext, {}, childContext);
  53704. }
  53705. }
  53706. function pushContextProvider(workInProgress) {
  53707. if (disableLegacyContext) {
  53708. return false;
  53709. } else {
  53710. var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.
  53711. // If the instance does not exist yet, we will push null at first,
  53712. // and replace it on the stack later when invalidating the context.
  53713. var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.
  53714. // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
  53715. previousContext = contextStackCursor.current;
  53716. push(contextStackCursor, memoizedMergedChildContext, workInProgress);
  53717. push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
  53718. return true;
  53719. }
  53720. }
  53721. function invalidateContextProvider(workInProgress, type, didChange) {
  53722. if (disableLegacyContext) {
  53723. return;
  53724. } else {
  53725. var instance = workInProgress.stateNode;
  53726. if (!instance) {
  53727. {
  53728. throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
  53729. }
  53730. }
  53731. if (didChange) {
  53732. // Merge parent and own context.
  53733. // Skip this if we're not updating due to sCU.
  53734. // This avoids unnecessarily recomputing memoized values.
  53735. var mergedContext = processChildContext(workInProgress, type, previousContext);
  53736. instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
  53737. // It is important to unwind the context in the reverse order.
  53738. pop(didPerformWorkStackCursor, workInProgress);
  53739. pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.
  53740. push(contextStackCursor, mergedContext, workInProgress);
  53741. push(didPerformWorkStackCursor, didChange, workInProgress);
  53742. } else {
  53743. pop(didPerformWorkStackCursor, workInProgress);
  53744. push(didPerformWorkStackCursor, didChange, workInProgress);
  53745. }
  53746. }
  53747. }
  53748. function findCurrentUnmaskedContext(fiber) {
  53749. if (disableLegacyContext) {
  53750. return emptyContextObject;
  53751. } else {
  53752. // Currently this is only used with renderSubtreeIntoContainer; not sure if it
  53753. // makes sense elsewhere
  53754. if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
  53755. {
  53756. throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
  53757. }
  53758. }
  53759. var node = fiber;
  53760. do {
  53761. switch (node.tag) {
  53762. case HostRoot:
  53763. return node.stateNode.context;
  53764. case ClassComponent:
  53765. {
  53766. var Component = node.type;
  53767. if (isContextProvider(Component)) {
  53768. return node.stateNode.__reactInternalMemoizedMergedChildContext;
  53769. }
  53770. break;
  53771. }
  53772. }
  53773. node = node.return;
  53774. } while (node !== null);
  53775. {
  53776. {
  53777. throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
  53778. }
  53779. }
  53780. }
  53781. }
  53782. var LegacyRoot = 0;
  53783. var BlockingRoot = 1;
  53784. var ConcurrentRoot = 2;
  53785. // Intentionally not named imports because Rollup would use dynamic dispatch for
  53786. // CommonJS interop named imports.
  53787. var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority;
  53788. var Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback;
  53789. var Scheduler_cancelCallback = Scheduler.unstable_cancelCallback;
  53790. var Scheduler_shouldYield = Scheduler.unstable_shouldYield;
  53791. var Scheduler_requestPaint = Scheduler.unstable_requestPaint;
  53792. var Scheduler_now = Scheduler.unstable_now;
  53793. var Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
  53794. var Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority;
  53795. var Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
  53796. var Scheduler_NormalPriority = Scheduler.unstable_NormalPriority;
  53797. var Scheduler_LowPriority = Scheduler.unstable_LowPriority;
  53798. var Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
  53799. if (enableSchedulerTracing) {
  53800. // Provide explicit error message when production+profiling bundle of e.g.
  53801. // react-dom is used with production (non-profiling) bundle of
  53802. // scheduler/tracing
  53803. if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
  53804. {
  53805. throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling");
  53806. }
  53807. }
  53808. }
  53809. var fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use
  53810. // ascending numbers so we can compare them like numbers. They start at 90 to
  53811. // avoid clashing with Scheduler's priorities.
  53812. var ImmediatePriority = 99;
  53813. var UserBlockingPriority$2 = 98;
  53814. var NormalPriority = 97;
  53815. var LowPriority = 96;
  53816. var IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.
  53817. var NoPriority = 90;
  53818. var shouldYield = Scheduler_shouldYield;
  53819. var requestPaint = // Fall back gracefully if we're running an older version of Scheduler.
  53820. Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};
  53821. var syncQueue = null;
  53822. var immediateQueueCallbackNode = null;
  53823. var isFlushingSyncQueue = false;
  53824. var initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.
  53825. // This will be the case for modern browsers that support `performance.now`. In
  53826. // older browsers, Scheduler falls back to `Date.now`, which returns a Unix
  53827. // timestamp. In that case, subtract the module initialization time to simulate
  53828. // the behavior of performance.now and keep our times small enough to fit
  53829. // within 32 bits.
  53830. // TODO: Consider lifting this into Scheduler.
  53831. var now = initialTimeMs < 10000 ? Scheduler_now : function () {
  53832. return Scheduler_now() - initialTimeMs;
  53833. };
  53834. function getCurrentPriorityLevel() {
  53835. switch (Scheduler_getCurrentPriorityLevel()) {
  53836. case Scheduler_ImmediatePriority:
  53837. return ImmediatePriority;
  53838. case Scheduler_UserBlockingPriority:
  53839. return UserBlockingPriority$2;
  53840. case Scheduler_NormalPriority:
  53841. return NormalPriority;
  53842. case Scheduler_LowPriority:
  53843. return LowPriority;
  53844. case Scheduler_IdlePriority:
  53845. return IdlePriority;
  53846. default:
  53847. {
  53848. {
  53849. throw Error("Unknown priority level.");
  53850. }
  53851. }
  53852. }
  53853. }
  53854. function reactPriorityToSchedulerPriority(reactPriorityLevel) {
  53855. switch (reactPriorityLevel) {
  53856. case ImmediatePriority:
  53857. return Scheduler_ImmediatePriority;
  53858. case UserBlockingPriority$2:
  53859. return Scheduler_UserBlockingPriority;
  53860. case NormalPriority:
  53861. return Scheduler_NormalPriority;
  53862. case LowPriority:
  53863. return Scheduler_LowPriority;
  53864. case IdlePriority:
  53865. return Scheduler_IdlePriority;
  53866. default:
  53867. {
  53868. {
  53869. throw Error("Unknown priority level.");
  53870. }
  53871. }
  53872. }
  53873. }
  53874. function runWithPriority$2(reactPriorityLevel, fn) {
  53875. var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  53876. return Scheduler_runWithPriority(priorityLevel, fn);
  53877. }
  53878. function scheduleCallback(reactPriorityLevel, callback, options) {
  53879. var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  53880. return Scheduler_scheduleCallback(priorityLevel, callback, options);
  53881. }
  53882. function scheduleSyncCallback(callback) {
  53883. // Push this callback into an internal queue. We'll flush these either in
  53884. // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
  53885. if (syncQueue === null) {
  53886. syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.
  53887. immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
  53888. } else {
  53889. // Push onto existing queue. Don't need to schedule a callback because
  53890. // we already scheduled one when we created the queue.
  53891. syncQueue.push(callback);
  53892. }
  53893. return fakeCallbackNode;
  53894. }
  53895. function cancelCallback(callbackNode) {
  53896. if (callbackNode !== fakeCallbackNode) {
  53897. Scheduler_cancelCallback(callbackNode);
  53898. }
  53899. }
  53900. function flushSyncCallbackQueue() {
  53901. if (immediateQueueCallbackNode !== null) {
  53902. var node = immediateQueueCallbackNode;
  53903. immediateQueueCallbackNode = null;
  53904. Scheduler_cancelCallback(node);
  53905. }
  53906. flushSyncCallbackQueueImpl();
  53907. }
  53908. function flushSyncCallbackQueueImpl() {
  53909. if (!isFlushingSyncQueue && syncQueue !== null) {
  53910. // Prevent re-entrancy.
  53911. isFlushingSyncQueue = true;
  53912. var i = 0;
  53913. try {
  53914. var _isSync = true;
  53915. var queue = syncQueue;
  53916. runWithPriority$2(ImmediatePriority, function () {
  53917. for (; i < queue.length; i++) {
  53918. var callback = queue[i];
  53919. do {
  53920. callback = callback(_isSync);
  53921. } while (callback !== null);
  53922. }
  53923. });
  53924. syncQueue = null;
  53925. } catch (error) {
  53926. // If something throws, leave the remaining callbacks on the queue.
  53927. if (syncQueue !== null) {
  53928. syncQueue = syncQueue.slice(i + 1);
  53929. } // Resume flushing in the next tick
  53930. Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
  53931. throw error;
  53932. } finally {
  53933. isFlushingSyncQueue = false;
  53934. }
  53935. }
  53936. }
  53937. var NoMode = 0;
  53938. var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
  53939. // tag instead
  53940. var BlockingMode = 2;
  53941. var ConcurrentMode = 4;
  53942. var ProfileMode = 8;
  53943. // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
  53944. // Math.pow(2, 30) - 1
  53945. // 0b111111111111111111111111111111
  53946. var MAX_SIGNED_31_BIT_INT = 1073741823;
  53947. var NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that
  53948. // Never work can be committed in an inconsistent state without tearing the UI.
  53949. // The main example is offscreen content, like a hidden subtree. So one possible
  53950. // name is Offscreen. However, it also includes dehydrated Suspense boundaries,
  53951. // which are inconsistent in the sense that they haven't finished yet, but
  53952. // aren't visibly inconsistent because the server rendered HTML matches what the
  53953. // hydrated tree would look like.
  53954. var Never = 1; // Idle is slightly higher priority than Never. It must completely finish in
  53955. // order to be consistent.
  53956. var Idle = 2; // Continuous Hydration is a moving priority. It is slightly higher than Idle
  53957. // and is used to increase priority of hover targets. It is increasing with
  53958. // each usage so that last always wins.
  53959. var ContinuousHydration = 3;
  53960. var Sync = MAX_SIGNED_31_BIT_INT;
  53961. var Batched = Sync - 1;
  53962. var UNIT_SIZE = 10;
  53963. var MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms.
  53964. function msToExpirationTime(ms) {
  53965. // Always add an offset so that we don't clash with the magic number for NoWork.
  53966. return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
  53967. }
  53968. function expirationTimeToMs(expirationTime) {
  53969. return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
  53970. }
  53971. function ceiling(num, precision) {
  53972. return ((num / precision | 0) + 1) * precision;
  53973. }
  53974. function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
  53975. return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
  53976. } // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update
  53977. // the names to reflect.
  53978. var LOW_PRIORITY_EXPIRATION = 5000;
  53979. var LOW_PRIORITY_BATCH_SIZE = 250;
  53980. function computeAsyncExpiration(currentTime) {
  53981. return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
  53982. }
  53983. function computeSuspenseExpiration(currentTime, timeoutMs) {
  53984. // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?
  53985. return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);
  53986. } // We intentionally set a higher expiration time for interactive updates in
  53987. // dev than in production.
  53988. //
  53989. // If the main thread is being blocked so long that you hit the expiration,
  53990. // it's a problem that could be solved with better scheduling.
  53991. //
  53992. // People will be more likely to notice this and fix it with the long
  53993. // expiration time in development.
  53994. //
  53995. // In production we opt for better UX at the risk of masking scheduling
  53996. // problems, by expiring fast.
  53997. var HIGH_PRIORITY_EXPIRATION = 500;
  53998. var HIGH_PRIORITY_BATCH_SIZE = 100;
  53999. function computeInteractiveExpiration(currentTime) {
  54000. return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
  54001. }
  54002. function computeContinuousHydrationExpiration(currentTime) {
  54003. // Each time we ask for a new one of these we increase the priority.
  54004. // This ensures that the last one always wins since we can't deprioritize
  54005. // once we've scheduled work already.
  54006. return ContinuousHydration++;
  54007. }
  54008. function inferPriorityFromExpirationTime(currentTime, expirationTime) {
  54009. if (expirationTime === Sync) {
  54010. return ImmediatePriority;
  54011. }
  54012. if (expirationTime === Never || expirationTime === Idle) {
  54013. return IdlePriority;
  54014. }
  54015. var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);
  54016. if (msUntil <= 0) {
  54017. return ImmediatePriority;
  54018. }
  54019. if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {
  54020. return UserBlockingPriority$2;
  54021. }
  54022. if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {
  54023. return NormalPriority;
  54024. } // TODO: Handle LowPriority
  54025. // Assume anything lower has idle priority
  54026. return IdlePriority;
  54027. }
  54028. /**
  54029. * Forked from fbjs/warning:
  54030. * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
  54031. *
  54032. * Only change is we use console.warn instead of console.error,
  54033. * and do nothing when 'console' is not supported.
  54034. * This really simplifies the code.
  54035. * ---
  54036. * Similar to invariant but only logs a warning if the condition is not met.
  54037. * This can be used to log issues in development environments in critical
  54038. * paths. Removing the logging code for production environments will keep the
  54039. * same logic and follow the same code paths.
  54040. */
  54041. var lowPriorityWarningWithoutStack = function () {};
  54042. {
  54043. var printWarning = function (format) {
  54044. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  54045. args[_key - 1] = arguments[_key];
  54046. }
  54047. var argIndex = 0;
  54048. var message = 'Warning: ' + format.replace(/%s/g, function () {
  54049. return args[argIndex++];
  54050. });
  54051. if (typeof console !== 'undefined') {
  54052. console.warn(message);
  54053. }
  54054. try {
  54055. // --- Welcome to debugging React ---
  54056. // This error was thrown as a convenience so that you can use this stack
  54057. // to find the callsite that caused this warning to fire.
  54058. throw new Error(message);
  54059. } catch (x) {}
  54060. };
  54061. lowPriorityWarningWithoutStack = function (condition, format) {
  54062. if (format === undefined) {
  54063. throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  54064. }
  54065. if (!condition) {
  54066. for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  54067. args[_key2 - 2] = arguments[_key2];
  54068. }
  54069. printWarning.apply(void 0, [format].concat(args));
  54070. }
  54071. };
  54072. }
  54073. var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
  54074. var ReactStrictModeWarnings = {
  54075. recordUnsafeLifecycleWarnings: function (fiber, instance) {},
  54076. flushPendingUnsafeLifecycleWarnings: function () {},
  54077. recordLegacyContextWarning: function (fiber, instance) {},
  54078. flushLegacyContextWarning: function () {},
  54079. discardPendingWarnings: function () {}
  54080. };
  54081. {
  54082. var findStrictRoot = function (fiber) {
  54083. var maybeStrictRoot = null;
  54084. var node = fiber;
  54085. while (node !== null) {
  54086. if (node.mode & StrictMode) {
  54087. maybeStrictRoot = node;
  54088. }
  54089. node = node.return;
  54090. }
  54091. return maybeStrictRoot;
  54092. };
  54093. var setToSortedString = function (set) {
  54094. var array = [];
  54095. set.forEach(function (value) {
  54096. array.push(value);
  54097. });
  54098. return array.sort().join(', ');
  54099. };
  54100. var pendingComponentWillMountWarnings = [];
  54101. var pendingUNSAFE_ComponentWillMountWarnings = [];
  54102. var pendingComponentWillReceivePropsWarnings = [];
  54103. var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  54104. var pendingComponentWillUpdateWarnings = [];
  54105. var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.
  54106. var didWarnAboutUnsafeLifecycles = new Set();
  54107. ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
  54108. // Dedup strategy: Warn once per component.
  54109. if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
  54110. return;
  54111. }
  54112. if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.
  54113. instance.componentWillMount.__suppressDeprecationWarning !== true) {
  54114. pendingComponentWillMountWarnings.push(fiber);
  54115. }
  54116. if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
  54117. pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
  54118. }
  54119. if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
  54120. pendingComponentWillReceivePropsWarnings.push(fiber);
  54121. }
  54122. if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
  54123. pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
  54124. }
  54125. if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
  54126. pendingComponentWillUpdateWarnings.push(fiber);
  54127. }
  54128. if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
  54129. pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
  54130. }
  54131. };
  54132. ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
  54133. // We do an initial pass to gather component names
  54134. var componentWillMountUniqueNames = new Set();
  54135. if (pendingComponentWillMountWarnings.length > 0) {
  54136. pendingComponentWillMountWarnings.forEach(function (fiber) {
  54137. componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
  54138. didWarnAboutUnsafeLifecycles.add(fiber.type);
  54139. });
  54140. pendingComponentWillMountWarnings = [];
  54141. }
  54142. var UNSAFE_componentWillMountUniqueNames = new Set();
  54143. if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
  54144. pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
  54145. UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
  54146. didWarnAboutUnsafeLifecycles.add(fiber.type);
  54147. });
  54148. pendingUNSAFE_ComponentWillMountWarnings = [];
  54149. }
  54150. var componentWillReceivePropsUniqueNames = new Set();
  54151. if (pendingComponentWillReceivePropsWarnings.length > 0) {
  54152. pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
  54153. componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
  54154. didWarnAboutUnsafeLifecycles.add(fiber.type);
  54155. });
  54156. pendingComponentWillReceivePropsWarnings = [];
  54157. }
  54158. var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
  54159. if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
  54160. pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
  54161. UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
  54162. didWarnAboutUnsafeLifecycles.add(fiber.type);
  54163. });
  54164. pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  54165. }
  54166. var componentWillUpdateUniqueNames = new Set();
  54167. if (pendingComponentWillUpdateWarnings.length > 0) {
  54168. pendingComponentWillUpdateWarnings.forEach(function (fiber) {
  54169. componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
  54170. didWarnAboutUnsafeLifecycles.add(fiber.type);
  54171. });
  54172. pendingComponentWillUpdateWarnings = [];
  54173. }
  54174. var UNSAFE_componentWillUpdateUniqueNames = new Set();
  54175. if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
  54176. pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
  54177. UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
  54178. didWarnAboutUnsafeLifecycles.add(fiber.type);
  54179. });
  54180. pendingUNSAFE_ComponentWillUpdateWarnings = [];
  54181. } // Finally, we flush all the warnings
  54182. // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'
  54183. if (UNSAFE_componentWillMountUniqueNames.size > 0) {
  54184. var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
  54185. warningWithoutStack$1(false, 'Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
  54186. }
  54187. if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
  54188. var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
  54189. warningWithoutStack$1(false, 'Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
  54190. }
  54191. if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
  54192. var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
  54193. warningWithoutStack$1(false, 'Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
  54194. }
  54195. if (componentWillMountUniqueNames.size > 0) {
  54196. var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
  54197. lowPriorityWarningWithoutStack$1(false, 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
  54198. }
  54199. if (componentWillReceivePropsUniqueNames.size > 0) {
  54200. var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
  54201. lowPriorityWarningWithoutStack$1(false, 'componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
  54202. }
  54203. if (componentWillUpdateUniqueNames.size > 0) {
  54204. var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
  54205. lowPriorityWarningWithoutStack$1(false, 'componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
  54206. }
  54207. };
  54208. var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.
  54209. var didWarnAboutLegacyContext = new Set();
  54210. ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
  54211. var strictRoot = findStrictRoot(fiber);
  54212. if (strictRoot === null) {
  54213. warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
  54214. return;
  54215. } // Dedup strategy: Warn once per component.
  54216. if (didWarnAboutLegacyContext.has(fiber.type)) {
  54217. return;
  54218. }
  54219. var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
  54220. if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
  54221. if (warningsForRoot === undefined) {
  54222. warningsForRoot = [];
  54223. pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
  54224. }
  54225. warningsForRoot.push(fiber);
  54226. }
  54227. };
  54228. ReactStrictModeWarnings.flushLegacyContextWarning = function () {
  54229. pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
  54230. var uniqueNames = new Set();
  54231. fiberArray.forEach(function (fiber) {
  54232. uniqueNames.add(getComponentName(fiber.type) || 'Component');
  54233. didWarnAboutLegacyContext.add(fiber.type);
  54234. });
  54235. var sortedNames = setToSortedString(uniqueNames);
  54236. var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);
  54237. warningWithoutStack$1(false, 'Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, strictRootComponentStack);
  54238. });
  54239. };
  54240. ReactStrictModeWarnings.discardPendingWarnings = function () {
  54241. pendingComponentWillMountWarnings = [];
  54242. pendingUNSAFE_ComponentWillMountWarnings = [];
  54243. pendingComponentWillReceivePropsWarnings = [];
  54244. pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
  54245. pendingComponentWillUpdateWarnings = [];
  54246. pendingUNSAFE_ComponentWillUpdateWarnings = [];
  54247. pendingLegacyContextWarning = new Map();
  54248. };
  54249. }
  54250. var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.
  54251. var failedBoundaries = null;
  54252. var setRefreshHandler = function (handler) {
  54253. {
  54254. resolveFamily = handler;
  54255. }
  54256. };
  54257. function resolveFunctionForHotReloading(type) {
  54258. {
  54259. if (resolveFamily === null) {
  54260. // Hot reloading is disabled.
  54261. return type;
  54262. }
  54263. var family = resolveFamily(type);
  54264. if (family === undefined) {
  54265. return type;
  54266. } // Use the latest known implementation.
  54267. return family.current;
  54268. }
  54269. }
  54270. function resolveClassForHotReloading(type) {
  54271. // No implementation differences.
  54272. return resolveFunctionForHotReloading(type);
  54273. }
  54274. function resolveForwardRefForHotReloading(type) {
  54275. {
  54276. if (resolveFamily === null) {
  54277. // Hot reloading is disabled.
  54278. return type;
  54279. }
  54280. var family = resolveFamily(type);
  54281. if (family === undefined) {
  54282. // Check if we're dealing with a real forwardRef. Don't want to crash early.
  54283. if (type !== null && type !== undefined && typeof type.render === 'function') {
  54284. // ForwardRef is special because its resolved .type is an object,
  54285. // but it's possible that we only have its inner render function in the map.
  54286. // If that inner render function is different, we'll build a new forwardRef type.
  54287. var currentRender = resolveFunctionForHotReloading(type.render);
  54288. if (type.render !== currentRender) {
  54289. var syntheticType = {
  54290. $$typeof: REACT_FORWARD_REF_TYPE,
  54291. render: currentRender
  54292. };
  54293. if (type.displayName !== undefined) {
  54294. syntheticType.displayName = type.displayName;
  54295. }
  54296. return syntheticType;
  54297. }
  54298. }
  54299. return type;
  54300. } // Use the latest known implementation.
  54301. return family.current;
  54302. }
  54303. }
  54304. function isCompatibleFamilyForHotReloading(fiber, element) {
  54305. {
  54306. if (resolveFamily === null) {
  54307. // Hot reloading is disabled.
  54308. return false;
  54309. }
  54310. var prevType = fiber.elementType;
  54311. var nextType = element.type; // If we got here, we know types aren't === equal.
  54312. var needsCompareFamilies = false;
  54313. var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;
  54314. switch (fiber.tag) {
  54315. case ClassComponent:
  54316. {
  54317. if (typeof nextType === 'function') {
  54318. needsCompareFamilies = true;
  54319. }
  54320. break;
  54321. }
  54322. case FunctionComponent:
  54323. {
  54324. if (typeof nextType === 'function') {
  54325. needsCompareFamilies = true;
  54326. } else if ($$typeofNextType === REACT_LAZY_TYPE) {
  54327. // We don't know the inner type yet.
  54328. // We're going to assume that the lazy inner type is stable,
  54329. // and so it is sufficient to avoid reconciling it away.
  54330. // We're not going to unwrap or actually use the new lazy type.
  54331. needsCompareFamilies = true;
  54332. }
  54333. break;
  54334. }
  54335. case ForwardRef:
  54336. {
  54337. if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
  54338. needsCompareFamilies = true;
  54339. } else if ($$typeofNextType === REACT_LAZY_TYPE) {
  54340. needsCompareFamilies = true;
  54341. }
  54342. break;
  54343. }
  54344. case MemoComponent:
  54345. case SimpleMemoComponent:
  54346. {
  54347. if ($$typeofNextType === REACT_MEMO_TYPE) {
  54348. // TODO: if it was but can no longer be simple,
  54349. // we shouldn't set this.
  54350. needsCompareFamilies = true;
  54351. } else if ($$typeofNextType === REACT_LAZY_TYPE) {
  54352. needsCompareFamilies = true;
  54353. }
  54354. break;
  54355. }
  54356. default:
  54357. return false;
  54358. } // Check if both types have a family and it's the same one.
  54359. if (needsCompareFamilies) {
  54360. // Note: memo() and forwardRef() we'll compare outer rather than inner type.
  54361. // This means both of them need to be registered to preserve state.
  54362. // If we unwrapped and compared the inner types for wrappers instead,
  54363. // then we would risk falsely saying two separate memo(Foo)
  54364. // calls are equivalent because they wrap the same Foo function.
  54365. var prevFamily = resolveFamily(prevType);
  54366. if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
  54367. return true;
  54368. }
  54369. }
  54370. return false;
  54371. }
  54372. }
  54373. function markFailedErrorBoundaryForHotReloading(fiber) {
  54374. {
  54375. if (resolveFamily === null) {
  54376. // Hot reloading is disabled.
  54377. return;
  54378. }
  54379. if (typeof WeakSet !== 'function') {
  54380. return;
  54381. }
  54382. if (failedBoundaries === null) {
  54383. failedBoundaries = new WeakSet();
  54384. }
  54385. failedBoundaries.add(fiber);
  54386. }
  54387. }
  54388. var scheduleRefresh = function (root, update) {
  54389. {
  54390. if (resolveFamily === null) {
  54391. // Hot reloading is disabled.
  54392. return;
  54393. }
  54394. var staleFamilies = update.staleFamilies,
  54395. updatedFamilies = update.updatedFamilies;
  54396. flushPassiveEffects();
  54397. flushSync(function () {
  54398. scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
  54399. });
  54400. }
  54401. };
  54402. var scheduleRoot = function (root, element) {
  54403. {
  54404. if (root.context !== emptyContextObject) {
  54405. // Super edge case: root has a legacy _renderSubtree context
  54406. // but we don't know the parentComponent so we can't pass it.
  54407. // Just ignore. We'll delete this with _renderSubtree code path later.
  54408. return;
  54409. }
  54410. flushPassiveEffects();
  54411. syncUpdates(function () {
  54412. updateContainer(element, root, null, null);
  54413. });
  54414. }
  54415. };
  54416. function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
  54417. {
  54418. var alternate = fiber.alternate,
  54419. child = fiber.child,
  54420. sibling = fiber.sibling,
  54421. tag = fiber.tag,
  54422. type = fiber.type;
  54423. var candidateType = null;
  54424. switch (tag) {
  54425. case FunctionComponent:
  54426. case SimpleMemoComponent:
  54427. case ClassComponent:
  54428. candidateType = type;
  54429. break;
  54430. case ForwardRef:
  54431. candidateType = type.render;
  54432. break;
  54433. default:
  54434. break;
  54435. }
  54436. if (resolveFamily === null) {
  54437. throw new Error('Expected resolveFamily to be set during hot reload.');
  54438. }
  54439. var needsRender = false;
  54440. var needsRemount = false;
  54441. if (candidateType !== null) {
  54442. var family = resolveFamily(candidateType);
  54443. if (family !== undefined) {
  54444. if (staleFamilies.has(family)) {
  54445. needsRemount = true;
  54446. } else if (updatedFamilies.has(family)) {
  54447. if (tag === ClassComponent) {
  54448. needsRemount = true;
  54449. } else {
  54450. needsRender = true;
  54451. }
  54452. }
  54453. }
  54454. }
  54455. if (failedBoundaries !== null) {
  54456. if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
  54457. needsRemount = true;
  54458. }
  54459. }
  54460. if (needsRemount) {
  54461. fiber._debugNeedsRemount = true;
  54462. }
  54463. if (needsRemount || needsRender) {
  54464. scheduleWork(fiber, Sync);
  54465. }
  54466. if (child !== null && !needsRemount) {
  54467. scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
  54468. }
  54469. if (sibling !== null) {
  54470. scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
  54471. }
  54472. }
  54473. }
  54474. var findHostInstancesForRefresh = function (root, families) {
  54475. {
  54476. var hostInstances = new Set();
  54477. var types = new Set(families.map(function (family) {
  54478. return family.current;
  54479. }));
  54480. findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
  54481. return hostInstances;
  54482. }
  54483. };
  54484. function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
  54485. {
  54486. var child = fiber.child,
  54487. sibling = fiber.sibling,
  54488. tag = fiber.tag,
  54489. type = fiber.type;
  54490. var candidateType = null;
  54491. switch (tag) {
  54492. case FunctionComponent:
  54493. case SimpleMemoComponent:
  54494. case ClassComponent:
  54495. candidateType = type;
  54496. break;
  54497. case ForwardRef:
  54498. candidateType = type.render;
  54499. break;
  54500. default:
  54501. break;
  54502. }
  54503. var didMatch = false;
  54504. if (candidateType !== null) {
  54505. if (types.has(candidateType)) {
  54506. didMatch = true;
  54507. }
  54508. }
  54509. if (didMatch) {
  54510. // We have a match. This only drills down to the closest host components.
  54511. // There's no need to search deeper because for the purpose of giving
  54512. // visual feedback, "flashing" outermost parent rectangles is sufficient.
  54513. findHostInstancesForFiberShallowly(fiber, hostInstances);
  54514. } else {
  54515. // If there's no match, maybe there will be one further down in the child tree.
  54516. if (child !== null) {
  54517. findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
  54518. }
  54519. }
  54520. if (sibling !== null) {
  54521. findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
  54522. }
  54523. }
  54524. }
  54525. function findHostInstancesForFiberShallowly(fiber, hostInstances) {
  54526. {
  54527. var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
  54528. if (foundHostInstances) {
  54529. return;
  54530. } // If we didn't find any host children, fallback to closest host parent.
  54531. var node = fiber;
  54532. while (true) {
  54533. switch (node.tag) {
  54534. case HostComponent:
  54535. hostInstances.add(node.stateNode);
  54536. return;
  54537. case HostPortal:
  54538. hostInstances.add(node.stateNode.containerInfo);
  54539. return;
  54540. case HostRoot:
  54541. hostInstances.add(node.stateNode.containerInfo);
  54542. return;
  54543. }
  54544. if (node.return === null) {
  54545. throw new Error('Expected to reach root first.');
  54546. }
  54547. node = node.return;
  54548. }
  54549. }
  54550. }
  54551. function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
  54552. {
  54553. var node = fiber;
  54554. var foundHostInstances = false;
  54555. while (true) {
  54556. if (node.tag === HostComponent) {
  54557. // We got a match.
  54558. foundHostInstances = true;
  54559. hostInstances.add(node.stateNode); // There may still be more, so keep searching.
  54560. } else if (node.child !== null) {
  54561. node.child.return = node;
  54562. node = node.child;
  54563. continue;
  54564. }
  54565. if (node === fiber) {
  54566. return foundHostInstances;
  54567. }
  54568. while (node.sibling === null) {
  54569. if (node.return === null || node.return === fiber) {
  54570. return foundHostInstances;
  54571. }
  54572. node = node.return;
  54573. }
  54574. node.sibling.return = node.return;
  54575. node = node.sibling;
  54576. }
  54577. }
  54578. return false;
  54579. }
  54580. function resolveDefaultProps(Component, baseProps) {
  54581. if (Component && Component.defaultProps) {
  54582. // Resolve default props. Taken from ReactElement
  54583. var props = _assign({}, baseProps);
  54584. var defaultProps = Component.defaultProps;
  54585. for (var propName in defaultProps) {
  54586. if (props[propName] === undefined) {
  54587. props[propName] = defaultProps[propName];
  54588. }
  54589. }
  54590. return props;
  54591. }
  54592. return baseProps;
  54593. }
  54594. function readLazyComponentType(lazyComponent) {
  54595. initializeLazyComponentType(lazyComponent);
  54596. if (lazyComponent._status !== Resolved) {
  54597. throw lazyComponent._result;
  54598. }
  54599. return lazyComponent._result;
  54600. }
  54601. var valueCursor = createCursor(null);
  54602. var rendererSigil;
  54603. {
  54604. // Use this to detect multiple renderers using the same context
  54605. rendererSigil = {};
  54606. }
  54607. var currentlyRenderingFiber = null;
  54608. var lastContextDependency = null;
  54609. var lastContextWithAllBitsObserved = null;
  54610. var isDisallowedContextReadInDEV = false;
  54611. function resetContextDependencies() {
  54612. // This is called right before React yields execution, to ensure `readContext`
  54613. // cannot be called outside the render phase.
  54614. currentlyRenderingFiber = null;
  54615. lastContextDependency = null;
  54616. lastContextWithAllBitsObserved = null;
  54617. {
  54618. isDisallowedContextReadInDEV = false;
  54619. }
  54620. }
  54621. function enterDisallowedContextReadInDEV() {
  54622. {
  54623. isDisallowedContextReadInDEV = true;
  54624. }
  54625. }
  54626. function exitDisallowedContextReadInDEV() {
  54627. {
  54628. isDisallowedContextReadInDEV = false;
  54629. }
  54630. }
  54631. function pushProvider(providerFiber, nextValue) {
  54632. var context = providerFiber.type._context;
  54633. if (isPrimaryRenderer) {
  54634. push(valueCursor, context._currentValue, providerFiber);
  54635. context._currentValue = nextValue;
  54636. {
  54637. !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
  54638. context._currentRenderer = rendererSigil;
  54639. }
  54640. } else {
  54641. push(valueCursor, context._currentValue2, providerFiber);
  54642. context._currentValue2 = nextValue;
  54643. {
  54644. !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
  54645. context._currentRenderer2 = rendererSigil;
  54646. }
  54647. }
  54648. }
  54649. function popProvider(providerFiber) {
  54650. var currentValue = valueCursor.current;
  54651. pop(valueCursor, providerFiber);
  54652. var context = providerFiber.type._context;
  54653. if (isPrimaryRenderer) {
  54654. context._currentValue = currentValue;
  54655. } else {
  54656. context._currentValue2 = currentValue;
  54657. }
  54658. }
  54659. function calculateChangedBits(context, newValue, oldValue) {
  54660. if (is$1(oldValue, newValue)) {
  54661. // No change
  54662. return 0;
  54663. } else {
  54664. var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
  54665. {
  54666. !((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0;
  54667. }
  54668. return changedBits | 0;
  54669. }
  54670. }
  54671. function scheduleWorkOnParentPath(parent, renderExpirationTime) {
  54672. // Update the child expiration time of all the ancestors, including
  54673. // the alternates.
  54674. var node = parent;
  54675. while (node !== null) {
  54676. var alternate = node.alternate;
  54677. if (node.childExpirationTime < renderExpirationTime) {
  54678. node.childExpirationTime = renderExpirationTime;
  54679. if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
  54680. alternate.childExpirationTime = renderExpirationTime;
  54681. }
  54682. } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
  54683. alternate.childExpirationTime = renderExpirationTime;
  54684. } else {
  54685. // Neither alternate was updated, which means the rest of the
  54686. // ancestor path already has sufficient priority.
  54687. break;
  54688. }
  54689. node = node.return;
  54690. }
  54691. }
  54692. function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
  54693. var fiber = workInProgress.child;
  54694. if (fiber !== null) {
  54695. // Set the return pointer of the child to the work-in-progress fiber.
  54696. fiber.return = workInProgress;
  54697. }
  54698. while (fiber !== null) {
  54699. var nextFiber = void 0; // Visit this fiber.
  54700. var list = fiber.dependencies;
  54701. if (list !== null) {
  54702. nextFiber = fiber.child;
  54703. var dependency = list.firstContext;
  54704. while (dependency !== null) {
  54705. // Check if the context matches.
  54706. if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
  54707. // Match! Schedule an update on this fiber.
  54708. if (fiber.tag === ClassComponent) {
  54709. // Schedule a force update on the work-in-progress.
  54710. var update = createUpdate(renderExpirationTime, null);
  54711. update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the
  54712. // update to the current fiber, too, which means it will persist even if
  54713. // this render is thrown away. Since it's a race condition, not sure it's
  54714. // worth fixing.
  54715. enqueueUpdate(fiber, update);
  54716. }
  54717. if (fiber.expirationTime < renderExpirationTime) {
  54718. fiber.expirationTime = renderExpirationTime;
  54719. }
  54720. var alternate = fiber.alternate;
  54721. if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
  54722. alternate.expirationTime = renderExpirationTime;
  54723. }
  54724. scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too.
  54725. if (list.expirationTime < renderExpirationTime) {
  54726. list.expirationTime = renderExpirationTime;
  54727. } // Since we already found a match, we can stop traversing the
  54728. // dependency list.
  54729. break;
  54730. }
  54731. dependency = dependency.next;
  54732. }
  54733. } else if (fiber.tag === ContextProvider) {
  54734. // Don't scan deeper if this is a matching provider
  54735. nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
  54736. } else if (enableSuspenseServerRenderer && fiber.tag === DehydratedFragment) {
  54737. // If a dehydrated suspense bounudary is in this subtree, we don't know
  54738. // if it will have any context consumers in it. The best we can do is
  54739. // mark it as having updates.
  54740. var parentSuspense = fiber.return;
  54741. if (!(parentSuspense !== null)) {
  54742. {
  54743. throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");
  54744. }
  54745. }
  54746. if (parentSuspense.expirationTime < renderExpirationTime) {
  54747. parentSuspense.expirationTime = renderExpirationTime;
  54748. }
  54749. var _alternate = parentSuspense.alternate;
  54750. if (_alternate !== null && _alternate.expirationTime < renderExpirationTime) {
  54751. _alternate.expirationTime = renderExpirationTime;
  54752. } // This is intentionally passing this fiber as the parent
  54753. // because we want to schedule this fiber as having work
  54754. // on its children. We'll use the childExpirationTime on
  54755. // this fiber to indicate that a context has changed.
  54756. scheduleWorkOnParentPath(parentSuspense, renderExpirationTime);
  54757. nextFiber = fiber.sibling;
  54758. } else {
  54759. // Traverse down.
  54760. nextFiber = fiber.child;
  54761. }
  54762. if (nextFiber !== null) {
  54763. // Set the return pointer of the child to the work-in-progress fiber.
  54764. nextFiber.return = fiber;
  54765. } else {
  54766. // No child. Traverse to next sibling.
  54767. nextFiber = fiber;
  54768. while (nextFiber !== null) {
  54769. if (nextFiber === workInProgress) {
  54770. // We're back to the root of this subtree. Exit.
  54771. nextFiber = null;
  54772. break;
  54773. }
  54774. var sibling = nextFiber.sibling;
  54775. if (sibling !== null) {
  54776. // Set the return pointer of the sibling to the work-in-progress fiber.
  54777. sibling.return = nextFiber.return;
  54778. nextFiber = sibling;
  54779. break;
  54780. } // No more siblings. Traverse up.
  54781. nextFiber = nextFiber.return;
  54782. }
  54783. }
  54784. fiber = nextFiber;
  54785. }
  54786. }
  54787. function prepareToReadContext(workInProgress, renderExpirationTime) {
  54788. currentlyRenderingFiber = workInProgress;
  54789. lastContextDependency = null;
  54790. lastContextWithAllBitsObserved = null;
  54791. var dependencies = workInProgress.dependencies;
  54792. if (dependencies !== null) {
  54793. var firstContext = dependencies.firstContext;
  54794. if (firstContext !== null) {
  54795. if (dependencies.expirationTime >= renderExpirationTime) {
  54796. // Context list has a pending update. Mark that this fiber performed work.
  54797. markWorkInProgressReceivedUpdate();
  54798. } // Reset the work-in-progress list
  54799. dependencies.firstContext = null;
  54800. }
  54801. }
  54802. }
  54803. function readContext(context, observedBits) {
  54804. {
  54805. // This warning would fire if you read context inside a Hook like useMemo.
  54806. // Unlike the class check below, it's not enforced in production for perf.
  54807. !!isDisallowedContextReadInDEV ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
  54808. }
  54809. if (lastContextWithAllBitsObserved === context) {// Nothing to do. We already observe everything in this context.
  54810. } else if (observedBits === false || observedBits === 0) {// Do not observe any updates.
  54811. } else {
  54812. var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.
  54813. if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
  54814. // Observe all updates.
  54815. lastContextWithAllBitsObserved = context;
  54816. resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
  54817. } else {
  54818. resolvedObservedBits = observedBits;
  54819. }
  54820. var contextItem = {
  54821. context: context,
  54822. observedBits: resolvedObservedBits,
  54823. next: null
  54824. };
  54825. if (lastContextDependency === null) {
  54826. if (!(currentlyRenderingFiber !== null)) {
  54827. {
  54828. throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
  54829. }
  54830. } // This is the first dependency for this component. Create a new list.
  54831. lastContextDependency = contextItem;
  54832. currentlyRenderingFiber.dependencies = {
  54833. expirationTime: NoWork,
  54834. firstContext: contextItem,
  54835. responders: null
  54836. };
  54837. } else {
  54838. // Append a new context item.
  54839. lastContextDependency = lastContextDependency.next = contextItem;
  54840. }
  54841. }
  54842. return isPrimaryRenderer ? context._currentValue : context._currentValue2;
  54843. }
  54844. // UpdateQueue is a linked list of prioritized updates.
  54845. //
  54846. // Like fibers, update queues come in pairs: a current queue, which represents
  54847. // the visible state of the screen, and a work-in-progress queue, which can be
  54848. // mutated and processed asynchronously before it is committed — a form of
  54849. // double buffering. If a work-in-progress render is discarded before finishing,
  54850. // we create a new work-in-progress by cloning the current queue.
  54851. //
  54852. // Both queues share a persistent, singly-linked list structure. To schedule an
  54853. // update, we append it to the end of both queues. Each queue maintains a
  54854. // pointer to first update in the persistent list that hasn't been processed.
  54855. // The work-in-progress pointer always has a position equal to or greater than
  54856. // the current queue, since we always work on that one. The current queue's
  54857. // pointer is only updated during the commit phase, when we swap in the
  54858. // work-in-progress.
  54859. //
  54860. // For example:
  54861. //
  54862. // Current pointer: A - B - C - D - E - F
  54863. // Work-in-progress pointer: D - E - F
  54864. // ^
  54865. // The work-in-progress queue has
  54866. // processed more updates than current.
  54867. //
  54868. // The reason we append to both queues is because otherwise we might drop
  54869. // updates without ever processing them. For example, if we only add updates to
  54870. // the work-in-progress queue, some updates could be lost whenever a work-in
  54871. // -progress render restarts by cloning from current. Similarly, if we only add
  54872. // updates to the current queue, the updates will be lost whenever an already
  54873. // in-progress queue commits and swaps with the current queue. However, by
  54874. // adding to both queues, we guarantee that the update will be part of the next
  54875. // work-in-progress. (And because the work-in-progress queue becomes the
  54876. // current queue once it commits, there's no danger of applying the same
  54877. // update twice.)
  54878. //
  54879. // Prioritization
  54880. // --------------
  54881. //
  54882. // Updates are not sorted by priority, but by insertion; new updates are always
  54883. // appended to the end of the list.
  54884. //
  54885. // The priority is still important, though. When processing the update queue
  54886. // during the render phase, only the updates with sufficient priority are
  54887. // included in the result. If we skip an update because it has insufficient
  54888. // priority, it remains in the queue to be processed later, during a lower
  54889. // priority render. Crucially, all updates subsequent to a skipped update also
  54890. // remain in the queue *regardless of their priority*. That means high priority
  54891. // updates are sometimes processed twice, at two separate priorities. We also
  54892. // keep track of a base state, that represents the state before the first
  54893. // update in the queue is applied.
  54894. //
  54895. // For example:
  54896. //
  54897. // Given a base state of '', and the following queue of updates
  54898. //
  54899. // A1 - B2 - C1 - D2
  54900. //
  54901. // where the number indicates the priority, and the update is applied to the
  54902. // previous state by appending a letter, React will process these updates as
  54903. // two separate renders, one per distinct priority level:
  54904. //
  54905. // First render, at priority 1:
  54906. // Base state: ''
  54907. // Updates: [A1, C1]
  54908. // Result state: 'AC'
  54909. //
  54910. // Second render, at priority 2:
  54911. // Base state: 'A' <- The base state does not include C1,
  54912. // because B2 was skipped.
  54913. // Updates: [B2, C1, D2] <- C1 was rebased on top of B2
  54914. // Result state: 'ABCD'
  54915. //
  54916. // Because we process updates in insertion order, and rebase high priority
  54917. // updates when preceding updates are skipped, the final result is deterministic
  54918. // regardless of priority. Intermediate state may vary according to system
  54919. // resources, but the final state is always the same.
  54920. var UpdateState = 0;
  54921. var ReplaceState = 1;
  54922. var ForceUpdate = 2;
  54923. var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.
  54924. // It should only be read right after calling `processUpdateQueue`, via
  54925. // `checkHasForceUpdateAfterProcessing`.
  54926. var hasForceUpdate = false;
  54927. var didWarnUpdateInsideUpdate;
  54928. var currentlyProcessingQueue;
  54929. {
  54930. didWarnUpdateInsideUpdate = false;
  54931. currentlyProcessingQueue = null;
  54932. }
  54933. function createUpdateQueue(baseState) {
  54934. var queue = {
  54935. baseState: baseState,
  54936. firstUpdate: null,
  54937. lastUpdate: null,
  54938. firstCapturedUpdate: null,
  54939. lastCapturedUpdate: null,
  54940. firstEffect: null,
  54941. lastEffect: null,
  54942. firstCapturedEffect: null,
  54943. lastCapturedEffect: null
  54944. };
  54945. return queue;
  54946. }
  54947. function cloneUpdateQueue(currentQueue) {
  54948. var queue = {
  54949. baseState: currentQueue.baseState,
  54950. firstUpdate: currentQueue.firstUpdate,
  54951. lastUpdate: currentQueue.lastUpdate,
  54952. // TODO: With resuming, if we bail out and resuse the child tree, we should
  54953. // keep these effects.
  54954. firstCapturedUpdate: null,
  54955. lastCapturedUpdate: null,
  54956. firstEffect: null,
  54957. lastEffect: null,
  54958. firstCapturedEffect: null,
  54959. lastCapturedEffect: null
  54960. };
  54961. return queue;
  54962. }
  54963. function createUpdate(expirationTime, suspenseConfig) {
  54964. var update = {
  54965. expirationTime: expirationTime,
  54966. suspenseConfig: suspenseConfig,
  54967. tag: UpdateState,
  54968. payload: null,
  54969. callback: null,
  54970. next: null,
  54971. nextEffect: null
  54972. };
  54973. {
  54974. update.priority = getCurrentPriorityLevel();
  54975. }
  54976. return update;
  54977. }
  54978. function appendUpdateToQueue(queue, update) {
  54979. // Append the update to the end of the list.
  54980. if (queue.lastUpdate === null) {
  54981. // Queue is empty
  54982. queue.firstUpdate = queue.lastUpdate = update;
  54983. } else {
  54984. queue.lastUpdate.next = update;
  54985. queue.lastUpdate = update;
  54986. }
  54987. }
  54988. function enqueueUpdate(fiber, update) {
  54989. // Update queues are created lazily.
  54990. var alternate = fiber.alternate;
  54991. var queue1;
  54992. var queue2;
  54993. if (alternate === null) {
  54994. // There's only one fiber.
  54995. queue1 = fiber.updateQueue;
  54996. queue2 = null;
  54997. if (queue1 === null) {
  54998. queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
  54999. }
  55000. } else {
  55001. // There are two owners.
  55002. queue1 = fiber.updateQueue;
  55003. queue2 = alternate.updateQueue;
  55004. if (queue1 === null) {
  55005. if (queue2 === null) {
  55006. // Neither fiber has an update queue. Create new ones.
  55007. queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
  55008. queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState);
  55009. } else {
  55010. // Only one fiber has an update queue. Clone to create a new one.
  55011. queue1 = fiber.updateQueue = cloneUpdateQueue(queue2);
  55012. }
  55013. } else {
  55014. if (queue2 === null) {
  55015. // Only one fiber has an update queue. Clone to create a new one.
  55016. queue2 = alternate.updateQueue = cloneUpdateQueue(queue1);
  55017. } else {// Both owners have an update queue.
  55018. }
  55019. }
  55020. }
  55021. if (queue2 === null || queue1 === queue2) {
  55022. // There's only a single queue.
  55023. appendUpdateToQueue(queue1, update);
  55024. } else {
  55025. // There are two queues. We need to append the update to both queues,
  55026. // while accounting for the persistent structure of the list — we don't
  55027. // want the same update to be added multiple times.
  55028. if (queue1.lastUpdate === null || queue2.lastUpdate === null) {
  55029. // One of the queues is not empty. We must add the update to both queues.
  55030. appendUpdateToQueue(queue1, update);
  55031. appendUpdateToQueue(queue2, update);
  55032. } else {
  55033. // Both queues are non-empty. The last update is the same in both lists,
  55034. // because of structural sharing. So, only append to one of the lists.
  55035. appendUpdateToQueue(queue1, update); // But we still need to update the `lastUpdate` pointer of queue2.
  55036. queue2.lastUpdate = update;
  55037. }
  55038. }
  55039. {
  55040. if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) {
  55041. warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
  55042. didWarnUpdateInsideUpdate = true;
  55043. }
  55044. }
  55045. }
  55046. function enqueueCapturedUpdate(workInProgress, update) {
  55047. // Captured updates go into a separate list, and only on the work-in-
  55048. // progress queue.
  55049. var workInProgressQueue = workInProgress.updateQueue;
  55050. if (workInProgressQueue === null) {
  55051. workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState);
  55052. } else {
  55053. // TODO: I put this here rather than createWorkInProgress so that we don't
  55054. // clone the queue unnecessarily. There's probably a better way to
  55055. // structure this.
  55056. workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue);
  55057. } // Append the update to the end of the list.
  55058. if (workInProgressQueue.lastCapturedUpdate === null) {
  55059. // This is the first render phase update
  55060. workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update;
  55061. } else {
  55062. workInProgressQueue.lastCapturedUpdate.next = update;
  55063. workInProgressQueue.lastCapturedUpdate = update;
  55064. }
  55065. }
  55066. function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
  55067. var current = workInProgress.alternate;
  55068. if (current !== null) {
  55069. // If the work-in-progress queue is equal to the current queue,
  55070. // we need to clone it first.
  55071. if (queue === current.updateQueue) {
  55072. queue = workInProgress.updateQueue = cloneUpdateQueue(queue);
  55073. }
  55074. }
  55075. return queue;
  55076. }
  55077. function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
  55078. switch (update.tag) {
  55079. case ReplaceState:
  55080. {
  55081. var payload = update.payload;
  55082. if (typeof payload === 'function') {
  55083. // Updater function
  55084. {
  55085. enterDisallowedContextReadInDEV();
  55086. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  55087. payload.call(instance, prevState, nextProps);
  55088. }
  55089. }
  55090. var nextState = payload.call(instance, prevState, nextProps);
  55091. {
  55092. exitDisallowedContextReadInDEV();
  55093. }
  55094. return nextState;
  55095. } // State object
  55096. return payload;
  55097. }
  55098. case CaptureUpdate:
  55099. {
  55100. workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
  55101. }
  55102. // Intentional fallthrough
  55103. case UpdateState:
  55104. {
  55105. var _payload = update.payload;
  55106. var partialState;
  55107. if (typeof _payload === 'function') {
  55108. // Updater function
  55109. {
  55110. enterDisallowedContextReadInDEV();
  55111. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  55112. _payload.call(instance, prevState, nextProps);
  55113. }
  55114. }
  55115. partialState = _payload.call(instance, prevState, nextProps);
  55116. {
  55117. exitDisallowedContextReadInDEV();
  55118. }
  55119. } else {
  55120. // Partial state object
  55121. partialState = _payload;
  55122. }
  55123. if (partialState === null || partialState === undefined) {
  55124. // Null and undefined are treated as no-ops.
  55125. return prevState;
  55126. } // Merge the partial state and the previous state.
  55127. return _assign({}, prevState, partialState);
  55128. }
  55129. case ForceUpdate:
  55130. {
  55131. hasForceUpdate = true;
  55132. return prevState;
  55133. }
  55134. }
  55135. return prevState;
  55136. }
  55137. function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) {
  55138. hasForceUpdate = false;
  55139. queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue);
  55140. {
  55141. currentlyProcessingQueue = queue;
  55142. } // These values may change as we process the queue.
  55143. var newBaseState = queue.baseState;
  55144. var newFirstUpdate = null;
  55145. var newExpirationTime = NoWork; // Iterate through the list of updates to compute the result.
  55146. var update = queue.firstUpdate;
  55147. var resultState = newBaseState;
  55148. while (update !== null) {
  55149. var updateExpirationTime = update.expirationTime;
  55150. if (updateExpirationTime < renderExpirationTime) {
  55151. // This update does not have sufficient priority. Skip it.
  55152. if (newFirstUpdate === null) {
  55153. // This is the first skipped update. It will be the first update in
  55154. // the new list.
  55155. newFirstUpdate = update; // Since this is the first update that was skipped, the current result
  55156. // is the new base state.
  55157. newBaseState = resultState;
  55158. } // Since this update will remain in the list, update the remaining
  55159. // expiration time.
  55160. if (newExpirationTime < updateExpirationTime) {
  55161. newExpirationTime = updateExpirationTime;
  55162. }
  55163. } else {
  55164. // This update does have sufficient priority.
  55165. // Mark the event time of this update as relevant to this render pass.
  55166. // TODO: This should ideally use the true event time of this update rather than
  55167. // its priority which is a derived and not reverseable value.
  55168. // TODO: We should skip this update if it was already committed but currently
  55169. // we have no way of detecting the difference between a committed and suspended
  55170. // update here.
  55171. markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process it and compute a new result.
  55172. resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
  55173. var callback = update.callback;
  55174. if (callback !== null) {
  55175. workInProgress.effectTag |= Callback; // Set this to null, in case it was mutated during an aborted render.
  55176. update.nextEffect = null;
  55177. if (queue.lastEffect === null) {
  55178. queue.firstEffect = queue.lastEffect = update;
  55179. } else {
  55180. queue.lastEffect.nextEffect = update;
  55181. queue.lastEffect = update;
  55182. }
  55183. }
  55184. } // Continue to the next update.
  55185. update = update.next;
  55186. } // Separately, iterate though the list of captured updates.
  55187. var newFirstCapturedUpdate = null;
  55188. update = queue.firstCapturedUpdate;
  55189. while (update !== null) {
  55190. var _updateExpirationTime = update.expirationTime;
  55191. if (_updateExpirationTime < renderExpirationTime) {
  55192. // This update does not have sufficient priority. Skip it.
  55193. if (newFirstCapturedUpdate === null) {
  55194. // This is the first skipped captured update. It will be the first
  55195. // update in the new list.
  55196. newFirstCapturedUpdate = update; // If this is the first update that was skipped, the current result is
  55197. // the new base state.
  55198. if (newFirstUpdate === null) {
  55199. newBaseState = resultState;
  55200. }
  55201. } // Since this update will remain in the list, update the remaining
  55202. // expiration time.
  55203. if (newExpirationTime < _updateExpirationTime) {
  55204. newExpirationTime = _updateExpirationTime;
  55205. }
  55206. } else {
  55207. // This update does have sufficient priority. Process it and compute
  55208. // a new result.
  55209. resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
  55210. var _callback = update.callback;
  55211. if (_callback !== null) {
  55212. workInProgress.effectTag |= Callback; // Set this to null, in case it was mutated during an aborted render.
  55213. update.nextEffect = null;
  55214. if (queue.lastCapturedEffect === null) {
  55215. queue.firstCapturedEffect = queue.lastCapturedEffect = update;
  55216. } else {
  55217. queue.lastCapturedEffect.nextEffect = update;
  55218. queue.lastCapturedEffect = update;
  55219. }
  55220. }
  55221. }
  55222. update = update.next;
  55223. }
  55224. if (newFirstUpdate === null) {
  55225. queue.lastUpdate = null;
  55226. }
  55227. if (newFirstCapturedUpdate === null) {
  55228. queue.lastCapturedUpdate = null;
  55229. } else {
  55230. workInProgress.effectTag |= Callback;
  55231. }
  55232. if (newFirstUpdate === null && newFirstCapturedUpdate === null) {
  55233. // We processed every update, without skipping. That means the new base
  55234. // state is the same as the result state.
  55235. newBaseState = resultState;
  55236. }
  55237. queue.baseState = newBaseState;
  55238. queue.firstUpdate = newFirstUpdate;
  55239. queue.firstCapturedUpdate = newFirstCapturedUpdate; // Set the remaining expiration time to be whatever is remaining in the queue.
  55240. // This should be fine because the only two other things that contribute to
  55241. // expiration time are props and context. We're already in the middle of the
  55242. // begin phase by the time we start processing the queue, so we've already
  55243. // dealt with the props. Context in components that specify
  55244. // shouldComponentUpdate is tricky; but we'll have to account for
  55245. // that regardless.
  55246. markUnprocessedUpdateTime(newExpirationTime);
  55247. workInProgress.expirationTime = newExpirationTime;
  55248. workInProgress.memoizedState = resultState;
  55249. {
  55250. currentlyProcessingQueue = null;
  55251. }
  55252. }
  55253. function callCallback(callback, context) {
  55254. if (!(typeof callback === 'function')) {
  55255. {
  55256. throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback);
  55257. }
  55258. }
  55259. callback.call(context);
  55260. }
  55261. function resetHasForceUpdateBeforeProcessing() {
  55262. hasForceUpdate = false;
  55263. }
  55264. function checkHasForceUpdateAfterProcessing() {
  55265. return hasForceUpdate;
  55266. }
  55267. function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) {
  55268. // If the finished render included captured updates, and there are still
  55269. // lower priority updates left over, we need to keep the captured updates
  55270. // in the queue so that they are rebased and not dropped once we process the
  55271. // queue again at the lower priority.
  55272. if (finishedQueue.firstCapturedUpdate !== null) {
  55273. // Join the captured update list to the end of the normal list.
  55274. if (finishedQueue.lastUpdate !== null) {
  55275. finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate;
  55276. finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate;
  55277. } // Clear the list of captured updates.
  55278. finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null;
  55279. } // Commit the effects
  55280. commitUpdateEffects(finishedQueue.firstEffect, instance);
  55281. finishedQueue.firstEffect = finishedQueue.lastEffect = null;
  55282. commitUpdateEffects(finishedQueue.firstCapturedEffect, instance);
  55283. finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null;
  55284. }
  55285. function commitUpdateEffects(effect, instance) {
  55286. while (effect !== null) {
  55287. var callback = effect.callback;
  55288. if (callback !== null) {
  55289. effect.callback = null;
  55290. callCallback(callback, instance);
  55291. }
  55292. effect = effect.nextEffect;
  55293. }
  55294. }
  55295. var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
  55296. function requestCurrentSuspenseConfig() {
  55297. return ReactCurrentBatchConfig.suspense;
  55298. }
  55299. var fakeInternalInstance = {};
  55300. var isArray$1 = Array.isArray; // React.Component uses a shared frozen object by default.
  55301. // We'll use it to determine whether we need to initialize legacy refs.
  55302. var emptyRefsObject = new React.Component().refs;
  55303. var didWarnAboutStateAssignmentForComponent;
  55304. var didWarnAboutUninitializedState;
  55305. var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
  55306. var didWarnAboutLegacyLifecyclesAndDerivedState;
  55307. var didWarnAboutUndefinedDerivedState;
  55308. var warnOnUndefinedDerivedState;
  55309. var warnOnInvalidCallback$1;
  55310. var didWarnAboutDirectlyAssigningPropsToState;
  55311. var didWarnAboutContextTypeAndContextTypes;
  55312. var didWarnAboutInvalidateContextType;
  55313. {
  55314. didWarnAboutStateAssignmentForComponent = new Set();
  55315. didWarnAboutUninitializedState = new Set();
  55316. didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
  55317. didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
  55318. didWarnAboutDirectlyAssigningPropsToState = new Set();
  55319. didWarnAboutUndefinedDerivedState = new Set();
  55320. didWarnAboutContextTypeAndContextTypes = new Set();
  55321. didWarnAboutInvalidateContextType = new Set();
  55322. var didWarnOnInvalidCallback = new Set();
  55323. warnOnInvalidCallback$1 = function (callback, callerName) {
  55324. if (callback === null || typeof callback === 'function') {
  55325. return;
  55326. }
  55327. var key = callerName + "_" + callback;
  55328. if (!didWarnOnInvalidCallback.has(key)) {
  55329. didWarnOnInvalidCallback.add(key);
  55330. warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
  55331. }
  55332. };
  55333. warnOnUndefinedDerivedState = function (type, partialState) {
  55334. if (partialState === undefined) {
  55335. var componentName = getComponentName(type) || 'Component';
  55336. if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
  55337. didWarnAboutUndefinedDerivedState.add(componentName);
  55338. warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
  55339. }
  55340. }
  55341. }; // This is so gross but it's at least non-critical and can be removed if
  55342. // it causes problems. This is meant to give a nicer error message for
  55343. // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
  55344. // ...)) which otherwise throws a "_processChildContext is not a function"
  55345. // exception.
  55346. Object.defineProperty(fakeInternalInstance, '_processChildContext', {
  55347. enumerable: false,
  55348. value: function () {
  55349. {
  55350. {
  55351. throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
  55352. }
  55353. }
  55354. }
  55355. });
  55356. Object.freeze(fakeInternalInstance);
  55357. }
  55358. function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
  55359. var prevState = workInProgress.memoizedState;
  55360. {
  55361. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  55362. // Invoke the function an extra time to help detect side-effects.
  55363. getDerivedStateFromProps(nextProps, prevState);
  55364. }
  55365. }
  55366. var partialState = getDerivedStateFromProps(nextProps, prevState);
  55367. {
  55368. warnOnUndefinedDerivedState(ctor, partialState);
  55369. } // Merge the partial state and the previous state.
  55370. var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
  55371. workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the
  55372. // base state.
  55373. var updateQueue = workInProgress.updateQueue;
  55374. if (updateQueue !== null && workInProgress.expirationTime === NoWork) {
  55375. updateQueue.baseState = memoizedState;
  55376. }
  55377. }
  55378. var classComponentUpdater = {
  55379. isMounted: isMounted,
  55380. enqueueSetState: function (inst, payload, callback) {
  55381. var fiber = get(inst);
  55382. var currentTime = requestCurrentTimeForUpdate();
  55383. var suspenseConfig = requestCurrentSuspenseConfig();
  55384. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  55385. var update = createUpdate(expirationTime, suspenseConfig);
  55386. update.payload = payload;
  55387. if (callback !== undefined && callback !== null) {
  55388. {
  55389. warnOnInvalidCallback$1(callback, 'setState');
  55390. }
  55391. update.callback = callback;
  55392. }
  55393. enqueueUpdate(fiber, update);
  55394. scheduleWork(fiber, expirationTime);
  55395. },
  55396. enqueueReplaceState: function (inst, payload, callback) {
  55397. var fiber = get(inst);
  55398. var currentTime = requestCurrentTimeForUpdate();
  55399. var suspenseConfig = requestCurrentSuspenseConfig();
  55400. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  55401. var update = createUpdate(expirationTime, suspenseConfig);
  55402. update.tag = ReplaceState;
  55403. update.payload = payload;
  55404. if (callback !== undefined && callback !== null) {
  55405. {
  55406. warnOnInvalidCallback$1(callback, 'replaceState');
  55407. }
  55408. update.callback = callback;
  55409. }
  55410. enqueueUpdate(fiber, update);
  55411. scheduleWork(fiber, expirationTime);
  55412. },
  55413. enqueueForceUpdate: function (inst, callback) {
  55414. var fiber = get(inst);
  55415. var currentTime = requestCurrentTimeForUpdate();
  55416. var suspenseConfig = requestCurrentSuspenseConfig();
  55417. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  55418. var update = createUpdate(expirationTime, suspenseConfig);
  55419. update.tag = ForceUpdate;
  55420. if (callback !== undefined && callback !== null) {
  55421. {
  55422. warnOnInvalidCallback$1(callback, 'forceUpdate');
  55423. }
  55424. update.callback = callback;
  55425. }
  55426. enqueueUpdate(fiber, update);
  55427. scheduleWork(fiber, expirationTime);
  55428. }
  55429. };
  55430. function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
  55431. var instance = workInProgress.stateNode;
  55432. if (typeof instance.shouldComponentUpdate === 'function') {
  55433. startPhaseTimer(workInProgress, 'shouldComponentUpdate');
  55434. var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
  55435. stopPhaseTimer();
  55436. {
  55437. !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0;
  55438. }
  55439. return shouldUpdate;
  55440. }
  55441. if (ctor.prototype && ctor.prototype.isPureReactComponent) {
  55442. return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
  55443. }
  55444. return true;
  55445. }
  55446. function checkClassInstance(workInProgress, ctor, newProps) {
  55447. var instance = workInProgress.stateNode;
  55448. {
  55449. var name = getComponentName(ctor) || 'Component';
  55450. var renderPresent = instance.render;
  55451. if (!renderPresent) {
  55452. if (ctor.prototype && typeof ctor.prototype.render === 'function') {
  55453. warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
  55454. } else {
  55455. warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
  55456. }
  55457. }
  55458. var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
  55459. !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0;
  55460. var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
  55461. !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0;
  55462. var noInstancePropTypes = !instance.propTypes;
  55463. !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
  55464. var noInstanceContextType = !instance.contextType;
  55465. !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0;
  55466. if (disableLegacyContext) {
  55467. if (ctor.childContextTypes) {
  55468. warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', name);
  55469. }
  55470. if (ctor.contextTypes) {
  55471. warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', name);
  55472. }
  55473. } else {
  55474. var noInstanceContextTypes = !instance.contextTypes;
  55475. !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;
  55476. if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
  55477. didWarnAboutContextTypeAndContextTypes.add(ctor);
  55478. warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
  55479. }
  55480. }
  55481. var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
  55482. !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0;
  55483. if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
  55484. warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
  55485. }
  55486. var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
  55487. !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
  55488. var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
  55489. !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0;
  55490. var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
  55491. !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
  55492. var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function';
  55493. !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0;
  55494. var hasMutatedProps = instance.props !== newProps;
  55495. !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0;
  55496. var noInstanceDefaultProps = !instance.defaultProps;
  55497. !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0;
  55498. if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
  55499. didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
  55500. warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
  55501. }
  55502. var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function';
  55503. !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
  55504. var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function';
  55505. !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
  55506. var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function';
  55507. !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0;
  55508. var _state = instance.state;
  55509. if (_state && (typeof _state !== 'object' || isArray$1(_state))) {
  55510. warningWithoutStack$1(false, '%s.state: must be set to an object or null', name);
  55511. }
  55512. if (typeof instance.getChildContext === 'function') {
  55513. !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0;
  55514. }
  55515. }
  55516. }
  55517. function adoptClassInstance(workInProgress, instance) {
  55518. instance.updater = classComponentUpdater;
  55519. workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates
  55520. set(instance, workInProgress);
  55521. {
  55522. instance._reactInternalInstance = fakeInternalInstance;
  55523. }
  55524. }
  55525. function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) {
  55526. var isLegacyContextConsumer = false;
  55527. var unmaskedContext = emptyContextObject;
  55528. var context = emptyContextObject;
  55529. var contextType = ctor.contextType;
  55530. {
  55531. if ('contextType' in ctor) {
  55532. var isValid = // Allow null for conditional declaration
  55533. contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>
  55534. if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
  55535. didWarnAboutInvalidateContextType.add(ctor);
  55536. var addendum = '';
  55537. if (contextType === undefined) {
  55538. addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
  55539. } else if (typeof contextType !== 'object') {
  55540. addendum = ' However, it is set to a ' + typeof contextType + '.';
  55541. } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
  55542. addendum = ' Did you accidentally pass the Context.Provider instead?';
  55543. } else if (contextType._context !== undefined) {
  55544. // <Context.Consumer>
  55545. addendum = ' Did you accidentally pass the Context.Consumer instead?';
  55546. } else {
  55547. addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
  55548. }
  55549. warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
  55550. }
  55551. }
  55552. }
  55553. if (typeof contextType === 'object' && contextType !== null) {
  55554. context = readContext(contextType);
  55555. } else if (!disableLegacyContext) {
  55556. unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  55557. var contextTypes = ctor.contextTypes;
  55558. isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
  55559. context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
  55560. } // Instantiate twice to help detect side-effects.
  55561. {
  55562. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  55563. new ctor(props, context); // eslint-disable-line no-new
  55564. }
  55565. }
  55566. var instance = new ctor(props, context);
  55567. var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
  55568. adoptClassInstance(workInProgress, instance);
  55569. {
  55570. if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
  55571. var componentName = getComponentName(ctor) || 'Component';
  55572. if (!didWarnAboutUninitializedState.has(componentName)) {
  55573. didWarnAboutUninitializedState.add(componentName);
  55574. warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
  55575. }
  55576. } // If new component APIs are defined, "unsafe" lifecycles won't be called.
  55577. // Warn about these lifecycles if they are present.
  55578. // Don't warn about react-lifecycles-compat polyfilled methods though.
  55579. if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
  55580. var foundWillMountName = null;
  55581. var foundWillReceivePropsName = null;
  55582. var foundWillUpdateName = null;
  55583. if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
  55584. foundWillMountName = 'componentWillMount';
  55585. } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
  55586. foundWillMountName = 'UNSAFE_componentWillMount';
  55587. }
  55588. if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
  55589. foundWillReceivePropsName = 'componentWillReceiveProps';
  55590. } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
  55591. foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
  55592. }
  55593. if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
  55594. foundWillUpdateName = 'componentWillUpdate';
  55595. } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
  55596. foundWillUpdateName = 'UNSAFE_componentWillUpdate';
  55597. }
  55598. if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
  55599. var _componentName = getComponentName(ctor) || 'Component';
  55600. var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
  55601. if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
  55602. didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
  55603. warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : '');
  55604. }
  55605. }
  55606. }
  55607. } // Cache unmasked context so we can avoid recreating masked context unless necessary.
  55608. // ReactFiberContext usually updates this cache but can't for newly-created instances.
  55609. if (isLegacyContextConsumer) {
  55610. cacheContext(workInProgress, unmaskedContext, context);
  55611. }
  55612. return instance;
  55613. }
  55614. function callComponentWillMount(workInProgress, instance) {
  55615. startPhaseTimer(workInProgress, 'componentWillMount');
  55616. var oldState = instance.state;
  55617. if (typeof instance.componentWillMount === 'function') {
  55618. instance.componentWillMount();
  55619. }
  55620. if (typeof instance.UNSAFE_componentWillMount === 'function') {
  55621. instance.UNSAFE_componentWillMount();
  55622. }
  55623. stopPhaseTimer();
  55624. if (oldState !== instance.state) {
  55625. {
  55626. warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
  55627. }
  55628. classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  55629. }
  55630. }
  55631. function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
  55632. var oldState = instance.state;
  55633. startPhaseTimer(workInProgress, 'componentWillReceiveProps');
  55634. if (typeof instance.componentWillReceiveProps === 'function') {
  55635. instance.componentWillReceiveProps(newProps, nextContext);
  55636. }
  55637. if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
  55638. instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  55639. }
  55640. stopPhaseTimer();
  55641. if (instance.state !== oldState) {
  55642. {
  55643. var componentName = getComponentName(workInProgress.type) || 'Component';
  55644. if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
  55645. didWarnAboutStateAssignmentForComponent.add(componentName);
  55646. warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
  55647. }
  55648. }
  55649. classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  55650. }
  55651. } // Invokes the mount life-cycles on a previously never rendered instance.
  55652. function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  55653. {
  55654. checkClassInstance(workInProgress, ctor, newProps);
  55655. }
  55656. var instance = workInProgress.stateNode;
  55657. instance.props = newProps;
  55658. instance.state = workInProgress.memoizedState;
  55659. instance.refs = emptyRefsObject;
  55660. var contextType = ctor.contextType;
  55661. if (typeof contextType === 'object' && contextType !== null) {
  55662. instance.context = readContext(contextType);
  55663. } else if (disableLegacyContext) {
  55664. instance.context = emptyContextObject;
  55665. } else {
  55666. var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  55667. instance.context = getMaskedContext(workInProgress, unmaskedContext);
  55668. }
  55669. {
  55670. if (instance.state === newProps) {
  55671. var componentName = getComponentName(ctor) || 'Component';
  55672. if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
  55673. didWarnAboutDirectlyAssigningPropsToState.add(componentName);
  55674. warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
  55675. }
  55676. }
  55677. if (workInProgress.mode & StrictMode) {
  55678. ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
  55679. }
  55680. if (warnAboutDeprecatedLifecycles) {
  55681. ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
  55682. }
  55683. }
  55684. var updateQueue = workInProgress.updateQueue;
  55685. if (updateQueue !== null) {
  55686. processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
  55687. instance.state = workInProgress.memoizedState;
  55688. }
  55689. var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  55690. if (typeof getDerivedStateFromProps === 'function') {
  55691. applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
  55692. instance.state = workInProgress.memoizedState;
  55693. } // In order to support react-lifecycles-compat polyfilled components,
  55694. // Unsafe lifecycles should not be invoked for components using the new APIs.
  55695. if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
  55696. callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's
  55697. // process them now.
  55698. updateQueue = workInProgress.updateQueue;
  55699. if (updateQueue !== null) {
  55700. processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
  55701. instance.state = workInProgress.memoizedState;
  55702. }
  55703. }
  55704. if (typeof instance.componentDidMount === 'function') {
  55705. workInProgress.effectTag |= Update;
  55706. }
  55707. }
  55708. function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  55709. var instance = workInProgress.stateNode;
  55710. var oldProps = workInProgress.memoizedProps;
  55711. instance.props = oldProps;
  55712. var oldContext = instance.context;
  55713. var contextType = ctor.contextType;
  55714. var nextContext = emptyContextObject;
  55715. if (typeof contextType === 'object' && contextType !== null) {
  55716. nextContext = readContext(contextType);
  55717. } else if (!disableLegacyContext) {
  55718. var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  55719. nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
  55720. }
  55721. var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  55722. var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  55723. // ever the previously attempted to render - not the "current". However,
  55724. // during componentDidUpdate we pass the "current" props.
  55725. // In order to support react-lifecycles-compat polyfilled components,
  55726. // Unsafe lifecycles should not be invoked for components using the new APIs.
  55727. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
  55728. if (oldProps !== newProps || oldContext !== nextContext) {
  55729. callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
  55730. }
  55731. }
  55732. resetHasForceUpdateBeforeProcessing();
  55733. var oldState = workInProgress.memoizedState;
  55734. var newState = instance.state = oldState;
  55735. var updateQueue = workInProgress.updateQueue;
  55736. if (updateQueue !== null) {
  55737. processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
  55738. newState = workInProgress.memoizedState;
  55739. }
  55740. if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
  55741. // If an update was already in progress, we should schedule an Update
  55742. // effect even though we're bailing out, so that cWU/cDU are called.
  55743. if (typeof instance.componentDidMount === 'function') {
  55744. workInProgress.effectTag |= Update;
  55745. }
  55746. return false;
  55747. }
  55748. if (typeof getDerivedStateFromProps === 'function') {
  55749. applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
  55750. newState = workInProgress.memoizedState;
  55751. }
  55752. var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
  55753. if (shouldUpdate) {
  55754. // In order to support react-lifecycles-compat polyfilled components,
  55755. // Unsafe lifecycles should not be invoked for components using the new APIs.
  55756. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
  55757. startPhaseTimer(workInProgress, 'componentWillMount');
  55758. if (typeof instance.componentWillMount === 'function') {
  55759. instance.componentWillMount();
  55760. }
  55761. if (typeof instance.UNSAFE_componentWillMount === 'function') {
  55762. instance.UNSAFE_componentWillMount();
  55763. }
  55764. stopPhaseTimer();
  55765. }
  55766. if (typeof instance.componentDidMount === 'function') {
  55767. workInProgress.effectTag |= Update;
  55768. }
  55769. } else {
  55770. // If an update was already in progress, we should schedule an Update
  55771. // effect even though we're bailing out, so that cWU/cDU are called.
  55772. if (typeof instance.componentDidMount === 'function') {
  55773. workInProgress.effectTag |= Update;
  55774. } // If shouldComponentUpdate returned false, we should still update the
  55775. // memoized state to indicate that this work can be reused.
  55776. workInProgress.memoizedProps = newProps;
  55777. workInProgress.memoizedState = newState;
  55778. } // Update the existing instance's state, props, and context pointers even
  55779. // if shouldComponentUpdate returns false.
  55780. instance.props = newProps;
  55781. instance.state = newState;
  55782. instance.context = nextContext;
  55783. return shouldUpdate;
  55784. } // Invokes the update life-cycles and returns false if it shouldn't rerender.
  55785. function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
  55786. var instance = workInProgress.stateNode;
  55787. var oldProps = workInProgress.memoizedProps;
  55788. instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);
  55789. var oldContext = instance.context;
  55790. var contextType = ctor.contextType;
  55791. var nextContext = emptyContextObject;
  55792. if (typeof contextType === 'object' && contextType !== null) {
  55793. nextContext = readContext(contextType);
  55794. } else if (!disableLegacyContext) {
  55795. var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
  55796. nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
  55797. }
  55798. var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  55799. var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
  55800. // ever the previously attempted to render - not the "current". However,
  55801. // during componentDidUpdate we pass the "current" props.
  55802. // In order to support react-lifecycles-compat polyfilled components,
  55803. // Unsafe lifecycles should not be invoked for components using the new APIs.
  55804. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
  55805. if (oldProps !== newProps || oldContext !== nextContext) {
  55806. callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
  55807. }
  55808. }
  55809. resetHasForceUpdateBeforeProcessing();
  55810. var oldState = workInProgress.memoizedState;
  55811. var newState = instance.state = oldState;
  55812. var updateQueue = workInProgress.updateQueue;
  55813. if (updateQueue !== null) {
  55814. processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
  55815. newState = workInProgress.memoizedState;
  55816. }
  55817. if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
  55818. // If an update was already in progress, we should schedule an Update
  55819. // effect even though we're bailing out, so that cWU/cDU are called.
  55820. if (typeof instance.componentDidUpdate === 'function') {
  55821. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  55822. workInProgress.effectTag |= Update;
  55823. }
  55824. }
  55825. if (typeof instance.getSnapshotBeforeUpdate === 'function') {
  55826. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  55827. workInProgress.effectTag |= Snapshot;
  55828. }
  55829. }
  55830. return false;
  55831. }
  55832. if (typeof getDerivedStateFromProps === 'function') {
  55833. applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
  55834. newState = workInProgress.memoizedState;
  55835. }
  55836. var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
  55837. if (shouldUpdate) {
  55838. // In order to support react-lifecycles-compat polyfilled components,
  55839. // Unsafe lifecycles should not be invoked for components using the new APIs.
  55840. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
  55841. startPhaseTimer(workInProgress, 'componentWillUpdate');
  55842. if (typeof instance.componentWillUpdate === 'function') {
  55843. instance.componentWillUpdate(newProps, newState, nextContext);
  55844. }
  55845. if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
  55846. instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
  55847. }
  55848. stopPhaseTimer();
  55849. }
  55850. if (typeof instance.componentDidUpdate === 'function') {
  55851. workInProgress.effectTag |= Update;
  55852. }
  55853. if (typeof instance.getSnapshotBeforeUpdate === 'function') {
  55854. workInProgress.effectTag |= Snapshot;
  55855. }
  55856. } else {
  55857. // If an update was already in progress, we should schedule an Update
  55858. // effect even though we're bailing out, so that cWU/cDU are called.
  55859. if (typeof instance.componentDidUpdate === 'function') {
  55860. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  55861. workInProgress.effectTag |= Update;
  55862. }
  55863. }
  55864. if (typeof instance.getSnapshotBeforeUpdate === 'function') {
  55865. if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
  55866. workInProgress.effectTag |= Snapshot;
  55867. }
  55868. } // If shouldComponentUpdate returned false, we should still update the
  55869. // memoized props/state to indicate that this work can be reused.
  55870. workInProgress.memoizedProps = newProps;
  55871. workInProgress.memoizedState = newState;
  55872. } // Update the existing instance's state, props, and context pointers even
  55873. // if shouldComponentUpdate returns false.
  55874. instance.props = newProps;
  55875. instance.state = newState;
  55876. instance.context = nextContext;
  55877. return shouldUpdate;
  55878. }
  55879. var didWarnAboutMaps;
  55880. var didWarnAboutGenerators;
  55881. var didWarnAboutStringRefs;
  55882. var ownerHasKeyUseWarning;
  55883. var ownerHasFunctionTypeWarning;
  55884. var warnForMissingKey = function (child) {};
  55885. {
  55886. didWarnAboutMaps = false;
  55887. didWarnAboutGenerators = false;
  55888. didWarnAboutStringRefs = {};
  55889. /**
  55890. * Warn if there's no key explicitly set on dynamic arrays of children or
  55891. * object keys are not valid. This allows us to keep track of children between
  55892. * updates.
  55893. */
  55894. ownerHasKeyUseWarning = {};
  55895. ownerHasFunctionTypeWarning = {};
  55896. warnForMissingKey = function (child) {
  55897. if (child === null || typeof child !== 'object') {
  55898. return;
  55899. }
  55900. if (!child._store || child._store.validated || child.key != null) {
  55901. return;
  55902. }
  55903. if (!(typeof child._store === 'object')) {
  55904. {
  55905. throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
  55906. }
  55907. }
  55908. child._store.validated = true;
  55909. var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
  55910. if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
  55911. return;
  55912. }
  55913. ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
  55914. warning$1(false, 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
  55915. };
  55916. }
  55917. var isArray = Array.isArray;
  55918. function coerceRef(returnFiber, current$$1, element) {
  55919. var mixedRef = element.ref;
  55920. if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
  55921. {
  55922. // TODO: Clean this up once we turn on the string ref warning for
  55923. // everyone, because the strict mode case will no longer be relevant
  55924. if (returnFiber.mode & StrictMode || warnAboutStringRefs) {
  55925. var componentName = getComponentName(returnFiber.type) || 'Component';
  55926. if (!didWarnAboutStringRefs[componentName]) {
  55927. if (warnAboutStringRefs) {
  55928. warningWithoutStack$1(false, 'Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', componentName, mixedRef, getStackByFiberInDevAndProd(returnFiber));
  55929. } else {
  55930. warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));
  55931. }
  55932. didWarnAboutStringRefs[componentName] = true;
  55933. }
  55934. }
  55935. }
  55936. if (element._owner) {
  55937. var owner = element._owner;
  55938. var inst;
  55939. if (owner) {
  55940. var ownerFiber = owner;
  55941. if (!(ownerFiber.tag === ClassComponent)) {
  55942. {
  55943. throw Error("Function components cannot have refs. Did you mean to use React.forwardRef()?");
  55944. }
  55945. }
  55946. inst = ownerFiber.stateNode;
  55947. }
  55948. if (!inst) {
  55949. {
  55950. throw Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
  55951. }
  55952. }
  55953. var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref
  55954. if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) {
  55955. return current$$1.ref;
  55956. }
  55957. var ref = function (value) {
  55958. var refs = inst.refs;
  55959. if (refs === emptyRefsObject) {
  55960. // This is a lazy pooled frozen object, so we need to initialize.
  55961. refs = inst.refs = {};
  55962. }
  55963. if (value === null) {
  55964. delete refs[stringRef];
  55965. } else {
  55966. refs[stringRef] = value;
  55967. }
  55968. };
  55969. ref._stringRef = stringRef;
  55970. return ref;
  55971. } else {
  55972. if (!(typeof mixedRef === 'string')) {
  55973. {
  55974. throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
  55975. }
  55976. }
  55977. if (!element._owner) {
  55978. {
  55979. throw Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.");
  55980. }
  55981. }
  55982. }
  55983. }
  55984. return mixedRef;
  55985. }
  55986. function throwOnInvalidObjectType(returnFiber, newChild) {
  55987. if (returnFiber.type !== 'textarea') {
  55988. var addendum = '';
  55989. {
  55990. addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
  55991. }
  55992. {
  55993. {
  55994. throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + ")." + addendum);
  55995. }
  55996. }
  55997. }
  55998. }
  55999. function warnOnFunctionType() {
  56000. var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();
  56001. if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
  56002. return;
  56003. }
  56004. ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
  56005. warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
  56006. } // This wrapper function exists because I expect to clone the code in each path
  56007. // to be able to optimize each path individually by branching early. This needs
  56008. // a compiler or we can do it manually. Helpers that don't need this branching
  56009. // live outside of this function.
  56010. function ChildReconciler(shouldTrackSideEffects) {
  56011. function deleteChild(returnFiber, childToDelete) {
  56012. if (!shouldTrackSideEffects) {
  56013. // Noop.
  56014. return;
  56015. } // Deletions are added in reversed order so we add it to the front.
  56016. // At this point, the return fiber's effect list is empty except for
  56017. // deletions, so we can just append the deletion to the list. The remaining
  56018. // effects aren't added until the complete phase. Once we implement
  56019. // resuming, this may not be true.
  56020. var last = returnFiber.lastEffect;
  56021. if (last !== null) {
  56022. last.nextEffect = childToDelete;
  56023. returnFiber.lastEffect = childToDelete;
  56024. } else {
  56025. returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  56026. }
  56027. childToDelete.nextEffect = null;
  56028. childToDelete.effectTag = Deletion;
  56029. }
  56030. function deleteRemainingChildren(returnFiber, currentFirstChild) {
  56031. if (!shouldTrackSideEffects) {
  56032. // Noop.
  56033. return null;
  56034. } // TODO: For the shouldClone case, this could be micro-optimized a bit by
  56035. // assuming that after the first child we've already added everything.
  56036. var childToDelete = currentFirstChild;
  56037. while (childToDelete !== null) {
  56038. deleteChild(returnFiber, childToDelete);
  56039. childToDelete = childToDelete.sibling;
  56040. }
  56041. return null;
  56042. }
  56043. function mapRemainingChildren(returnFiber, currentFirstChild) {
  56044. // Add the remaining children to a temporary map so that we can find them by
  56045. // keys quickly. Implicit (null) keys get added to this set with their index
  56046. // instead.
  56047. var existingChildren = new Map();
  56048. var existingChild = currentFirstChild;
  56049. while (existingChild !== null) {
  56050. if (existingChild.key !== null) {
  56051. existingChildren.set(existingChild.key, existingChild);
  56052. } else {
  56053. existingChildren.set(existingChild.index, existingChild);
  56054. }
  56055. existingChild = existingChild.sibling;
  56056. }
  56057. return existingChildren;
  56058. }
  56059. function useFiber(fiber, pendingProps, expirationTime) {
  56060. // We currently set sibling to null and index to 0 here because it is easy
  56061. // to forget to do before returning it. E.g. for the single child case.
  56062. var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
  56063. clone.index = 0;
  56064. clone.sibling = null;
  56065. return clone;
  56066. }
  56067. function placeChild(newFiber, lastPlacedIndex, newIndex) {
  56068. newFiber.index = newIndex;
  56069. if (!shouldTrackSideEffects) {
  56070. // Noop.
  56071. return lastPlacedIndex;
  56072. }
  56073. var current$$1 = newFiber.alternate;
  56074. if (current$$1 !== null) {
  56075. var oldIndex = current$$1.index;
  56076. if (oldIndex < lastPlacedIndex) {
  56077. // This is a move.
  56078. newFiber.effectTag = Placement;
  56079. return lastPlacedIndex;
  56080. } else {
  56081. // This item can stay in place.
  56082. return oldIndex;
  56083. }
  56084. } else {
  56085. // This is an insertion.
  56086. newFiber.effectTag = Placement;
  56087. return lastPlacedIndex;
  56088. }
  56089. }
  56090. function placeSingleChild(newFiber) {
  56091. // This is simpler for the single child case. We only need to do a
  56092. // placement for inserting new children.
  56093. if (shouldTrackSideEffects && newFiber.alternate === null) {
  56094. newFiber.effectTag = Placement;
  56095. }
  56096. return newFiber;
  56097. }
  56098. function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {
  56099. if (current$$1 === null || current$$1.tag !== HostText) {
  56100. // Insert
  56101. var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
  56102. created.return = returnFiber;
  56103. return created;
  56104. } else {
  56105. // Update
  56106. var existing = useFiber(current$$1, textContent, expirationTime);
  56107. existing.return = returnFiber;
  56108. return existing;
  56109. }
  56110. }
  56111. function updateElement(returnFiber, current$$1, element, expirationTime) {
  56112. if (current$$1 !== null && (current$$1.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
  56113. isCompatibleFamilyForHotReloading(current$$1, element)))) {
  56114. // Move based on index
  56115. var existing = useFiber(current$$1, element.props, expirationTime);
  56116. existing.ref = coerceRef(returnFiber, current$$1, element);
  56117. existing.return = returnFiber;
  56118. {
  56119. existing._debugSource = element._source;
  56120. existing._debugOwner = element._owner;
  56121. }
  56122. return existing;
  56123. } else {
  56124. // Insert
  56125. var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
  56126. created.ref = coerceRef(returnFiber, current$$1, element);
  56127. created.return = returnFiber;
  56128. return created;
  56129. }
  56130. }
  56131. function updatePortal(returnFiber, current$$1, portal, expirationTime) {
  56132. if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {
  56133. // Insert
  56134. var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
  56135. created.return = returnFiber;
  56136. return created;
  56137. } else {
  56138. // Update
  56139. var existing = useFiber(current$$1, portal.children || [], expirationTime);
  56140. existing.return = returnFiber;
  56141. return existing;
  56142. }
  56143. }
  56144. function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) {
  56145. if (current$$1 === null || current$$1.tag !== Fragment) {
  56146. // Insert
  56147. var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
  56148. created.return = returnFiber;
  56149. return created;
  56150. } else {
  56151. // Update
  56152. var existing = useFiber(current$$1, fragment, expirationTime);
  56153. existing.return = returnFiber;
  56154. return existing;
  56155. }
  56156. }
  56157. function createChild(returnFiber, newChild, expirationTime) {
  56158. if (typeof newChild === 'string' || typeof newChild === 'number') {
  56159. // Text nodes don't have keys. If the previous node is implicitly keyed
  56160. // we can continue to replace it without aborting even if it is not a text
  56161. // node.
  56162. var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
  56163. created.return = returnFiber;
  56164. return created;
  56165. }
  56166. if (typeof newChild === 'object' && newChild !== null) {
  56167. switch (newChild.$$typeof) {
  56168. case REACT_ELEMENT_TYPE:
  56169. {
  56170. var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
  56171. _created.ref = coerceRef(returnFiber, null, newChild);
  56172. _created.return = returnFiber;
  56173. return _created;
  56174. }
  56175. case REACT_PORTAL_TYPE:
  56176. {
  56177. var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
  56178. _created2.return = returnFiber;
  56179. return _created2;
  56180. }
  56181. }
  56182. if (isArray(newChild) || getIteratorFn(newChild)) {
  56183. var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
  56184. _created3.return = returnFiber;
  56185. return _created3;
  56186. }
  56187. throwOnInvalidObjectType(returnFiber, newChild);
  56188. }
  56189. {
  56190. if (typeof newChild === 'function') {
  56191. warnOnFunctionType();
  56192. }
  56193. }
  56194. return null;
  56195. }
  56196. function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
  56197. // Update the fiber if the keys match, otherwise return null.
  56198. var key = oldFiber !== null ? oldFiber.key : null;
  56199. if (typeof newChild === 'string' || typeof newChild === 'number') {
  56200. // Text nodes don't have keys. If the previous node is implicitly keyed
  56201. // we can continue to replace it without aborting even if it is not a text
  56202. // node.
  56203. if (key !== null) {
  56204. return null;
  56205. }
  56206. return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
  56207. }
  56208. if (typeof newChild === 'object' && newChild !== null) {
  56209. switch (newChild.$$typeof) {
  56210. case REACT_ELEMENT_TYPE:
  56211. {
  56212. if (newChild.key === key) {
  56213. if (newChild.type === REACT_FRAGMENT_TYPE) {
  56214. return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
  56215. }
  56216. return updateElement(returnFiber, oldFiber, newChild, expirationTime);
  56217. } else {
  56218. return null;
  56219. }
  56220. }
  56221. case REACT_PORTAL_TYPE:
  56222. {
  56223. if (newChild.key === key) {
  56224. return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
  56225. } else {
  56226. return null;
  56227. }
  56228. }
  56229. }
  56230. if (isArray(newChild) || getIteratorFn(newChild)) {
  56231. if (key !== null) {
  56232. return null;
  56233. }
  56234. return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
  56235. }
  56236. throwOnInvalidObjectType(returnFiber, newChild);
  56237. }
  56238. {
  56239. if (typeof newChild === 'function') {
  56240. warnOnFunctionType();
  56241. }
  56242. }
  56243. return null;
  56244. }
  56245. function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
  56246. if (typeof newChild === 'string' || typeof newChild === 'number') {
  56247. // Text nodes don't have keys, so we neither have to check the old nor
  56248. // new node for the key. If both are text nodes, they match.
  56249. var matchedFiber = existingChildren.get(newIdx) || null;
  56250. return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
  56251. }
  56252. if (typeof newChild === 'object' && newChild !== null) {
  56253. switch (newChild.$$typeof) {
  56254. case REACT_ELEMENT_TYPE:
  56255. {
  56256. var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
  56257. if (newChild.type === REACT_FRAGMENT_TYPE) {
  56258. return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
  56259. }
  56260. return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
  56261. }
  56262. case REACT_PORTAL_TYPE:
  56263. {
  56264. var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
  56265. return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
  56266. }
  56267. }
  56268. if (isArray(newChild) || getIteratorFn(newChild)) {
  56269. var _matchedFiber3 = existingChildren.get(newIdx) || null;
  56270. return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
  56271. }
  56272. throwOnInvalidObjectType(returnFiber, newChild);
  56273. }
  56274. {
  56275. if (typeof newChild === 'function') {
  56276. warnOnFunctionType();
  56277. }
  56278. }
  56279. return null;
  56280. }
  56281. /**
  56282. * Warns if there is a duplicate or missing key
  56283. */
  56284. function warnOnInvalidKey(child, knownKeys) {
  56285. {
  56286. if (typeof child !== 'object' || child === null) {
  56287. return knownKeys;
  56288. }
  56289. switch (child.$$typeof) {
  56290. case REACT_ELEMENT_TYPE:
  56291. case REACT_PORTAL_TYPE:
  56292. warnForMissingKey(child);
  56293. var key = child.key;
  56294. if (typeof key !== 'string') {
  56295. break;
  56296. }
  56297. if (knownKeys === null) {
  56298. knownKeys = new Set();
  56299. knownKeys.add(key);
  56300. break;
  56301. }
  56302. if (!knownKeys.has(key)) {
  56303. knownKeys.add(key);
  56304. break;
  56305. }
  56306. warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
  56307. break;
  56308. default:
  56309. break;
  56310. }
  56311. }
  56312. return knownKeys;
  56313. }
  56314. function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
  56315. // This algorithm can't optimize by searching from both ends since we
  56316. // don't have backpointers on fibers. I'm trying to see how far we can get
  56317. // with that model. If it ends up not being worth the tradeoffs, we can
  56318. // add it later.
  56319. // Even with a two ended optimization, we'd want to optimize for the case
  56320. // where there are few changes and brute force the comparison instead of
  56321. // going for the Map. It'd like to explore hitting that path first in
  56322. // forward-only mode and only go for the Map once we notice that we need
  56323. // lots of look ahead. This doesn't handle reversal as well as two ended
  56324. // search but that's unusual. Besides, for the two ended optimization to
  56325. // work on Iterables, we'd need to copy the whole set.
  56326. // In this first iteration, we'll just live with hitting the bad case
  56327. // (adding everything to a Map) in for every insert/move.
  56328. // If you change this code, also update reconcileChildrenIterator() which
  56329. // uses the same algorithm.
  56330. {
  56331. // First, validate keys.
  56332. var knownKeys = null;
  56333. for (var i = 0; i < newChildren.length; i++) {
  56334. var child = newChildren[i];
  56335. knownKeys = warnOnInvalidKey(child, knownKeys);
  56336. }
  56337. }
  56338. var resultingFirstChild = null;
  56339. var previousNewFiber = null;
  56340. var oldFiber = currentFirstChild;
  56341. var lastPlacedIndex = 0;
  56342. var newIdx = 0;
  56343. var nextOldFiber = null;
  56344. for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
  56345. if (oldFiber.index > newIdx) {
  56346. nextOldFiber = oldFiber;
  56347. oldFiber = null;
  56348. } else {
  56349. nextOldFiber = oldFiber.sibling;
  56350. }
  56351. var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
  56352. if (newFiber === null) {
  56353. // TODO: This breaks on empty slots like null children. That's
  56354. // unfortunate because it triggers the slow path all the time. We need
  56355. // a better way to communicate whether this was a miss or null,
  56356. // boolean, undefined, etc.
  56357. if (oldFiber === null) {
  56358. oldFiber = nextOldFiber;
  56359. }
  56360. break;
  56361. }
  56362. if (shouldTrackSideEffects) {
  56363. if (oldFiber && newFiber.alternate === null) {
  56364. // We matched the slot, but we didn't reuse the existing fiber, so we
  56365. // need to delete the existing child.
  56366. deleteChild(returnFiber, oldFiber);
  56367. }
  56368. }
  56369. lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
  56370. if (previousNewFiber === null) {
  56371. // TODO: Move out of the loop. This only happens for the first run.
  56372. resultingFirstChild = newFiber;
  56373. } else {
  56374. // TODO: Defer siblings if we're not at the right index for this slot.
  56375. // I.e. if we had null values before, then we want to defer this
  56376. // for each null value. However, we also don't want to call updateSlot
  56377. // with the previous one.
  56378. previousNewFiber.sibling = newFiber;
  56379. }
  56380. previousNewFiber = newFiber;
  56381. oldFiber = nextOldFiber;
  56382. }
  56383. if (newIdx === newChildren.length) {
  56384. // We've reached the end of the new children. We can delete the rest.
  56385. deleteRemainingChildren(returnFiber, oldFiber);
  56386. return resultingFirstChild;
  56387. }
  56388. if (oldFiber === null) {
  56389. // If we don't have any more existing children we can choose a fast path
  56390. // since the rest will all be insertions.
  56391. for (; newIdx < newChildren.length; newIdx++) {
  56392. var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
  56393. if (_newFiber === null) {
  56394. continue;
  56395. }
  56396. lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
  56397. if (previousNewFiber === null) {
  56398. // TODO: Move out of the loop. This only happens for the first run.
  56399. resultingFirstChild = _newFiber;
  56400. } else {
  56401. previousNewFiber.sibling = _newFiber;
  56402. }
  56403. previousNewFiber = _newFiber;
  56404. }
  56405. return resultingFirstChild;
  56406. } // Add all children to a key map for quick lookups.
  56407. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
  56408. for (; newIdx < newChildren.length; newIdx++) {
  56409. var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
  56410. if (_newFiber2 !== null) {
  56411. if (shouldTrackSideEffects) {
  56412. if (_newFiber2.alternate !== null) {
  56413. // The new fiber is a work in progress, but if there exists a
  56414. // current, that means that we reused the fiber. We need to delete
  56415. // it from the child list so that we don't add it to the deletion
  56416. // list.
  56417. existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
  56418. }
  56419. }
  56420. lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
  56421. if (previousNewFiber === null) {
  56422. resultingFirstChild = _newFiber2;
  56423. } else {
  56424. previousNewFiber.sibling = _newFiber2;
  56425. }
  56426. previousNewFiber = _newFiber2;
  56427. }
  56428. }
  56429. if (shouldTrackSideEffects) {
  56430. // Any existing children that weren't consumed above were deleted. We need
  56431. // to add them to the deletion list.
  56432. existingChildren.forEach(function (child) {
  56433. return deleteChild(returnFiber, child);
  56434. });
  56435. }
  56436. return resultingFirstChild;
  56437. }
  56438. function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
  56439. // This is the same implementation as reconcileChildrenArray(),
  56440. // but using the iterator instead.
  56441. var iteratorFn = getIteratorFn(newChildrenIterable);
  56442. if (!(typeof iteratorFn === 'function')) {
  56443. {
  56444. throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
  56445. }
  56446. }
  56447. {
  56448. // We don't support rendering Generators because it's a mutation.
  56449. // See https://github.com/facebook/react/issues/12995
  56450. if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag
  56451. newChildrenIterable[Symbol.toStringTag] === 'Generator') {
  56452. !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0;
  56453. didWarnAboutGenerators = true;
  56454. } // Warn about using Maps as children
  56455. if (newChildrenIterable.entries === iteratorFn) {
  56456. !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
  56457. didWarnAboutMaps = true;
  56458. } // First, validate keys.
  56459. // We'll get a different iterator later for the main pass.
  56460. var _newChildren = iteratorFn.call(newChildrenIterable);
  56461. if (_newChildren) {
  56462. var knownKeys = null;
  56463. var _step = _newChildren.next();
  56464. for (; !_step.done; _step = _newChildren.next()) {
  56465. var child = _step.value;
  56466. knownKeys = warnOnInvalidKey(child, knownKeys);
  56467. }
  56468. }
  56469. }
  56470. var newChildren = iteratorFn.call(newChildrenIterable);
  56471. if (!(newChildren != null)) {
  56472. {
  56473. throw Error("An iterable object provided no iterator.");
  56474. }
  56475. }
  56476. var resultingFirstChild = null;
  56477. var previousNewFiber = null;
  56478. var oldFiber = currentFirstChild;
  56479. var lastPlacedIndex = 0;
  56480. var newIdx = 0;
  56481. var nextOldFiber = null;
  56482. var step = newChildren.next();
  56483. for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
  56484. if (oldFiber.index > newIdx) {
  56485. nextOldFiber = oldFiber;
  56486. oldFiber = null;
  56487. } else {
  56488. nextOldFiber = oldFiber.sibling;
  56489. }
  56490. var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
  56491. if (newFiber === null) {
  56492. // TODO: This breaks on empty slots like null children. That's
  56493. // unfortunate because it triggers the slow path all the time. We need
  56494. // a better way to communicate whether this was a miss or null,
  56495. // boolean, undefined, etc.
  56496. if (oldFiber === null) {
  56497. oldFiber = nextOldFiber;
  56498. }
  56499. break;
  56500. }
  56501. if (shouldTrackSideEffects) {
  56502. if (oldFiber && newFiber.alternate === null) {
  56503. // We matched the slot, but we didn't reuse the existing fiber, so we
  56504. // need to delete the existing child.
  56505. deleteChild(returnFiber, oldFiber);
  56506. }
  56507. }
  56508. lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
  56509. if (previousNewFiber === null) {
  56510. // TODO: Move out of the loop. This only happens for the first run.
  56511. resultingFirstChild = newFiber;
  56512. } else {
  56513. // TODO: Defer siblings if we're not at the right index for this slot.
  56514. // I.e. if we had null values before, then we want to defer this
  56515. // for each null value. However, we also don't want to call updateSlot
  56516. // with the previous one.
  56517. previousNewFiber.sibling = newFiber;
  56518. }
  56519. previousNewFiber = newFiber;
  56520. oldFiber = nextOldFiber;
  56521. }
  56522. if (step.done) {
  56523. // We've reached the end of the new children. We can delete the rest.
  56524. deleteRemainingChildren(returnFiber, oldFiber);
  56525. return resultingFirstChild;
  56526. }
  56527. if (oldFiber === null) {
  56528. // If we don't have any more existing children we can choose a fast path
  56529. // since the rest will all be insertions.
  56530. for (; !step.done; newIdx++, step = newChildren.next()) {
  56531. var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
  56532. if (_newFiber3 === null) {
  56533. continue;
  56534. }
  56535. lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
  56536. if (previousNewFiber === null) {
  56537. // TODO: Move out of the loop. This only happens for the first run.
  56538. resultingFirstChild = _newFiber3;
  56539. } else {
  56540. previousNewFiber.sibling = _newFiber3;
  56541. }
  56542. previousNewFiber = _newFiber3;
  56543. }
  56544. return resultingFirstChild;
  56545. } // Add all children to a key map for quick lookups.
  56546. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
  56547. for (; !step.done; newIdx++, step = newChildren.next()) {
  56548. var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
  56549. if (_newFiber4 !== null) {
  56550. if (shouldTrackSideEffects) {
  56551. if (_newFiber4.alternate !== null) {
  56552. // The new fiber is a work in progress, but if there exists a
  56553. // current, that means that we reused the fiber. We need to delete
  56554. // it from the child list so that we don't add it to the deletion
  56555. // list.
  56556. existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
  56557. }
  56558. }
  56559. lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
  56560. if (previousNewFiber === null) {
  56561. resultingFirstChild = _newFiber4;
  56562. } else {
  56563. previousNewFiber.sibling = _newFiber4;
  56564. }
  56565. previousNewFiber = _newFiber4;
  56566. }
  56567. }
  56568. if (shouldTrackSideEffects) {
  56569. // Any existing children that weren't consumed above were deleted. We need
  56570. // to add them to the deletion list.
  56571. existingChildren.forEach(function (child) {
  56572. return deleteChild(returnFiber, child);
  56573. });
  56574. }
  56575. return resultingFirstChild;
  56576. }
  56577. function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
  56578. // There's no need to check for keys on text nodes since we don't have a
  56579. // way to define them.
  56580. if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
  56581. // We already have an existing node so let's just update it and delete
  56582. // the rest.
  56583. deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
  56584. var existing = useFiber(currentFirstChild, textContent, expirationTime);
  56585. existing.return = returnFiber;
  56586. return existing;
  56587. } // The existing first child is not a text node so we need to create one
  56588. // and delete the existing ones.
  56589. deleteRemainingChildren(returnFiber, currentFirstChild);
  56590. var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
  56591. created.return = returnFiber;
  56592. return created;
  56593. }
  56594. function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
  56595. var key = element.key;
  56596. var child = currentFirstChild;
  56597. while (child !== null) {
  56598. // TODO: If key === null and child.key === null, then this only applies to
  56599. // the first item in the list.
  56600. if (child.key === key) {
  56601. if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
  56602. isCompatibleFamilyForHotReloading(child, element))) {
  56603. deleteRemainingChildren(returnFiber, child.sibling);
  56604. var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
  56605. existing.ref = coerceRef(returnFiber, child, element);
  56606. existing.return = returnFiber;
  56607. {
  56608. existing._debugSource = element._source;
  56609. existing._debugOwner = element._owner;
  56610. }
  56611. return existing;
  56612. } else {
  56613. deleteRemainingChildren(returnFiber, child);
  56614. break;
  56615. }
  56616. } else {
  56617. deleteChild(returnFiber, child);
  56618. }
  56619. child = child.sibling;
  56620. }
  56621. if (element.type === REACT_FRAGMENT_TYPE) {
  56622. var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
  56623. created.return = returnFiber;
  56624. return created;
  56625. } else {
  56626. var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
  56627. _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
  56628. _created4.return = returnFiber;
  56629. return _created4;
  56630. }
  56631. }
  56632. function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
  56633. var key = portal.key;
  56634. var child = currentFirstChild;
  56635. while (child !== null) {
  56636. // TODO: If key === null and child.key === null, then this only applies to
  56637. // the first item in the list.
  56638. if (child.key === key) {
  56639. if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
  56640. deleteRemainingChildren(returnFiber, child.sibling);
  56641. var existing = useFiber(child, portal.children || [], expirationTime);
  56642. existing.return = returnFiber;
  56643. return existing;
  56644. } else {
  56645. deleteRemainingChildren(returnFiber, child);
  56646. break;
  56647. }
  56648. } else {
  56649. deleteChild(returnFiber, child);
  56650. }
  56651. child = child.sibling;
  56652. }
  56653. var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
  56654. created.return = returnFiber;
  56655. return created;
  56656. } // This API will tag the children with the side-effect of the reconciliation
  56657. // itself. They will be added to the side-effect list as we pass through the
  56658. // children and the parent.
  56659. function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
  56660. // This function is not recursive.
  56661. // If the top level item is an array, we treat it as a set of children,
  56662. // not as a fragment. Nested arrays on the other hand will be treated as
  56663. // fragment nodes. Recursion happens at the normal flow.
  56664. // Handle top level unkeyed fragments as if they were arrays.
  56665. // This leads to an ambiguity between <>{[...]}</> and <>...</>.
  56666. // We treat the ambiguous cases above the same.
  56667. var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
  56668. if (isUnkeyedTopLevelFragment) {
  56669. newChild = newChild.props.children;
  56670. } // Handle object types
  56671. var isObject = typeof newChild === 'object' && newChild !== null;
  56672. if (isObject) {
  56673. switch (newChild.$$typeof) {
  56674. case REACT_ELEMENT_TYPE:
  56675. return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
  56676. case REACT_PORTAL_TYPE:
  56677. return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
  56678. }
  56679. }
  56680. if (typeof newChild === 'string' || typeof newChild === 'number') {
  56681. return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
  56682. }
  56683. if (isArray(newChild)) {
  56684. return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
  56685. }
  56686. if (getIteratorFn(newChild)) {
  56687. return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
  56688. }
  56689. if (isObject) {
  56690. throwOnInvalidObjectType(returnFiber, newChild);
  56691. }
  56692. {
  56693. if (typeof newChild === 'function') {
  56694. warnOnFunctionType();
  56695. }
  56696. }
  56697. if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
  56698. // If the new child is undefined, and the return fiber is a composite
  56699. // component, throw an error. If Fiber return types are disabled,
  56700. // we already threw above.
  56701. switch (returnFiber.tag) {
  56702. case ClassComponent:
  56703. {
  56704. {
  56705. var instance = returnFiber.stateNode;
  56706. if (instance.render._isMockFunction) {
  56707. // We allow auto-mocks to proceed as if they're returning null.
  56708. break;
  56709. }
  56710. }
  56711. }
  56712. // Intentionally fall through to the next case, which handles both
  56713. // functions and classes
  56714. // eslint-disable-next-lined no-fallthrough
  56715. case FunctionComponent:
  56716. {
  56717. var Component = returnFiber.type;
  56718. {
  56719. {
  56720. throw Error((Component.displayName || Component.name || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
  56721. }
  56722. }
  56723. }
  56724. }
  56725. } // Remaining cases are all treated as empty.
  56726. return deleteRemainingChildren(returnFiber, currentFirstChild);
  56727. }
  56728. return reconcileChildFibers;
  56729. }
  56730. var reconcileChildFibers = ChildReconciler(true);
  56731. var mountChildFibers = ChildReconciler(false);
  56732. function cloneChildFibers(current$$1, workInProgress) {
  56733. if (!(current$$1 === null || workInProgress.child === current$$1.child)) {
  56734. {
  56735. throw Error("Resuming work not yet implemented.");
  56736. }
  56737. }
  56738. if (workInProgress.child === null) {
  56739. return;
  56740. }
  56741. var currentChild = workInProgress.child;
  56742. var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
  56743. workInProgress.child = newChild;
  56744. newChild.return = workInProgress;
  56745. while (currentChild.sibling !== null) {
  56746. currentChild = currentChild.sibling;
  56747. newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
  56748. newChild.return = workInProgress;
  56749. }
  56750. newChild.sibling = null;
  56751. } // Reset a workInProgress child set to prepare it for a second pass.
  56752. function resetChildFibers(workInProgress, renderExpirationTime) {
  56753. var child = workInProgress.child;
  56754. while (child !== null) {
  56755. resetWorkInProgress(child, renderExpirationTime);
  56756. child = child.sibling;
  56757. }
  56758. }
  56759. var NO_CONTEXT = {};
  56760. var contextStackCursor$1 = createCursor(NO_CONTEXT);
  56761. var contextFiberStackCursor = createCursor(NO_CONTEXT);
  56762. var rootInstanceStackCursor = createCursor(NO_CONTEXT);
  56763. function requiredContext(c) {
  56764. if (!(c !== NO_CONTEXT)) {
  56765. {
  56766. throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
  56767. }
  56768. }
  56769. return c;
  56770. }
  56771. function getRootHostContainer() {
  56772. var rootInstance = requiredContext(rootInstanceStackCursor.current);
  56773. return rootInstance;
  56774. }
  56775. function pushHostContainer(fiber, nextRootInstance) {
  56776. // Push current root instance onto the stack;
  56777. // This allows us to reset root when portals are popped.
  56778. push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
  56779. // This enables us to pop only Fibers that provide unique contexts.
  56780. push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
  56781. // However, we can't just call getRootHostContext() and push it because
  56782. // we'd have a different number of entries on the stack depending on
  56783. // whether getRootHostContext() throws somewhere in renderer code or not.
  56784. // So we push an empty value first. This lets us safely unwind on errors.
  56785. push(contextStackCursor$1, NO_CONTEXT, fiber);
  56786. var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.
  56787. pop(contextStackCursor$1, fiber);
  56788. push(contextStackCursor$1, nextRootContext, fiber);
  56789. }
  56790. function popHostContainer(fiber) {
  56791. pop(contextStackCursor$1, fiber);
  56792. pop(contextFiberStackCursor, fiber);
  56793. pop(rootInstanceStackCursor, fiber);
  56794. }
  56795. function getHostContext() {
  56796. var context = requiredContext(contextStackCursor$1.current);
  56797. return context;
  56798. }
  56799. function pushHostContext(fiber) {
  56800. var rootInstance = requiredContext(rootInstanceStackCursor.current);
  56801. var context = requiredContext(contextStackCursor$1.current);
  56802. var nextContext = getChildHostContext(context, fiber.type, rootInstance); // Don't push this Fiber's context unless it's unique.
  56803. if (context === nextContext) {
  56804. return;
  56805. } // Track the context and the Fiber that provided it.
  56806. // This enables us to pop only Fibers that provide unique contexts.
  56807. push(contextFiberStackCursor, fiber, fiber);
  56808. push(contextStackCursor$1, nextContext, fiber);
  56809. }
  56810. function popHostContext(fiber) {
  56811. // Do not pop unless this Fiber provided the current context.
  56812. // pushHostContext() only pushes Fibers that provide unique contexts.
  56813. if (contextFiberStackCursor.current !== fiber) {
  56814. return;
  56815. }
  56816. pop(contextStackCursor$1, fiber);
  56817. pop(contextFiberStackCursor, fiber);
  56818. }
  56819. var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is
  56820. // inherited deeply down the subtree. The upper bits only affect
  56821. // this immediate suspense boundary and gets reset each new
  56822. // boundary or suspense list.
  56823. var SubtreeSuspenseContextMask = 1; // Subtree Flags:
  56824. // InvisibleParentSuspenseContext indicates that one of our parent Suspense
  56825. // boundaries is not currently showing visible main content.
  56826. // Either because it is already showing a fallback or is not mounted at all.
  56827. // We can use this to determine if it is desirable to trigger a fallback at
  56828. // the parent. If not, then we might need to trigger undesirable boundaries
  56829. // and/or suspend the commit to avoid hiding the parent content.
  56830. var InvisibleParentSuspenseContext = 1; // Shallow Flags:
  56831. // ForceSuspenseFallback can be used by SuspenseList to force newly added
  56832. // items into their fallback state during one of the render passes.
  56833. var ForceSuspenseFallback = 2;
  56834. var suspenseStackCursor = createCursor(DefaultSuspenseContext);
  56835. function hasSuspenseContext(parentContext, flag) {
  56836. return (parentContext & flag) !== 0;
  56837. }
  56838. function setDefaultShallowSuspenseContext(parentContext) {
  56839. return parentContext & SubtreeSuspenseContextMask;
  56840. }
  56841. function setShallowSuspenseContext(parentContext, shallowContext) {
  56842. return parentContext & SubtreeSuspenseContextMask | shallowContext;
  56843. }
  56844. function addSubtreeSuspenseContext(parentContext, subtreeContext) {
  56845. return parentContext | subtreeContext;
  56846. }
  56847. function pushSuspenseContext(fiber, newContext) {
  56848. push(suspenseStackCursor, newContext, fiber);
  56849. }
  56850. function popSuspenseContext(fiber) {
  56851. pop(suspenseStackCursor, fiber);
  56852. }
  56853. function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
  56854. // If it was the primary children that just suspended, capture and render the
  56855. // fallback. Otherwise, don't capture and bubble to the next boundary.
  56856. var nextState = workInProgress.memoizedState;
  56857. if (nextState !== null) {
  56858. if (nextState.dehydrated !== null) {
  56859. // A dehydrated boundary always captures.
  56860. return true;
  56861. }
  56862. return false;
  56863. }
  56864. var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.
  56865. if (props.fallback === undefined) {
  56866. return false;
  56867. } // Regular boundaries always capture.
  56868. if (props.unstable_avoidThisFallback !== true) {
  56869. return true;
  56870. } // If it's a boundary we should avoid, then we prefer to bubble up to the
  56871. // parent boundary if it is currently invisible.
  56872. if (hasInvisibleParent) {
  56873. return false;
  56874. } // If the parent is not able to handle it, we must handle it.
  56875. return true;
  56876. }
  56877. function findFirstSuspended(row) {
  56878. var node = row;
  56879. while (node !== null) {
  56880. if (node.tag === SuspenseComponent) {
  56881. var state = node.memoizedState;
  56882. if (state !== null) {
  56883. var dehydrated = state.dehydrated;
  56884. if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
  56885. return node;
  56886. }
  56887. }
  56888. } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
  56889. // keep track of whether it suspended or not.
  56890. node.memoizedProps.revealOrder !== undefined) {
  56891. var didSuspend = (node.effectTag & DidCapture) !== NoEffect;
  56892. if (didSuspend) {
  56893. return node;
  56894. }
  56895. } else if (node.child !== null) {
  56896. node.child.return = node;
  56897. node = node.child;
  56898. continue;
  56899. }
  56900. if (node === row) {
  56901. return null;
  56902. }
  56903. while (node.sibling === null) {
  56904. if (node.return === null || node.return === row) {
  56905. return null;
  56906. }
  56907. node = node.return;
  56908. }
  56909. node.sibling.return = node.return;
  56910. node = node.sibling;
  56911. }
  56912. return null;
  56913. }
  56914. var emptyObject = {};
  56915. var isArray$2 = Array.isArray;
  56916. function createResponderInstance(responder, responderProps, responderState, fiber) {
  56917. return {
  56918. fiber: fiber,
  56919. props: responderProps,
  56920. responder: responder,
  56921. rootEventTypes: null,
  56922. state: responderState
  56923. };
  56924. }
  56925. function mountEventResponder$1(responder, responderProps, fiber, respondersMap, rootContainerInstance) {
  56926. var responderState = emptyObject;
  56927. var getInitialState = responder.getInitialState;
  56928. if (getInitialState !== null) {
  56929. responderState = getInitialState(responderProps);
  56930. }
  56931. var responderInstance = createResponderInstance(responder, responderProps, responderState, fiber);
  56932. if (!rootContainerInstance) {
  56933. var node = fiber;
  56934. while (node !== null) {
  56935. var tag = node.tag;
  56936. if (tag === HostComponent) {
  56937. rootContainerInstance = node.stateNode;
  56938. break;
  56939. } else if (tag === HostRoot) {
  56940. rootContainerInstance = node.stateNode.containerInfo;
  56941. break;
  56942. }
  56943. node = node.return;
  56944. }
  56945. }
  56946. mountResponderInstance(responder, responderInstance, responderProps, responderState, rootContainerInstance);
  56947. respondersMap.set(responder, responderInstance);
  56948. }
  56949. function updateEventListener(listener, fiber, visistedResponders, respondersMap, rootContainerInstance) {
  56950. var responder;
  56951. var props;
  56952. if (listener) {
  56953. responder = listener.responder;
  56954. props = listener.props;
  56955. }
  56956. if (!(responder && responder.$$typeof === REACT_RESPONDER_TYPE)) {
  56957. {
  56958. throw Error("An invalid value was used as an event listener. Expect one or many event listeners created via React.unstable_useResponder().");
  56959. }
  56960. }
  56961. var listenerProps = props;
  56962. if (visistedResponders.has(responder)) {
  56963. // show warning
  56964. {
  56965. warning$1(false, 'Duplicate event responder "%s" found in event listeners. ' + 'Event listeners passed to elements cannot use the same event responder more than once.', responder.displayName);
  56966. }
  56967. return;
  56968. }
  56969. visistedResponders.add(responder);
  56970. var responderInstance = respondersMap.get(responder);
  56971. if (responderInstance === undefined) {
  56972. // Mount (happens in either complete or commit phase)
  56973. mountEventResponder$1(responder, listenerProps, fiber, respondersMap, rootContainerInstance);
  56974. } else {
  56975. // Update (happens during commit phase only)
  56976. responderInstance.props = listenerProps;
  56977. responderInstance.fiber = fiber;
  56978. }
  56979. }
  56980. function updateEventListeners(listeners, fiber, rootContainerInstance) {
  56981. var visistedResponders = new Set();
  56982. var dependencies = fiber.dependencies;
  56983. if (listeners != null) {
  56984. if (dependencies === null) {
  56985. dependencies = fiber.dependencies = {
  56986. expirationTime: NoWork,
  56987. firstContext: null,
  56988. responders: new Map()
  56989. };
  56990. }
  56991. var respondersMap = dependencies.responders;
  56992. if (respondersMap === null) {
  56993. respondersMap = new Map();
  56994. }
  56995. if (isArray$2(listeners)) {
  56996. for (var i = 0, length = listeners.length; i < length; i++) {
  56997. var listener = listeners[i];
  56998. updateEventListener(listener, fiber, visistedResponders, respondersMap, rootContainerInstance);
  56999. }
  57000. } else {
  57001. updateEventListener(listeners, fiber, visistedResponders, respondersMap, rootContainerInstance);
  57002. }
  57003. }
  57004. if (dependencies !== null) {
  57005. var _respondersMap = dependencies.responders;
  57006. if (_respondersMap !== null) {
  57007. // Unmount
  57008. var mountedResponders = Array.from(_respondersMap.keys());
  57009. for (var _i = 0, _length = mountedResponders.length; _i < _length; _i++) {
  57010. var mountedResponder = mountedResponders[_i];
  57011. if (!visistedResponders.has(mountedResponder)) {
  57012. var responderInstance = _respondersMap.get(mountedResponder);
  57013. unmountResponderInstance(responderInstance);
  57014. _respondersMap.delete(mountedResponder);
  57015. }
  57016. }
  57017. }
  57018. }
  57019. }
  57020. function createResponderListener(responder, props) {
  57021. var eventResponderListener = {
  57022. responder: responder,
  57023. props: props
  57024. };
  57025. {
  57026. Object.freeze(eventResponderListener);
  57027. }
  57028. return eventResponderListener;
  57029. }
  57030. var NoEffect$1 =
  57031. /* */
  57032. 0;
  57033. var UnmountSnapshot =
  57034. /* */
  57035. 2;
  57036. var UnmountMutation =
  57037. /* */
  57038. 4;
  57039. var MountMutation =
  57040. /* */
  57041. 8;
  57042. var UnmountLayout =
  57043. /* */
  57044. 16;
  57045. var MountLayout =
  57046. /* */
  57047. 32;
  57048. var MountPassive =
  57049. /* */
  57050. 64;
  57051. var UnmountPassive =
  57052. /* */
  57053. 128;
  57054. var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
  57055. var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
  57056. var didWarnAboutMismatchedHooksForComponent;
  57057. {
  57058. didWarnAboutMismatchedHooksForComponent = new Set();
  57059. }
  57060. // These are set right before calling the component.
  57061. var renderExpirationTime$1 = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from
  57062. // the work-in-progress hook.
  57063. var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The
  57064. // current hook list is the list that belongs to the current fiber. The
  57065. // work-in-progress hook list is a new list that will be added to the
  57066. // work-in-progress fiber.
  57067. var currentHook = null;
  57068. var nextCurrentHook = null;
  57069. var firstWorkInProgressHook = null;
  57070. var workInProgressHook = null;
  57071. var nextWorkInProgressHook = null;
  57072. var remainingExpirationTime = NoWork;
  57073. var componentUpdateQueue = null;
  57074. var sideEffectTag = 0; // Updates scheduled during render will trigger an immediate re-render at the
  57075. // end of the current pass. We can't store these updates on the normal queue,
  57076. // because if the work is aborted, they should be discarded. Because this is
  57077. // a relatively rare case, we also don't want to add an additional field to
  57078. // either the hook or queue object types. So we store them in a lazily create
  57079. // map of queue -> render-phase updates, which are discarded once the component
  57080. // completes without re-rendering.
  57081. // Whether an update was scheduled during the currently executing render pass.
  57082. var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates
  57083. var renderPhaseUpdates = null; // Counter to prevent infinite loops.
  57084. var numberOfReRenders = 0;
  57085. var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook
  57086. var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
  57087. // The list stores the order of hooks used during the initial render (mount).
  57088. // Subsequent renders (updates) reference this list.
  57089. var hookTypesDev = null;
  57090. var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore
  57091. // the dependencies for Hooks that need them (e.g. useEffect or useMemo).
  57092. // When true, such Hooks will always be "remounted". Only used during hot reload.
  57093. var ignorePreviousDependencies = false;
  57094. function mountHookTypesDev() {
  57095. {
  57096. var hookName = currentHookNameInDev;
  57097. if (hookTypesDev === null) {
  57098. hookTypesDev = [hookName];
  57099. } else {
  57100. hookTypesDev.push(hookName);
  57101. }
  57102. }
  57103. }
  57104. function updateHookTypesDev() {
  57105. {
  57106. var hookName = currentHookNameInDev;
  57107. if (hookTypesDev !== null) {
  57108. hookTypesUpdateIndexDev++;
  57109. if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
  57110. warnOnHookMismatchInDev(hookName);
  57111. }
  57112. }
  57113. }
  57114. }
  57115. function checkDepsAreArrayDev(deps) {
  57116. {
  57117. if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
  57118. // Verify deps, but only on mount to avoid extra checks.
  57119. // It's unlikely their type would change as usually you define them inline.
  57120. warning$1(false, '%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
  57121. }
  57122. }
  57123. }
  57124. function warnOnHookMismatchInDev(currentHookName) {
  57125. {
  57126. var componentName = getComponentName(currentlyRenderingFiber$1.type);
  57127. if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
  57128. didWarnAboutMismatchedHooksForComponent.add(componentName);
  57129. if (hookTypesDev !== null) {
  57130. var table = '';
  57131. var secondColumnStart = 30;
  57132. for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
  57133. var oldHookName = hookTypesDev[i];
  57134. var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
  57135. var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up
  57136. // lol @ IE not supporting String#repeat
  57137. while (row.length < secondColumnStart) {
  57138. row += ' ';
  57139. }
  57140. row += newHookName + '\n';
  57141. table += row;
  57142. }
  57143. warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
  57144. }
  57145. }
  57146. }
  57147. }
  57148. function throwInvalidHookError() {
  57149. {
  57150. {
  57151. throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
  57152. }
  57153. }
  57154. }
  57155. function areHookInputsEqual(nextDeps, prevDeps) {
  57156. {
  57157. if (ignorePreviousDependencies) {
  57158. // Only true when this component is being hot reloaded.
  57159. return false;
  57160. }
  57161. }
  57162. if (prevDeps === null) {
  57163. {
  57164. warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
  57165. }
  57166. return false;
  57167. }
  57168. {
  57169. // Don't bother comparing lengths in prod because these arrays should be
  57170. // passed inline.
  57171. if (nextDeps.length !== prevDeps.length) {
  57172. warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]");
  57173. }
  57174. }
  57175. for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
  57176. if (is$1(nextDeps[i], prevDeps[i])) {
  57177. continue;
  57178. }
  57179. return false;
  57180. }
  57181. return true;
  57182. }
  57183. function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
  57184. renderExpirationTime$1 = nextRenderExpirationTime;
  57185. currentlyRenderingFiber$1 = workInProgress;
  57186. nextCurrentHook = current !== null ? current.memoizedState : null;
  57187. {
  57188. hookTypesDev = current !== null ? current._debugHookTypes : null;
  57189. hookTypesUpdateIndexDev = -1; // Used for hot reloading:
  57190. ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
  57191. } // The following should have already been reset
  57192. // currentHook = null;
  57193. // workInProgressHook = null;
  57194. // remainingExpirationTime = NoWork;
  57195. // componentUpdateQueue = null;
  57196. // didScheduleRenderPhaseUpdate = false;
  57197. // renderPhaseUpdates = null;
  57198. // numberOfReRenders = 0;
  57199. // sideEffectTag = 0;
  57200. // TODO Warn if no hooks are used at all during mount, then some are used during update.
  57201. // Currently we will identify the update render as a mount because nextCurrentHook === null.
  57202. // This is tricky because it's valid for certain types of components (e.g. React.lazy)
  57203. // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
  57204. // Non-stateful hooks (e.g. context) don't get added to memoizedState,
  57205. // so nextCurrentHook would be null during updates and mounts.
  57206. {
  57207. if (nextCurrentHook !== null) {
  57208. ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
  57209. } else if (hookTypesDev !== null) {
  57210. // This dispatcher handles an edge case where a component is updating,
  57211. // but no stateful hooks have been used.
  57212. // We want to match the production code behavior (which will use HooksDispatcherOnMount),
  57213. // but with the extra DEV validation to ensure hooks ordering hasn't changed.
  57214. // This dispatcher does that.
  57215. ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
  57216. } else {
  57217. ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
  57218. }
  57219. }
  57220. var children = Component(props, refOrContext);
  57221. if (didScheduleRenderPhaseUpdate) {
  57222. do {
  57223. didScheduleRenderPhaseUpdate = false;
  57224. numberOfReRenders += 1;
  57225. {
  57226. // Even when hot reloading, allow dependencies to stabilize
  57227. // after first render to prevent infinite render phase updates.
  57228. ignorePreviousDependencies = false;
  57229. } // Start over from the beginning of the list
  57230. nextCurrentHook = current !== null ? current.memoizedState : null;
  57231. nextWorkInProgressHook = firstWorkInProgressHook;
  57232. currentHook = null;
  57233. workInProgressHook = null;
  57234. componentUpdateQueue = null;
  57235. {
  57236. // Also validate hook order for cascading updates.
  57237. hookTypesUpdateIndexDev = -1;
  57238. }
  57239. ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
  57240. children = Component(props, refOrContext);
  57241. } while (didScheduleRenderPhaseUpdate);
  57242. renderPhaseUpdates = null;
  57243. numberOfReRenders = 0;
  57244. } // We can assume the previous dispatcher is always this one, since we set it
  57245. // at the beginning of the render phase and there's no re-entrancy.
  57246. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
  57247. var renderedWork = currentlyRenderingFiber$1;
  57248. renderedWork.memoizedState = firstWorkInProgressHook;
  57249. renderedWork.expirationTime = remainingExpirationTime;
  57250. renderedWork.updateQueue = componentUpdateQueue;
  57251. renderedWork.effectTag |= sideEffectTag;
  57252. {
  57253. renderedWork._debugHookTypes = hookTypesDev;
  57254. } // This check uses currentHook so that it works the same in DEV and prod bundles.
  57255. // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
  57256. var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
  57257. renderExpirationTime$1 = NoWork;
  57258. currentlyRenderingFiber$1 = null;
  57259. currentHook = null;
  57260. nextCurrentHook = null;
  57261. firstWorkInProgressHook = null;
  57262. workInProgressHook = null;
  57263. nextWorkInProgressHook = null;
  57264. {
  57265. currentHookNameInDev = null;
  57266. hookTypesDev = null;
  57267. hookTypesUpdateIndexDev = -1;
  57268. }
  57269. remainingExpirationTime = NoWork;
  57270. componentUpdateQueue = null;
  57271. sideEffectTag = 0; // These were reset above
  57272. // didScheduleRenderPhaseUpdate = false;
  57273. // renderPhaseUpdates = null;
  57274. // numberOfReRenders = 0;
  57275. if (!!didRenderTooFewHooks) {
  57276. {
  57277. throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
  57278. }
  57279. }
  57280. return children;
  57281. }
  57282. function bailoutHooks(current, workInProgress, expirationTime) {
  57283. workInProgress.updateQueue = current.updateQueue;
  57284. workInProgress.effectTag &= ~(Passive | Update);
  57285. if (current.expirationTime <= expirationTime) {
  57286. current.expirationTime = NoWork;
  57287. }
  57288. }
  57289. function resetHooks() {
  57290. // We can assume the previous dispatcher is always this one, since we set it
  57291. // at the beginning of the render phase and there's no re-entrancy.
  57292. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; // This is used to reset the state of this module when a component throws.
  57293. // It's also called inside mountIndeterminateComponent if we determine the
  57294. // component is a module-style component.
  57295. renderExpirationTime$1 = NoWork;
  57296. currentlyRenderingFiber$1 = null;
  57297. currentHook = null;
  57298. nextCurrentHook = null;
  57299. firstWorkInProgressHook = null;
  57300. workInProgressHook = null;
  57301. nextWorkInProgressHook = null;
  57302. {
  57303. hookTypesDev = null;
  57304. hookTypesUpdateIndexDev = -1;
  57305. currentHookNameInDev = null;
  57306. }
  57307. remainingExpirationTime = NoWork;
  57308. componentUpdateQueue = null;
  57309. sideEffectTag = 0;
  57310. didScheduleRenderPhaseUpdate = false;
  57311. renderPhaseUpdates = null;
  57312. numberOfReRenders = 0;
  57313. }
  57314. function mountWorkInProgressHook() {
  57315. var hook = {
  57316. memoizedState: null,
  57317. baseState: null,
  57318. queue: null,
  57319. baseUpdate: null,
  57320. next: null
  57321. };
  57322. if (workInProgressHook === null) {
  57323. // This is the first hook in the list
  57324. firstWorkInProgressHook = workInProgressHook = hook;
  57325. } else {
  57326. // Append to the end of the list
  57327. workInProgressHook = workInProgressHook.next = hook;
  57328. }
  57329. return workInProgressHook;
  57330. }
  57331. function updateWorkInProgressHook() {
  57332. // This function is used both for updates and for re-renders triggered by a
  57333. // render phase update. It assumes there is either a current hook we can
  57334. // clone, or a work-in-progress hook from a previous render pass that we can
  57335. // use as a base. When we reach the end of the base list, we must switch to
  57336. // the dispatcher used for mounts.
  57337. if (nextWorkInProgressHook !== null) {
  57338. // There's already a work-in-progress. Reuse it.
  57339. workInProgressHook = nextWorkInProgressHook;
  57340. nextWorkInProgressHook = workInProgressHook.next;
  57341. currentHook = nextCurrentHook;
  57342. nextCurrentHook = currentHook !== null ? currentHook.next : null;
  57343. } else {
  57344. // Clone from the current hook.
  57345. if (!(nextCurrentHook !== null)) {
  57346. {
  57347. throw Error("Rendered more hooks than during the previous render.");
  57348. }
  57349. }
  57350. currentHook = nextCurrentHook;
  57351. var newHook = {
  57352. memoizedState: currentHook.memoizedState,
  57353. baseState: currentHook.baseState,
  57354. queue: currentHook.queue,
  57355. baseUpdate: currentHook.baseUpdate,
  57356. next: null
  57357. };
  57358. if (workInProgressHook === null) {
  57359. // This is the first hook in the list.
  57360. workInProgressHook = firstWorkInProgressHook = newHook;
  57361. } else {
  57362. // Append to the end of the list.
  57363. workInProgressHook = workInProgressHook.next = newHook;
  57364. }
  57365. nextCurrentHook = currentHook.next;
  57366. }
  57367. return workInProgressHook;
  57368. }
  57369. function createFunctionComponentUpdateQueue() {
  57370. return {
  57371. lastEffect: null
  57372. };
  57373. }
  57374. function basicStateReducer(state, action) {
  57375. return typeof action === 'function' ? action(state) : action;
  57376. }
  57377. function mountReducer(reducer, initialArg, init) {
  57378. var hook = mountWorkInProgressHook();
  57379. var initialState;
  57380. if (init !== undefined) {
  57381. initialState = init(initialArg);
  57382. } else {
  57383. initialState = initialArg;
  57384. }
  57385. hook.memoizedState = hook.baseState = initialState;
  57386. var queue = hook.queue = {
  57387. last: null,
  57388. dispatch: null,
  57389. lastRenderedReducer: reducer,
  57390. lastRenderedState: initialState
  57391. };
  57392. var dispatch = queue.dispatch = dispatchAction.bind(null, // Flow doesn't know this is non-null, but we do.
  57393. currentlyRenderingFiber$1, queue);
  57394. return [hook.memoizedState, dispatch];
  57395. }
  57396. function updateReducer(reducer, initialArg, init) {
  57397. var hook = updateWorkInProgressHook();
  57398. var queue = hook.queue;
  57399. if (!(queue !== null)) {
  57400. {
  57401. throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
  57402. }
  57403. }
  57404. queue.lastRenderedReducer = reducer;
  57405. if (numberOfReRenders > 0) {
  57406. // This is a re-render. Apply the new render phase updates to the previous
  57407. // work-in-progress hook.
  57408. var _dispatch = queue.dispatch;
  57409. if (renderPhaseUpdates !== null) {
  57410. // Render phase updates are stored in a map of queue -> linked list
  57411. var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
  57412. if (firstRenderPhaseUpdate !== undefined) {
  57413. renderPhaseUpdates.delete(queue);
  57414. var newState = hook.memoizedState;
  57415. var update = firstRenderPhaseUpdate;
  57416. do {
  57417. // Process this render phase update. We don't have to check the
  57418. // priority because it will always be the same as the current
  57419. // render's.
  57420. var action = update.action;
  57421. newState = reducer(newState, action);
  57422. update = update.next;
  57423. } while (update !== null); // Mark that the fiber performed work, but only if the new state is
  57424. // different from the current state.
  57425. if (!is$1(newState, hook.memoizedState)) {
  57426. markWorkInProgressReceivedUpdate();
  57427. }
  57428. hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to
  57429. // the base state unless the queue is empty.
  57430. // TODO: Not sure if this is the desired semantics, but it's what we
  57431. // do for gDSFP. I can't remember why.
  57432. if (hook.baseUpdate === queue.last) {
  57433. hook.baseState = newState;
  57434. }
  57435. queue.lastRenderedState = newState;
  57436. return [newState, _dispatch];
  57437. }
  57438. }
  57439. return [hook.memoizedState, _dispatch];
  57440. } // The last update in the entire queue
  57441. var last = queue.last; // The last update that is part of the base state.
  57442. var baseUpdate = hook.baseUpdate;
  57443. var baseState = hook.baseState; // Find the first unprocessed update.
  57444. var first;
  57445. if (baseUpdate !== null) {
  57446. if (last !== null) {
  57447. // For the first update, the queue is a circular linked list where
  57448. // `queue.last.next = queue.first`. Once the first update commits, and
  57449. // the `baseUpdate` is no longer empty, we can unravel the list.
  57450. last.next = null;
  57451. }
  57452. first = baseUpdate.next;
  57453. } else {
  57454. first = last !== null ? last.next : null;
  57455. }
  57456. if (first !== null) {
  57457. var _newState = baseState;
  57458. var newBaseState = null;
  57459. var newBaseUpdate = null;
  57460. var prevUpdate = baseUpdate;
  57461. var _update = first;
  57462. var didSkip = false;
  57463. do {
  57464. var updateExpirationTime = _update.expirationTime;
  57465. if (updateExpirationTime < renderExpirationTime$1) {
  57466. // Priority is insufficient. Skip this update. If this is the first
  57467. // skipped update, the previous update/state is the new base
  57468. // update/state.
  57469. if (!didSkip) {
  57470. didSkip = true;
  57471. newBaseUpdate = prevUpdate;
  57472. newBaseState = _newState;
  57473. } // Update the remaining priority in the queue.
  57474. if (updateExpirationTime > remainingExpirationTime) {
  57475. remainingExpirationTime = updateExpirationTime;
  57476. markUnprocessedUpdateTime(remainingExpirationTime);
  57477. }
  57478. } else {
  57479. // This update does have sufficient priority.
  57480. // Mark the event time of this update as relevant to this render pass.
  57481. // TODO: This should ideally use the true event time of this update rather than
  57482. // its priority which is a derived and not reverseable value.
  57483. // TODO: We should skip this update if it was already committed but currently
  57484. // we have no way of detecting the difference between a committed and suspended
  57485. // update here.
  57486. markRenderEventTimeAndConfig(updateExpirationTime, _update.suspenseConfig); // Process this update.
  57487. if (_update.eagerReducer === reducer) {
  57488. // If this update was processed eagerly, and its reducer matches the
  57489. // current reducer, we can use the eagerly computed state.
  57490. _newState = _update.eagerState;
  57491. } else {
  57492. var _action = _update.action;
  57493. _newState = reducer(_newState, _action);
  57494. }
  57495. }
  57496. prevUpdate = _update;
  57497. _update = _update.next;
  57498. } while (_update !== null && _update !== first);
  57499. if (!didSkip) {
  57500. newBaseUpdate = prevUpdate;
  57501. newBaseState = _newState;
  57502. } // Mark that the fiber performed work, but only if the new state is
  57503. // different from the current state.
  57504. if (!is$1(_newState, hook.memoizedState)) {
  57505. markWorkInProgressReceivedUpdate();
  57506. }
  57507. hook.memoizedState = _newState;
  57508. hook.baseUpdate = newBaseUpdate;
  57509. hook.baseState = newBaseState;
  57510. queue.lastRenderedState = _newState;
  57511. }
  57512. var dispatch = queue.dispatch;
  57513. return [hook.memoizedState, dispatch];
  57514. }
  57515. function mountState(initialState) {
  57516. var hook = mountWorkInProgressHook();
  57517. if (typeof initialState === 'function') {
  57518. initialState = initialState();
  57519. }
  57520. hook.memoizedState = hook.baseState = initialState;
  57521. var queue = hook.queue = {
  57522. last: null,
  57523. dispatch: null,
  57524. lastRenderedReducer: basicStateReducer,
  57525. lastRenderedState: initialState
  57526. };
  57527. var dispatch = queue.dispatch = dispatchAction.bind(null, // Flow doesn't know this is non-null, but we do.
  57528. currentlyRenderingFiber$1, queue);
  57529. return [hook.memoizedState, dispatch];
  57530. }
  57531. function updateState(initialState) {
  57532. return updateReducer(basicStateReducer, initialState);
  57533. }
  57534. function pushEffect(tag, create, destroy, deps) {
  57535. var effect = {
  57536. tag: tag,
  57537. create: create,
  57538. destroy: destroy,
  57539. deps: deps,
  57540. // Circular
  57541. next: null
  57542. };
  57543. if (componentUpdateQueue === null) {
  57544. componentUpdateQueue = createFunctionComponentUpdateQueue();
  57545. componentUpdateQueue.lastEffect = effect.next = effect;
  57546. } else {
  57547. var lastEffect = componentUpdateQueue.lastEffect;
  57548. if (lastEffect === null) {
  57549. componentUpdateQueue.lastEffect = effect.next = effect;
  57550. } else {
  57551. var firstEffect = lastEffect.next;
  57552. lastEffect.next = effect;
  57553. effect.next = firstEffect;
  57554. componentUpdateQueue.lastEffect = effect;
  57555. }
  57556. }
  57557. return effect;
  57558. }
  57559. function mountRef(initialValue) {
  57560. var hook = mountWorkInProgressHook();
  57561. var ref = {
  57562. current: initialValue
  57563. };
  57564. {
  57565. Object.seal(ref);
  57566. }
  57567. hook.memoizedState = ref;
  57568. return ref;
  57569. }
  57570. function updateRef(initialValue) {
  57571. var hook = updateWorkInProgressHook();
  57572. return hook.memoizedState;
  57573. }
  57574. function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  57575. var hook = mountWorkInProgressHook();
  57576. var nextDeps = deps === undefined ? null : deps;
  57577. sideEffectTag |= fiberEffectTag;
  57578. hook.memoizedState = pushEffect(hookEffectTag, create, undefined, nextDeps);
  57579. }
  57580. function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  57581. var hook = updateWorkInProgressHook();
  57582. var nextDeps = deps === undefined ? null : deps;
  57583. var destroy = undefined;
  57584. if (currentHook !== null) {
  57585. var prevEffect = currentHook.memoizedState;
  57586. destroy = prevEffect.destroy;
  57587. if (nextDeps !== null) {
  57588. var prevDeps = prevEffect.deps;
  57589. if (areHookInputsEqual(nextDeps, prevDeps)) {
  57590. pushEffect(NoEffect$1, create, destroy, nextDeps);
  57591. return;
  57592. }
  57593. }
  57594. }
  57595. sideEffectTag |= fiberEffectTag;
  57596. hook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextDeps);
  57597. }
  57598. function mountEffect(create, deps) {
  57599. {
  57600. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  57601. if ('undefined' !== typeof jest) {
  57602. warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
  57603. }
  57604. }
  57605. return mountEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
  57606. }
  57607. function updateEffect(create, deps) {
  57608. {
  57609. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  57610. if ('undefined' !== typeof jest) {
  57611. warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
  57612. }
  57613. }
  57614. return updateEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
  57615. }
  57616. function mountLayoutEffect(create, deps) {
  57617. return mountEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
  57618. }
  57619. function updateLayoutEffect(create, deps) {
  57620. return updateEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
  57621. }
  57622. function imperativeHandleEffect(create, ref) {
  57623. if (typeof ref === 'function') {
  57624. var refCallback = ref;
  57625. var _inst = create();
  57626. refCallback(_inst);
  57627. return function () {
  57628. refCallback(null);
  57629. };
  57630. } else if (ref !== null && ref !== undefined) {
  57631. var refObject = ref;
  57632. {
  57633. !refObject.hasOwnProperty('current') ? warning$1(false, 'Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}') : void 0;
  57634. }
  57635. var _inst2 = create();
  57636. refObject.current = _inst2;
  57637. return function () {
  57638. refObject.current = null;
  57639. };
  57640. }
  57641. }
  57642. function mountImperativeHandle(ref, create, deps) {
  57643. {
  57644. !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
  57645. } // TODO: If deps are provided, should we skip comparing the ref itself?
  57646. var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  57647. return mountEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
  57648. }
  57649. function updateImperativeHandle(ref, create, deps) {
  57650. {
  57651. !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
  57652. } // TODO: If deps are provided, should we skip comparing the ref itself?
  57653. var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
  57654. return updateEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
  57655. }
  57656. function mountDebugValue(value, formatterFn) {// This hook is normally a no-op.
  57657. // The react-debug-hooks package injects its own implementation
  57658. // so that e.g. DevTools can display custom hook values.
  57659. }
  57660. var updateDebugValue = mountDebugValue;
  57661. function mountCallback(callback, deps) {
  57662. var hook = mountWorkInProgressHook();
  57663. var nextDeps = deps === undefined ? null : deps;
  57664. hook.memoizedState = [callback, nextDeps];
  57665. return callback;
  57666. }
  57667. function updateCallback(callback, deps) {
  57668. var hook = updateWorkInProgressHook();
  57669. var nextDeps = deps === undefined ? null : deps;
  57670. var prevState = hook.memoizedState;
  57671. if (prevState !== null) {
  57672. if (nextDeps !== null) {
  57673. var prevDeps = prevState[1];
  57674. if (areHookInputsEqual(nextDeps, prevDeps)) {
  57675. return prevState[0];
  57676. }
  57677. }
  57678. }
  57679. hook.memoizedState = [callback, nextDeps];
  57680. return callback;
  57681. }
  57682. function mountMemo(nextCreate, deps) {
  57683. var hook = mountWorkInProgressHook();
  57684. var nextDeps = deps === undefined ? null : deps;
  57685. var nextValue = nextCreate();
  57686. hook.memoizedState = [nextValue, nextDeps];
  57687. return nextValue;
  57688. }
  57689. function updateMemo(nextCreate, deps) {
  57690. var hook = updateWorkInProgressHook();
  57691. var nextDeps = deps === undefined ? null : deps;
  57692. var prevState = hook.memoizedState;
  57693. if (prevState !== null) {
  57694. // Assume these are defined. If they're not, areHookInputsEqual will warn.
  57695. if (nextDeps !== null) {
  57696. var prevDeps = prevState[1];
  57697. if (areHookInputsEqual(nextDeps, prevDeps)) {
  57698. return prevState[0];
  57699. }
  57700. }
  57701. }
  57702. var nextValue = nextCreate();
  57703. hook.memoizedState = [nextValue, nextDeps];
  57704. return nextValue;
  57705. }
  57706. function mountDeferredValue(value, config) {
  57707. var _mountState = mountState(value),
  57708. prevValue = _mountState[0],
  57709. setValue = _mountState[1];
  57710. mountEffect(function () {
  57711. Scheduler.unstable_next(function () {
  57712. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  57713. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  57714. try {
  57715. setValue(value);
  57716. } finally {
  57717. ReactCurrentBatchConfig$1.suspense = previousConfig;
  57718. }
  57719. });
  57720. }, [value, config]);
  57721. return prevValue;
  57722. }
  57723. function updateDeferredValue(value, config) {
  57724. var _updateState = updateState(value),
  57725. prevValue = _updateState[0],
  57726. setValue = _updateState[1];
  57727. updateEffect(function () {
  57728. Scheduler.unstable_next(function () {
  57729. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  57730. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  57731. try {
  57732. setValue(value);
  57733. } finally {
  57734. ReactCurrentBatchConfig$1.suspense = previousConfig;
  57735. }
  57736. });
  57737. }, [value, config]);
  57738. return prevValue;
  57739. }
  57740. function mountTransition(config) {
  57741. var _mountState2 = mountState(false),
  57742. isPending = _mountState2[0],
  57743. setPending = _mountState2[1];
  57744. var startTransition = mountCallback(function (callback) {
  57745. setPending(true);
  57746. Scheduler.unstable_next(function () {
  57747. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  57748. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  57749. try {
  57750. setPending(false);
  57751. callback();
  57752. } finally {
  57753. ReactCurrentBatchConfig$1.suspense = previousConfig;
  57754. }
  57755. });
  57756. }, [config, isPending]);
  57757. return [startTransition, isPending];
  57758. }
  57759. function updateTransition(config) {
  57760. var _updateState2 = updateState(false),
  57761. isPending = _updateState2[0],
  57762. setPending = _updateState2[1];
  57763. var startTransition = updateCallback(function (callback) {
  57764. setPending(true);
  57765. Scheduler.unstable_next(function () {
  57766. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  57767. ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
  57768. try {
  57769. setPending(false);
  57770. callback();
  57771. } finally {
  57772. ReactCurrentBatchConfig$1.suspense = previousConfig;
  57773. }
  57774. });
  57775. }, [config, isPending]);
  57776. return [startTransition, isPending];
  57777. }
  57778. function dispatchAction(fiber, queue, action) {
  57779. if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
  57780. {
  57781. throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
  57782. }
  57783. }
  57784. {
  57785. !(typeof arguments[3] !== 'function') ? warning$1(false, "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().') : void 0;
  57786. }
  57787. var alternate = fiber.alternate;
  57788. if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
  57789. // This is a render phase update. Stash it in a lazily-created map of
  57790. // queue -> linked list of updates. After this render pass, we'll restart
  57791. // and apply the stashed updates on top of the work-in-progress hook.
  57792. didScheduleRenderPhaseUpdate = true;
  57793. var update = {
  57794. expirationTime: renderExpirationTime$1,
  57795. suspenseConfig: null,
  57796. action: action,
  57797. eagerReducer: null,
  57798. eagerState: null,
  57799. next: null
  57800. };
  57801. {
  57802. update.priority = getCurrentPriorityLevel();
  57803. }
  57804. if (renderPhaseUpdates === null) {
  57805. renderPhaseUpdates = new Map();
  57806. }
  57807. var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
  57808. if (firstRenderPhaseUpdate === undefined) {
  57809. renderPhaseUpdates.set(queue, update);
  57810. } else {
  57811. // Append the update to the end of the list.
  57812. var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
  57813. while (lastRenderPhaseUpdate.next !== null) {
  57814. lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
  57815. }
  57816. lastRenderPhaseUpdate.next = update;
  57817. }
  57818. } else {
  57819. var currentTime = requestCurrentTimeForUpdate();
  57820. var suspenseConfig = requestCurrentSuspenseConfig();
  57821. var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  57822. var _update2 = {
  57823. expirationTime: expirationTime,
  57824. suspenseConfig: suspenseConfig,
  57825. action: action,
  57826. eagerReducer: null,
  57827. eagerState: null,
  57828. next: null
  57829. };
  57830. {
  57831. _update2.priority = getCurrentPriorityLevel();
  57832. } // Append the update to the end of the list.
  57833. var last = queue.last;
  57834. if (last === null) {
  57835. // This is the first update. Create a circular list.
  57836. _update2.next = _update2;
  57837. } else {
  57838. var first = last.next;
  57839. if (first !== null) {
  57840. // Still circular.
  57841. _update2.next = first;
  57842. }
  57843. last.next = _update2;
  57844. }
  57845. queue.last = _update2;
  57846. if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
  57847. // The queue is currently empty, which means we can eagerly compute the
  57848. // next state before entering the render phase. If the new state is the
  57849. // same as the current state, we may be able to bail out entirely.
  57850. var lastRenderedReducer = queue.lastRenderedReducer;
  57851. if (lastRenderedReducer !== null) {
  57852. var prevDispatcher;
  57853. {
  57854. prevDispatcher = ReactCurrentDispatcher$1.current;
  57855. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  57856. }
  57857. try {
  57858. var currentState = queue.lastRenderedState;
  57859. var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute
  57860. // it, on the update object. If the reducer hasn't changed by the
  57861. // time we enter the render phase, then the eager state can be used
  57862. // without calling the reducer again.
  57863. _update2.eagerReducer = lastRenderedReducer;
  57864. _update2.eagerState = eagerState;
  57865. if (is$1(eagerState, currentState)) {
  57866. // Fast path. We can bail out without scheduling React to re-render.
  57867. // It's still possible that we'll need to rebase this update later,
  57868. // if the component re-renders for a different reason and by that
  57869. // time the reducer has changed.
  57870. return;
  57871. }
  57872. } catch (error) {// Suppress the error. It will throw again in the render phase.
  57873. } finally {
  57874. {
  57875. ReactCurrentDispatcher$1.current = prevDispatcher;
  57876. }
  57877. }
  57878. }
  57879. }
  57880. {
  57881. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  57882. if ('undefined' !== typeof jest) {
  57883. warnIfNotScopedWithMatchingAct(fiber);
  57884. warnIfNotCurrentlyActingUpdatesInDev(fiber);
  57885. }
  57886. }
  57887. scheduleWork(fiber, expirationTime);
  57888. }
  57889. }
  57890. var ContextOnlyDispatcher = {
  57891. readContext: readContext,
  57892. useCallback: throwInvalidHookError,
  57893. useContext: throwInvalidHookError,
  57894. useEffect: throwInvalidHookError,
  57895. useImperativeHandle: throwInvalidHookError,
  57896. useLayoutEffect: throwInvalidHookError,
  57897. useMemo: throwInvalidHookError,
  57898. useReducer: throwInvalidHookError,
  57899. useRef: throwInvalidHookError,
  57900. useState: throwInvalidHookError,
  57901. useDebugValue: throwInvalidHookError,
  57902. useResponder: throwInvalidHookError,
  57903. useDeferredValue: throwInvalidHookError,
  57904. useTransition: throwInvalidHookError
  57905. };
  57906. var HooksDispatcherOnMountInDEV = null;
  57907. var HooksDispatcherOnMountWithHookTypesInDEV = null;
  57908. var HooksDispatcherOnUpdateInDEV = null;
  57909. var InvalidNestedHooksDispatcherOnMountInDEV = null;
  57910. var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
  57911. {
  57912. var warnInvalidContextAccess = function () {
  57913. warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
  57914. };
  57915. var warnInvalidHookAccess = function () {
  57916. warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
  57917. };
  57918. HooksDispatcherOnMountInDEV = {
  57919. readContext: function (context, observedBits) {
  57920. return readContext(context, observedBits);
  57921. },
  57922. useCallback: function (callback, deps) {
  57923. currentHookNameInDev = 'useCallback';
  57924. mountHookTypesDev();
  57925. checkDepsAreArrayDev(deps);
  57926. return mountCallback(callback, deps);
  57927. },
  57928. useContext: function (context, observedBits) {
  57929. currentHookNameInDev = 'useContext';
  57930. mountHookTypesDev();
  57931. return readContext(context, observedBits);
  57932. },
  57933. useEffect: function (create, deps) {
  57934. currentHookNameInDev = 'useEffect';
  57935. mountHookTypesDev();
  57936. checkDepsAreArrayDev(deps);
  57937. return mountEffect(create, deps);
  57938. },
  57939. useImperativeHandle: function (ref, create, deps) {
  57940. currentHookNameInDev = 'useImperativeHandle';
  57941. mountHookTypesDev();
  57942. checkDepsAreArrayDev(deps);
  57943. return mountImperativeHandle(ref, create, deps);
  57944. },
  57945. useLayoutEffect: function (create, deps) {
  57946. currentHookNameInDev = 'useLayoutEffect';
  57947. mountHookTypesDev();
  57948. checkDepsAreArrayDev(deps);
  57949. return mountLayoutEffect(create, deps);
  57950. },
  57951. useMemo: function (create, deps) {
  57952. currentHookNameInDev = 'useMemo';
  57953. mountHookTypesDev();
  57954. checkDepsAreArrayDev(deps);
  57955. var prevDispatcher = ReactCurrentDispatcher$1.current;
  57956. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  57957. try {
  57958. return mountMemo(create, deps);
  57959. } finally {
  57960. ReactCurrentDispatcher$1.current = prevDispatcher;
  57961. }
  57962. },
  57963. useReducer: function (reducer, initialArg, init) {
  57964. currentHookNameInDev = 'useReducer';
  57965. mountHookTypesDev();
  57966. var prevDispatcher = ReactCurrentDispatcher$1.current;
  57967. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  57968. try {
  57969. return mountReducer(reducer, initialArg, init);
  57970. } finally {
  57971. ReactCurrentDispatcher$1.current = prevDispatcher;
  57972. }
  57973. },
  57974. useRef: function (initialValue) {
  57975. currentHookNameInDev = 'useRef';
  57976. mountHookTypesDev();
  57977. return mountRef(initialValue);
  57978. },
  57979. useState: function (initialState) {
  57980. currentHookNameInDev = 'useState';
  57981. mountHookTypesDev();
  57982. var prevDispatcher = ReactCurrentDispatcher$1.current;
  57983. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  57984. try {
  57985. return mountState(initialState);
  57986. } finally {
  57987. ReactCurrentDispatcher$1.current = prevDispatcher;
  57988. }
  57989. },
  57990. useDebugValue: function (value, formatterFn) {
  57991. currentHookNameInDev = 'useDebugValue';
  57992. mountHookTypesDev();
  57993. return mountDebugValue(value, formatterFn);
  57994. },
  57995. useResponder: function (responder, props) {
  57996. currentHookNameInDev = 'useResponder';
  57997. mountHookTypesDev();
  57998. return createResponderListener(responder, props);
  57999. },
  58000. useDeferredValue: function (value, config) {
  58001. currentHookNameInDev = 'useDeferredValue';
  58002. mountHookTypesDev();
  58003. return mountDeferredValue(value, config);
  58004. },
  58005. useTransition: function (config) {
  58006. currentHookNameInDev = 'useTransition';
  58007. mountHookTypesDev();
  58008. return mountTransition(config);
  58009. }
  58010. };
  58011. HooksDispatcherOnMountWithHookTypesInDEV = {
  58012. readContext: function (context, observedBits) {
  58013. return readContext(context, observedBits);
  58014. },
  58015. useCallback: function (callback, deps) {
  58016. currentHookNameInDev = 'useCallback';
  58017. updateHookTypesDev();
  58018. return mountCallback(callback, deps);
  58019. },
  58020. useContext: function (context, observedBits) {
  58021. currentHookNameInDev = 'useContext';
  58022. updateHookTypesDev();
  58023. return readContext(context, observedBits);
  58024. },
  58025. useEffect: function (create, deps) {
  58026. currentHookNameInDev = 'useEffect';
  58027. updateHookTypesDev();
  58028. return mountEffect(create, deps);
  58029. },
  58030. useImperativeHandle: function (ref, create, deps) {
  58031. currentHookNameInDev = 'useImperativeHandle';
  58032. updateHookTypesDev();
  58033. return mountImperativeHandle(ref, create, deps);
  58034. },
  58035. useLayoutEffect: function (create, deps) {
  58036. currentHookNameInDev = 'useLayoutEffect';
  58037. updateHookTypesDev();
  58038. return mountLayoutEffect(create, deps);
  58039. },
  58040. useMemo: function (create, deps) {
  58041. currentHookNameInDev = 'useMemo';
  58042. updateHookTypesDev();
  58043. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58044. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  58045. try {
  58046. return mountMemo(create, deps);
  58047. } finally {
  58048. ReactCurrentDispatcher$1.current = prevDispatcher;
  58049. }
  58050. },
  58051. useReducer: function (reducer, initialArg, init) {
  58052. currentHookNameInDev = 'useReducer';
  58053. updateHookTypesDev();
  58054. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58055. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  58056. try {
  58057. return mountReducer(reducer, initialArg, init);
  58058. } finally {
  58059. ReactCurrentDispatcher$1.current = prevDispatcher;
  58060. }
  58061. },
  58062. useRef: function (initialValue) {
  58063. currentHookNameInDev = 'useRef';
  58064. updateHookTypesDev();
  58065. return mountRef(initialValue);
  58066. },
  58067. useState: function (initialState) {
  58068. currentHookNameInDev = 'useState';
  58069. updateHookTypesDev();
  58070. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58071. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  58072. try {
  58073. return mountState(initialState);
  58074. } finally {
  58075. ReactCurrentDispatcher$1.current = prevDispatcher;
  58076. }
  58077. },
  58078. useDebugValue: function (value, formatterFn) {
  58079. currentHookNameInDev = 'useDebugValue';
  58080. updateHookTypesDev();
  58081. return mountDebugValue(value, formatterFn);
  58082. },
  58083. useResponder: function (responder, props) {
  58084. currentHookNameInDev = 'useResponder';
  58085. updateHookTypesDev();
  58086. return createResponderListener(responder, props);
  58087. },
  58088. useDeferredValue: function (value, config) {
  58089. currentHookNameInDev = 'useDeferredValue';
  58090. updateHookTypesDev();
  58091. return mountDeferredValue(value, config);
  58092. },
  58093. useTransition: function (config) {
  58094. currentHookNameInDev = 'useTransition';
  58095. updateHookTypesDev();
  58096. return mountTransition(config);
  58097. }
  58098. };
  58099. HooksDispatcherOnUpdateInDEV = {
  58100. readContext: function (context, observedBits) {
  58101. return readContext(context, observedBits);
  58102. },
  58103. useCallback: function (callback, deps) {
  58104. currentHookNameInDev = 'useCallback';
  58105. updateHookTypesDev();
  58106. return updateCallback(callback, deps);
  58107. },
  58108. useContext: function (context, observedBits) {
  58109. currentHookNameInDev = 'useContext';
  58110. updateHookTypesDev();
  58111. return readContext(context, observedBits);
  58112. },
  58113. useEffect: function (create, deps) {
  58114. currentHookNameInDev = 'useEffect';
  58115. updateHookTypesDev();
  58116. return updateEffect(create, deps);
  58117. },
  58118. useImperativeHandle: function (ref, create, deps) {
  58119. currentHookNameInDev = 'useImperativeHandle';
  58120. updateHookTypesDev();
  58121. return updateImperativeHandle(ref, create, deps);
  58122. },
  58123. useLayoutEffect: function (create, deps) {
  58124. currentHookNameInDev = 'useLayoutEffect';
  58125. updateHookTypesDev();
  58126. return updateLayoutEffect(create, deps);
  58127. },
  58128. useMemo: function (create, deps) {
  58129. currentHookNameInDev = 'useMemo';
  58130. updateHookTypesDev();
  58131. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58132. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  58133. try {
  58134. return updateMemo(create, deps);
  58135. } finally {
  58136. ReactCurrentDispatcher$1.current = prevDispatcher;
  58137. }
  58138. },
  58139. useReducer: function (reducer, initialArg, init) {
  58140. currentHookNameInDev = 'useReducer';
  58141. updateHookTypesDev();
  58142. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58143. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  58144. try {
  58145. return updateReducer(reducer, initialArg, init);
  58146. } finally {
  58147. ReactCurrentDispatcher$1.current = prevDispatcher;
  58148. }
  58149. },
  58150. useRef: function (initialValue) {
  58151. currentHookNameInDev = 'useRef';
  58152. updateHookTypesDev();
  58153. return updateRef(initialValue);
  58154. },
  58155. useState: function (initialState) {
  58156. currentHookNameInDev = 'useState';
  58157. updateHookTypesDev();
  58158. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58159. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  58160. try {
  58161. return updateState(initialState);
  58162. } finally {
  58163. ReactCurrentDispatcher$1.current = prevDispatcher;
  58164. }
  58165. },
  58166. useDebugValue: function (value, formatterFn) {
  58167. currentHookNameInDev = 'useDebugValue';
  58168. updateHookTypesDev();
  58169. return updateDebugValue(value, formatterFn);
  58170. },
  58171. useResponder: function (responder, props) {
  58172. currentHookNameInDev = 'useResponder';
  58173. updateHookTypesDev();
  58174. return createResponderListener(responder, props);
  58175. },
  58176. useDeferredValue: function (value, config) {
  58177. currentHookNameInDev = 'useDeferredValue';
  58178. updateHookTypesDev();
  58179. return updateDeferredValue(value, config);
  58180. },
  58181. useTransition: function (config) {
  58182. currentHookNameInDev = 'useTransition';
  58183. updateHookTypesDev();
  58184. return updateTransition(config);
  58185. }
  58186. };
  58187. InvalidNestedHooksDispatcherOnMountInDEV = {
  58188. readContext: function (context, observedBits) {
  58189. warnInvalidContextAccess();
  58190. return readContext(context, observedBits);
  58191. },
  58192. useCallback: function (callback, deps) {
  58193. currentHookNameInDev = 'useCallback';
  58194. warnInvalidHookAccess();
  58195. mountHookTypesDev();
  58196. return mountCallback(callback, deps);
  58197. },
  58198. useContext: function (context, observedBits) {
  58199. currentHookNameInDev = 'useContext';
  58200. warnInvalidHookAccess();
  58201. mountHookTypesDev();
  58202. return readContext(context, observedBits);
  58203. },
  58204. useEffect: function (create, deps) {
  58205. currentHookNameInDev = 'useEffect';
  58206. warnInvalidHookAccess();
  58207. mountHookTypesDev();
  58208. return mountEffect(create, deps);
  58209. },
  58210. useImperativeHandle: function (ref, create, deps) {
  58211. currentHookNameInDev = 'useImperativeHandle';
  58212. warnInvalidHookAccess();
  58213. mountHookTypesDev();
  58214. return mountImperativeHandle(ref, create, deps);
  58215. },
  58216. useLayoutEffect: function (create, deps) {
  58217. currentHookNameInDev = 'useLayoutEffect';
  58218. warnInvalidHookAccess();
  58219. mountHookTypesDev();
  58220. return mountLayoutEffect(create, deps);
  58221. },
  58222. useMemo: function (create, deps) {
  58223. currentHookNameInDev = 'useMemo';
  58224. warnInvalidHookAccess();
  58225. mountHookTypesDev();
  58226. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58227. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  58228. try {
  58229. return mountMemo(create, deps);
  58230. } finally {
  58231. ReactCurrentDispatcher$1.current = prevDispatcher;
  58232. }
  58233. },
  58234. useReducer: function (reducer, initialArg, init) {
  58235. currentHookNameInDev = 'useReducer';
  58236. warnInvalidHookAccess();
  58237. mountHookTypesDev();
  58238. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58239. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  58240. try {
  58241. return mountReducer(reducer, initialArg, init);
  58242. } finally {
  58243. ReactCurrentDispatcher$1.current = prevDispatcher;
  58244. }
  58245. },
  58246. useRef: function (initialValue) {
  58247. currentHookNameInDev = 'useRef';
  58248. warnInvalidHookAccess();
  58249. mountHookTypesDev();
  58250. return mountRef(initialValue);
  58251. },
  58252. useState: function (initialState) {
  58253. currentHookNameInDev = 'useState';
  58254. warnInvalidHookAccess();
  58255. mountHookTypesDev();
  58256. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58257. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
  58258. try {
  58259. return mountState(initialState);
  58260. } finally {
  58261. ReactCurrentDispatcher$1.current = prevDispatcher;
  58262. }
  58263. },
  58264. useDebugValue: function (value, formatterFn) {
  58265. currentHookNameInDev = 'useDebugValue';
  58266. warnInvalidHookAccess();
  58267. mountHookTypesDev();
  58268. return mountDebugValue(value, formatterFn);
  58269. },
  58270. useResponder: function (responder, props) {
  58271. currentHookNameInDev = 'useResponder';
  58272. warnInvalidHookAccess();
  58273. mountHookTypesDev();
  58274. return createResponderListener(responder, props);
  58275. },
  58276. useDeferredValue: function (value, config) {
  58277. currentHookNameInDev = 'useDeferredValue';
  58278. warnInvalidHookAccess();
  58279. mountHookTypesDev();
  58280. return mountDeferredValue(value, config);
  58281. },
  58282. useTransition: function (config) {
  58283. currentHookNameInDev = 'useTransition';
  58284. warnInvalidHookAccess();
  58285. mountHookTypesDev();
  58286. return mountTransition(config);
  58287. }
  58288. };
  58289. InvalidNestedHooksDispatcherOnUpdateInDEV = {
  58290. readContext: function (context, observedBits) {
  58291. warnInvalidContextAccess();
  58292. return readContext(context, observedBits);
  58293. },
  58294. useCallback: function (callback, deps) {
  58295. currentHookNameInDev = 'useCallback';
  58296. warnInvalidHookAccess();
  58297. updateHookTypesDev();
  58298. return updateCallback(callback, deps);
  58299. },
  58300. useContext: function (context, observedBits) {
  58301. currentHookNameInDev = 'useContext';
  58302. warnInvalidHookAccess();
  58303. updateHookTypesDev();
  58304. return readContext(context, observedBits);
  58305. },
  58306. useEffect: function (create, deps) {
  58307. currentHookNameInDev = 'useEffect';
  58308. warnInvalidHookAccess();
  58309. updateHookTypesDev();
  58310. return updateEffect(create, deps);
  58311. },
  58312. useImperativeHandle: function (ref, create, deps) {
  58313. currentHookNameInDev = 'useImperativeHandle';
  58314. warnInvalidHookAccess();
  58315. updateHookTypesDev();
  58316. return updateImperativeHandle(ref, create, deps);
  58317. },
  58318. useLayoutEffect: function (create, deps) {
  58319. currentHookNameInDev = 'useLayoutEffect';
  58320. warnInvalidHookAccess();
  58321. updateHookTypesDev();
  58322. return updateLayoutEffect(create, deps);
  58323. },
  58324. useMemo: function (create, deps) {
  58325. currentHookNameInDev = 'useMemo';
  58326. warnInvalidHookAccess();
  58327. updateHookTypesDev();
  58328. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58329. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  58330. try {
  58331. return updateMemo(create, deps);
  58332. } finally {
  58333. ReactCurrentDispatcher$1.current = prevDispatcher;
  58334. }
  58335. },
  58336. useReducer: function (reducer, initialArg, init) {
  58337. currentHookNameInDev = 'useReducer';
  58338. warnInvalidHookAccess();
  58339. updateHookTypesDev();
  58340. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58341. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  58342. try {
  58343. return updateReducer(reducer, initialArg, init);
  58344. } finally {
  58345. ReactCurrentDispatcher$1.current = prevDispatcher;
  58346. }
  58347. },
  58348. useRef: function (initialValue) {
  58349. currentHookNameInDev = 'useRef';
  58350. warnInvalidHookAccess();
  58351. updateHookTypesDev();
  58352. return updateRef(initialValue);
  58353. },
  58354. useState: function (initialState) {
  58355. currentHookNameInDev = 'useState';
  58356. warnInvalidHookAccess();
  58357. updateHookTypesDev();
  58358. var prevDispatcher = ReactCurrentDispatcher$1.current;
  58359. ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
  58360. try {
  58361. return updateState(initialState);
  58362. } finally {
  58363. ReactCurrentDispatcher$1.current = prevDispatcher;
  58364. }
  58365. },
  58366. useDebugValue: function (value, formatterFn) {
  58367. currentHookNameInDev = 'useDebugValue';
  58368. warnInvalidHookAccess();
  58369. updateHookTypesDev();
  58370. return updateDebugValue(value, formatterFn);
  58371. },
  58372. useResponder: function (responder, props) {
  58373. currentHookNameInDev = 'useResponder';
  58374. warnInvalidHookAccess();
  58375. updateHookTypesDev();
  58376. return createResponderListener(responder, props);
  58377. },
  58378. useDeferredValue: function (value, config) {
  58379. currentHookNameInDev = 'useDeferredValue';
  58380. warnInvalidHookAccess();
  58381. updateHookTypesDev();
  58382. return updateDeferredValue(value, config);
  58383. },
  58384. useTransition: function (config) {
  58385. currentHookNameInDev = 'useTransition';
  58386. warnInvalidHookAccess();
  58387. updateHookTypesDev();
  58388. return updateTransition(config);
  58389. }
  58390. };
  58391. }
  58392. // CommonJS interop named imports.
  58393. var now$1 = Scheduler.unstable_now;
  58394. var commitTime = 0;
  58395. var profilerStartTime = -1;
  58396. function getCommitTime() {
  58397. return commitTime;
  58398. }
  58399. function recordCommitTime() {
  58400. if (!enableProfilerTimer) {
  58401. return;
  58402. }
  58403. commitTime = now$1();
  58404. }
  58405. function startProfilerTimer(fiber) {
  58406. if (!enableProfilerTimer) {
  58407. return;
  58408. }
  58409. profilerStartTime = now$1();
  58410. if (fiber.actualStartTime < 0) {
  58411. fiber.actualStartTime = now$1();
  58412. }
  58413. }
  58414. function stopProfilerTimerIfRunning(fiber) {
  58415. if (!enableProfilerTimer) {
  58416. return;
  58417. }
  58418. profilerStartTime = -1;
  58419. }
  58420. function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
  58421. if (!enableProfilerTimer) {
  58422. return;
  58423. }
  58424. if (profilerStartTime >= 0) {
  58425. var elapsedTime = now$1() - profilerStartTime;
  58426. fiber.actualDuration += elapsedTime;
  58427. if (overrideBaseTime) {
  58428. fiber.selfBaseDuration = elapsedTime;
  58429. }
  58430. profilerStartTime = -1;
  58431. }
  58432. }
  58433. // This may have been an insertion or a hydration.
  58434. var hydrationParentFiber = null;
  58435. var nextHydratableInstance = null;
  58436. var isHydrating = false;
  58437. function warnIfHydrating() {
  58438. {
  58439. !!isHydrating ? warning$1(false, 'We should not be hydrating here. This is a bug in React. Please file a bug.') : void 0;
  58440. }
  58441. }
  58442. function enterHydrationState(fiber) {
  58443. if (!supportsHydration) {
  58444. return false;
  58445. }
  58446. var parentInstance = fiber.stateNode.containerInfo;
  58447. nextHydratableInstance = getFirstHydratableChild(parentInstance);
  58448. hydrationParentFiber = fiber;
  58449. isHydrating = true;
  58450. return true;
  58451. }
  58452. function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance) {
  58453. if (!supportsHydration) {
  58454. return false;
  58455. }
  58456. nextHydratableInstance = getNextHydratableSibling(suspenseInstance);
  58457. popToNextHostParent(fiber);
  58458. isHydrating = true;
  58459. return true;
  58460. }
  58461. function deleteHydratableInstance(returnFiber, instance) {
  58462. {
  58463. switch (returnFiber.tag) {
  58464. case HostRoot:
  58465. didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
  58466. break;
  58467. case HostComponent:
  58468. didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
  58469. break;
  58470. }
  58471. }
  58472. var childToDelete = createFiberFromHostInstanceForDeletion();
  58473. childToDelete.stateNode = instance;
  58474. childToDelete.return = returnFiber;
  58475. childToDelete.effectTag = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,
  58476. // these children are not part of the reconciliation list of children.
  58477. // Even if we abort and rereconcile the children, that will try to hydrate
  58478. // again and the nodes are still in the host tree so these will be
  58479. // recreated.
  58480. if (returnFiber.lastEffect !== null) {
  58481. returnFiber.lastEffect.nextEffect = childToDelete;
  58482. returnFiber.lastEffect = childToDelete;
  58483. } else {
  58484. returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  58485. }
  58486. }
  58487. function insertNonHydratedInstance(returnFiber, fiber) {
  58488. fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;
  58489. {
  58490. switch (returnFiber.tag) {
  58491. case HostRoot:
  58492. {
  58493. var parentContainer = returnFiber.stateNode.containerInfo;
  58494. switch (fiber.tag) {
  58495. case HostComponent:
  58496. var type = fiber.type;
  58497. var props = fiber.pendingProps;
  58498. didNotFindHydratableContainerInstance(parentContainer, type, props);
  58499. break;
  58500. case HostText:
  58501. var text = fiber.pendingProps;
  58502. didNotFindHydratableContainerTextInstance(parentContainer, text);
  58503. break;
  58504. case SuspenseComponent:
  58505. break;
  58506. }
  58507. break;
  58508. }
  58509. case HostComponent:
  58510. {
  58511. var parentType = returnFiber.type;
  58512. var parentProps = returnFiber.memoizedProps;
  58513. var parentInstance = returnFiber.stateNode;
  58514. switch (fiber.tag) {
  58515. case HostComponent:
  58516. var _type = fiber.type;
  58517. var _props = fiber.pendingProps;
  58518. didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props);
  58519. break;
  58520. case HostText:
  58521. var _text = fiber.pendingProps;
  58522. didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
  58523. break;
  58524. case SuspenseComponent:
  58525. didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance);
  58526. break;
  58527. }
  58528. break;
  58529. }
  58530. default:
  58531. return;
  58532. }
  58533. }
  58534. }
  58535. function tryHydrate(fiber, nextInstance) {
  58536. switch (fiber.tag) {
  58537. case HostComponent:
  58538. {
  58539. var type = fiber.type;
  58540. var props = fiber.pendingProps;
  58541. var instance = canHydrateInstance(nextInstance, type, props);
  58542. if (instance !== null) {
  58543. fiber.stateNode = instance;
  58544. return true;
  58545. }
  58546. return false;
  58547. }
  58548. case HostText:
  58549. {
  58550. var text = fiber.pendingProps;
  58551. var textInstance = canHydrateTextInstance(nextInstance, text);
  58552. if (textInstance !== null) {
  58553. fiber.stateNode = textInstance;
  58554. return true;
  58555. }
  58556. return false;
  58557. }
  58558. case SuspenseComponent:
  58559. {
  58560. if (enableSuspenseServerRenderer) {
  58561. var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
  58562. if (suspenseInstance !== null) {
  58563. var suspenseState = {
  58564. dehydrated: suspenseInstance,
  58565. retryTime: Never
  58566. };
  58567. fiber.memoizedState = suspenseState; // Store the dehydrated fragment as a child fiber.
  58568. // This simplifies the code for getHostSibling and deleting nodes,
  58569. // since it doesn't have to consider all Suspense boundaries and
  58570. // check if they're dehydrated ones or not.
  58571. var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
  58572. dehydratedFragment.return = fiber;
  58573. fiber.child = dehydratedFragment;
  58574. return true;
  58575. }
  58576. }
  58577. return false;
  58578. }
  58579. default:
  58580. return false;
  58581. }
  58582. }
  58583. function tryToClaimNextHydratableInstance(fiber) {
  58584. if (!isHydrating) {
  58585. return;
  58586. }
  58587. var nextInstance = nextHydratableInstance;
  58588. if (!nextInstance) {
  58589. // Nothing to hydrate. Make it an insertion.
  58590. insertNonHydratedInstance(hydrationParentFiber, fiber);
  58591. isHydrating = false;
  58592. hydrationParentFiber = fiber;
  58593. return;
  58594. }
  58595. var firstAttemptedInstance = nextInstance;
  58596. if (!tryHydrate(fiber, nextInstance)) {
  58597. // If we can't hydrate this instance let's try the next one.
  58598. // We use this as a heuristic. It's based on intuition and not data so it
  58599. // might be flawed or unnecessary.
  58600. nextInstance = getNextHydratableSibling(firstAttemptedInstance);
  58601. if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
  58602. // Nothing to hydrate. Make it an insertion.
  58603. insertNonHydratedInstance(hydrationParentFiber, fiber);
  58604. isHydrating = false;
  58605. hydrationParentFiber = fiber;
  58606. return;
  58607. } // We matched the next one, we'll now assume that the first one was
  58608. // superfluous and we'll delete it. Since we can't eagerly delete it
  58609. // we'll have to schedule a deletion. To do that, this node needs a dummy
  58610. // fiber associated with it.
  58611. deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
  58612. }
  58613. hydrationParentFiber = fiber;
  58614. nextHydratableInstance = getFirstHydratableChild(nextInstance);
  58615. }
  58616. function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
  58617. if (!supportsHydration) {
  58618. {
  58619. {
  58620. throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
  58621. }
  58622. }
  58623. }
  58624. var instance = fiber.stateNode;
  58625. var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.
  58626. fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
  58627. // is a new ref we mark this as an update.
  58628. if (updatePayload !== null) {
  58629. return true;
  58630. }
  58631. return false;
  58632. }
  58633. function prepareToHydrateHostTextInstance(fiber) {
  58634. if (!supportsHydration) {
  58635. {
  58636. {
  58637. throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
  58638. }
  58639. }
  58640. }
  58641. var textInstance = fiber.stateNode;
  58642. var textContent = fiber.memoizedProps;
  58643. var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
  58644. {
  58645. if (shouldUpdate) {
  58646. // We assume that prepareToHydrateHostTextInstance is called in a context where the
  58647. // hydration parent is the parent host component of this host text.
  58648. var returnFiber = hydrationParentFiber;
  58649. if (returnFiber !== null) {
  58650. switch (returnFiber.tag) {
  58651. case HostRoot:
  58652. {
  58653. var parentContainer = returnFiber.stateNode.containerInfo;
  58654. didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
  58655. break;
  58656. }
  58657. case HostComponent:
  58658. {
  58659. var parentType = returnFiber.type;
  58660. var parentProps = returnFiber.memoizedProps;
  58661. var parentInstance = returnFiber.stateNode;
  58662. didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
  58663. break;
  58664. }
  58665. }
  58666. }
  58667. }
  58668. }
  58669. return shouldUpdate;
  58670. }
  58671. function prepareToHydrateHostSuspenseInstance(fiber) {
  58672. if (!supportsHydration) {
  58673. {
  58674. {
  58675. throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
  58676. }
  58677. }
  58678. }
  58679. var suspenseState = fiber.memoizedState;
  58680. var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
  58681. if (!suspenseInstance) {
  58682. {
  58683. throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
  58684. }
  58685. }
  58686. hydrateSuspenseInstance(suspenseInstance, fiber);
  58687. }
  58688. function skipPastDehydratedSuspenseInstance(fiber) {
  58689. if (!supportsHydration) {
  58690. {
  58691. {
  58692. throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
  58693. }
  58694. }
  58695. }
  58696. var suspenseState = fiber.memoizedState;
  58697. var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
  58698. if (!suspenseInstance) {
  58699. {
  58700. throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
  58701. }
  58702. }
  58703. return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
  58704. }
  58705. function popToNextHostParent(fiber) {
  58706. var parent = fiber.return;
  58707. while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
  58708. parent = parent.return;
  58709. }
  58710. hydrationParentFiber = parent;
  58711. }
  58712. function popHydrationState(fiber) {
  58713. if (!supportsHydration) {
  58714. return false;
  58715. }
  58716. if (fiber !== hydrationParentFiber) {
  58717. // We're deeper than the current hydration context, inside an inserted
  58718. // tree.
  58719. return false;
  58720. }
  58721. if (!isHydrating) {
  58722. // If we're not currently hydrating but we're in a hydration context, then
  58723. // we were an insertion and now need to pop up reenter hydration of our
  58724. // siblings.
  58725. popToNextHostParent(fiber);
  58726. isHydrating = true;
  58727. return false;
  58728. }
  58729. var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.
  58730. // We only do this deeper than head and body since they tend to have random
  58731. // other nodes in them. We also ignore components with pure text content in
  58732. // side of them.
  58733. // TODO: Better heuristic.
  58734. if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
  58735. var nextInstance = nextHydratableInstance;
  58736. while (nextInstance) {
  58737. deleteHydratableInstance(fiber, nextInstance);
  58738. nextInstance = getNextHydratableSibling(nextInstance);
  58739. }
  58740. }
  58741. popToNextHostParent(fiber);
  58742. if (fiber.tag === SuspenseComponent) {
  58743. nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
  58744. } else {
  58745. nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
  58746. }
  58747. return true;
  58748. }
  58749. function resetHydrationState() {
  58750. if (!supportsHydration) {
  58751. return;
  58752. }
  58753. hydrationParentFiber = null;
  58754. nextHydratableInstance = null;
  58755. isHydrating = false;
  58756. }
  58757. var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
  58758. var didReceiveUpdate = false;
  58759. var didWarnAboutBadClass;
  58760. var didWarnAboutModulePatternComponent;
  58761. var didWarnAboutContextTypeOnFunctionComponent;
  58762. var didWarnAboutGetDerivedStateOnFunctionComponent;
  58763. var didWarnAboutFunctionRefs;
  58764. var didWarnAboutReassigningProps;
  58765. var didWarnAboutMaxDuration;
  58766. var didWarnAboutRevealOrder;
  58767. var didWarnAboutTailOptions;
  58768. var didWarnAboutDefaultPropsOnFunctionComponent;
  58769. {
  58770. didWarnAboutBadClass = {};
  58771. didWarnAboutModulePatternComponent = {};
  58772. didWarnAboutContextTypeOnFunctionComponent = {};
  58773. didWarnAboutGetDerivedStateOnFunctionComponent = {};
  58774. didWarnAboutFunctionRefs = {};
  58775. didWarnAboutReassigningProps = false;
  58776. didWarnAboutMaxDuration = false;
  58777. didWarnAboutRevealOrder = {};
  58778. didWarnAboutTailOptions = {};
  58779. didWarnAboutDefaultPropsOnFunctionComponent = {};
  58780. }
  58781. function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) {
  58782. if (current$$1 === null) {
  58783. // If this is a fresh new component that hasn't been rendered yet, we
  58784. // won't update its child set by applying minimal side-effects. Instead,
  58785. // we will add them all to the child before it gets rendered. That means
  58786. // we can optimize this reconciliation pass by not tracking side-effects.
  58787. workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  58788. } else {
  58789. // If the current child is the same as the work in progress, it means that
  58790. // we haven't yet started any work on these children. Therefore, we use
  58791. // the clone algorithm to create a copy of all the current children.
  58792. // If we had any progressed work already, that is invalid at this point so
  58793. // let's throw it out.
  58794. workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime);
  58795. }
  58796. }
  58797. function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) {
  58798. // This function is fork of reconcileChildren. It's used in cases where we
  58799. // want to reconcile without matching against the existing set. This has the
  58800. // effect of all current children being unmounted; even if the type and key
  58801. // are the same, the old child is unmounted and a new child is created.
  58802. //
  58803. // To do this, we're going to go through the reconcile algorithm twice. In
  58804. // the first pass, we schedule a deletion for all the current children by
  58805. // passing null.
  58806. workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime); // In the second pass, we mount the new children. The trick here is that we
  58807. // pass null in place of where we usually pass the current child set. This has
  58808. // the effect of remounting all children regardless of whether their their
  58809. // identity matches.
  58810. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  58811. }
  58812. function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  58813. // TODO: current can be non-null here even if the component
  58814. // hasn't yet mounted. This happens after the first render suspends.
  58815. // We'll need to figure out if this is fine or can cause issues.
  58816. {
  58817. if (workInProgress.type !== workInProgress.elementType) {
  58818. // Lazy component props can't be validated in createElement
  58819. // because they're only guaranteed to be resolved here.
  58820. var innerPropTypes = Component.propTypes;
  58821. if (innerPropTypes) {
  58822. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  58823. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  58824. }
  58825. }
  58826. }
  58827. var render = Component.render;
  58828. var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent
  58829. var nextChildren;
  58830. prepareToReadContext(workInProgress, renderExpirationTime);
  58831. {
  58832. ReactCurrentOwner$3.current = workInProgress;
  58833. setCurrentPhase('render');
  58834. nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
  58835. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  58836. // Only double-render components with Hooks
  58837. if (workInProgress.memoizedState !== null) {
  58838. nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
  58839. }
  58840. }
  58841. setCurrentPhase(null);
  58842. }
  58843. if (current$$1 !== null && !didReceiveUpdate) {
  58844. bailoutHooks(current$$1, workInProgress, renderExpirationTime);
  58845. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  58846. } // React DevTools reads this flag.
  58847. workInProgress.effectTag |= PerformedWork;
  58848. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  58849. return workInProgress.child;
  58850. }
  58851. function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  58852. if (current$$1 === null) {
  58853. var type = Component.type;
  58854. if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
  58855. Component.defaultProps === undefined) {
  58856. var resolvedType = type;
  58857. {
  58858. resolvedType = resolveFunctionForHotReloading(type);
  58859. } // If this is a plain function component without default props,
  58860. // and with only the default shallow comparison, we upgrade it
  58861. // to a SimpleMemoComponent to allow fast path updates.
  58862. workInProgress.tag = SimpleMemoComponent;
  58863. workInProgress.type = resolvedType;
  58864. {
  58865. validateFunctionComponentInDev(workInProgress, type);
  58866. }
  58867. return updateSimpleMemoComponent(current$$1, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);
  58868. }
  58869. {
  58870. var innerPropTypes = type.propTypes;
  58871. if (innerPropTypes) {
  58872. // Inner memo component props aren't currently validated in createElement.
  58873. // We could move it there, but we'd still need this for lazy code path.
  58874. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  58875. 'prop', getComponentName(type), getCurrentFiberStackInDev);
  58876. }
  58877. }
  58878. var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
  58879. child.ref = workInProgress.ref;
  58880. child.return = workInProgress;
  58881. workInProgress.child = child;
  58882. return child;
  58883. }
  58884. {
  58885. var _type = Component.type;
  58886. var _innerPropTypes = _type.propTypes;
  58887. if (_innerPropTypes) {
  58888. // Inner memo component props aren't currently validated in createElement.
  58889. // We could move it there, but we'd still need this for lazy code path.
  58890. checkPropTypes(_innerPropTypes, nextProps, // Resolved props
  58891. 'prop', getComponentName(_type), getCurrentFiberStackInDev);
  58892. }
  58893. }
  58894. var currentChild = current$$1.child; // This is always exactly one child
  58895. if (updateExpirationTime < renderExpirationTime) {
  58896. // This will be the props with resolved defaultProps,
  58897. // unlike current.memoizedProps which will be the unresolved ones.
  58898. var prevProps = currentChild.memoizedProps; // Default to shallow comparison
  58899. var compare = Component.compare;
  58900. compare = compare !== null ? compare : shallowEqual;
  58901. if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
  58902. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  58903. }
  58904. } // React DevTools reads this flag.
  58905. workInProgress.effectTag |= PerformedWork;
  58906. var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime);
  58907. newChild.ref = workInProgress.ref;
  58908. newChild.return = workInProgress;
  58909. workInProgress.child = newChild;
  58910. return newChild;
  58911. }
  58912. function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  58913. // TODO: current can be non-null here even if the component
  58914. // hasn't yet mounted. This happens when the inner render suspends.
  58915. // We'll need to figure out if this is fine or can cause issues.
  58916. {
  58917. if (workInProgress.type !== workInProgress.elementType) {
  58918. // Lazy component props can't be validated in createElement
  58919. // because they're only guaranteed to be resolved here.
  58920. var outerMemoType = workInProgress.elementType;
  58921. if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
  58922. // We warn when you define propTypes on lazy()
  58923. // so let's just skip over it to find memo() outer wrapper.
  58924. // Inner props for memo are validated later.
  58925. outerMemoType = refineResolvedLazyComponent(outerMemoType);
  58926. }
  58927. var outerPropTypes = outerMemoType && outerMemoType.propTypes;
  58928. if (outerPropTypes) {
  58929. checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
  58930. 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
  58931. } // Inner propTypes will be validated in the function component path.
  58932. }
  58933. }
  58934. if (current$$1 !== null) {
  58935. var prevProps = current$$1.memoizedProps;
  58936. if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload:
  58937. workInProgress.type === current$$1.type)) {
  58938. didReceiveUpdate = false;
  58939. if (updateExpirationTime < renderExpirationTime) {
  58940. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  58941. }
  58942. }
  58943. }
  58944. return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
  58945. }
  58946. function updateFragment(current$$1, workInProgress, renderExpirationTime) {
  58947. var nextChildren = workInProgress.pendingProps;
  58948. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  58949. return workInProgress.child;
  58950. }
  58951. function updateMode(current$$1, workInProgress, renderExpirationTime) {
  58952. var nextChildren = workInProgress.pendingProps.children;
  58953. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  58954. return workInProgress.child;
  58955. }
  58956. function updateProfiler(current$$1, workInProgress, renderExpirationTime) {
  58957. if (enableProfilerTimer) {
  58958. workInProgress.effectTag |= Update;
  58959. }
  58960. var nextProps = workInProgress.pendingProps;
  58961. var nextChildren = nextProps.children;
  58962. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  58963. return workInProgress.child;
  58964. }
  58965. function markRef(current$$1, workInProgress) {
  58966. var ref = workInProgress.ref;
  58967. if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) {
  58968. // Schedule a Ref effect
  58969. workInProgress.effectTag |= Ref;
  58970. }
  58971. }
  58972. function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  58973. {
  58974. if (workInProgress.type !== workInProgress.elementType) {
  58975. // Lazy component props can't be validated in createElement
  58976. // because they're only guaranteed to be resolved here.
  58977. var innerPropTypes = Component.propTypes;
  58978. if (innerPropTypes) {
  58979. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  58980. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  58981. }
  58982. }
  58983. }
  58984. var context;
  58985. if (!disableLegacyContext) {
  58986. var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
  58987. context = getMaskedContext(workInProgress, unmaskedContext);
  58988. }
  58989. var nextChildren;
  58990. prepareToReadContext(workInProgress, renderExpirationTime);
  58991. {
  58992. ReactCurrentOwner$3.current = workInProgress;
  58993. setCurrentPhase('render');
  58994. nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
  58995. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  58996. // Only double-render components with Hooks
  58997. if (workInProgress.memoizedState !== null) {
  58998. nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
  58999. }
  59000. }
  59001. setCurrentPhase(null);
  59002. }
  59003. if (current$$1 !== null && !didReceiveUpdate) {
  59004. bailoutHooks(current$$1, workInProgress, renderExpirationTime);
  59005. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  59006. } // React DevTools reads this flag.
  59007. workInProgress.effectTag |= PerformedWork;
  59008. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  59009. return workInProgress.child;
  59010. }
  59011. function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  59012. {
  59013. if (workInProgress.type !== workInProgress.elementType) {
  59014. // Lazy component props can't be validated in createElement
  59015. // because they're only guaranteed to be resolved here.
  59016. var innerPropTypes = Component.propTypes;
  59017. if (innerPropTypes) {
  59018. checkPropTypes(innerPropTypes, nextProps, // Resolved props
  59019. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  59020. }
  59021. }
  59022. } // Push context providers early to prevent context stack mismatches.
  59023. // During mounting we don't know the child context yet as the instance doesn't exist.
  59024. // We will invalidate the child context in finishClassComponent() right after rendering.
  59025. var hasContext;
  59026. if (isContextProvider(Component)) {
  59027. hasContext = true;
  59028. pushContextProvider(workInProgress);
  59029. } else {
  59030. hasContext = false;
  59031. }
  59032. prepareToReadContext(workInProgress, renderExpirationTime);
  59033. var instance = workInProgress.stateNode;
  59034. var shouldUpdate;
  59035. if (instance === null) {
  59036. if (current$$1 !== null) {
  59037. // An class component without an instance only mounts if it suspended
  59038. // inside a non- concurrent tree, in an inconsistent state. We want to
  59039. // tree it like a new mount, even though an empty version of it already
  59040. // committed. Disconnect the alternate pointers.
  59041. current$$1.alternate = null;
  59042. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  59043. workInProgress.effectTag |= Placement;
  59044. } // In the initial pass we might need to construct the instance.
  59045. constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  59046. mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  59047. shouldUpdate = true;
  59048. } else if (current$$1 === null) {
  59049. // In a resume, we'll already have an instance we can reuse.
  59050. shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  59051. } else {
  59052. shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
  59053. }
  59054. var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
  59055. {
  59056. var inst = workInProgress.stateNode;
  59057. if (inst.props !== nextProps) {
  59058. !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0;
  59059. didWarnAboutReassigningProps = true;
  59060. }
  59061. }
  59062. return nextUnitOfWork;
  59063. }
  59064. function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
  59065. // Refs should update even if shouldComponentUpdate returns false
  59066. markRef(current$$1, workInProgress);
  59067. var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;
  59068. if (!shouldUpdate && !didCaptureError) {
  59069. // Context providers should defer to sCU for rendering
  59070. if (hasContext) {
  59071. invalidateContextProvider(workInProgress, Component, false);
  59072. }
  59073. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  59074. }
  59075. var instance = workInProgress.stateNode; // Rerender
  59076. ReactCurrentOwner$3.current = workInProgress;
  59077. var nextChildren;
  59078. if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
  59079. // If we captured an error, but getDerivedStateFrom catch is not defined,
  59080. // unmount all the children. componentDidCatch will schedule an update to
  59081. // re-render a fallback. This is temporary until we migrate everyone to
  59082. // the new API.
  59083. // TODO: Warn in a future release.
  59084. nextChildren = null;
  59085. if (enableProfilerTimer) {
  59086. stopProfilerTimerIfRunning(workInProgress);
  59087. }
  59088. } else {
  59089. {
  59090. setCurrentPhase('render');
  59091. nextChildren = instance.render();
  59092. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  59093. instance.render();
  59094. }
  59095. setCurrentPhase(null);
  59096. }
  59097. } // React DevTools reads this flag.
  59098. workInProgress.effectTag |= PerformedWork;
  59099. if (current$$1 !== null && didCaptureError) {
  59100. // If we're recovering from an error, reconcile without reusing any of
  59101. // the existing children. Conceptually, the normal children and the children
  59102. // that are shown on error are two different sets, so we shouldn't reuse
  59103. // normal children even if their identities match.
  59104. forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime);
  59105. } else {
  59106. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  59107. } // Memoize state using the values we just used to render.
  59108. // TODO: Restructure so we never read values from the instance.
  59109. workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.
  59110. if (hasContext) {
  59111. invalidateContextProvider(workInProgress, Component, true);
  59112. }
  59113. return workInProgress.child;
  59114. }
  59115. function pushHostRootContext(workInProgress) {
  59116. var root = workInProgress.stateNode;
  59117. if (root.pendingContext) {
  59118. pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
  59119. } else if (root.context) {
  59120. // Should always be set
  59121. pushTopLevelContextObject(workInProgress, root.context, false);
  59122. }
  59123. pushHostContainer(workInProgress, root.containerInfo);
  59124. }
  59125. function updateHostRoot(current$$1, workInProgress, renderExpirationTime) {
  59126. pushHostRootContext(workInProgress);
  59127. var updateQueue = workInProgress.updateQueue;
  59128. if (!(updateQueue !== null)) {
  59129. {
  59130. throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
  59131. }
  59132. }
  59133. var nextProps = workInProgress.pendingProps;
  59134. var prevState = workInProgress.memoizedState;
  59135. var prevChildren = prevState !== null ? prevState.element : null;
  59136. processUpdateQueue(workInProgress, updateQueue, nextProps, null, renderExpirationTime);
  59137. var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property
  59138. // being called "element".
  59139. var nextChildren = nextState.element;
  59140. if (nextChildren === prevChildren) {
  59141. // If the state is the same as before, that's a bailout because we had
  59142. // no work that expires at this time.
  59143. resetHydrationState();
  59144. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  59145. }
  59146. var root = workInProgress.stateNode;
  59147. if (root.hydrate && enterHydrationState(workInProgress)) {
  59148. // If we don't have any current children this might be the first pass.
  59149. // We always try to hydrate. If this isn't a hydration pass there won't
  59150. // be any children to hydrate which is effectively the same thing as
  59151. // not hydrating.
  59152. var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  59153. workInProgress.child = child;
  59154. var node = child;
  59155. while (node) {
  59156. // Mark each child as hydrating. This is a fast path to know whether this
  59157. // tree is part of a hydrating tree. This is used to determine if a child
  59158. // node has fully mounted yet, and for scheduling event replaying.
  59159. // Conceptually this is similar to Placement in that a new subtree is
  59160. // inserted into the React tree here. It just happens to not need DOM
  59161. // mutations because it already exists.
  59162. node.effectTag = node.effectTag & ~Placement | Hydrating;
  59163. node = node.sibling;
  59164. }
  59165. } else {
  59166. // Otherwise reset hydration state in case we aborted and resumed another
  59167. // root.
  59168. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  59169. resetHydrationState();
  59170. }
  59171. return workInProgress.child;
  59172. }
  59173. function updateHostComponent(current$$1, workInProgress, renderExpirationTime) {
  59174. pushHostContext(workInProgress);
  59175. if (current$$1 === null) {
  59176. tryToClaimNextHydratableInstance(workInProgress);
  59177. }
  59178. var type = workInProgress.type;
  59179. var nextProps = workInProgress.pendingProps;
  59180. var prevProps = current$$1 !== null ? current$$1.memoizedProps : null;
  59181. var nextChildren = nextProps.children;
  59182. var isDirectTextChild = shouldSetTextContent(type, nextProps);
  59183. if (isDirectTextChild) {
  59184. // We special case a direct text child of a host node. This is a common
  59185. // case. We won't handle it as a reified child. We will instead handle
  59186. // this in the host environment that also have access to this prop. That
  59187. // avoids allocating another HostText fiber and traversing it.
  59188. nextChildren = null;
  59189. } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
  59190. // If we're switching from a direct text child to a normal child, or to
  59191. // empty, we need to schedule the text content to be reset.
  59192. workInProgress.effectTag |= ContentReset;
  59193. }
  59194. markRef(current$$1, workInProgress); // Check the host config to see if the children are offscreen/hidden.
  59195. if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {
  59196. if (enableSchedulerTracing) {
  59197. markSpawnedWork(Never);
  59198. } // Schedule this fiber to re-render at offscreen priority. Then bailout.
  59199. workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
  59200. return null;
  59201. }
  59202. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  59203. return workInProgress.child;
  59204. }
  59205. function updateHostText(current$$1, workInProgress) {
  59206. if (current$$1 === null) {
  59207. tryToClaimNextHydratableInstance(workInProgress);
  59208. } // Nothing to do here. This is terminal. We'll do the completion step
  59209. // immediately after.
  59210. return null;
  59211. }
  59212. function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {
  59213. if (_current !== null) {
  59214. // An lazy component only mounts if it suspended inside a non-
  59215. // concurrent tree, in an inconsistent state. We want to treat it like
  59216. // a new mount, even though an empty version of it already committed.
  59217. // Disconnect the alternate pointers.
  59218. _current.alternate = null;
  59219. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  59220. workInProgress.effectTag |= Placement;
  59221. }
  59222. var props = workInProgress.pendingProps; // We can't start a User Timing measurement with correct label yet.
  59223. // Cancel and resume right after we know the tag.
  59224. cancelWorkTimer(workInProgress);
  59225. var Component = readLazyComponentType(elementType); // Store the unwrapped component in the type.
  59226. workInProgress.type = Component;
  59227. var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
  59228. startWorkTimer(workInProgress);
  59229. var resolvedProps = resolveDefaultProps(Component, props);
  59230. var child;
  59231. switch (resolvedTag) {
  59232. case FunctionComponent:
  59233. {
  59234. {
  59235. validateFunctionComponentInDev(workInProgress, Component);
  59236. workInProgress.type = Component = resolveFunctionForHotReloading(Component);
  59237. }
  59238. child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
  59239. break;
  59240. }
  59241. case ClassComponent:
  59242. {
  59243. {
  59244. workInProgress.type = Component = resolveClassForHotReloading(Component);
  59245. }
  59246. child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
  59247. break;
  59248. }
  59249. case ForwardRef:
  59250. {
  59251. {
  59252. workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
  59253. }
  59254. child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);
  59255. break;
  59256. }
  59257. case MemoComponent:
  59258. {
  59259. {
  59260. if (workInProgress.type !== workInProgress.elementType) {
  59261. var outerPropTypes = Component.propTypes;
  59262. if (outerPropTypes) {
  59263. checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
  59264. 'prop', getComponentName(Component), getCurrentFiberStackInDev);
  59265. }
  59266. }
  59267. }
  59268. child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
  59269. updateExpirationTime, renderExpirationTime);
  59270. break;
  59271. }
  59272. default:
  59273. {
  59274. var hint = '';
  59275. {
  59276. if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
  59277. hint = ' Did you wrap a component in React.lazy() more than once?';
  59278. }
  59279. } // This message intentionally doesn't mention ForwardRef or MemoComponent
  59280. // because the fact that it's a separate type of work is an
  59281. // implementation detail.
  59282. {
  59283. {
  59284. throw Error("Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint);
  59285. }
  59286. }
  59287. }
  59288. }
  59289. return child;
  59290. }
  59291. function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {
  59292. if (_current !== null) {
  59293. // An incomplete component only mounts if it suspended inside a non-
  59294. // concurrent tree, in an inconsistent state. We want to treat it like
  59295. // a new mount, even though an empty version of it already committed.
  59296. // Disconnect the alternate pointers.
  59297. _current.alternate = null;
  59298. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  59299. workInProgress.effectTag |= Placement;
  59300. } // Promote the fiber to a class and try rendering again.
  59301. workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`
  59302. // Push context providers early to prevent context stack mismatches.
  59303. // During mounting we don't know the child context yet as the instance doesn't exist.
  59304. // We will invalidate the child context in finishClassComponent() right after rendering.
  59305. var hasContext;
  59306. if (isContextProvider(Component)) {
  59307. hasContext = true;
  59308. pushContextProvider(workInProgress);
  59309. } else {
  59310. hasContext = false;
  59311. }
  59312. prepareToReadContext(workInProgress, renderExpirationTime);
  59313. constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  59314. mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  59315. return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
  59316. }
  59317. function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {
  59318. if (_current !== null) {
  59319. // An indeterminate component only mounts if it suspended inside a non-
  59320. // concurrent tree, in an inconsistent state. We want to treat it like
  59321. // a new mount, even though an empty version of it already committed.
  59322. // Disconnect the alternate pointers.
  59323. _current.alternate = null;
  59324. workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
  59325. workInProgress.effectTag |= Placement;
  59326. }
  59327. var props = workInProgress.pendingProps;
  59328. var context;
  59329. if (!disableLegacyContext) {
  59330. var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
  59331. context = getMaskedContext(workInProgress, unmaskedContext);
  59332. }
  59333. prepareToReadContext(workInProgress, renderExpirationTime);
  59334. var value;
  59335. {
  59336. if (Component.prototype && typeof Component.prototype.render === 'function') {
  59337. var componentName = getComponentName(Component) || 'Unknown';
  59338. if (!didWarnAboutBadClass[componentName]) {
  59339. warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
  59340. didWarnAboutBadClass[componentName] = true;
  59341. }
  59342. }
  59343. if (workInProgress.mode & StrictMode) {
  59344. ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
  59345. }
  59346. ReactCurrentOwner$3.current = workInProgress;
  59347. value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
  59348. } // React DevTools reads this flag.
  59349. workInProgress.effectTag |= PerformedWork;
  59350. if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
  59351. {
  59352. var _componentName = getComponentName(Component) || 'Unknown';
  59353. if (!didWarnAboutModulePatternComponent[_componentName]) {
  59354. warningWithoutStack$1(false, 'The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);
  59355. didWarnAboutModulePatternComponent[_componentName] = true;
  59356. }
  59357. } // Proceed under the assumption that this is a class instance
  59358. workInProgress.tag = ClassComponent; // Throw out any hooks that were used.
  59359. resetHooks(); // Push context providers early to prevent context stack mismatches.
  59360. // During mounting we don't know the child context yet as the instance doesn't exist.
  59361. // We will invalidate the child context in finishClassComponent() right after rendering.
  59362. var hasContext = false;
  59363. if (isContextProvider(Component)) {
  59364. hasContext = true;
  59365. pushContextProvider(workInProgress);
  59366. } else {
  59367. hasContext = false;
  59368. }
  59369. workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;
  59370. var getDerivedStateFromProps = Component.getDerivedStateFromProps;
  59371. if (typeof getDerivedStateFromProps === 'function') {
  59372. applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
  59373. }
  59374. adoptClassInstance(workInProgress, value);
  59375. mountClassInstance(workInProgress, Component, props, renderExpirationTime);
  59376. return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
  59377. } else {
  59378. // Proceed under the assumption that this is a function component
  59379. workInProgress.tag = FunctionComponent;
  59380. {
  59381. if (disableLegacyContext && Component.contextTypes) {
  59382. warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(Component) || 'Unknown');
  59383. }
  59384. if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
  59385. // Only double-render components with Hooks
  59386. if (workInProgress.memoizedState !== null) {
  59387. value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
  59388. }
  59389. }
  59390. }
  59391. reconcileChildren(null, workInProgress, value, renderExpirationTime);
  59392. {
  59393. validateFunctionComponentInDev(workInProgress, Component);
  59394. }
  59395. return workInProgress.child;
  59396. }
  59397. }
  59398. function validateFunctionComponentInDev(workInProgress, Component) {
  59399. if (Component) {
  59400. !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0;
  59401. }
  59402. if (workInProgress.ref !== null) {
  59403. var info = '';
  59404. var ownerName = getCurrentFiberOwnerNameInDevOrNull();
  59405. if (ownerName) {
  59406. info += '\n\nCheck the render method of `' + ownerName + '`.';
  59407. }
  59408. var warningKey = ownerName || workInProgress._debugID || '';
  59409. var debugSource = workInProgress._debugSource;
  59410. if (debugSource) {
  59411. warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
  59412. }
  59413. if (!didWarnAboutFunctionRefs[warningKey]) {
  59414. didWarnAboutFunctionRefs[warningKey] = true;
  59415. warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
  59416. }
  59417. }
  59418. if (warnAboutDefaultPropsOnFunctionComponents && Component.defaultProps !== undefined) {
  59419. var componentName = getComponentName(Component) || 'Unknown';
  59420. if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
  59421. warningWithoutStack$1(false, '%s: Support for defaultProps will be removed from function components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName);
  59422. didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
  59423. }
  59424. }
  59425. if (typeof Component.getDerivedStateFromProps === 'function') {
  59426. var _componentName2 = getComponentName(Component) || 'Unknown';
  59427. if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {
  59428. warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', _componentName2);
  59429. didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;
  59430. }
  59431. }
  59432. if (typeof Component.contextType === 'object' && Component.contextType !== null) {
  59433. var _componentName3 = getComponentName(Component) || 'Unknown';
  59434. if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {
  59435. warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName3);
  59436. didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;
  59437. }
  59438. }
  59439. }
  59440. var SUSPENDED_MARKER = {
  59441. dehydrated: null,
  59442. retryTime: NoWork
  59443. };
  59444. function shouldRemainOnFallback(suspenseContext, current$$1, workInProgress) {
  59445. // If the context is telling us that we should show a fallback, and we're not
  59446. // already showing content, then we should show the fallback instead.
  59447. return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current$$1 === null || current$$1.memoizedState !== null);
  59448. }
  59449. function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime) {
  59450. var mode = workInProgress.mode;
  59451. var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.
  59452. {
  59453. if (shouldSuspend(workInProgress)) {
  59454. workInProgress.effectTag |= DidCapture;
  59455. }
  59456. }
  59457. var suspenseContext = suspenseStackCursor.current;
  59458. var nextDidTimeout = false;
  59459. var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect;
  59460. if (didSuspend || shouldRemainOnFallback(suspenseContext, current$$1, workInProgress)) {
  59461. // Something in this boundary's subtree already suspended. Switch to
  59462. // rendering the fallback children.
  59463. nextDidTimeout = true;
  59464. workInProgress.effectTag &= ~DidCapture;
  59465. } else {
  59466. // Attempting the main content
  59467. if (current$$1 === null || current$$1.memoizedState !== null) {
  59468. // This is a new mount or this boundary is already showing a fallback state.
  59469. // Mark this subtree context as having at least one invisible parent that could
  59470. // handle the fallback state.
  59471. // Boundaries without fallbacks or should be avoided are not considered since
  59472. // they cannot handle preferred fallback states.
  59473. if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {
  59474. suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
  59475. }
  59476. }
  59477. }
  59478. suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  59479. pushSuspenseContext(workInProgress, suspenseContext);
  59480. {
  59481. if ('maxDuration' in nextProps) {
  59482. if (!didWarnAboutMaxDuration) {
  59483. didWarnAboutMaxDuration = true;
  59484. warning$1(false, 'maxDuration has been removed from React. ' + 'Remove the maxDuration prop.');
  59485. }
  59486. }
  59487. } // This next part is a bit confusing. If the children timeout, we switch to
  59488. // showing the fallback children in place of the "primary" children.
  59489. // However, we don't want to delete the primary children because then their
  59490. // state will be lost (both the React state and the host state, e.g.
  59491. // uncontrolled form inputs). Instead we keep them mounted and hide them.
  59492. // Both the fallback children AND the primary children are rendered at the
  59493. // same time. Once the primary children are un-suspended, we can delete
  59494. // the fallback children — don't need to preserve their state.
  59495. //
  59496. // The two sets of children are siblings in the host environment, but
  59497. // semantically, for purposes of reconciliation, they are two separate sets.
  59498. // So we store them using two fragment fibers.
  59499. //
  59500. // However, we want to avoid allocating extra fibers for every placeholder.
  59501. // They're only necessary when the children time out, because that's the
  59502. // only time when both sets are mounted.
  59503. //
  59504. // So, the extra fragment fibers are only used if the children time out.
  59505. // Otherwise, we render the primary children directly. This requires some
  59506. // custom reconciliation logic to preserve the state of the primary
  59507. // children. It's essentially a very basic form of re-parenting.
  59508. if (current$$1 === null) {
  59509. // If we're currently hydrating, try to hydrate this boundary.
  59510. // But only if this has a fallback.
  59511. if (nextProps.fallback !== undefined) {
  59512. tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.
  59513. if (enableSuspenseServerRenderer) {
  59514. var suspenseState = workInProgress.memoizedState;
  59515. if (suspenseState !== null) {
  59516. var dehydrated = suspenseState.dehydrated;
  59517. if (dehydrated !== null) {
  59518. return mountDehydratedSuspenseComponent(workInProgress, dehydrated, renderExpirationTime);
  59519. }
  59520. }
  59521. }
  59522. } // This is the initial mount. This branch is pretty simple because there's
  59523. // no previous state that needs to be preserved.
  59524. if (nextDidTimeout) {
  59525. // Mount separate fragments for primary and fallback children.
  59526. var nextFallbackChildren = nextProps.fallback;
  59527. var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
  59528. primaryChildFragment.return = workInProgress;
  59529. if ((workInProgress.mode & BlockingMode) === NoMode) {
  59530. // Outside of blocking mode, we commit the effects from the
  59531. // partially completed, timed-out tree, too.
  59532. var progressedState = workInProgress.memoizedState;
  59533. var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
  59534. primaryChildFragment.child = progressedPrimaryChild;
  59535. var progressedChild = progressedPrimaryChild;
  59536. while (progressedChild !== null) {
  59537. progressedChild.return = primaryChildFragment;
  59538. progressedChild = progressedChild.sibling;
  59539. }
  59540. }
  59541. var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);
  59542. fallbackChildFragment.return = workInProgress;
  59543. primaryChildFragment.sibling = fallbackChildFragment; // Skip the primary children, and continue working on the
  59544. // fallback children.
  59545. workInProgress.memoizedState = SUSPENDED_MARKER;
  59546. workInProgress.child = primaryChildFragment;
  59547. return fallbackChildFragment;
  59548. } else {
  59549. // Mount the primary children without an intermediate fragment fiber.
  59550. var nextPrimaryChildren = nextProps.children;
  59551. workInProgress.memoizedState = null;
  59552. return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);
  59553. }
  59554. } else {
  59555. // This is an update. This branch is more complicated because we need to
  59556. // ensure the state of the primary children is preserved.
  59557. var prevState = current$$1.memoizedState;
  59558. if (prevState !== null) {
  59559. if (enableSuspenseServerRenderer) {
  59560. var _dehydrated = prevState.dehydrated;
  59561. if (_dehydrated !== null) {
  59562. if (!didSuspend) {
  59563. return updateDehydratedSuspenseComponent(current$$1, workInProgress, _dehydrated, prevState, renderExpirationTime);
  59564. } else if (workInProgress.memoizedState !== null) {
  59565. // Something suspended and we should still be in dehydrated mode.
  59566. // Leave the existing child in place.
  59567. workInProgress.child = current$$1.child; // The dehydrated completion pass expects this flag to be there
  59568. // but the normal suspense pass doesn't.
  59569. workInProgress.effectTag |= DidCapture;
  59570. return null;
  59571. } else {
  59572. // Suspended but we should no longer be in dehydrated mode.
  59573. // Therefore we now have to render the fallback. Wrap the children
  59574. // in a fragment fiber to keep them separate from the fallback
  59575. // children.
  59576. var _nextFallbackChildren = nextProps.fallback;
  59577. var _primaryChildFragment = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't
  59578. // going to render this fragment.
  59579. null, mode, NoWork, null);
  59580. _primaryChildFragment.return = workInProgress; // This is always null since we never want the previous child
  59581. // that we're not going to hydrate.
  59582. _primaryChildFragment.child = null;
  59583. if ((workInProgress.mode & BlockingMode) === NoMode) {
  59584. // Outside of blocking mode, we commit the effects from the
  59585. // partially completed, timed-out tree, too.
  59586. var _progressedChild = _primaryChildFragment.child = workInProgress.child;
  59587. while (_progressedChild !== null) {
  59588. _progressedChild.return = _primaryChildFragment;
  59589. _progressedChild = _progressedChild.sibling;
  59590. }
  59591. } else {
  59592. // We will have dropped the effect list which contains the deletion.
  59593. // We need to reconcile to delete the current child.
  59594. reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime);
  59595. } // Because primaryChildFragment is a new fiber that we're inserting as the
  59596. // parent of a new tree, we need to set its treeBaseDuration.
  59597. if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
  59598. // treeBaseDuration is the sum of all the child tree base durations.
  59599. var treeBaseDuration = 0;
  59600. var hiddenChild = _primaryChildFragment.child;
  59601. while (hiddenChild !== null) {
  59602. treeBaseDuration += hiddenChild.treeBaseDuration;
  59603. hiddenChild = hiddenChild.sibling;
  59604. }
  59605. _primaryChildFragment.treeBaseDuration = treeBaseDuration;
  59606. } // Create a fragment from the fallback children, too.
  59607. var _fallbackChildFragment = createFiberFromFragment(_nextFallbackChildren, mode, renderExpirationTime, null);
  59608. _fallbackChildFragment.return = workInProgress;
  59609. _primaryChildFragment.sibling = _fallbackChildFragment;
  59610. _fallbackChildFragment.effectTag |= Placement;
  59611. _primaryChildFragment.childExpirationTime = NoWork;
  59612. workInProgress.memoizedState = SUSPENDED_MARKER;
  59613. workInProgress.child = _primaryChildFragment; // Skip the primary children, and continue working on the
  59614. // fallback children.
  59615. return _fallbackChildFragment;
  59616. }
  59617. }
  59618. } // The current tree already timed out. That means each child set is
  59619. // wrapped in a fragment fiber.
  59620. var currentPrimaryChildFragment = current$$1.child;
  59621. var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
  59622. if (nextDidTimeout) {
  59623. // Still timed out. Reuse the current primary children by cloning
  59624. // its fragment. We're going to skip over these entirely.
  59625. var _nextFallbackChildren2 = nextProps.fallback;
  59626. var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps, NoWork);
  59627. _primaryChildFragment2.return = workInProgress;
  59628. if ((workInProgress.mode & BlockingMode) === NoMode) {
  59629. // Outside of blocking mode, we commit the effects from the
  59630. // partially completed, timed-out tree, too.
  59631. var _progressedState = workInProgress.memoizedState;
  59632. var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;
  59633. if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
  59634. _primaryChildFragment2.child = _progressedPrimaryChild;
  59635. var _progressedChild2 = _progressedPrimaryChild;
  59636. while (_progressedChild2 !== null) {
  59637. _progressedChild2.return = _primaryChildFragment2;
  59638. _progressedChild2 = _progressedChild2.sibling;
  59639. }
  59640. }
  59641. } // Because primaryChildFragment is a new fiber that we're inserting as the
  59642. // parent of a new tree, we need to set its treeBaseDuration.
  59643. if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
  59644. // treeBaseDuration is the sum of all the child tree base durations.
  59645. var _treeBaseDuration = 0;
  59646. var _hiddenChild = _primaryChildFragment2.child;
  59647. while (_hiddenChild !== null) {
  59648. _treeBaseDuration += _hiddenChild.treeBaseDuration;
  59649. _hiddenChild = _hiddenChild.sibling;
  59650. }
  59651. _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
  59652. } // Clone the fallback child fragment, too. These we'll continue
  59653. // working on.
  59654. var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2, currentFallbackChildFragment.expirationTime);
  59655. _fallbackChildFragment2.return = workInProgress;
  59656. _primaryChildFragment2.sibling = _fallbackChildFragment2;
  59657. _primaryChildFragment2.childExpirationTime = NoWork; // Skip the primary children, and continue working on the
  59658. // fallback children.
  59659. workInProgress.memoizedState = SUSPENDED_MARKER;
  59660. workInProgress.child = _primaryChildFragment2;
  59661. return _fallbackChildFragment2;
  59662. } else {
  59663. // No longer suspended. Switch back to showing the primary children,
  59664. // and remove the intermediate fragment fiber.
  59665. var _nextPrimaryChildren = nextProps.children;
  59666. var currentPrimaryChild = currentPrimaryChildFragment.child;
  59667. var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime); // If this render doesn't suspend, we need to delete the fallback
  59668. // children. Wait until the complete phase, after we've confirmed the
  59669. // fallback is no longer needed.
  59670. // TODO: Would it be better to store the fallback fragment on
  59671. // the stateNode?
  59672. // Continue rendering the children, like we normally do.
  59673. workInProgress.memoizedState = null;
  59674. return workInProgress.child = primaryChild;
  59675. }
  59676. } else {
  59677. // The current tree has not already timed out. That means the primary
  59678. // children are not wrapped in a fragment fiber.
  59679. var _currentPrimaryChild = current$$1.child;
  59680. if (nextDidTimeout) {
  59681. // Timed out. Wrap the children in a fragment fiber to keep them
  59682. // separate from the fallback children.
  59683. var _nextFallbackChildren3 = nextProps.fallback;
  59684. var _primaryChildFragment3 = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't
  59685. // going to render this fragment.
  59686. null, mode, NoWork, null);
  59687. _primaryChildFragment3.return = workInProgress;
  59688. _primaryChildFragment3.child = _currentPrimaryChild;
  59689. if (_currentPrimaryChild !== null) {
  59690. _currentPrimaryChild.return = _primaryChildFragment3;
  59691. } // Even though we're creating a new fiber, there are no new children,
  59692. // because we're reusing an already mounted tree. So we don't need to
  59693. // schedule a placement.
  59694. // primaryChildFragment.effectTag |= Placement;
  59695. if ((workInProgress.mode & BlockingMode) === NoMode) {
  59696. // Outside of blocking mode, we commit the effects from the
  59697. // partially completed, timed-out tree, too.
  59698. var _progressedState2 = workInProgress.memoizedState;
  59699. var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;
  59700. _primaryChildFragment3.child = _progressedPrimaryChild2;
  59701. var _progressedChild3 = _progressedPrimaryChild2;
  59702. while (_progressedChild3 !== null) {
  59703. _progressedChild3.return = _primaryChildFragment3;
  59704. _progressedChild3 = _progressedChild3.sibling;
  59705. }
  59706. } // Because primaryChildFragment is a new fiber that we're inserting as the
  59707. // parent of a new tree, we need to set its treeBaseDuration.
  59708. if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
  59709. // treeBaseDuration is the sum of all the child tree base durations.
  59710. var _treeBaseDuration2 = 0;
  59711. var _hiddenChild2 = _primaryChildFragment3.child;
  59712. while (_hiddenChild2 !== null) {
  59713. _treeBaseDuration2 += _hiddenChild2.treeBaseDuration;
  59714. _hiddenChild2 = _hiddenChild2.sibling;
  59715. }
  59716. _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;
  59717. } // Create a fragment from the fallback children, too.
  59718. var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null);
  59719. _fallbackChildFragment3.return = workInProgress;
  59720. _primaryChildFragment3.sibling = _fallbackChildFragment3;
  59721. _fallbackChildFragment3.effectTag |= Placement;
  59722. _primaryChildFragment3.childExpirationTime = NoWork; // Skip the primary children, and continue working on the
  59723. // fallback children.
  59724. workInProgress.memoizedState = SUSPENDED_MARKER;
  59725. workInProgress.child = _primaryChildFragment3;
  59726. return _fallbackChildFragment3;
  59727. } else {
  59728. // Still haven't timed out. Continue rendering the children, like we
  59729. // normally do.
  59730. workInProgress.memoizedState = null;
  59731. var _nextPrimaryChildren2 = nextProps.children;
  59732. return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
  59733. }
  59734. }
  59735. }
  59736. }
  59737. function retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime) {
  59738. // We're now not suspended nor dehydrated.
  59739. workInProgress.memoizedState = null; // Retry with the full children.
  59740. var nextProps = workInProgress.pendingProps;
  59741. var nextChildren = nextProps.children; // This will ensure that the children get Placement effects and
  59742. // that the old child gets a Deletion effect.
  59743. // We could also call forceUnmountCurrentAndReconcile.
  59744. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  59745. return workInProgress.child;
  59746. }
  59747. function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderExpirationTime) {
  59748. // During the first pass, we'll bail out and not drill into the children.
  59749. // Instead, we'll leave the content in place and try to hydrate it later.
  59750. if ((workInProgress.mode & BlockingMode) === NoMode) {
  59751. {
  59752. warning$1(false, 'Cannot hydrate Suspense in legacy mode. Switch from ' + 'ReactDOM.hydrate(element, container) to ' + 'ReactDOM.createBlockingRoot(container, { hydrate: true })' + '.render(element) or remove the Suspense components from ' + 'the server rendered components.');
  59753. }
  59754. workInProgress.expirationTime = Sync;
  59755. } else if (isSuspenseInstanceFallback(suspenseInstance)) {
  59756. // This is a client-only boundary. Since we won't get any content from the server
  59757. // for this, we need to schedule that at a higher priority based on when it would
  59758. // have timed out. In theory we could render it in this pass but it would have the
  59759. // wrong priority associated with it and will prevent hydration of parent path.
  59760. // Instead, we'll leave work left on it to render it in a separate commit.
  59761. // TODO This time should be the time at which the server rendered response that is
  59762. // a parent to this boundary was displayed. However, since we currently don't have
  59763. // a protocol to transfer that time, we'll just estimate it by using the current
  59764. // time. This will mean that Suspense timeouts are slightly shifted to later than
  59765. // they should be.
  59766. var serverDisplayTime = requestCurrentTimeForUpdate(); // Schedule a normal pri update to render this content.
  59767. var newExpirationTime = computeAsyncExpiration(serverDisplayTime);
  59768. if (enableSchedulerTracing) {
  59769. markSpawnedWork(newExpirationTime);
  59770. }
  59771. workInProgress.expirationTime = newExpirationTime;
  59772. } else {
  59773. // We'll continue hydrating the rest at offscreen priority since we'll already
  59774. // be showing the right content coming from the server, it is no rush.
  59775. workInProgress.expirationTime = Never;
  59776. if (enableSchedulerTracing) {
  59777. markSpawnedWork(Never);
  59778. }
  59779. }
  59780. return null;
  59781. }
  59782. function updateDehydratedSuspenseComponent(current$$1, workInProgress, suspenseInstance, suspenseState, renderExpirationTime) {
  59783. // We should never be hydrating at this point because it is the first pass,
  59784. // but after we've already committed once.
  59785. warnIfHydrating();
  59786. if ((workInProgress.mode & BlockingMode) === NoMode) {
  59787. return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
  59788. }
  59789. if (isSuspenseInstanceFallback(suspenseInstance)) {
  59790. // This boundary is in a permanent fallback state. In this case, we'll never
  59791. // get an update and we'll never be able to hydrate the final content. Let's just try the
  59792. // client side render instead.
  59793. return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
  59794. } // We use childExpirationTime to indicate that a child might depend on context, so if
  59795. // any context has changed, we need to treat is as if the input might have changed.
  59796. var hasContextChanged$$1 = current$$1.childExpirationTime >= renderExpirationTime;
  59797. if (didReceiveUpdate || hasContextChanged$$1) {
  59798. // This boundary has changed since the first render. This means that we are now unable to
  59799. // hydrate it. We might still be able to hydrate it using an earlier expiration time, if
  59800. // we are rendering at lower expiration than sync.
  59801. if (renderExpirationTime < Sync) {
  59802. if (suspenseState.retryTime <= renderExpirationTime) {
  59803. // This render is even higher pri than we've seen before, let's try again
  59804. // at even higher pri.
  59805. var attemptHydrationAtExpirationTime = renderExpirationTime + 1;
  59806. suspenseState.retryTime = attemptHydrationAtExpirationTime;
  59807. scheduleWork(current$$1, attemptHydrationAtExpirationTime); // TODO: Early abort this render.
  59808. } else {// We have already tried to ping at a higher priority than we're rendering with
  59809. // so if we got here, we must have failed to hydrate at those levels. We must
  59810. // now give up. Instead, we're going to delete the whole subtree and instead inject
  59811. // a new real Suspense boundary to take its place, which may render content
  59812. // or fallback. This might suspend for a while and if it does we might still have
  59813. // an opportunity to hydrate before this pass commits.
  59814. }
  59815. } // If we have scheduled higher pri work above, this will probably just abort the render
  59816. // since we now have higher priority work, but in case it doesn't, we need to prepare to
  59817. // render something, if we time out. Even if that requires us to delete everything and
  59818. // skip hydration.
  59819. // Delay having to do this as long as the suspense timeout allows us.
  59820. renderDidSuspendDelayIfPossible();
  59821. return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
  59822. } else if (isSuspenseInstancePending(suspenseInstance)) {
  59823. // This component is still pending more data from the server, so we can't hydrate its
  59824. // content. We treat it as if this component suspended itself. It might seem as if
  59825. // we could just try to render it client-side instead. However, this will perform a
  59826. // lot of unnecessary work and is unlikely to complete since it often will suspend
  59827. // on missing data anyway. Additionally, the server might be able to render more
  59828. // than we can on the client yet. In that case we'd end up with more fallback states
  59829. // on the client than if we just leave it alone. If the server times out or errors
  59830. // these should update this boundary to the permanent Fallback state instead.
  59831. // Mark it as having captured (i.e. suspended).
  59832. workInProgress.effectTag |= DidCapture; // Leave the child in place. I.e. the dehydrated fragment.
  59833. workInProgress.child = current$$1.child; // Register a callback to retry this boundary once the server has sent the result.
  59834. registerSuspenseInstanceRetry(suspenseInstance, retryDehydratedSuspenseBoundary.bind(null, current$$1));
  59835. return null;
  59836. } else {
  59837. // This is the first attempt.
  59838. reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance);
  59839. var nextProps = workInProgress.pendingProps;
  59840. var nextChildren = nextProps.children;
  59841. var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  59842. var node = child;
  59843. while (node) {
  59844. // Mark each child as hydrating. This is a fast path to know whether this
  59845. // tree is part of a hydrating tree. This is used to determine if a child
  59846. // node has fully mounted yet, and for scheduling event replaying.
  59847. // Conceptually this is similar to Placement in that a new subtree is
  59848. // inserted into the React tree here. It just happens to not need DOM
  59849. // mutations because it already exists.
  59850. node.effectTag |= Hydrating;
  59851. node = node.sibling;
  59852. }
  59853. workInProgress.child = child;
  59854. return workInProgress.child;
  59855. }
  59856. }
  59857. function scheduleWorkOnFiber(fiber, renderExpirationTime) {
  59858. if (fiber.expirationTime < renderExpirationTime) {
  59859. fiber.expirationTime = renderExpirationTime;
  59860. }
  59861. var alternate = fiber.alternate;
  59862. if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
  59863. alternate.expirationTime = renderExpirationTime;
  59864. }
  59865. scheduleWorkOnParentPath(fiber.return, renderExpirationTime);
  59866. }
  59867. function propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {
  59868. // Mark any Suspense boundaries with fallbacks as having work to do.
  59869. // If they were previously forced into fallbacks, they may now be able
  59870. // to unblock.
  59871. var node = firstChild;
  59872. while (node !== null) {
  59873. if (node.tag === SuspenseComponent) {
  59874. var state = node.memoizedState;
  59875. if (state !== null) {
  59876. scheduleWorkOnFiber(node, renderExpirationTime);
  59877. }
  59878. } else if (node.tag === SuspenseListComponent) {
  59879. // If the tail is hidden there might not be an Suspense boundaries
  59880. // to schedule work on. In this case we have to schedule it on the
  59881. // list itself.
  59882. // We don't have to traverse to the children of the list since
  59883. // the list will propagate the change when it rerenders.
  59884. scheduleWorkOnFiber(node, renderExpirationTime);
  59885. } else if (node.child !== null) {
  59886. node.child.return = node;
  59887. node = node.child;
  59888. continue;
  59889. }
  59890. if (node === workInProgress) {
  59891. return;
  59892. }
  59893. while (node.sibling === null) {
  59894. if (node.return === null || node.return === workInProgress) {
  59895. return;
  59896. }
  59897. node = node.return;
  59898. }
  59899. node.sibling.return = node.return;
  59900. node = node.sibling;
  59901. }
  59902. }
  59903. function findLastContentRow(firstChild) {
  59904. // This is going to find the last row among these children that is already
  59905. // showing content on the screen, as opposed to being in fallback state or
  59906. // new. If a row has multiple Suspense boundaries, any of them being in the
  59907. // fallback state, counts as the whole row being in a fallback state.
  59908. // Note that the "rows" will be workInProgress, but any nested children
  59909. // will still be current since we haven't rendered them yet. The mounted
  59910. // order may not be the same as the new order. We use the new order.
  59911. var row = firstChild;
  59912. var lastContentRow = null;
  59913. while (row !== null) {
  59914. var currentRow = row.alternate; // New rows can't be content rows.
  59915. if (currentRow !== null && findFirstSuspended(currentRow) === null) {
  59916. lastContentRow = row;
  59917. }
  59918. row = row.sibling;
  59919. }
  59920. return lastContentRow;
  59921. }
  59922. function validateRevealOrder(revealOrder) {
  59923. {
  59924. if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {
  59925. didWarnAboutRevealOrder[revealOrder] = true;
  59926. if (typeof revealOrder === 'string') {
  59927. switch (revealOrder.toLowerCase()) {
  59928. case 'together':
  59929. case 'forwards':
  59930. case 'backwards':
  59931. {
  59932. warning$1(false, '"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
  59933. break;
  59934. }
  59935. case 'forward':
  59936. case 'backward':
  59937. {
  59938. warning$1(false, '"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
  59939. break;
  59940. }
  59941. default:
  59942. warning$1(false, '"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
  59943. break;
  59944. }
  59945. } else {
  59946. warning$1(false, '%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
  59947. }
  59948. }
  59949. }
  59950. }
  59951. function validateTailOptions(tailMode, revealOrder) {
  59952. {
  59953. if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {
  59954. if (tailMode !== 'collapsed' && tailMode !== 'hidden') {
  59955. didWarnAboutTailOptions[tailMode] = true;
  59956. warning$1(false, '"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode);
  59957. } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {
  59958. didWarnAboutTailOptions[tailMode] = true;
  59959. warning$1(false, '<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode);
  59960. }
  59961. }
  59962. }
  59963. }
  59964. function validateSuspenseListNestedChild(childSlot, index) {
  59965. {
  59966. var isArray = Array.isArray(childSlot);
  59967. var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';
  59968. if (isArray || isIterable) {
  59969. var type = isArray ? 'array' : 'iterable';
  59970. warning$1(false, 'A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);
  59971. return false;
  59972. }
  59973. }
  59974. return true;
  59975. }
  59976. function validateSuspenseListChildren(children, revealOrder) {
  59977. {
  59978. if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {
  59979. if (Array.isArray(children)) {
  59980. for (var i = 0; i < children.length; i++) {
  59981. if (!validateSuspenseListNestedChild(children[i], i)) {
  59982. return;
  59983. }
  59984. }
  59985. } else {
  59986. var iteratorFn = getIteratorFn(children);
  59987. if (typeof iteratorFn === 'function') {
  59988. var childrenIterator = iteratorFn.call(children);
  59989. if (childrenIterator) {
  59990. var step = childrenIterator.next();
  59991. var _i = 0;
  59992. for (; !step.done; step = childrenIterator.next()) {
  59993. if (!validateSuspenseListNestedChild(step.value, _i)) {
  59994. return;
  59995. }
  59996. _i++;
  59997. }
  59998. }
  59999. } else {
  60000. warning$1(false, 'A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);
  60001. }
  60002. }
  60003. }
  60004. }
  60005. }
  60006. function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
  60007. var renderState = workInProgress.memoizedState;
  60008. if (renderState === null) {
  60009. workInProgress.memoizedState = {
  60010. isBackwards: isBackwards,
  60011. rendering: null,
  60012. last: lastContentRow,
  60013. tail: tail,
  60014. tailExpiration: 0,
  60015. tailMode: tailMode,
  60016. lastEffect: lastEffectBeforeRendering
  60017. };
  60018. } else {
  60019. // We can reuse the existing object from previous renders.
  60020. renderState.isBackwards = isBackwards;
  60021. renderState.rendering = null;
  60022. renderState.last = lastContentRow;
  60023. renderState.tail = tail;
  60024. renderState.tailExpiration = 0;
  60025. renderState.tailMode = tailMode;
  60026. renderState.lastEffect = lastEffectBeforeRendering;
  60027. }
  60028. } // This can end up rendering this component multiple passes.
  60029. // The first pass splits the children fibers into two sets. A head and tail.
  60030. // We first render the head. If anything is in fallback state, we do another
  60031. // pass through beginWork to rerender all children (including the tail) with
  60032. // the force suspend context. If the first render didn't have anything in
  60033. // in fallback state. Then we render each row in the tail one-by-one.
  60034. // That happens in the completeWork phase without going back to beginWork.
  60035. function updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime) {
  60036. var nextProps = workInProgress.pendingProps;
  60037. var revealOrder = nextProps.revealOrder;
  60038. var tailMode = nextProps.tail;
  60039. var newChildren = nextProps.children;
  60040. validateRevealOrder(revealOrder);
  60041. validateTailOptions(tailMode, revealOrder);
  60042. validateSuspenseListChildren(newChildren, revealOrder);
  60043. reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
  60044. var suspenseContext = suspenseStackCursor.current;
  60045. var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
  60046. if (shouldForceFallback) {
  60047. suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
  60048. workInProgress.effectTag |= DidCapture;
  60049. } else {
  60050. var didSuspendBefore = current$$1 !== null && (current$$1.effectTag & DidCapture) !== NoEffect;
  60051. if (didSuspendBefore) {
  60052. // If we previously forced a fallback, we need to schedule work
  60053. // on any nested boundaries to let them know to try to render
  60054. // again. This is the same as context updating.
  60055. propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);
  60056. }
  60057. suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  60058. }
  60059. pushSuspenseContext(workInProgress, suspenseContext);
  60060. if ((workInProgress.mode & BlockingMode) === NoMode) {
  60061. // Outside of blocking mode, SuspenseList doesn't work so we just
  60062. // use make it a noop by treating it as the default revealOrder.
  60063. workInProgress.memoizedState = null;
  60064. } else {
  60065. switch (revealOrder) {
  60066. case 'forwards':
  60067. {
  60068. var lastContentRow = findLastContentRow(workInProgress.child);
  60069. var tail;
  60070. if (lastContentRow === null) {
  60071. // The whole list is part of the tail.
  60072. // TODO: We could fast path by just rendering the tail now.
  60073. tail = workInProgress.child;
  60074. workInProgress.child = null;
  60075. } else {
  60076. // Disconnect the tail rows after the content row.
  60077. // We're going to render them separately later.
  60078. tail = lastContentRow.sibling;
  60079. lastContentRow.sibling = null;
  60080. }
  60081. initSuspenseListRenderState(workInProgress, false, // isBackwards
  60082. tail, lastContentRow, tailMode, workInProgress.lastEffect);
  60083. break;
  60084. }
  60085. case 'backwards':
  60086. {
  60087. // We're going to find the first row that has existing content.
  60088. // At the same time we're going to reverse the list of everything
  60089. // we pass in the meantime. That's going to be our tail in reverse
  60090. // order.
  60091. var _tail = null;
  60092. var row = workInProgress.child;
  60093. workInProgress.child = null;
  60094. while (row !== null) {
  60095. var currentRow = row.alternate; // New rows can't be content rows.
  60096. if (currentRow !== null && findFirstSuspended(currentRow) === null) {
  60097. // This is the beginning of the main content.
  60098. workInProgress.child = row;
  60099. break;
  60100. }
  60101. var nextRow = row.sibling;
  60102. row.sibling = _tail;
  60103. _tail = row;
  60104. row = nextRow;
  60105. } // TODO: If workInProgress.child is null, we can continue on the tail immediately.
  60106. initSuspenseListRenderState(workInProgress, true, // isBackwards
  60107. _tail, null, // last
  60108. tailMode, workInProgress.lastEffect);
  60109. break;
  60110. }
  60111. case 'together':
  60112. {
  60113. initSuspenseListRenderState(workInProgress, false, // isBackwards
  60114. null, // tail
  60115. null, // last
  60116. undefined, workInProgress.lastEffect);
  60117. break;
  60118. }
  60119. default:
  60120. {
  60121. // The default reveal order is the same as not having
  60122. // a boundary.
  60123. workInProgress.memoizedState = null;
  60124. }
  60125. }
  60126. }
  60127. return workInProgress.child;
  60128. }
  60129. function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) {
  60130. pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  60131. var nextChildren = workInProgress.pendingProps;
  60132. if (current$$1 === null) {
  60133. // Portals are special because we don't append the children during mount
  60134. // but at commit. Therefore we need to track insertions which the normal
  60135. // flow doesn't do during mount. This doesn't happen at the root because
  60136. // the root always starts with a "current" with a null child.
  60137. // TODO: Consider unifying this with how the root works.
  60138. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  60139. } else {
  60140. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  60141. }
  60142. return workInProgress.child;
  60143. }
  60144. function updateContextProvider(current$$1, workInProgress, renderExpirationTime) {
  60145. var providerType = workInProgress.type;
  60146. var context = providerType._context;
  60147. var newProps = workInProgress.pendingProps;
  60148. var oldProps = workInProgress.memoizedProps;
  60149. var newValue = newProps.value;
  60150. {
  60151. var providerPropTypes = workInProgress.type.propTypes;
  60152. if (providerPropTypes) {
  60153. checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);
  60154. }
  60155. }
  60156. pushProvider(workInProgress, newValue);
  60157. if (oldProps !== null) {
  60158. var oldValue = oldProps.value;
  60159. var changedBits = calculateChangedBits(context, newValue, oldValue);
  60160. if (changedBits === 0) {
  60161. // No change. Bailout early if children are the same.
  60162. if (oldProps.children === newProps.children && !hasContextChanged()) {
  60163. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  60164. }
  60165. } else {
  60166. // The context value changed. Search for matching consumers and schedule
  60167. // them to update.
  60168. propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
  60169. }
  60170. }
  60171. var newChildren = newProps.children;
  60172. reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
  60173. return workInProgress.child;
  60174. }
  60175. var hasWarnedAboutUsingContextAsConsumer = false;
  60176. function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) {
  60177. var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In
  60178. // DEV mode, we create a separate object for Context.Consumer that acts
  60179. // like a proxy to Context. This proxy object adds unnecessary code in PROD
  60180. // so we use the old behaviour (Context.Consumer references Context) to
  60181. // reduce size and overhead. The separate object references context via
  60182. // a property called "_context", which also gives us the ability to check
  60183. // in DEV mode if this property exists or not and warn if it does not.
  60184. {
  60185. if (context._context === undefined) {
  60186. // This may be because it's a Context (rather than a Consumer).
  60187. // Or it may be because it's older React where they're the same thing.
  60188. // We only want to warn if we're sure it's a new React.
  60189. if (context !== context.Consumer) {
  60190. if (!hasWarnedAboutUsingContextAsConsumer) {
  60191. hasWarnedAboutUsingContextAsConsumer = true;
  60192. warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
  60193. }
  60194. }
  60195. } else {
  60196. context = context._context;
  60197. }
  60198. }
  60199. var newProps = workInProgress.pendingProps;
  60200. var render = newProps.children;
  60201. {
  60202. !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0;
  60203. }
  60204. prepareToReadContext(workInProgress, renderExpirationTime);
  60205. var newValue = readContext(context, newProps.unstable_observedBits);
  60206. var newChildren;
  60207. {
  60208. ReactCurrentOwner$3.current = workInProgress;
  60209. setCurrentPhase('render');
  60210. newChildren = render(newValue);
  60211. setCurrentPhase(null);
  60212. } // React DevTools reads this flag.
  60213. workInProgress.effectTag |= PerformedWork;
  60214. reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
  60215. return workInProgress.child;
  60216. }
  60217. function updateFundamentalComponent$1(current$$1, workInProgress, renderExpirationTime) {
  60218. var fundamentalImpl = workInProgress.type.impl;
  60219. if (fundamentalImpl.reconcileChildren === false) {
  60220. return null;
  60221. }
  60222. var nextProps = workInProgress.pendingProps;
  60223. var nextChildren = nextProps.children;
  60224. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  60225. return workInProgress.child;
  60226. }
  60227. function updateScopeComponent(current$$1, workInProgress, renderExpirationTime) {
  60228. var nextProps = workInProgress.pendingProps;
  60229. var nextChildren = nextProps.children;
  60230. reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  60231. return workInProgress.child;
  60232. }
  60233. function markWorkInProgressReceivedUpdate() {
  60234. didReceiveUpdate = true;
  60235. }
  60236. function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) {
  60237. cancelWorkTimer(workInProgress);
  60238. if (current$$1 !== null) {
  60239. // Reuse previous dependencies
  60240. workInProgress.dependencies = current$$1.dependencies;
  60241. }
  60242. if (enableProfilerTimer) {
  60243. // Don't update "base" render times for bailouts.
  60244. stopProfilerTimerIfRunning(workInProgress);
  60245. }
  60246. var updateExpirationTime = workInProgress.expirationTime;
  60247. if (updateExpirationTime !== NoWork) {
  60248. markUnprocessedUpdateTime(updateExpirationTime);
  60249. } // Check if the children have any pending work.
  60250. var childExpirationTime = workInProgress.childExpirationTime;
  60251. if (childExpirationTime < renderExpirationTime) {
  60252. // The children don't have any work either. We can skip them.
  60253. // TODO: Once we add back resuming, we should check if the children are
  60254. // a work-in-progress set. If so, we need to transfer their effects.
  60255. return null;
  60256. } else {
  60257. // This fiber doesn't have work, but its subtree does. Clone the child
  60258. // fibers and continue.
  60259. cloneChildFibers(current$$1, workInProgress);
  60260. return workInProgress.child;
  60261. }
  60262. }
  60263. function remountFiber(current$$1, oldWorkInProgress, newWorkInProgress) {
  60264. {
  60265. var returnFiber = oldWorkInProgress.return;
  60266. if (returnFiber === null) {
  60267. throw new Error('Cannot swap the root fiber.');
  60268. } // Disconnect from the old current.
  60269. // It will get deleted.
  60270. current$$1.alternate = null;
  60271. oldWorkInProgress.alternate = null; // Connect to the new tree.
  60272. newWorkInProgress.index = oldWorkInProgress.index;
  60273. newWorkInProgress.sibling = oldWorkInProgress.sibling;
  60274. newWorkInProgress.return = oldWorkInProgress.return;
  60275. newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.
  60276. if (oldWorkInProgress === returnFiber.child) {
  60277. returnFiber.child = newWorkInProgress;
  60278. } else {
  60279. var prevSibling = returnFiber.child;
  60280. if (prevSibling === null) {
  60281. throw new Error('Expected parent to have a child.');
  60282. }
  60283. while (prevSibling.sibling !== oldWorkInProgress) {
  60284. prevSibling = prevSibling.sibling;
  60285. if (prevSibling === null) {
  60286. throw new Error('Expected to find the previous sibling.');
  60287. }
  60288. }
  60289. prevSibling.sibling = newWorkInProgress;
  60290. } // Delete the old fiber and place the new one.
  60291. // Since the old fiber is disconnected, we have to schedule it manually.
  60292. var last = returnFiber.lastEffect;
  60293. if (last !== null) {
  60294. last.nextEffect = current$$1;
  60295. returnFiber.lastEffect = current$$1;
  60296. } else {
  60297. returnFiber.firstEffect = returnFiber.lastEffect = current$$1;
  60298. }
  60299. current$$1.nextEffect = null;
  60300. current$$1.effectTag = Deletion;
  60301. newWorkInProgress.effectTag |= Placement; // Restart work from the new fiber.
  60302. return newWorkInProgress;
  60303. }
  60304. }
  60305. function beginWork$1(current$$1, workInProgress, renderExpirationTime) {
  60306. var updateExpirationTime = workInProgress.expirationTime;
  60307. {
  60308. if (workInProgress._debugNeedsRemount && current$$1 !== null) {
  60309. // This will restart the begin phase with a new fiber.
  60310. return remountFiber(current$$1, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));
  60311. }
  60312. }
  60313. if (current$$1 !== null) {
  60314. var oldProps = current$$1.memoizedProps;
  60315. var newProps = workInProgress.pendingProps;
  60316. if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:
  60317. workInProgress.type !== current$$1.type)) {
  60318. // If props or context changed, mark the fiber as having performed work.
  60319. // This may be unset if the props are determined to be equal later (memo).
  60320. didReceiveUpdate = true;
  60321. } else if (updateExpirationTime < renderExpirationTime) {
  60322. didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering
  60323. // the begin phase. There's still some bookkeeping we that needs to be done
  60324. // in this optimized path, mostly pushing stuff onto the stack.
  60325. switch (workInProgress.tag) {
  60326. case HostRoot:
  60327. pushHostRootContext(workInProgress);
  60328. resetHydrationState();
  60329. break;
  60330. case HostComponent:
  60331. pushHostContext(workInProgress);
  60332. if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {
  60333. if (enableSchedulerTracing) {
  60334. markSpawnedWork(Never);
  60335. } // Schedule this fiber to re-render at offscreen priority. Then bailout.
  60336. workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
  60337. return null;
  60338. }
  60339. break;
  60340. case ClassComponent:
  60341. {
  60342. var Component = workInProgress.type;
  60343. if (isContextProvider(Component)) {
  60344. pushContextProvider(workInProgress);
  60345. }
  60346. break;
  60347. }
  60348. case HostPortal:
  60349. pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  60350. break;
  60351. case ContextProvider:
  60352. {
  60353. var newValue = workInProgress.memoizedProps.value;
  60354. pushProvider(workInProgress, newValue);
  60355. break;
  60356. }
  60357. case Profiler:
  60358. if (enableProfilerTimer) {
  60359. // Profiler should only call onRender when one of its descendants actually rendered.
  60360. var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
  60361. if (hasChildWork) {
  60362. workInProgress.effectTag |= Update;
  60363. }
  60364. }
  60365. break;
  60366. case SuspenseComponent:
  60367. {
  60368. var state = workInProgress.memoizedState;
  60369. if (state !== null) {
  60370. if (enableSuspenseServerRenderer) {
  60371. if (state.dehydrated !== null) {
  60372. pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // We know that this component will suspend again because if it has
  60373. // been unsuspended it has committed as a resolved Suspense component.
  60374. // If it needs to be retried, it should have work scheduled on it.
  60375. workInProgress.effectTag |= DidCapture;
  60376. break;
  60377. }
  60378. } // If this boundary is currently timed out, we need to decide
  60379. // whether to retry the primary children, or to skip over it and
  60380. // go straight to the fallback. Check the priority of the primary
  60381. // child fragment.
  60382. var primaryChildFragment = workInProgress.child;
  60383. var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
  60384. if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {
  60385. // The primary children have pending work. Use the normal path
  60386. // to attempt to render the primary children again.
  60387. return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
  60388. } else {
  60389. pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient
  60390. // priority. Bailout.
  60391. var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  60392. if (child !== null) {
  60393. // The fallback children have pending work. Skip over the
  60394. // primary children and work on the fallback.
  60395. return child.sibling;
  60396. } else {
  60397. return null;
  60398. }
  60399. }
  60400. } else {
  60401. pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
  60402. }
  60403. break;
  60404. }
  60405. case SuspenseListComponent:
  60406. {
  60407. var didSuspendBefore = (current$$1.effectTag & DidCapture) !== NoEffect;
  60408. var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
  60409. if (didSuspendBefore) {
  60410. if (_hasChildWork) {
  60411. // If something was in fallback state last time, and we have all the
  60412. // same children then we're still in progressive loading state.
  60413. // Something might get unblocked by state updates or retries in the
  60414. // tree which will affect the tail. So we need to use the normal
  60415. // path to compute the correct tail.
  60416. return updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime);
  60417. } // If none of the children had any work, that means that none of
  60418. // them got retried so they'll still be blocked in the same way
  60419. // as before. We can fast bail out.
  60420. workInProgress.effectTag |= DidCapture;
  60421. } // If nothing suspended before and we're rendering the same children,
  60422. // then the tail doesn't matter. Anything new that suspends will work
  60423. // in the "together" mode, so we can continue from the state we had.
  60424. var renderState = workInProgress.memoizedState;
  60425. if (renderState !== null) {
  60426. // Reset to the "together" mode in case we've started a different
  60427. // update in the past but didn't complete it.
  60428. renderState.rendering = null;
  60429. renderState.tail = null;
  60430. }
  60431. pushSuspenseContext(workInProgress, suspenseStackCursor.current);
  60432. if (_hasChildWork) {
  60433. break;
  60434. } else {
  60435. // If none of the children had any work, that means that none of
  60436. // them got retried so they'll still be blocked in the same way
  60437. // as before. We can fast bail out.
  60438. return null;
  60439. }
  60440. }
  60441. }
  60442. return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  60443. } else {
  60444. // An update was scheduled on this fiber, but there are no new props
  60445. // nor legacy context. Set this to false. If an update queue or context
  60446. // consumer produces a changed value, it will set this to true. Otherwise,
  60447. // the component will assume the children have not changed and bail out.
  60448. didReceiveUpdate = false;
  60449. }
  60450. } else {
  60451. didReceiveUpdate = false;
  60452. } // Before entering the begin phase, clear the expiration time.
  60453. workInProgress.expirationTime = NoWork;
  60454. switch (workInProgress.tag) {
  60455. case IndeterminateComponent:
  60456. {
  60457. return mountIndeterminateComponent(current$$1, workInProgress, workInProgress.type, renderExpirationTime);
  60458. }
  60459. case LazyComponent:
  60460. {
  60461. var elementType = workInProgress.elementType;
  60462. return mountLazyComponent(current$$1, workInProgress, elementType, updateExpirationTime, renderExpirationTime);
  60463. }
  60464. case FunctionComponent:
  60465. {
  60466. var _Component = workInProgress.type;
  60467. var unresolvedProps = workInProgress.pendingProps;
  60468. var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
  60469. return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime);
  60470. }
  60471. case ClassComponent:
  60472. {
  60473. var _Component2 = workInProgress.type;
  60474. var _unresolvedProps = workInProgress.pendingProps;
  60475. var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
  60476. return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime);
  60477. }
  60478. case HostRoot:
  60479. return updateHostRoot(current$$1, workInProgress, renderExpirationTime);
  60480. case HostComponent:
  60481. return updateHostComponent(current$$1, workInProgress, renderExpirationTime);
  60482. case HostText:
  60483. return updateHostText(current$$1, workInProgress);
  60484. case SuspenseComponent:
  60485. return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
  60486. case HostPortal:
  60487. return updatePortalComponent(current$$1, workInProgress, renderExpirationTime);
  60488. case ForwardRef:
  60489. {
  60490. var type = workInProgress.type;
  60491. var _unresolvedProps2 = workInProgress.pendingProps;
  60492. var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
  60493. return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime);
  60494. }
  60495. case Fragment:
  60496. return updateFragment(current$$1, workInProgress, renderExpirationTime);
  60497. case Mode:
  60498. return updateMode(current$$1, workInProgress, renderExpirationTime);
  60499. case Profiler:
  60500. return updateProfiler(current$$1, workInProgress, renderExpirationTime);
  60501. case ContextProvider:
  60502. return updateContextProvider(current$$1, workInProgress, renderExpirationTime);
  60503. case ContextConsumer:
  60504. return updateContextConsumer(current$$1, workInProgress, renderExpirationTime);
  60505. case MemoComponent:
  60506. {
  60507. var _type2 = workInProgress.type;
  60508. var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.
  60509. var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
  60510. {
  60511. if (workInProgress.type !== workInProgress.elementType) {
  60512. var outerPropTypes = _type2.propTypes;
  60513. if (outerPropTypes) {
  60514. checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
  60515. 'prop', getComponentName(_type2), getCurrentFiberStackInDev);
  60516. }
  60517. }
  60518. }
  60519. _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
  60520. return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
  60521. }
  60522. case SimpleMemoComponent:
  60523. {
  60524. return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);
  60525. }
  60526. case IncompleteClassComponent:
  60527. {
  60528. var _Component3 = workInProgress.type;
  60529. var _unresolvedProps4 = workInProgress.pendingProps;
  60530. var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
  60531. return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);
  60532. }
  60533. case SuspenseListComponent:
  60534. {
  60535. return updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime);
  60536. }
  60537. case FundamentalComponent:
  60538. {
  60539. if (enableFundamentalAPI) {
  60540. return updateFundamentalComponent$1(current$$1, workInProgress, renderExpirationTime);
  60541. }
  60542. break;
  60543. }
  60544. case ScopeComponent:
  60545. {
  60546. if (enableScopeAPI) {
  60547. return updateScopeComponent(current$$1, workInProgress, renderExpirationTime);
  60548. }
  60549. break;
  60550. }
  60551. }
  60552. {
  60553. {
  60554. throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue.");
  60555. }
  60556. }
  60557. }
  60558. function createFundamentalStateInstance(currentFiber, props, impl, state) {
  60559. return {
  60560. currentFiber: currentFiber,
  60561. impl: impl,
  60562. instance: null,
  60563. prevProps: null,
  60564. props: props,
  60565. state: state
  60566. };
  60567. }
  60568. function isFiberSuspenseAndTimedOut(fiber) {
  60569. return fiber.tag === SuspenseComponent && fiber.memoizedState !== null;
  60570. }
  60571. function getSuspenseFallbackChild(fiber) {
  60572. return fiber.child.sibling.child;
  60573. }
  60574. var emptyObject$1 = {};
  60575. function collectScopedNodes(node, fn, scopedNodes) {
  60576. if (enableScopeAPI) {
  60577. if (node.tag === HostComponent) {
  60578. var _type = node.type,
  60579. memoizedProps = node.memoizedProps,
  60580. stateNode = node.stateNode;
  60581. var _instance = getPublicInstance(stateNode);
  60582. if (_instance !== null && fn(_type, memoizedProps || emptyObject$1, _instance) === true) {
  60583. scopedNodes.push(_instance);
  60584. }
  60585. }
  60586. var child = node.child;
  60587. if (isFiberSuspenseAndTimedOut(node)) {
  60588. child = getSuspenseFallbackChild(node);
  60589. }
  60590. if (child !== null) {
  60591. collectScopedNodesFromChildren(child, fn, scopedNodes);
  60592. }
  60593. }
  60594. }
  60595. function collectFirstScopedNode(node, fn) {
  60596. if (enableScopeAPI) {
  60597. if (node.tag === HostComponent) {
  60598. var _type2 = node.type,
  60599. memoizedProps = node.memoizedProps,
  60600. stateNode = node.stateNode;
  60601. var _instance2 = getPublicInstance(stateNode);
  60602. if (_instance2 !== null && fn(_type2, memoizedProps, _instance2) === true) {
  60603. return _instance2;
  60604. }
  60605. }
  60606. var child = node.child;
  60607. if (isFiberSuspenseAndTimedOut(node)) {
  60608. child = getSuspenseFallbackChild(node);
  60609. }
  60610. if (child !== null) {
  60611. return collectFirstScopedNodeFromChildren(child, fn);
  60612. }
  60613. }
  60614. return null;
  60615. }
  60616. function collectScopedNodesFromChildren(startingChild, fn, scopedNodes) {
  60617. var child = startingChild;
  60618. while (child !== null) {
  60619. collectScopedNodes(child, fn, scopedNodes);
  60620. child = child.sibling;
  60621. }
  60622. }
  60623. function collectFirstScopedNodeFromChildren(startingChild, fn) {
  60624. var child = startingChild;
  60625. while (child !== null) {
  60626. var scopedNode = collectFirstScopedNode(child, fn);
  60627. if (scopedNode !== null) {
  60628. return scopedNode;
  60629. }
  60630. child = child.sibling;
  60631. }
  60632. return null;
  60633. }
  60634. function collectNearestScopeMethods(node, scope, childrenScopes) {
  60635. if (isValidScopeNode(node, scope)) {
  60636. childrenScopes.push(node.stateNode.methods);
  60637. } else {
  60638. var child = node.child;
  60639. if (isFiberSuspenseAndTimedOut(node)) {
  60640. child = getSuspenseFallbackChild(node);
  60641. }
  60642. if (child !== null) {
  60643. collectNearestChildScopeMethods(child, scope, childrenScopes);
  60644. }
  60645. }
  60646. }
  60647. function collectNearestChildScopeMethods(startingChild, scope, childrenScopes) {
  60648. var child = startingChild;
  60649. while (child !== null) {
  60650. collectNearestScopeMethods(child, scope, childrenScopes);
  60651. child = child.sibling;
  60652. }
  60653. }
  60654. function isValidScopeNode(node, scope) {
  60655. return node.tag === ScopeComponent && node.type === scope && node.stateNode !== null;
  60656. }
  60657. function createScopeMethods(scope, instance) {
  60658. return {
  60659. getChildren: function () {
  60660. var currentFiber = instance.fiber;
  60661. var child = currentFiber.child;
  60662. var childrenScopes = [];
  60663. if (child !== null) {
  60664. collectNearestChildScopeMethods(child, scope, childrenScopes);
  60665. }
  60666. return childrenScopes.length === 0 ? null : childrenScopes;
  60667. },
  60668. getChildrenFromRoot: function () {
  60669. var currentFiber = instance.fiber;
  60670. var node = currentFiber;
  60671. while (node !== null) {
  60672. var parent = node.return;
  60673. if (parent === null) {
  60674. break;
  60675. }
  60676. node = parent;
  60677. if (node.tag === ScopeComponent && node.type === scope) {
  60678. break;
  60679. }
  60680. }
  60681. var childrenScopes = [];
  60682. collectNearestChildScopeMethods(node.child, scope, childrenScopes);
  60683. return childrenScopes.length === 0 ? null : childrenScopes;
  60684. },
  60685. getParent: function () {
  60686. var node = instance.fiber.return;
  60687. while (node !== null) {
  60688. if (node.tag === ScopeComponent && node.type === scope) {
  60689. return node.stateNode.methods;
  60690. }
  60691. node = node.return;
  60692. }
  60693. return null;
  60694. },
  60695. getProps: function () {
  60696. var currentFiber = instance.fiber;
  60697. return currentFiber.memoizedProps;
  60698. },
  60699. queryAllNodes: function (fn) {
  60700. var currentFiber = instance.fiber;
  60701. var child = currentFiber.child;
  60702. var scopedNodes = [];
  60703. if (child !== null) {
  60704. collectScopedNodesFromChildren(child, fn, scopedNodes);
  60705. }
  60706. return scopedNodes.length === 0 ? null : scopedNodes;
  60707. },
  60708. queryFirstNode: function (fn) {
  60709. var currentFiber = instance.fiber;
  60710. var child = currentFiber.child;
  60711. if (child !== null) {
  60712. return collectFirstScopedNodeFromChildren(child, fn);
  60713. }
  60714. return null;
  60715. },
  60716. containsNode: function (node) {
  60717. var fiber = getInstanceFromNode$2(node);
  60718. while (fiber !== null) {
  60719. if (fiber.tag === ScopeComponent && fiber.type === scope && fiber.stateNode === instance) {
  60720. return true;
  60721. }
  60722. fiber = fiber.return;
  60723. }
  60724. return false;
  60725. }
  60726. };
  60727. }
  60728. function markUpdate(workInProgress) {
  60729. // Tag the fiber with an update effect. This turns a Placement into
  60730. // a PlacementAndUpdate.
  60731. workInProgress.effectTag |= Update;
  60732. }
  60733. function markRef$1(workInProgress) {
  60734. workInProgress.effectTag |= Ref;
  60735. }
  60736. var appendAllChildren;
  60737. var updateHostContainer;
  60738. var updateHostComponent$1;
  60739. var updateHostText$1;
  60740. if (supportsMutation) {
  60741. // Mutation mode
  60742. appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
  60743. // We only have the top Fiber that was created but we need recurse down its
  60744. // children to find all the terminal nodes.
  60745. var node = workInProgress.child;
  60746. while (node !== null) {
  60747. if (node.tag === HostComponent || node.tag === HostText) {
  60748. appendInitialChild(parent, node.stateNode);
  60749. } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
  60750. appendInitialChild(parent, node.stateNode.instance);
  60751. } else if (node.tag === HostPortal) {// If we have a portal child, then we don't want to traverse
  60752. // down its children. Instead, we'll get insertions from each child in
  60753. // the portal directly.
  60754. } else if (node.child !== null) {
  60755. node.child.return = node;
  60756. node = node.child;
  60757. continue;
  60758. }
  60759. if (node === workInProgress) {
  60760. return;
  60761. }
  60762. while (node.sibling === null) {
  60763. if (node.return === null || node.return === workInProgress) {
  60764. return;
  60765. }
  60766. node = node.return;
  60767. }
  60768. node.sibling.return = node.return;
  60769. node = node.sibling;
  60770. }
  60771. };
  60772. updateHostContainer = function (workInProgress) {// Noop
  60773. };
  60774. updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
  60775. // If we have an alternate, that means this is an update and we need to
  60776. // schedule a side-effect to do the updates.
  60777. var oldProps = current.memoizedProps;
  60778. if (oldProps === newProps) {
  60779. // In mutation mode, this is sufficient for a bailout because
  60780. // we won't touch this node even if children changed.
  60781. return;
  60782. } // If we get updated because one of our children updated, we don't
  60783. // have newProps so we'll have to reuse them.
  60784. // TODO: Split the update API as separate for the props vs. children.
  60785. // Even better would be if children weren't special cased at all tho.
  60786. var instance = workInProgress.stateNode;
  60787. var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host
  60788. // component is hitting the resume path. Figure out why. Possibly
  60789. // related to `hidden`.
  60790. var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.
  60791. workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
  60792. // is a new ref we mark this as an update. All the work is done in commitWork.
  60793. if (updatePayload) {
  60794. markUpdate(workInProgress);
  60795. }
  60796. };
  60797. updateHostText$1 = function (current, workInProgress, oldText, newText) {
  60798. // If the text differs, mark it as an update. All the work in done in commitWork.
  60799. if (oldText !== newText) {
  60800. markUpdate(workInProgress);
  60801. }
  60802. };
  60803. } else if (supportsPersistence) {
  60804. // Persistent host tree mode
  60805. appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
  60806. // We only have the top Fiber that was created but we need recurse down its
  60807. // children to find all the terminal nodes.
  60808. var node = workInProgress.child;
  60809. while (node !== null) {
  60810. // eslint-disable-next-line no-labels
  60811. branches: if (node.tag === HostComponent) {
  60812. var instance = node.stateNode;
  60813. if (needsVisibilityToggle && isHidden) {
  60814. // This child is inside a timed out tree. Hide it.
  60815. var props = node.memoizedProps;
  60816. var type = node.type;
  60817. instance = cloneHiddenInstance(instance, type, props, node);
  60818. }
  60819. appendInitialChild(parent, instance);
  60820. } else if (node.tag === HostText) {
  60821. var _instance = node.stateNode;
  60822. if (needsVisibilityToggle && isHidden) {
  60823. // This child is inside a timed out tree. Hide it.
  60824. var text = node.memoizedProps;
  60825. _instance = cloneHiddenTextInstance(_instance, text, node);
  60826. }
  60827. appendInitialChild(parent, _instance);
  60828. } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
  60829. var _instance2 = node.stateNode.instance;
  60830. if (needsVisibilityToggle && isHidden) {
  60831. // This child is inside a timed out tree. Hide it.
  60832. var _props = node.memoizedProps;
  60833. var _type = node.type;
  60834. _instance2 = cloneHiddenInstance(_instance2, _type, _props, node);
  60835. }
  60836. appendInitialChild(parent, _instance2);
  60837. } else if (node.tag === HostPortal) {// If we have a portal child, then we don't want to traverse
  60838. // down its children. Instead, we'll get insertions from each child in
  60839. // the portal directly.
  60840. } else if (node.tag === SuspenseComponent) {
  60841. if ((node.effectTag & Update) !== NoEffect) {
  60842. // Need to toggle the visibility of the primary children.
  60843. var newIsHidden = node.memoizedState !== null;
  60844. if (newIsHidden) {
  60845. var primaryChildParent = node.child;
  60846. if (primaryChildParent !== null) {
  60847. if (primaryChildParent.child !== null) {
  60848. primaryChildParent.child.return = primaryChildParent;
  60849. appendAllChildren(parent, primaryChildParent, true, newIsHidden);
  60850. }
  60851. var fallbackChildParent = primaryChildParent.sibling;
  60852. if (fallbackChildParent !== null) {
  60853. fallbackChildParent.return = node;
  60854. node = fallbackChildParent;
  60855. continue;
  60856. }
  60857. }
  60858. }
  60859. }
  60860. if (node.child !== null) {
  60861. // Continue traversing like normal
  60862. node.child.return = node;
  60863. node = node.child;
  60864. continue;
  60865. }
  60866. } else if (node.child !== null) {
  60867. node.child.return = node;
  60868. node = node.child;
  60869. continue;
  60870. } // $FlowFixMe This is correct but Flow is confused by the labeled break.
  60871. node = node;
  60872. if (node === workInProgress) {
  60873. return;
  60874. }
  60875. while (node.sibling === null) {
  60876. if (node.return === null || node.return === workInProgress) {
  60877. return;
  60878. }
  60879. node = node.return;
  60880. }
  60881. node.sibling.return = node.return;
  60882. node = node.sibling;
  60883. }
  60884. }; // An unfortunate fork of appendAllChildren because we have two different parent types.
  60885. var appendAllChildrenToContainer = function (containerChildSet, workInProgress, needsVisibilityToggle, isHidden) {
  60886. // We only have the top Fiber that was created but we need recurse down its
  60887. // children to find all the terminal nodes.
  60888. var node = workInProgress.child;
  60889. while (node !== null) {
  60890. // eslint-disable-next-line no-labels
  60891. branches: if (node.tag === HostComponent) {
  60892. var instance = node.stateNode;
  60893. if (needsVisibilityToggle && isHidden) {
  60894. // This child is inside a timed out tree. Hide it.
  60895. var props = node.memoizedProps;
  60896. var type = node.type;
  60897. instance = cloneHiddenInstance(instance, type, props, node);
  60898. }
  60899. appendChildToContainerChildSet(containerChildSet, instance);
  60900. } else if (node.tag === HostText) {
  60901. var _instance3 = node.stateNode;
  60902. if (needsVisibilityToggle && isHidden) {
  60903. // This child is inside a timed out tree. Hide it.
  60904. var text = node.memoizedProps;
  60905. _instance3 = cloneHiddenTextInstance(_instance3, text, node);
  60906. }
  60907. appendChildToContainerChildSet(containerChildSet, _instance3);
  60908. } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
  60909. var _instance4 = node.stateNode.instance;
  60910. if (needsVisibilityToggle && isHidden) {
  60911. // This child is inside a timed out tree. Hide it.
  60912. var _props2 = node.memoizedProps;
  60913. var _type2 = node.type;
  60914. _instance4 = cloneHiddenInstance(_instance4, _type2, _props2, node);
  60915. }
  60916. appendChildToContainerChildSet(containerChildSet, _instance4);
  60917. } else if (node.tag === HostPortal) {// If we have a portal child, then we don't want to traverse
  60918. // down its children. Instead, we'll get insertions from each child in
  60919. // the portal directly.
  60920. } else if (node.tag === SuspenseComponent) {
  60921. if ((node.effectTag & Update) !== NoEffect) {
  60922. // Need to toggle the visibility of the primary children.
  60923. var newIsHidden = node.memoizedState !== null;
  60924. if (newIsHidden) {
  60925. var primaryChildParent = node.child;
  60926. if (primaryChildParent !== null) {
  60927. if (primaryChildParent.child !== null) {
  60928. primaryChildParent.child.return = primaryChildParent;
  60929. appendAllChildrenToContainer(containerChildSet, primaryChildParent, true, newIsHidden);
  60930. }
  60931. var fallbackChildParent = primaryChildParent.sibling;
  60932. if (fallbackChildParent !== null) {
  60933. fallbackChildParent.return = node;
  60934. node = fallbackChildParent;
  60935. continue;
  60936. }
  60937. }
  60938. }
  60939. }
  60940. if (node.child !== null) {
  60941. // Continue traversing like normal
  60942. node.child.return = node;
  60943. node = node.child;
  60944. continue;
  60945. }
  60946. } else if (node.child !== null) {
  60947. node.child.return = node;
  60948. node = node.child;
  60949. continue;
  60950. } // $FlowFixMe This is correct but Flow is confused by the labeled break.
  60951. node = node;
  60952. if (node === workInProgress) {
  60953. return;
  60954. }
  60955. while (node.sibling === null) {
  60956. if (node.return === null || node.return === workInProgress) {
  60957. return;
  60958. }
  60959. node = node.return;
  60960. }
  60961. node.sibling.return = node.return;
  60962. node = node.sibling;
  60963. }
  60964. };
  60965. updateHostContainer = function (workInProgress) {
  60966. var portalOrRoot = workInProgress.stateNode;
  60967. var childrenUnchanged = workInProgress.firstEffect === null;
  60968. if (childrenUnchanged) {// No changes, just reuse the existing instance.
  60969. } else {
  60970. var container = portalOrRoot.containerInfo;
  60971. var newChildSet = createContainerChildSet(container); // If children might have changed, we have to add them all to the set.
  60972. appendAllChildrenToContainer(newChildSet, workInProgress, false, false);
  60973. portalOrRoot.pendingChildren = newChildSet; // Schedule an update on the container to swap out the container.
  60974. markUpdate(workInProgress);
  60975. finalizeContainerChildren(container, newChildSet);
  60976. }
  60977. };
  60978. updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
  60979. var currentInstance = current.stateNode;
  60980. var oldProps = current.memoizedProps; // If there are no effects associated with this node, then none of our children had any updates.
  60981. // This guarantees that we can reuse all of them.
  60982. var childrenUnchanged = workInProgress.firstEffect === null;
  60983. if (childrenUnchanged && oldProps === newProps) {
  60984. // No changes, just reuse the existing instance.
  60985. // Note that this might release a previous clone.
  60986. workInProgress.stateNode = currentInstance;
  60987. return;
  60988. }
  60989. var recyclableInstance = workInProgress.stateNode;
  60990. var currentHostContext = getHostContext();
  60991. var updatePayload = null;
  60992. if (oldProps !== newProps) {
  60993. updatePayload = prepareUpdate(recyclableInstance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
  60994. }
  60995. if (childrenUnchanged && updatePayload === null) {
  60996. // No changes, just reuse the existing instance.
  60997. // Note that this might release a previous clone.
  60998. workInProgress.stateNode = currentInstance;
  60999. return;
  61000. }
  61001. var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance);
  61002. if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance, currentHostContext)) {
  61003. markUpdate(workInProgress);
  61004. }
  61005. workInProgress.stateNode = newInstance;
  61006. if (childrenUnchanged) {
  61007. // If there are no other effects in this tree, we need to flag this node as having one.
  61008. // Even though we're not going to use it for anything.
  61009. // Otherwise parents won't know that there are new children to propagate upwards.
  61010. markUpdate(workInProgress);
  61011. } else {
  61012. // If children might have changed, we have to add them all to the set.
  61013. appendAllChildren(newInstance, workInProgress, false, false);
  61014. }
  61015. };
  61016. updateHostText$1 = function (current, workInProgress, oldText, newText) {
  61017. if (oldText !== newText) {
  61018. // If the text content differs, we'll create a new text instance for it.
  61019. var rootContainerInstance = getRootHostContainer();
  61020. var currentHostContext = getHostContext();
  61021. workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress); // We'll have to mark it as having an effect, even though we won't use the effect for anything.
  61022. // This lets the parents know that at least one of their children has changed.
  61023. markUpdate(workInProgress);
  61024. }
  61025. };
  61026. } else {
  61027. // No host operations
  61028. updateHostContainer = function (workInProgress) {// Noop
  61029. };
  61030. updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {// Noop
  61031. };
  61032. updateHostText$1 = function (current, workInProgress, oldText, newText) {// Noop
  61033. };
  61034. }
  61035. function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  61036. switch (renderState.tailMode) {
  61037. case 'hidden':
  61038. {
  61039. // Any insertions at the end of the tail list after this point
  61040. // should be invisible. If there are already mounted boundaries
  61041. // anything before them are not considered for collapsing.
  61042. // Therefore we need to go through the whole tail to find if
  61043. // there are any.
  61044. var tailNode = renderState.tail;
  61045. var lastTailNode = null;
  61046. while (tailNode !== null) {
  61047. if (tailNode.alternate !== null) {
  61048. lastTailNode = tailNode;
  61049. }
  61050. tailNode = tailNode.sibling;
  61051. } // Next we're simply going to delete all insertions after the
  61052. // last rendered item.
  61053. if (lastTailNode === null) {
  61054. // All remaining items in the tail are insertions.
  61055. renderState.tail = null;
  61056. } else {
  61057. // Detach the insertion after the last node that was already
  61058. // inserted.
  61059. lastTailNode.sibling = null;
  61060. }
  61061. break;
  61062. }
  61063. case 'collapsed':
  61064. {
  61065. // Any insertions at the end of the tail list after this point
  61066. // should be invisible. If there are already mounted boundaries
  61067. // anything before them are not considered for collapsing.
  61068. // Therefore we need to go through the whole tail to find if
  61069. // there are any.
  61070. var _tailNode = renderState.tail;
  61071. var _lastTailNode = null;
  61072. while (_tailNode !== null) {
  61073. if (_tailNode.alternate !== null) {
  61074. _lastTailNode = _tailNode;
  61075. }
  61076. _tailNode = _tailNode.sibling;
  61077. } // Next we're simply going to delete all insertions after the
  61078. // last rendered item.
  61079. if (_lastTailNode === null) {
  61080. // All remaining items in the tail are insertions.
  61081. if (!hasRenderedATailFallback && renderState.tail !== null) {
  61082. // We suspended during the head. We want to show at least one
  61083. // row at the tail. So we'll keep on and cut off the rest.
  61084. renderState.tail.sibling = null;
  61085. } else {
  61086. renderState.tail = null;
  61087. }
  61088. } else {
  61089. // Detach the insertion after the last node that was already
  61090. // inserted.
  61091. _lastTailNode.sibling = null;
  61092. }
  61093. break;
  61094. }
  61095. }
  61096. }
  61097. function completeWork(current, workInProgress, renderExpirationTime) {
  61098. var newProps = workInProgress.pendingProps;
  61099. switch (workInProgress.tag) {
  61100. case IndeterminateComponent:
  61101. break;
  61102. case LazyComponent:
  61103. break;
  61104. case SimpleMemoComponent:
  61105. case FunctionComponent:
  61106. break;
  61107. case ClassComponent:
  61108. {
  61109. var Component = workInProgress.type;
  61110. if (isContextProvider(Component)) {
  61111. popContext(workInProgress);
  61112. }
  61113. break;
  61114. }
  61115. case HostRoot:
  61116. {
  61117. popHostContainer(workInProgress);
  61118. popTopLevelContextObject(workInProgress);
  61119. var fiberRoot = workInProgress.stateNode;
  61120. if (fiberRoot.pendingContext) {
  61121. fiberRoot.context = fiberRoot.pendingContext;
  61122. fiberRoot.pendingContext = null;
  61123. }
  61124. if (current === null || current.child === null) {
  61125. // If we hydrated, pop so that we can delete any remaining children
  61126. // that weren't hydrated.
  61127. var wasHydrated = popHydrationState(workInProgress);
  61128. if (wasHydrated) {
  61129. // If we hydrated, then we'll need to schedule an update for
  61130. // the commit side-effects on the root.
  61131. markUpdate(workInProgress);
  61132. }
  61133. }
  61134. updateHostContainer(workInProgress);
  61135. break;
  61136. }
  61137. case HostComponent:
  61138. {
  61139. popHostContext(workInProgress);
  61140. var rootContainerInstance = getRootHostContainer();
  61141. var type = workInProgress.type;
  61142. if (current !== null && workInProgress.stateNode != null) {
  61143. updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);
  61144. if (enableFlareAPI) {
  61145. var prevListeners = current.memoizedProps.listeners;
  61146. var nextListeners = newProps.listeners;
  61147. if (prevListeners !== nextListeners) {
  61148. markUpdate(workInProgress);
  61149. }
  61150. }
  61151. if (current.ref !== workInProgress.ref) {
  61152. markRef$1(workInProgress);
  61153. }
  61154. } else {
  61155. if (!newProps) {
  61156. if (!(workInProgress.stateNode !== null)) {
  61157. {
  61158. throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
  61159. }
  61160. } // This can happen when we abort work.
  61161. break;
  61162. }
  61163. var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
  61164. // "stack" as the parent. Then append children as we go in beginWork
  61165. // or completeWork depending on we want to add then top->down or
  61166. // bottom->up. Top->down is faster in IE11.
  61167. var _wasHydrated = popHydrationState(workInProgress);
  61168. if (_wasHydrated) {
  61169. // TODO: Move this and createInstance step into the beginPhase
  61170. // to consolidate.
  61171. if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
  61172. // If changes to the hydrated node needs to be applied at the
  61173. // commit-phase we mark this as such.
  61174. markUpdate(workInProgress);
  61175. }
  61176. if (enableFlareAPI) {
  61177. var listeners = newProps.listeners;
  61178. if (listeners != null) {
  61179. updateEventListeners(listeners, workInProgress, rootContainerInstance);
  61180. }
  61181. }
  61182. } else {
  61183. var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);
  61184. appendAllChildren(instance, workInProgress, false, false); // This needs to be set before we mount Flare event listeners
  61185. workInProgress.stateNode = instance;
  61186. if (enableFlareAPI) {
  61187. var _listeners = newProps.listeners;
  61188. if (_listeners != null) {
  61189. updateEventListeners(_listeners, workInProgress, rootContainerInstance);
  61190. }
  61191. } // Certain renderers require commit-time effects for initial mount.
  61192. // (eg DOM renderer supports auto-focus for certain elements).
  61193. // Make sure such renderers get scheduled for later work.
  61194. if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance, currentHostContext)) {
  61195. markUpdate(workInProgress);
  61196. }
  61197. }
  61198. if (workInProgress.ref !== null) {
  61199. // If there is a ref on a host node we need to schedule a callback
  61200. markRef$1(workInProgress);
  61201. }
  61202. }
  61203. break;
  61204. }
  61205. case HostText:
  61206. {
  61207. var newText = newProps;
  61208. if (current && workInProgress.stateNode != null) {
  61209. var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need
  61210. // to schedule a side-effect to do the updates.
  61211. updateHostText$1(current, workInProgress, oldText, newText);
  61212. } else {
  61213. if (typeof newText !== 'string') {
  61214. if (!(workInProgress.stateNode !== null)) {
  61215. {
  61216. throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
  61217. }
  61218. } // This can happen when we abort work.
  61219. }
  61220. var _rootContainerInstance = getRootHostContainer();
  61221. var _currentHostContext = getHostContext();
  61222. var _wasHydrated2 = popHydrationState(workInProgress);
  61223. if (_wasHydrated2) {
  61224. if (prepareToHydrateHostTextInstance(workInProgress)) {
  61225. markUpdate(workInProgress);
  61226. }
  61227. } else {
  61228. workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
  61229. }
  61230. }
  61231. break;
  61232. }
  61233. case ForwardRef:
  61234. break;
  61235. case SuspenseComponent:
  61236. {
  61237. popSuspenseContext(workInProgress);
  61238. var nextState = workInProgress.memoizedState;
  61239. if (enableSuspenseServerRenderer) {
  61240. if (nextState !== null && nextState.dehydrated !== null) {
  61241. if (current === null) {
  61242. var _wasHydrated3 = popHydrationState(workInProgress);
  61243. if (!_wasHydrated3) {
  61244. {
  61245. throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
  61246. }
  61247. }
  61248. prepareToHydrateHostSuspenseInstance(workInProgress);
  61249. if (enableSchedulerTracing) {
  61250. markSpawnedWork(Never);
  61251. }
  61252. return null;
  61253. } else {
  61254. // We should never have been in a hydration state if we didn't have a current.
  61255. // However, in some of those paths, we might have reentered a hydration state
  61256. // and then we might be inside a hydration state. In that case, we'll need to
  61257. // exit out of it.
  61258. resetHydrationState();
  61259. if ((workInProgress.effectTag & DidCapture) === NoEffect) {
  61260. // This boundary did not suspend so it's now hydrated and unsuspended.
  61261. workInProgress.memoizedState = null;
  61262. } // If nothing suspended, we need to schedule an effect to mark this boundary
  61263. // as having hydrated so events know that they're free be invoked.
  61264. // It's also a signal to replay events and the suspense callback.
  61265. // If something suspended, schedule an effect to attach retry listeners.
  61266. // So we might as well always mark this.
  61267. workInProgress.effectTag |= Update;
  61268. return null;
  61269. }
  61270. }
  61271. }
  61272. if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
  61273. // Something suspended. Re-render with the fallback children.
  61274. workInProgress.expirationTime = renderExpirationTime; // Do not reset the effect list.
  61275. return workInProgress;
  61276. }
  61277. var nextDidTimeout = nextState !== null;
  61278. var prevDidTimeout = false;
  61279. if (current === null) {
  61280. if (workInProgress.memoizedProps.fallback !== undefined) {
  61281. popHydrationState(workInProgress);
  61282. }
  61283. } else {
  61284. var prevState = current.memoizedState;
  61285. prevDidTimeout = prevState !== null;
  61286. if (!nextDidTimeout && prevState !== null) {
  61287. // We just switched from the fallback to the normal children.
  61288. // Delete the fallback.
  61289. // TODO: Would it be better to store the fallback fragment on
  61290. // the stateNode during the begin phase?
  61291. var currentFallbackChild = current.child.sibling;
  61292. if (currentFallbackChild !== null) {
  61293. // Deletions go at the beginning of the return fiber's effect list
  61294. var first = workInProgress.firstEffect;
  61295. if (first !== null) {
  61296. workInProgress.firstEffect = currentFallbackChild;
  61297. currentFallbackChild.nextEffect = first;
  61298. } else {
  61299. workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;
  61300. currentFallbackChild.nextEffect = null;
  61301. }
  61302. currentFallbackChild.effectTag = Deletion;
  61303. }
  61304. }
  61305. }
  61306. if (nextDidTimeout && !prevDidTimeout) {
  61307. // If this subtreee is running in blocking mode we can suspend,
  61308. // otherwise we won't suspend.
  61309. // TODO: This will still suspend a synchronous tree if anything
  61310. // in the concurrent tree already suspended during this render.
  61311. // This is a known bug.
  61312. if ((workInProgress.mode & BlockingMode) !== NoMode) {
  61313. // TODO: Move this back to throwException because this is too late
  61314. // if this is a large tree which is common for initial loads. We
  61315. // don't know if we should restart a render or not until we get
  61316. // this marker, and this is too late.
  61317. // If this render already had a ping or lower pri updates,
  61318. // and this is the first time we know we're going to suspend we
  61319. // should be able to immediately restart from within throwException.
  61320. var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;
  61321. if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
  61322. // If this was in an invisible tree or a new render, then showing
  61323. // this boundary is ok.
  61324. renderDidSuspend();
  61325. } else {
  61326. // Otherwise, we're going to have to hide content so we should
  61327. // suspend for longer if possible.
  61328. renderDidSuspendDelayIfPossible();
  61329. }
  61330. }
  61331. }
  61332. if (supportsPersistence) {
  61333. // TODO: Only schedule updates if not prevDidTimeout.
  61334. if (nextDidTimeout) {
  61335. // If this boundary just timed out, schedule an effect to attach a
  61336. // retry listener to the proimse. This flag is also used to hide the
  61337. // primary children.
  61338. workInProgress.effectTag |= Update;
  61339. }
  61340. }
  61341. if (supportsMutation) {
  61342. // TODO: Only schedule updates if these values are non equal, i.e. it changed.
  61343. if (nextDidTimeout || prevDidTimeout) {
  61344. // If this boundary just timed out, schedule an effect to attach a
  61345. // retry listener to the proimse. This flag is also used to hide the
  61346. // primary children. In mutation mode, we also need the flag to
  61347. // *unhide* children that were previously hidden, so check if the
  61348. // is currently timed out, too.
  61349. workInProgress.effectTag |= Update;
  61350. }
  61351. }
  61352. if (enableSuspenseCallback && workInProgress.updateQueue !== null && workInProgress.memoizedProps.suspenseCallback != null) {
  61353. // Always notify the callback
  61354. workInProgress.effectTag |= Update;
  61355. }
  61356. break;
  61357. }
  61358. case Fragment:
  61359. break;
  61360. case Mode:
  61361. break;
  61362. case Profiler:
  61363. break;
  61364. case HostPortal:
  61365. popHostContainer(workInProgress);
  61366. updateHostContainer(workInProgress);
  61367. break;
  61368. case ContextProvider:
  61369. // Pop provider fiber
  61370. popProvider(workInProgress);
  61371. break;
  61372. case ContextConsumer:
  61373. break;
  61374. case MemoComponent:
  61375. break;
  61376. case IncompleteClassComponent:
  61377. {
  61378. // Same as class component case. I put it down here so that the tags are
  61379. // sequential to ensure this switch is compiled to a jump table.
  61380. var _Component = workInProgress.type;
  61381. if (isContextProvider(_Component)) {
  61382. popContext(workInProgress);
  61383. }
  61384. break;
  61385. }
  61386. case SuspenseListComponent:
  61387. {
  61388. popSuspenseContext(workInProgress);
  61389. var renderState = workInProgress.memoizedState;
  61390. if (renderState === null) {
  61391. // We're running in the default, "independent" mode. We don't do anything
  61392. // in this mode.
  61393. break;
  61394. }
  61395. var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;
  61396. var renderedTail = renderState.rendering;
  61397. if (renderedTail === null) {
  61398. // We just rendered the head.
  61399. if (!didSuspendAlready) {
  61400. // This is the first pass. We need to figure out if anything is still
  61401. // suspended in the rendered set.
  61402. // If new content unsuspended, but there's still some content that
  61403. // didn't. Then we need to do a second pass that forces everything
  61404. // to keep showing their fallbacks.
  61405. // We might be suspended if something in this render pass suspended, or
  61406. // something in the previous committed pass suspended. Otherwise,
  61407. // there's no chance so we can skip the expensive call to
  61408. // findFirstSuspended.
  61409. var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);
  61410. if (!cannotBeSuspended) {
  61411. var row = workInProgress.child;
  61412. while (row !== null) {
  61413. var suspended = findFirstSuspended(row);
  61414. if (suspended !== null) {
  61415. didSuspendAlready = true;
  61416. workInProgress.effectTag |= DidCapture;
  61417. cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as
  61418. // part of the second pass. In that case nothing will subscribe to
  61419. // its thennables. Instead, we'll transfer its thennables to the
  61420. // SuspenseList so that it can retry if they resolve.
  61421. // There might be multiple of these in the list but since we're
  61422. // going to wait for all of them anyway, it doesn't really matter
  61423. // which ones gets to ping. In theory we could get clever and keep
  61424. // track of how many dependencies remain but it gets tricky because
  61425. // in the meantime, we can add/remove/change items and dependencies.
  61426. // We might bail out of the loop before finding any but that
  61427. // doesn't matter since that means that the other boundaries that
  61428. // we did find already has their listeners attached.
  61429. var newThennables = suspended.updateQueue;
  61430. if (newThennables !== null) {
  61431. workInProgress.updateQueue = newThennables;
  61432. workInProgress.effectTag |= Update;
  61433. } // Rerender the whole list, but this time, we'll force fallbacks
  61434. // to stay in place.
  61435. // Reset the effect list before doing the second pass since that's now invalid.
  61436. if (renderState.lastEffect === null) {
  61437. workInProgress.firstEffect = null;
  61438. }
  61439. workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.
  61440. resetChildFibers(workInProgress, renderExpirationTime); // Set up the Suspense Context to force suspense and immediately
  61441. // rerender the children.
  61442. pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
  61443. return workInProgress.child;
  61444. }
  61445. row = row.sibling;
  61446. }
  61447. }
  61448. } else {
  61449. cutOffTailIfNeeded(renderState, false);
  61450. } // Next we're going to render the tail.
  61451. } else {
  61452. // Append the rendered row to the child list.
  61453. if (!didSuspendAlready) {
  61454. var _suspended = findFirstSuspended(renderedTail);
  61455. if (_suspended !== null) {
  61456. workInProgress.effectTag |= DidCapture;
  61457. didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't
  61458. // get lost if this row ends up dropped during a second pass.
  61459. var _newThennables = _suspended.updateQueue;
  61460. if (_newThennables !== null) {
  61461. workInProgress.updateQueue = _newThennables;
  61462. workInProgress.effectTag |= Update;
  61463. }
  61464. cutOffTailIfNeeded(renderState, true); // This might have been modified.
  61465. if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {
  61466. // We need to delete the row we just rendered.
  61467. // Reset the effect list to what it was before we rendered this
  61468. // child. The nested children have already appended themselves.
  61469. var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.
  61470. if (lastEffect !== null) {
  61471. lastEffect.nextEffect = null;
  61472. } // We're done.
  61473. return null;
  61474. }
  61475. } else if (now() > renderState.tailExpiration && renderExpirationTime > Never) {
  61476. // We have now passed our CPU deadline and we'll just give up further
  61477. // attempts to render the main content and only render fallbacks.
  61478. // The assumption is that this is usually faster.
  61479. workInProgress.effectTag |= DidCapture;
  61480. didSuspendAlready = true;
  61481. cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
  61482. // to get it started back up to attempt the next item. If we can show
  61483. // them, then they really have the same priority as this render.
  61484. // So we'll pick it back up the very next render pass once we've had
  61485. // an opportunity to yield for paint.
  61486. var nextPriority = renderExpirationTime - 1;
  61487. workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;
  61488. if (enableSchedulerTracing) {
  61489. markSpawnedWork(nextPriority);
  61490. }
  61491. }
  61492. }
  61493. if (renderState.isBackwards) {
  61494. // The effect list of the backwards tail will have been added
  61495. // to the end. This breaks the guarantee that life-cycles fire in
  61496. // sibling order but that isn't a strong guarantee promised by React.
  61497. // Especially since these might also just pop in during future commits.
  61498. // Append to the beginning of the list.
  61499. renderedTail.sibling = workInProgress.child;
  61500. workInProgress.child = renderedTail;
  61501. } else {
  61502. var previousSibling = renderState.last;
  61503. if (previousSibling !== null) {
  61504. previousSibling.sibling = renderedTail;
  61505. } else {
  61506. workInProgress.child = renderedTail;
  61507. }
  61508. renderState.last = renderedTail;
  61509. }
  61510. }
  61511. if (renderState.tail !== null) {
  61512. // We still have tail rows to render.
  61513. if (renderState.tailExpiration === 0) {
  61514. // Heuristic for how long we're willing to spend rendering rows
  61515. // until we just give up and show what we have so far.
  61516. var TAIL_EXPIRATION_TIMEOUT_MS = 500;
  61517. renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS;
  61518. } // Pop a row.
  61519. var next = renderState.tail;
  61520. renderState.rendering = next;
  61521. renderState.tail = next.sibling;
  61522. renderState.lastEffect = workInProgress.lastEffect;
  61523. next.sibling = null; // Restore the context.
  61524. // TODO: We can probably just avoid popping it instead and only
  61525. // setting it the first time we go from not suspended to suspended.
  61526. var suspenseContext = suspenseStackCursor.current;
  61527. if (didSuspendAlready) {
  61528. suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
  61529. } else {
  61530. suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
  61531. }
  61532. pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.
  61533. return next;
  61534. }
  61535. break;
  61536. }
  61537. case FundamentalComponent:
  61538. {
  61539. if (enableFundamentalAPI) {
  61540. var fundamentalImpl = workInProgress.type.impl;
  61541. var fundamentalInstance = workInProgress.stateNode;
  61542. if (fundamentalInstance === null) {
  61543. var getInitialState = fundamentalImpl.getInitialState;
  61544. var fundamentalState;
  61545. if (getInitialState !== undefined) {
  61546. fundamentalState = getInitialState(newProps);
  61547. }
  61548. fundamentalInstance = workInProgress.stateNode = createFundamentalStateInstance(workInProgress, newProps, fundamentalImpl, fundamentalState || {});
  61549. var _instance5 = getFundamentalComponentInstance(fundamentalInstance);
  61550. fundamentalInstance.instance = _instance5;
  61551. if (fundamentalImpl.reconcileChildren === false) {
  61552. return null;
  61553. }
  61554. appendAllChildren(_instance5, workInProgress, false, false);
  61555. mountFundamentalComponent(fundamentalInstance);
  61556. } else {
  61557. // We fire update in commit phase
  61558. var prevProps = fundamentalInstance.props;
  61559. fundamentalInstance.prevProps = prevProps;
  61560. fundamentalInstance.props = newProps;
  61561. fundamentalInstance.currentFiber = workInProgress;
  61562. if (supportsPersistence) {
  61563. var _instance6 = cloneFundamentalInstance(fundamentalInstance);
  61564. fundamentalInstance.instance = _instance6;
  61565. appendAllChildren(_instance6, workInProgress, false, false);
  61566. }
  61567. var shouldUpdate = shouldUpdateFundamentalComponent(fundamentalInstance);
  61568. if (shouldUpdate) {
  61569. markUpdate(workInProgress);
  61570. }
  61571. }
  61572. }
  61573. break;
  61574. }
  61575. case ScopeComponent:
  61576. {
  61577. if (enableScopeAPI) {
  61578. if (current === null) {
  61579. var _type3 = workInProgress.type;
  61580. var scopeInstance = {
  61581. fiber: workInProgress,
  61582. methods: null
  61583. };
  61584. workInProgress.stateNode = scopeInstance;
  61585. scopeInstance.methods = createScopeMethods(_type3, scopeInstance);
  61586. if (enableFlareAPI) {
  61587. var _listeners2 = newProps.listeners;
  61588. if (_listeners2 != null) {
  61589. var _rootContainerInstance2 = getRootHostContainer();
  61590. updateEventListeners(_listeners2, workInProgress, _rootContainerInstance2);
  61591. }
  61592. }
  61593. if (workInProgress.ref !== null) {
  61594. markRef$1(workInProgress);
  61595. markUpdate(workInProgress);
  61596. }
  61597. } else {
  61598. if (enableFlareAPI) {
  61599. var _prevListeners = current.memoizedProps.listeners;
  61600. var _nextListeners = newProps.listeners;
  61601. if (_prevListeners !== _nextListeners || workInProgress.ref !== null) {
  61602. markUpdate(workInProgress);
  61603. }
  61604. } else {
  61605. if (workInProgress.ref !== null) {
  61606. markUpdate(workInProgress);
  61607. }
  61608. }
  61609. if (current.ref !== workInProgress.ref) {
  61610. markRef$1(workInProgress);
  61611. }
  61612. }
  61613. }
  61614. break;
  61615. }
  61616. default:
  61617. {
  61618. {
  61619. throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue.");
  61620. }
  61621. }
  61622. }
  61623. return null;
  61624. }
  61625. function unwindWork(workInProgress, renderExpirationTime) {
  61626. switch (workInProgress.tag) {
  61627. case ClassComponent:
  61628. {
  61629. var Component = workInProgress.type;
  61630. if (isContextProvider(Component)) {
  61631. popContext(workInProgress);
  61632. }
  61633. var effectTag = workInProgress.effectTag;
  61634. if (effectTag & ShouldCapture) {
  61635. workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
  61636. return workInProgress;
  61637. }
  61638. return null;
  61639. }
  61640. case HostRoot:
  61641. {
  61642. popHostContainer(workInProgress);
  61643. popTopLevelContextObject(workInProgress);
  61644. var _effectTag = workInProgress.effectTag;
  61645. if (!((_effectTag & DidCapture) === NoEffect)) {
  61646. {
  61647. throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
  61648. }
  61649. }
  61650. workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
  61651. return workInProgress;
  61652. }
  61653. case HostComponent:
  61654. {
  61655. // TODO: popHydrationState
  61656. popHostContext(workInProgress);
  61657. return null;
  61658. }
  61659. case SuspenseComponent:
  61660. {
  61661. popSuspenseContext(workInProgress);
  61662. if (enableSuspenseServerRenderer) {
  61663. var suspenseState = workInProgress.memoizedState;
  61664. if (suspenseState !== null && suspenseState.dehydrated !== null) {
  61665. if (!(workInProgress.alternate !== null)) {
  61666. {
  61667. throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
  61668. }
  61669. }
  61670. resetHydrationState();
  61671. }
  61672. }
  61673. var _effectTag2 = workInProgress.effectTag;
  61674. if (_effectTag2 & ShouldCapture) {
  61675. workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.
  61676. return workInProgress;
  61677. }
  61678. return null;
  61679. }
  61680. case SuspenseListComponent:
  61681. {
  61682. popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been
  61683. // caught by a nested boundary. If not, it should bubble through.
  61684. return null;
  61685. }
  61686. case HostPortal:
  61687. popHostContainer(workInProgress);
  61688. return null;
  61689. case ContextProvider:
  61690. popProvider(workInProgress);
  61691. return null;
  61692. default:
  61693. return null;
  61694. }
  61695. }
  61696. function unwindInterruptedWork(interruptedWork) {
  61697. switch (interruptedWork.tag) {
  61698. case ClassComponent:
  61699. {
  61700. var childContextTypes = interruptedWork.type.childContextTypes;
  61701. if (childContextTypes !== null && childContextTypes !== undefined) {
  61702. popContext(interruptedWork);
  61703. }
  61704. break;
  61705. }
  61706. case HostRoot:
  61707. {
  61708. popHostContainer(interruptedWork);
  61709. popTopLevelContextObject(interruptedWork);
  61710. break;
  61711. }
  61712. case HostComponent:
  61713. {
  61714. popHostContext(interruptedWork);
  61715. break;
  61716. }
  61717. case HostPortal:
  61718. popHostContainer(interruptedWork);
  61719. break;
  61720. case SuspenseComponent:
  61721. popSuspenseContext(interruptedWork);
  61722. break;
  61723. case SuspenseListComponent:
  61724. popSuspenseContext(interruptedWork);
  61725. break;
  61726. case ContextProvider:
  61727. popProvider(interruptedWork);
  61728. break;
  61729. default:
  61730. break;
  61731. }
  61732. }
  61733. function createCapturedValue(value, source) {
  61734. // If the value is an error, call this function immediately after it is thrown
  61735. // so the stack is accurate.
  61736. return {
  61737. value: value,
  61738. source: source,
  61739. stack: getStackByFiberInDevAndProd(source)
  61740. };
  61741. }
  61742. // This module is forked in different environments.
  61743. // By default, return `true` to log errors to the console.
  61744. // Forks can return `false` if this isn't desirable.
  61745. function showErrorDialog(capturedError) {
  61746. return true;
  61747. }
  61748. function logCapturedError(capturedError) {
  61749. var logError = showErrorDialog(capturedError); // Allow injected showErrorDialog() to prevent default console.error logging.
  61750. // This enables renderers like ReactNative to better manage redbox behavior.
  61751. if (logError === false) {
  61752. return;
  61753. }
  61754. var error = capturedError.error;
  61755. {
  61756. var componentName = capturedError.componentName,
  61757. componentStack = capturedError.componentStack,
  61758. errorBoundaryName = capturedError.errorBoundaryName,
  61759. errorBoundaryFound = capturedError.errorBoundaryFound,
  61760. willRetry = capturedError.willRetry; // Browsers support silencing uncaught errors by calling
  61761. // `preventDefault()` in window `error` handler.
  61762. // We record this information as an expando on the error.
  61763. if (error != null && error._suppressLogging) {
  61764. if (errorBoundaryFound && willRetry) {
  61765. // The error is recoverable and was silenced.
  61766. // Ignore it and don't print the stack addendum.
  61767. // This is handy for testing error boundaries without noise.
  61768. return;
  61769. } // The error is fatal. Since the silencing might have
  61770. // been accidental, we'll surface it anyway.
  61771. // However, the browser would have silenced the original error
  61772. // so we'll print it first, and then print the stack addendum.
  61773. console.error(error); // For a more detailed description of this block, see:
  61774. // https://github.com/facebook/react/pull/13384
  61775. }
  61776. var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:';
  61777. var errorBoundaryMessage; // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.
  61778. if (errorBoundaryFound && errorBoundaryName) {
  61779. if (willRetry) {
  61780. errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
  61781. } else {
  61782. errorBoundaryMessage = "This error was initially handled by the error boundary " + errorBoundaryName + ".\n" + "Recreating the tree from scratch failed so React will unmount the tree.";
  61783. }
  61784. } else {
  61785. errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
  61786. }
  61787. var combinedMessage = "" + componentNameMessage + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.
  61788. // We don't include the original error message and JS stack because the browser
  61789. // has already printed it. Even if the application swallows the error, it is still
  61790. // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.
  61791. console.error(combinedMessage);
  61792. }
  61793. }
  61794. var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
  61795. {
  61796. didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
  61797. }
  61798. var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
  61799. function logError(boundary, errorInfo) {
  61800. var source = errorInfo.source;
  61801. var stack = errorInfo.stack;
  61802. if (stack === null && source !== null) {
  61803. stack = getStackByFiberInDevAndProd(source);
  61804. }
  61805. var capturedError = {
  61806. componentName: source !== null ? getComponentName(source.type) : null,
  61807. componentStack: stack !== null ? stack : '',
  61808. error: errorInfo.value,
  61809. errorBoundary: null,
  61810. errorBoundaryName: null,
  61811. errorBoundaryFound: false,
  61812. willRetry: false
  61813. };
  61814. if (boundary !== null && boundary.tag === ClassComponent) {
  61815. capturedError.errorBoundary = boundary.stateNode;
  61816. capturedError.errorBoundaryName = getComponentName(boundary.type);
  61817. capturedError.errorBoundaryFound = true;
  61818. capturedError.willRetry = true;
  61819. }
  61820. try {
  61821. logCapturedError(capturedError);
  61822. } catch (e) {
  61823. // This method must not throw, or React internal state will get messed up.
  61824. // If console.error is overridden, or logCapturedError() shows a dialog that throws,
  61825. // we want to report this error outside of the normal stack as a last resort.
  61826. // https://github.com/facebook/react/issues/13188
  61827. setTimeout(function () {
  61828. throw e;
  61829. });
  61830. }
  61831. }
  61832. var callComponentWillUnmountWithTimer = function (current$$1, instance) {
  61833. startPhaseTimer(current$$1, 'componentWillUnmount');
  61834. instance.props = current$$1.memoizedProps;
  61835. instance.state = current$$1.memoizedState;
  61836. instance.componentWillUnmount();
  61837. stopPhaseTimer();
  61838. }; // Capture errors so they don't interrupt unmounting.
  61839. function safelyCallComponentWillUnmount(current$$1, instance) {
  61840. {
  61841. invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current$$1, instance);
  61842. if (hasCaughtError()) {
  61843. var unmountError = clearCaughtError();
  61844. captureCommitPhaseError(current$$1, unmountError);
  61845. }
  61846. }
  61847. }
  61848. function safelyDetachRef(current$$1) {
  61849. var ref = current$$1.ref;
  61850. if (ref !== null) {
  61851. if (typeof ref === 'function') {
  61852. {
  61853. invokeGuardedCallback(null, ref, null, null);
  61854. if (hasCaughtError()) {
  61855. var refError = clearCaughtError();
  61856. captureCommitPhaseError(current$$1, refError);
  61857. }
  61858. }
  61859. } else {
  61860. ref.current = null;
  61861. }
  61862. }
  61863. }
  61864. function safelyCallDestroy(current$$1, destroy) {
  61865. {
  61866. invokeGuardedCallback(null, destroy, null);
  61867. if (hasCaughtError()) {
  61868. var error = clearCaughtError();
  61869. captureCommitPhaseError(current$$1, error);
  61870. }
  61871. }
  61872. }
  61873. function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
  61874. switch (finishedWork.tag) {
  61875. case FunctionComponent:
  61876. case ForwardRef:
  61877. case SimpleMemoComponent:
  61878. {
  61879. commitHookEffectList(UnmountSnapshot, NoEffect$1, finishedWork);
  61880. return;
  61881. }
  61882. case ClassComponent:
  61883. {
  61884. if (finishedWork.effectTag & Snapshot) {
  61885. if (current$$1 !== null) {
  61886. var prevProps = current$$1.memoizedProps;
  61887. var prevState = current$$1.memoizedState;
  61888. startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');
  61889. var instance = finishedWork.stateNode; // We could update instance props and state here,
  61890. // but instead we rely on them being set during last render.
  61891. // TODO: revisit this when we implement resuming.
  61892. {
  61893. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  61894. !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  61895. !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  61896. }
  61897. }
  61898. var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
  61899. {
  61900. var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
  61901. if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
  61902. didWarnSet.add(finishedWork.type);
  61903. warningWithoutStack$1(false, '%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
  61904. }
  61905. }
  61906. instance.__reactInternalSnapshotBeforeUpdate = snapshot;
  61907. stopPhaseTimer();
  61908. }
  61909. }
  61910. return;
  61911. }
  61912. case HostRoot:
  61913. case HostComponent:
  61914. case HostText:
  61915. case HostPortal:
  61916. case IncompleteClassComponent:
  61917. // Nothing to do for these component types
  61918. return;
  61919. default:
  61920. {
  61921. {
  61922. {
  61923. throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
  61924. }
  61925. }
  61926. }
  61927. }
  61928. }
  61929. function commitHookEffectList(unmountTag, mountTag, finishedWork) {
  61930. var updateQueue = finishedWork.updateQueue;
  61931. var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
  61932. if (lastEffect !== null) {
  61933. var firstEffect = lastEffect.next;
  61934. var effect = firstEffect;
  61935. do {
  61936. if ((effect.tag & unmountTag) !== NoEffect$1) {
  61937. // Unmount
  61938. var destroy = effect.destroy;
  61939. effect.destroy = undefined;
  61940. if (destroy !== undefined) {
  61941. destroy();
  61942. }
  61943. }
  61944. if ((effect.tag & mountTag) !== NoEffect$1) {
  61945. // Mount
  61946. var create = effect.create;
  61947. effect.destroy = create();
  61948. {
  61949. var _destroy = effect.destroy;
  61950. if (_destroy !== undefined && typeof _destroy !== 'function') {
  61951. var addendum = void 0;
  61952. if (_destroy === null) {
  61953. addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
  61954. } else if (typeof _destroy.then === 'function') {
  61955. addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';
  61956. } else {
  61957. addendum = ' You returned: ' + _destroy;
  61958. }
  61959. warningWithoutStack$1(false, 'An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));
  61960. }
  61961. }
  61962. }
  61963. effect = effect.next;
  61964. } while (effect !== firstEffect);
  61965. }
  61966. }
  61967. function commitPassiveHookEffects(finishedWork) {
  61968. if ((finishedWork.effectTag & Passive) !== NoEffect) {
  61969. switch (finishedWork.tag) {
  61970. case FunctionComponent:
  61971. case ForwardRef:
  61972. case SimpleMemoComponent:
  61973. {
  61974. commitHookEffectList(UnmountPassive, NoEffect$1, finishedWork);
  61975. commitHookEffectList(NoEffect$1, MountPassive, finishedWork);
  61976. break;
  61977. }
  61978. default:
  61979. break;
  61980. }
  61981. }
  61982. }
  61983. function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpirationTime) {
  61984. switch (finishedWork.tag) {
  61985. case FunctionComponent:
  61986. case ForwardRef:
  61987. case SimpleMemoComponent:
  61988. {
  61989. commitHookEffectList(UnmountLayout, MountLayout, finishedWork);
  61990. break;
  61991. }
  61992. case ClassComponent:
  61993. {
  61994. var instance = finishedWork.stateNode;
  61995. if (finishedWork.effectTag & Update) {
  61996. if (current$$1 === null) {
  61997. startPhaseTimer(finishedWork, 'componentDidMount'); // We could update instance props and state here,
  61998. // but instead we rely on them being set during last render.
  61999. // TODO: revisit this when we implement resuming.
  62000. {
  62001. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  62002. !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  62003. !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  62004. }
  62005. }
  62006. instance.componentDidMount();
  62007. stopPhaseTimer();
  62008. } else {
  62009. var prevProps = finishedWork.elementType === finishedWork.type ? current$$1.memoizedProps : resolveDefaultProps(finishedWork.type, current$$1.memoizedProps);
  62010. var prevState = current$$1.memoizedState;
  62011. startPhaseTimer(finishedWork, 'componentDidUpdate'); // We could update instance props and state here,
  62012. // but instead we rely on them being set during last render.
  62013. // TODO: revisit this when we implement resuming.
  62014. {
  62015. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  62016. !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  62017. !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  62018. }
  62019. }
  62020. instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
  62021. stopPhaseTimer();
  62022. }
  62023. }
  62024. var updateQueue = finishedWork.updateQueue;
  62025. if (updateQueue !== null) {
  62026. {
  62027. if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
  62028. !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  62029. !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
  62030. }
  62031. } // We could update instance props and state here,
  62032. // but instead we rely on them being set during last render.
  62033. // TODO: revisit this when we implement resuming.
  62034. commitUpdateQueue(finishedWork, updateQueue, instance, committedExpirationTime);
  62035. }
  62036. return;
  62037. }
  62038. case HostRoot:
  62039. {
  62040. var _updateQueue = finishedWork.updateQueue;
  62041. if (_updateQueue !== null) {
  62042. var _instance = null;
  62043. if (finishedWork.child !== null) {
  62044. switch (finishedWork.child.tag) {
  62045. case HostComponent:
  62046. _instance = getPublicInstance(finishedWork.child.stateNode);
  62047. break;
  62048. case ClassComponent:
  62049. _instance = finishedWork.child.stateNode;
  62050. break;
  62051. }
  62052. }
  62053. commitUpdateQueue(finishedWork, _updateQueue, _instance, committedExpirationTime);
  62054. }
  62055. return;
  62056. }
  62057. case HostComponent:
  62058. {
  62059. var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted
  62060. // (eg DOM renderer may schedule auto-focus for inputs and form controls).
  62061. // These effects should only be committed when components are first mounted,
  62062. // aka when there is no current/alternate.
  62063. if (current$$1 === null && finishedWork.effectTag & Update) {
  62064. var type = finishedWork.type;
  62065. var props = finishedWork.memoizedProps;
  62066. commitMount(_instance2, type, props, finishedWork);
  62067. }
  62068. return;
  62069. }
  62070. case HostText:
  62071. {
  62072. // We have no life-cycles associated with text.
  62073. return;
  62074. }
  62075. case HostPortal:
  62076. {
  62077. // We have no life-cycles associated with portals.
  62078. return;
  62079. }
  62080. case Profiler:
  62081. {
  62082. if (enableProfilerTimer) {
  62083. var onRender = finishedWork.memoizedProps.onRender;
  62084. if (typeof onRender === 'function') {
  62085. if (enableSchedulerTracing) {
  62086. onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
  62087. } else {
  62088. onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime());
  62089. }
  62090. }
  62091. }
  62092. return;
  62093. }
  62094. case SuspenseComponent:
  62095. {
  62096. commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
  62097. return;
  62098. }
  62099. case SuspenseListComponent:
  62100. case IncompleteClassComponent:
  62101. case FundamentalComponent:
  62102. case ScopeComponent:
  62103. return;
  62104. default:
  62105. {
  62106. {
  62107. {
  62108. throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
  62109. }
  62110. }
  62111. }
  62112. }
  62113. }
  62114. function hideOrUnhideAllChildren(finishedWork, isHidden) {
  62115. if (supportsMutation) {
  62116. // We only have the top Fiber that was inserted but we need to recurse down its
  62117. // children to find all the terminal nodes.
  62118. var node = finishedWork;
  62119. while (true) {
  62120. if (node.tag === HostComponent) {
  62121. var instance = node.stateNode;
  62122. if (isHidden) {
  62123. hideInstance(instance);
  62124. } else {
  62125. unhideInstance(node.stateNode, node.memoizedProps);
  62126. }
  62127. } else if (node.tag === HostText) {
  62128. var _instance3 = node.stateNode;
  62129. if (isHidden) {
  62130. hideTextInstance(_instance3);
  62131. } else {
  62132. unhideTextInstance(_instance3, node.memoizedProps);
  62133. }
  62134. } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {
  62135. // Found a nested Suspense component that timed out. Skip over the
  62136. // primary child fragment, which should remain hidden.
  62137. var fallbackChildFragment = node.child.sibling;
  62138. fallbackChildFragment.return = node;
  62139. node = fallbackChildFragment;
  62140. continue;
  62141. } else if (node.child !== null) {
  62142. node.child.return = node;
  62143. node = node.child;
  62144. continue;
  62145. }
  62146. if (node === finishedWork) {
  62147. return;
  62148. }
  62149. while (node.sibling === null) {
  62150. if (node.return === null || node.return === finishedWork) {
  62151. return;
  62152. }
  62153. node = node.return;
  62154. }
  62155. node.sibling.return = node.return;
  62156. node = node.sibling;
  62157. }
  62158. }
  62159. }
  62160. function commitAttachRef(finishedWork) {
  62161. var ref = finishedWork.ref;
  62162. if (ref !== null) {
  62163. var instance = finishedWork.stateNode;
  62164. var instanceToUse;
  62165. switch (finishedWork.tag) {
  62166. case HostComponent:
  62167. instanceToUse = getPublicInstance(instance);
  62168. break;
  62169. default:
  62170. instanceToUse = instance;
  62171. } // Moved outside to ensure DCE works with this flag
  62172. if (enableScopeAPI && finishedWork.tag === ScopeComponent) {
  62173. instanceToUse = instance.methods;
  62174. }
  62175. if (typeof ref === 'function') {
  62176. ref(instanceToUse);
  62177. } else {
  62178. {
  62179. if (!ref.hasOwnProperty('current')) {
  62180. warningWithoutStack$1(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
  62181. }
  62182. }
  62183. ref.current = instanceToUse;
  62184. }
  62185. }
  62186. }
  62187. function commitDetachRef(current$$1) {
  62188. var currentRef = current$$1.ref;
  62189. if (currentRef !== null) {
  62190. if (typeof currentRef === 'function') {
  62191. currentRef(null);
  62192. } else {
  62193. currentRef.current = null;
  62194. }
  62195. }
  62196. } // User-originating errors (lifecycles and refs) should not interrupt
  62197. // deletion, so don't let them throw. Host-originating errors should
  62198. // interrupt deletion, so it's okay
  62199. function commitUnmount(finishedRoot, current$$1, renderPriorityLevel) {
  62200. onCommitUnmount(current$$1);
  62201. switch (current$$1.tag) {
  62202. case FunctionComponent:
  62203. case ForwardRef:
  62204. case MemoComponent:
  62205. case SimpleMemoComponent:
  62206. {
  62207. var updateQueue = current$$1.updateQueue;
  62208. if (updateQueue !== null) {
  62209. var lastEffect = updateQueue.lastEffect;
  62210. if (lastEffect !== null) {
  62211. var firstEffect = lastEffect.next; // When the owner fiber is deleted, the destroy function of a passive
  62212. // effect hook is called during the synchronous commit phase. This is
  62213. // a concession to implementation complexity. Calling it in the
  62214. // passive effect phase (like they usually are, when dependencies
  62215. // change during an update) would require either traversing the
  62216. // children of the deleted fiber again, or including unmount effects
  62217. // as part of the fiber effect list.
  62218. //
  62219. // Because this is during the sync commit phase, we need to change
  62220. // the priority.
  62221. //
  62222. // TODO: Reconsider this implementation trade off.
  62223. var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;
  62224. runWithPriority$2(priorityLevel, function () {
  62225. var effect = firstEffect;
  62226. do {
  62227. var destroy = effect.destroy;
  62228. if (destroy !== undefined) {
  62229. safelyCallDestroy(current$$1, destroy);
  62230. }
  62231. effect = effect.next;
  62232. } while (effect !== firstEffect);
  62233. });
  62234. }
  62235. }
  62236. break;
  62237. }
  62238. case ClassComponent:
  62239. {
  62240. safelyDetachRef(current$$1);
  62241. var instance = current$$1.stateNode;
  62242. if (typeof instance.componentWillUnmount === 'function') {
  62243. safelyCallComponentWillUnmount(current$$1, instance);
  62244. }
  62245. return;
  62246. }
  62247. case HostComponent:
  62248. {
  62249. if (enableFlareAPI) {
  62250. var dependencies = current$$1.dependencies;
  62251. if (dependencies !== null) {
  62252. var respondersMap = dependencies.responders;
  62253. if (respondersMap !== null) {
  62254. var responderInstances = Array.from(respondersMap.values());
  62255. for (var i = 0, length = responderInstances.length; i < length; i++) {
  62256. var responderInstance = responderInstances[i];
  62257. unmountResponderInstance(responderInstance);
  62258. }
  62259. dependencies.responders = null;
  62260. }
  62261. }
  62262. }
  62263. safelyDetachRef(current$$1);
  62264. return;
  62265. }
  62266. case HostPortal:
  62267. {
  62268. // TODO: this is recursive.
  62269. // We are also not using this parent because
  62270. // the portal will get pushed immediately.
  62271. if (supportsMutation) {
  62272. unmountHostComponents(finishedRoot, current$$1, renderPriorityLevel);
  62273. } else if (supportsPersistence) {
  62274. emptyPortalContainer(current$$1);
  62275. }
  62276. return;
  62277. }
  62278. case FundamentalComponent:
  62279. {
  62280. if (enableFundamentalAPI) {
  62281. var fundamentalInstance = current$$1.stateNode;
  62282. if (fundamentalInstance !== null) {
  62283. unmountFundamentalComponent(fundamentalInstance);
  62284. current$$1.stateNode = null;
  62285. }
  62286. }
  62287. return;
  62288. }
  62289. case DehydratedFragment:
  62290. {
  62291. if (enableSuspenseCallback) {
  62292. var hydrationCallbacks = finishedRoot.hydrationCallbacks;
  62293. if (hydrationCallbacks !== null) {
  62294. var onDeleted = hydrationCallbacks.onDeleted;
  62295. if (onDeleted) {
  62296. onDeleted(current$$1.stateNode);
  62297. }
  62298. }
  62299. }
  62300. return;
  62301. }
  62302. case ScopeComponent:
  62303. {
  62304. if (enableScopeAPI) {
  62305. safelyDetachRef(current$$1);
  62306. }
  62307. }
  62308. }
  62309. }
  62310. function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {
  62311. // While we're inside a removed host node we don't want to call
  62312. // removeChild on the inner nodes because they're removed by the top
  62313. // call anyway. We also want to call componentWillUnmount on all
  62314. // composites before this host node is removed from the tree. Therefore
  62315. // we do an inner loop while we're still inside the host node.
  62316. var node = root;
  62317. while (true) {
  62318. commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because they may contain more composite or host nodes.
  62319. // Skip portals because commitUnmount() currently visits them recursively.
  62320. if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.
  62321. // If we don't use mutation we drill down into portals here instead.
  62322. !supportsMutation || node.tag !== HostPortal)) {
  62323. node.child.return = node;
  62324. node = node.child;
  62325. continue;
  62326. }
  62327. if (node === root) {
  62328. return;
  62329. }
  62330. while (node.sibling === null) {
  62331. if (node.return === null || node.return === root) {
  62332. return;
  62333. }
  62334. node = node.return;
  62335. }
  62336. node.sibling.return = node.return;
  62337. node = node.sibling;
  62338. }
  62339. }
  62340. function detachFiber(current$$1) {
  62341. var alternate = current$$1.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we
  62342. // should clear the child pointer of the parent alternate to let this
  62343. // get GC:ed but we don't know which for sure which parent is the current
  62344. // one so we'll settle for GC:ing the subtree of this child. This child
  62345. // itself will be GC:ed when the parent updates the next time.
  62346. current$$1.return = null;
  62347. current$$1.child = null;
  62348. current$$1.memoizedState = null;
  62349. current$$1.updateQueue = null;
  62350. current$$1.dependencies = null;
  62351. current$$1.alternate = null;
  62352. current$$1.firstEffect = null;
  62353. current$$1.lastEffect = null;
  62354. current$$1.pendingProps = null;
  62355. current$$1.memoizedProps = null;
  62356. if (alternate !== null) {
  62357. detachFiber(alternate);
  62358. }
  62359. }
  62360. function emptyPortalContainer(current$$1) {
  62361. if (!supportsPersistence) {
  62362. return;
  62363. }
  62364. var portal = current$$1.stateNode;
  62365. var containerInfo = portal.containerInfo;
  62366. var emptyChildSet = createContainerChildSet(containerInfo);
  62367. replaceContainerChildren(containerInfo, emptyChildSet);
  62368. }
  62369. function commitContainer(finishedWork) {
  62370. if (!supportsPersistence) {
  62371. return;
  62372. }
  62373. switch (finishedWork.tag) {
  62374. case ClassComponent:
  62375. case HostComponent:
  62376. case HostText:
  62377. case FundamentalComponent:
  62378. {
  62379. return;
  62380. }
  62381. case HostRoot:
  62382. case HostPortal:
  62383. {
  62384. var portalOrRoot = finishedWork.stateNode;
  62385. var containerInfo = portalOrRoot.containerInfo,
  62386. pendingChildren = portalOrRoot.pendingChildren;
  62387. replaceContainerChildren(containerInfo, pendingChildren);
  62388. return;
  62389. }
  62390. default:
  62391. {
  62392. {
  62393. {
  62394. throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
  62395. }
  62396. }
  62397. }
  62398. }
  62399. }
  62400. function getHostParentFiber(fiber) {
  62401. var parent = fiber.return;
  62402. while (parent !== null) {
  62403. if (isHostParent(parent)) {
  62404. return parent;
  62405. }
  62406. parent = parent.return;
  62407. }
  62408. {
  62409. {
  62410. throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
  62411. }
  62412. }
  62413. }
  62414. function isHostParent(fiber) {
  62415. return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
  62416. }
  62417. function getHostSibling(fiber) {
  62418. // We're going to search forward into the tree until we find a sibling host
  62419. // node. Unfortunately, if multiple insertions are done in a row we have to
  62420. // search past them. This leads to exponential search for the next sibling.
  62421. // TODO: Find a more efficient way to do this.
  62422. var node = fiber;
  62423. siblings: while (true) {
  62424. // If we didn't find anything, let's try the next sibling.
  62425. while (node.sibling === null) {
  62426. if (node.return === null || isHostParent(node.return)) {
  62427. // If we pop out of the root or hit the parent the fiber we are the
  62428. // last sibling.
  62429. return null;
  62430. }
  62431. node = node.return;
  62432. }
  62433. node.sibling.return = node.return;
  62434. node = node.sibling;
  62435. while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
  62436. // If it is not host node and, we might have a host node inside it.
  62437. // Try to search down until we find one.
  62438. if (node.effectTag & Placement) {
  62439. // If we don't have a child, try the siblings instead.
  62440. continue siblings;
  62441. } // If we don't have a child, try the siblings instead.
  62442. // We also skip portals because they are not part of this host tree.
  62443. if (node.child === null || node.tag === HostPortal) {
  62444. continue siblings;
  62445. } else {
  62446. node.child.return = node;
  62447. node = node.child;
  62448. }
  62449. } // Check if this host node is stable or about to be placed.
  62450. if (!(node.effectTag & Placement)) {
  62451. // Found it!
  62452. return node.stateNode;
  62453. }
  62454. }
  62455. }
  62456. function commitPlacement(finishedWork) {
  62457. if (!supportsMutation) {
  62458. return;
  62459. } // Recursively insert all host nodes into the parent.
  62460. var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.
  62461. var parent;
  62462. var isContainer;
  62463. var parentStateNode = parentFiber.stateNode;
  62464. switch (parentFiber.tag) {
  62465. case HostComponent:
  62466. parent = parentStateNode;
  62467. isContainer = false;
  62468. break;
  62469. case HostRoot:
  62470. parent = parentStateNode.containerInfo;
  62471. isContainer = true;
  62472. break;
  62473. case HostPortal:
  62474. parent = parentStateNode.containerInfo;
  62475. isContainer = true;
  62476. break;
  62477. case FundamentalComponent:
  62478. if (enableFundamentalAPI) {
  62479. parent = parentStateNode.instance;
  62480. isContainer = false;
  62481. }
  62482. // eslint-disable-next-line-no-fallthrough
  62483. default:
  62484. {
  62485. {
  62486. throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
  62487. }
  62488. }
  62489. }
  62490. if (parentFiber.effectTag & ContentReset) {
  62491. // Reset the text content of the parent before doing any insertions
  62492. resetTextContent(parent); // Clear ContentReset from the effect tag
  62493. parentFiber.effectTag &= ~ContentReset;
  62494. }
  62495. var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its
  62496. // children to find all the terminal nodes.
  62497. var node = finishedWork;
  62498. while (true) {
  62499. var isHost = node.tag === HostComponent || node.tag === HostText;
  62500. if (isHost || enableFundamentalAPI && node.tag === FundamentalComponent) {
  62501. var stateNode = isHost ? node.stateNode : node.stateNode.instance;
  62502. if (before) {
  62503. if (isContainer) {
  62504. insertInContainerBefore(parent, stateNode, before);
  62505. } else {
  62506. insertBefore(parent, stateNode, before);
  62507. }
  62508. } else {
  62509. if (isContainer) {
  62510. appendChildToContainer(parent, stateNode);
  62511. } else {
  62512. appendChild(parent, stateNode);
  62513. }
  62514. }
  62515. } else if (node.tag === HostPortal) {// If the insertion itself is a portal, then we don't want to traverse
  62516. // down its children. Instead, we'll get insertions from each child in
  62517. // the portal directly.
  62518. } else if (node.child !== null) {
  62519. node.child.return = node;
  62520. node = node.child;
  62521. continue;
  62522. }
  62523. if (node === finishedWork) {
  62524. return;
  62525. }
  62526. while (node.sibling === null) {
  62527. if (node.return === null || node.return === finishedWork) {
  62528. return;
  62529. }
  62530. node = node.return;
  62531. }
  62532. node.sibling.return = node.return;
  62533. node = node.sibling;
  62534. }
  62535. }
  62536. function unmountHostComponents(finishedRoot, current$$1, renderPriorityLevel) {
  62537. // We only have the top Fiber that was deleted but we need to recurse down its
  62538. // children to find all the terminal nodes.
  62539. var node = current$$1; // Each iteration, currentParent is populated with node's host parent if not
  62540. // currentParentIsValid.
  62541. var currentParentIsValid = false; // Note: these two variables *must* always be updated together.
  62542. var currentParent;
  62543. var currentParentIsContainer;
  62544. while (true) {
  62545. if (!currentParentIsValid) {
  62546. var parent = node.return;
  62547. findParent: while (true) {
  62548. if (!(parent !== null)) {
  62549. {
  62550. throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
  62551. }
  62552. }
  62553. var parentStateNode = parent.stateNode;
  62554. switch (parent.tag) {
  62555. case HostComponent:
  62556. currentParent = parentStateNode;
  62557. currentParentIsContainer = false;
  62558. break findParent;
  62559. case HostRoot:
  62560. currentParent = parentStateNode.containerInfo;
  62561. currentParentIsContainer = true;
  62562. break findParent;
  62563. case HostPortal:
  62564. currentParent = parentStateNode.containerInfo;
  62565. currentParentIsContainer = true;
  62566. break findParent;
  62567. case FundamentalComponent:
  62568. if (enableFundamentalAPI) {
  62569. currentParent = parentStateNode.instance;
  62570. currentParentIsContainer = false;
  62571. }
  62572. }
  62573. parent = parent.return;
  62574. }
  62575. currentParentIsValid = true;
  62576. }
  62577. if (node.tag === HostComponent || node.tag === HostText) {
  62578. commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the
  62579. // node from the tree.
  62580. if (currentParentIsContainer) {
  62581. removeChildFromContainer(currentParent, node.stateNode);
  62582. } else {
  62583. removeChild(currentParent, node.stateNode);
  62584. } // Don't visit children because we already visited them.
  62585. } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
  62586. var fundamentalNode = node.stateNode.instance;
  62587. commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the
  62588. // node from the tree.
  62589. if (currentParentIsContainer) {
  62590. removeChildFromContainer(currentParent, fundamentalNode);
  62591. } else {
  62592. removeChild(currentParent, fundamentalNode);
  62593. }
  62594. } else if (enableSuspenseServerRenderer && node.tag === DehydratedFragment) {
  62595. if (enableSuspenseCallback) {
  62596. var hydrationCallbacks = finishedRoot.hydrationCallbacks;
  62597. if (hydrationCallbacks !== null) {
  62598. var onDeleted = hydrationCallbacks.onDeleted;
  62599. if (onDeleted) {
  62600. onDeleted(node.stateNode);
  62601. }
  62602. }
  62603. } // Delete the dehydrated suspense boundary and all of its content.
  62604. if (currentParentIsContainer) {
  62605. clearSuspenseBoundaryFromContainer(currentParent, node.stateNode);
  62606. } else {
  62607. clearSuspenseBoundary(currentParent, node.stateNode);
  62608. }
  62609. } else if (node.tag === HostPortal) {
  62610. if (node.child !== null) {
  62611. // When we go into a portal, it becomes the parent to remove from.
  62612. // We will reassign it back when we pop the portal on the way up.
  62613. currentParent = node.stateNode.containerInfo;
  62614. currentParentIsContainer = true; // Visit children because portals might contain host components.
  62615. node.child.return = node;
  62616. node = node.child;
  62617. continue;
  62618. }
  62619. } else {
  62620. commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because we may find more host components below.
  62621. if (node.child !== null) {
  62622. node.child.return = node;
  62623. node = node.child;
  62624. continue;
  62625. }
  62626. }
  62627. if (node === current$$1) {
  62628. return;
  62629. }
  62630. while (node.sibling === null) {
  62631. if (node.return === null || node.return === current$$1) {
  62632. return;
  62633. }
  62634. node = node.return;
  62635. if (node.tag === HostPortal) {
  62636. // When we go out of the portal, we need to restore the parent.
  62637. // Since we don't keep a stack of them, we will search for it.
  62638. currentParentIsValid = false;
  62639. }
  62640. }
  62641. node.sibling.return = node.return;
  62642. node = node.sibling;
  62643. }
  62644. }
  62645. function commitDeletion(finishedRoot, current$$1, renderPriorityLevel) {
  62646. if (supportsMutation) {
  62647. // Recursively delete all host nodes from the parent.
  62648. // Detach refs and call componentWillUnmount() on the whole subtree.
  62649. unmountHostComponents(finishedRoot, current$$1, renderPriorityLevel);
  62650. } else {
  62651. // Detach refs and call componentWillUnmount() on the whole subtree.
  62652. commitNestedUnmounts(finishedRoot, current$$1, renderPriorityLevel);
  62653. }
  62654. detachFiber(current$$1);
  62655. }
  62656. function commitWork(current$$1, finishedWork) {
  62657. if (!supportsMutation) {
  62658. switch (finishedWork.tag) {
  62659. case FunctionComponent:
  62660. case ForwardRef:
  62661. case MemoComponent:
  62662. case SimpleMemoComponent:
  62663. {
  62664. // Note: We currently never use MountMutation, but useLayout uses
  62665. // UnmountMutation.
  62666. commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
  62667. return;
  62668. }
  62669. case Profiler:
  62670. {
  62671. return;
  62672. }
  62673. case SuspenseComponent:
  62674. {
  62675. commitSuspenseComponent(finishedWork);
  62676. attachSuspenseRetryListeners(finishedWork);
  62677. return;
  62678. }
  62679. case SuspenseListComponent:
  62680. {
  62681. attachSuspenseRetryListeners(finishedWork);
  62682. return;
  62683. }
  62684. case HostRoot:
  62685. {
  62686. if (supportsHydration) {
  62687. var root = finishedWork.stateNode;
  62688. if (root.hydrate) {
  62689. // We've just hydrated. No need to hydrate again.
  62690. root.hydrate = false;
  62691. commitHydratedContainer(root.containerInfo);
  62692. }
  62693. }
  62694. break;
  62695. }
  62696. }
  62697. commitContainer(finishedWork);
  62698. return;
  62699. }
  62700. switch (finishedWork.tag) {
  62701. case FunctionComponent:
  62702. case ForwardRef:
  62703. case MemoComponent:
  62704. case SimpleMemoComponent:
  62705. {
  62706. // Note: We currently never use MountMutation, but useLayout uses
  62707. // UnmountMutation.
  62708. commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
  62709. return;
  62710. }
  62711. case ClassComponent:
  62712. {
  62713. return;
  62714. }
  62715. case HostComponent:
  62716. {
  62717. var instance = finishedWork.stateNode;
  62718. if (instance != null) {
  62719. // Commit the work prepared earlier.
  62720. var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
  62721. // as the newProps. The updatePayload will contain the real change in
  62722. // this case.
  62723. var oldProps = current$$1 !== null ? current$$1.memoizedProps : newProps;
  62724. var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.
  62725. var updatePayload = finishedWork.updateQueue;
  62726. finishedWork.updateQueue = null;
  62727. if (updatePayload !== null) {
  62728. commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
  62729. }
  62730. if (enableFlareAPI) {
  62731. var prevListeners = oldProps.listeners;
  62732. var nextListeners = newProps.listeners;
  62733. if (prevListeners !== nextListeners) {
  62734. updateEventListeners(nextListeners, finishedWork, null);
  62735. }
  62736. }
  62737. }
  62738. return;
  62739. }
  62740. case HostText:
  62741. {
  62742. if (!(finishedWork.stateNode !== null)) {
  62743. {
  62744. throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
  62745. }
  62746. }
  62747. var textInstance = finishedWork.stateNode;
  62748. var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
  62749. // as the newProps. The updatePayload will contain the real change in
  62750. // this case.
  62751. var oldText = current$$1 !== null ? current$$1.memoizedProps : newText;
  62752. commitTextUpdate(textInstance, oldText, newText);
  62753. return;
  62754. }
  62755. case HostRoot:
  62756. {
  62757. if (supportsHydration) {
  62758. var _root = finishedWork.stateNode;
  62759. if (_root.hydrate) {
  62760. // We've just hydrated. No need to hydrate again.
  62761. _root.hydrate = false;
  62762. commitHydratedContainer(_root.containerInfo);
  62763. }
  62764. }
  62765. return;
  62766. }
  62767. case Profiler:
  62768. {
  62769. return;
  62770. }
  62771. case SuspenseComponent:
  62772. {
  62773. commitSuspenseComponent(finishedWork);
  62774. attachSuspenseRetryListeners(finishedWork);
  62775. return;
  62776. }
  62777. case SuspenseListComponent:
  62778. {
  62779. attachSuspenseRetryListeners(finishedWork);
  62780. return;
  62781. }
  62782. case IncompleteClassComponent:
  62783. {
  62784. return;
  62785. }
  62786. case FundamentalComponent:
  62787. {
  62788. if (enableFundamentalAPI) {
  62789. var fundamentalInstance = finishedWork.stateNode;
  62790. updateFundamentalComponent(fundamentalInstance);
  62791. }
  62792. return;
  62793. }
  62794. case ScopeComponent:
  62795. {
  62796. if (enableScopeAPI) {
  62797. var scopeInstance = finishedWork.stateNode;
  62798. scopeInstance.fiber = finishedWork;
  62799. if (enableFlareAPI) {
  62800. var _newProps = finishedWork.memoizedProps;
  62801. var _oldProps = current$$1 !== null ? current$$1.memoizedProps : _newProps;
  62802. var _prevListeners = _oldProps.listeners;
  62803. var _nextListeners = _newProps.listeners;
  62804. if (_prevListeners !== _nextListeners) {
  62805. updateEventListeners(_nextListeners, finishedWork, null);
  62806. }
  62807. }
  62808. }
  62809. return;
  62810. }
  62811. default:
  62812. {
  62813. {
  62814. {
  62815. throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
  62816. }
  62817. }
  62818. }
  62819. }
  62820. }
  62821. function commitSuspenseComponent(finishedWork) {
  62822. var newState = finishedWork.memoizedState;
  62823. var newDidTimeout;
  62824. var primaryChildParent = finishedWork;
  62825. if (newState === null) {
  62826. newDidTimeout = false;
  62827. } else {
  62828. newDidTimeout = true;
  62829. primaryChildParent = finishedWork.child;
  62830. markCommitTimeOfFallback();
  62831. }
  62832. if (supportsMutation && primaryChildParent !== null) {
  62833. hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
  62834. }
  62835. if (enableSuspenseCallback && newState !== null) {
  62836. var suspenseCallback = finishedWork.memoizedProps.suspenseCallback;
  62837. if (typeof suspenseCallback === 'function') {
  62838. var thenables = finishedWork.updateQueue;
  62839. if (thenables !== null) {
  62840. suspenseCallback(new Set(thenables));
  62841. }
  62842. } else {
  62843. if (suspenseCallback !== undefined) {
  62844. warning$1(false, 'Unexpected type for suspenseCallback.');
  62845. }
  62846. }
  62847. }
  62848. }
  62849. function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
  62850. if (!supportsHydration) {
  62851. return;
  62852. }
  62853. var newState = finishedWork.memoizedState;
  62854. if (newState === null) {
  62855. var current$$1 = finishedWork.alternate;
  62856. if (current$$1 !== null) {
  62857. var prevState = current$$1.memoizedState;
  62858. if (prevState !== null) {
  62859. var suspenseInstance = prevState.dehydrated;
  62860. if (suspenseInstance !== null) {
  62861. commitHydratedSuspenseInstance(suspenseInstance);
  62862. if (enableSuspenseCallback) {
  62863. var hydrationCallbacks = finishedRoot.hydrationCallbacks;
  62864. if (hydrationCallbacks !== null) {
  62865. var onHydrated = hydrationCallbacks.onHydrated;
  62866. if (onHydrated) {
  62867. onHydrated(suspenseInstance);
  62868. }
  62869. }
  62870. }
  62871. }
  62872. }
  62873. }
  62874. }
  62875. }
  62876. function attachSuspenseRetryListeners(finishedWork) {
  62877. // If this boundary just timed out, then it will have a set of thenables.
  62878. // For each thenable, attach a listener so that when it resolves, React
  62879. // attempts to re-render the boundary in the primary (pre-timeout) state.
  62880. var thenables = finishedWork.updateQueue;
  62881. if (thenables !== null) {
  62882. finishedWork.updateQueue = null;
  62883. var retryCache = finishedWork.stateNode;
  62884. if (retryCache === null) {
  62885. retryCache = finishedWork.stateNode = new PossiblyWeakSet();
  62886. }
  62887. thenables.forEach(function (thenable) {
  62888. // Memoize using the boundary fiber to prevent redundant listeners.
  62889. var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
  62890. if (!retryCache.has(thenable)) {
  62891. if (enableSchedulerTracing) {
  62892. if (thenable.__reactDoNotTraceInteractions !== true) {
  62893. retry = tracing.unstable_wrap(retry);
  62894. }
  62895. }
  62896. retryCache.add(thenable);
  62897. thenable.then(retry, retry);
  62898. }
  62899. });
  62900. }
  62901. }
  62902. function commitResetTextContent(current$$1) {
  62903. if (!supportsMutation) {
  62904. return;
  62905. }
  62906. resetTextContent(current$$1.stateNode);
  62907. }
  62908. var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;
  62909. function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
  62910. var update = createUpdate(expirationTime, null); // Unmount the root by rendering null.
  62911. update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property
  62912. // being called "element".
  62913. update.payload = {
  62914. element: null
  62915. };
  62916. var error = errorInfo.value;
  62917. update.callback = function () {
  62918. onUncaughtError(error);
  62919. logError(fiber, errorInfo);
  62920. };
  62921. return update;
  62922. }
  62923. function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
  62924. var update = createUpdate(expirationTime, null);
  62925. update.tag = CaptureUpdate;
  62926. var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  62927. if (typeof getDerivedStateFromError === 'function') {
  62928. var error = errorInfo.value;
  62929. update.payload = function () {
  62930. logError(fiber, errorInfo);
  62931. return getDerivedStateFromError(error);
  62932. };
  62933. }
  62934. var inst = fiber.stateNode;
  62935. if (inst !== null && typeof inst.componentDidCatch === 'function') {
  62936. update.callback = function callback() {
  62937. {
  62938. markFailedErrorBoundaryForHotReloading(fiber);
  62939. }
  62940. if (typeof getDerivedStateFromError !== 'function') {
  62941. // To preserve the preexisting retry behavior of error boundaries,
  62942. // we keep track of which ones already failed during this batch.
  62943. // This gets reset before we yield back to the browser.
  62944. // TODO: Warn in strict mode if getDerivedStateFromError is
  62945. // not defined.
  62946. markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined
  62947. logError(fiber, errorInfo);
  62948. }
  62949. var error = errorInfo.value;
  62950. var stack = errorInfo.stack;
  62951. this.componentDidCatch(error, {
  62952. componentStack: stack !== null ? stack : ''
  62953. });
  62954. {
  62955. if (typeof getDerivedStateFromError !== 'function') {
  62956. // If componentDidCatch is the only error boundary method defined,
  62957. // then it needs to call setState to recover from errors.
  62958. // If no state update is scheduled then the boundary will swallow the error.
  62959. !(fiber.expirationTime === Sync) ? warningWithoutStack$1(false, '%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown') : void 0;
  62960. }
  62961. }
  62962. };
  62963. } else {
  62964. update.callback = function () {
  62965. markFailedErrorBoundaryForHotReloading(fiber);
  62966. };
  62967. }
  62968. return update;
  62969. }
  62970. function attachPingListener(root, renderExpirationTime, thenable) {
  62971. // Attach a listener to the promise to "ping" the root and retry. But
  62972. // only if one does not already exist for the current render expiration
  62973. // time (which acts like a "thread ID" here).
  62974. var pingCache = root.pingCache;
  62975. var threadIDs;
  62976. if (pingCache === null) {
  62977. pingCache = root.pingCache = new PossiblyWeakMap$1();
  62978. threadIDs = new Set();
  62979. pingCache.set(thenable, threadIDs);
  62980. } else {
  62981. threadIDs = pingCache.get(thenable);
  62982. if (threadIDs === undefined) {
  62983. threadIDs = new Set();
  62984. pingCache.set(thenable, threadIDs);
  62985. }
  62986. }
  62987. if (!threadIDs.has(renderExpirationTime)) {
  62988. // Memoize using the thread ID to prevent redundant listeners.
  62989. threadIDs.add(renderExpirationTime);
  62990. var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
  62991. thenable.then(ping, ping);
  62992. }
  62993. }
  62994. function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {
  62995. // The source fiber did not complete.
  62996. sourceFiber.effectTag |= Incomplete; // Its effect list is no longer valid.
  62997. sourceFiber.firstEffect = sourceFiber.lastEffect = null;
  62998. if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
  62999. // This is a thenable.
  63000. var thenable = value;
  63001. checkForWrongSuspensePriorityInDEV(sourceFiber);
  63002. var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.
  63003. var _workInProgress = returnFiber;
  63004. do {
  63005. if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
  63006. // Found the nearest boundary.
  63007. // Stash the promise on the boundary fiber. If the boundary times out, we'll
  63008. // attach another listener to flip the boundary back to its normal state.
  63009. var thenables = _workInProgress.updateQueue;
  63010. if (thenables === null) {
  63011. var updateQueue = new Set();
  63012. updateQueue.add(thenable);
  63013. _workInProgress.updateQueue = updateQueue;
  63014. } else {
  63015. thenables.add(thenable);
  63016. } // If the boundary is outside of blocking mode, we should *not*
  63017. // suspend the commit. Pretend as if the suspended component rendered
  63018. // null and keep rendering. In the commit phase, we'll schedule a
  63019. // subsequent synchronous update to re-render the Suspense.
  63020. //
  63021. // Note: It doesn't matter whether the component that suspended was
  63022. // inside a blocking mode tree. If the Suspense is outside of it, we
  63023. // should *not* suspend the commit.
  63024. if ((_workInProgress.mode & BlockingMode) === NoMode) {
  63025. _workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete.
  63026. // But we shouldn't call any lifecycle methods or callbacks. Remove
  63027. // all lifecycle effect tags.
  63028. sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
  63029. if (sourceFiber.tag === ClassComponent) {
  63030. var currentSourceFiber = sourceFiber.alternate;
  63031. if (currentSourceFiber === null) {
  63032. // This is a new mount. Change the tag so it's not mistaken for a
  63033. // completed class component. For example, we should not call
  63034. // componentWillUnmount if it is deleted.
  63035. sourceFiber.tag = IncompleteClassComponent;
  63036. } else {
  63037. // When we try rendering again, we should not reuse the current fiber,
  63038. // since it's known to be in an inconsistent state. Use a force update to
  63039. // prevent a bail out.
  63040. var update = createUpdate(Sync, null);
  63041. update.tag = ForceUpdate;
  63042. enqueueUpdate(sourceFiber, update);
  63043. }
  63044. } // The source fiber did not complete. Mark it with Sync priority to
  63045. // indicate that it still has pending work.
  63046. sourceFiber.expirationTime = Sync; // Exit without suspending.
  63047. return;
  63048. } // Confirmed that the boundary is in a concurrent mode tree. Continue
  63049. // with the normal suspend path.
  63050. //
  63051. // After this we'll use a set of heuristics to determine whether this
  63052. // render pass will run to completion or restart or "suspend" the commit.
  63053. // The actual logic for this is spread out in different places.
  63054. //
  63055. // This first principle is that if we're going to suspend when we complete
  63056. // a root, then we should also restart if we get an update or ping that
  63057. // might unsuspend it, and vice versa. The only reason to suspend is
  63058. // because you think you might want to restart before committing. However,
  63059. // it doesn't make sense to restart only while in the period we're suspended.
  63060. //
  63061. // Restarting too aggressively is also not good because it starves out any
  63062. // intermediate loading state. So we use heuristics to determine when.
  63063. // Suspense Heuristics
  63064. //
  63065. // If nothing threw a Promise or all the same fallbacks are already showing,
  63066. // then don't suspend/restart.
  63067. //
  63068. // If this is an initial render of a new tree of Suspense boundaries and
  63069. // those trigger a fallback, then don't suspend/restart. We want to ensure
  63070. // that we can show the initial loading state as quickly as possible.
  63071. //
  63072. // If we hit a "Delayed" case, such as when we'd switch from content back into
  63073. // a fallback, then we should always suspend/restart. SuspenseConfig applies to
  63074. // this case. If none is defined, JND is used instead.
  63075. //
  63076. // If we're already showing a fallback and it gets "retried", allowing us to show
  63077. // another level, but there's still an inner boundary that would show a fallback,
  63078. // then we suspend/restart for 500ms since the last time we showed a fallback
  63079. // anywhere in the tree. This effectively throttles progressive loading into a
  63080. // consistent train of commits. This also gives us an opportunity to restart to
  63081. // get to the completed state slightly earlier.
  63082. //
  63083. // If there's ambiguity due to batching it's resolved in preference of:
  63084. // 1) "delayed", 2) "initial render", 3) "retry".
  63085. //
  63086. // We want to ensure that a "busy" state doesn't get force committed. We want to
  63087. // ensure that new initial loading states can commit as soon as possible.
  63088. attachPingListener(root, renderExpirationTime, thenable);
  63089. _workInProgress.effectTag |= ShouldCapture;
  63090. _workInProgress.expirationTime = renderExpirationTime;
  63091. return;
  63092. } // This boundary already captured during this render. Continue to the next
  63093. // boundary.
  63094. _workInProgress = _workInProgress.return;
  63095. } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.
  63096. // TODO: Use invariant so the message is stripped in prod?
  63097. value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));
  63098. } // We didn't find a boundary that could handle this type of exception. Start
  63099. // over and traverse parent path again, this time treating the exception
  63100. // as an error.
  63101. renderDidError();
  63102. value = createCapturedValue(value, sourceFiber);
  63103. var workInProgress = returnFiber;
  63104. do {
  63105. switch (workInProgress.tag) {
  63106. case HostRoot:
  63107. {
  63108. var _errorInfo = value;
  63109. workInProgress.effectTag |= ShouldCapture;
  63110. workInProgress.expirationTime = renderExpirationTime;
  63111. var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
  63112. enqueueCapturedUpdate(workInProgress, _update);
  63113. return;
  63114. }
  63115. case ClassComponent:
  63116. // Capture and retry
  63117. var errorInfo = value;
  63118. var ctor = workInProgress.type;
  63119. var instance = workInProgress.stateNode;
  63120. if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
  63121. workInProgress.effectTag |= ShouldCapture;
  63122. workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state
  63123. var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
  63124. enqueueCapturedUpdate(workInProgress, _update2);
  63125. return;
  63126. }
  63127. break;
  63128. default:
  63129. break;
  63130. }
  63131. workInProgress = workInProgress.return;
  63132. } while (workInProgress !== null);
  63133. }
  63134. var ceil = Math.ceil;
  63135. var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
  63136. var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner;
  63137. var IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
  63138. var NoContext =
  63139. /* */
  63140. 0;
  63141. var BatchedContext =
  63142. /* */
  63143. 1;
  63144. var EventContext =
  63145. /* */
  63146. 2;
  63147. var DiscreteEventContext =
  63148. /* */
  63149. 4;
  63150. var LegacyUnbatchedContext =
  63151. /* */
  63152. 8;
  63153. var RenderContext =
  63154. /* */
  63155. 16;
  63156. var CommitContext =
  63157. /* */
  63158. 32;
  63159. var RootIncomplete = 0;
  63160. var RootFatalErrored = 1;
  63161. var RootErrored = 2;
  63162. var RootSuspended = 3;
  63163. var RootSuspendedWithDelay = 4;
  63164. var RootCompleted = 5;
  63165. // Describes where we are in the React execution stack
  63166. var executionContext = NoContext; // The root we're working on
  63167. var workInProgressRoot = null; // The fiber we're working on
  63168. var workInProgress = null; // The expiration time we're rendering
  63169. var renderExpirationTime = NoWork; // Whether to root completed, errored, suspended, etc.
  63170. var workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown
  63171. var workInProgressRootFatalError = null; // Most recent event time among processed updates during this render.
  63172. // This is conceptually a time stamp but expressed in terms of an ExpirationTime
  63173. // because we deal mostly with expiration times in the hot path, so this avoids
  63174. // the conversion happening in the hot path.
  63175. var workInProgressRootLatestProcessedExpirationTime = Sync;
  63176. var workInProgressRootLatestSuspenseTimeout = Sync;
  63177. var workInProgressRootCanSuspendUsingConfig = null; // The work left over by components that were visited during this render. Only
  63178. // includes unprocessed updates, not work in bailed out children.
  63179. var workInProgressRootNextUnprocessedUpdateTime = NoWork; // If we're pinged while rendering we don't always restart immediately.
  63180. // This flag determines if it might be worthwhile to restart if an opportunity
  63181. // happens latere.
  63182. var workInProgressRootHasPendingPing = false; // The most recent time we committed a fallback. This lets us ensure a train
  63183. // model where we don't commit new loading states in too quick succession.
  63184. var globalMostRecentFallbackTime = 0;
  63185. var FALLBACK_THROTTLE_MS = 500;
  63186. var nextEffect = null;
  63187. var hasUncaughtError = false;
  63188. var firstUncaughtError = null;
  63189. var legacyErrorBoundariesThatAlreadyFailed = null;
  63190. var rootDoesHavePassiveEffects = false;
  63191. var rootWithPendingPassiveEffects = null;
  63192. var pendingPassiveEffectsRenderPriority = NoPriority;
  63193. var pendingPassiveEffectsExpirationTime = NoWork;
  63194. var rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates
  63195. var NESTED_UPDATE_LIMIT = 50;
  63196. var nestedUpdateCount = 0;
  63197. var rootWithNestedUpdates = null;
  63198. var NESTED_PASSIVE_UPDATE_LIMIT = 50;
  63199. var nestedPassiveUpdateCount = 0;
  63200. var interruptedBy = null; // Marks the need to reschedule pending interactions at these expiration times
  63201. // during the commit phase. This enables them to be traced across components
  63202. // that spawn new work during render. E.g. hidden boundaries, suspended SSR
  63203. // hydration or SuspenseList.
  63204. var spawnedWorkDuringRender = null; // Expiration times are computed by adding to the current time (the start
  63205. // time). However, if two updates are scheduled within the same event, we
  63206. // should treat their start times as simultaneous, even if the actual clock
  63207. // time has advanced between the first and second call.
  63208. // In other words, because expiration times determine how updates are batched,
  63209. // we want all updates of like priority that occur within the same event to
  63210. // receive the same expiration time. Otherwise we get tearing.
  63211. var currentEventTime = NoWork;
  63212. function requestCurrentTimeForUpdate() {
  63213. if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
  63214. // We're inside React, so it's fine to read the actual time.
  63215. return msToExpirationTime(now());
  63216. } // We're not inside React, so we may be in the middle of a browser event.
  63217. if (currentEventTime !== NoWork) {
  63218. // Use the same start time for all updates until we enter React again.
  63219. return currentEventTime;
  63220. } // This is the first update since React yielded. Compute a new start time.
  63221. currentEventTime = msToExpirationTime(now());
  63222. return currentEventTime;
  63223. }
  63224. function getCurrentTime() {
  63225. return msToExpirationTime(now());
  63226. }
  63227. function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
  63228. var mode = fiber.mode;
  63229. if ((mode & BlockingMode) === NoMode) {
  63230. return Sync;
  63231. }
  63232. var priorityLevel = getCurrentPriorityLevel();
  63233. if ((mode & ConcurrentMode) === NoMode) {
  63234. return priorityLevel === ImmediatePriority ? Sync : Batched;
  63235. }
  63236. if ((executionContext & RenderContext) !== NoContext) {
  63237. // Use whatever time we're already rendering
  63238. // TODO: Should there be a way to opt out, like with `runWithPriority`?
  63239. return renderExpirationTime;
  63240. }
  63241. var expirationTime;
  63242. if (suspenseConfig !== null) {
  63243. // Compute an expiration time based on the Suspense timeout.
  63244. expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
  63245. } else {
  63246. // Compute an expiration time based on the Scheduler priority.
  63247. switch (priorityLevel) {
  63248. case ImmediatePriority:
  63249. expirationTime = Sync;
  63250. break;
  63251. case UserBlockingPriority$2:
  63252. // TODO: Rename this to computeUserBlockingExpiration
  63253. expirationTime = computeInteractiveExpiration(currentTime);
  63254. break;
  63255. case NormalPriority:
  63256. case LowPriority:
  63257. // TODO: Handle LowPriority
  63258. // TODO: Rename this to... something better.
  63259. expirationTime = computeAsyncExpiration(currentTime);
  63260. break;
  63261. case IdlePriority:
  63262. expirationTime = Idle;
  63263. break;
  63264. default:
  63265. {
  63266. {
  63267. throw Error("Expected a valid priority level");
  63268. }
  63269. }
  63270. }
  63271. } // If we're in the middle of rendering a tree, do not update at the same
  63272. // expiration time that is already rendering.
  63273. // TODO: We shouldn't have to do this if the update is on a different root.
  63274. // Refactor computeExpirationForFiber + scheduleUpdate so we have access to
  63275. // the root when we check for this condition.
  63276. if (workInProgressRoot !== null && expirationTime === renderExpirationTime) {
  63277. // This is a trick to move this update into a separate batch
  63278. expirationTime -= 1;
  63279. }
  63280. return expirationTime;
  63281. }
  63282. function scheduleUpdateOnFiber(fiber, expirationTime) {
  63283. checkForNestedUpdates();
  63284. warnAboutInvalidUpdatesOnClassComponentsInDEV(fiber);
  63285. var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
  63286. if (root === null) {
  63287. warnAboutUpdateOnUnmountedFiberInDEV(fiber);
  63288. return;
  63289. }
  63290. checkForInterruption(fiber, expirationTime);
  63291. recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the
  63292. // priority as an argument to that function and this one.
  63293. var priorityLevel = getCurrentPriorityLevel();
  63294. if (expirationTime === Sync) {
  63295. if ( // Check if we're inside unbatchedUpdates
  63296. (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering
  63297. (executionContext & (RenderContext | CommitContext)) === NoContext) {
  63298. // Register pending interactions on the root to avoid losing traced interaction data.
  63299. schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed
  63300. // root inside of batchedUpdates should be synchronous, but layout updates
  63301. // should be deferred until the end of the batch.
  63302. performSyncWorkOnRoot(root);
  63303. } else {
  63304. ensureRootIsScheduled(root);
  63305. schedulePendingInteractions(root, expirationTime);
  63306. if (executionContext === NoContext) {
  63307. // Flush the synchronous work now, unless we're already working or inside
  63308. // a batch. This is intentionally inside scheduleUpdateOnFiber instead of
  63309. // scheduleCallbackForFiber to preserve the ability to schedule a callback
  63310. // without immediately flushing it. We only do this for user-initiated
  63311. // updates, to preserve historical behavior of legacy mode.
  63312. flushSyncCallbackQueue();
  63313. }
  63314. }
  63315. } else {
  63316. ensureRootIsScheduled(root);
  63317. schedulePendingInteractions(root, expirationTime);
  63318. }
  63319. if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered
  63320. // discrete, even inside a discrete event.
  63321. priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority)) {
  63322. // This is the result of a discrete event. Track the lowest priority
  63323. // discrete update per root so we can flush them early, if needed.
  63324. if (rootsWithPendingDiscreteUpdates === null) {
  63325. rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);
  63326. } else {
  63327. var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);
  63328. if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {
  63329. rootsWithPendingDiscreteUpdates.set(root, expirationTime);
  63330. }
  63331. }
  63332. }
  63333. }
  63334. var scheduleWork = scheduleUpdateOnFiber; // This is split into a separate function so we can mark a fiber with pending
  63335. // work without treating it as a typical update that originates from an event;
  63336. // e.g. retrying a Suspense boundary isn't an update, but it does schedule work
  63337. // on a fiber.
  63338. function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
  63339. // Update the source fiber's expiration time
  63340. if (fiber.expirationTime < expirationTime) {
  63341. fiber.expirationTime = expirationTime;
  63342. }
  63343. var alternate = fiber.alternate;
  63344. if (alternate !== null && alternate.expirationTime < expirationTime) {
  63345. alternate.expirationTime = expirationTime;
  63346. } // Walk the parent path to the root and update the child expiration time.
  63347. var node = fiber.return;
  63348. var root = null;
  63349. if (node === null && fiber.tag === HostRoot) {
  63350. root = fiber.stateNode;
  63351. } else {
  63352. while (node !== null) {
  63353. alternate = node.alternate;
  63354. if (node.childExpirationTime < expirationTime) {
  63355. node.childExpirationTime = expirationTime;
  63356. if (alternate !== null && alternate.childExpirationTime < expirationTime) {
  63357. alternate.childExpirationTime = expirationTime;
  63358. }
  63359. } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
  63360. alternate.childExpirationTime = expirationTime;
  63361. }
  63362. if (node.return === null && node.tag === HostRoot) {
  63363. root = node.stateNode;
  63364. break;
  63365. }
  63366. node = node.return;
  63367. }
  63368. }
  63369. if (root !== null) {
  63370. if (workInProgressRoot === root) {
  63371. // Received an update to a tree that's in the middle of rendering. Mark
  63372. // that's unprocessed work on this root.
  63373. markUnprocessedUpdateTime(expirationTime);
  63374. if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
  63375. // The root already suspended with a delay, which means this render
  63376. // definitely won't finish. Since we have a new update, let's mark it as
  63377. // suspended now, right before marking the incoming update. This has the
  63378. // effect of interrupting the current render and switching to the update.
  63379. // TODO: This happens to work when receiving an update during the render
  63380. // phase, because of the trick inside computeExpirationForFiber to
  63381. // subtract 1 from `renderExpirationTime` to move it into a
  63382. // separate bucket. But we should probably model it with an exception,
  63383. // using the same mechanism we use to force hydration of a subtree.
  63384. // TODO: This does not account for low pri updates that were already
  63385. // scheduled before the root started rendering. Need to track the next
  63386. // pending expiration time (perhaps by backtracking the return path) and
  63387. // then trigger a restart in the `renderDidSuspendDelayIfPossible` path.
  63388. markRootSuspendedAtTime(root, renderExpirationTime);
  63389. }
  63390. } // Mark that the root has a pending update.
  63391. markRootUpdatedAtTime(root, expirationTime);
  63392. }
  63393. return root;
  63394. }
  63395. function getNextRootExpirationTimeToWorkOn(root) {
  63396. // Determines the next expiration time that the root should render, taking
  63397. // into account levels that may be suspended, or levels that may have
  63398. // received a ping.
  63399. var lastExpiredTime = root.lastExpiredTime;
  63400. if (lastExpiredTime !== NoWork) {
  63401. return lastExpiredTime;
  63402. } // "Pending" refers to any update that hasn't committed yet, including if it
  63403. // suspended. The "suspended" range is therefore a subset.
  63404. var firstPendingTime = root.firstPendingTime;
  63405. if (!isRootSuspendedAtTime(root, firstPendingTime)) {
  63406. // The highest priority pending time is not suspended. Let's work on that.
  63407. return firstPendingTime;
  63408. } // If the first pending time is suspended, check if there's a lower priority
  63409. // pending level that we know about. Or check if we received a ping. Work
  63410. // on whichever is higher priority.
  63411. var lastPingedTime = root.lastPingedTime;
  63412. var nextKnownPendingLevel = root.nextKnownPendingLevel;
  63413. return lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;
  63414. } // Use this function to schedule a task for a root. There's only one task per
  63415. // root; if a task was already scheduled, we'll check to make sure the
  63416. // expiration time of the existing task is the same as the expiration time of
  63417. // the next level that the root has work on. This function is called on every
  63418. // update, and right before exiting a task.
  63419. function ensureRootIsScheduled(root) {
  63420. var lastExpiredTime = root.lastExpiredTime;
  63421. if (lastExpiredTime !== NoWork) {
  63422. // Special case: Expired work should flush synchronously.
  63423. root.callbackExpirationTime = Sync;
  63424. root.callbackPriority = ImmediatePriority;
  63425. root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
  63426. return;
  63427. }
  63428. var expirationTime = getNextRootExpirationTimeToWorkOn(root);
  63429. var existingCallbackNode = root.callbackNode;
  63430. if (expirationTime === NoWork) {
  63431. // There's nothing to work on.
  63432. if (existingCallbackNode !== null) {
  63433. root.callbackNode = null;
  63434. root.callbackExpirationTime = NoWork;
  63435. root.callbackPriority = NoPriority;
  63436. }
  63437. return;
  63438. } // TODO: If this is an update, we already read the current time. Pass the
  63439. // time as an argument.
  63440. var currentTime = requestCurrentTimeForUpdate();
  63441. var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and
  63442. // expiration time. Otherwise, we'll cancel it and schedule a new one.
  63443. if (existingCallbackNode !== null) {
  63444. var existingCallbackPriority = root.callbackPriority;
  63445. var existingCallbackExpirationTime = root.callbackExpirationTime;
  63446. if ( // Callback must have the exact same expiration time.
  63447. existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.
  63448. existingCallbackPriority >= priorityLevel) {
  63449. // Existing callback is sufficient.
  63450. return;
  63451. } // Need to schedule a new task.
  63452. // TODO: Instead of scheduling a new task, we should be able to change the
  63453. // priority of the existing one.
  63454. cancelCallback(existingCallbackNode);
  63455. }
  63456. root.callbackExpirationTime = expirationTime;
  63457. root.callbackPriority = priorityLevel;
  63458. var callbackNode;
  63459. if (expirationTime === Sync) {
  63460. // Sync React callbacks are scheduled on a special internal queue
  63461. callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
  63462. } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {
  63463. callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));
  63464. } else {
  63465. callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects
  63466. // ordering because tasks are processed in timeout order.
  63467. {
  63468. timeout: expirationTimeToMs(expirationTime) - now()
  63469. });
  63470. }
  63471. root.callbackNode = callbackNode;
  63472. } // This is the entry point for every concurrent task, i.e. anything that
  63473. // goes through Scheduler.
  63474. function performConcurrentWorkOnRoot(root, didTimeout) {
  63475. // Since we know we're in a React event, we can clear the current
  63476. // event time. The next update will compute a new event time.
  63477. currentEventTime = NoWork;
  63478. if (didTimeout) {
  63479. // The render task took too long to complete. Mark the current time as
  63480. // expired to synchronously render all expired work in a single batch.
  63481. var currentTime = requestCurrentTimeForUpdate();
  63482. markRootExpiredAtTime(root, currentTime); // This will schedule a synchronous callback.
  63483. ensureRootIsScheduled(root);
  63484. return null;
  63485. } // Determine the next expiration time to work on, using the fields stored
  63486. // on the root.
  63487. var expirationTime = getNextRootExpirationTimeToWorkOn(root);
  63488. if (expirationTime !== NoWork) {
  63489. var originalCallbackNode = root.callbackNode;
  63490. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  63491. {
  63492. throw Error("Should not already be working.");
  63493. }
  63494. }
  63495. flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack
  63496. // and prepare a fresh one. Otherwise we'll continue where we left off.
  63497. if (root !== workInProgressRoot || expirationTime !== renderExpirationTime) {
  63498. prepareFreshStack(root, expirationTime);
  63499. startWorkOnPendingInteractions(root, expirationTime);
  63500. } // If we have a work-in-progress fiber, it means there's still work to do
  63501. // in this root.
  63502. if (workInProgress !== null) {
  63503. var prevExecutionContext = executionContext;
  63504. executionContext |= RenderContext;
  63505. var prevDispatcher = pushDispatcher(root);
  63506. var prevInteractions = pushInteractions(root);
  63507. startWorkLoopTimer(workInProgress);
  63508. do {
  63509. try {
  63510. workLoopConcurrent();
  63511. break;
  63512. } catch (thrownValue) {
  63513. handleError(root, thrownValue);
  63514. }
  63515. } while (true);
  63516. resetContextDependencies();
  63517. executionContext = prevExecutionContext;
  63518. popDispatcher(prevDispatcher);
  63519. if (enableSchedulerTracing) {
  63520. popInteractions(prevInteractions);
  63521. }
  63522. if (workInProgressRootExitStatus === RootFatalErrored) {
  63523. var fatalError = workInProgressRootFatalError;
  63524. stopInterruptedWorkLoopTimer();
  63525. prepareFreshStack(root, expirationTime);
  63526. markRootSuspendedAtTime(root, expirationTime);
  63527. ensureRootIsScheduled(root);
  63528. throw fatalError;
  63529. }
  63530. if (workInProgress !== null) {
  63531. // There's still work left over. Exit without committing.
  63532. stopInterruptedWorkLoopTimer();
  63533. } else {
  63534. // We now have a consistent tree. The next step is either to commit it,
  63535. // or, if something suspended, wait to commit it after a timeout.
  63536. stopFinishedWorkLoopTimer();
  63537. var finishedWork = root.finishedWork = root.current.alternate;
  63538. root.finishedExpirationTime = expirationTime;
  63539. finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime);
  63540. }
  63541. ensureRootIsScheduled(root);
  63542. if (root.callbackNode === originalCallbackNode) {
  63543. // The task node scheduled for this root is the same one that's
  63544. // currently executed. Need to return a continuation.
  63545. return performConcurrentWorkOnRoot.bind(null, root);
  63546. }
  63547. }
  63548. }
  63549. return null;
  63550. }
  63551. function finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) {
  63552. // Set this to null to indicate there's no in-progress render.
  63553. workInProgressRoot = null;
  63554. switch (exitStatus) {
  63555. case RootIncomplete:
  63556. case RootFatalErrored:
  63557. {
  63558. {
  63559. {
  63560. throw Error("Root did not complete. This is a bug in React.");
  63561. }
  63562. }
  63563. }
  63564. // Flow knows about invariant, so it complains if I add a break
  63565. // statement, but eslint doesn't know about invariant, so it complains
  63566. // if I do. eslint-disable-next-line no-fallthrough
  63567. case RootErrored:
  63568. {
  63569. // If this was an async render, the error may have happened due to
  63570. // a mutation in a concurrent event. Try rendering one more time,
  63571. // synchronously, to see if the error goes away. If there are
  63572. // lower priority updates, let's include those, too, in case they
  63573. // fix the inconsistency. Render at Idle to include all updates.
  63574. // If it was Idle or Never or some not-yet-invented time, render
  63575. // at that time.
  63576. markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime); // We assume that this second render pass will be synchronous
  63577. // and therefore not hit this path again.
  63578. break;
  63579. }
  63580. case RootSuspended:
  63581. {
  63582. markRootSuspendedAtTime(root, expirationTime);
  63583. var lastSuspendedTime = root.lastSuspendedTime;
  63584. if (expirationTime === lastSuspendedTime) {
  63585. root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
  63586. }
  63587. flushSuspensePriorityWarningInDEV(); // We have an acceptable loading state. We need to figure out if we
  63588. // should immediately commit it or wait a bit.
  63589. // If we have processed new updates during this render, we may now
  63590. // have a new loading state ready. We want to ensure that we commit
  63591. // that as soon as possible.
  63592. var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;
  63593. if (hasNotProcessedNewUpdates && // do not delay if we're inside an act() scope
  63594. !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current)) {
  63595. // If we have not processed any new updates during this pass, then
  63596. // this is either a retry of an existing fallback state or a
  63597. // hidden tree. Hidden trees shouldn't be batched with other work
  63598. // and after that's fixed it can only be a retry. We're going to
  63599. // throttle committing retries so that we don't show too many
  63600. // loading states too quickly.
  63601. var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.
  63602. if (msUntilTimeout > 10) {
  63603. if (workInProgressRootHasPendingPing) {
  63604. var lastPingedTime = root.lastPingedTime;
  63605. if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {
  63606. // This render was pinged but we didn't get to restart
  63607. // earlier so try restarting now instead.
  63608. root.lastPingedTime = expirationTime;
  63609. prepareFreshStack(root, expirationTime);
  63610. break;
  63611. }
  63612. }
  63613. var nextTime = getNextRootExpirationTimeToWorkOn(root);
  63614. if (nextTime !== NoWork && nextTime !== expirationTime) {
  63615. // There's additional work on this root.
  63616. break;
  63617. }
  63618. if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {
  63619. // We should prefer to render the fallback of at the last
  63620. // suspended level. Ping the last suspended level to try
  63621. // rendering it again.
  63622. root.lastPingedTime = lastSuspendedTime;
  63623. break;
  63624. } // The render is suspended, it hasn't timed out, and there's no
  63625. // lower priority work to do. Instead of committing the fallback
  63626. // immediately, wait for more data to arrive.
  63627. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);
  63628. break;
  63629. }
  63630. } // The work expired. Commit immediately.
  63631. commitRoot(root);
  63632. break;
  63633. }
  63634. case RootSuspendedWithDelay:
  63635. {
  63636. markRootSuspendedAtTime(root, expirationTime);
  63637. var _lastSuspendedTime = root.lastSuspendedTime;
  63638. if (expirationTime === _lastSuspendedTime) {
  63639. root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
  63640. }
  63641. flushSuspensePriorityWarningInDEV();
  63642. if ( // do not delay if we're inside an act() scope
  63643. !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current)) {
  63644. // We're suspended in a state that should be avoided. We'll try to
  63645. // avoid committing it for as long as the timeouts let us.
  63646. if (workInProgressRootHasPendingPing) {
  63647. var _lastPingedTime = root.lastPingedTime;
  63648. if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {
  63649. // This render was pinged but we didn't get to restart earlier
  63650. // so try restarting now instead.
  63651. root.lastPingedTime = expirationTime;
  63652. prepareFreshStack(root, expirationTime);
  63653. break;
  63654. }
  63655. }
  63656. var _nextTime = getNextRootExpirationTimeToWorkOn(root);
  63657. if (_nextTime !== NoWork && _nextTime !== expirationTime) {
  63658. // There's additional work on this root.
  63659. break;
  63660. }
  63661. if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {
  63662. // We should prefer to render the fallback of at the last
  63663. // suspended level. Ping the last suspended level to try
  63664. // rendering it again.
  63665. root.lastPingedTime = _lastSuspendedTime;
  63666. break;
  63667. }
  63668. var _msUntilTimeout;
  63669. if (workInProgressRootLatestSuspenseTimeout !== Sync) {
  63670. // We have processed a suspense config whose expiration time we
  63671. // can use as the timeout.
  63672. _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();
  63673. } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {
  63674. // This should never normally happen because only new updates
  63675. // cause delayed states, so we should have processed something.
  63676. // However, this could also happen in an offscreen tree.
  63677. _msUntilTimeout = 0;
  63678. } else {
  63679. // If we don't have a suspense config, we're going to use a
  63680. // heuristic to determine how long we can suspend.
  63681. var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);
  63682. var currentTimeMs = now();
  63683. var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;
  63684. var timeElapsed = currentTimeMs - eventTimeMs;
  63685. if (timeElapsed < 0) {
  63686. // We get this wrong some time since we estimate the time.
  63687. timeElapsed = 0;
  63688. }
  63689. _msUntilTimeout = jnd(timeElapsed) - timeElapsed; // Clamp the timeout to the expiration time. TODO: Once the
  63690. // event time is exact instead of inferred from expiration time
  63691. // we don't need this.
  63692. if (timeUntilExpirationMs < _msUntilTimeout) {
  63693. _msUntilTimeout = timeUntilExpirationMs;
  63694. }
  63695. } // Don't bother with a very short suspense time.
  63696. if (_msUntilTimeout > 10) {
  63697. // The render is suspended, it hasn't timed out, and there's no
  63698. // lower priority work to do. Instead of committing the fallback
  63699. // immediately, wait for more data to arrive.
  63700. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);
  63701. break;
  63702. }
  63703. } // The work expired. Commit immediately.
  63704. commitRoot(root);
  63705. break;
  63706. }
  63707. case RootCompleted:
  63708. {
  63709. // The work completed. Ready to commit.
  63710. if ( // do not delay if we're inside an act() scope
  63711. !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {
  63712. // If we have exceeded the minimum loading delay, which probably
  63713. // means we have shown a spinner already, we might have to suspend
  63714. // a bit longer to ensure that the spinner is shown for
  63715. // enough time.
  63716. var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);
  63717. if (_msUntilTimeout2 > 10) {
  63718. markRootSuspendedAtTime(root, expirationTime);
  63719. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);
  63720. break;
  63721. }
  63722. }
  63723. commitRoot(root);
  63724. break;
  63725. }
  63726. default:
  63727. {
  63728. {
  63729. {
  63730. throw Error("Unknown root exit status.");
  63731. }
  63732. }
  63733. }
  63734. }
  63735. } // This is the entry point for synchronous tasks that don't go
  63736. // through Scheduler
  63737. function performSyncWorkOnRoot(root) {
  63738. // Check if there's expired work on this root. Otherwise, render at Sync.
  63739. var lastExpiredTime = root.lastExpiredTime;
  63740. var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;
  63741. if (root.finishedExpirationTime === expirationTime) {
  63742. // There's already a pending commit at this expiration time.
  63743. // TODO: This is poorly factored. This case only exists for the
  63744. // batch.commit() API.
  63745. commitRoot(root);
  63746. } else {
  63747. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  63748. {
  63749. throw Error("Should not already be working.");
  63750. }
  63751. }
  63752. flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack
  63753. // and prepare a fresh one. Otherwise we'll continue where we left off.
  63754. if (root !== workInProgressRoot || expirationTime !== renderExpirationTime) {
  63755. prepareFreshStack(root, expirationTime);
  63756. startWorkOnPendingInteractions(root, expirationTime);
  63757. } // If we have a work-in-progress fiber, it means there's still work to do
  63758. // in this root.
  63759. if (workInProgress !== null) {
  63760. var prevExecutionContext = executionContext;
  63761. executionContext |= RenderContext;
  63762. var prevDispatcher = pushDispatcher(root);
  63763. var prevInteractions = pushInteractions(root);
  63764. startWorkLoopTimer(workInProgress);
  63765. do {
  63766. try {
  63767. workLoopSync();
  63768. break;
  63769. } catch (thrownValue) {
  63770. handleError(root, thrownValue);
  63771. }
  63772. } while (true);
  63773. resetContextDependencies();
  63774. executionContext = prevExecutionContext;
  63775. popDispatcher(prevDispatcher);
  63776. if (enableSchedulerTracing) {
  63777. popInteractions(prevInteractions);
  63778. }
  63779. if (workInProgressRootExitStatus === RootFatalErrored) {
  63780. var fatalError = workInProgressRootFatalError;
  63781. stopInterruptedWorkLoopTimer();
  63782. prepareFreshStack(root, expirationTime);
  63783. markRootSuspendedAtTime(root, expirationTime);
  63784. ensureRootIsScheduled(root);
  63785. throw fatalError;
  63786. }
  63787. if (workInProgress !== null) {
  63788. // This is a sync render, so we should have finished the whole tree.
  63789. {
  63790. {
  63791. throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
  63792. }
  63793. }
  63794. } else {
  63795. // We now have a consistent tree. Because this is a sync render, we
  63796. // will commit it even if something suspended.
  63797. stopFinishedWorkLoopTimer();
  63798. root.finishedWork = root.current.alternate;
  63799. root.finishedExpirationTime = expirationTime;
  63800. finishSyncRender(root, workInProgressRootExitStatus, expirationTime);
  63801. } // Before exiting, make sure there's a callback scheduled for the next
  63802. // pending level.
  63803. ensureRootIsScheduled(root);
  63804. }
  63805. }
  63806. return null;
  63807. }
  63808. function finishSyncRender(root, exitStatus, expirationTime) {
  63809. // Set this to null to indicate there's no in-progress render.
  63810. workInProgressRoot = null;
  63811. {
  63812. if (exitStatus === RootSuspended || exitStatus === RootSuspendedWithDelay) {
  63813. flushSuspensePriorityWarningInDEV();
  63814. }
  63815. }
  63816. commitRoot(root);
  63817. }
  63818. function flushRoot(root, expirationTime) {
  63819. markRootExpiredAtTime(root, expirationTime);
  63820. ensureRootIsScheduled(root);
  63821. if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
  63822. flushSyncCallbackQueue();
  63823. }
  63824. }
  63825. function flushDiscreteUpdates() {
  63826. // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.
  63827. // However, `act` uses `batchedUpdates`, so there's no way to distinguish
  63828. // those two cases. Need to fix this before exposing flushDiscreteUpdates
  63829. // as a public API.
  63830. if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
  63831. if ( true && (executionContext & RenderContext) !== NoContext) {
  63832. warning$1(false, 'unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
  63833. } // We're already rendering, so we can't synchronously flush pending work.
  63834. // This is probably a nested event dispatch triggered by a lifecycle/effect,
  63835. // like `el.focus()`. Exit.
  63836. return;
  63837. }
  63838. flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that
  63839. // they fire before the next serial event.
  63840. flushPassiveEffects();
  63841. }
  63842. function syncUpdates(fn, a, b, c) {
  63843. return runWithPriority$2(ImmediatePriority, fn.bind(null, a, b, c));
  63844. }
  63845. function flushPendingDiscreteUpdates() {
  63846. if (rootsWithPendingDiscreteUpdates !== null) {
  63847. // For each root with pending discrete updates, schedule a callback to
  63848. // immediately flush them.
  63849. var roots = rootsWithPendingDiscreteUpdates;
  63850. rootsWithPendingDiscreteUpdates = null;
  63851. roots.forEach(function (expirationTime, root) {
  63852. markRootExpiredAtTime(root, expirationTime);
  63853. ensureRootIsScheduled(root);
  63854. }); // Now flush the immediate queue.
  63855. flushSyncCallbackQueue();
  63856. }
  63857. }
  63858. function batchedUpdates$1(fn, a) {
  63859. var prevExecutionContext = executionContext;
  63860. executionContext |= BatchedContext;
  63861. try {
  63862. return fn(a);
  63863. } finally {
  63864. executionContext = prevExecutionContext;
  63865. if (executionContext === NoContext) {
  63866. // Flush the immediate callbacks that were scheduled during this batch
  63867. flushSyncCallbackQueue();
  63868. }
  63869. }
  63870. }
  63871. function batchedEventUpdates$1(fn, a) {
  63872. var prevExecutionContext = executionContext;
  63873. executionContext |= EventContext;
  63874. try {
  63875. return fn(a);
  63876. } finally {
  63877. executionContext = prevExecutionContext;
  63878. if (executionContext === NoContext) {
  63879. // Flush the immediate callbacks that were scheduled during this batch
  63880. flushSyncCallbackQueue();
  63881. }
  63882. }
  63883. }
  63884. function discreteUpdates$1(fn, a, b, c) {
  63885. var prevExecutionContext = executionContext;
  63886. executionContext |= DiscreteEventContext;
  63887. try {
  63888. // Should this
  63889. return runWithPriority$2(UserBlockingPriority$2, fn.bind(null, a, b, c));
  63890. } finally {
  63891. executionContext = prevExecutionContext;
  63892. if (executionContext === NoContext) {
  63893. // Flush the immediate callbacks that were scheduled during this batch
  63894. flushSyncCallbackQueue();
  63895. }
  63896. }
  63897. }
  63898. function unbatchedUpdates(fn, a) {
  63899. var prevExecutionContext = executionContext;
  63900. executionContext &= ~BatchedContext;
  63901. executionContext |= LegacyUnbatchedContext;
  63902. try {
  63903. return fn(a);
  63904. } finally {
  63905. executionContext = prevExecutionContext;
  63906. if (executionContext === NoContext) {
  63907. // Flush the immediate callbacks that were scheduled during this batch
  63908. flushSyncCallbackQueue();
  63909. }
  63910. }
  63911. }
  63912. function flushSync(fn, a) {
  63913. if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
  63914. {
  63915. {
  63916. throw Error("flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.");
  63917. }
  63918. }
  63919. }
  63920. var prevExecutionContext = executionContext;
  63921. executionContext |= BatchedContext;
  63922. try {
  63923. return runWithPriority$2(ImmediatePriority, fn.bind(null, a));
  63924. } finally {
  63925. executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.
  63926. // Note that this will happen even if batchedUpdates is higher up
  63927. // the stack.
  63928. flushSyncCallbackQueue();
  63929. }
  63930. }
  63931. function flushControlled(fn) {
  63932. var prevExecutionContext = executionContext;
  63933. executionContext |= BatchedContext;
  63934. try {
  63935. runWithPriority$2(ImmediatePriority, fn);
  63936. } finally {
  63937. executionContext = prevExecutionContext;
  63938. if (executionContext === NoContext) {
  63939. // Flush the immediate callbacks that were scheduled during this batch
  63940. flushSyncCallbackQueue();
  63941. }
  63942. }
  63943. }
  63944. function prepareFreshStack(root, expirationTime) {
  63945. root.finishedWork = null;
  63946. root.finishedExpirationTime = NoWork;
  63947. var timeoutHandle = root.timeoutHandle;
  63948. if (timeoutHandle !== noTimeout) {
  63949. // The root previous suspended and scheduled a timeout to commit a fallback
  63950. // state. Now that we have additional work, cancel the timeout.
  63951. root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above
  63952. cancelTimeout(timeoutHandle);
  63953. }
  63954. if (workInProgress !== null) {
  63955. var interruptedWork = workInProgress.return;
  63956. while (interruptedWork !== null) {
  63957. unwindInterruptedWork(interruptedWork);
  63958. interruptedWork = interruptedWork.return;
  63959. }
  63960. }
  63961. workInProgressRoot = root;
  63962. workInProgress = createWorkInProgress(root.current, null, expirationTime);
  63963. renderExpirationTime = expirationTime;
  63964. workInProgressRootExitStatus = RootIncomplete;
  63965. workInProgressRootFatalError = null;
  63966. workInProgressRootLatestProcessedExpirationTime = Sync;
  63967. workInProgressRootLatestSuspenseTimeout = Sync;
  63968. workInProgressRootCanSuspendUsingConfig = null;
  63969. workInProgressRootNextUnprocessedUpdateTime = NoWork;
  63970. workInProgressRootHasPendingPing = false;
  63971. if (enableSchedulerTracing) {
  63972. spawnedWorkDuringRender = null;
  63973. }
  63974. {
  63975. ReactStrictModeWarnings.discardPendingWarnings();
  63976. componentsThatTriggeredHighPriSuspend = null;
  63977. }
  63978. }
  63979. function handleError(root, thrownValue) {
  63980. do {
  63981. try {
  63982. // Reset module-level state that was set during the render phase.
  63983. resetContextDependencies();
  63984. resetHooks();
  63985. resetCurrentFiber();
  63986. if (workInProgress === null || workInProgress.return === null) {
  63987. // Expected to be working on a non-root fiber. This is a fatal error
  63988. // because there's no ancestor that can handle it; the root is
  63989. // supposed to capture all errors that weren't caught by an error
  63990. // boundary.
  63991. workInProgressRootExitStatus = RootFatalErrored;
  63992. workInProgressRootFatalError = thrownValue;
  63993. return null;
  63994. }
  63995. if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
  63996. // Record the time spent rendering before an error was thrown. This
  63997. // avoids inaccurate Profiler durations in the case of a
  63998. // suspended render.
  63999. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);
  64000. }
  64001. throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime);
  64002. workInProgress = completeUnitOfWork(workInProgress);
  64003. } catch (yetAnotherThrownValue) {
  64004. // Something in the return path also threw.
  64005. thrownValue = yetAnotherThrownValue;
  64006. continue;
  64007. } // Return to the normal work loop.
  64008. return;
  64009. } while (true);
  64010. }
  64011. function pushDispatcher(root) {
  64012. var prevDispatcher = ReactCurrentDispatcher.current;
  64013. ReactCurrentDispatcher.current = ContextOnlyDispatcher;
  64014. if (prevDispatcher === null) {
  64015. // The React isomorphic package does not include a default dispatcher.
  64016. // Instead the first renderer will lazily attach one, in order to give
  64017. // nicer error messages.
  64018. return ContextOnlyDispatcher;
  64019. } else {
  64020. return prevDispatcher;
  64021. }
  64022. }
  64023. function popDispatcher(prevDispatcher) {
  64024. ReactCurrentDispatcher.current = prevDispatcher;
  64025. }
  64026. function pushInteractions(root) {
  64027. if (enableSchedulerTracing) {
  64028. var prevInteractions = tracing.__interactionsRef.current;
  64029. tracing.__interactionsRef.current = root.memoizedInteractions;
  64030. return prevInteractions;
  64031. }
  64032. return null;
  64033. }
  64034. function popInteractions(prevInteractions) {
  64035. if (enableSchedulerTracing) {
  64036. tracing.__interactionsRef.current = prevInteractions;
  64037. }
  64038. }
  64039. function markCommitTimeOfFallback() {
  64040. globalMostRecentFallbackTime = now();
  64041. }
  64042. function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
  64043. if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {
  64044. workInProgressRootLatestProcessedExpirationTime = expirationTime;
  64045. }
  64046. if (suspenseConfig !== null) {
  64047. if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {
  64048. workInProgressRootLatestSuspenseTimeout = expirationTime; // Most of the time we only have one config and getting wrong is not bad.
  64049. workInProgressRootCanSuspendUsingConfig = suspenseConfig;
  64050. }
  64051. }
  64052. }
  64053. function markUnprocessedUpdateTime(expirationTime) {
  64054. if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {
  64055. workInProgressRootNextUnprocessedUpdateTime = expirationTime;
  64056. }
  64057. }
  64058. function renderDidSuspend() {
  64059. if (workInProgressRootExitStatus === RootIncomplete) {
  64060. workInProgressRootExitStatus = RootSuspended;
  64061. }
  64062. }
  64063. function renderDidSuspendDelayIfPossible() {
  64064. if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
  64065. workInProgressRootExitStatus = RootSuspendedWithDelay;
  64066. } // Check if there's a lower priority update somewhere else in the tree.
  64067. if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {
  64068. // Mark the current render as suspended, and then mark that there's a
  64069. // pending update.
  64070. // TODO: This should immediately interrupt the current render, instead
  64071. // of waiting until the next time we yield.
  64072. markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime);
  64073. markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);
  64074. }
  64075. }
  64076. function renderDidError() {
  64077. if (workInProgressRootExitStatus !== RootCompleted) {
  64078. workInProgressRootExitStatus = RootErrored;
  64079. }
  64080. } // Called during render to determine if anything has suspended.
  64081. // Returns false if we're not sure.
  64082. function renderHasNotSuspendedYet() {
  64083. // If something errored or completed, we can't really be sure,
  64084. // so those are false.
  64085. return workInProgressRootExitStatus === RootIncomplete;
  64086. }
  64087. function inferTimeFromExpirationTime(expirationTime) {
  64088. // We don't know exactly when the update was scheduled, but we can infer an
  64089. // approximate start time from the expiration time.
  64090. var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
  64091. return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
  64092. }
  64093. function inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {
  64094. // We don't know exactly when the update was scheduled, but we can infer an
  64095. // approximate start time from the expiration time by subtracting the timeout
  64096. // that was added to the event time.
  64097. var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
  64098. return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
  64099. } // The work loop is an extremely hot path. Tell Closure not to inline it.
  64100. /** @noinline */
  64101. function workLoopSync() {
  64102. // Already timed out, so perform work without checking if we need to yield.
  64103. while (workInProgress !== null) {
  64104. workInProgress = performUnitOfWork(workInProgress);
  64105. }
  64106. }
  64107. /** @noinline */
  64108. function workLoopConcurrent() {
  64109. // Perform work until Scheduler asks us to yield
  64110. while (workInProgress !== null && !shouldYield()) {
  64111. workInProgress = performUnitOfWork(workInProgress);
  64112. }
  64113. }
  64114. function performUnitOfWork(unitOfWork) {
  64115. // The current, flushed, state of this fiber is the alternate. Ideally
  64116. // nothing should rely on this, but relying on it here means that we don't
  64117. // need an additional field on the work in progress.
  64118. var current$$1 = unitOfWork.alternate;
  64119. startWorkTimer(unitOfWork);
  64120. setCurrentFiber(unitOfWork);
  64121. var next;
  64122. if (enableProfilerTimer && (unitOfWork.mode & ProfileMode) !== NoMode) {
  64123. startProfilerTimer(unitOfWork);
  64124. next = beginWork$$1(current$$1, unitOfWork, renderExpirationTime);
  64125. stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
  64126. } else {
  64127. next = beginWork$$1(current$$1, unitOfWork, renderExpirationTime);
  64128. }
  64129. resetCurrentFiber();
  64130. unitOfWork.memoizedProps = unitOfWork.pendingProps;
  64131. if (next === null) {
  64132. // If this doesn't spawn new work, complete the current work.
  64133. next = completeUnitOfWork(unitOfWork);
  64134. }
  64135. ReactCurrentOwner$2.current = null;
  64136. return next;
  64137. }
  64138. function completeUnitOfWork(unitOfWork) {
  64139. // Attempt to complete the current unit of work, then move to the next
  64140. // sibling. If there are no more siblings, return to the parent fiber.
  64141. workInProgress = unitOfWork;
  64142. do {
  64143. // The current, flushed, state of this fiber is the alternate. Ideally
  64144. // nothing should rely on this, but relying on it here means that we don't
  64145. // need an additional field on the work in progress.
  64146. var current$$1 = workInProgress.alternate;
  64147. var returnFiber = workInProgress.return; // Check if the work completed or if something threw.
  64148. if ((workInProgress.effectTag & Incomplete) === NoEffect) {
  64149. setCurrentFiber(workInProgress);
  64150. var next = void 0;
  64151. if (!enableProfilerTimer || (workInProgress.mode & ProfileMode) === NoMode) {
  64152. next = completeWork(current$$1, workInProgress, renderExpirationTime);
  64153. } else {
  64154. startProfilerTimer(workInProgress);
  64155. next = completeWork(current$$1, workInProgress, renderExpirationTime); // Update render duration assuming we didn't error.
  64156. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
  64157. }
  64158. stopWorkTimer(workInProgress);
  64159. resetCurrentFiber();
  64160. resetChildExpirationTime(workInProgress);
  64161. if (next !== null) {
  64162. // Completing this fiber spawned new work. Work on that next.
  64163. return next;
  64164. }
  64165. if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete
  64166. (returnFiber.effectTag & Incomplete) === NoEffect) {
  64167. // Append all the effects of the subtree and this fiber onto the effect
  64168. // list of the parent. The completion order of the children affects the
  64169. // side-effect order.
  64170. if (returnFiber.firstEffect === null) {
  64171. returnFiber.firstEffect = workInProgress.firstEffect;
  64172. }
  64173. if (workInProgress.lastEffect !== null) {
  64174. if (returnFiber.lastEffect !== null) {
  64175. returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
  64176. }
  64177. returnFiber.lastEffect = workInProgress.lastEffect;
  64178. } // If this fiber had side-effects, we append it AFTER the children's
  64179. // side-effects. We can perform certain side-effects earlier if needed,
  64180. // by doing multiple passes over the effect list. We don't want to
  64181. // schedule our own side-effect on our own list because if end up
  64182. // reusing children we'll schedule this effect onto itself since we're
  64183. // at the end.
  64184. var effectTag = workInProgress.effectTag; // Skip both NoWork and PerformedWork tags when creating the effect
  64185. // list. PerformedWork effect is read by React DevTools but shouldn't be
  64186. // committed.
  64187. if (effectTag > PerformedWork) {
  64188. if (returnFiber.lastEffect !== null) {
  64189. returnFiber.lastEffect.nextEffect = workInProgress;
  64190. } else {
  64191. returnFiber.firstEffect = workInProgress;
  64192. }
  64193. returnFiber.lastEffect = workInProgress;
  64194. }
  64195. }
  64196. } else {
  64197. // This fiber did not complete because something threw. Pop values off
  64198. // the stack without entering the complete phase. If this is a boundary,
  64199. // capture values if possible.
  64200. var _next = unwindWork(workInProgress, renderExpirationTime); // Because this fiber did not complete, don't reset its expiration time.
  64201. if (enableProfilerTimer && (workInProgress.mode & ProfileMode) !== NoMode) {
  64202. // Record the render duration for the fiber that errored.
  64203. stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); // Include the time spent working on failed children before continuing.
  64204. var actualDuration = workInProgress.actualDuration;
  64205. var child = workInProgress.child;
  64206. while (child !== null) {
  64207. actualDuration += child.actualDuration;
  64208. child = child.sibling;
  64209. }
  64210. workInProgress.actualDuration = actualDuration;
  64211. }
  64212. if (_next !== null) {
  64213. // If completing this work spawned new work, do that next. We'll come
  64214. // back here again.
  64215. // Since we're restarting, remove anything that is not a host effect
  64216. // from the effect tag.
  64217. // TODO: The name stopFailedWorkTimer is misleading because Suspense
  64218. // also captures and restarts.
  64219. stopFailedWorkTimer(workInProgress);
  64220. _next.effectTag &= HostEffectMask;
  64221. return _next;
  64222. }
  64223. stopWorkTimer(workInProgress);
  64224. if (returnFiber !== null) {
  64225. // Mark the parent fiber as incomplete and clear its effect list.
  64226. returnFiber.firstEffect = returnFiber.lastEffect = null;
  64227. returnFiber.effectTag |= Incomplete;
  64228. }
  64229. }
  64230. var siblingFiber = workInProgress.sibling;
  64231. if (siblingFiber !== null) {
  64232. // If there is more work to do in this returnFiber, do that next.
  64233. return siblingFiber;
  64234. } // Otherwise, return to the parent
  64235. workInProgress = returnFiber;
  64236. } while (workInProgress !== null); // We've reached the root.
  64237. if (workInProgressRootExitStatus === RootIncomplete) {
  64238. workInProgressRootExitStatus = RootCompleted;
  64239. }
  64240. return null;
  64241. }
  64242. function getRemainingExpirationTime(fiber) {
  64243. var updateExpirationTime = fiber.expirationTime;
  64244. var childExpirationTime = fiber.childExpirationTime;
  64245. return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;
  64246. }
  64247. function resetChildExpirationTime(completedWork) {
  64248. if (renderExpirationTime !== Never && completedWork.childExpirationTime === Never) {
  64249. // The children of this component are hidden. Don't bubble their
  64250. // expiration times.
  64251. return;
  64252. }
  64253. var newChildExpirationTime = NoWork; // Bubble up the earliest expiration time.
  64254. if (enableProfilerTimer && (completedWork.mode & ProfileMode) !== NoMode) {
  64255. // In profiling mode, resetChildExpirationTime is also used to reset
  64256. // profiler durations.
  64257. var actualDuration = completedWork.actualDuration;
  64258. var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will
  64259. // only be updated if work is done on the fiber (i.e. it doesn't bailout).
  64260. // When work is done, it should bubble to the parent's actualDuration. If
  64261. // the fiber has not been cloned though, (meaning no work was done), then
  64262. // this value will reflect the amount of time spent working on a previous
  64263. // render. In that case it should not bubble. We determine whether it was
  64264. // cloned by comparing the child pointer.
  64265. var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
  64266. var child = completedWork.child;
  64267. while (child !== null) {
  64268. var childUpdateExpirationTime = child.expirationTime;
  64269. var childChildExpirationTime = child.childExpirationTime;
  64270. if (childUpdateExpirationTime > newChildExpirationTime) {
  64271. newChildExpirationTime = childUpdateExpirationTime;
  64272. }
  64273. if (childChildExpirationTime > newChildExpirationTime) {
  64274. newChildExpirationTime = childChildExpirationTime;
  64275. }
  64276. if (shouldBubbleActualDurations) {
  64277. actualDuration += child.actualDuration;
  64278. }
  64279. treeBaseDuration += child.treeBaseDuration;
  64280. child = child.sibling;
  64281. }
  64282. completedWork.actualDuration = actualDuration;
  64283. completedWork.treeBaseDuration = treeBaseDuration;
  64284. } else {
  64285. var _child = completedWork.child;
  64286. while (_child !== null) {
  64287. var _childUpdateExpirationTime = _child.expirationTime;
  64288. var _childChildExpirationTime = _child.childExpirationTime;
  64289. if (_childUpdateExpirationTime > newChildExpirationTime) {
  64290. newChildExpirationTime = _childUpdateExpirationTime;
  64291. }
  64292. if (_childChildExpirationTime > newChildExpirationTime) {
  64293. newChildExpirationTime = _childChildExpirationTime;
  64294. }
  64295. _child = _child.sibling;
  64296. }
  64297. }
  64298. completedWork.childExpirationTime = newChildExpirationTime;
  64299. }
  64300. function commitRoot(root) {
  64301. var renderPriorityLevel = getCurrentPriorityLevel();
  64302. runWithPriority$2(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));
  64303. return null;
  64304. }
  64305. function commitRootImpl(root, renderPriorityLevel) {
  64306. do {
  64307. // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which
  64308. // means `flushPassiveEffects` will sometimes result in additional
  64309. // passive effects. So we need to keep flushing in a loop until there are
  64310. // no more pending effects.
  64311. // TODO: Might be better if `flushPassiveEffects` did not automatically
  64312. // flush synchronous work at the end, to avoid factoring hazards like this.
  64313. flushPassiveEffects();
  64314. } while (rootWithPendingPassiveEffects !== null);
  64315. flushRenderPhaseStrictModeWarningsInDEV();
  64316. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  64317. {
  64318. throw Error("Should not already be working.");
  64319. }
  64320. }
  64321. var finishedWork = root.finishedWork;
  64322. var expirationTime = root.finishedExpirationTime;
  64323. if (finishedWork === null) {
  64324. return null;
  64325. }
  64326. root.finishedWork = null;
  64327. root.finishedExpirationTime = NoWork;
  64328. if (!(finishedWork !== root.current)) {
  64329. {
  64330. throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
  64331. }
  64332. } // commitRoot never returns a continuation; it always finishes synchronously.
  64333. // So we can clear these now to allow a new callback to be scheduled.
  64334. root.callbackNode = null;
  64335. root.callbackExpirationTime = NoWork;
  64336. root.callbackPriority = NoPriority;
  64337. root.nextKnownPendingLevel = NoWork;
  64338. startCommitTimer(); // Update the first and last pending times on this root. The new first
  64339. // pending time is whatever is left on the root fiber.
  64340. var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);
  64341. markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit);
  64342. if (root === workInProgressRoot) {
  64343. // We can reset these now that they are finished.
  64344. workInProgressRoot = null;
  64345. workInProgress = null;
  64346. renderExpirationTime = NoWork;
  64347. } else {} // This indicates that the last root we worked on is not the same one that
  64348. // we're committing now. This most commonly happens when a suspended root
  64349. // times out.
  64350. // Get the list of effects.
  64351. var firstEffect;
  64352. if (finishedWork.effectTag > PerformedWork) {
  64353. // A fiber's effect list consists only of its children, not itself. So if
  64354. // the root has an effect, we need to add it to the end of the list. The
  64355. // resulting list is the set that would belong to the root's parent, if it
  64356. // had one; that is, all the effects in the tree including the root.
  64357. if (finishedWork.lastEffect !== null) {
  64358. finishedWork.lastEffect.nextEffect = finishedWork;
  64359. firstEffect = finishedWork.firstEffect;
  64360. } else {
  64361. firstEffect = finishedWork;
  64362. }
  64363. } else {
  64364. // There is no effect on the root.
  64365. firstEffect = finishedWork.firstEffect;
  64366. }
  64367. if (firstEffect !== null) {
  64368. var prevExecutionContext = executionContext;
  64369. executionContext |= CommitContext;
  64370. var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles
  64371. ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass
  64372. // of the effect list for each phase: all mutation effects come before all
  64373. // layout effects, and so on.
  64374. // The first phase a "before mutation" phase. We use this phase to read the
  64375. // state of the host tree right before we mutate it. This is where
  64376. // getSnapshotBeforeUpdate is called.
  64377. startCommitSnapshotEffectsTimer();
  64378. prepareForCommit(root.containerInfo);
  64379. nextEffect = firstEffect;
  64380. do {
  64381. {
  64382. invokeGuardedCallback(null, commitBeforeMutationEffects, null);
  64383. if (hasCaughtError()) {
  64384. if (!(nextEffect !== null)) {
  64385. {
  64386. throw Error("Should be working on an effect.");
  64387. }
  64388. }
  64389. var error = clearCaughtError();
  64390. captureCommitPhaseError(nextEffect, error);
  64391. nextEffect = nextEffect.nextEffect;
  64392. }
  64393. }
  64394. } while (nextEffect !== null);
  64395. stopCommitSnapshotEffectsTimer();
  64396. if (enableProfilerTimer) {
  64397. // Mark the current commit time to be shared by all Profilers in this
  64398. // batch. This enables them to be grouped later.
  64399. recordCommitTime();
  64400. } // The next phase is the mutation phase, where we mutate the host tree.
  64401. startCommitHostEffectsTimer();
  64402. nextEffect = firstEffect;
  64403. do {
  64404. {
  64405. invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);
  64406. if (hasCaughtError()) {
  64407. if (!(nextEffect !== null)) {
  64408. {
  64409. throw Error("Should be working on an effect.");
  64410. }
  64411. }
  64412. var _error = clearCaughtError();
  64413. captureCommitPhaseError(nextEffect, _error);
  64414. nextEffect = nextEffect.nextEffect;
  64415. }
  64416. }
  64417. } while (nextEffect !== null);
  64418. stopCommitHostEffectsTimer();
  64419. resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after
  64420. // the mutation phase, so that the previous tree is still current during
  64421. // componentWillUnmount, but before the layout phase, so that the finished
  64422. // work is current during componentDidMount/Update.
  64423. root.current = finishedWork; // The next phase is the layout phase, where we call effects that read
  64424. // the host tree after it's been mutated. The idiomatic use case for this is
  64425. // layout, but class component lifecycles also fire here for legacy reasons.
  64426. startCommitLifeCyclesTimer();
  64427. nextEffect = firstEffect;
  64428. do {
  64429. {
  64430. invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);
  64431. if (hasCaughtError()) {
  64432. if (!(nextEffect !== null)) {
  64433. {
  64434. throw Error("Should be working on an effect.");
  64435. }
  64436. }
  64437. var _error2 = clearCaughtError();
  64438. captureCommitPhaseError(nextEffect, _error2);
  64439. nextEffect = nextEffect.nextEffect;
  64440. }
  64441. }
  64442. } while (nextEffect !== null);
  64443. stopCommitLifeCyclesTimer();
  64444. nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an
  64445. // opportunity to paint.
  64446. requestPaint();
  64447. if (enableSchedulerTracing) {
  64448. popInteractions(prevInteractions);
  64449. }
  64450. executionContext = prevExecutionContext;
  64451. } else {
  64452. // No effects.
  64453. root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were
  64454. // no effects.
  64455. // TODO: Maybe there's a better way to report this.
  64456. startCommitSnapshotEffectsTimer();
  64457. stopCommitSnapshotEffectsTimer();
  64458. if (enableProfilerTimer) {
  64459. recordCommitTime();
  64460. }
  64461. startCommitHostEffectsTimer();
  64462. stopCommitHostEffectsTimer();
  64463. startCommitLifeCyclesTimer();
  64464. stopCommitLifeCyclesTimer();
  64465. }
  64466. stopCommitTimer();
  64467. var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
  64468. if (rootDoesHavePassiveEffects) {
  64469. // This commit has passive effects. Stash a reference to them. But don't
  64470. // schedule a callback until after flushing layout work.
  64471. rootDoesHavePassiveEffects = false;
  64472. rootWithPendingPassiveEffects = root;
  64473. pendingPassiveEffectsExpirationTime = expirationTime;
  64474. pendingPassiveEffectsRenderPriority = renderPriorityLevel;
  64475. } else {
  64476. // We are done with the effect chain at this point so let's clear the
  64477. // nextEffect pointers to assist with GC. If we have passive effects, we'll
  64478. // clear this in flushPassiveEffects.
  64479. nextEffect = firstEffect;
  64480. while (nextEffect !== null) {
  64481. var nextNextEffect = nextEffect.nextEffect;
  64482. nextEffect.nextEffect = null;
  64483. nextEffect = nextNextEffect;
  64484. }
  64485. } // Check if there's remaining work on this root
  64486. var remainingExpirationTime = root.firstPendingTime;
  64487. if (remainingExpirationTime !== NoWork) {
  64488. if (enableSchedulerTracing) {
  64489. if (spawnedWorkDuringRender !== null) {
  64490. var expirationTimes = spawnedWorkDuringRender;
  64491. spawnedWorkDuringRender = null;
  64492. for (var i = 0; i < expirationTimes.length; i++) {
  64493. scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);
  64494. }
  64495. }
  64496. schedulePendingInteractions(root, remainingExpirationTime);
  64497. }
  64498. } else {
  64499. // If there's no remaining work, we can clear the set of already failed
  64500. // error boundaries.
  64501. legacyErrorBoundariesThatAlreadyFailed = null;
  64502. }
  64503. if (enableSchedulerTracing) {
  64504. if (!rootDidHavePassiveEffects) {
  64505. // If there are no passive effects, then we can complete the pending interactions.
  64506. // Otherwise, we'll wait until after the passive effects are flushed.
  64507. // Wait to do this until after remaining work has been scheduled,
  64508. // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.
  64509. finishPendingInteractions(root, expirationTime);
  64510. }
  64511. }
  64512. if (remainingExpirationTime === Sync) {
  64513. // Count the number of times the root synchronously re-renders without
  64514. // finishing. If there are too many, it indicates an infinite update loop.
  64515. if (root === rootWithNestedUpdates) {
  64516. nestedUpdateCount++;
  64517. } else {
  64518. nestedUpdateCount = 0;
  64519. rootWithNestedUpdates = root;
  64520. }
  64521. } else {
  64522. nestedUpdateCount = 0;
  64523. }
  64524. onCommitRoot(finishedWork.stateNode, expirationTime); // Always call this before exiting `commitRoot`, to ensure that any
  64525. // additional work on this root is scheduled.
  64526. ensureRootIsScheduled(root);
  64527. if (hasUncaughtError) {
  64528. hasUncaughtError = false;
  64529. var _error3 = firstUncaughtError;
  64530. firstUncaughtError = null;
  64531. throw _error3;
  64532. }
  64533. if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
  64534. // This is a legacy edge case. We just committed the initial mount of
  64535. // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired
  64536. // synchronously, but layout updates should be deferred until the end
  64537. // of the batch.
  64538. return null;
  64539. } // If layout work was scheduled, flush it now.
  64540. flushSyncCallbackQueue();
  64541. return null;
  64542. }
  64543. function commitBeforeMutationEffects() {
  64544. while (nextEffect !== null) {
  64545. var effectTag = nextEffect.effectTag;
  64546. if ((effectTag & Snapshot) !== NoEffect) {
  64547. setCurrentFiber(nextEffect);
  64548. recordEffect();
  64549. var current$$1 = nextEffect.alternate;
  64550. commitBeforeMutationLifeCycles(current$$1, nextEffect);
  64551. resetCurrentFiber();
  64552. }
  64553. if ((effectTag & Passive) !== NoEffect) {
  64554. // If there are passive effects, schedule a callback to flush at
  64555. // the earliest opportunity.
  64556. if (!rootDoesHavePassiveEffects) {
  64557. rootDoesHavePassiveEffects = true;
  64558. scheduleCallback(NormalPriority, function () {
  64559. flushPassiveEffects();
  64560. return null;
  64561. });
  64562. }
  64563. }
  64564. nextEffect = nextEffect.nextEffect;
  64565. }
  64566. }
  64567. function commitMutationEffects(root, renderPriorityLevel) {
  64568. // TODO: Should probably move the bulk of this function to commitWork.
  64569. while (nextEffect !== null) {
  64570. setCurrentFiber(nextEffect);
  64571. var effectTag = nextEffect.effectTag;
  64572. if (effectTag & ContentReset) {
  64573. commitResetTextContent(nextEffect);
  64574. }
  64575. if (effectTag & Ref) {
  64576. var current$$1 = nextEffect.alternate;
  64577. if (current$$1 !== null) {
  64578. commitDetachRef(current$$1);
  64579. }
  64580. } // The following switch statement is only concerned about placement,
  64581. // updates, and deletions. To avoid needing to add a case for every possible
  64582. // bitmap value, we remove the secondary effects from the effect tag and
  64583. // switch on that value.
  64584. var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);
  64585. switch (primaryEffectTag) {
  64586. case Placement:
  64587. {
  64588. commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
  64589. // inserted, before any life-cycles like componentDidMount gets called.
  64590. // TODO: findDOMNode doesn't rely on this any more but isMounted does
  64591. // and isMounted is deprecated anyway so we should be able to kill this.
  64592. nextEffect.effectTag &= ~Placement;
  64593. break;
  64594. }
  64595. case PlacementAndUpdate:
  64596. {
  64597. // Placement
  64598. commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
  64599. // inserted, before any life-cycles like componentDidMount gets called.
  64600. nextEffect.effectTag &= ~Placement; // Update
  64601. var _current = nextEffect.alternate;
  64602. commitWork(_current, nextEffect);
  64603. break;
  64604. }
  64605. case Hydrating:
  64606. {
  64607. nextEffect.effectTag &= ~Hydrating;
  64608. break;
  64609. }
  64610. case HydratingAndUpdate:
  64611. {
  64612. nextEffect.effectTag &= ~Hydrating; // Update
  64613. var _current2 = nextEffect.alternate;
  64614. commitWork(_current2, nextEffect);
  64615. break;
  64616. }
  64617. case Update:
  64618. {
  64619. var _current3 = nextEffect.alternate;
  64620. commitWork(_current3, nextEffect);
  64621. break;
  64622. }
  64623. case Deletion:
  64624. {
  64625. commitDeletion(root, nextEffect, renderPriorityLevel);
  64626. break;
  64627. }
  64628. } // TODO: Only record a mutation effect if primaryEffectTag is non-zero.
  64629. recordEffect();
  64630. resetCurrentFiber();
  64631. nextEffect = nextEffect.nextEffect;
  64632. }
  64633. }
  64634. function commitLayoutEffects(root, committedExpirationTime) {
  64635. // TODO: Should probably move the bulk of this function to commitWork.
  64636. while (nextEffect !== null) {
  64637. setCurrentFiber(nextEffect);
  64638. var effectTag = nextEffect.effectTag;
  64639. if (effectTag & (Update | Callback)) {
  64640. recordEffect();
  64641. var current$$1 = nextEffect.alternate;
  64642. commitLifeCycles(root, current$$1, nextEffect, committedExpirationTime);
  64643. }
  64644. if (effectTag & Ref) {
  64645. recordEffect();
  64646. commitAttachRef(nextEffect);
  64647. }
  64648. resetCurrentFiber();
  64649. nextEffect = nextEffect.nextEffect;
  64650. }
  64651. }
  64652. function flushPassiveEffects() {
  64653. if (pendingPassiveEffectsRenderPriority !== NoPriority) {
  64654. var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;
  64655. pendingPassiveEffectsRenderPriority = NoPriority;
  64656. return runWithPriority$2(priorityLevel, flushPassiveEffectsImpl);
  64657. }
  64658. }
  64659. function flushPassiveEffectsImpl() {
  64660. if (rootWithPendingPassiveEffects === null) {
  64661. return false;
  64662. }
  64663. var root = rootWithPendingPassiveEffects;
  64664. var expirationTime = pendingPassiveEffectsExpirationTime;
  64665. rootWithPendingPassiveEffects = null;
  64666. pendingPassiveEffectsExpirationTime = NoWork;
  64667. if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
  64668. {
  64669. throw Error("Cannot flush passive effects while already rendering.");
  64670. }
  64671. }
  64672. var prevExecutionContext = executionContext;
  64673. executionContext |= CommitContext;
  64674. var prevInteractions = pushInteractions(root); // Note: This currently assumes there are no passive effects on the root
  64675. // fiber, because the root is not part of its own effect list. This could
  64676. // change in the future.
  64677. var effect = root.current.firstEffect;
  64678. while (effect !== null) {
  64679. {
  64680. setCurrentFiber(effect);
  64681. invokeGuardedCallback(null, commitPassiveHookEffects, null, effect);
  64682. if (hasCaughtError()) {
  64683. if (!(effect !== null)) {
  64684. {
  64685. throw Error("Should be working on an effect.");
  64686. }
  64687. }
  64688. var error = clearCaughtError();
  64689. captureCommitPhaseError(effect, error);
  64690. }
  64691. resetCurrentFiber();
  64692. }
  64693. var nextNextEffect = effect.nextEffect; // Remove nextEffect pointer to assist GC
  64694. effect.nextEffect = null;
  64695. effect = nextNextEffect;
  64696. }
  64697. if (enableSchedulerTracing) {
  64698. popInteractions(prevInteractions);
  64699. finishPendingInteractions(root, expirationTime);
  64700. }
  64701. executionContext = prevExecutionContext;
  64702. flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this
  64703. // exceeds the limit, we'll fire a warning.
  64704. nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
  64705. return true;
  64706. }
  64707. function isAlreadyFailedLegacyErrorBoundary(instance) {
  64708. return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
  64709. }
  64710. function markLegacyErrorBoundaryAsFailed(instance) {
  64711. if (legacyErrorBoundariesThatAlreadyFailed === null) {
  64712. legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
  64713. } else {
  64714. legacyErrorBoundariesThatAlreadyFailed.add(instance);
  64715. }
  64716. }
  64717. function prepareToThrowUncaughtError(error) {
  64718. if (!hasUncaughtError) {
  64719. hasUncaughtError = true;
  64720. firstUncaughtError = error;
  64721. }
  64722. }
  64723. var onUncaughtError = prepareToThrowUncaughtError;
  64724. function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  64725. var errorInfo = createCapturedValue(error, sourceFiber);
  64726. var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);
  64727. enqueueUpdate(rootFiber, update);
  64728. var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);
  64729. if (root !== null) {
  64730. ensureRootIsScheduled(root);
  64731. schedulePendingInteractions(root, Sync);
  64732. }
  64733. }
  64734. function captureCommitPhaseError(sourceFiber, error) {
  64735. if (sourceFiber.tag === HostRoot) {
  64736. // Error was thrown at the root. There is no parent, so the root
  64737. // itself should capture it.
  64738. captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
  64739. return;
  64740. }
  64741. var fiber = sourceFiber.return;
  64742. while (fiber !== null) {
  64743. if (fiber.tag === HostRoot) {
  64744. captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
  64745. return;
  64746. } else if (fiber.tag === ClassComponent) {
  64747. var ctor = fiber.type;
  64748. var instance = fiber.stateNode;
  64749. if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
  64750. var errorInfo = createCapturedValue(error, sourceFiber);
  64751. var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync
  64752. Sync);
  64753. enqueueUpdate(fiber, update);
  64754. var root = markUpdateTimeFromFiberToRoot(fiber, Sync);
  64755. if (root !== null) {
  64756. ensureRootIsScheduled(root);
  64757. schedulePendingInteractions(root, Sync);
  64758. }
  64759. return;
  64760. }
  64761. }
  64762. fiber = fiber.return;
  64763. }
  64764. }
  64765. function pingSuspendedRoot(root, thenable, suspendedTime) {
  64766. var pingCache = root.pingCache;
  64767. if (pingCache !== null) {
  64768. // The thenable resolved, so we no longer need to memoize, because it will
  64769. // never be thrown again.
  64770. pingCache.delete(thenable);
  64771. }
  64772. if (workInProgressRoot === root && renderExpirationTime === suspendedTime) {
  64773. // Received a ping at the same priority level at which we're currently
  64774. // rendering. We might want to restart this render. This should mirror
  64775. // the logic of whether or not a root suspends once it completes.
  64776. // TODO: If we're rendering sync either due to Sync, Batched or expired,
  64777. // we should probably never restart.
  64778. // If we're suspended with delay, we'll always suspend so we can always
  64779. // restart. If we're suspended without any updates, it might be a retry.
  64780. // If it's early in the retry we can restart. We can't know for sure
  64781. // whether we'll eventually process an update during this render pass,
  64782. // but it's somewhat unlikely that we get to a ping before that, since
  64783. // getting to the root most update is usually very fast.
  64784. if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
  64785. // Restart from the root. Don't need to schedule a ping because
  64786. // we're already working on this tree.
  64787. prepareFreshStack(root, renderExpirationTime);
  64788. } else {
  64789. // Even though we can't restart right now, we might get an
  64790. // opportunity later. So we mark this render as having a ping.
  64791. workInProgressRootHasPendingPing = true;
  64792. }
  64793. return;
  64794. }
  64795. if (!isRootSuspendedAtTime(root, suspendedTime)) {
  64796. // The root is no longer suspended at this time.
  64797. return;
  64798. }
  64799. var lastPingedTime = root.lastPingedTime;
  64800. if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {
  64801. // There's already a lower priority ping scheduled.
  64802. return;
  64803. } // Mark the time at which this ping was scheduled.
  64804. root.lastPingedTime = suspendedTime;
  64805. if (root.finishedExpirationTime === suspendedTime) {
  64806. // If there's a pending fallback waiting to commit, throw it away.
  64807. root.finishedExpirationTime = NoWork;
  64808. root.finishedWork = null;
  64809. }
  64810. ensureRootIsScheduled(root);
  64811. schedulePendingInteractions(root, suspendedTime);
  64812. }
  64813. function retryTimedOutBoundary(boundaryFiber, retryTime) {
  64814. // The boundary fiber (a Suspense component or SuspenseList component)
  64815. // previously was rendered in its fallback state. One of the promises that
  64816. // suspended it has resolved, which means at least part of the tree was
  64817. // likely unblocked. Try rendering again, at a new expiration time.
  64818. if (retryTime === NoWork) {
  64819. var suspenseConfig = null; // Retries don't carry over the already committed update.
  64820. var currentTime = requestCurrentTimeForUpdate();
  64821. retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);
  64822. } // TODO: Special case idle priority?
  64823. var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);
  64824. if (root !== null) {
  64825. ensureRootIsScheduled(root);
  64826. schedulePendingInteractions(root, retryTime);
  64827. }
  64828. }
  64829. function retryDehydratedSuspenseBoundary(boundaryFiber) {
  64830. var suspenseState = boundaryFiber.memoizedState;
  64831. var retryTime = NoWork;
  64832. if (suspenseState !== null) {
  64833. retryTime = suspenseState.retryTime;
  64834. }
  64835. retryTimedOutBoundary(boundaryFiber, retryTime);
  64836. }
  64837. function resolveRetryThenable(boundaryFiber, thenable) {
  64838. var retryTime = NoWork; // Default
  64839. var retryCache;
  64840. if (enableSuspenseServerRenderer) {
  64841. switch (boundaryFiber.tag) {
  64842. case SuspenseComponent:
  64843. retryCache = boundaryFiber.stateNode;
  64844. var suspenseState = boundaryFiber.memoizedState;
  64845. if (suspenseState !== null) {
  64846. retryTime = suspenseState.retryTime;
  64847. }
  64848. break;
  64849. case SuspenseListComponent:
  64850. retryCache = boundaryFiber.stateNode;
  64851. break;
  64852. default:
  64853. {
  64854. {
  64855. throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
  64856. }
  64857. }
  64858. }
  64859. } else {
  64860. retryCache = boundaryFiber.stateNode;
  64861. }
  64862. if (retryCache !== null) {
  64863. // The thenable resolved, so we no longer need to memoize, because it will
  64864. // never be thrown again.
  64865. retryCache.delete(thenable);
  64866. }
  64867. retryTimedOutBoundary(boundaryFiber, retryTime);
  64868. } // Computes the next Just Noticeable Difference (JND) boundary.
  64869. // The theory is that a person can't tell the difference between small differences in time.
  64870. // Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
  64871. // difference in the experience. However, waiting for longer might mean that we can avoid
  64872. // showing an intermediate loading state. The longer we have already waited, the harder it
  64873. // is to tell small differences in time. Therefore, the longer we've already waited,
  64874. // the longer we can wait additionally. At some point we have to give up though.
  64875. // We pick a train model where the next boundary commits at a consistent schedule.
  64876. // These particular numbers are vague estimates. We expect to adjust them based on research.
  64877. function jnd(timeElapsed) {
  64878. return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
  64879. }
  64880. function computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {
  64881. var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;
  64882. if (busyMinDurationMs <= 0) {
  64883. return 0;
  64884. }
  64885. var busyDelayMs = suspenseConfig.busyDelayMs | 0; // Compute the time until this render pass would expire.
  64886. var currentTimeMs = now();
  64887. var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);
  64888. var timeElapsed = currentTimeMs - eventTimeMs;
  64889. if (timeElapsed <= busyDelayMs) {
  64890. // If we haven't yet waited longer than the initial delay, we don't
  64891. // have to wait any additional time.
  64892. return 0;
  64893. }
  64894. var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed; // This is the value that is passed to `setTimeout`.
  64895. return msUntilTimeout;
  64896. }
  64897. function checkForNestedUpdates() {
  64898. if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
  64899. nestedUpdateCount = 0;
  64900. rootWithNestedUpdates = null;
  64901. {
  64902. {
  64903. throw Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
  64904. }
  64905. }
  64906. }
  64907. {
  64908. if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
  64909. nestedPassiveUpdateCount = 0;
  64910. warning$1(false, 'Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
  64911. }
  64912. }
  64913. }
  64914. function flushRenderPhaseStrictModeWarningsInDEV() {
  64915. {
  64916. ReactStrictModeWarnings.flushLegacyContextWarning();
  64917. if (warnAboutDeprecatedLifecycles) {
  64918. ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
  64919. }
  64920. }
  64921. }
  64922. function stopFinishedWorkLoopTimer() {
  64923. var didCompleteRoot = true;
  64924. stopWorkLoopTimer(interruptedBy, didCompleteRoot);
  64925. interruptedBy = null;
  64926. }
  64927. function stopInterruptedWorkLoopTimer() {
  64928. // TODO: Track which fiber caused the interruption.
  64929. var didCompleteRoot = false;
  64930. stopWorkLoopTimer(interruptedBy, didCompleteRoot);
  64931. interruptedBy = null;
  64932. }
  64933. function checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {
  64934. if (enableUserTimingAPI && workInProgressRoot !== null && updateExpirationTime > renderExpirationTime) {
  64935. interruptedBy = fiberThatReceivedUpdate;
  64936. }
  64937. }
  64938. var didWarnStateUpdateForUnmountedComponent = null;
  64939. function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
  64940. {
  64941. var tag = fiber.tag;
  64942. if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
  64943. // Only warn for user-defined components, not internal ones like Suspense.
  64944. return;
  64945. } // We show the whole stack but dedupe on the top component's name because
  64946. // the problematic code almost always lies inside that component.
  64947. var componentName = getComponentName(fiber.type) || 'ReactComponent';
  64948. if (didWarnStateUpdateForUnmountedComponent !== null) {
  64949. if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
  64950. return;
  64951. }
  64952. didWarnStateUpdateForUnmountedComponent.add(componentName);
  64953. } else {
  64954. didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
  64955. }
  64956. warningWithoutStack$1(false, "Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));
  64957. }
  64958. }
  64959. var beginWork$$1;
  64960. if ( true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
  64961. var dummyFiber = null;
  64962. beginWork$$1 = function (current$$1, unitOfWork, expirationTime) {
  64963. // If a component throws an error, we replay it again in a synchronously
  64964. // dispatched event, so that the debugger will treat it as an uncaught
  64965. // error See ReactErrorUtils for more information.
  64966. // Before entering the begin phase, copy the work-in-progress onto a dummy
  64967. // fiber. If beginWork throws, we'll use this to reset the state.
  64968. var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
  64969. try {
  64970. return beginWork$1(current$$1, unitOfWork, expirationTime);
  64971. } catch (originalError) {
  64972. if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {
  64973. // Don't replay promises. Treat everything else like an error.
  64974. throw originalError;
  64975. } // Keep this code in sync with handleError; any changes here must have
  64976. // corresponding changes there.
  64977. resetContextDependencies();
  64978. resetHooks(); // Don't reset current debug fiber, since we're about to work on the
  64979. // same fiber again.
  64980. // Unwind the failed stack frame
  64981. unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.
  64982. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
  64983. if (enableProfilerTimer && unitOfWork.mode & ProfileMode) {
  64984. // Reset the profiler timer.
  64985. startProfilerTimer(unitOfWork);
  64986. } // Run beginWork again.
  64987. invokeGuardedCallback(null, beginWork$1, null, current$$1, unitOfWork, expirationTime);
  64988. if (hasCaughtError()) {
  64989. var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
  64990. // Rethrow this error instead of the original one.
  64991. throw replayError;
  64992. } else {
  64993. // This branch is reachable if the render phase is impure.
  64994. throw originalError;
  64995. }
  64996. }
  64997. };
  64998. } else {
  64999. beginWork$$1 = beginWork$1;
  65000. }
  65001. var didWarnAboutUpdateInRender = false;
  65002. var didWarnAboutUpdateInGetChildContext = false;
  65003. function warnAboutInvalidUpdatesOnClassComponentsInDEV(fiber) {
  65004. {
  65005. if (fiber.tag === ClassComponent) {
  65006. switch (phase) {
  65007. case 'getChildContext':
  65008. if (didWarnAboutUpdateInGetChildContext) {
  65009. return;
  65010. }
  65011. warningWithoutStack$1(false, 'setState(...): Cannot call setState() inside getChildContext()');
  65012. didWarnAboutUpdateInGetChildContext = true;
  65013. break;
  65014. case 'render':
  65015. if (didWarnAboutUpdateInRender) {
  65016. return;
  65017. }
  65018. warningWithoutStack$1(false, 'Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure function of ' + 'props and state.');
  65019. didWarnAboutUpdateInRender = true;
  65020. break;
  65021. }
  65022. }
  65023. }
  65024. } // a 'shared' variable that changes when act() opens/closes in tests.
  65025. var IsThisRendererActing = {
  65026. current: false
  65027. };
  65028. function warnIfNotScopedWithMatchingAct(fiber) {
  65029. {
  65030. if (warnsIfNotActing === true && IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
  65031. warningWithoutStack$1(false, "It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + "import {act} from 'react-dom/test-utils';\n" + '// ...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + "import TestRenderer from 'react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '// ...\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));
  65032. }
  65033. }
  65034. }
  65035. function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
  65036. {
  65037. if (warnsIfNotActing === true && (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
  65038. warningWithoutStack$1(false, 'An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
  65039. }
  65040. }
  65041. }
  65042. function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
  65043. {
  65044. if (warnsIfNotActing === true && executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
  65045. warningWithoutStack$1(false, 'An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
  65046. }
  65047. }
  65048. }
  65049. var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.
  65050. var didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked
  65051. // scheduler is the actual recommendation. The alternative could be a testing build,
  65052. // a new lib, or whatever; we dunno just yet. This message is for early adopters
  65053. // to get their tests right.
  65054. function warnIfUnmockedScheduler(fiber) {
  65055. {
  65056. if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {
  65057. if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
  65058. didWarnAboutUnmockedScheduler = true;
  65059. warningWithoutStack$1(false, 'In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
  65060. } else if (warnAboutUnmockedScheduler === true) {
  65061. didWarnAboutUnmockedScheduler = true;
  65062. warningWithoutStack$1(false, 'Starting from React v17, the "scheduler" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
  65063. }
  65064. }
  65065. }
  65066. }
  65067. var componentsThatTriggeredHighPriSuspend = null;
  65068. function checkForWrongSuspensePriorityInDEV(sourceFiber) {
  65069. {
  65070. var currentPriorityLevel = getCurrentPriorityLevel();
  65071. if ((sourceFiber.mode & ConcurrentMode) !== NoEffect && (currentPriorityLevel === UserBlockingPriority$2 || currentPriorityLevel === ImmediatePriority)) {
  65072. var workInProgressNode = sourceFiber;
  65073. while (workInProgressNode !== null) {
  65074. // Add the component that triggered the suspense
  65075. var current$$1 = workInProgressNode.alternate;
  65076. if (current$$1 !== null) {
  65077. // TODO: warn component that triggers the high priority
  65078. // suspend is the HostRoot
  65079. switch (workInProgressNode.tag) {
  65080. case ClassComponent:
  65081. // Loop through the component's update queue and see whether the component
  65082. // has triggered any high priority updates
  65083. var updateQueue = current$$1.updateQueue;
  65084. if (updateQueue !== null) {
  65085. var update = updateQueue.firstUpdate;
  65086. while (update !== null) {
  65087. var priorityLevel = update.priority;
  65088. if (priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority) {
  65089. if (componentsThatTriggeredHighPriSuspend === null) {
  65090. componentsThatTriggeredHighPriSuspend = new Set([getComponentName(workInProgressNode.type)]);
  65091. } else {
  65092. componentsThatTriggeredHighPriSuspend.add(getComponentName(workInProgressNode.type));
  65093. }
  65094. break;
  65095. }
  65096. update = update.next;
  65097. }
  65098. }
  65099. break;
  65100. case FunctionComponent:
  65101. case ForwardRef:
  65102. case SimpleMemoComponent:
  65103. if (workInProgressNode.memoizedState !== null && workInProgressNode.memoizedState.baseUpdate !== null) {
  65104. var _update = workInProgressNode.memoizedState.baseUpdate; // Loop through the functional component's memoized state to see whether
  65105. // the component has triggered any high pri updates
  65106. while (_update !== null) {
  65107. var priority = _update.priority;
  65108. if (priority === UserBlockingPriority$2 || priority === ImmediatePriority) {
  65109. if (componentsThatTriggeredHighPriSuspend === null) {
  65110. componentsThatTriggeredHighPriSuspend = new Set([getComponentName(workInProgressNode.type)]);
  65111. } else {
  65112. componentsThatTriggeredHighPriSuspend.add(getComponentName(workInProgressNode.type));
  65113. }
  65114. break;
  65115. }
  65116. if (_update.next === workInProgressNode.memoizedState.baseUpdate) {
  65117. break;
  65118. }
  65119. _update = _update.next;
  65120. }
  65121. }
  65122. break;
  65123. default:
  65124. break;
  65125. }
  65126. }
  65127. workInProgressNode = workInProgressNode.return;
  65128. }
  65129. }
  65130. }
  65131. }
  65132. function flushSuspensePriorityWarningInDEV() {
  65133. {
  65134. if (componentsThatTriggeredHighPriSuspend !== null) {
  65135. var componentNames = [];
  65136. componentsThatTriggeredHighPriSuspend.forEach(function (name) {
  65137. return componentNames.push(name);
  65138. });
  65139. componentsThatTriggeredHighPriSuspend = null;
  65140. if (componentNames.length > 0) {
  65141. warningWithoutStack$1(false, '%s triggered a user-blocking update that suspended.' + '\n\n' + 'The fix is to split the update into multiple parts: a user-blocking ' + 'update to provide immediate feedback, and another update that ' + 'triggers the bulk of the changes.' + '\n\n' + 'Refer to the documentation for useTransition to learn how ' + 'to implement this pattern.', // TODO: Add link to React docs with more information, once it exists
  65142. componentNames.sort().join(', '));
  65143. }
  65144. }
  65145. }
  65146. }
  65147. function computeThreadID(root, expirationTime) {
  65148. // Interaction threads are unique per root and expiration time.
  65149. return expirationTime * 1000 + root.interactionThreadID;
  65150. }
  65151. function markSpawnedWork(expirationTime) {
  65152. if (!enableSchedulerTracing) {
  65153. return;
  65154. }
  65155. if (spawnedWorkDuringRender === null) {
  65156. spawnedWorkDuringRender = [expirationTime];
  65157. } else {
  65158. spawnedWorkDuringRender.push(expirationTime);
  65159. }
  65160. }
  65161. function scheduleInteractions(root, expirationTime, interactions) {
  65162. if (!enableSchedulerTracing) {
  65163. return;
  65164. }
  65165. if (interactions.size > 0) {
  65166. var pendingInteractionMap = root.pendingInteractionMap;
  65167. var pendingInteractions = pendingInteractionMap.get(expirationTime);
  65168. if (pendingInteractions != null) {
  65169. interactions.forEach(function (interaction) {
  65170. if (!pendingInteractions.has(interaction)) {
  65171. // Update the pending async work count for previously unscheduled interaction.
  65172. interaction.__count++;
  65173. }
  65174. pendingInteractions.add(interaction);
  65175. });
  65176. } else {
  65177. pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions.
  65178. interactions.forEach(function (interaction) {
  65179. interaction.__count++;
  65180. });
  65181. }
  65182. var subscriber = tracing.__subscriberRef.current;
  65183. if (subscriber !== null) {
  65184. var threadID = computeThreadID(root, expirationTime);
  65185. subscriber.onWorkScheduled(interactions, threadID);
  65186. }
  65187. }
  65188. }
  65189. function schedulePendingInteractions(root, expirationTime) {
  65190. // This is called when work is scheduled on a root.
  65191. // It associates the current interactions with the newly-scheduled expiration.
  65192. // They will be restored when that expiration is later committed.
  65193. if (!enableSchedulerTracing) {
  65194. return;
  65195. }
  65196. scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current);
  65197. }
  65198. function startWorkOnPendingInteractions(root, expirationTime) {
  65199. // This is called when new work is started on a root.
  65200. if (!enableSchedulerTracing) {
  65201. return;
  65202. } // Determine which interactions this batch of work currently includes, So that
  65203. // we can accurately attribute time spent working on it, And so that cascading
  65204. // work triggered during the render phase will be associated with it.
  65205. var interactions = new Set();
  65206. root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
  65207. if (scheduledExpirationTime >= expirationTime) {
  65208. scheduledInteractions.forEach(function (interaction) {
  65209. return interactions.add(interaction);
  65210. });
  65211. }
  65212. }); // Store the current set of interactions on the FiberRoot for a few reasons:
  65213. // We can re-use it in hot functions like performConcurrentWorkOnRoot()
  65214. // without having to recalculate it. We will also use it in commitWork() to
  65215. // pass to any Profiler onRender() hooks. This also provides DevTools with a
  65216. // way to access it when the onCommitRoot() hook is called.
  65217. root.memoizedInteractions = interactions;
  65218. if (interactions.size > 0) {
  65219. var subscriber = tracing.__subscriberRef.current;
  65220. if (subscriber !== null) {
  65221. var threadID = computeThreadID(root, expirationTime);
  65222. try {
  65223. subscriber.onWorkStarted(interactions, threadID);
  65224. } catch (error) {
  65225. // If the subscriber throws, rethrow it in a separate task
  65226. scheduleCallback(ImmediatePriority, function () {
  65227. throw error;
  65228. });
  65229. }
  65230. }
  65231. }
  65232. }
  65233. function finishPendingInteractions(root, committedExpirationTime) {
  65234. if (!enableSchedulerTracing) {
  65235. return;
  65236. }
  65237. var earliestRemainingTimeAfterCommit = root.firstPendingTime;
  65238. var subscriber;
  65239. try {
  65240. subscriber = tracing.__subscriberRef.current;
  65241. if (subscriber !== null && root.memoizedInteractions.size > 0) {
  65242. var threadID = computeThreadID(root, committedExpirationTime);
  65243. subscriber.onWorkStopped(root.memoizedInteractions, threadID);
  65244. }
  65245. } catch (error) {
  65246. // If the subscriber throws, rethrow it in a separate task
  65247. scheduleCallback(ImmediatePriority, function () {
  65248. throw error;
  65249. });
  65250. } finally {
  65251. // Clear completed interactions from the pending Map.
  65252. // Unless the render was suspended or cascading work was scheduled,
  65253. // In which case– leave pending interactions until the subsequent render.
  65254. var pendingInteractionMap = root.pendingInteractionMap;
  65255. pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
  65256. // Only decrement the pending interaction count if we're done.
  65257. // If there's still work at the current priority,
  65258. // That indicates that we are waiting for suspense data.
  65259. if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
  65260. pendingInteractionMap.delete(scheduledExpirationTime);
  65261. scheduledInteractions.forEach(function (interaction) {
  65262. interaction.__count--;
  65263. if (subscriber !== null && interaction.__count === 0) {
  65264. try {
  65265. subscriber.onInteractionScheduledWorkCompleted(interaction);
  65266. } catch (error) {
  65267. // If the subscriber throws, rethrow it in a separate task
  65268. scheduleCallback(ImmediatePriority, function () {
  65269. throw error;
  65270. });
  65271. }
  65272. }
  65273. });
  65274. }
  65275. });
  65276. }
  65277. }
  65278. var onCommitFiberRoot = null;
  65279. var onCommitFiberUnmount = null;
  65280. var hasLoggedError = false;
  65281. var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';
  65282. function injectInternals(internals) {
  65283. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
  65284. // No DevTools
  65285. return false;
  65286. }
  65287. var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  65288. if (hook.isDisabled) {
  65289. // This isn't a real property on the hook, but it can be set to opt out
  65290. // of DevTools integration and associated warnings and logs.
  65291. // https://github.com/facebook/react/issues/3877
  65292. return true;
  65293. }
  65294. if (!hook.supportsFiber) {
  65295. {
  65296. warningWithoutStack$1(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
  65297. } // DevTools exists, even though it doesn't support Fiber.
  65298. return true;
  65299. }
  65300. try {
  65301. var rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.
  65302. onCommitFiberRoot = function (root, expirationTime) {
  65303. try {
  65304. var didError = (root.current.effectTag & DidCapture) === DidCapture;
  65305. if (enableProfilerTimer) {
  65306. var currentTime = getCurrentTime();
  65307. var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
  65308. hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
  65309. } else {
  65310. hook.onCommitFiberRoot(rendererID, root, undefined, didError);
  65311. }
  65312. } catch (err) {
  65313. if ( true && !hasLoggedError) {
  65314. hasLoggedError = true;
  65315. warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
  65316. }
  65317. }
  65318. };
  65319. onCommitFiberUnmount = function (fiber) {
  65320. try {
  65321. hook.onCommitFiberUnmount(rendererID, fiber);
  65322. } catch (err) {
  65323. if ( true && !hasLoggedError) {
  65324. hasLoggedError = true;
  65325. warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
  65326. }
  65327. }
  65328. };
  65329. } catch (err) {
  65330. // Catch all errors because it is unsafe to throw during initialization.
  65331. {
  65332. warningWithoutStack$1(false, 'React DevTools encountered an error: %s.', err);
  65333. }
  65334. } // DevTools exists
  65335. return true;
  65336. }
  65337. function onCommitRoot(root, expirationTime) {
  65338. if (typeof onCommitFiberRoot === 'function') {
  65339. onCommitFiberRoot(root, expirationTime);
  65340. }
  65341. }
  65342. function onCommitUnmount(fiber) {
  65343. if (typeof onCommitFiberUnmount === 'function') {
  65344. onCommitFiberUnmount(fiber);
  65345. }
  65346. }
  65347. var hasBadMapPolyfill;
  65348. {
  65349. hasBadMapPolyfill = false;
  65350. try {
  65351. var nonExtensibleObject = Object.preventExtensions({});
  65352. var testMap = new Map([[nonExtensibleObject, null]]);
  65353. var testSet = new Set([nonExtensibleObject]); // This is necessary for Rollup to not consider these unused.
  65354. // https://github.com/rollup/rollup/issues/1771
  65355. // TODO: we can remove these if Rollup fixes the bug.
  65356. testMap.set(0, 0);
  65357. testSet.add(0);
  65358. } catch (e) {
  65359. // TODO: Consider warning about bad polyfills
  65360. hasBadMapPolyfill = true;
  65361. }
  65362. }
  65363. var debugCounter = 1;
  65364. function FiberNode(tag, pendingProps, key, mode) {
  65365. // Instance
  65366. this.tag = tag;
  65367. this.key = key;
  65368. this.elementType = null;
  65369. this.type = null;
  65370. this.stateNode = null; // Fiber
  65371. this.return = null;
  65372. this.child = null;
  65373. this.sibling = null;
  65374. this.index = 0;
  65375. this.ref = null;
  65376. this.pendingProps = pendingProps;
  65377. this.memoizedProps = null;
  65378. this.updateQueue = null;
  65379. this.memoizedState = null;
  65380. this.dependencies = null;
  65381. this.mode = mode; // Effects
  65382. this.effectTag = NoEffect;
  65383. this.nextEffect = null;
  65384. this.firstEffect = null;
  65385. this.lastEffect = null;
  65386. this.expirationTime = NoWork;
  65387. this.childExpirationTime = NoWork;
  65388. this.alternate = null;
  65389. if (enableProfilerTimer) {
  65390. // Note: The following is done to avoid a v8 performance cliff.
  65391. //
  65392. // Initializing the fields below to smis and later updating them with
  65393. // double values will cause Fibers to end up having separate shapes.
  65394. // This behavior/bug has something to do with Object.preventExtension().
  65395. // Fortunately this only impacts DEV builds.
  65396. // Unfortunately it makes React unusably slow for some applications.
  65397. // To work around this, initialize the fields below with doubles.
  65398. //
  65399. // Learn more about this here:
  65400. // https://github.com/facebook/react/issues/14365
  65401. // https://bugs.chromium.org/p/v8/issues/detail?id=8538
  65402. this.actualDuration = Number.NaN;
  65403. this.actualStartTime = Number.NaN;
  65404. this.selfBaseDuration = Number.NaN;
  65405. this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.
  65406. // This won't trigger the performance cliff mentioned above,
  65407. // and it simplifies other profiler code (including DevTools).
  65408. this.actualDuration = 0;
  65409. this.actualStartTime = -1;
  65410. this.selfBaseDuration = 0;
  65411. this.treeBaseDuration = 0;
  65412. } // This is normally DEV-only except www when it adds listeners.
  65413. // TODO: remove the User Timing integration in favor of Root Events.
  65414. if (enableUserTimingAPI) {
  65415. this._debugID = debugCounter++;
  65416. this._debugIsCurrentlyTiming = false;
  65417. }
  65418. {
  65419. this._debugSource = null;
  65420. this._debugOwner = null;
  65421. this._debugNeedsRemount = false;
  65422. this._debugHookTypes = null;
  65423. if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
  65424. Object.preventExtensions(this);
  65425. }
  65426. }
  65427. } // This is a constructor function, rather than a POJO constructor, still
  65428. // please ensure we do the following:
  65429. // 1) Nobody should add any instance methods on this. Instance methods can be
  65430. // more difficult to predict when they get optimized and they are almost
  65431. // never inlined properly in static compilers.
  65432. // 2) Nobody should rely on `instanceof Fiber` for type testing. We should
  65433. // always know when it is a fiber.
  65434. // 3) We might want to experiment with using numeric keys since they are easier
  65435. // to optimize in a non-JIT environment.
  65436. // 4) We can easily go from a constructor to a createFiber object literal if that
  65437. // is faster.
  65438. // 5) It should be easy to port this to a C struct and keep a C implementation
  65439. // compatible.
  65440. var createFiber = function (tag, pendingProps, key, mode) {
  65441. // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
  65442. return new FiberNode(tag, pendingProps, key, mode);
  65443. };
  65444. function shouldConstruct(Component) {
  65445. var prototype = Component.prototype;
  65446. return !!(prototype && prototype.isReactComponent);
  65447. }
  65448. function isSimpleFunctionComponent(type) {
  65449. return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;
  65450. }
  65451. function resolveLazyComponentTag(Component) {
  65452. if (typeof Component === 'function') {
  65453. return shouldConstruct(Component) ? ClassComponent : FunctionComponent;
  65454. } else if (Component !== undefined && Component !== null) {
  65455. var $$typeof = Component.$$typeof;
  65456. if ($$typeof === REACT_FORWARD_REF_TYPE) {
  65457. return ForwardRef;
  65458. }
  65459. if ($$typeof === REACT_MEMO_TYPE) {
  65460. return MemoComponent;
  65461. }
  65462. }
  65463. return IndeterminateComponent;
  65464. } // This is used to create an alternate fiber to do work on.
  65465. function createWorkInProgress(current, pendingProps, expirationTime) {
  65466. var workInProgress = current.alternate;
  65467. if (workInProgress === null) {
  65468. // We use a double buffering pooling technique because we know that we'll
  65469. // only ever need at most two versions of a tree. We pool the "other" unused
  65470. // node that we're free to reuse. This is lazily created to avoid allocating
  65471. // extra objects for things that are never updated. It also allow us to
  65472. // reclaim the extra memory if needed.
  65473. workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
  65474. workInProgress.elementType = current.elementType;
  65475. workInProgress.type = current.type;
  65476. workInProgress.stateNode = current.stateNode;
  65477. {
  65478. // DEV-only fields
  65479. workInProgress._debugID = current._debugID;
  65480. workInProgress._debugSource = current._debugSource;
  65481. workInProgress._debugOwner = current._debugOwner;
  65482. workInProgress._debugHookTypes = current._debugHookTypes;
  65483. }
  65484. workInProgress.alternate = current;
  65485. current.alternate = workInProgress;
  65486. } else {
  65487. workInProgress.pendingProps = pendingProps; // We already have an alternate.
  65488. // Reset the effect tag.
  65489. workInProgress.effectTag = NoEffect; // The effect list is no longer valid.
  65490. workInProgress.nextEffect = null;
  65491. workInProgress.firstEffect = null;
  65492. workInProgress.lastEffect = null;
  65493. if (enableProfilerTimer) {
  65494. // We intentionally reset, rather than copy, actualDuration & actualStartTime.
  65495. // This prevents time from endlessly accumulating in new commits.
  65496. // This has the downside of resetting values for different priority renders,
  65497. // But works for yielding (the common case) and should support resuming.
  65498. workInProgress.actualDuration = 0;
  65499. workInProgress.actualStartTime = -1;
  65500. }
  65501. }
  65502. workInProgress.childExpirationTime = current.childExpirationTime;
  65503. workInProgress.expirationTime = current.expirationTime;
  65504. workInProgress.child = current.child;
  65505. workInProgress.memoizedProps = current.memoizedProps;
  65506. workInProgress.memoizedState = current.memoizedState;
  65507. workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
  65508. // it cannot be shared with the current fiber.
  65509. var currentDependencies = current.dependencies;
  65510. workInProgress.dependencies = currentDependencies === null ? null : {
  65511. expirationTime: currentDependencies.expirationTime,
  65512. firstContext: currentDependencies.firstContext,
  65513. responders: currentDependencies.responders
  65514. }; // These will be overridden during the parent's reconciliation
  65515. workInProgress.sibling = current.sibling;
  65516. workInProgress.index = current.index;
  65517. workInProgress.ref = current.ref;
  65518. if (enableProfilerTimer) {
  65519. workInProgress.selfBaseDuration = current.selfBaseDuration;
  65520. workInProgress.treeBaseDuration = current.treeBaseDuration;
  65521. }
  65522. {
  65523. workInProgress._debugNeedsRemount = current._debugNeedsRemount;
  65524. switch (workInProgress.tag) {
  65525. case IndeterminateComponent:
  65526. case FunctionComponent:
  65527. case SimpleMemoComponent:
  65528. workInProgress.type = resolveFunctionForHotReloading(current.type);
  65529. break;
  65530. case ClassComponent:
  65531. workInProgress.type = resolveClassForHotReloading(current.type);
  65532. break;
  65533. case ForwardRef:
  65534. workInProgress.type = resolveForwardRefForHotReloading(current.type);
  65535. break;
  65536. default:
  65537. break;
  65538. }
  65539. }
  65540. return workInProgress;
  65541. } // Used to reuse a Fiber for a second pass.
  65542. function resetWorkInProgress(workInProgress, renderExpirationTime) {
  65543. // This resets the Fiber to what createFiber or createWorkInProgress would
  65544. // have set the values to before during the first pass. Ideally this wouldn't
  65545. // be necessary but unfortunately many code paths reads from the workInProgress
  65546. // when they should be reading from current and writing to workInProgress.
  65547. // We assume pendingProps, index, key, ref, return are still untouched to
  65548. // avoid doing another reconciliation.
  65549. // Reset the effect tag but keep any Placement tags, since that's something
  65550. // that child fiber is setting, not the reconciliation.
  65551. workInProgress.effectTag &= Placement; // The effect list is no longer valid.
  65552. workInProgress.nextEffect = null;
  65553. workInProgress.firstEffect = null;
  65554. workInProgress.lastEffect = null;
  65555. var current = workInProgress.alternate;
  65556. if (current === null) {
  65557. // Reset to createFiber's initial values.
  65558. workInProgress.childExpirationTime = NoWork;
  65559. workInProgress.expirationTime = renderExpirationTime;
  65560. workInProgress.child = null;
  65561. workInProgress.memoizedProps = null;
  65562. workInProgress.memoizedState = null;
  65563. workInProgress.updateQueue = null;
  65564. workInProgress.dependencies = null;
  65565. if (enableProfilerTimer) {
  65566. // Note: We don't reset the actualTime counts. It's useful to accumulate
  65567. // actual time across multiple render passes.
  65568. workInProgress.selfBaseDuration = 0;
  65569. workInProgress.treeBaseDuration = 0;
  65570. }
  65571. } else {
  65572. // Reset to the cloned values that createWorkInProgress would've.
  65573. workInProgress.childExpirationTime = current.childExpirationTime;
  65574. workInProgress.expirationTime = current.expirationTime;
  65575. workInProgress.child = current.child;
  65576. workInProgress.memoizedProps = current.memoizedProps;
  65577. workInProgress.memoizedState = current.memoizedState;
  65578. workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
  65579. // it cannot be shared with the current fiber.
  65580. var currentDependencies = current.dependencies;
  65581. workInProgress.dependencies = currentDependencies === null ? null : {
  65582. expirationTime: currentDependencies.expirationTime,
  65583. firstContext: currentDependencies.firstContext,
  65584. responders: currentDependencies.responders
  65585. };
  65586. if (enableProfilerTimer) {
  65587. // Note: We don't reset the actualTime counts. It's useful to accumulate
  65588. // actual time across multiple render passes.
  65589. workInProgress.selfBaseDuration = current.selfBaseDuration;
  65590. workInProgress.treeBaseDuration = current.treeBaseDuration;
  65591. }
  65592. }
  65593. return workInProgress;
  65594. }
  65595. function createHostRootFiber(tag) {
  65596. var mode;
  65597. if (tag === ConcurrentRoot) {
  65598. mode = ConcurrentMode | BlockingMode | StrictMode;
  65599. } else if (tag === BlockingRoot) {
  65600. mode = BlockingMode | StrictMode;
  65601. } else {
  65602. mode = NoMode;
  65603. }
  65604. if (enableProfilerTimer && isDevToolsPresent) {
  65605. // Always collect profile timings when DevTools are present.
  65606. // This enables DevTools to start capturing timing at any point–
  65607. // Without some nodes in the tree having empty base times.
  65608. mode |= ProfileMode;
  65609. }
  65610. return createFiber(HostRoot, null, null, mode);
  65611. }
  65612. function createFiberFromTypeAndProps(type, // React$ElementType
  65613. key, pendingProps, owner, mode, expirationTime) {
  65614. var fiber;
  65615. var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.
  65616. var resolvedType = type;
  65617. if (typeof type === 'function') {
  65618. if (shouldConstruct(type)) {
  65619. fiberTag = ClassComponent;
  65620. {
  65621. resolvedType = resolveClassForHotReloading(resolvedType);
  65622. }
  65623. } else {
  65624. {
  65625. resolvedType = resolveFunctionForHotReloading(resolvedType);
  65626. }
  65627. }
  65628. } else if (typeof type === 'string') {
  65629. fiberTag = HostComponent;
  65630. } else {
  65631. getTag: switch (type) {
  65632. case REACT_FRAGMENT_TYPE:
  65633. return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);
  65634. case REACT_CONCURRENT_MODE_TYPE:
  65635. fiberTag = Mode;
  65636. mode |= ConcurrentMode | BlockingMode | StrictMode;
  65637. break;
  65638. case REACT_STRICT_MODE_TYPE:
  65639. fiberTag = Mode;
  65640. mode |= StrictMode;
  65641. break;
  65642. case REACT_PROFILER_TYPE:
  65643. return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
  65644. case REACT_SUSPENSE_TYPE:
  65645. return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
  65646. case REACT_SUSPENSE_LIST_TYPE:
  65647. return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);
  65648. default:
  65649. {
  65650. if (typeof type === 'object' && type !== null) {
  65651. switch (type.$$typeof) {
  65652. case REACT_PROVIDER_TYPE:
  65653. fiberTag = ContextProvider;
  65654. break getTag;
  65655. case REACT_CONTEXT_TYPE:
  65656. // This is a consumer
  65657. fiberTag = ContextConsumer;
  65658. break getTag;
  65659. case REACT_FORWARD_REF_TYPE:
  65660. fiberTag = ForwardRef;
  65661. {
  65662. resolvedType = resolveForwardRefForHotReloading(resolvedType);
  65663. }
  65664. break getTag;
  65665. case REACT_MEMO_TYPE:
  65666. fiberTag = MemoComponent;
  65667. break getTag;
  65668. case REACT_LAZY_TYPE:
  65669. fiberTag = LazyComponent;
  65670. resolvedType = null;
  65671. break getTag;
  65672. case REACT_FUNDAMENTAL_TYPE:
  65673. if (enableFundamentalAPI) {
  65674. return createFiberFromFundamental(type, pendingProps, mode, expirationTime, key);
  65675. }
  65676. break;
  65677. case REACT_SCOPE_TYPE:
  65678. if (enableScopeAPI) {
  65679. return createFiberFromScope(type, pendingProps, mode, expirationTime, key);
  65680. }
  65681. }
  65682. }
  65683. var info = '';
  65684. {
  65685. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  65686. info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
  65687. }
  65688. var ownerName = owner ? getComponentName(owner.type) : null;
  65689. if (ownerName) {
  65690. info += '\n\nCheck the render method of `' + ownerName + '`.';
  65691. }
  65692. }
  65693. {
  65694. {
  65695. throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info);
  65696. }
  65697. }
  65698. }
  65699. }
  65700. }
  65701. fiber = createFiber(fiberTag, pendingProps, key, mode);
  65702. fiber.elementType = type;
  65703. fiber.type = resolvedType;
  65704. fiber.expirationTime = expirationTime;
  65705. return fiber;
  65706. }
  65707. function createFiberFromElement(element, mode, expirationTime) {
  65708. var owner = null;
  65709. {
  65710. owner = element._owner;
  65711. }
  65712. var type = element.type;
  65713. var key = element.key;
  65714. var pendingProps = element.props;
  65715. var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);
  65716. {
  65717. fiber._debugSource = element._source;
  65718. fiber._debugOwner = element._owner;
  65719. }
  65720. return fiber;
  65721. }
  65722. function createFiberFromFragment(elements, mode, expirationTime, key) {
  65723. var fiber = createFiber(Fragment, elements, key, mode);
  65724. fiber.expirationTime = expirationTime;
  65725. return fiber;
  65726. }
  65727. function createFiberFromFundamental(fundamentalComponent, pendingProps, mode, expirationTime, key) {
  65728. var fiber = createFiber(FundamentalComponent, pendingProps, key, mode);
  65729. fiber.elementType = fundamentalComponent;
  65730. fiber.type = fundamentalComponent;
  65731. fiber.expirationTime = expirationTime;
  65732. return fiber;
  65733. }
  65734. function createFiberFromScope(scope, pendingProps, mode, expirationTime, key) {
  65735. var fiber = createFiber(ScopeComponent, pendingProps, key, mode);
  65736. fiber.type = scope;
  65737. fiber.elementType = scope;
  65738. fiber.expirationTime = expirationTime;
  65739. return fiber;
  65740. }
  65741. function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
  65742. {
  65743. if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {
  65744. warningWithoutStack$1(false, 'Profiler must specify an "id" string and "onRender" function as props');
  65745. }
  65746. }
  65747. var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.
  65748. fiber.elementType = REACT_PROFILER_TYPE;
  65749. fiber.type = REACT_PROFILER_TYPE;
  65750. fiber.expirationTime = expirationTime;
  65751. return fiber;
  65752. }
  65753. function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
  65754. var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.
  65755. // This needs to be fixed in getComponentName so that it relies on the tag
  65756. // instead.
  65757. fiber.type = REACT_SUSPENSE_TYPE;
  65758. fiber.elementType = REACT_SUSPENSE_TYPE;
  65759. fiber.expirationTime = expirationTime;
  65760. return fiber;
  65761. }
  65762. function createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {
  65763. var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
  65764. {
  65765. // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.
  65766. // This needs to be fixed in getComponentName so that it relies on the tag
  65767. // instead.
  65768. fiber.type = REACT_SUSPENSE_LIST_TYPE;
  65769. }
  65770. fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
  65771. fiber.expirationTime = expirationTime;
  65772. return fiber;
  65773. }
  65774. function createFiberFromText(content, mode, expirationTime) {
  65775. var fiber = createFiber(HostText, content, null, mode);
  65776. fiber.expirationTime = expirationTime;
  65777. return fiber;
  65778. }
  65779. function createFiberFromHostInstanceForDeletion() {
  65780. var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.
  65781. fiber.elementType = 'DELETED';
  65782. fiber.type = 'DELETED';
  65783. return fiber;
  65784. }
  65785. function createFiberFromDehydratedFragment(dehydratedNode) {
  65786. var fiber = createFiber(DehydratedFragment, null, null, NoMode);
  65787. fiber.stateNode = dehydratedNode;
  65788. return fiber;
  65789. }
  65790. function createFiberFromPortal(portal, mode, expirationTime) {
  65791. var pendingProps = portal.children !== null ? portal.children : [];
  65792. var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
  65793. fiber.expirationTime = expirationTime;
  65794. fiber.stateNode = {
  65795. containerInfo: portal.containerInfo,
  65796. pendingChildren: null,
  65797. // Used by persistent updates
  65798. implementation: portal.implementation
  65799. };
  65800. return fiber;
  65801. } // Used for stashing WIP properties to replay failed work in DEV.
  65802. function assignFiberPropertiesInDEV(target, source) {
  65803. if (target === null) {
  65804. // This Fiber's initial properties will always be overwritten.
  65805. // We only use a Fiber to ensure the same hidden class so DEV isn't slow.
  65806. target = createFiber(IndeterminateComponent, null, null, NoMode);
  65807. } // This is intentionally written as a list of all properties.
  65808. // We tried to use Object.assign() instead but this is called in
  65809. // the hottest path, and Object.assign() was too slow:
  65810. // https://github.com/facebook/react/issues/12502
  65811. // This code is DEV-only so size is not a concern.
  65812. target.tag = source.tag;
  65813. target.key = source.key;
  65814. target.elementType = source.elementType;
  65815. target.type = source.type;
  65816. target.stateNode = source.stateNode;
  65817. target.return = source.return;
  65818. target.child = source.child;
  65819. target.sibling = source.sibling;
  65820. target.index = source.index;
  65821. target.ref = source.ref;
  65822. target.pendingProps = source.pendingProps;
  65823. target.memoizedProps = source.memoizedProps;
  65824. target.updateQueue = source.updateQueue;
  65825. target.memoizedState = source.memoizedState;
  65826. target.dependencies = source.dependencies;
  65827. target.mode = source.mode;
  65828. target.effectTag = source.effectTag;
  65829. target.nextEffect = source.nextEffect;
  65830. target.firstEffect = source.firstEffect;
  65831. target.lastEffect = source.lastEffect;
  65832. target.expirationTime = source.expirationTime;
  65833. target.childExpirationTime = source.childExpirationTime;
  65834. target.alternate = source.alternate;
  65835. if (enableProfilerTimer) {
  65836. target.actualDuration = source.actualDuration;
  65837. target.actualStartTime = source.actualStartTime;
  65838. target.selfBaseDuration = source.selfBaseDuration;
  65839. target.treeBaseDuration = source.treeBaseDuration;
  65840. }
  65841. target._debugID = source._debugID;
  65842. target._debugSource = source._debugSource;
  65843. target._debugOwner = source._debugOwner;
  65844. target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
  65845. target._debugNeedsRemount = source._debugNeedsRemount;
  65846. target._debugHookTypes = source._debugHookTypes;
  65847. return target;
  65848. }
  65849. function FiberRootNode(containerInfo, tag, hydrate) {
  65850. this.tag = tag;
  65851. this.current = null;
  65852. this.containerInfo = containerInfo;
  65853. this.pendingChildren = null;
  65854. this.pingCache = null;
  65855. this.finishedExpirationTime = NoWork;
  65856. this.finishedWork = null;
  65857. this.timeoutHandle = noTimeout;
  65858. this.context = null;
  65859. this.pendingContext = null;
  65860. this.hydrate = hydrate;
  65861. this.callbackNode = null;
  65862. this.callbackPriority = NoPriority;
  65863. this.firstPendingTime = NoWork;
  65864. this.firstSuspendedTime = NoWork;
  65865. this.lastSuspendedTime = NoWork;
  65866. this.nextKnownPendingLevel = NoWork;
  65867. this.lastPingedTime = NoWork;
  65868. this.lastExpiredTime = NoWork;
  65869. if (enableSchedulerTracing) {
  65870. this.interactionThreadID = tracing.unstable_getThreadID();
  65871. this.memoizedInteractions = new Set();
  65872. this.pendingInteractionMap = new Map();
  65873. }
  65874. if (enableSuspenseCallback) {
  65875. this.hydrationCallbacks = null;
  65876. }
  65877. }
  65878. function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {
  65879. var root = new FiberRootNode(containerInfo, tag, hydrate);
  65880. if (enableSuspenseCallback) {
  65881. root.hydrationCallbacks = hydrationCallbacks;
  65882. } // Cyclic construction. This cheats the type system right now because
  65883. // stateNode is any.
  65884. var uninitializedFiber = createHostRootFiber(tag);
  65885. root.current = uninitializedFiber;
  65886. uninitializedFiber.stateNode = root;
  65887. return root;
  65888. }
  65889. function isRootSuspendedAtTime(root, expirationTime) {
  65890. var firstSuspendedTime = root.firstSuspendedTime;
  65891. var lastSuspendedTime = root.lastSuspendedTime;
  65892. return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;
  65893. }
  65894. function markRootSuspendedAtTime(root, expirationTime) {
  65895. var firstSuspendedTime = root.firstSuspendedTime;
  65896. var lastSuspendedTime = root.lastSuspendedTime;
  65897. if (firstSuspendedTime < expirationTime) {
  65898. root.firstSuspendedTime = expirationTime;
  65899. }
  65900. if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {
  65901. root.lastSuspendedTime = expirationTime;
  65902. }
  65903. if (expirationTime <= root.lastPingedTime) {
  65904. root.lastPingedTime = NoWork;
  65905. }
  65906. if (expirationTime <= root.lastExpiredTime) {
  65907. root.lastExpiredTime = NoWork;
  65908. }
  65909. }
  65910. function markRootUpdatedAtTime(root, expirationTime) {
  65911. // Update the range of pending times
  65912. var firstPendingTime = root.firstPendingTime;
  65913. if (expirationTime > firstPendingTime) {
  65914. root.firstPendingTime = expirationTime;
  65915. } // Update the range of suspended times. Treat everything lower priority or
  65916. // equal to this update as unsuspended.
  65917. var firstSuspendedTime = root.firstSuspendedTime;
  65918. if (firstSuspendedTime !== NoWork) {
  65919. if (expirationTime >= firstSuspendedTime) {
  65920. // The entire suspended range is now unsuspended.
  65921. root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
  65922. } else if (expirationTime >= root.lastSuspendedTime) {
  65923. root.lastSuspendedTime = expirationTime + 1;
  65924. } // This is a pending level. Check if it's higher priority than the next
  65925. // known pending level.
  65926. if (expirationTime > root.nextKnownPendingLevel) {
  65927. root.nextKnownPendingLevel = expirationTime;
  65928. }
  65929. }
  65930. }
  65931. function markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) {
  65932. // Update the range of pending times
  65933. root.firstPendingTime = remainingExpirationTime; // Update the range of suspended times. Treat everything higher priority or
  65934. // equal to this update as unsuspended.
  65935. if (finishedExpirationTime <= root.lastSuspendedTime) {
  65936. // The entire suspended range is now unsuspended.
  65937. root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
  65938. } else if (finishedExpirationTime <= root.firstSuspendedTime) {
  65939. // Part of the suspended range is now unsuspended. Narrow the range to
  65940. // include everything between the unsuspended time (non-inclusive) and the
  65941. // last suspended time.
  65942. root.firstSuspendedTime = finishedExpirationTime - 1;
  65943. }
  65944. if (finishedExpirationTime <= root.lastPingedTime) {
  65945. // Clear the pinged time
  65946. root.lastPingedTime = NoWork;
  65947. }
  65948. if (finishedExpirationTime <= root.lastExpiredTime) {
  65949. // Clear the expired time
  65950. root.lastExpiredTime = NoWork;
  65951. }
  65952. }
  65953. function markRootExpiredAtTime(root, expirationTime) {
  65954. var lastExpiredTime = root.lastExpiredTime;
  65955. if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {
  65956. root.lastExpiredTime = expirationTime;
  65957. }
  65958. }
  65959. // This lets us hook into Fiber to debug what it's doing.
  65960. // See https://github.com/facebook/react/pull/8033.
  65961. // This is not part of the public API, not even for React DevTools.
  65962. // You may only inject a debugTool if you work on React Fiber itself.
  65963. var ReactFiberInstrumentation = {
  65964. debugTool: null
  65965. };
  65966. var ReactFiberInstrumentation_1 = ReactFiberInstrumentation;
  65967. var didWarnAboutNestedUpdates;
  65968. var didWarnAboutFindNodeInStrictMode;
  65969. {
  65970. didWarnAboutNestedUpdates = false;
  65971. didWarnAboutFindNodeInStrictMode = {};
  65972. }
  65973. function getContextForSubtree(parentComponent) {
  65974. if (!parentComponent) {
  65975. return emptyContextObject;
  65976. }
  65977. var fiber = get(parentComponent);
  65978. var parentContext = findCurrentUnmaskedContext(fiber);
  65979. if (fiber.tag === ClassComponent) {
  65980. var Component = fiber.type;
  65981. if (isContextProvider(Component)) {
  65982. return processChildContext(fiber, Component, parentContext);
  65983. }
  65984. }
  65985. return parentContext;
  65986. }
  65987. function findHostInstance(component) {
  65988. var fiber = get(component);
  65989. if (fiber === undefined) {
  65990. if (typeof component.render === 'function') {
  65991. {
  65992. {
  65993. throw Error("Unable to find node on an unmounted component.");
  65994. }
  65995. }
  65996. } else {
  65997. {
  65998. {
  65999. throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
  66000. }
  66001. }
  66002. }
  66003. }
  66004. var hostFiber = findCurrentHostFiber(fiber);
  66005. if (hostFiber === null) {
  66006. return null;
  66007. }
  66008. return hostFiber.stateNode;
  66009. }
  66010. function findHostInstanceWithWarning(component, methodName) {
  66011. {
  66012. var fiber = get(component);
  66013. if (fiber === undefined) {
  66014. if (typeof component.render === 'function') {
  66015. {
  66016. {
  66017. throw Error("Unable to find node on an unmounted component.");
  66018. }
  66019. }
  66020. } else {
  66021. {
  66022. {
  66023. throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
  66024. }
  66025. }
  66026. }
  66027. }
  66028. var hostFiber = findCurrentHostFiber(fiber);
  66029. if (hostFiber === null) {
  66030. return null;
  66031. }
  66032. if (hostFiber.mode & StrictMode) {
  66033. var componentName = getComponentName(fiber.type) || 'Component';
  66034. if (!didWarnAboutFindNodeInStrictMode[componentName]) {
  66035. didWarnAboutFindNodeInStrictMode[componentName] = true;
  66036. if (fiber.mode & StrictMode) {
  66037. warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
  66038. } else {
  66039. warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
  66040. }
  66041. }
  66042. }
  66043. return hostFiber.stateNode;
  66044. }
  66045. return findHostInstance(component);
  66046. }
  66047. function createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {
  66048. return createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks);
  66049. }
  66050. function updateContainer(element, container, parentComponent, callback) {
  66051. var current$$1 = container.current;
  66052. var currentTime = requestCurrentTimeForUpdate();
  66053. {
  66054. // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
  66055. if ('undefined' !== typeof jest) {
  66056. warnIfUnmockedScheduler(current$$1);
  66057. warnIfNotScopedWithMatchingAct(current$$1);
  66058. }
  66059. }
  66060. var suspenseConfig = requestCurrentSuspenseConfig();
  66061. var expirationTime = computeExpirationForFiber(currentTime, current$$1, suspenseConfig);
  66062. {
  66063. if (ReactFiberInstrumentation_1.debugTool) {
  66064. if (current$$1.alternate === null) {
  66065. ReactFiberInstrumentation_1.debugTool.onMountContainer(container);
  66066. } else if (element === null) {
  66067. ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);
  66068. } else {
  66069. ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);
  66070. }
  66071. }
  66072. }
  66073. var context = getContextForSubtree(parentComponent);
  66074. if (container.context === null) {
  66075. container.context = context;
  66076. } else {
  66077. container.pendingContext = context;
  66078. }
  66079. {
  66080. if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
  66081. didWarnAboutNestedUpdates = true;
  66082. warningWithoutStack$1(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
  66083. }
  66084. }
  66085. var update = createUpdate(expirationTime, suspenseConfig); // Caution: React DevTools currently depends on this property
  66086. // being called "element".
  66087. update.payload = {
  66088. element: element
  66089. };
  66090. callback = callback === undefined ? null : callback;
  66091. if (callback !== null) {
  66092. !(typeof callback === 'function') ? warningWithoutStack$1(false, 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback) : void 0;
  66093. update.callback = callback;
  66094. }
  66095. enqueueUpdate(current$$1, update);
  66096. scheduleWork(current$$1, expirationTime);
  66097. return expirationTime;
  66098. }
  66099. function getPublicRootInstance(container) {
  66100. var containerFiber = container.current;
  66101. if (!containerFiber.child) {
  66102. return null;
  66103. }
  66104. switch (containerFiber.child.tag) {
  66105. case HostComponent:
  66106. return getPublicInstance(containerFiber.child.stateNode);
  66107. default:
  66108. return containerFiber.child.stateNode;
  66109. }
  66110. }
  66111. function attemptSynchronousHydration$1(fiber) {
  66112. switch (fiber.tag) {
  66113. case HostRoot:
  66114. var root = fiber.stateNode;
  66115. if (root.hydrate) {
  66116. // Flush the first scheduled "update".
  66117. flushRoot(root, root.firstPendingTime);
  66118. }
  66119. break;
  66120. case SuspenseComponent:
  66121. flushSync(function () {
  66122. return scheduleWork(fiber, Sync);
  66123. }); // If we're still blocked after this, we need to increase
  66124. // the priority of any promises resolving within this
  66125. // boundary so that they next attempt also has higher pri.
  66126. var retryExpTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
  66127. markRetryTimeIfNotHydrated(fiber, retryExpTime);
  66128. break;
  66129. }
  66130. }
  66131. function markRetryTimeImpl(fiber, retryTime) {
  66132. var suspenseState = fiber.memoizedState;
  66133. if (suspenseState !== null && suspenseState.dehydrated !== null) {
  66134. if (suspenseState.retryTime < retryTime) {
  66135. suspenseState.retryTime = retryTime;
  66136. }
  66137. }
  66138. } // Increases the priority of thennables when they resolve within this boundary.
  66139. function markRetryTimeIfNotHydrated(fiber, retryTime) {
  66140. markRetryTimeImpl(fiber, retryTime);
  66141. var alternate = fiber.alternate;
  66142. if (alternate) {
  66143. markRetryTimeImpl(alternate, retryTime);
  66144. }
  66145. }
  66146. function attemptUserBlockingHydration$1(fiber) {
  66147. if (fiber.tag !== SuspenseComponent) {
  66148. // We ignore HostRoots here because we can't increase
  66149. // their priority and they should not suspend on I/O,
  66150. // since you have to wrap anything that might suspend in
  66151. // Suspense.
  66152. return;
  66153. }
  66154. var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
  66155. scheduleWork(fiber, expTime);
  66156. markRetryTimeIfNotHydrated(fiber, expTime);
  66157. }
  66158. function attemptContinuousHydration$1(fiber) {
  66159. if (fiber.tag !== SuspenseComponent) {
  66160. // We ignore HostRoots here because we can't increase
  66161. // their priority and they should not suspend on I/O,
  66162. // since you have to wrap anything that might suspend in
  66163. // Suspense.
  66164. return;
  66165. }
  66166. var expTime = computeContinuousHydrationExpiration(requestCurrentTimeForUpdate());
  66167. scheduleWork(fiber, expTime);
  66168. markRetryTimeIfNotHydrated(fiber, expTime);
  66169. }
  66170. function attemptHydrationAtCurrentPriority$1(fiber) {
  66171. if (fiber.tag !== SuspenseComponent) {
  66172. // We ignore HostRoots here because we can't increase
  66173. // their priority other than synchronously flush it.
  66174. return;
  66175. }
  66176. var currentTime = requestCurrentTimeForUpdate();
  66177. var expTime = computeExpirationForFiber(currentTime, fiber, null);
  66178. scheduleWork(fiber, expTime);
  66179. markRetryTimeIfNotHydrated(fiber, expTime);
  66180. }
  66181. function findHostInstanceWithNoPortals(fiber) {
  66182. var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
  66183. if (hostFiber === null) {
  66184. return null;
  66185. }
  66186. if (hostFiber.tag === FundamentalComponent) {
  66187. return hostFiber.stateNode.instance;
  66188. }
  66189. return hostFiber.stateNode;
  66190. }
  66191. var shouldSuspendImpl = function (fiber) {
  66192. return false;
  66193. };
  66194. function shouldSuspend(fiber) {
  66195. return shouldSuspendImpl(fiber);
  66196. }
  66197. var overrideHookState = null;
  66198. var overrideProps = null;
  66199. var scheduleUpdate = null;
  66200. var setSuspenseHandler = null;
  66201. {
  66202. var copyWithSetImpl = function (obj, path, idx, value) {
  66203. if (idx >= path.length) {
  66204. return value;
  66205. }
  66206. var key = path[idx];
  66207. var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here
  66208. updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
  66209. return updated;
  66210. };
  66211. var copyWithSet = function (obj, path, value) {
  66212. return copyWithSetImpl(obj, path, 0, value);
  66213. }; // Support DevTools editable values for useState and useReducer.
  66214. overrideHookState = function (fiber, id, path, value) {
  66215. // For now, the "id" of stateful hooks is just the stateful hook index.
  66216. // This may change in the future with e.g. nested hooks.
  66217. var currentHook = fiber.memoizedState;
  66218. while (currentHook !== null && id > 0) {
  66219. currentHook = currentHook.next;
  66220. id--;
  66221. }
  66222. if (currentHook !== null) {
  66223. var newState = copyWithSet(currentHook.memoizedState, path, value);
  66224. currentHook.memoizedState = newState;
  66225. currentHook.baseState = newState; // We aren't actually adding an update to the queue,
  66226. // because there is no update we can add for useReducer hooks that won't trigger an error.
  66227. // (There's no appropriate action type for DevTools overrides.)
  66228. // As a result though, React will see the scheduled update as a noop and bailout.
  66229. // Shallow cloning props works as a workaround for now to bypass the bailout check.
  66230. fiber.memoizedProps = _assign({}, fiber.memoizedProps);
  66231. scheduleWork(fiber, Sync);
  66232. }
  66233. }; // Support DevTools props for function components, forwardRef, memo, host components, etc.
  66234. overrideProps = function (fiber, path, value) {
  66235. fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
  66236. if (fiber.alternate) {
  66237. fiber.alternate.pendingProps = fiber.pendingProps;
  66238. }
  66239. scheduleWork(fiber, Sync);
  66240. };
  66241. scheduleUpdate = function (fiber) {
  66242. scheduleWork(fiber, Sync);
  66243. };
  66244. setSuspenseHandler = function (newShouldSuspendImpl) {
  66245. shouldSuspendImpl = newShouldSuspendImpl;
  66246. };
  66247. }
  66248. function injectIntoDevTools(devToolsConfig) {
  66249. var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  66250. var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
  66251. return injectInternals(_assign({}, devToolsConfig, {
  66252. overrideHookState: overrideHookState,
  66253. overrideProps: overrideProps,
  66254. setSuspenseHandler: setSuspenseHandler,
  66255. scheduleUpdate: scheduleUpdate,
  66256. currentDispatcherRef: ReactCurrentDispatcher,
  66257. findHostInstanceByFiber: function (fiber) {
  66258. var hostFiber = findCurrentHostFiber(fiber);
  66259. if (hostFiber === null) {
  66260. return null;
  66261. }
  66262. return hostFiber.stateNode;
  66263. },
  66264. findFiberByHostInstance: function (instance) {
  66265. if (!findFiberByHostInstance) {
  66266. // Might not be implemented by the renderer.
  66267. return null;
  66268. }
  66269. return findFiberByHostInstance(instance);
  66270. },
  66271. // React Refresh
  66272. findHostInstancesForRefresh: findHostInstancesForRefresh,
  66273. scheduleRefresh: scheduleRefresh,
  66274. scheduleRoot: scheduleRoot,
  66275. setRefreshHandler: setRefreshHandler,
  66276. // Enables DevTools to append owner stacks to error messages in DEV mode.
  66277. getCurrentFiber: function () {
  66278. return current;
  66279. }
  66280. }));
  66281. }
  66282. // This file intentionally does *not* have the Flow annotation.
  66283. // Don't add it. See `./inline-typed.js` for an explanation.
  66284. // TODO: This type is shared between the reconciler and ReactDOM, but will
  66285. // eventually be lifted out to the renderer.
  66286. function ReactDOMRoot(container, options) {
  66287. this._internalRoot = createRootImpl(container, ConcurrentRoot, options);
  66288. }
  66289. function ReactDOMBlockingRoot(container, tag, options) {
  66290. this._internalRoot = createRootImpl(container, tag, options);
  66291. }
  66292. ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children, callback) {
  66293. var root = this._internalRoot;
  66294. var cb = callback === undefined ? null : callback;
  66295. {
  66296. warnOnInvalidCallback(cb, 'render');
  66297. }
  66298. updateContainer(children, root, null, cb);
  66299. };
  66300. ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function (callback) {
  66301. var root = this._internalRoot;
  66302. var cb = callback === undefined ? null : callback;
  66303. {
  66304. warnOnInvalidCallback(cb, 'render');
  66305. }
  66306. var container = root.containerInfo;
  66307. updateContainer(null, root, null, function () {
  66308. unmarkContainerAsRoot(container);
  66309. if (cb !== null) {
  66310. cb();
  66311. }
  66312. });
  66313. };
  66314. function createRootImpl(container, tag, options) {
  66315. // Tag is either LegacyRoot or Concurrent Root
  66316. var hydrate = options != null && options.hydrate === true;
  66317. var hydrationCallbacks = options != null && options.hydrationOptions || null;
  66318. var root = createContainer(container, tag, hydrate, hydrationCallbacks);
  66319. markContainerAsRoot(root.current, container);
  66320. if (hydrate && tag !== LegacyRoot) {
  66321. var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;
  66322. eagerlyTrapReplayableEvents(doc);
  66323. }
  66324. return root;
  66325. }
  66326. function createRoot(container, options) {
  66327. if (!isValidContainer(container)) {
  66328. {
  66329. throw Error("createRoot(...): Target container is not a DOM element.");
  66330. }
  66331. }
  66332. warnIfReactDOMContainerInDEV(container);
  66333. return new ReactDOMRoot(container, options);
  66334. }
  66335. function createBlockingRoot(container, options) {
  66336. if (!isValidContainer(container)) {
  66337. {
  66338. throw Error("createRoot(...): Target container is not a DOM element.");
  66339. }
  66340. }
  66341. warnIfReactDOMContainerInDEV(container);
  66342. return new ReactDOMBlockingRoot(container, BlockingRoot, options);
  66343. }
  66344. function createLegacyRoot(container, options) {
  66345. return new ReactDOMBlockingRoot(container, LegacyRoot, options);
  66346. }
  66347. function isValidContainer(node) {
  66348. return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
  66349. }
  66350. function warnOnInvalidCallback(callback, callerName) {
  66351. {
  66352. !(callback === null || typeof callback === 'function') ? warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback) : void 0;
  66353. }
  66354. }
  66355. function warnIfReactDOMContainerInDEV(container) {
  66356. {
  66357. if (isContainerMarkedAsRoot(container)) {
  66358. if (container._reactRootContainer) {
  66359. warningWithoutStack$1(false, 'You are calling ReactDOM.createRoot() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.');
  66360. } else {
  66361. warningWithoutStack$1(false, 'You are calling ReactDOM.createRoot() on a container that ' + 'has already been passed to createRoot() before. Instead, call ' + 'root.render() on the existing root instead if you want to update it.');
  66362. }
  66363. }
  66364. }
  66365. }
  66366. var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
  66367. var topLevelUpdateWarnings;
  66368. var warnedAboutHydrateAPI = false;
  66369. {
  66370. topLevelUpdateWarnings = function (container) {
  66371. if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
  66372. var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
  66373. if (hostInstance) {
  66374. !(hostInstance.parentNode === container) ? warningWithoutStack$1(false, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.') : void 0;
  66375. }
  66376. }
  66377. var isRootRenderedBySomeReact = !!container._reactRootContainer;
  66378. var rootEl = getReactRootElementInContainer(container);
  66379. var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));
  66380. !(!hasNonRootReactChild || isRootRenderedBySomeReact) ? warningWithoutStack$1(false, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
  66381. !(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY') ? warningWithoutStack$1(false, 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
  66382. };
  66383. }
  66384. function getReactRootElementInContainer(container) {
  66385. if (!container) {
  66386. return null;
  66387. }
  66388. if (container.nodeType === DOCUMENT_NODE) {
  66389. return container.documentElement;
  66390. } else {
  66391. return container.firstChild;
  66392. }
  66393. }
  66394. function shouldHydrateDueToLegacyHeuristic(container) {
  66395. var rootElement = getReactRootElementInContainer(container);
  66396. return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
  66397. }
  66398. function legacyCreateRootFromDOMContainer(container, forceHydrate) {
  66399. var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.
  66400. if (!shouldHydrate) {
  66401. var warned = false;
  66402. var rootSibling;
  66403. while (rootSibling = container.lastChild) {
  66404. {
  66405. if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
  66406. warned = true;
  66407. warningWithoutStack$1(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
  66408. }
  66409. }
  66410. container.removeChild(rootSibling);
  66411. }
  66412. }
  66413. {
  66414. if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
  66415. warnedAboutHydrateAPI = true;
  66416. lowPriorityWarningWithoutStack$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
  66417. }
  66418. }
  66419. return createLegacyRoot(container, shouldHydrate ? {
  66420. hydrate: true
  66421. } : undefined);
  66422. }
  66423. function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
  66424. {
  66425. topLevelUpdateWarnings(container);
  66426. warnOnInvalidCallback(callback === undefined ? null : callback, 'render');
  66427. } // TODO: Without `any` type, Flow says "Property cannot be accessed on any
  66428. // member of intersection type." Whyyyyyy.
  66429. var root = container._reactRootContainer;
  66430. var fiberRoot;
  66431. if (!root) {
  66432. // Initial mount
  66433. root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
  66434. fiberRoot = root._internalRoot;
  66435. if (typeof callback === 'function') {
  66436. var originalCallback = callback;
  66437. callback = function () {
  66438. var instance = getPublicRootInstance(fiberRoot);
  66439. originalCallback.call(instance);
  66440. };
  66441. } // Initial mount should not be batched.
  66442. unbatchedUpdates(function () {
  66443. updateContainer(children, fiberRoot, parentComponent, callback);
  66444. });
  66445. } else {
  66446. fiberRoot = root._internalRoot;
  66447. if (typeof callback === 'function') {
  66448. var _originalCallback = callback;
  66449. callback = function () {
  66450. var instance = getPublicRootInstance(fiberRoot);
  66451. _originalCallback.call(instance);
  66452. };
  66453. } // Update
  66454. updateContainer(children, fiberRoot, parentComponent, callback);
  66455. }
  66456. return getPublicRootInstance(fiberRoot);
  66457. }
  66458. function findDOMNode(componentOrElement) {
  66459. {
  66460. var owner = ReactCurrentOwner$1.current;
  66461. if (owner !== null && owner.stateNode !== null) {
  66462. var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
  66463. !warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component') : void 0;
  66464. owner.stateNode._warnedAboutRefsInRender = true;
  66465. }
  66466. }
  66467. if (componentOrElement == null) {
  66468. return null;
  66469. }
  66470. if (componentOrElement.nodeType === ELEMENT_NODE) {
  66471. return componentOrElement;
  66472. }
  66473. {
  66474. return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
  66475. }
  66476. return findHostInstance(componentOrElement);
  66477. }
  66478. function hydrate(element, container, callback) {
  66479. if (!isValidContainer(container)) {
  66480. {
  66481. throw Error("Target container is not a DOM element.");
  66482. }
  66483. }
  66484. {
  66485. var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
  66486. if (isModernRoot) {
  66487. warningWithoutStack$1(false, 'You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');
  66488. }
  66489. } // TODO: throw or warn if we couldn't hydrate?
  66490. return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
  66491. }
  66492. function render(element, container, callback) {
  66493. if (!isValidContainer(container)) {
  66494. {
  66495. throw Error("Target container is not a DOM element.");
  66496. }
  66497. }
  66498. {
  66499. var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
  66500. if (isModernRoot) {
  66501. warningWithoutStack$1(false, 'You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');
  66502. }
  66503. }
  66504. return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
  66505. }
  66506. function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
  66507. if (!isValidContainer(containerNode)) {
  66508. {
  66509. throw Error("Target container is not a DOM element.");
  66510. }
  66511. }
  66512. if (!(parentComponent != null && has(parentComponent))) {
  66513. {
  66514. throw Error("parentComponent must be a valid React Component");
  66515. }
  66516. }
  66517. return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
  66518. }
  66519. function unmountComponentAtNode(container) {
  66520. if (!isValidContainer(container)) {
  66521. {
  66522. throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
  66523. }
  66524. }
  66525. {
  66526. var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
  66527. if (isModernRoot) {
  66528. warningWithoutStack$1(false, 'You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');
  66529. }
  66530. }
  66531. if (container._reactRootContainer) {
  66532. {
  66533. var rootEl = getReactRootElementInContainer(container);
  66534. var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
  66535. !!renderedByDifferentReact ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0;
  66536. } // Unmount should not be batched.
  66537. unbatchedUpdates(function () {
  66538. legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
  66539. container._reactRootContainer = null;
  66540. unmarkContainerAsRoot(container);
  66541. });
  66542. }); // If you call unmountComponentAtNode twice in quick succession, you'll
  66543. // get `true` twice. That's probably fine?
  66544. return true;
  66545. } else {
  66546. {
  66547. var _rootEl = getReactRootElementInContainer(container);
  66548. var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl)); // Check if the container itself is a React root node.
  66549. var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
  66550. !!hasNonRootReactChild ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
  66551. }
  66552. return false;
  66553. }
  66554. }
  66555. function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
  66556. implementation) {
  66557. var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  66558. return {
  66559. // This tag allow us to uniquely identify this as a React Portal
  66560. $$typeof: REACT_PORTAL_TYPE,
  66561. key: key == null ? null : '' + key,
  66562. children: children,
  66563. containerInfo: containerInfo,
  66564. implementation: implementation
  66565. };
  66566. }
  66567. // TODO: this is special because it gets imported during build.
  66568. var ReactVersion = '16.12.0';
  66569. setAttemptSynchronousHydration(attemptSynchronousHydration$1);
  66570. setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
  66571. setAttemptContinuousHydration(attemptContinuousHydration$1);
  66572. setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
  66573. var didWarnAboutUnstableCreatePortal = false;
  66574. {
  66575. if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype
  66576. Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype
  66577. Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
  66578. warningWithoutStack$1(false, 'React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  66579. }
  66580. }
  66581. setRestoreImplementation(restoreControlledState$$1);
  66582. setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
  66583. function createPortal$$1(children, container) {
  66584. var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  66585. if (!isValidContainer(container)) {
  66586. {
  66587. throw Error("Target container is not a DOM element.");
  66588. }
  66589. } // TODO: pass ReactDOM portal implementation as third argument
  66590. return createPortal$1(children, container, null, key);
  66591. }
  66592. var ReactDOM = {
  66593. createPortal: createPortal$$1,
  66594. // Legacy
  66595. findDOMNode: findDOMNode,
  66596. hydrate: hydrate,
  66597. render: render,
  66598. unstable_renderSubtreeIntoContainer: unstable_renderSubtreeIntoContainer,
  66599. unmountComponentAtNode: unmountComponentAtNode,
  66600. // Temporary alias since we already shipped React 16 RC with it.
  66601. // TODO: remove in React 17.
  66602. unstable_createPortal: function () {
  66603. if (!didWarnAboutUnstableCreatePortal) {
  66604. didWarnAboutUnstableCreatePortal = true;
  66605. lowPriorityWarningWithoutStack$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
  66606. }
  66607. return createPortal$$1.apply(void 0, arguments);
  66608. },
  66609. unstable_batchedUpdates: batchedUpdates$1,
  66610. flushSync: flushSync,
  66611. __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
  66612. // Keep in sync with ReactDOMUnstableNativeDependencies.js
  66613. // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.
  66614. Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injection.injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]
  66615. }
  66616. };
  66617. if (exposeConcurrentModeAPIs) {
  66618. ReactDOM.createRoot = createRoot;
  66619. ReactDOM.createBlockingRoot = createBlockingRoot;
  66620. ReactDOM.unstable_discreteUpdates = discreteUpdates$1;
  66621. ReactDOM.unstable_flushDiscreteUpdates = flushDiscreteUpdates;
  66622. ReactDOM.unstable_flushControlled = flushControlled;
  66623. ReactDOM.unstable_scheduleHydration = function (target) {
  66624. if (target) {
  66625. queueExplicitHydrationTarget(target);
  66626. }
  66627. };
  66628. }
  66629. var foundDevTools = injectIntoDevTools({
  66630. findFiberByHostInstance: getClosestInstanceFromNode,
  66631. bundleType: 1,
  66632. version: ReactVersion,
  66633. rendererPackageName: 'react-dom'
  66634. });
  66635. {
  66636. if (!foundDevTools && canUseDOM && window.top === window.self) {
  66637. // If we're in Chrome or Firefox, provide a download link if not installed.
  66638. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
  66639. var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.
  66640. if (/^(https?|file):$/.test(protocol)) {
  66641. console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
  66642. }
  66643. }
  66644. }
  66645. }
  66646. var ReactDOM$2 = Object.freeze({
  66647. default: ReactDOM
  66648. });
  66649. var ReactDOM$3 = ( ReactDOM$2 && ReactDOM ) || ReactDOM$2;
  66650. // TODO: decide on the top-level export form.
  66651. // This is hacky but makes it work with both Rollup and Jest.
  66652. var reactDom = ReactDOM$3.default || ReactDOM$3;
  66653. module.exports = reactDom;
  66654. })();
  66655. }
  66656. /***/ }),
  66657. /***/ "./node_modules/react-dom/index.js":
  66658. /*!*****************************************!*\
  66659. !*** ./node_modules/react-dom/index.js ***!
  66660. \*****************************************/
  66661. /*! no static exports found */
  66662. /***/ (function(module, exports, __webpack_require__) {
  66663. "use strict";
  66664. function checkDCE() {
  66665. /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  66666. if (
  66667. typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
  66668. typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  66669. ) {
  66670. return;
  66671. }
  66672. if (true) {
  66673. // This branch is unreachable because this function is only called
  66674. // in production, but the condition is true only in development.
  66675. // Therefore if the branch is still here, dead code elimination wasn't
  66676. // properly applied.
  66677. // Don't change the message. React DevTools relies on it. Also make sure
  66678. // this message doesn't occur elsewhere in this function, or it will cause
  66679. // a false positive.
  66680. throw new Error('^_^');
  66681. }
  66682. try {
  66683. // Verify that the code above has been dead code eliminated (DCE'd).
  66684. __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  66685. } catch (err) {
  66686. // DevTools shouldn't crash React, no matter what.
  66687. // We should still report in case we break this code.
  66688. console.error(err);
  66689. }
  66690. }
  66691. if (false) {} else {
  66692. module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ "./node_modules/react-dom/cjs/react-dom.development.js");
  66693. }
  66694. /***/ }),
  66695. /***/ "./node_modules/react-is/cjs/react-is.development.js":
  66696. /*!***********************************************************!*\
  66697. !*** ./node_modules/react-is/cjs/react-is.development.js ***!
  66698. \***********************************************************/
  66699. /*! no static exports found */
  66700. /***/ (function(module, exports, __webpack_require__) {
  66701. "use strict";
  66702. /** @license React v16.12.0
  66703. * react-is.development.js
  66704. *
  66705. * Copyright (c) Facebook, Inc. and its affiliates.
  66706. *
  66707. * This source code is licensed under the MIT license found in the
  66708. * LICENSE file in the root directory of this source tree.
  66709. */
  66710. if (true) {
  66711. (function() {
  66712. 'use strict';
  66713. Object.defineProperty(exports, '__esModule', { value: true });
  66714. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  66715. // nor polyfill, then a plain number is used for performance.
  66716. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  66717. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  66718. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  66719. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  66720. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  66721. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  66722. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  66723. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  66724. // (unstable) APIs that have been removed. Can we remove the symbols?
  66725. var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
  66726. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  66727. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  66728. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  66729. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  66730. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  66731. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  66732. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  66733. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  66734. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  66735. function isValidElementType(type) {
  66736. return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  66737. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
  66738. }
  66739. /**
  66740. * Forked from fbjs/warning:
  66741. * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
  66742. *
  66743. * Only change is we use console.warn instead of console.error,
  66744. * and do nothing when 'console' is not supported.
  66745. * This really simplifies the code.
  66746. * ---
  66747. * Similar to invariant but only logs a warning if the condition is not met.
  66748. * This can be used to log issues in development environments in critical
  66749. * paths. Removing the logging code for production environments will keep the
  66750. * same logic and follow the same code paths.
  66751. */
  66752. var lowPriorityWarningWithoutStack = function () {};
  66753. {
  66754. var printWarning = function (format) {
  66755. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  66756. args[_key - 1] = arguments[_key];
  66757. }
  66758. var argIndex = 0;
  66759. var message = 'Warning: ' + format.replace(/%s/g, function () {
  66760. return args[argIndex++];
  66761. });
  66762. if (typeof console !== 'undefined') {
  66763. console.warn(message);
  66764. }
  66765. try {
  66766. // --- Welcome to debugging React ---
  66767. // This error was thrown as a convenience so that you can use this stack
  66768. // to find the callsite that caused this warning to fire.
  66769. throw new Error(message);
  66770. } catch (x) {}
  66771. };
  66772. lowPriorityWarningWithoutStack = function (condition, format) {
  66773. if (format === undefined) {
  66774. throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  66775. }
  66776. if (!condition) {
  66777. for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  66778. args[_key2 - 2] = arguments[_key2];
  66779. }
  66780. printWarning.apply(void 0, [format].concat(args));
  66781. }
  66782. };
  66783. }
  66784. var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
  66785. function typeOf(object) {
  66786. if (typeof object === 'object' && object !== null) {
  66787. var $$typeof = object.$$typeof;
  66788. switch ($$typeof) {
  66789. case REACT_ELEMENT_TYPE:
  66790. var type = object.type;
  66791. switch (type) {
  66792. case REACT_ASYNC_MODE_TYPE:
  66793. case REACT_CONCURRENT_MODE_TYPE:
  66794. case REACT_FRAGMENT_TYPE:
  66795. case REACT_PROFILER_TYPE:
  66796. case REACT_STRICT_MODE_TYPE:
  66797. case REACT_SUSPENSE_TYPE:
  66798. return type;
  66799. default:
  66800. var $$typeofType = type && type.$$typeof;
  66801. switch ($$typeofType) {
  66802. case REACT_CONTEXT_TYPE:
  66803. case REACT_FORWARD_REF_TYPE:
  66804. case REACT_LAZY_TYPE:
  66805. case REACT_MEMO_TYPE:
  66806. case REACT_PROVIDER_TYPE:
  66807. return $$typeofType;
  66808. default:
  66809. return $$typeof;
  66810. }
  66811. }
  66812. case REACT_PORTAL_TYPE:
  66813. return $$typeof;
  66814. }
  66815. }
  66816. return undefined;
  66817. } // AsyncMode is deprecated along with isAsyncMode
  66818. var AsyncMode = REACT_ASYNC_MODE_TYPE;
  66819. var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  66820. var ContextConsumer = REACT_CONTEXT_TYPE;
  66821. var ContextProvider = REACT_PROVIDER_TYPE;
  66822. var Element = REACT_ELEMENT_TYPE;
  66823. var ForwardRef = REACT_FORWARD_REF_TYPE;
  66824. var Fragment = REACT_FRAGMENT_TYPE;
  66825. var Lazy = REACT_LAZY_TYPE;
  66826. var Memo = REACT_MEMO_TYPE;
  66827. var Portal = REACT_PORTAL_TYPE;
  66828. var Profiler = REACT_PROFILER_TYPE;
  66829. var StrictMode = REACT_STRICT_MODE_TYPE;
  66830. var Suspense = REACT_SUSPENSE_TYPE;
  66831. var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
  66832. function isAsyncMode(object) {
  66833. {
  66834. if (!hasWarnedAboutDeprecatedIsAsyncMode) {
  66835. hasWarnedAboutDeprecatedIsAsyncMode = true;
  66836. lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
  66837. }
  66838. }
  66839. return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
  66840. }
  66841. function isConcurrentMode(object) {
  66842. return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
  66843. }
  66844. function isContextConsumer(object) {
  66845. return typeOf(object) === REACT_CONTEXT_TYPE;
  66846. }
  66847. function isContextProvider(object) {
  66848. return typeOf(object) === REACT_PROVIDER_TYPE;
  66849. }
  66850. function isElement(object) {
  66851. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  66852. }
  66853. function isForwardRef(object) {
  66854. return typeOf(object) === REACT_FORWARD_REF_TYPE;
  66855. }
  66856. function isFragment(object) {
  66857. return typeOf(object) === REACT_FRAGMENT_TYPE;
  66858. }
  66859. function isLazy(object) {
  66860. return typeOf(object) === REACT_LAZY_TYPE;
  66861. }
  66862. function isMemo(object) {
  66863. return typeOf(object) === REACT_MEMO_TYPE;
  66864. }
  66865. function isPortal(object) {
  66866. return typeOf(object) === REACT_PORTAL_TYPE;
  66867. }
  66868. function isProfiler(object) {
  66869. return typeOf(object) === REACT_PROFILER_TYPE;
  66870. }
  66871. function isStrictMode(object) {
  66872. return typeOf(object) === REACT_STRICT_MODE_TYPE;
  66873. }
  66874. function isSuspense(object) {
  66875. return typeOf(object) === REACT_SUSPENSE_TYPE;
  66876. }
  66877. exports.typeOf = typeOf;
  66878. exports.AsyncMode = AsyncMode;
  66879. exports.ConcurrentMode = ConcurrentMode;
  66880. exports.ContextConsumer = ContextConsumer;
  66881. exports.ContextProvider = ContextProvider;
  66882. exports.Element = Element;
  66883. exports.ForwardRef = ForwardRef;
  66884. exports.Fragment = Fragment;
  66885. exports.Lazy = Lazy;
  66886. exports.Memo = Memo;
  66887. exports.Portal = Portal;
  66888. exports.Profiler = Profiler;
  66889. exports.StrictMode = StrictMode;
  66890. exports.Suspense = Suspense;
  66891. exports.isValidElementType = isValidElementType;
  66892. exports.isAsyncMode = isAsyncMode;
  66893. exports.isConcurrentMode = isConcurrentMode;
  66894. exports.isContextConsumer = isContextConsumer;
  66895. exports.isContextProvider = isContextProvider;
  66896. exports.isElement = isElement;
  66897. exports.isForwardRef = isForwardRef;
  66898. exports.isFragment = isFragment;
  66899. exports.isLazy = isLazy;
  66900. exports.isMemo = isMemo;
  66901. exports.isPortal = isPortal;
  66902. exports.isProfiler = isProfiler;
  66903. exports.isStrictMode = isStrictMode;
  66904. exports.isSuspense = isSuspense;
  66905. })();
  66906. }
  66907. /***/ }),
  66908. /***/ "./node_modules/react-is/index.js":
  66909. /*!****************************************!*\
  66910. !*** ./node_modules/react-is/index.js ***!
  66911. \****************************************/
  66912. /*! no static exports found */
  66913. /***/ (function(module, exports, __webpack_require__) {
  66914. "use strict";
  66915. if (false) {} else {
  66916. module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
  66917. }
  66918. /***/ }),
  66919. /***/ "./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js":
  66920. /*!****************************************************************************!*\
  66921. !*** ./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js ***!
  66922. \****************************************************************************/
  66923. /*! exports provided: polyfill */
  66924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66925. "use strict";
  66926. __webpack_require__.r(__webpack_exports__);
  66927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyfill", function() { return polyfill; });
  66928. /**
  66929. * Copyright (c) 2013-present, Facebook, Inc.
  66930. *
  66931. * This source code is licensed under the MIT license found in the
  66932. * LICENSE file in the root directory of this source tree.
  66933. */
  66934. function componentWillMount() {
  66935. // Call this.constructor.gDSFP to support sub-classes.
  66936. var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
  66937. if (state !== null && state !== undefined) {
  66938. this.setState(state);
  66939. }
  66940. }
  66941. function componentWillReceiveProps(nextProps) {
  66942. // Call this.constructor.gDSFP to support sub-classes.
  66943. // Use the setState() updater to ensure state isn't stale in certain edge cases.
  66944. function updater(prevState) {
  66945. var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
  66946. return state !== null && state !== undefined ? state : null;
  66947. }
  66948. // Binding "this" is important for shallow renderer support.
  66949. this.setState(updater.bind(this));
  66950. }
  66951. function componentWillUpdate(nextProps, nextState) {
  66952. try {
  66953. var prevProps = this.props;
  66954. var prevState = this.state;
  66955. this.props = nextProps;
  66956. this.state = nextState;
  66957. this.__reactInternalSnapshotFlag = true;
  66958. this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
  66959. prevProps,
  66960. prevState
  66961. );
  66962. } finally {
  66963. this.props = prevProps;
  66964. this.state = prevState;
  66965. }
  66966. }
  66967. // React may warn about cWM/cWRP/cWU methods being deprecated.
  66968. // Add a flag to suppress these warnings for this special case.
  66969. componentWillMount.__suppressDeprecationWarning = true;
  66970. componentWillReceiveProps.__suppressDeprecationWarning = true;
  66971. componentWillUpdate.__suppressDeprecationWarning = true;
  66972. function polyfill(Component) {
  66973. var prototype = Component.prototype;
  66974. if (!prototype || !prototype.isReactComponent) {
  66975. throw new Error('Can only polyfill class components');
  66976. }
  66977. if (
  66978. typeof Component.getDerivedStateFromProps !== 'function' &&
  66979. typeof prototype.getSnapshotBeforeUpdate !== 'function'
  66980. ) {
  66981. return Component;
  66982. }
  66983. // If new component APIs are defined, "unsafe" lifecycles won't be called.
  66984. // Error if any of these lifecycles are present,
  66985. // Because they would work differently between older and newer (16.3+) versions of React.
  66986. var foundWillMountName = null;
  66987. var foundWillReceivePropsName = null;
  66988. var foundWillUpdateName = null;
  66989. if (typeof prototype.componentWillMount === 'function') {
  66990. foundWillMountName = 'componentWillMount';
  66991. } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
  66992. foundWillMountName = 'UNSAFE_componentWillMount';
  66993. }
  66994. if (typeof prototype.componentWillReceiveProps === 'function') {
  66995. foundWillReceivePropsName = 'componentWillReceiveProps';
  66996. } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
  66997. foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
  66998. }
  66999. if (typeof prototype.componentWillUpdate === 'function') {
  67000. foundWillUpdateName = 'componentWillUpdate';
  67001. } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
  67002. foundWillUpdateName = 'UNSAFE_componentWillUpdate';
  67003. }
  67004. if (
  67005. foundWillMountName !== null ||
  67006. foundWillReceivePropsName !== null ||
  67007. foundWillUpdateName !== null
  67008. ) {
  67009. var componentName = Component.displayName || Component.name;
  67010. var newApiName =
  67011. typeof Component.getDerivedStateFromProps === 'function'
  67012. ? 'getDerivedStateFromProps()'
  67013. : 'getSnapshotBeforeUpdate()';
  67014. throw Error(
  67015. 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
  67016. componentName +
  67017. ' uses ' +
  67018. newApiName +
  67019. ' but also contains the following legacy lifecycles:' +
  67020. (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
  67021. (foundWillReceivePropsName !== null
  67022. ? '\n ' + foundWillReceivePropsName
  67023. : '') +
  67024. (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
  67025. '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
  67026. 'https://fb.me/react-async-component-lifecycle-hooks'
  67027. );
  67028. }
  67029. // React <= 16.2 does not support static getDerivedStateFromProps.
  67030. // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
  67031. // Newer versions of React will ignore these lifecycles if gDSFP exists.
  67032. if (typeof Component.getDerivedStateFromProps === 'function') {
  67033. prototype.componentWillMount = componentWillMount;
  67034. prototype.componentWillReceiveProps = componentWillReceiveProps;
  67035. }
  67036. // React <= 16.2 does not support getSnapshotBeforeUpdate.
  67037. // As a workaround, use cWU to invoke the new lifecycle.
  67038. // Newer versions of React will ignore that lifecycle if gSBU exists.
  67039. if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
  67040. if (typeof prototype.componentDidUpdate !== 'function') {
  67041. throw new Error(
  67042. 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
  67043. );
  67044. }
  67045. prototype.componentWillUpdate = componentWillUpdate;
  67046. var componentDidUpdate = prototype.componentDidUpdate;
  67047. prototype.componentDidUpdate = function componentDidUpdatePolyfill(
  67048. prevProps,
  67049. prevState,
  67050. maybeSnapshot
  67051. ) {
  67052. // 16.3+ will not execute our will-update method;
  67053. // It will pass a snapshot value to did-update though.
  67054. // Older versions will require our polyfilled will-update value.
  67055. // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
  67056. // Because for <= 15.x versions this might be a "prevContext" object.
  67057. // We also can't just check "__reactInternalSnapshot",
  67058. // Because get-snapshot might return a falsy value.
  67059. // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
  67060. var snapshot = this.__reactInternalSnapshotFlag
  67061. ? this.__reactInternalSnapshot
  67062. : maybeSnapshot;
  67063. componentDidUpdate.call(this, prevProps, prevState, snapshot);
  67064. };
  67065. }
  67066. return Component;
  67067. }
  67068. /***/ }),
  67069. /***/ "./node_modules/react-overlays/Dropdown.js":
  67070. /*!*************************************************!*\
  67071. !*** ./node_modules/react-overlays/Dropdown.js ***!
  67072. \*************************************************/
  67073. /*! no static exports found */
  67074. /***/ (function(module, exports, __webpack_require__) {
  67075. "use strict";
  67076. exports.__esModule = true;
  67077. exports.default = void 0;
  67078. var _matches = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/matches */ "./node_modules/dom-helpers/query/matches.js"));
  67079. var _querySelectorAll = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js"));
  67080. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  67081. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  67082. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  67083. var _uncontrollable = _interopRequireDefault(__webpack_require__(/*! uncontrollable */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/index.js"));
  67084. var Popper = _interopRequireWildcard(__webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/index.js"));
  67085. var _DropdownContext = _interopRequireDefault(__webpack_require__(/*! ./DropdownContext */ "./node_modules/react-overlays/DropdownContext.js"));
  67086. var _DropdownMenu = _interopRequireDefault(__webpack_require__(/*! ./DropdownMenu */ "./node_modules/react-overlays/DropdownMenu.js"));
  67087. var _DropdownToggle = _interopRequireDefault(__webpack_require__(/*! ./DropdownToggle */ "./node_modules/react-overlays/DropdownToggle.js"));
  67088. 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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
  67089. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  67090. function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  67091. function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  67092. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  67093. var propTypes = {
  67094. /**
  67095. * A render prop that returns the root dropdown element. The `props`
  67096. * argument should spread through to an element containing _both_ the
  67097. * menu and toggle in order to handle keyboard events for focus management.
  67098. *
  67099. * @type {Function ({
  67100. * props: {
  67101. * onKeyDown: (SyntheticEvent) => void,
  67102. * },
  67103. * }) => React.Element}
  67104. */
  67105. children: _propTypes.default.func.isRequired,
  67106. /**
  67107. * Determines the direction and location of the Menu in relation to it's Toggle.
  67108. */
  67109. drop: _propTypes.default.oneOf(['up', 'left', 'right', 'down']),
  67110. /**
  67111. * Controls the focus behavior for when the Dropdown is opened. Set to
  67112. * `true` to always focus the first menu item, `keyboard` to focus only when
  67113. * navigating via the keyboard, or `false` to disable completely
  67114. *
  67115. * The Default behavior is `false` **unless** the Menu has a `role="menu"`
  67116. * where it will default to `keyboard` to match the recommended [ARIA Authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton).
  67117. */
  67118. focusFirstItemOnShow: _propTypes.default.oneOf([false, true, 'keyboard']),
  67119. /**
  67120. * A css slector string that will return __focusable__ menu items.
  67121. * Selectors should be relative to the menu component:
  67122. * e.g. ` > li:not('.disabled')`
  67123. */
  67124. itemSelector: _propTypes.default.string.isRequired,
  67125. /**
  67126. * Align the menu to the 'end' side of the placement side of the Dropdown toggle. The default placement is `top-start` or `bottom-start`.
  67127. */
  67128. alignEnd: _propTypes.default.bool,
  67129. /**
  67130. * Whether or not the Dropdown is visible.
  67131. *
  67132. * @controllable onToggle
  67133. */
  67134. show: _propTypes.default.bool,
  67135. /**
  67136. * A callback fired when the Dropdown wishes to change visibility. Called with the requested
  67137. * `show` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`.
  67138. *
  67139. * ```js
  67140. * function(
  67141. * isOpen: boolean,
  67142. * event: SyntheticEvent,
  67143. * ): void
  67144. * ```
  67145. *
  67146. * @controllable show
  67147. */
  67148. onToggle: _propTypes.default.func
  67149. };
  67150. var defaultProps = {
  67151. itemSelector: '* > *'
  67152. };
  67153. /**
  67154. * `Dropdown` is set of structural components for building, accessible dropdown menus with close-on-click,
  67155. * keyboard navigation, and correct focus handling. As with all the react-overlay's
  67156. * components its BYOS (bring your own styles). Dropdown is primarily
  67157. * built from three base components, you should compose to build your Dropdowns.
  67158. *
  67159. * - `Dropdown`, which wraps the menu and toggle, and handles keyboard navigation
  67160. * - `Dropdown.Toggle` generally a button that triggers the menu opening
  67161. * - `Dropdown.Menu` The overlaid, menu, positioned to the toggle with PopperJs
  67162. */
  67163. var Dropdown =
  67164. /*#__PURE__*/
  67165. function (_React$Component) {
  67166. _inheritsLoose(Dropdown, _React$Component);
  67167. Dropdown.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
  67168. var drop = _ref.drop,
  67169. alignEnd = _ref.alignEnd,
  67170. show = _ref.show;
  67171. var lastShow = prevState.context.show;
  67172. return {
  67173. lastShow: lastShow,
  67174. context: _extends({}, prevState.context, {
  67175. drop: drop,
  67176. show: show,
  67177. alignEnd: alignEnd
  67178. })
  67179. };
  67180. };
  67181. function Dropdown(props, context) {
  67182. var _this;
  67183. _this = _React$Component.call(this, props, context) || this;
  67184. _this.handleClick = function (event) {
  67185. _this.toggleOpen(event);
  67186. };
  67187. _this.handleKeyDown = function (event) {
  67188. var key = event.key,
  67189. target = event.target; // Second only to https://github.com/twbs/bootstrap/blob/8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac/js/src/dropdown.js#L400
  67190. // in inscrutability
  67191. var isInput = /input|textarea/i.test(target.tagName);
  67192. if (isInput && (key === ' ' || key !== 'Escape' && _this.menu.contains(target))) {
  67193. return;
  67194. }
  67195. _this._lastSourceEvent = event.type;
  67196. switch (key) {
  67197. case 'ArrowUp':
  67198. {
  67199. var next = _this.getNextFocusedChild(target, -1);
  67200. if (next && next.focus) next.focus();
  67201. event.preventDefault();
  67202. return;
  67203. }
  67204. case 'ArrowDown':
  67205. event.preventDefault();
  67206. if (!_this.props.show) {
  67207. _this.toggleOpen(event);
  67208. } else {
  67209. var _next = _this.getNextFocusedChild(target, 1);
  67210. if (_next && _next.focus) _next.focus();
  67211. }
  67212. return;
  67213. case 'Escape':
  67214. case 'Tab':
  67215. _this.props.onToggle(false, event);
  67216. break;
  67217. default:
  67218. }
  67219. };
  67220. _this._focusInDropdown = false;
  67221. _this.menu = null;
  67222. _this.state = {
  67223. context: {
  67224. close: _this.handleClose,
  67225. toggle: _this.handleClick,
  67226. menuRef: function menuRef(r) {
  67227. _this.menu = r;
  67228. },
  67229. toggleRef: function toggleRef(r) {
  67230. var toggleNode = r && _reactDom.default.findDOMNode(r);
  67231. _this.setState(function (_ref2) {
  67232. var context = _ref2.context;
  67233. return {
  67234. context: _extends({}, context, {
  67235. toggleNode: toggleNode
  67236. })
  67237. };
  67238. });
  67239. }
  67240. }
  67241. };
  67242. return _this;
  67243. }
  67244. var _proto = Dropdown.prototype;
  67245. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  67246. var show = this.props.show;
  67247. var prevOpen = prevProps.show;
  67248. if (show && !prevOpen) {
  67249. this.maybeFocusFirst();
  67250. }
  67251. this._lastSourceEvent = null;
  67252. if (!show && prevOpen) {
  67253. // if focus hasn't already moved from the menu let's return it
  67254. // to the toggle
  67255. if (this._focusInDropdown) {
  67256. this._focusInDropdown = false;
  67257. this.focus();
  67258. }
  67259. }
  67260. };
  67261. _proto.getNextFocusedChild = function getNextFocusedChild(current, offset) {
  67262. if (!this.menu) return null;
  67263. var itemSelector = this.props.itemSelector;
  67264. var items = (0, _querySelectorAll.default)(this.menu, itemSelector);
  67265. var index = items.indexOf(current) + offset;
  67266. index = Math.max(0, Math.min(index, items.length));
  67267. return items[index];
  67268. };
  67269. _proto.hasMenuRole = function hasMenuRole() {
  67270. return this.menu && (0, _matches.default)(this.menu, '[role=menu]');
  67271. };
  67272. _proto.focus = function focus() {
  67273. var toggleNode = this.state.context.toggleNode;
  67274. if (toggleNode && toggleNode.focus) {
  67275. toggleNode.focus();
  67276. }
  67277. };
  67278. _proto.maybeFocusFirst = function maybeFocusFirst() {
  67279. var type = this._lastSourceEvent;
  67280. var focusFirstItemOnShow = this.props.focusFirstItemOnShow;
  67281. if (focusFirstItemOnShow == null) {
  67282. focusFirstItemOnShow = this.hasMenuRole() ? 'keyboard' : false;
  67283. }
  67284. if (focusFirstItemOnShow === false || focusFirstItemOnShow === 'keyboard' && !/^key.+$/.test(type)) {
  67285. return;
  67286. }
  67287. var itemSelector = this.props.itemSelector;
  67288. var first = (0, _querySelectorAll.default)(this.menu, itemSelector)[0];
  67289. if (first && first.focus) first.focus();
  67290. };
  67291. _proto.toggleOpen = function toggleOpen(event) {
  67292. var show = !this.props.show;
  67293. this.props.onToggle(show, event);
  67294. };
  67295. _proto.render = function render() {
  67296. var _this$props = this.props,
  67297. children = _this$props.children,
  67298. props = _objectWithoutPropertiesLoose(_this$props, ["children"]);
  67299. delete props.onToggle;
  67300. if (this.menu && this.state.lastShow && !this.props.show) {
  67301. this._focusInDropdown = this.menu.contains(document.activeElement);
  67302. }
  67303. return _react.default.createElement(_DropdownContext.default.Provider, {
  67304. value: this.state.context
  67305. }, _react.default.createElement(Popper.Manager, null, children({
  67306. props: {
  67307. onKeyDown: this.handleKeyDown
  67308. }
  67309. })));
  67310. };
  67311. return Dropdown;
  67312. }(_react.default.Component);
  67313. Dropdown.displayName = 'ReactOverlaysDropdown';
  67314. Dropdown.propTypes = propTypes;
  67315. Dropdown.defaultProps = defaultProps;
  67316. var UncontrolledDropdown = (0, _uncontrollable.default)(Dropdown, {
  67317. show: 'onToggle'
  67318. });
  67319. UncontrolledDropdown.Menu = _DropdownMenu.default;
  67320. UncontrolledDropdown.Toggle = _DropdownToggle.default;
  67321. var _default = UncontrolledDropdown;
  67322. exports.default = _default;
  67323. module.exports = exports.default;
  67324. /***/ }),
  67325. /***/ "./node_modules/react-overlays/DropdownContext.js":
  67326. /*!********************************************************!*\
  67327. !*** ./node_modules/react-overlays/DropdownContext.js ***!
  67328. \********************************************************/
  67329. /*! no static exports found */
  67330. /***/ (function(module, exports, __webpack_require__) {
  67331. "use strict";
  67332. exports.__esModule = true;
  67333. exports.default = void 0;
  67334. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  67335. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  67336. var DropdownContext = _react.default.createContext({
  67337. menuRef: function menuRef() {},
  67338. toggleRef: function toggleRef() {},
  67339. onToggle: function onToggle() {},
  67340. toggleNode: undefined,
  67341. alignEnd: null,
  67342. show: null,
  67343. drop: null
  67344. });
  67345. var _default = DropdownContext;
  67346. exports.default = _default;
  67347. module.exports = exports.default;
  67348. /***/ }),
  67349. /***/ "./node_modules/react-overlays/DropdownMenu.js":
  67350. /*!*****************************************************!*\
  67351. !*** ./node_modules/react-overlays/DropdownMenu.js ***!
  67352. \*****************************************************/
  67353. /*! no static exports found */
  67354. /***/ (function(module, exports, __webpack_require__) {
  67355. "use strict";
  67356. exports.__esModule = true;
  67357. exports.default = void 0;
  67358. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  67359. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  67360. var _reactPopper = __webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/index.js");
  67361. var _DropdownContext = _interopRequireDefault(__webpack_require__(/*! ./DropdownContext */ "./node_modules/react-overlays/DropdownContext.js"));
  67362. var _RootCloseWrapper = _interopRequireDefault(__webpack_require__(/*! ./RootCloseWrapper */ "./node_modules/react-overlays/RootCloseWrapper.js"));
  67363. var _mapContextToProps = _interopRequireDefault(__webpack_require__(/*! react-context-toolbox/mapContextToProps */ "./node_modules/react-context-toolbox/mapContextToProps.js"));
  67364. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  67365. function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  67366. function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  67367. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  67368. var DropdownMenu =
  67369. /*#__PURE__*/
  67370. function (_React$Component) {
  67371. _inheritsLoose(DropdownMenu, _React$Component);
  67372. function DropdownMenu() {
  67373. var _this;
  67374. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  67375. args[_key] = arguments[_key];
  67376. }
  67377. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  67378. _this.state = {
  67379. toggleId: null
  67380. };
  67381. _this.popperIsInitialized = false;
  67382. _this.handleClose = function (e) {
  67383. if (!_this.props.onToggle) return;
  67384. _this.props.onToggle(false, e);
  67385. };
  67386. return _this;
  67387. }
  67388. var _proto = DropdownMenu.prototype;
  67389. _proto.getSnapshotBeforeUpdate = function getSnapshotBeforeUpdate(prevProps) {
  67390. // If, to the best we can tell, this update won't reinitialize popper,
  67391. // manually schedule an update
  67392. var shouldUpdatePopper = !prevProps.show && this.props.show && this.popperIsInitialized && // a new reference node will already trigger this internally
  67393. prevProps.toggleNode === this.props.toggleNode;
  67394. if (this.props.show && this.props.usePopper && !this.popperIsInitialized) {
  67395. this.popperIsInitialized = true;
  67396. }
  67397. return !!shouldUpdatePopper;
  67398. };
  67399. _proto.componentDidUpdate = function componentDidUpdate(_, __, shouldUpdatePopper) {
  67400. if (shouldUpdatePopper && this.scheduleUpdate) {
  67401. this.scheduleUpdate();
  67402. }
  67403. };
  67404. _proto.render = function render() {
  67405. var _this2 = this;
  67406. var _this$props = this.props,
  67407. show = _this$props.show,
  67408. flip = _this$props.flip,
  67409. menuRef = _this$props.menuRef,
  67410. alignEnd = _this$props.alignEnd,
  67411. drop = _this$props.drop,
  67412. usePopper = _this$props.usePopper,
  67413. toggleNode = _this$props.toggleNode,
  67414. rootCloseEvent = _this$props.rootCloseEvent,
  67415. _this$props$popperCon = _this$props.popperConfig,
  67416. popperConfig = _this$props$popperCon === void 0 ? {} : _this$props$popperCon;
  67417. var placement = alignEnd ? 'bottom-end' : 'bottom-start';
  67418. if (drop === 'up') placement = alignEnd ? 'top-end' : 'top-start';
  67419. if (drop === 'right') placement = alignEnd ? 'right-end' : 'right-start';
  67420. if (drop === 'left') placement = alignEnd ? 'left-end' : 'left-start';
  67421. var menu = null;
  67422. var menuProps = {
  67423. ref: menuRef,
  67424. 'aria-labelledby': toggleNode && toggleNode.id
  67425. };
  67426. var childArgs = {
  67427. show: show,
  67428. alignEnd: alignEnd,
  67429. close: this.handleClose
  67430. };
  67431. if (!usePopper) {
  67432. menu = this.props.children(_extends({}, childArgs, {
  67433. props: menuProps
  67434. }));
  67435. } else if (this.popperIsInitialized || show) {
  67436. // Add it this way, so it doesn't override someones usage
  67437. // with react-poppers <Reference>
  67438. if (toggleNode) popperConfig.referenceElement = toggleNode;
  67439. menu = _react.default.createElement(_reactPopper.Popper, _extends({}, popperConfig, {
  67440. innerRef: menuRef,
  67441. placement: placement,
  67442. eventsEnabled: !!show,
  67443. modifiers: _extends({
  67444. flip: {
  67445. enabled: !!flip
  67446. }
  67447. }, popperConfig.modifiers)
  67448. }), function (_ref) {
  67449. var ref = _ref.ref,
  67450. style = _ref.style,
  67451. popper = _objectWithoutPropertiesLoose(_ref, ["ref", "style"]);
  67452. _this2.scheduleUpdate = popper.scheduleUpdate;
  67453. return _this2.props.children(_extends({}, popper, childArgs, {
  67454. props: _extends({}, menuProps, {
  67455. ref: ref,
  67456. style: style
  67457. })
  67458. }));
  67459. });
  67460. }
  67461. return menu && _react.default.createElement(_RootCloseWrapper.default, {
  67462. disabled: !show,
  67463. event: rootCloseEvent,
  67464. onRootClose: this.handleClose
  67465. }, menu);
  67466. };
  67467. return DropdownMenu;
  67468. }(_react.default.Component);
  67469. DropdownMenu.displayName = 'ReactOverlaysDropdownMenu';
  67470. DropdownMenu.propTypes = {
  67471. /**
  67472. * A render prop that returns a Menu element. The `props`
  67473. * argument should spread through to **a component that can accept a ref**.
  67474. *
  67475. * @type {Function ({
  67476. * show: boolean,
  67477. * alignEnd: boolean,
  67478. * close: (?SyntheticEvent) => void,
  67479. * placement: Placement,
  67480. * outOfBoundaries: ?boolean,
  67481. * scheduleUpdate: () => void,
  67482. * props: {
  67483. * ref: (?HTMLElement) => void,
  67484. * style: { [string]: string | number },
  67485. * aria-labelledby: ?string
  67486. * },
  67487. * arrowProps: {
  67488. * ref: (?HTMLElement) => void,
  67489. * style: { [string]: string | number },
  67490. * },
  67491. * }) => React.Element}
  67492. */
  67493. children: _propTypes.default.func.isRequired,
  67494. /**
  67495. * Controls the visible state of the menu, generally this is
  67496. * provided by the parent `Dropdown` component,
  67497. * but may also be specified as a prop directly.
  67498. */
  67499. show: _propTypes.default.bool,
  67500. /**
  67501. * Aligns the dropdown menu to the 'end' of it's placement position.
  67502. * Generally this is provided by the parent `Dropdown` component,
  67503. * but may also be specified as a prop directly.
  67504. */
  67505. alignEnd: _propTypes.default.bool,
  67506. /**
  67507. * Enables the Popper.js `flip` modifier, allowing the Dropdown to
  67508. * automatically adjust it's placement in case of overlap with the viewport or toggle.
  67509. * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info
  67510. */
  67511. flip: _propTypes.default.bool,
  67512. usePopper: _propTypes.default.oneOf([true, false]),
  67513. /**
  67514. * A set of popper options and props passed directly to react-popper's Popper component.
  67515. */
  67516. popperConfig: _propTypes.default.object,
  67517. /**
  67518. * Override the default event used by RootCloseWrapper.
  67519. */
  67520. rootCloseEvent: _propTypes.default.string,
  67521. /** @private */
  67522. onToggle: _propTypes.default.func,
  67523. /** @private */
  67524. menuRef: _propTypes.default.func,
  67525. /** @private */
  67526. drop: _propTypes.default.string,
  67527. /** @private */
  67528. toggleNode: _propTypes.default.any
  67529. };
  67530. DropdownMenu.defaultProps = {
  67531. usePopper: true
  67532. };
  67533. var DecoratedDropdownMenu = (0, _mapContextToProps.default)(_DropdownContext.default, function (_ref2, props) {
  67534. var show = _ref2.show,
  67535. alignEnd = _ref2.alignEnd,
  67536. toggle = _ref2.toggle,
  67537. drop = _ref2.drop,
  67538. menuRef = _ref2.menuRef,
  67539. toggleNode = _ref2.toggleNode;
  67540. return {
  67541. drop: drop,
  67542. menuRef: menuRef,
  67543. toggleNode: toggleNode,
  67544. onToggle: toggle,
  67545. show: show == null ? props.show : show,
  67546. alignEnd: alignEnd == null ? props.alignEnd : alignEnd
  67547. };
  67548. }, DropdownMenu);
  67549. var _default = DecoratedDropdownMenu;
  67550. exports.default = _default;
  67551. module.exports = exports.default;
  67552. /***/ }),
  67553. /***/ "./node_modules/react-overlays/DropdownToggle.js":
  67554. /*!*******************************************************!*\
  67555. !*** ./node_modules/react-overlays/DropdownToggle.js ***!
  67556. \*******************************************************/
  67557. /*! no static exports found */
  67558. /***/ (function(module, exports, __webpack_require__) {
  67559. "use strict";
  67560. exports.__esModule = true;
  67561. exports.default = void 0;
  67562. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  67563. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  67564. var _DropdownContext = _interopRequireDefault(__webpack_require__(/*! ./DropdownContext */ "./node_modules/react-overlays/DropdownContext.js"));
  67565. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  67566. var propTypes = {
  67567. /**
  67568. * A render prop that returns a Toggle element. The `props`
  67569. * argument should spread through to **a component that can accept a ref**. Use
  67570. * the `onToggle` argument to toggle the menu open or closed
  67571. *
  67572. * @type {Function ({
  67573. * show: boolean,
  67574. * toggle: (show: boolean) => void,
  67575. * props: {
  67576. * ref: (?HTMLElement) => void,
  67577. * aria-haspopup: true
  67578. * aria-expanded: boolean
  67579. * },
  67580. * }) => React.Element}
  67581. */
  67582. children: _propTypes.default.func.isRequired
  67583. };
  67584. function DropdownToggle(_ref) {
  67585. var children = _ref.children;
  67586. return _react.default.createElement(_DropdownContext.default.Consumer, null, function (_ref2) {
  67587. var show = _ref2.show,
  67588. toggle = _ref2.toggle,
  67589. toggleRef = _ref2.toggleRef;
  67590. return children({
  67591. show: show,
  67592. toggle: toggle,
  67593. props: {
  67594. ref: toggleRef,
  67595. 'aria-haspopup': true,
  67596. 'aria-expanded': !!show
  67597. }
  67598. });
  67599. });
  67600. }
  67601. DropdownToggle.displayName = 'ReactOverlaysDropdownToggle';
  67602. DropdownToggle.propTypes = propTypes;
  67603. var _default = DropdownToggle;
  67604. exports.default = _default;
  67605. module.exports = exports.default;
  67606. /***/ }),
  67607. /***/ "./node_modules/react-overlays/Modal.js":
  67608. /*!**********************************************!*\
  67609. !*** ./node_modules/react-overlays/Modal.js ***!
  67610. \**********************************************/
  67611. /*! no static exports found */
  67612. /***/ (function(module, exports, __webpack_require__) {
  67613. "use strict";
  67614. exports.__esModule = true;
  67615. exports.default = void 0;
  67616. var _activeElement = _interopRequireDefault(__webpack_require__(/*! dom-helpers/activeElement */ "./node_modules/dom-helpers/activeElement.js"));
  67617. var _contains = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"));
  67618. var _inDOM = _interopRequireDefault(__webpack_require__(/*! dom-helpers/util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  67619. var _listen = _interopRequireDefault(__webpack_require__(/*! dom-helpers/events/listen */ "./node_modules/dom-helpers/events/listen.js"));
  67620. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  67621. var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
  67622. var _elementType = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/elementType */ "./node_modules/prop-types-extra/lib/elementType.js"));
  67623. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  67624. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  67625. var _ModalManager = _interopRequireDefault(__webpack_require__(/*! ./ModalManager */ "./node_modules/react-overlays/ModalManager.js"));
  67626. var _Portal = _interopRequireDefault(__webpack_require__(/*! ./Portal */ "./node_modules/react-overlays/Portal.js"));
  67627. var _getContainer = _interopRequireDefault(__webpack_require__(/*! ./utils/getContainer */ "./node_modules/react-overlays/utils/getContainer.js"));
  67628. var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! ./utils/ownerDocument */ "./node_modules/react-overlays/utils/ownerDocument.js"));
  67629. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  67630. function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  67631. function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  67632. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  67633. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67634. var modalManager = new _ModalManager.default();
  67635. function omitProps(props, propTypes) {
  67636. var keys = Object.keys(props);
  67637. var newProps = {};
  67638. keys.map(function (prop) {
  67639. if (!Object.prototype.hasOwnProperty.call(propTypes, prop)) {
  67640. newProps[prop] = props[prop];
  67641. }
  67642. });
  67643. return newProps;
  67644. }
  67645. /**
  67646. * Love them or hate them, `<Modal />` provides a solid foundation for creating dialogs, lightboxes, or whatever else.
  67647. * The Modal component renders its `children` node in front of a backdrop component.
  67648. *
  67649. * The Modal offers a few helpful features over using just a `<Portal/>` component and some styles:
  67650. *
  67651. * - Manages dialog stacking when one-at-a-time just isn't enough.
  67652. * - Creates a backdrop, for disabling interaction below the modal.
  67653. * - It properly manages focus; moving to the modal content, and keeping it there until the modal is closed.
  67654. * - It disables scrolling of the page content while open.
  67655. * - Adds the appropriate ARIA roles are automatically.
  67656. * - Easily pluggable animations via a `<Transition/>` component.
  67657. *
  67658. * Note that, in the same way the backdrop element prevents users from clicking or interacting
  67659. * with the page content underneath the Modal, Screen readers also need to be signaled to not to
  67660. * interact with page content while the Modal is open. To do this, we use a common technique of applying
  67661. * the `aria-hidden='true'` attribute to the non-Modal elements in the Modal `container`. This means that for
  67662. * a Modal to be truly modal, it should have a `container` that is _outside_ your app's
  67663. * React hierarchy (such as the default: document.body).
  67664. */
  67665. var Modal =
  67666. /*#__PURE__*/
  67667. function (_React$Component) {
  67668. _inheritsLoose(Modal, _React$Component);
  67669. function Modal() {
  67670. var _this;
  67671. for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
  67672. _args[_key] = arguments[_key];
  67673. }
  67674. _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
  67675. _this.state = {
  67676. exited: !_this.props.show
  67677. };
  67678. _this.onPortalRendered = function () {
  67679. if (_this.props.onShow) {
  67680. _this.props.onShow();
  67681. } // autofocus after onShow, to not trigger a focus event for previous
  67682. // modals before this one is shown.
  67683. _this.autoFocus();
  67684. };
  67685. _this.onShow = function () {
  67686. var doc = (0, _ownerDocument.default)(_assertThisInitialized(_assertThisInitialized(_this)));
  67687. var container = (0, _getContainer.default)(_this.props.container, doc.body);
  67688. _this.props.manager.add(_assertThisInitialized(_assertThisInitialized(_this)), container, _this.props.containerClassName);
  67689. _this.removeKeydownListener = (0, _listen.default)(doc, 'keydown', _this.handleDocumentKeyDown);
  67690. _this.removeFocusListener = (0, _listen.default)(doc, 'focus', // the timeout is necessary b/c this will run before the new modal is mounted
  67691. // and so steals focus from it
  67692. function () {
  67693. return setTimeout(_this.enforceFocus);
  67694. }, true);
  67695. };
  67696. _this.onHide = function () {
  67697. _this.props.manager.remove(_assertThisInitialized(_assertThisInitialized(_this)));
  67698. _this.removeKeydownListener();
  67699. _this.removeFocusListener();
  67700. if (_this.props.restoreFocus) {
  67701. _this.restoreLastFocus();
  67702. }
  67703. };
  67704. _this.setDialogRef = function (ref) {
  67705. _this.dialog = ref;
  67706. };
  67707. _this.setBackdropRef = function (ref) {
  67708. _this.backdrop = ref && _reactDom.default.findDOMNode(ref);
  67709. };
  67710. _this.handleHidden = function () {
  67711. _this.setState({
  67712. exited: true
  67713. });
  67714. _this.onHide();
  67715. if (_this.props.onExited) {
  67716. var _this$props;
  67717. (_this$props = _this.props).onExited.apply(_this$props, arguments);
  67718. }
  67719. };
  67720. _this.handleBackdropClick = function (e) {
  67721. if (e.target !== e.currentTarget) {
  67722. return;
  67723. }
  67724. if (_this.props.onBackdropClick) {
  67725. _this.props.onBackdropClick(e);
  67726. }
  67727. if (_this.props.backdrop === true) {
  67728. _this.props.onHide();
  67729. }
  67730. };
  67731. _this.handleDocumentKeyDown = function (e) {
  67732. if (_this.props.keyboard && e.keyCode === 27 && _this.isTopModal()) {
  67733. if (_this.props.onEscapeKeyDown) {
  67734. _this.props.onEscapeKeyDown(e);
  67735. }
  67736. _this.props.onHide();
  67737. }
  67738. };
  67739. _this.enforceFocus = function () {
  67740. if (!_this.props.enforceFocus || !_this._isMounted || !_this.isTopModal()) {
  67741. return;
  67742. }
  67743. var currentActiveElement = (0, _activeElement.default)((0, _ownerDocument.default)(_assertThisInitialized(_assertThisInitialized(_this))));
  67744. if (_this.dialog && !(0, _contains.default)(_this.dialog, currentActiveElement)) {
  67745. _this.dialog.focus();
  67746. }
  67747. };
  67748. _this.renderBackdrop = function () {
  67749. var _this$props2 = _this.props,
  67750. renderBackdrop = _this$props2.renderBackdrop,
  67751. Transition = _this$props2.backdropTransition;
  67752. var backdrop = renderBackdrop({
  67753. ref: _this.setBackdropRef,
  67754. onClick: _this.handleBackdropClick
  67755. });
  67756. if (Transition) {
  67757. backdrop = _react.default.createElement(Transition, {
  67758. appear: true,
  67759. in: _this.props.show
  67760. }, backdrop);
  67761. }
  67762. return backdrop;
  67763. };
  67764. return _this;
  67765. }
  67766. Modal.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
  67767. if (nextProps.show) {
  67768. return {
  67769. exited: false
  67770. };
  67771. } else if (!nextProps.transition) {
  67772. // Otherwise let handleHidden take care of marking exited.
  67773. return {
  67774. exited: true
  67775. };
  67776. }
  67777. return null;
  67778. };
  67779. var _proto = Modal.prototype;
  67780. _proto.getSnapshotBeforeUpdate = function getSnapshotBeforeUpdate(prevProps) {
  67781. if (_inDOM.default && !prevProps.show && this.props.show) {
  67782. this.lastFocus = (0, _activeElement.default)();
  67783. }
  67784. return null;
  67785. };
  67786. _proto.componentDidMount = function componentDidMount() {
  67787. this._isMounted = true;
  67788. if (this.props.show) {
  67789. this.onShow();
  67790. }
  67791. };
  67792. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  67793. var transition = this.props.transition;
  67794. if (prevProps.show && !this.props.show && !transition) {
  67795. // Otherwise handleHidden will call this.
  67796. this.onHide();
  67797. } else if (!prevProps.show && this.props.show) {
  67798. this.onShow();
  67799. }
  67800. };
  67801. _proto.componentWillUnmount = function componentWillUnmount() {
  67802. var _this$props3 = this.props,
  67803. show = _this$props3.show,
  67804. transition = _this$props3.transition;
  67805. this._isMounted = false;
  67806. if (show || transition && !this.state.exited) {
  67807. this.onHide();
  67808. }
  67809. };
  67810. _proto.autoFocus = function autoFocus() {
  67811. if (!this.props.autoFocus) return;
  67812. var currentActiveElement = (0, _activeElement.default)((0, _ownerDocument.default)(this));
  67813. if (this.dialog && !(0, _contains.default)(this.dialog, currentActiveElement)) {
  67814. this.lastFocus = currentActiveElement;
  67815. this.dialog.focus();
  67816. }
  67817. };
  67818. _proto.restoreLastFocus = function restoreLastFocus() {
  67819. // Support: <=IE11 doesn't support `focus()` on svg elements (RB: #917)
  67820. if (this.lastFocus && this.lastFocus.focus) {
  67821. this.lastFocus.focus();
  67822. this.lastFocus = null;
  67823. }
  67824. };
  67825. _proto.isTopModal = function isTopModal() {
  67826. return this.props.manager.isTopModal(this);
  67827. };
  67828. _proto.render = function render() {
  67829. var _this$props4 = this.props,
  67830. show = _this$props4.show,
  67831. container = _this$props4.container,
  67832. children = _this$props4.children,
  67833. renderDialog = _this$props4.renderDialog,
  67834. _this$props4$role = _this$props4.role,
  67835. role = _this$props4$role === void 0 ? 'dialog' : _this$props4$role,
  67836. Transition = _this$props4.transition,
  67837. backdrop = _this$props4.backdrop,
  67838. className = _this$props4.className,
  67839. style = _this$props4.style,
  67840. onExit = _this$props4.onExit,
  67841. onExiting = _this$props4.onExiting,
  67842. onEnter = _this$props4.onEnter,
  67843. onEntering = _this$props4.onEntering,
  67844. onEntered = _this$props4.onEntered,
  67845. props = _objectWithoutPropertiesLoose(_this$props4, ["show", "container", "children", "renderDialog", "role", "transition", "backdrop", "className", "style", "onExit", "onExiting", "onEnter", "onEntering", "onEntered"]);
  67846. if (!(show || Transition && !this.state.exited)) {
  67847. return null;
  67848. }
  67849. var dialogProps = _extends({
  67850. role: role,
  67851. ref: this.setDialogRef,
  67852. // apparently only works on the dialog role element
  67853. 'aria-modal': role === 'dialog' ? true : undefined
  67854. }, omitProps(props, Modal.propTypes), {
  67855. style: style,
  67856. className: className,
  67857. tabIndex: '-1'
  67858. });
  67859. var dialog = renderDialog ? renderDialog(dialogProps) : _react.default.createElement("div", dialogProps, _react.default.cloneElement(children, {
  67860. role: 'document'
  67861. }));
  67862. if (Transition) {
  67863. dialog = _react.default.createElement(Transition, {
  67864. appear: true,
  67865. unmountOnExit: true,
  67866. in: show,
  67867. onExit: onExit,
  67868. onExiting: onExiting,
  67869. onExited: this.handleHidden,
  67870. onEnter: onEnter,
  67871. onEntering: onEntering,
  67872. onEntered: onEntered
  67873. }, dialog);
  67874. }
  67875. return _react.default.createElement(_Portal.default, {
  67876. container: container,
  67877. onRendered: this.onPortalRendered
  67878. }, _react.default.createElement(_react.default.Fragment, null, backdrop && this.renderBackdrop(), dialog));
  67879. };
  67880. return Modal;
  67881. }(_react.default.Component);
  67882. Modal.propTypes = {
  67883. /**
  67884. * Set the visibility of the Modal
  67885. */
  67886. show: _propTypes.default.bool,
  67887. /**
  67888. * A Node, Component instance, or function that returns either. The Modal is appended to it's container element.
  67889. *
  67890. * For the sake of assistive technologies, the container should usually be the document body, so that the rest of the
  67891. * page content can be placed behind a virtual backdrop as well as a visual one.
  67892. */
  67893. container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
  67894. /**
  67895. * A callback fired when the Modal is opening.
  67896. */
  67897. onShow: _propTypes.default.func,
  67898. /**
  67899. * A callback fired when either the backdrop is clicked, or the escape key is pressed.
  67900. *
  67901. * The `onHide` callback only signals intent from the Modal,
  67902. * you must actually set the `show` prop to `false` for the Modal to close.
  67903. */
  67904. onHide: _propTypes.default.func,
  67905. /**
  67906. * Include a backdrop component.
  67907. */
  67908. backdrop: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.oneOf(['static'])]),
  67909. /**
  67910. * A function that returns the dialog component. Useful for custom
  67911. * rendering. **Note:** the component should make sure to apply the provided ref.
  67912. *
  67913. * ```js
  67914. * renderDialog={props => <MyDialog {...props} />}
  67915. * ```
  67916. */
  67917. renderDialog: _propTypes.default.func,
  67918. /**
  67919. * A function that returns a backdrop component. Useful for custom
  67920. * backdrop rendering.
  67921. *
  67922. * ```js
  67923. * renderBackdrop={props => <MyBackdrop {...props} />}
  67924. * ```
  67925. */
  67926. renderBackdrop: _propTypes.default.func,
  67927. /**
  67928. * A callback fired when the escape key, if specified in `keyboard`, is pressed.
  67929. */
  67930. onEscapeKeyDown: _propTypes.default.func,
  67931. /**
  67932. * A callback fired when the backdrop, if specified, is clicked.
  67933. */
  67934. onBackdropClick: _propTypes.default.func,
  67935. /**
  67936. * A css class or set of classes applied to the modal container when the modal is open,
  67937. * and removed when it is closed.
  67938. */
  67939. containerClassName: _propTypes.default.string,
  67940. /**
  67941. * Close the modal when escape key is pressed
  67942. */
  67943. keyboard: _propTypes.default.bool,
  67944. /**
  67945. * A `react-transition-group@2.0.0` `<Transition/>` component used
  67946. * to control animations for the dialog component.
  67947. */
  67948. transition: _elementType.default,
  67949. /**
  67950. * A `react-transition-group@2.0.0` `<Transition/>` component used
  67951. * to control animations for the backdrop components.
  67952. */
  67953. backdropTransition: _elementType.default,
  67954. /**
  67955. * When `true` The modal will automatically shift focus to itself when it opens, and
  67956. * replace it to the last focused element when it closes. This also
  67957. * works correctly with any Modal children that have the `autoFocus` prop.
  67958. *
  67959. * Generally this should never be set to `false` as it makes the Modal less
  67960. * accessible to assistive technologies, like screen readers.
  67961. */
  67962. autoFocus: _propTypes.default.bool,
  67963. /**
  67964. * When `true` The modal will prevent focus from leaving the Modal while open.
  67965. *
  67966. * Generally this should never be set to `false` as it makes the Modal less
  67967. * accessible to assistive technologies, like screen readers.
  67968. */
  67969. enforceFocus: _propTypes.default.bool,
  67970. /**
  67971. * When `true` The modal will restore focus to previously focused element once
  67972. * modal is hidden
  67973. */
  67974. restoreFocus: _propTypes.default.bool,
  67975. /**
  67976. * Callback fired before the Modal transitions in
  67977. */
  67978. onEnter: _propTypes.default.func,
  67979. /**
  67980. * Callback fired as the Modal begins to transition in
  67981. */
  67982. onEntering: _propTypes.default.func,
  67983. /**
  67984. * Callback fired after the Modal finishes transitioning in
  67985. */
  67986. onEntered: _propTypes.default.func,
  67987. /**
  67988. * Callback fired right before the Modal transitions out
  67989. */
  67990. onExit: _propTypes.default.func,
  67991. /**
  67992. * Callback fired as the Modal begins to transition out
  67993. */
  67994. onExiting: _propTypes.default.func,
  67995. /**
  67996. * Callback fired after the Modal finishes transitioning out
  67997. */
  67998. onExited: _propTypes.default.func,
  67999. /**
  68000. * A ModalManager instance used to track and manage the state of open
  68001. * Modals. Useful when customizing how modals interact within a container
  68002. */
  68003. manager: _propTypes.default.object.isRequired
  68004. };
  68005. Modal.defaultProps = {
  68006. show: false,
  68007. role: 'dialog',
  68008. backdrop: true,
  68009. keyboard: true,
  68010. autoFocus: true,
  68011. enforceFocus: true,
  68012. restoreFocus: true,
  68013. onHide: function onHide() {},
  68014. manager: modalManager,
  68015. renderBackdrop: function renderBackdrop(props) {
  68016. return _react.default.createElement("div", props);
  68017. }
  68018. };
  68019. Modal.Manager = _ModalManager.default;
  68020. var _default = Modal;
  68021. exports.default = _default;
  68022. module.exports = exports.default;
  68023. /***/ }),
  68024. /***/ "./node_modules/react-overlays/ModalManager.js":
  68025. /*!*****************************************************!*\
  68026. !*** ./node_modules/react-overlays/ModalManager.js ***!
  68027. \*****************************************************/
  68028. /*! no static exports found */
  68029. /***/ (function(module, exports, __webpack_require__) {
  68030. "use strict";
  68031. exports.__esModule = true;
  68032. exports.default = void 0;
  68033. var _class = _interopRequireDefault(__webpack_require__(/*! dom-helpers/class */ "./node_modules/dom-helpers/class/index.js"));
  68034. var _style = _interopRequireDefault(__webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js"));
  68035. var _scrollbarSize = _interopRequireDefault(__webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js"));
  68036. var _isOverflowing = _interopRequireDefault(__webpack_require__(/*! ./utils/isOverflowing */ "./node_modules/react-overlays/utils/isOverflowing.js"));
  68037. var _manageAriaHidden = __webpack_require__(/*! ./utils/manageAriaHidden */ "./node_modules/react-overlays/utils/manageAriaHidden.js");
  68038. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68039. function findIndexOf(arr, cb) {
  68040. var idx = -1;
  68041. arr.some(function (d, i) {
  68042. if (cb(d, i)) {
  68043. idx = i;
  68044. return true;
  68045. }
  68046. });
  68047. return idx;
  68048. }
  68049. /**
  68050. * Proper state managment for containers and the modals in those containers.
  68051. *
  68052. * @internal Used by the Modal to ensure proper styling of containers.
  68053. */
  68054. var ModalManager =
  68055. /*#__PURE__*/
  68056. function () {
  68057. function ModalManager(_temp) {
  68058. var _ref = _temp === void 0 ? {} : _temp,
  68059. _ref$hideSiblingNodes = _ref.hideSiblingNodes,
  68060. hideSiblingNodes = _ref$hideSiblingNodes === void 0 ? true : _ref$hideSiblingNodes,
  68061. _ref$handleContainerO = _ref.handleContainerOverflow,
  68062. handleContainerOverflow = _ref$handleContainerO === void 0 ? true : _ref$handleContainerO;
  68063. this.hideSiblingNodes = hideSiblingNodes;
  68064. this.handleContainerOverflow = handleContainerOverflow;
  68065. this.modals = [];
  68066. this.containers = [];
  68067. this.data = [];
  68068. this.scrollbarSize = (0, _scrollbarSize.default)();
  68069. }
  68070. var _proto = ModalManager.prototype;
  68071. _proto.isContainerOverflowing = function isContainerOverflowing(modal) {
  68072. var data = this.data[this.containerIndexFromModal(modal)];
  68073. return data && data.overflowing;
  68074. };
  68075. _proto.containerIndexFromModal = function containerIndexFromModal(modal) {
  68076. return findIndexOf(this.data, function (d) {
  68077. return d.modals.indexOf(modal) !== -1;
  68078. });
  68079. };
  68080. _proto.setContainerStyle = function setContainerStyle(containerState, container) {
  68081. var style = {
  68082. overflow: 'hidden' // we are only interested in the actual `style` here
  68083. // becasue we will override it
  68084. };
  68085. containerState.style = {
  68086. overflow: container.style.overflow,
  68087. paddingRight: container.style.paddingRight
  68088. };
  68089. if (containerState.overflowing) {
  68090. // use computed style, here to get the real padding
  68091. // to add our scrollbar width
  68092. style.paddingRight = parseInt((0, _style.default)(container, 'paddingRight') || 0, 10) + this.scrollbarSize + "px";
  68093. }
  68094. (0, _style.default)(container, style);
  68095. };
  68096. _proto.removeContainerStyle = function removeContainerStyle(containerState, container) {
  68097. var style = containerState.style;
  68098. Object.keys(style).forEach(function (key) {
  68099. container.style[key] = style[key];
  68100. });
  68101. };
  68102. _proto.add = function add(modal, container, className) {
  68103. var modalIdx = this.modals.indexOf(modal);
  68104. var containerIdx = this.containers.indexOf(container);
  68105. if (modalIdx !== -1) {
  68106. return modalIdx;
  68107. }
  68108. modalIdx = this.modals.length;
  68109. this.modals.push(modal);
  68110. if (this.hideSiblingNodes) {
  68111. (0, _manageAriaHidden.hideSiblings)(container, modal);
  68112. }
  68113. if (containerIdx !== -1) {
  68114. this.data[containerIdx].modals.push(modal);
  68115. return modalIdx;
  68116. }
  68117. var data = {
  68118. modals: [modal],
  68119. //right now only the first modal of a container will have its classes applied
  68120. classes: className ? className.split(/\s+/) : [],
  68121. overflowing: (0, _isOverflowing.default)(container)
  68122. };
  68123. if (this.handleContainerOverflow) {
  68124. this.setContainerStyle(data, container);
  68125. }
  68126. data.classes.forEach(_class.default.addClass.bind(null, container));
  68127. this.containers.push(container);
  68128. this.data.push(data);
  68129. return modalIdx;
  68130. };
  68131. _proto.remove = function remove(modal) {
  68132. var modalIdx = this.modals.indexOf(modal);
  68133. if (modalIdx === -1) {
  68134. return;
  68135. }
  68136. var containerIdx = this.containerIndexFromModal(modal);
  68137. var data = this.data[containerIdx];
  68138. var container = this.containers[containerIdx];
  68139. data.modals.splice(data.modals.indexOf(modal), 1);
  68140. this.modals.splice(modalIdx, 1); // if that was the last modal in a container,
  68141. // clean up the container
  68142. if (data.modals.length === 0) {
  68143. data.classes.forEach(_class.default.removeClass.bind(null, container));
  68144. if (this.handleContainerOverflow) {
  68145. this.removeContainerStyle(data, container);
  68146. }
  68147. if (this.hideSiblingNodes) {
  68148. (0, _manageAriaHidden.showSiblings)(container, modal);
  68149. }
  68150. this.containers.splice(containerIdx, 1);
  68151. this.data.splice(containerIdx, 1);
  68152. } else if (this.hideSiblingNodes) {
  68153. //otherwise make sure the next top modal is visible to a SR
  68154. var _data$modals = data.modals[data.modals.length - 1],
  68155. backdrop = _data$modals.backdrop,
  68156. dialog = _data$modals.dialog;
  68157. (0, _manageAriaHidden.ariaHidden)(false, dialog);
  68158. (0, _manageAriaHidden.ariaHidden)(false, backdrop);
  68159. }
  68160. };
  68161. _proto.isTopModal = function isTopModal(modal) {
  68162. return !!this.modals.length && this.modals[this.modals.length - 1] === modal;
  68163. };
  68164. return ModalManager;
  68165. }();
  68166. var _default = ModalManager;
  68167. exports.default = _default;
  68168. module.exports = exports.default;
  68169. /***/ }),
  68170. /***/ "./node_modules/react-overlays/Overlay.js":
  68171. /*!************************************************!*\
  68172. !*** ./node_modules/react-overlays/Overlay.js ***!
  68173. \************************************************/
  68174. /*! no static exports found */
  68175. /***/ (function(module, exports, __webpack_require__) {
  68176. "use strict";
  68177. exports.__esModule = true;
  68178. exports.default = void 0;
  68179. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  68180. var _elementType = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/elementType */ "./node_modules/prop-types-extra/lib/elementType.js"));
  68181. var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
  68182. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  68183. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  68184. var _Portal = _interopRequireDefault(__webpack_require__(/*! ./Portal */ "./node_modules/react-overlays/Portal.js"));
  68185. var _RootCloseWrapper = _interopRequireDefault(__webpack_require__(/*! ./RootCloseWrapper */ "./node_modules/react-overlays/RootCloseWrapper.js"));
  68186. var _reactPopper = __webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/index.js");
  68187. var _forwardRef = _interopRequireDefault(__webpack_require__(/*! react-context-toolbox/forwardRef */ "./node_modules/react-context-toolbox/forwardRef.js"));
  68188. var _WaitForContainer = _interopRequireDefault(__webpack_require__(/*! ./WaitForContainer */ "./node_modules/react-overlays/WaitForContainer.js"));
  68189. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68190. function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  68191. function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  68192. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  68193. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68194. /**
  68195. * Built on top of `<Position/>` and `<Portal/>`, the overlay component is
  68196. * great for custom tooltip overlays.
  68197. */
  68198. var Overlay =
  68199. /*#__PURE__*/
  68200. function (_React$Component) {
  68201. _inheritsLoose(Overlay, _React$Component);
  68202. function Overlay(props, context) {
  68203. var _this;
  68204. _this = _React$Component.call(this, props, context) || this;
  68205. _this.handleHidden = function () {
  68206. _this.setState({
  68207. exited: true
  68208. });
  68209. if (_this.props.onExited) {
  68210. var _this$props;
  68211. (_this$props = _this.props).onExited.apply(_this$props, arguments);
  68212. }
  68213. };
  68214. _this.state = {
  68215. exited: !props.show
  68216. };
  68217. _this.onHiddenListener = _this.handleHidden.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  68218. _this._lastTarget = null;
  68219. return _this;
  68220. }
  68221. Overlay.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
  68222. if (nextProps.show) {
  68223. return {
  68224. exited: false
  68225. };
  68226. } else if (!nextProps.transition) {
  68227. // Otherwise let handleHidden take care of marking exited.
  68228. return {
  68229. exited: true
  68230. };
  68231. }
  68232. return null;
  68233. };
  68234. var _proto = Overlay.prototype;
  68235. _proto.componentDidMount = function componentDidMount() {
  68236. this.setState({
  68237. target: this.getTarget()
  68238. });
  68239. };
  68240. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  68241. if (this.props === prevProps) return;
  68242. var target = this.getTarget();
  68243. if (target !== this.state.target) {
  68244. this.setState({
  68245. target: target
  68246. });
  68247. }
  68248. };
  68249. _proto.getTarget = function getTarget() {
  68250. var target = this.props.target;
  68251. target = typeof target === 'function' ? target() : target;
  68252. return target && _reactDom.default.findDOMNode(target) || null;
  68253. };
  68254. _proto.render = function render() {
  68255. var _this2 = this;
  68256. var _this$props2 = this.props,
  68257. _0 = _this$props2.target,
  68258. container = _this$props2.container,
  68259. containerPadding = _this$props2.containerPadding,
  68260. placement = _this$props2.placement,
  68261. rootClose = _this$props2.rootClose,
  68262. children = _this$props2.children,
  68263. flip = _this$props2.flip,
  68264. _this$props2$popperCo = _this$props2.popperConfig,
  68265. popperConfig = _this$props2$popperCo === void 0 ? {} : _this$props2$popperCo,
  68266. Transition = _this$props2.transition,
  68267. props = _objectWithoutPropertiesLoose(_this$props2, ["target", "container", "containerPadding", "placement", "rootClose", "children", "flip", "popperConfig", "transition"]);
  68268. var target = this.state.target; // Don't un-render the overlay while it's transitioning out.
  68269. var mountOverlay = props.show || Transition && !this.state.exited;
  68270. if (!mountOverlay) {
  68271. // Don't bother showing anything if we don't have to.
  68272. return null;
  68273. }
  68274. var child = children;
  68275. var _popperConfig$modifie = popperConfig.modifiers,
  68276. modifiers = _popperConfig$modifie === void 0 ? {} : _popperConfig$modifie;
  68277. var popperProps = _extends({}, popperConfig, {
  68278. placement: placement,
  68279. referenceElement: target,
  68280. enableEvents: props.show,
  68281. modifiers: _extends({}, modifiers, {
  68282. preventOverflow: _extends({
  68283. padding: containerPadding || 5
  68284. }, modifiers.preventOverflow),
  68285. flip: _extends({
  68286. enabled: !!flip
  68287. }, modifiers.preventOverflow)
  68288. })
  68289. });
  68290. child = _react.default.createElement(_reactPopper.Popper, popperProps, function (_ref) {
  68291. var arrowProps = _ref.arrowProps,
  68292. style = _ref.style,
  68293. ref = _ref.ref,
  68294. popper = _objectWithoutPropertiesLoose(_ref, ["arrowProps", "style", "ref"]);
  68295. _this2.popper = popper;
  68296. var innerChild = _this2.props.children(_extends({}, popper, {
  68297. // popper doesn't set the initial placement
  68298. placement: popper.placement || placement,
  68299. show: props.show,
  68300. arrowProps: arrowProps,
  68301. props: {
  68302. ref: ref,
  68303. style: style
  68304. }
  68305. }));
  68306. if (Transition) {
  68307. var onExit = props.onExit,
  68308. onExiting = props.onExiting,
  68309. onEnter = props.onEnter,
  68310. onEntering = props.onEntering,
  68311. onEntered = props.onEntered;
  68312. innerChild = _react.default.createElement(Transition, {
  68313. in: props.show,
  68314. appear: true,
  68315. onExit: onExit,
  68316. onExiting: onExiting,
  68317. onExited: _this2.onHiddenListener,
  68318. onEnter: onEnter,
  68319. onEntering: onEntering,
  68320. onEntered: onEntered
  68321. }, innerChild);
  68322. }
  68323. return innerChild;
  68324. });
  68325. if (rootClose) {
  68326. child = _react.default.createElement(_RootCloseWrapper.default, {
  68327. onRootClose: props.onHide,
  68328. event: props.rootCloseEvent,
  68329. disabled: props.rootCloseDisabled
  68330. }, child);
  68331. }
  68332. return _react.default.createElement(_Portal.default, {
  68333. container: container
  68334. }, child);
  68335. };
  68336. return Overlay;
  68337. }(_react.default.Component);
  68338. Overlay.propTypes = _extends({}, _Portal.default.propTypes, {
  68339. /**
  68340. * Set the visibility of the Overlay
  68341. */
  68342. show: _propTypes.default.bool,
  68343. /** Specify where the overlay element is positioned in relation to the target element */
  68344. placement: _propTypes.default.oneOf(_reactPopper.placements),
  68345. /**
  68346. * A Node, Component instance, or function that returns either. The `container` will have the Portal children
  68347. * appended to it.
  68348. */
  68349. container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
  68350. /**
  68351. * Enables the Popper.js `flip` modifier, allowing the Overlay to
  68352. * automatically adjust it's placement in case of overlap with the viewport or toggle.
  68353. * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info
  68354. */
  68355. flip: _propTypes.default.bool,
  68356. /**
  68357. * A render prop that returns an element to overlay and position. See
  68358. * the [react-popper documentation](https://github.com/FezVrasta/react-popper#children) for more info.
  68359. *
  68360. * @type {Function ({
  68361. * show: boolean,
  68362. * placement: Placement,
  68363. * outOfBoundaries: ?boolean,
  68364. * scheduleUpdate: () => void,
  68365. * props: {
  68366. * ref: (?HTMLElement) => void,
  68367. * style: { [string]: string | number },
  68368. * aria-labelledby: ?string
  68369. * },
  68370. * arrowProps: {
  68371. * ref: (?HTMLElement) => void,
  68372. * style: { [string]: string | number },
  68373. * },
  68374. * }) => React.Element}
  68375. */
  68376. children: _propTypes.default.func.isRequired,
  68377. /**
  68378. * A set of popper options and props passed directly to react-popper's Popper component.
  68379. */
  68380. popperConfig: _propTypes.default.object,
  68381. /**
  68382. * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay
  68383. */
  68384. rootClose: _propTypes.default.bool,
  68385. /**
  68386. * Specify event for toggling overlay
  68387. */
  68388. rootCloseEvent: _RootCloseWrapper.default.propTypes.event,
  68389. /**
  68390. * Specify disabled for disable RootCloseWrapper
  68391. */
  68392. rootCloseDisabled: _RootCloseWrapper.default.propTypes.disabled,
  68393. /**
  68394. * A Callback fired by the Overlay when it wishes to be hidden.
  68395. *
  68396. * __required__ when `rootClose` is `true`.
  68397. *
  68398. * @type func
  68399. */
  68400. onHide: function onHide(props) {
  68401. var propType = _propTypes.default.func;
  68402. if (props.rootClose) {
  68403. propType = propType.isRequired;
  68404. }
  68405. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  68406. args[_key - 1] = arguments[_key];
  68407. }
  68408. return propType.apply(void 0, [props].concat(args));
  68409. },
  68410. /**
  68411. * A `react-transition-group@2.0.0` `<Transition/>` component
  68412. * used to animate the overlay as it changes visibility.
  68413. */
  68414. transition: _elementType.default,
  68415. /**
  68416. * Callback fired before the Overlay transitions in
  68417. */
  68418. onEnter: _propTypes.default.func,
  68419. /**
  68420. * Callback fired as the Overlay begins to transition in
  68421. */
  68422. onEntering: _propTypes.default.func,
  68423. /**
  68424. * Callback fired after the Overlay finishes transitioning in
  68425. */
  68426. onEntered: _propTypes.default.func,
  68427. /**
  68428. * Callback fired right before the Overlay transitions out
  68429. */
  68430. onExit: _propTypes.default.func,
  68431. /**
  68432. * Callback fired as the Overlay begins to transition out
  68433. */
  68434. onExiting: _propTypes.default.func,
  68435. /**
  68436. * Callback fired after the Overlay finishes transitioning out
  68437. */
  68438. onExited: _propTypes.default.func
  68439. });
  68440. var _default = (0, _forwardRef.default)(function (props, ref) {
  68441. return (// eslint-disable-next-line react/prop-types
  68442. _react.default.createElement(_WaitForContainer.default, {
  68443. container: props.container
  68444. }, function (container) {
  68445. return _react.default.createElement(Overlay, _extends({}, props, {
  68446. ref: ref,
  68447. container: container
  68448. }));
  68449. })
  68450. );
  68451. }, {
  68452. displayName: 'withContainer(Overlay)'
  68453. });
  68454. exports.default = _default;
  68455. module.exports = exports.default;
  68456. /***/ }),
  68457. /***/ "./node_modules/react-overlays/Portal.js":
  68458. /*!***********************************************!*\
  68459. !*** ./node_modules/react-overlays/Portal.js ***!
  68460. \***********************************************/
  68461. /*! no static exports found */
  68462. /***/ (function(module, exports, __webpack_require__) {
  68463. "use strict";
  68464. exports.__esModule = true;
  68465. exports.default = void 0;
  68466. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  68467. var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
  68468. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  68469. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  68470. var _WaitForContainer = _interopRequireDefault(__webpack_require__(/*! ./WaitForContainer */ "./node_modules/react-overlays/WaitForContainer.js"));
  68471. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68472. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  68473. /**
  68474. * The `<Portal/>` component renders its children into a new "subtree" outside of current component hierarchy.
  68475. * You can think of it as a declarative `appendChild()`, or jQuery's `$.fn.appendTo()`.
  68476. * The children of `<Portal/>` component will be appended to the `container` specified.
  68477. */
  68478. var Portal =
  68479. /*#__PURE__*/
  68480. function (_React$Component) {
  68481. _inheritsLoose(Portal, _React$Component);
  68482. function Portal() {
  68483. return _React$Component.apply(this, arguments) || this;
  68484. }
  68485. var _proto = Portal.prototype;
  68486. _proto.render = function render() {
  68487. var _this = this;
  68488. return this.props.children ? _react.default.createElement(_WaitForContainer.default, {
  68489. container: this.props.container,
  68490. onContainerResolved: this.props.onRendered
  68491. }, function (container) {
  68492. return _reactDom.default.createPortal(_this.props.children, container);
  68493. }) : null;
  68494. };
  68495. return Portal;
  68496. }(_react.default.Component);
  68497. Portal.displayName = 'Portal';
  68498. Portal.propTypes = {
  68499. /**
  68500. * A Node, Component instance, or function that returns either. The `container` will have the Portal children
  68501. * appended to it.
  68502. */
  68503. container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
  68504. onRendered: _propTypes.default.func
  68505. };
  68506. var _default = Portal;
  68507. exports.default = _default;
  68508. module.exports = exports.default;
  68509. /***/ }),
  68510. /***/ "./node_modules/react-overlays/RootCloseWrapper.js":
  68511. /*!*********************************************************!*\
  68512. !*** ./node_modules/react-overlays/RootCloseWrapper.js ***!
  68513. \*********************************************************/
  68514. /*! no static exports found */
  68515. /***/ (function(module, exports, __webpack_require__) {
  68516. "use strict";
  68517. exports.__esModule = true;
  68518. exports.default = void 0;
  68519. var _contains = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"));
  68520. var _listen = _interopRequireDefault(__webpack_require__(/*! dom-helpers/events/listen */ "./node_modules/dom-helpers/events/listen.js"));
  68521. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  68522. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  68523. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  68524. var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! ./utils/ownerDocument */ "./node_modules/react-overlays/utils/ownerDocument.js"));
  68525. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68526. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  68527. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68528. var escapeKeyCode = 27;
  68529. var noop = function noop() {};
  68530. function isLeftClickEvent(event) {
  68531. return event.button === 0;
  68532. }
  68533. function isModifiedEvent(event) {
  68534. return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
  68535. }
  68536. /**
  68537. * The `<RootCloseWrapper/>` component registers your callback on the document
  68538. * when rendered. Powers the `<Overlay/>` component. This is used achieve modal
  68539. * style behavior where your callback is triggered when the user tries to
  68540. * interact with the rest of the document or hits the `esc` key.
  68541. */
  68542. var RootCloseWrapper =
  68543. /*#__PURE__*/
  68544. function (_React$Component) {
  68545. _inheritsLoose(RootCloseWrapper, _React$Component);
  68546. function RootCloseWrapper(props, context) {
  68547. var _this;
  68548. _this = _React$Component.call(this, props, context) || this;
  68549. _this.addEventListeners = function () {
  68550. var event = _this.props.event;
  68551. var doc = (0, _ownerDocument.default)(_assertThisInitialized(_assertThisInitialized(_this))); // Use capture for this listener so it fires before React's listener, to
  68552. // avoid false positives in the contains() check below if the target DOM
  68553. // element is removed in the React mouse callback.
  68554. _this.removeMouseCaptureListener = (0, _listen.default)(doc, event, _this.handleMouseCapture, true);
  68555. _this.removeMouseListener = (0, _listen.default)(doc, event, _this.handleMouse);
  68556. _this.removeKeyupListener = (0, _listen.default)(doc, 'keyup', _this.handleKeyUp);
  68557. if ('ontouchstart' in doc.documentElement) {
  68558. _this.mobileSafariHackListeners = [].slice.call(document.body.children).map(function (el) {
  68559. return (0, _listen.default)(el, 'mousemove', noop);
  68560. });
  68561. }
  68562. };
  68563. _this.removeEventListeners = function () {
  68564. if (_this.removeMouseCaptureListener) _this.removeMouseCaptureListener();
  68565. if (_this.removeMouseListener) _this.removeMouseListener();
  68566. if (_this.removeKeyupListener) _this.removeKeyupListener();
  68567. if (_this.mobileSafariHackListeners) _this.mobileSafariHackListeners.forEach(function (remove) {
  68568. return remove();
  68569. });
  68570. };
  68571. _this.handleMouseCapture = function (e) {
  68572. _this.preventMouseRootClose = isModifiedEvent(e) || !isLeftClickEvent(e) || (0, _contains.default)(_reactDom.default.findDOMNode(_assertThisInitialized(_assertThisInitialized(_this))), e.target);
  68573. };
  68574. _this.handleMouse = function (e) {
  68575. if (!_this.preventMouseRootClose && _this.props.onRootClose) {
  68576. _this.props.onRootClose(e);
  68577. }
  68578. };
  68579. _this.handleKeyUp = function (e) {
  68580. if (e.keyCode === escapeKeyCode && _this.props.onRootClose) {
  68581. _this.props.onRootClose(e);
  68582. }
  68583. };
  68584. _this.preventMouseRootClose = false;
  68585. return _this;
  68586. }
  68587. var _proto = RootCloseWrapper.prototype;
  68588. _proto.componentDidMount = function componentDidMount() {
  68589. if (!this.props.disabled) {
  68590. this.addEventListeners();
  68591. }
  68592. };
  68593. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  68594. if (!this.props.disabled && prevProps.disabled) {
  68595. this.addEventListeners();
  68596. } else if (this.props.disabled && !prevProps.disabled) {
  68597. this.removeEventListeners();
  68598. }
  68599. };
  68600. _proto.componentWillUnmount = function componentWillUnmount() {
  68601. if (!this.props.disabled) {
  68602. this.removeEventListeners();
  68603. }
  68604. };
  68605. _proto.render = function render() {
  68606. return this.props.children;
  68607. };
  68608. return RootCloseWrapper;
  68609. }(_react.default.Component);
  68610. RootCloseWrapper.displayName = 'RootCloseWrapper';
  68611. RootCloseWrapper.propTypes = {
  68612. /**
  68613. * Callback fired after click or mousedown. Also triggers when user hits `esc`.
  68614. */
  68615. onRootClose: _propTypes.default.func,
  68616. /**
  68617. * Children to render.
  68618. */
  68619. children: _propTypes.default.element,
  68620. /**
  68621. * Disable the the RootCloseWrapper, preventing it from triggering `onRootClose`.
  68622. */
  68623. disabled: _propTypes.default.bool,
  68624. /**
  68625. * Choose which document mouse event to bind to.
  68626. */
  68627. event: _propTypes.default.oneOf(['click', 'mousedown'])
  68628. };
  68629. RootCloseWrapper.defaultProps = {
  68630. event: 'click'
  68631. };
  68632. var _default = RootCloseWrapper;
  68633. exports.default = _default;
  68634. module.exports = exports.default;
  68635. /***/ }),
  68636. /***/ "./node_modules/react-overlays/WaitForContainer.js":
  68637. /*!*********************************************************!*\
  68638. !*** ./node_modules/react-overlays/WaitForContainer.js ***!
  68639. \*********************************************************/
  68640. /*! no static exports found */
  68641. /***/ (function(module, exports, __webpack_require__) {
  68642. "use strict";
  68643. exports.__esModule = true;
  68644. exports.default = void 0;
  68645. var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
  68646. var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
  68647. var _inDOM = _interopRequireDefault(__webpack_require__(/*! dom-helpers/util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
  68648. var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
  68649. var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  68650. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  68651. var _getContainer = _interopRequireDefault(__webpack_require__(/*! ./utils/getContainer */ "./node_modules/react-overlays/utils/getContainer.js"));
  68652. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68653. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68654. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  68655. var propTypes = {
  68656. /**
  68657. * A Node, Component instance, or function that returns either. The `container` will have the Portal children
  68658. * appended to it.
  68659. */
  68660. container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
  68661. onContainerResolved: _propTypes.default.func
  68662. };
  68663. var WaitForContainer =
  68664. /*#__PURE__*/
  68665. function (_React$Component) {
  68666. _inheritsLoose(WaitForContainer, _React$Component);
  68667. function WaitForContainer() {
  68668. var _this;
  68669. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  68670. args[_key] = arguments[_key];
  68671. }
  68672. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  68673. if (!_inDOM.default) return _assertThisInitialized(_this);
  68674. var container = _this.props.container;
  68675. if (typeof container === 'function') container = container();
  68676. if (container && !_reactDom.default.findDOMNode(container)) {
  68677. // The container is a React component that has not yet been rendered.
  68678. // Don't set the container node yet.
  68679. return _assertThisInitialized(_this);
  68680. }
  68681. _this.setContainer(container);
  68682. return _this;
  68683. }
  68684. var _proto = WaitForContainer.prototype;
  68685. _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {
  68686. if (nextProps.container !== this.props.container) {
  68687. this.setContainer(nextProps.container);
  68688. }
  68689. };
  68690. _proto.componentDidMount = function componentDidMount() {
  68691. if (!this._container) {
  68692. this.setContainer(this.props.container);
  68693. this.forceUpdate(this.props.onContainerResolved);
  68694. } else if (this.props.onContainerResolved) {
  68695. this.props.onContainerResolved();
  68696. }
  68697. };
  68698. _proto.componentWillUnmount = function componentWillUnmount() {
  68699. this._container = null;
  68700. };
  68701. _proto.setContainer = function setContainer(container) {
  68702. this._container = (0, _getContainer.default)(container, (0, _ownerDocument.default)().body);
  68703. };
  68704. _proto.render = function render() {
  68705. return this._container ? this.props.children(this._container) : null;
  68706. };
  68707. return WaitForContainer;
  68708. }(_react.default.Component);
  68709. WaitForContainer.propTypes = propTypes;
  68710. var _default = WaitForContainer;
  68711. exports.default = _default;
  68712. module.exports = exports.default;
  68713. /***/ }),
  68714. /***/ "./node_modules/react-overlays/node_modules/uncontrollable/esm/hook.js":
  68715. /*!*****************************************************************************!*\
  68716. !*** ./node_modules/react-overlays/node_modules/uncontrollable/esm/hook.js ***!
  68717. \*****************************************************************************/
  68718. /*! exports provided: default */
  68719. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68720. "use strict";
  68721. __webpack_require__.r(__webpack_exports__);
  68722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useUncontrolled; });
  68723. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  68724. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  68725. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  68726. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  68727. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js");
  68728. function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
  68729. function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
  68730. function useUncontrolled(props, config) {
  68731. return Object.keys(config).reduce(function (result, fieldName) {
  68732. var _extends2;
  68733. var defaultValue = result[_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName)],
  68734. propsValue = result[fieldName],
  68735. rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(result, [_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName), fieldName].map(_toPropertyKey));
  68736. var handlerName = config[fieldName];
  68737. var prevProps = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])({});
  68738. var _useState = Object(react__WEBPACK_IMPORTED_MODULE_2__["useState"])(defaultValue),
  68739. stateValue = _useState[0],
  68740. setState = _useState[1];
  68741. var isProp = _utils__WEBPACK_IMPORTED_MODULE_3__["isProp"](props, fieldName);
  68742. var wasProp = _utils__WEBPACK_IMPORTED_MODULE_3__["isProp"](prevProps.current, fieldName);
  68743. prevProps.current = props;
  68744. /**
  68745. * If a prop switches from controlled to Uncontrolled
  68746. * reset its value to the defaultValue
  68747. */
  68748. if (!isProp && wasProp) {
  68749. setState(defaultValue);
  68750. }
  68751. var propsHandler = props[handlerName];
  68752. var handler = Object(react__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (value) {
  68753. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  68754. args[_key - 1] = arguments[_key];
  68755. }
  68756. if (propsHandler) propsHandler.apply(void 0, [value].concat(args));
  68757. setState(value);
  68758. }, [setState, propsHandler]);
  68759. return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, (_extends2 = {}, _extends2[fieldName] = isProp ? propsValue : stateValue, _extends2[handlerName] = handler, _extends2));
  68760. }, props);
  68761. }
  68762. /***/ }),
  68763. /***/ "./node_modules/react-overlays/node_modules/uncontrollable/esm/index.js":
  68764. /*!******************************************************************************!*\
  68765. !*** ./node_modules/react-overlays/node_modules/uncontrollable/esm/index.js ***!
  68766. \******************************************************************************/
  68767. /*! exports provided: useUncontrolled, uncontrollable, default */
  68768. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68769. "use strict";
  68770. __webpack_require__.r(__webpack_exports__);
  68771. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uncontrollable", function() { return uncontrollable; });
  68772. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  68773. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  68774. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  68775. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  68776. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  68777. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
  68778. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_4__);
  68779. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js");
  68780. /* harmony import */ var _hook_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hook.js */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/hook.js");
  68781. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useUncontrolled", function() { return _hook_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  68782. function uncontrollable(Component, controlledValues, methods) {
  68783. if (methods === void 0) {
  68784. methods = [];
  68785. }
  68786. var displayName = Component.displayName || Component.name || 'Component';
  68787. var canAcceptRef = _utils__WEBPACK_IMPORTED_MODULE_5__["canAcceptRef"](Component);
  68788. var controlledProps = Object.keys(controlledValues);
  68789. var PROPS_TO_OMIT = controlledProps.map(_utils__WEBPACK_IMPORTED_MODULE_5__["defaultKey"]);
  68790. !(canAcceptRef || !methods.length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_4___default()(false, '[uncontrollable] stateless function components cannot pass through methods ' + 'because they have no associated instances. Check component: ' + displayName + ', ' + 'attempting to pass through methods: ' + methods.join(', ')) : undefined : void 0;
  68791. var UncontrolledComponent =
  68792. /*#__PURE__*/
  68793. function (_React$Component) {
  68794. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(UncontrolledComponent, _React$Component);
  68795. function UncontrolledComponent() {
  68796. var _this;
  68797. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  68798. args[_key] = arguments[_key];
  68799. }
  68800. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  68801. _this.handlers = Object.create(null);
  68802. controlledProps.forEach(function (propName) {
  68803. var handlerName = controlledValues[propName];
  68804. var handleChange = function handleChange(value) {
  68805. if (_this.props[handlerName]) {
  68806. var _this$props;
  68807. _this._notifying = true;
  68808. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  68809. args[_key2 - 1] = arguments[_key2];
  68810. }
  68811. (_this$props = _this.props)[handlerName].apply(_this$props, [value].concat(args));
  68812. _this._notifying = false;
  68813. }
  68814. _this._values[propName] = value;
  68815. if (!_this.unmounted) _this.forceUpdate();
  68816. };
  68817. _this.handlers[handlerName] = handleChange;
  68818. });
  68819. if (methods.length) _this.attachRef = function (ref) {
  68820. _this.inner = ref;
  68821. };
  68822. return _this;
  68823. }
  68824. var _proto = UncontrolledComponent.prototype;
  68825. _proto.shouldComponentUpdate = function shouldComponentUpdate() {
  68826. //let the forceUpdate trigger the update
  68827. return !this._notifying;
  68828. };
  68829. _proto.componentWillMount = function componentWillMount() {
  68830. var _this2 = this;
  68831. var props = this.props;
  68832. this._values = Object.create(null);
  68833. controlledProps.forEach(function (key) {
  68834. _this2._values[key] = props[_utils__WEBPACK_IMPORTED_MODULE_5__["defaultKey"](key)];
  68835. });
  68836. };
  68837. _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
  68838. var _this3 = this;
  68839. var props = this.props;
  68840. controlledProps.forEach(function (key) {
  68841. /**
  68842. * If a prop switches from controlled to Uncontrolled
  68843. * reset its value to the defaultValue
  68844. */
  68845. if (!_utils__WEBPACK_IMPORTED_MODULE_5__["isProp"](nextProps, key) && _utils__WEBPACK_IMPORTED_MODULE_5__["isProp"](props, key)) {
  68846. _this3._values[key] = nextProps[_utils__WEBPACK_IMPORTED_MODULE_5__["defaultKey"](key)];
  68847. }
  68848. });
  68849. };
  68850. _proto.componentWillUnmount = function componentWillUnmount() {
  68851. this.unmounted = true;
  68852. };
  68853. _proto.render = function render() {
  68854. var _this4 = this;
  68855. var _this$props2 = this.props,
  68856. innerRef = _this$props2.innerRef,
  68857. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["innerRef"]);
  68858. PROPS_TO_OMIT.forEach(function (prop) {
  68859. delete props[prop];
  68860. });
  68861. var newProps = {};
  68862. controlledProps.forEach(function (propName) {
  68863. var propValue = _this4.props[propName];
  68864. newProps[propName] = propValue !== undefined ? propValue : _this4._values[propName];
  68865. });
  68866. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, newProps, this.handlers, {
  68867. ref: innerRef || this.attachRef
  68868. }));
  68869. };
  68870. return UncontrolledComponent;
  68871. }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
  68872. UncontrolledComponent.displayName = "Uncontrolled(" + displayName + ")";
  68873. UncontrolledComponent.propTypes = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
  68874. innerRef: function innerRef() {}
  68875. }, _utils__WEBPACK_IMPORTED_MODULE_5__["uncontrolledPropTypes"](controlledValues, displayName));
  68876. methods.forEach(function (method) {
  68877. UncontrolledComponent.prototype[method] = function $proxiedMethod() {
  68878. var _this$inner;
  68879. return (_this$inner = this.inner)[method].apply(_this$inner, arguments);
  68880. };
  68881. });
  68882. var WrappedComponent = UncontrolledComponent;
  68883. if (react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef) {
  68884. WrappedComponent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  68885. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(UncontrolledComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
  68886. innerRef: ref
  68887. }));
  68888. });
  68889. WrappedComponent.propTypes = UncontrolledComponent.propTypes;
  68890. }
  68891. WrappedComponent.ControlledComponent = Component;
  68892. /**
  68893. * useful when wrapping a Component and you want to control
  68894. * everything
  68895. */
  68896. WrappedComponent.deferControlTo = function (newComponent, additions, nextMethods) {
  68897. if (additions === void 0) {
  68898. additions = {};
  68899. }
  68900. return uncontrollable(newComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, controlledValues, additions), nextMethods);
  68901. };
  68902. return WrappedComponent;
  68903. }
  68904. /* harmony default export */ __webpack_exports__["default"] = (uncontrollable);
  68905. /***/ }),
  68906. /***/ "./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js":
  68907. /*!******************************************************************************!*\
  68908. !*** ./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js ***!
  68909. \******************************************************************************/
  68910. /*! exports provided: uncontrolledPropTypes, isProp, defaultKey, canAcceptRef */
  68911. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68912. "use strict";
  68913. __webpack_require__.r(__webpack_exports__);
  68914. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uncontrolledPropTypes", function() { return uncontrolledPropTypes; });
  68915. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isProp", function() { return isProp; });
  68916. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultKey", function() { return defaultKey; });
  68917. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canAcceptRef", function() { return canAcceptRef; });
  68918. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
  68919. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
  68920. var noop = function noop() {};
  68921. function readOnlyPropType(handler, name) {
  68922. return function (props, propName) {
  68923. if (props[propName] !== undefined) {
  68924. if (!props[handler]) {
  68925. return new Error("You have provided a `" + propName + "` prop to `" + name + "` " + ("without an `" + handler + "` handler prop. This will render a read-only field. ") + ("If the field should be mutable use `" + defaultKey(propName) + "`. ") + ("Otherwise, set `" + handler + "`."));
  68926. }
  68927. }
  68928. };
  68929. }
  68930. function uncontrolledPropTypes(controlledValues, displayName) {
  68931. var propTypes = {};
  68932. Object.keys(controlledValues).forEach(function (prop) {
  68933. // add default propTypes for folks that use runtime checks
  68934. propTypes[defaultKey(prop)] = noop;
  68935. if (true) {
  68936. var handler = controlledValues[prop];
  68937. !(typeof handler === 'string' && handler.trim().length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_0___default()(false, 'Uncontrollable - [%s]: the prop `%s` needs a valid handler key name in order to make it uncontrollable', displayName, prop) : undefined : void 0;
  68938. propTypes[prop] = readOnlyPropType(handler, displayName);
  68939. }
  68940. });
  68941. return propTypes;
  68942. }
  68943. function isProp(props, prop) {
  68944. return props[prop] !== undefined;
  68945. }
  68946. function defaultKey(key) {
  68947. return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
  68948. }
  68949. /**
  68950. * Copyright (c) 2013-present, Facebook, Inc.
  68951. * All rights reserved.
  68952. *
  68953. * This source code is licensed under the BSD-style license found in the
  68954. * LICENSE file in the root directory of this source tree. An additional grant
  68955. * of patent rights can be found in the PATENTS file in the same directory.
  68956. */
  68957. function canAcceptRef(component) {
  68958. return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent);
  68959. }
  68960. /***/ }),
  68961. /***/ "./node_modules/react-overlays/utils/getContainer.js":
  68962. /*!***********************************************************!*\
  68963. !*** ./node_modules/react-overlays/utils/getContainer.js ***!
  68964. \***********************************************************/
  68965. /*! no static exports found */
  68966. /***/ (function(module, exports, __webpack_require__) {
  68967. "use strict";
  68968. exports.__esModule = true;
  68969. exports.default = getContainer;
  68970. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  68971. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68972. function getContainer(container, defaultContainer) {
  68973. if (container == null) return defaultContainer;
  68974. container = typeof container === 'function' ? container() : container;
  68975. return _reactDom.default.findDOMNode(container) || null;
  68976. }
  68977. module.exports = exports.default;
  68978. /***/ }),
  68979. /***/ "./node_modules/react-overlays/utils/isOverflowing.js":
  68980. /*!************************************************************!*\
  68981. !*** ./node_modules/react-overlays/utils/isOverflowing.js ***!
  68982. \************************************************************/
  68983. /*! no static exports found */
  68984. /***/ (function(module, exports, __webpack_require__) {
  68985. "use strict";
  68986. exports.__esModule = true;
  68987. exports.default = isOverflowing;
  68988. var _isWindow = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/isWindow */ "./node_modules/dom-helpers/query/isWindow.js"));
  68989. var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
  68990. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68991. function isBody(node) {
  68992. return node && node.tagName.toLowerCase() === 'body';
  68993. }
  68994. function bodyIsOverflowing(node) {
  68995. var doc = (0, _ownerDocument.default)(node);
  68996. var win = (0, _isWindow.default)(doc);
  68997. return doc.body.clientWidth < win.innerWidth;
  68998. }
  68999. function isOverflowing(container) {
  69000. var win = (0, _isWindow.default)(container);
  69001. return win || isBody(container) ? bodyIsOverflowing(container) : container.scrollHeight > container.clientHeight;
  69002. }
  69003. module.exports = exports.default;
  69004. /***/ }),
  69005. /***/ "./node_modules/react-overlays/utils/manageAriaHidden.js":
  69006. /*!***************************************************************!*\
  69007. !*** ./node_modules/react-overlays/utils/manageAriaHidden.js ***!
  69008. \***************************************************************/
  69009. /*! no static exports found */
  69010. /***/ (function(module, exports, __webpack_require__) {
  69011. "use strict";
  69012. exports.__esModule = true;
  69013. exports.ariaHidden = ariaHidden;
  69014. exports.hideSiblings = hideSiblings;
  69015. exports.showSiblings = showSiblings;
  69016. var BLACKLIST = ['template', 'script', 'style'];
  69017. var isHidable = function isHidable(_ref) {
  69018. var nodeType = _ref.nodeType,
  69019. tagName = _ref.tagName;
  69020. return nodeType === 1 && BLACKLIST.indexOf(tagName.toLowerCase()) === -1;
  69021. };
  69022. var siblings = function siblings(container, exclude, cb) {
  69023. exclude = [].concat(exclude);
  69024. [].forEach.call(container.children, function (node) {
  69025. if (exclude.indexOf(node) === -1 && isHidable(node)) {
  69026. cb(node);
  69027. }
  69028. });
  69029. };
  69030. function ariaHidden(show, node) {
  69031. if (!node) return;
  69032. if (show) {
  69033. node.setAttribute('aria-hidden', 'true');
  69034. } else {
  69035. node.removeAttribute('aria-hidden');
  69036. }
  69037. }
  69038. function hideSiblings(container, _ref2) {
  69039. var root = _ref2.root,
  69040. backdrop = _ref2.backdrop;
  69041. siblings(container, [root, backdrop], function (node) {
  69042. return ariaHidden(true, node);
  69043. });
  69044. }
  69045. function showSiblings(container, _ref3) {
  69046. var root = _ref3.root,
  69047. backdrop = _ref3.backdrop;
  69048. siblings(container, [root, backdrop], function (node) {
  69049. return ariaHidden(false, node);
  69050. });
  69051. }
  69052. /***/ }),
  69053. /***/ "./node_modules/react-overlays/utils/ownerDocument.js":
  69054. /*!************************************************************!*\
  69055. !*** ./node_modules/react-overlays/utils/ownerDocument.js ***!
  69056. \************************************************************/
  69057. /*! no static exports found */
  69058. /***/ (function(module, exports, __webpack_require__) {
  69059. "use strict";
  69060. exports.__esModule = true;
  69061. exports.default = _default;
  69062. var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
  69063. var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
  69064. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69065. function _default(componentOrElement) {
  69066. return (0, _ownerDocument.default)(_reactDom.default.findDOMNode(componentOrElement));
  69067. }
  69068. module.exports = exports.default;
  69069. /***/ }),
  69070. /***/ "./node_modules/react-popper/lib/esm/Manager.js":
  69071. /*!******************************************************!*\
  69072. !*** ./node_modules/react-popper/lib/esm/Manager.js ***!
  69073. \******************************************************/
  69074. /*! exports provided: ManagerReferenceNodeContext, ManagerReferenceNodeSetterContext, default */
  69075. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69076. "use strict";
  69077. __webpack_require__.r(__webpack_exports__);
  69078. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManagerReferenceNodeContext", function() { return ManagerReferenceNodeContext; });
  69079. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManagerReferenceNodeSetterContext", function() { return ManagerReferenceNodeSetterContext; });
  69080. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Manager; });
  69081. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  69082. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0__);
  69083. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
  69084. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__);
  69085. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
  69086. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);
  69087. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  69088. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  69089. /* harmony import */ var create_react_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! create-react-context */ "./node_modules/create-react-context/lib/index.js");
  69090. /* harmony import */ var create_react_context__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(create_react_context__WEBPACK_IMPORTED_MODULE_4__);
  69091. var ManagerReferenceNodeContext = create_react_context__WEBPACK_IMPORTED_MODULE_4___default()();
  69092. var ManagerReferenceNodeSetterContext = create_react_context__WEBPACK_IMPORTED_MODULE_4___default()();
  69093. var Manager =
  69094. /*#__PURE__*/
  69095. function (_React$Component) {
  69096. _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default()(Manager, _React$Component);
  69097. function Manager() {
  69098. var _this;
  69099. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  69100. args[_key] = arguments[_key];
  69101. }
  69102. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  69103. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0___default()(_this), "referenceNode", void 0);
  69104. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0___default()(_this), "setReferenceNode", function (newReferenceNode) {
  69105. if (newReferenceNode && _this.referenceNode !== newReferenceNode) {
  69106. _this.referenceNode = newReferenceNode;
  69107. _this.forceUpdate();
  69108. }
  69109. });
  69110. return _this;
  69111. }
  69112. var _proto = Manager.prototype;
  69113. _proto.componentWillUnmount = function componentWillUnmount() {
  69114. this.referenceNode = null;
  69115. };
  69116. _proto.render = function render() {
  69117. return react__WEBPACK_IMPORTED_MODULE_3__["createElement"](ManagerReferenceNodeContext.Provider, {
  69118. value: this.referenceNode
  69119. }, react__WEBPACK_IMPORTED_MODULE_3__["createElement"](ManagerReferenceNodeSetterContext.Provider, {
  69120. value: this.setReferenceNode
  69121. }, this.props.children));
  69122. };
  69123. return Manager;
  69124. }(react__WEBPACK_IMPORTED_MODULE_3__["Component"]);
  69125. /***/ }),
  69126. /***/ "./node_modules/react-popper/lib/esm/Popper.js":
  69127. /*!*****************************************************!*\
  69128. !*** ./node_modules/react-popper/lib/esm/Popper.js ***!
  69129. \*****************************************************/
  69130. /*! exports provided: InnerPopper, placements, default */
  69131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69132. "use strict";
  69133. __webpack_require__.r(__webpack_exports__);
  69134. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerPopper", function() { return InnerPopper; });
  69135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "placements", function() { return placements; });
  69136. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Popper; });
  69137. /* harmony import */ var _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
  69138. /* harmony import */ var _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__);
  69139. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
  69140. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__);
  69141. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  69142. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
  69143. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
  69144. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__);
  69145. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
  69146. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__);
  69147. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  69148. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
  69149. /* harmony import */ var popper_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js");
  69150. /* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
  69151. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./node_modules/react-popper/lib/esm/utils.js");
  69152. var initialStyle = {
  69153. position: 'absolute',
  69154. top: 0,
  69155. left: 0,
  69156. opacity: 0,
  69157. pointerEvents: 'none'
  69158. };
  69159. var initialArrowStyle = {};
  69160. var InnerPopper =
  69161. /*#__PURE__*/
  69162. function (_React$Component) {
  69163. _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3___default()(InnerPopper, _React$Component);
  69164. function InnerPopper() {
  69165. var _this;
  69166. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  69167. args[_key] = arguments[_key];
  69168. }
  69169. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  69170. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "state", {
  69171. data: undefined,
  69172. placement: undefined
  69173. });
  69174. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "popperInstance", void 0);
  69175. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "popperNode", null);
  69176. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "arrowNode", null);
  69177. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "setPopperNode", function (popperNode) {
  69178. if (!popperNode || _this.popperNode === popperNode) return;
  69179. Object(_utils__WEBPACK_IMPORTED_MODULE_8__["setRef"])(_this.props.innerRef, popperNode);
  69180. _this.popperNode = popperNode;
  69181. _this.updatePopperInstance();
  69182. });
  69183. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "setArrowNode", function (arrowNode) {
  69184. _this.arrowNode = arrowNode;
  69185. });
  69186. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "updateStateModifier", {
  69187. enabled: true,
  69188. order: 900,
  69189. fn: function fn(data) {
  69190. var placement = data.placement;
  69191. _this.setState({
  69192. data: data,
  69193. placement: placement
  69194. });
  69195. return data;
  69196. }
  69197. });
  69198. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getOptions", function () {
  69199. return {
  69200. placement: _this.props.placement,
  69201. eventsEnabled: _this.props.eventsEnabled,
  69202. positionFixed: _this.props.positionFixed,
  69203. modifiers: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _this.props.modifiers, {
  69204. arrow: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _this.props.modifiers && _this.props.modifiers.arrow, {
  69205. enabled: !!_this.arrowNode,
  69206. element: _this.arrowNode
  69207. }),
  69208. applyStyle: {
  69209. enabled: false
  69210. },
  69211. updateStateModifier: _this.updateStateModifier
  69212. })
  69213. };
  69214. });
  69215. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getPopperStyle", function () {
  69216. return !_this.popperNode || !_this.state.data ? initialStyle : _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
  69217. position: _this.state.data.offsets.popper.position
  69218. }, _this.state.data.styles);
  69219. });
  69220. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getPopperPlacement", function () {
  69221. return !_this.state.data ? undefined : _this.state.placement;
  69222. });
  69223. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getArrowStyle", function () {
  69224. return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;
  69225. });
  69226. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getOutOfBoundariesState", function () {
  69227. return _this.state.data ? _this.state.data.hide : undefined;
  69228. });
  69229. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "destroyPopperInstance", function () {
  69230. if (!_this.popperInstance) return;
  69231. _this.popperInstance.destroy();
  69232. _this.popperInstance = null;
  69233. });
  69234. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "updatePopperInstance", function () {
  69235. _this.destroyPopperInstance();
  69236. var _assertThisInitialize = _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this),
  69237. popperNode = _assertThisInitialize.popperNode;
  69238. var referenceElement = _this.props.referenceElement;
  69239. if (!referenceElement || !popperNode) return;
  69240. _this.popperInstance = new popper_js__WEBPACK_IMPORTED_MODULE_6__["default"](referenceElement, popperNode, _this.getOptions());
  69241. });
  69242. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "scheduleUpdate", function () {
  69243. if (_this.popperInstance) {
  69244. _this.popperInstance.scheduleUpdate();
  69245. }
  69246. });
  69247. return _this;
  69248. }
  69249. var _proto = InnerPopper.prototype;
  69250. _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
  69251. // If the Popper.js options have changed, update the instance (destroy + create)
  69252. if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed || this.props.modifiers !== prevProps.modifiers) {
  69253. // develop only check that modifiers isn't being updated needlessly
  69254. if (true) {
  69255. if (this.props.modifiers !== prevProps.modifiers && this.props.modifiers != null && prevProps.modifiers != null && Object(_utils__WEBPACK_IMPORTED_MODULE_8__["shallowEqual"])(this.props.modifiers, prevProps.modifiers)) {
  69256. console.warn("'modifiers' prop reference updated even though all values appear the same.\nConsider memoizing the 'modifiers' object to avoid needless rendering.");
  69257. }
  69258. }
  69259. this.updatePopperInstance();
  69260. } else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {
  69261. this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();
  69262. } // A placement difference in state means popper determined a new placement
  69263. // apart from the props value. By the time the popper element is rendered with
  69264. // the new position Popper has already measured it, if the place change triggers
  69265. // a size change it will result in a misaligned popper. So we schedule an update to be sure.
  69266. if (prevState.placement !== this.state.placement) {
  69267. this.scheduleUpdate();
  69268. }
  69269. };
  69270. _proto.componentWillUnmount = function componentWillUnmount() {
  69271. Object(_utils__WEBPACK_IMPORTED_MODULE_8__["setRef"])(this.props.innerRef, null);
  69272. this.destroyPopperInstance();
  69273. };
  69274. _proto.render = function render() {
  69275. return Object(_utils__WEBPACK_IMPORTED_MODULE_8__["unwrapArray"])(this.props.children)({
  69276. ref: this.setPopperNode,
  69277. style: this.getPopperStyle(),
  69278. placement: this.getPopperPlacement(),
  69279. outOfBoundaries: this.getOutOfBoundariesState(),
  69280. scheduleUpdate: this.scheduleUpdate,
  69281. arrowProps: {
  69282. ref: this.setArrowNode,
  69283. style: this.getArrowStyle()
  69284. }
  69285. });
  69286. };
  69287. return InnerPopper;
  69288. }(react__WEBPACK_IMPORTED_MODULE_5__["Component"]);
  69289. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(InnerPopper, "defaultProps", {
  69290. placement: 'bottom',
  69291. eventsEnabled: true,
  69292. referenceElement: undefined,
  69293. positionFixed: false
  69294. });
  69295. var placements = popper_js__WEBPACK_IMPORTED_MODULE_6__["default"].placements;
  69296. function Popper(_ref) {
  69297. var referenceElement = _ref.referenceElement,
  69298. props = _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0___default()(_ref, ["referenceElement"]);
  69299. return react__WEBPACK_IMPORTED_MODULE_5__["createElement"](_Manager__WEBPACK_IMPORTED_MODULE_7__["ManagerReferenceNodeContext"].Consumer, null, function (referenceNode) {
  69300. return react__WEBPACK_IMPORTED_MODULE_5__["createElement"](InnerPopper, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
  69301. referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
  69302. }, props));
  69303. });
  69304. }
  69305. /***/ }),
  69306. /***/ "./node_modules/react-popper/lib/esm/Reference.js":
  69307. /*!********************************************************!*\
  69308. !*** ./node_modules/react-popper/lib/esm/Reference.js ***!
  69309. \********************************************************/
  69310. /*! exports provided: default */
  69311. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69312. "use strict";
  69313. __webpack_require__.r(__webpack_exports__);
  69314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Reference; });
  69315. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
  69316. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
  69317. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  69318. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  69319. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
  69320. /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__);
  69321. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
  69322. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__);
  69323. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  69324. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
  69325. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
  69326. /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_5__);
  69327. /* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
  69328. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./node_modules/react-popper/lib/esm/utils.js");
  69329. var InnerReference =
  69330. /*#__PURE__*/
  69331. function (_React$Component) {
  69332. _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2___default()(InnerReference, _React$Component);
  69333. function InnerReference() {
  69334. var _this;
  69335. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  69336. args[_key] = arguments[_key];
  69337. }
  69338. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  69339. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), "refHandler", function (node) {
  69340. Object(_utils__WEBPACK_IMPORTED_MODULE_7__["setRef"])(_this.props.innerRef, node);
  69341. Object(_utils__WEBPACK_IMPORTED_MODULE_7__["safeInvoke"])(_this.props.setReferenceNode, node);
  69342. });
  69343. return _this;
  69344. }
  69345. var _proto = InnerReference.prototype;
  69346. _proto.componentWillUnmount = function componentWillUnmount() {
  69347. Object(_utils__WEBPACK_IMPORTED_MODULE_7__["setRef"])(this.props.innerRef, null);
  69348. };
  69349. _proto.render = function render() {
  69350. warning__WEBPACK_IMPORTED_MODULE_5___default()(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
  69351. return Object(_utils__WEBPACK_IMPORTED_MODULE_7__["unwrapArray"])(this.props.children)({
  69352. ref: this.refHandler
  69353. });
  69354. };
  69355. return InnerReference;
  69356. }(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
  69357. function Reference(props) {
  69358. return react__WEBPACK_IMPORTED_MODULE_4__["createElement"](_Manager__WEBPACK_IMPORTED_MODULE_6__["ManagerReferenceNodeSetterContext"].Consumer, null, function (setReferenceNode) {
  69359. return react__WEBPACK_IMPORTED_MODULE_4__["createElement"](InnerReference, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
  69360. setReferenceNode: setReferenceNode
  69361. }, props));
  69362. });
  69363. }
  69364. /***/ }),
  69365. /***/ "./node_modules/react-popper/lib/esm/index.js":
  69366. /*!****************************************************!*\
  69367. !*** ./node_modules/react-popper/lib/esm/index.js ***!
  69368. \****************************************************/
  69369. /*! exports provided: Popper, placements, Manager, Reference */
  69370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69371. "use strict";
  69372. __webpack_require__.r(__webpack_exports__);
  69373. /* harmony import */ var _Popper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Popper */ "./node_modules/react-popper/lib/esm/Popper.js");
  69374. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popper", function() { return _Popper__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  69375. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "placements", function() { return _Popper__WEBPACK_IMPORTED_MODULE_0__["placements"]; });
  69376. /* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
  69377. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Manager", function() { return _Manager__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  69378. /* harmony import */ var _Reference__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Reference */ "./node_modules/react-popper/lib/esm/Reference.js");
  69379. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Reference", function() { return _Reference__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  69380. // Public components
  69381. // Public types
  69382. /***/ }),
  69383. /***/ "./node_modules/react-popper/lib/esm/utils.js":
  69384. /*!****************************************************!*\
  69385. !*** ./node_modules/react-popper/lib/esm/utils.js ***!
  69386. \****************************************************/
  69387. /*! exports provided: unwrapArray, safeInvoke, shallowEqual, setRef */
  69388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69389. "use strict";
  69390. __webpack_require__.r(__webpack_exports__);
  69391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapArray", function() { return unwrapArray; });
  69392. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeInvoke", function() { return safeInvoke; });
  69393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shallowEqual", function() { return shallowEqual; });
  69394. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRef", function() { return setRef; });
  69395. /**
  69396. * Takes an argument and if it's an array, returns the first item in the array,
  69397. * otherwise returns the argument. Used for Preact compatibility.
  69398. */
  69399. var unwrapArray = function unwrapArray(arg) {
  69400. return Array.isArray(arg) ? arg[0] : arg;
  69401. };
  69402. /**
  69403. * Takes a maybe-undefined function and arbitrary args and invokes the function
  69404. * only if it is defined.
  69405. */
  69406. var safeInvoke = function safeInvoke(fn) {
  69407. if (typeof fn === "function") {
  69408. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  69409. args[_key - 1] = arguments[_key];
  69410. }
  69411. return fn.apply(void 0, args);
  69412. }
  69413. };
  69414. /**
  69415. * Does a shallow equality check of two objects by comparing the reference
  69416. * equality of each value.
  69417. */
  69418. var shallowEqual = function shallowEqual(objA, objB) {
  69419. var aKeys = Object.keys(objA);
  69420. var bKeys = Object.keys(objB);
  69421. if (bKeys.length !== aKeys.length) {
  69422. return false;
  69423. }
  69424. for (var i = 0; i < bKeys.length; i++) {
  69425. var key = aKeys[i];
  69426. if (objA[key] !== objB[key]) {
  69427. return false;
  69428. }
  69429. }
  69430. return true;
  69431. };
  69432. /**
  69433. * Sets a ref using either a ref callback or a ref object
  69434. */
  69435. var setRef = function setRef(ref, node) {
  69436. // if its a function call it
  69437. if (typeof ref === "function") {
  69438. return safeInvoke(ref, node);
  69439. } // otherwise we should treat it as a ref object
  69440. else if (ref != null) {
  69441. ref.current = node;
  69442. }
  69443. };
  69444. /***/ }),
  69445. /***/ "./node_modules/react-spinners/ClipLoader.js":
  69446. /*!***************************************************!*\
  69447. !*** ./node_modules/react-spinners/ClipLoader.js ***!
  69448. \***************************************************/
  69449. /*! no static exports found */
  69450. /***/ (function(module, exports, __webpack_require__) {
  69451. "use strict";
  69452. var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
  69453. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  69454. return cooked;
  69455. };
  69456. var __extends = (this && this.__extends) || (function () {
  69457. var extendStatics = function (d, b) {
  69458. extendStatics = Object.setPrototypeOf ||
  69459. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  69460. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  69461. return extendStatics(d, b);
  69462. };
  69463. return function (d, b) {
  69464. extendStatics(d, b);
  69465. function __() { this.constructor = d; }
  69466. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  69467. };
  69468. })();
  69469. var __importStar = (this && this.__importStar) || function (mod) {
  69470. if (mod && mod.__esModule) return mod;
  69471. var result = {};
  69472. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  69473. result["default"] = mod;
  69474. return result;
  69475. };
  69476. Object.defineProperty(exports, "__esModule", { value: true });
  69477. /** @jsx jsx */
  69478. var React = __importStar(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
  69479. var core_1 = __webpack_require__(/*! @emotion/core */ "./node_modules/@emotion/core/dist/core.browser.esm.js");
  69480. var proptypes_1 = __webpack_require__(/*! ./helpers/proptypes */ "./node_modules/react-spinners/helpers/proptypes.js");
  69481. var clip = core_1.keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {transform: rotate(0deg) scale(1)}\n 50% {transform: rotate(180deg) scale(0.8)}\n 100% {transform: rotate(360deg) scale(1)}\n"], ["\n 0% {transform: rotate(0deg) scale(1)}\n 50% {transform: rotate(180deg) scale(0.8)}\n 100% {transform: rotate(360deg) scale(1)}\n"])));
  69482. var Loader = /** @class */ (function (_super) {
  69483. __extends(Loader, _super);
  69484. function Loader() {
  69485. var _this = _super !== null && _super.apply(this, arguments) || this;
  69486. _this.style = function () {
  69487. var _a = _this.props, size = _a.size, sizeUnit = _a.sizeUnit, color = _a.color;
  69488. return core_1.css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: transparent !important;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border: 2px solid;\n border-color: ", ";\n border-bottom-color: transparent;\n display: inline-block;\n animation: ", " 0.75s 0s infinite linear;\n animation-fill-mode: both;\n "], ["\n background: transparent !important;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border: 2px solid;\n border-color: ", ";\n border-bottom-color: transparent;\n display: inline-block;\n animation: ", " 0.75s 0s infinite linear;\n animation-fill-mode: both;\n "])), "" + size + sizeUnit, "" + size + sizeUnit, color, clip);
  69489. };
  69490. return _this;
  69491. }
  69492. Loader.prototype.render = function () {
  69493. var _a = this.props, loading = _a.loading, css = _a.css;
  69494. return loading ? core_1.jsx("div", { css: [this.style(), css] }) : null;
  69495. };
  69496. Loader.defaultProps = proptypes_1.sizeDefaults(35);
  69497. return Loader;
  69498. }(React.PureComponent));
  69499. exports.default = Loader;
  69500. var templateObject_1, templateObject_2;
  69501. /***/ }),
  69502. /***/ "./node_modules/react-spinners/helpers/proptypes.js":
  69503. /*!**********************************************************!*\
  69504. !*** ./node_modules/react-spinners/helpers/proptypes.js ***!
  69505. \**********************************************************/
  69506. /*! no static exports found */
  69507. /***/ (function(module, exports, __webpack_require__) {
  69508. "use strict";
  69509. var _a;
  69510. Object.defineProperty(exports, "__esModule", { value: true });
  69511. /*
  69512. * List of string constants to represent different props
  69513. */
  69514. var LOADING = "loading";
  69515. var COLOR = "color";
  69516. var CSS = "css";
  69517. var SIZE = "size";
  69518. var SIZE_UNIT = "sizeUnit";
  69519. var WIDTH = "width";
  69520. var WIDTH_UNIT = "widthUnit";
  69521. var HEIGHT = "height";
  69522. var HEIGHT_UNIT = "heightUnit";
  69523. var RADIUS = "radius";
  69524. var RADIUS_UNIT = "radiusUnit";
  69525. var MARGIN = "margin";
  69526. var commonValues = (_a = {},
  69527. _a[LOADING] = true,
  69528. _a[COLOR] = "#000000",
  69529. _a[CSS] = {},
  69530. _a);
  69531. var heightWidthValues = function (height, width) {
  69532. var _a;
  69533. return (_a = {},
  69534. _a[HEIGHT] = height,
  69535. _a[HEIGHT_UNIT] = "px",
  69536. _a[WIDTH] = width,
  69537. _a[WIDTH_UNIT] = "px",
  69538. _a);
  69539. };
  69540. var sizeValues = function (sizeValue) {
  69541. var _a;
  69542. return (_a = {},
  69543. _a[SIZE] = sizeValue,
  69544. _a[SIZE_UNIT] = "px",
  69545. _a);
  69546. };
  69547. exports.sizeDefaults = function (sizeValue) {
  69548. return Object.assign({}, commonValues, sizeValues(sizeValue));
  69549. };
  69550. exports.sizeMarginDefaults = function (sizeValue) {
  69551. var _a;
  69552. return Object.assign({}, exports.sizeDefaults(sizeValue), (_a = {},
  69553. _a[MARGIN] = "2px",
  69554. _a));
  69555. };
  69556. exports.heightWidthDefaults = function (height, width) {
  69557. return Object.assign({}, commonValues, heightWidthValues(height, width));
  69558. };
  69559. exports.heightWidthRadiusDefaults = function (height, width, radius) {
  69560. var _a;
  69561. if (radius === void 0) { radius = 2; }
  69562. return Object.assign({}, exports.heightWidthDefaults(height, width), (_a = {},
  69563. _a[RADIUS] = radius,
  69564. _a[RADIUS_UNIT] = "px",
  69565. _a[MARGIN] = "2px",
  69566. _a));
  69567. };
  69568. /***/ }),
  69569. /***/ "./node_modules/react-transition-group/esm/Transition.js":
  69570. /*!***************************************************************!*\
  69571. !*** ./node_modules/react-transition-group/esm/Transition.js ***!
  69572. \***************************************************************/
  69573. /*! exports provided: UNMOUNTED, EXITED, ENTERING, ENTERED, EXITING, default */
  69574. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69575. "use strict";
  69576. __webpack_require__.r(__webpack_exports__);
  69577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNMOUNTED", function() { return UNMOUNTED; });
  69578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXITED", function() { return EXITED; });
  69579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTERING", function() { return ENTERING; });
  69580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTERED", function() { return ENTERED; });
  69581. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXITING", function() { return EXITING; });
  69582. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  69583. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  69584. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  69585. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
  69586. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  69587. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  69588. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  69589. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);
  69590. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ "./node_modules/react-transition-group/esm/config.js");
  69591. /* harmony import */ var _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/PropTypes */ "./node_modules/react-transition-group/esm/utils/PropTypes.js");
  69592. /* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./TransitionGroupContext */ "./node_modules/react-transition-group/esm/TransitionGroupContext.js");
  69593. var UNMOUNTED = 'unmounted';
  69594. var EXITED = 'exited';
  69595. var ENTERING = 'entering';
  69596. var ENTERED = 'entered';
  69597. var EXITING = 'exiting';
  69598. /**
  69599. * The Transition component lets you describe a transition from one component
  69600. * state to another _over time_ with a simple declarative API. Most commonly
  69601. * it's used to animate the mounting and unmounting of a component, but can also
  69602. * be used to describe in-place transition states as well.
  69603. *
  69604. * ---
  69605. *
  69606. * **Note**: `Transition` is a platform-agnostic base component. If you're using
  69607. * transitions in CSS, you'll probably want to use
  69608. * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
  69609. * instead. It inherits all the features of `Transition`, but contains
  69610. * additional features necessary to play nice with CSS transitions (hence the
  69611. * name of the component).
  69612. *
  69613. * ---
  69614. *
  69615. * By default the `Transition` component does not alter the behavior of the
  69616. * component it renders, it only tracks "enter" and "exit" states for the
  69617. * components. It's up to you to give meaning and effect to those states. For
  69618. * example we can add styles to a component when it enters or exits:
  69619. *
  69620. * ```jsx
  69621. * import { Transition } from 'react-transition-group';
  69622. *
  69623. * const duration = 300;
  69624. *
  69625. * const defaultStyle = {
  69626. * transition: `opacity ${duration}ms ease-in-out`,
  69627. * opacity: 0,
  69628. * }
  69629. *
  69630. * const transitionStyles = {
  69631. * entering: { opacity: 1 },
  69632. * entered: { opacity: 1 },
  69633. * exiting: { opacity: 0 },
  69634. * exited: { opacity: 0 },
  69635. * };
  69636. *
  69637. * const Fade = ({ in: inProp }) => (
  69638. * <Transition in={inProp} timeout={duration}>
  69639. * {state => (
  69640. * <div style={{
  69641. * ...defaultStyle,
  69642. * ...transitionStyles[state]
  69643. * }}>
  69644. * I'm a fade Transition!
  69645. * </div>
  69646. * )}
  69647. * </Transition>
  69648. * );
  69649. * ```
  69650. *
  69651. * There are 4 main states a Transition can be in:
  69652. * - `'entering'`
  69653. * - `'entered'`
  69654. * - `'exiting'`
  69655. * - `'exited'`
  69656. *
  69657. * Transition state is toggled via the `in` prop. When `true` the component
  69658. * begins the "Enter" stage. During this stage, the component will shift from
  69659. * its current transition state, to `'entering'` for the duration of the
  69660. * transition and then to the `'entered'` stage once it's complete. Let's take
  69661. * the following example (we'll use the
  69662. * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
  69663. *
  69664. * ```jsx
  69665. * function App() {
  69666. * const [inProp, setInProp] = useState(false);
  69667. * return (
  69668. * <div>
  69669. * <Transition in={inProp} timeout={500}>
  69670. * {state => (
  69671. * // ...
  69672. * )}
  69673. * </Transition>
  69674. * <button onClick={() => setInProp(true)}>
  69675. * Click to Enter
  69676. * </button>
  69677. * </div>
  69678. * );
  69679. * }
  69680. * ```
  69681. *
  69682. * When the button is clicked the component will shift to the `'entering'` state
  69683. * and stay there for 500ms (the value of `timeout`) before it finally switches
  69684. * to `'entered'`.
  69685. *
  69686. * When `in` is `false` the same thing happens except the state moves from
  69687. * `'exiting'` to `'exited'`.
  69688. */
  69689. var Transition =
  69690. /*#__PURE__*/
  69691. function (_React$Component) {
  69692. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Transition, _React$Component);
  69693. function Transition(props, context) {
  69694. var _this;
  69695. _this = _React$Component.call(this, props, context) || this;
  69696. var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
  69697. var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
  69698. var initialStatus;
  69699. _this.appearStatus = null;
  69700. if (props.in) {
  69701. if (appear) {
  69702. initialStatus = EXITED;
  69703. _this.appearStatus = ENTERING;
  69704. } else {
  69705. initialStatus = ENTERED;
  69706. }
  69707. } else {
  69708. if (props.unmountOnExit || props.mountOnEnter) {
  69709. initialStatus = UNMOUNTED;
  69710. } else {
  69711. initialStatus = EXITED;
  69712. }
  69713. }
  69714. _this.state = {
  69715. status: initialStatus
  69716. };
  69717. _this.nextCallback = null;
  69718. return _this;
  69719. }
  69720. Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
  69721. var nextIn = _ref.in;
  69722. if (nextIn && prevState.status === UNMOUNTED) {
  69723. return {
  69724. status: EXITED
  69725. };
  69726. }
  69727. return null;
  69728. }; // getSnapshotBeforeUpdate(prevProps) {
  69729. // let nextStatus = null
  69730. // if (prevProps !== this.props) {
  69731. // const { status } = this.state
  69732. // if (this.props.in) {
  69733. // if (status !== ENTERING && status !== ENTERED) {
  69734. // nextStatus = ENTERING
  69735. // }
  69736. // } else {
  69737. // if (status === ENTERING || status === ENTERED) {
  69738. // nextStatus = EXITING
  69739. // }
  69740. // }
  69741. // }
  69742. // return { nextStatus }
  69743. // }
  69744. var _proto = Transition.prototype;
  69745. _proto.componentDidMount = function componentDidMount() {
  69746. this.updateStatus(true, this.appearStatus);
  69747. };
  69748. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  69749. var nextStatus = null;
  69750. if (prevProps !== this.props) {
  69751. var status = this.state.status;
  69752. if (this.props.in) {
  69753. if (status !== ENTERING && status !== ENTERED) {
  69754. nextStatus = ENTERING;
  69755. }
  69756. } else {
  69757. if (status === ENTERING || status === ENTERED) {
  69758. nextStatus = EXITING;
  69759. }
  69760. }
  69761. }
  69762. this.updateStatus(false, nextStatus);
  69763. };
  69764. _proto.componentWillUnmount = function componentWillUnmount() {
  69765. this.cancelNextCallback();
  69766. };
  69767. _proto.getTimeouts = function getTimeouts() {
  69768. var timeout = this.props.timeout;
  69769. var exit, enter, appear;
  69770. exit = enter = appear = timeout;
  69771. if (timeout != null && typeof timeout !== 'number') {
  69772. exit = timeout.exit;
  69773. enter = timeout.enter; // TODO: remove fallback for next major
  69774. appear = timeout.appear !== undefined ? timeout.appear : enter;
  69775. }
  69776. return {
  69777. exit: exit,
  69778. enter: enter,
  69779. appear: appear
  69780. };
  69781. };
  69782. _proto.updateStatus = function updateStatus(mounting, nextStatus) {
  69783. if (mounting === void 0) {
  69784. mounting = false;
  69785. }
  69786. if (nextStatus !== null) {
  69787. // nextStatus will always be ENTERING or EXITING.
  69788. this.cancelNextCallback();
  69789. var node = react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this);
  69790. if (nextStatus === ENTERING) {
  69791. this.performEnter(node, mounting);
  69792. } else {
  69793. this.performExit(node);
  69794. }
  69795. } else if (this.props.unmountOnExit && this.state.status === EXITED) {
  69796. this.setState({
  69797. status: UNMOUNTED
  69798. });
  69799. }
  69800. };
  69801. _proto.performEnter = function performEnter(node, mounting) {
  69802. var _this2 = this;
  69803. var enter = this.props.enter;
  69804. var appearing = this.context ? this.context.isMounting : mounting;
  69805. var timeouts = this.getTimeouts();
  69806. var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
  69807. // if we are mounting and running this it means appear _must_ be set
  69808. if (!mounting && !enter || _config__WEBPACK_IMPORTED_MODULE_5__["default"].disabled) {
  69809. this.safeSetState({
  69810. status: ENTERED
  69811. }, function () {
  69812. _this2.props.onEntered(node);
  69813. });
  69814. return;
  69815. }
  69816. this.props.onEnter(node, appearing);
  69817. this.safeSetState({
  69818. status: ENTERING
  69819. }, function () {
  69820. _this2.props.onEntering(node, appearing);
  69821. _this2.onTransitionEnd(node, enterTimeout, function () {
  69822. _this2.safeSetState({
  69823. status: ENTERED
  69824. }, function () {
  69825. _this2.props.onEntered(node, appearing);
  69826. });
  69827. });
  69828. });
  69829. };
  69830. _proto.performExit = function performExit(node) {
  69831. var _this3 = this;
  69832. var exit = this.props.exit;
  69833. var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
  69834. if (!exit || _config__WEBPACK_IMPORTED_MODULE_5__["default"].disabled) {
  69835. this.safeSetState({
  69836. status: EXITED
  69837. }, function () {
  69838. _this3.props.onExited(node);
  69839. });
  69840. return;
  69841. }
  69842. this.props.onExit(node);
  69843. this.safeSetState({
  69844. status: EXITING
  69845. }, function () {
  69846. _this3.props.onExiting(node);
  69847. _this3.onTransitionEnd(node, timeouts.exit, function () {
  69848. _this3.safeSetState({
  69849. status: EXITED
  69850. }, function () {
  69851. _this3.props.onExited(node);
  69852. });
  69853. });
  69854. });
  69855. };
  69856. _proto.cancelNextCallback = function cancelNextCallback() {
  69857. if (this.nextCallback !== null) {
  69858. this.nextCallback.cancel();
  69859. this.nextCallback = null;
  69860. }
  69861. };
  69862. _proto.safeSetState = function safeSetState(nextState, callback) {
  69863. // This shouldn't be necessary, but there are weird race conditions with
  69864. // setState callbacks and unmounting in testing, so always make sure that
  69865. // we can cancel any pending setState callbacks after we unmount.
  69866. callback = this.setNextCallback(callback);
  69867. this.setState(nextState, callback);
  69868. };
  69869. _proto.setNextCallback = function setNextCallback(callback) {
  69870. var _this4 = this;
  69871. var active = true;
  69872. this.nextCallback = function (event) {
  69873. if (active) {
  69874. active = false;
  69875. _this4.nextCallback = null;
  69876. callback(event);
  69877. }
  69878. };
  69879. this.nextCallback.cancel = function () {
  69880. active = false;
  69881. };
  69882. return this.nextCallback;
  69883. };
  69884. _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
  69885. this.setNextCallback(handler);
  69886. var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
  69887. if (!node || doesNotHaveTimeoutOrListener) {
  69888. setTimeout(this.nextCallback, 0);
  69889. return;
  69890. }
  69891. if (this.props.addEndListener) {
  69892. this.props.addEndListener(node, this.nextCallback);
  69893. }
  69894. if (timeout != null) {
  69895. setTimeout(this.nextCallback, timeout);
  69896. }
  69897. };
  69898. _proto.render = function render() {
  69899. var status = this.state.status;
  69900. if (status === UNMOUNTED) {
  69901. return null;
  69902. }
  69903. var _this$props = this.props,
  69904. children = _this$props.children,
  69905. childProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props, ["children"]); // filter props for Transtition
  69906. delete childProps.in;
  69907. delete childProps.mountOnEnter;
  69908. delete childProps.unmountOnExit;
  69909. delete childProps.appear;
  69910. delete childProps.enter;
  69911. delete childProps.exit;
  69912. delete childProps.timeout;
  69913. delete childProps.addEndListener;
  69914. delete childProps.onEnter;
  69915. delete childProps.onEntering;
  69916. delete childProps.onEntered;
  69917. delete childProps.onExit;
  69918. delete childProps.onExiting;
  69919. delete childProps.onExited;
  69920. if (typeof children === 'function') {
  69921. // allows for nested Transitions
  69922. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
  69923. value: null
  69924. }, children(status, childProps));
  69925. }
  69926. var child = react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.only(children);
  69927. return (// allows for nested Transitions
  69928. react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
  69929. value: null
  69930. }, react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(child, childProps))
  69931. );
  69932. };
  69933. return Transition;
  69934. }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
  69935. Transition.contextType = _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__["default"];
  69936. Transition.propTypes = true ? {
  69937. /**
  69938. * A `function` child can be used instead of a React element. This function is
  69939. * called with the current transition status (`'entering'`, `'entered'`,
  69940. * `'exiting'`, `'exited'`), which can be used to apply context
  69941. * specific props to a component.
  69942. *
  69943. * ```jsx
  69944. * <Transition in={this.state.in} timeout={150}>
  69945. * {state => (
  69946. * <MyComponent className={`fade fade-${state}`} />
  69947. * )}
  69948. * </Transition>
  69949. * ```
  69950. */
  69951. children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element.isRequired]).isRequired,
  69952. /**
  69953. * Show the component; triggers the enter or exit states
  69954. */
  69955. in: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
  69956. /**
  69957. * By default the child component is mounted immediately along with
  69958. * the parent `Transition` component. If you want to "lazy mount" the component on the
  69959. * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
  69960. * mounted, even on "exited", unless you also specify `unmountOnExit`.
  69961. */
  69962. mountOnEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
  69963. /**
  69964. * By default the child component stays mounted after it reaches the `'exited'` state.
  69965. * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
  69966. */
  69967. unmountOnExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
  69968. /**
  69969. * Normally a component is not transitioned if it is shown when the
  69970. * `<Transition>` component mounts. If you want to transition on the first
  69971. * mount set `appear` to `true`, and the component will transition in as soon
  69972. * as the `<Transition>` mounts.
  69973. *
  69974. * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
  69975. * > only adds an additional enter transition. However, in the
  69976. * > `<CSSTransition>` component that first enter transition does result in
  69977. * > additional `.appear-*` classes, that way you can choose to style it
  69978. * > differently.
  69979. */
  69980. appear: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
  69981. /**
  69982. * Enable or disable enter transitions.
  69983. */
  69984. enter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
  69985. /**
  69986. * Enable or disable exit transitions.
  69987. */
  69988. exit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
  69989. /**
  69990. * The duration of the transition, in milliseconds.
  69991. * Required unless `addEndListener` is provided.
  69992. *
  69993. * You may specify a single timeout for all transitions:
  69994. *
  69995. * ```jsx
  69996. * timeout={500}
  69997. * ```
  69998. *
  69999. * or individually:
  70000. *
  70001. * ```jsx
  70002. * timeout={{
  70003. * appear: 500,
  70004. * enter: 300,
  70005. * exit: 500,
  70006. * }}
  70007. * ```
  70008. *
  70009. * - `appear` defaults to the value of `enter`
  70010. * - `enter` defaults to `0`
  70011. * - `exit` defaults to `0`
  70012. *
  70013. * @type {number | { enter?: number, exit?: number, appear?: number }}
  70014. */
  70015. timeout: function timeout(props) {
  70016. var pt = _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__["timeoutsShape"];
  70017. if (!props.addEndListener) pt = pt.isRequired;
  70018. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  70019. args[_key - 1] = arguments[_key];
  70020. }
  70021. return pt.apply(void 0, [props].concat(args));
  70022. },
  70023. /**
  70024. * Add a custom transition end trigger. Called with the transitioning
  70025. * DOM node and a `done` callback. Allows for more fine grained transition end
  70026. * logic. **Note:** Timeouts are still used as a fallback if provided.
  70027. *
  70028. * ```jsx
  70029. * addEndListener={(node, done) => {
  70030. * // use the css transitionend event to mark the finish of a transition
  70031. * node.addEventListener('transitionend', done, false);
  70032. * }}
  70033. * ```
  70034. */
  70035. addEndListener: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
  70036. /**
  70037. * Callback fired before the "entering" status is applied. An extra parameter
  70038. * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
  70039. *
  70040. * @type Function(node: HtmlElement, isAppearing: bool) -> void
  70041. */
  70042. onEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
  70043. /**
  70044. * Callback fired after the "entering" status is applied. An extra parameter
  70045. * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
  70046. *
  70047. * @type Function(node: HtmlElement, isAppearing: bool)
  70048. */
  70049. onEntering: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
  70050. /**
  70051. * Callback fired after the "entered" status is applied. An extra parameter
  70052. * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
  70053. *
  70054. * @type Function(node: HtmlElement, isAppearing: bool) -> void
  70055. */
  70056. onEntered: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
  70057. /**
  70058. * Callback fired before the "exiting" status is applied.
  70059. *
  70060. * @type Function(node: HtmlElement) -> void
  70061. */
  70062. onExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
  70063. /**
  70064. * Callback fired after the "exiting" status is applied.
  70065. *
  70066. * @type Function(node: HtmlElement) -> void
  70067. */
  70068. onExiting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
  70069. /**
  70070. * Callback fired after the "exited" status is applied.
  70071. *
  70072. * @type Function(node: HtmlElement) -> void
  70073. */
  70074. onExited: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func // Name the function so it is clearer in the documentation
  70075. } : undefined;
  70076. function noop() {}
  70077. Transition.defaultProps = {
  70078. in: false,
  70079. mountOnEnter: false,
  70080. unmountOnExit: false,
  70081. appear: false,
  70082. enter: true,
  70083. exit: true,
  70084. onEnter: noop,
  70085. onEntering: noop,
  70086. onEntered: noop,
  70087. onExit: noop,
  70088. onExiting: noop,
  70089. onExited: noop
  70090. };
  70091. Transition.UNMOUNTED = 0;
  70092. Transition.EXITED = 1;
  70093. Transition.ENTERING = 2;
  70094. Transition.ENTERED = 3;
  70095. Transition.EXITING = 4;
  70096. /* harmony default export */ __webpack_exports__["default"] = (Transition);
  70097. /***/ }),
  70098. /***/ "./node_modules/react-transition-group/esm/TransitionGroupContext.js":
  70099. /*!***************************************************************************!*\
  70100. !*** ./node_modules/react-transition-group/esm/TransitionGroupContext.js ***!
  70101. \***************************************************************************/
  70102. /*! exports provided: default */
  70103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70104. "use strict";
  70105. __webpack_require__.r(__webpack_exports__);
  70106. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  70107. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  70108. /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
  70109. /***/ }),
  70110. /***/ "./node_modules/react-transition-group/esm/config.js":
  70111. /*!***********************************************************!*\
  70112. !*** ./node_modules/react-transition-group/esm/config.js ***!
  70113. \***********************************************************/
  70114. /*! exports provided: default */
  70115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70116. "use strict";
  70117. __webpack_require__.r(__webpack_exports__);
  70118. /* harmony default export */ __webpack_exports__["default"] = ({
  70119. disabled: false
  70120. });
  70121. /***/ }),
  70122. /***/ "./node_modules/react-transition-group/esm/utils/PropTypes.js":
  70123. /*!********************************************************************!*\
  70124. !*** ./node_modules/react-transition-group/esm/utils/PropTypes.js ***!
  70125. \********************************************************************/
  70126. /*! exports provided: timeoutsShape, classNamesShape */
  70127. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70128. "use strict";
  70129. __webpack_require__.r(__webpack_exports__);
  70130. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutsShape", function() { return timeoutsShape; });
  70131. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classNamesShape", function() { return classNamesShape; });
  70132. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
  70133. /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
  70134. var timeoutsShape = true ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({
  70135. enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,
  70136. exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,
  70137. appear: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number
  70138. }).isRequired]) : undefined;
  70139. var classNamesShape = true ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({
  70140. enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
  70141. exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
  70142. active: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string
  70143. }), prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({
  70144. enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
  70145. enterDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
  70146. enterActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
  70147. exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
  70148. exitDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
  70149. exitActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string
  70150. })]) : undefined;
  70151. /***/ }),
  70152. /***/ "./node_modules/react/cjs/react.development.js":
  70153. /*!*****************************************************!*\
  70154. !*** ./node_modules/react/cjs/react.development.js ***!
  70155. \*****************************************************/
  70156. /*! no static exports found */
  70157. /***/ (function(module, exports, __webpack_require__) {
  70158. "use strict";
  70159. /** @license React v16.12.0
  70160. * react.development.js
  70161. *
  70162. * Copyright (c) Facebook, Inc. and its affiliates.
  70163. *
  70164. * This source code is licensed under the MIT license found in the
  70165. * LICENSE file in the root directory of this source tree.
  70166. */
  70167. if (true) {
  70168. (function() {
  70169. 'use strict';
  70170. var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
  70171. var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
  70172. // TODO: this is special because it gets imported during build.
  70173. var ReactVersion = '16.12.0';
  70174. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  70175. // nor polyfill, then a plain number is used for performance.
  70176. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  70177. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  70178. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  70179. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  70180. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  70181. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  70182. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  70183. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  70184. // (unstable) APIs that have been removed. Can we remove the symbols?
  70185. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  70186. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  70187. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  70188. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  70189. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  70190. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  70191. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  70192. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  70193. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  70194. var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  70195. var FAUX_ITERATOR_SYMBOL = '@@iterator';
  70196. function getIteratorFn(maybeIterable) {
  70197. if (maybeIterable === null || typeof maybeIterable !== 'object') {
  70198. return null;
  70199. }
  70200. var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  70201. if (typeof maybeIterator === 'function') {
  70202. return maybeIterator;
  70203. }
  70204. return null;
  70205. }
  70206. // Do not require this module directly! Use normal `invariant` calls with
  70207. // template literal strings. The messages will be replaced with error codes
  70208. // during build.
  70209. /**
  70210. * Use invariant() to assert state which your program assumes to be true.
  70211. *
  70212. * Provide sprintf-style format (only %s is supported) and arguments
  70213. * to provide information about what broke and what you were
  70214. * expecting.
  70215. *
  70216. * The invariant message will be stripped in production, but the invariant
  70217. * will remain to ensure logic does not differ in production.
  70218. */
  70219. /**
  70220. * Forked from fbjs/warning:
  70221. * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
  70222. *
  70223. * Only change is we use console.warn instead of console.error,
  70224. * and do nothing when 'console' is not supported.
  70225. * This really simplifies the code.
  70226. * ---
  70227. * Similar to invariant but only logs a warning if the condition is not met.
  70228. * This can be used to log issues in development environments in critical
  70229. * paths. Removing the logging code for production environments will keep the
  70230. * same logic and follow the same code paths.
  70231. */
  70232. var lowPriorityWarningWithoutStack = function () {};
  70233. {
  70234. var printWarning = function (format) {
  70235. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  70236. args[_key - 1] = arguments[_key];
  70237. }
  70238. var argIndex = 0;
  70239. var message = 'Warning: ' + format.replace(/%s/g, function () {
  70240. return args[argIndex++];
  70241. });
  70242. if (typeof console !== 'undefined') {
  70243. console.warn(message);
  70244. }
  70245. try {
  70246. // --- Welcome to debugging React ---
  70247. // This error was thrown as a convenience so that you can use this stack
  70248. // to find the callsite that caused this warning to fire.
  70249. throw new Error(message);
  70250. } catch (x) {}
  70251. };
  70252. lowPriorityWarningWithoutStack = function (condition, format) {
  70253. if (format === undefined) {
  70254. throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  70255. }
  70256. if (!condition) {
  70257. for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  70258. args[_key2 - 2] = arguments[_key2];
  70259. }
  70260. printWarning.apply(void 0, [format].concat(args));
  70261. }
  70262. };
  70263. }
  70264. var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
  70265. /**
  70266. * Similar to invariant but only logs a warning if the condition is not met.
  70267. * This can be used to log issues in development environments in critical
  70268. * paths. Removing the logging code for production environments will keep the
  70269. * same logic and follow the same code paths.
  70270. */
  70271. var warningWithoutStack = function () {};
  70272. {
  70273. warningWithoutStack = function (condition, format) {
  70274. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  70275. args[_key - 2] = arguments[_key];
  70276. }
  70277. if (format === undefined) {
  70278. throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  70279. }
  70280. if (args.length > 8) {
  70281. // Check before the condition to catch violations early.
  70282. throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
  70283. }
  70284. if (condition) {
  70285. return;
  70286. }
  70287. if (typeof console !== 'undefined') {
  70288. var argsWithFormat = args.map(function (item) {
  70289. return '' + item;
  70290. });
  70291. argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
  70292. // breaks IE9: https://github.com/facebook/react/issues/13610
  70293. Function.prototype.apply.call(console.error, console, argsWithFormat);
  70294. }
  70295. try {
  70296. // --- Welcome to debugging React ---
  70297. // This error was thrown as a convenience so that you can use this stack
  70298. // to find the callsite that caused this warning to fire.
  70299. var argIndex = 0;
  70300. var message = 'Warning: ' + format.replace(/%s/g, function () {
  70301. return args[argIndex++];
  70302. });
  70303. throw new Error(message);
  70304. } catch (x) {}
  70305. };
  70306. }
  70307. var warningWithoutStack$1 = warningWithoutStack;
  70308. var didWarnStateUpdateForUnmountedComponent = {};
  70309. function warnNoop(publicInstance, callerName) {
  70310. {
  70311. var _constructor = publicInstance.constructor;
  70312. var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
  70313. var warningKey = componentName + "." + callerName;
  70314. if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
  70315. return;
  70316. }
  70317. warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
  70318. didWarnStateUpdateForUnmountedComponent[warningKey] = true;
  70319. }
  70320. }
  70321. /**
  70322. * This is the abstract API for an update queue.
  70323. */
  70324. var ReactNoopUpdateQueue = {
  70325. /**
  70326. * Checks whether or not this composite component is mounted.
  70327. * @param {ReactClass} publicInstance The instance we want to test.
  70328. * @return {boolean} True if mounted, false otherwise.
  70329. * @protected
  70330. * @final
  70331. */
  70332. isMounted: function (publicInstance) {
  70333. return false;
  70334. },
  70335. /**
  70336. * Forces an update. This should only be invoked when it is known with
  70337. * certainty that we are **not** in a DOM transaction.
  70338. *
  70339. * You may want to call this when you know that some deeper aspect of the
  70340. * component's state has changed but `setState` was not called.
  70341. *
  70342. * This will not invoke `shouldComponentUpdate`, but it will invoke
  70343. * `componentWillUpdate` and `componentDidUpdate`.
  70344. *
  70345. * @param {ReactClass} publicInstance The instance that should rerender.
  70346. * @param {?function} callback Called after component is updated.
  70347. * @param {?string} callerName name of the calling function in the public API.
  70348. * @internal
  70349. */
  70350. enqueueForceUpdate: function (publicInstance, callback, callerName) {
  70351. warnNoop(publicInstance, 'forceUpdate');
  70352. },
  70353. /**
  70354. * Replaces all of the state. Always use this or `setState` to mutate state.
  70355. * You should treat `this.state` as immutable.
  70356. *
  70357. * There is no guarantee that `this.state` will be immediately updated, so
  70358. * accessing `this.state` after calling this method may return the old value.
  70359. *
  70360. * @param {ReactClass} publicInstance The instance that should rerender.
  70361. * @param {object} completeState Next state.
  70362. * @param {?function} callback Called after component is updated.
  70363. * @param {?string} callerName name of the calling function in the public API.
  70364. * @internal
  70365. */
  70366. enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
  70367. warnNoop(publicInstance, 'replaceState');
  70368. },
  70369. /**
  70370. * Sets a subset of the state. This only exists because _pendingState is
  70371. * internal. This provides a merging strategy that is not available to deep
  70372. * properties which is confusing. TODO: Expose pendingState or don't use it
  70373. * during the merge.
  70374. *
  70375. * @param {ReactClass} publicInstance The instance that should rerender.
  70376. * @param {object} partialState Next partial state to be merged with state.
  70377. * @param {?function} callback Called after component is updated.
  70378. * @param {?string} Name of the calling function in the public API.
  70379. * @internal
  70380. */
  70381. enqueueSetState: function (publicInstance, partialState, callback, callerName) {
  70382. warnNoop(publicInstance, 'setState');
  70383. }
  70384. };
  70385. var emptyObject = {};
  70386. {
  70387. Object.freeze(emptyObject);
  70388. }
  70389. /**
  70390. * Base class helpers for the updating state of a component.
  70391. */
  70392. function Component(props, context, updater) {
  70393. this.props = props;
  70394. this.context = context; // If a component has string refs, we will assign a different object later.
  70395. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
  70396. // renderer.
  70397. this.updater = updater || ReactNoopUpdateQueue;
  70398. }
  70399. Component.prototype.isReactComponent = {};
  70400. /**
  70401. * Sets a subset of the state. Always use this to mutate
  70402. * state. You should treat `this.state` as immutable.
  70403. *
  70404. * There is no guarantee that `this.state` will be immediately updated, so
  70405. * accessing `this.state` after calling this method may return the old value.
  70406. *
  70407. * There is no guarantee that calls to `setState` will run synchronously,
  70408. * as they may eventually be batched together. You can provide an optional
  70409. * callback that will be executed when the call to setState is actually
  70410. * completed.
  70411. *
  70412. * When a function is provided to setState, it will be called at some point in
  70413. * the future (not synchronously). It will be called with the up to date
  70414. * component arguments (state, props, context). These values can be different
  70415. * from this.* because your function may be called after receiveProps but before
  70416. * shouldComponentUpdate, and this new state, props, and context will not yet be
  70417. * assigned to this.
  70418. *
  70419. * @param {object|function} partialState Next partial state or function to
  70420. * produce next partial state to be merged with current state.
  70421. * @param {?function} callback Called after state is updated.
  70422. * @final
  70423. * @protected
  70424. */
  70425. Component.prototype.setState = function (partialState, callback) {
  70426. if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
  70427. {
  70428. throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
  70429. }
  70430. }
  70431. this.updater.enqueueSetState(this, partialState, callback, 'setState');
  70432. };
  70433. /**
  70434. * Forces an update. This should only be invoked when it is known with
  70435. * certainty that we are **not** in a DOM transaction.
  70436. *
  70437. * You may want to call this when you know that some deeper aspect of the
  70438. * component's state has changed but `setState` was not called.
  70439. *
  70440. * This will not invoke `shouldComponentUpdate`, but it will invoke
  70441. * `componentWillUpdate` and `componentDidUpdate`.
  70442. *
  70443. * @param {?function} callback Called after update is complete.
  70444. * @final
  70445. * @protected
  70446. */
  70447. Component.prototype.forceUpdate = function (callback) {
  70448. this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
  70449. };
  70450. /**
  70451. * Deprecated APIs. These APIs used to exist on classic React classes but since
  70452. * we would like to deprecate them, we're not going to move them over to this
  70453. * modern base class. Instead, we define a getter that warns if it's accessed.
  70454. */
  70455. {
  70456. var deprecatedAPIs = {
  70457. isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
  70458. replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  70459. };
  70460. var defineDeprecationWarning = function (methodName, info) {
  70461. Object.defineProperty(Component.prototype, methodName, {
  70462. get: function () {
  70463. lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
  70464. return undefined;
  70465. }
  70466. });
  70467. };
  70468. for (var fnName in deprecatedAPIs) {
  70469. if (deprecatedAPIs.hasOwnProperty(fnName)) {
  70470. defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
  70471. }
  70472. }
  70473. }
  70474. function ComponentDummy() {}
  70475. ComponentDummy.prototype = Component.prototype;
  70476. /**
  70477. * Convenience component with default shallow equality check for sCU.
  70478. */
  70479. function PureComponent(props, context, updater) {
  70480. this.props = props;
  70481. this.context = context; // If a component has string refs, we will assign a different object later.
  70482. this.refs = emptyObject;
  70483. this.updater = updater || ReactNoopUpdateQueue;
  70484. }
  70485. var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
  70486. pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
  70487. _assign(pureComponentPrototype, Component.prototype);
  70488. pureComponentPrototype.isPureReactComponent = true;
  70489. // an immutable object with a single mutable value
  70490. function createRef() {
  70491. var refObject = {
  70492. current: null
  70493. };
  70494. {
  70495. Object.seal(refObject);
  70496. }
  70497. return refObject;
  70498. }
  70499. /**
  70500. * Keeps track of the current dispatcher.
  70501. */
  70502. var ReactCurrentDispatcher = {
  70503. /**
  70504. * @internal
  70505. * @type {ReactComponent}
  70506. */
  70507. current: null
  70508. };
  70509. /**
  70510. * Keeps track of the current batch's configuration such as how long an update
  70511. * should suspend for if it needs to.
  70512. */
  70513. var ReactCurrentBatchConfig = {
  70514. suspense: null
  70515. };
  70516. /**
  70517. * Keeps track of the current owner.
  70518. *
  70519. * The current owner is the component who should own any components that are
  70520. * currently being constructed.
  70521. */
  70522. var ReactCurrentOwner = {
  70523. /**
  70524. * @internal
  70525. * @type {ReactComponent}
  70526. */
  70527. current: null
  70528. };
  70529. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  70530. var describeComponentFrame = function (name, source, ownerName) {
  70531. var sourceInfo = '';
  70532. if (source) {
  70533. var path = source.fileName;
  70534. var fileName = path.replace(BEFORE_SLASH_RE, '');
  70535. {
  70536. // In DEV, include code for a common special case:
  70537. // prefer "folder/index.js" instead of just "index.js".
  70538. if (/^index\./.test(fileName)) {
  70539. var match = path.match(BEFORE_SLASH_RE);
  70540. if (match) {
  70541. var pathBeforeSlash = match[1];
  70542. if (pathBeforeSlash) {
  70543. var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
  70544. fileName = folderName + '/' + fileName;
  70545. }
  70546. }
  70547. }
  70548. }
  70549. sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  70550. } else if (ownerName) {
  70551. sourceInfo = ' (created by ' + ownerName + ')';
  70552. }
  70553. return '\n in ' + (name || 'Unknown') + sourceInfo;
  70554. };
  70555. var Resolved = 1;
  70556. function refineResolvedLazyComponent(lazyComponent) {
  70557. return lazyComponent._status === Resolved ? lazyComponent._result : null;
  70558. }
  70559. function getWrappedName(outerType, innerType, wrapperName) {
  70560. var functionName = innerType.displayName || innerType.name || '';
  70561. return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
  70562. }
  70563. function getComponentName(type) {
  70564. if (type == null) {
  70565. // Host root, text node or just invalid type.
  70566. return null;
  70567. }
  70568. {
  70569. if (typeof type.tag === 'number') {
  70570. warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
  70571. }
  70572. }
  70573. if (typeof type === 'function') {
  70574. return type.displayName || type.name || null;
  70575. }
  70576. if (typeof type === 'string') {
  70577. return type;
  70578. }
  70579. switch (type) {
  70580. case REACT_FRAGMENT_TYPE:
  70581. return 'Fragment';
  70582. case REACT_PORTAL_TYPE:
  70583. return 'Portal';
  70584. case REACT_PROFILER_TYPE:
  70585. return "Profiler";
  70586. case REACT_STRICT_MODE_TYPE:
  70587. return 'StrictMode';
  70588. case REACT_SUSPENSE_TYPE:
  70589. return 'Suspense';
  70590. case REACT_SUSPENSE_LIST_TYPE:
  70591. return 'SuspenseList';
  70592. }
  70593. if (typeof type === 'object') {
  70594. switch (type.$$typeof) {
  70595. case REACT_CONTEXT_TYPE:
  70596. return 'Context.Consumer';
  70597. case REACT_PROVIDER_TYPE:
  70598. return 'Context.Provider';
  70599. case REACT_FORWARD_REF_TYPE:
  70600. return getWrappedName(type, type.render, 'ForwardRef');
  70601. case REACT_MEMO_TYPE:
  70602. return getComponentName(type.type);
  70603. case REACT_LAZY_TYPE:
  70604. {
  70605. var thenable = type;
  70606. var resolvedThenable = refineResolvedLazyComponent(thenable);
  70607. if (resolvedThenable) {
  70608. return getComponentName(resolvedThenable);
  70609. }
  70610. break;
  70611. }
  70612. }
  70613. }
  70614. return null;
  70615. }
  70616. var ReactDebugCurrentFrame = {};
  70617. var currentlyValidatingElement = null;
  70618. function setCurrentlyValidatingElement(element) {
  70619. {
  70620. currentlyValidatingElement = element;
  70621. }
  70622. }
  70623. {
  70624. // Stack implementation injected by the current renderer.
  70625. ReactDebugCurrentFrame.getCurrentStack = null;
  70626. ReactDebugCurrentFrame.getStackAddendum = function () {
  70627. var stack = ''; // Add an extra top frame while an element is being validated
  70628. if (currentlyValidatingElement) {
  70629. var name = getComponentName(currentlyValidatingElement.type);
  70630. var owner = currentlyValidatingElement._owner;
  70631. stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
  70632. } // Delegate to the injected renderer-specific implementation
  70633. var impl = ReactDebugCurrentFrame.getCurrentStack;
  70634. if (impl) {
  70635. stack += impl() || '';
  70636. }
  70637. return stack;
  70638. };
  70639. }
  70640. /**
  70641. * Used by act() to track whether you're inside an act() scope.
  70642. */
  70643. var IsSomeRendererActing = {
  70644. current: false
  70645. };
  70646. var ReactSharedInternals = {
  70647. ReactCurrentDispatcher: ReactCurrentDispatcher,
  70648. ReactCurrentBatchConfig: ReactCurrentBatchConfig,
  70649. ReactCurrentOwner: ReactCurrentOwner,
  70650. IsSomeRendererActing: IsSomeRendererActing,
  70651. // Used by renderers to avoid bundling object-assign twice in UMD bundles:
  70652. assign: _assign
  70653. };
  70654. {
  70655. _assign(ReactSharedInternals, {
  70656. // These should not be included in production.
  70657. ReactDebugCurrentFrame: ReactDebugCurrentFrame,
  70658. // Shim for React DOM 16.0.0 which still destructured (but not used) this.
  70659. // TODO: remove in React 17.0.
  70660. ReactComponentTreeHook: {}
  70661. });
  70662. }
  70663. /**
  70664. * Similar to invariant but only logs a warning if the condition is not met.
  70665. * This can be used to log issues in development environments in critical
  70666. * paths. Removing the logging code for production environments will keep the
  70667. * same logic and follow the same code paths.
  70668. */
  70669. var warning = warningWithoutStack$1;
  70670. {
  70671. warning = function (condition, format) {
  70672. if (condition) {
  70673. return;
  70674. }
  70675. var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  70676. var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
  70677. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  70678. args[_key - 2] = arguments[_key];
  70679. }
  70680. warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
  70681. };
  70682. }
  70683. var warning$1 = warning;
  70684. var hasOwnProperty = Object.prototype.hasOwnProperty;
  70685. var RESERVED_PROPS = {
  70686. key: true,
  70687. ref: true,
  70688. __self: true,
  70689. __source: true
  70690. };
  70691. var specialPropKeyWarningShown;
  70692. var specialPropRefWarningShown;
  70693. function hasValidRef(config) {
  70694. {
  70695. if (hasOwnProperty.call(config, 'ref')) {
  70696. var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
  70697. if (getter && getter.isReactWarning) {
  70698. return false;
  70699. }
  70700. }
  70701. }
  70702. return config.ref !== undefined;
  70703. }
  70704. function hasValidKey(config) {
  70705. {
  70706. if (hasOwnProperty.call(config, 'key')) {
  70707. var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
  70708. if (getter && getter.isReactWarning) {
  70709. return false;
  70710. }
  70711. }
  70712. }
  70713. return config.key !== undefined;
  70714. }
  70715. function defineKeyPropWarningGetter(props, displayName) {
  70716. var warnAboutAccessingKey = function () {
  70717. if (!specialPropKeyWarningShown) {
  70718. specialPropKeyWarningShown = true;
  70719. warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
  70720. }
  70721. };
  70722. warnAboutAccessingKey.isReactWarning = true;
  70723. Object.defineProperty(props, 'key', {
  70724. get: warnAboutAccessingKey,
  70725. configurable: true
  70726. });
  70727. }
  70728. function defineRefPropWarningGetter(props, displayName) {
  70729. var warnAboutAccessingRef = function () {
  70730. if (!specialPropRefWarningShown) {
  70731. specialPropRefWarningShown = true;
  70732. warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
  70733. }
  70734. };
  70735. warnAboutAccessingRef.isReactWarning = true;
  70736. Object.defineProperty(props, 'ref', {
  70737. get: warnAboutAccessingRef,
  70738. configurable: true
  70739. });
  70740. }
  70741. /**
  70742. * Factory method to create a new React element. This no longer adheres to
  70743. * the class pattern, so do not use new to call it. Also, instanceof check
  70744. * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
  70745. * if something is a React Element.
  70746. *
  70747. * @param {*} type
  70748. * @param {*} props
  70749. * @param {*} key
  70750. * @param {string|object} ref
  70751. * @param {*} owner
  70752. * @param {*} self A *temporary* helper to detect places where `this` is
  70753. * different from the `owner` when React.createElement is called, so that we
  70754. * can warn. We want to get rid of owner and replace string `ref`s with arrow
  70755. * functions, and as long as `this` and owner are the same, there will be no
  70756. * change in behavior.
  70757. * @param {*} source An annotation object (added by a transpiler or otherwise)
  70758. * indicating filename, line number, and/or other information.
  70759. * @internal
  70760. */
  70761. var ReactElement = function (type, key, ref, self, source, owner, props) {
  70762. var element = {
  70763. // This tag allows us to uniquely identify this as a React Element
  70764. $$typeof: REACT_ELEMENT_TYPE,
  70765. // Built-in properties that belong on the element
  70766. type: type,
  70767. key: key,
  70768. ref: ref,
  70769. props: props,
  70770. // Record the component responsible for creating this element.
  70771. _owner: owner
  70772. };
  70773. {
  70774. // The validation flag is currently mutative. We put it on
  70775. // an external backing store so that we can freeze the whole object.
  70776. // This can be replaced with a WeakMap once they are implemented in
  70777. // commonly used development environments.
  70778. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
  70779. // the validation flag non-enumerable (where possible, which should
  70780. // include every environment we run tests in), so the test framework
  70781. // ignores it.
  70782. Object.defineProperty(element._store, 'validated', {
  70783. configurable: false,
  70784. enumerable: false,
  70785. writable: true,
  70786. value: false
  70787. }); // self and source are DEV only properties.
  70788. Object.defineProperty(element, '_self', {
  70789. configurable: false,
  70790. enumerable: false,
  70791. writable: false,
  70792. value: self
  70793. }); // Two elements created in two different places should be considered
  70794. // equal for testing purposes and therefore we hide it from enumeration.
  70795. Object.defineProperty(element, '_source', {
  70796. configurable: false,
  70797. enumerable: false,
  70798. writable: false,
  70799. value: source
  70800. });
  70801. if (Object.freeze) {
  70802. Object.freeze(element.props);
  70803. Object.freeze(element);
  70804. }
  70805. }
  70806. return element;
  70807. };
  70808. /**
  70809. * https://github.com/reactjs/rfcs/pull/107
  70810. * @param {*} type
  70811. * @param {object} props
  70812. * @param {string} key
  70813. */
  70814. /**
  70815. * https://github.com/reactjs/rfcs/pull/107
  70816. * @param {*} type
  70817. * @param {object} props
  70818. * @param {string} key
  70819. */
  70820. function jsxDEV(type, config, maybeKey, source, self) {
  70821. var propName; // Reserved names are extracted
  70822. var props = {};
  70823. var key = null;
  70824. var ref = null; // Currently, key can be spread in as a prop. This causes a potential
  70825. // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
  70826. // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
  70827. // but as an intermediary step, we will use jsxDEV for everything except
  70828. // <div {...props} key="Hi" />, because we aren't currently able to tell if
  70829. // key is explicitly declared to be undefined or not.
  70830. if (maybeKey !== undefined) {
  70831. key = '' + maybeKey;
  70832. }
  70833. if (hasValidKey(config)) {
  70834. key = '' + config.key;
  70835. }
  70836. if (hasValidRef(config)) {
  70837. ref = config.ref;
  70838. } // Remaining properties are added to a new props object
  70839. for (propName in config) {
  70840. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  70841. props[propName] = config[propName];
  70842. }
  70843. } // Resolve default props
  70844. if (type && type.defaultProps) {
  70845. var defaultProps = type.defaultProps;
  70846. for (propName in defaultProps) {
  70847. if (props[propName] === undefined) {
  70848. props[propName] = defaultProps[propName];
  70849. }
  70850. }
  70851. }
  70852. if (key || ref) {
  70853. var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
  70854. if (key) {
  70855. defineKeyPropWarningGetter(props, displayName);
  70856. }
  70857. if (ref) {
  70858. defineRefPropWarningGetter(props, displayName);
  70859. }
  70860. }
  70861. return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  70862. }
  70863. /**
  70864. * Create and return a new ReactElement of the given type.
  70865. * See https://reactjs.org/docs/react-api.html#createelement
  70866. */
  70867. function createElement(type, config, children) {
  70868. var propName; // Reserved names are extracted
  70869. var props = {};
  70870. var key = null;
  70871. var ref = null;
  70872. var self = null;
  70873. var source = null;
  70874. if (config != null) {
  70875. if (hasValidRef(config)) {
  70876. ref = config.ref;
  70877. }
  70878. if (hasValidKey(config)) {
  70879. key = '' + config.key;
  70880. }
  70881. self = config.__self === undefined ? null : config.__self;
  70882. source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
  70883. for (propName in config) {
  70884. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  70885. props[propName] = config[propName];
  70886. }
  70887. }
  70888. } // Children can be more than one argument, and those are transferred onto
  70889. // the newly allocated props object.
  70890. var childrenLength = arguments.length - 2;
  70891. if (childrenLength === 1) {
  70892. props.children = children;
  70893. } else if (childrenLength > 1) {
  70894. var childArray = Array(childrenLength);
  70895. for (var i = 0; i < childrenLength; i++) {
  70896. childArray[i] = arguments[i + 2];
  70897. }
  70898. {
  70899. if (Object.freeze) {
  70900. Object.freeze(childArray);
  70901. }
  70902. }
  70903. props.children = childArray;
  70904. } // Resolve default props
  70905. if (type && type.defaultProps) {
  70906. var defaultProps = type.defaultProps;
  70907. for (propName in defaultProps) {
  70908. if (props[propName] === undefined) {
  70909. props[propName] = defaultProps[propName];
  70910. }
  70911. }
  70912. }
  70913. {
  70914. if (key || ref) {
  70915. var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
  70916. if (key) {
  70917. defineKeyPropWarningGetter(props, displayName);
  70918. }
  70919. if (ref) {
  70920. defineRefPropWarningGetter(props, displayName);
  70921. }
  70922. }
  70923. }
  70924. return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  70925. }
  70926. /**
  70927. * Return a function that produces ReactElements of a given type.
  70928. * See https://reactjs.org/docs/react-api.html#createfactory
  70929. */
  70930. function cloneAndReplaceKey(oldElement, newKey) {
  70931. var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  70932. return newElement;
  70933. }
  70934. /**
  70935. * Clone and return a new ReactElement using element as the starting point.
  70936. * See https://reactjs.org/docs/react-api.html#cloneelement
  70937. */
  70938. function cloneElement(element, config, children) {
  70939. if (!!(element === null || element === undefined)) {
  70940. {
  70941. throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
  70942. }
  70943. }
  70944. var propName; // Original props are copied
  70945. var props = _assign({}, element.props); // Reserved names are extracted
  70946. var key = element.key;
  70947. var ref = element.ref; // Self is preserved since the owner is preserved.
  70948. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
  70949. // transpiler, and the original source is probably a better indicator of the
  70950. // true owner.
  70951. var source = element._source; // Owner will be preserved, unless ref is overridden
  70952. var owner = element._owner;
  70953. if (config != null) {
  70954. if (hasValidRef(config)) {
  70955. // Silently steal the ref from the parent.
  70956. ref = config.ref;
  70957. owner = ReactCurrentOwner.current;
  70958. }
  70959. if (hasValidKey(config)) {
  70960. key = '' + config.key;
  70961. } // Remaining properties override existing props
  70962. var defaultProps;
  70963. if (element.type && element.type.defaultProps) {
  70964. defaultProps = element.type.defaultProps;
  70965. }
  70966. for (propName in config) {
  70967. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  70968. if (config[propName] === undefined && defaultProps !== undefined) {
  70969. // Resolve default props
  70970. props[propName] = defaultProps[propName];
  70971. } else {
  70972. props[propName] = config[propName];
  70973. }
  70974. }
  70975. }
  70976. } // Children can be more than one argument, and those are transferred onto
  70977. // the newly allocated props object.
  70978. var childrenLength = arguments.length - 2;
  70979. if (childrenLength === 1) {
  70980. props.children = children;
  70981. } else if (childrenLength > 1) {
  70982. var childArray = Array(childrenLength);
  70983. for (var i = 0; i < childrenLength; i++) {
  70984. childArray[i] = arguments[i + 2];
  70985. }
  70986. props.children = childArray;
  70987. }
  70988. return ReactElement(element.type, key, ref, self, source, owner, props);
  70989. }
  70990. /**
  70991. * Verifies the object is a ReactElement.
  70992. * See https://reactjs.org/docs/react-api.html#isvalidelement
  70993. * @param {?object} object
  70994. * @return {boolean} True if `object` is a ReactElement.
  70995. * @final
  70996. */
  70997. function isValidElement(object) {
  70998. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  70999. }
  71000. var SEPARATOR = '.';
  71001. var SUBSEPARATOR = ':';
  71002. /**
  71003. * Escape and wrap key so it is safe to use as a reactid
  71004. *
  71005. * @param {string} key to be escaped.
  71006. * @return {string} the escaped key.
  71007. */
  71008. function escape(key) {
  71009. var escapeRegex = /[=:]/g;
  71010. var escaperLookup = {
  71011. '=': '=0',
  71012. ':': '=2'
  71013. };
  71014. var escapedString = ('' + key).replace(escapeRegex, function (match) {
  71015. return escaperLookup[match];
  71016. });
  71017. return '$' + escapedString;
  71018. }
  71019. /**
  71020. * TODO: Test that a single child and an array with one item have the same key
  71021. * pattern.
  71022. */
  71023. var didWarnAboutMaps = false;
  71024. var userProvidedKeyEscapeRegex = /\/+/g;
  71025. function escapeUserProvidedKey(text) {
  71026. return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
  71027. }
  71028. var POOL_SIZE = 10;
  71029. var traverseContextPool = [];
  71030. function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
  71031. if (traverseContextPool.length) {
  71032. var traverseContext = traverseContextPool.pop();
  71033. traverseContext.result = mapResult;
  71034. traverseContext.keyPrefix = keyPrefix;
  71035. traverseContext.func = mapFunction;
  71036. traverseContext.context = mapContext;
  71037. traverseContext.count = 0;
  71038. return traverseContext;
  71039. } else {
  71040. return {
  71041. result: mapResult,
  71042. keyPrefix: keyPrefix,
  71043. func: mapFunction,
  71044. context: mapContext,
  71045. count: 0
  71046. };
  71047. }
  71048. }
  71049. function releaseTraverseContext(traverseContext) {
  71050. traverseContext.result = null;
  71051. traverseContext.keyPrefix = null;
  71052. traverseContext.func = null;
  71053. traverseContext.context = null;
  71054. traverseContext.count = 0;
  71055. if (traverseContextPool.length < POOL_SIZE) {
  71056. traverseContextPool.push(traverseContext);
  71057. }
  71058. }
  71059. /**
  71060. * @param {?*} children Children tree container.
  71061. * @param {!string} nameSoFar Name of the key path so far.
  71062. * @param {!function} callback Callback to invoke with each child found.
  71063. * @param {?*} traverseContext Used to pass information throughout the traversal
  71064. * process.
  71065. * @return {!number} The number of children in this subtree.
  71066. */
  71067. function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  71068. var type = typeof children;
  71069. if (type === 'undefined' || type === 'boolean') {
  71070. // All of the above are perceived as null.
  71071. children = null;
  71072. }
  71073. var invokeCallback = false;
  71074. if (children === null) {
  71075. invokeCallback = true;
  71076. } else {
  71077. switch (type) {
  71078. case 'string':
  71079. case 'number':
  71080. invokeCallback = true;
  71081. break;
  71082. case 'object':
  71083. switch (children.$$typeof) {
  71084. case REACT_ELEMENT_TYPE:
  71085. case REACT_PORTAL_TYPE:
  71086. invokeCallback = true;
  71087. }
  71088. }
  71089. }
  71090. if (invokeCallback) {
  71091. callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
  71092. // so that it's consistent if the number of children grows.
  71093. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
  71094. return 1;
  71095. }
  71096. var child;
  71097. var nextName;
  71098. var subtreeCount = 0; // Count of children found in the current subtree.
  71099. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
  71100. if (Array.isArray(children)) {
  71101. for (var i = 0; i < children.length; i++) {
  71102. child = children[i];
  71103. nextName = nextNamePrefix + getComponentKey(child, i);
  71104. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  71105. }
  71106. } else {
  71107. var iteratorFn = getIteratorFn(children);
  71108. if (typeof iteratorFn === 'function') {
  71109. {
  71110. // Warn about using Maps as children
  71111. if (iteratorFn === children.entries) {
  71112. !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
  71113. didWarnAboutMaps = true;
  71114. }
  71115. }
  71116. var iterator = iteratorFn.call(children);
  71117. var step;
  71118. var ii = 0;
  71119. while (!(step = iterator.next()).done) {
  71120. child = step.value;
  71121. nextName = nextNamePrefix + getComponentKey(child, ii++);
  71122. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  71123. }
  71124. } else if (type === 'object') {
  71125. var addendum = '';
  71126. {
  71127. addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
  71128. }
  71129. var childrenString = '' + children;
  71130. {
  71131. {
  71132. throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
  71133. }
  71134. }
  71135. }
  71136. }
  71137. return subtreeCount;
  71138. }
  71139. /**
  71140. * Traverses children that are typically specified as `props.children`, but
  71141. * might also be specified through attributes:
  71142. *
  71143. * - `traverseAllChildren(this.props.children, ...)`
  71144. * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
  71145. *
  71146. * The `traverseContext` is an optional argument that is passed through the
  71147. * entire traversal. It can be used to store accumulations or anything else that
  71148. * the callback might find relevant.
  71149. *
  71150. * @param {?*} children Children tree object.
  71151. * @param {!function} callback To invoke upon traversing each child.
  71152. * @param {?*} traverseContext Context for traversal.
  71153. * @return {!number} The number of children in this subtree.
  71154. */
  71155. function traverseAllChildren(children, callback, traverseContext) {
  71156. if (children == null) {
  71157. return 0;
  71158. }
  71159. return traverseAllChildrenImpl(children, '', callback, traverseContext);
  71160. }
  71161. /**
  71162. * Generate a key string that identifies a component within a set.
  71163. *
  71164. * @param {*} component A component that could contain a manual key.
  71165. * @param {number} index Index that is used if a manual key is not provided.
  71166. * @return {string}
  71167. */
  71168. function getComponentKey(component, index) {
  71169. // Do some typechecking here since we call this blindly. We want to ensure
  71170. // that we don't block potential future ES APIs.
  71171. if (typeof component === 'object' && component !== null && component.key != null) {
  71172. // Explicit key
  71173. return escape(component.key);
  71174. } // Implicit key determined by the index in the set
  71175. return index.toString(36);
  71176. }
  71177. function forEachSingleChild(bookKeeping, child, name) {
  71178. var func = bookKeeping.func,
  71179. context = bookKeeping.context;
  71180. func.call(context, child, bookKeeping.count++);
  71181. }
  71182. /**
  71183. * Iterates through children that are typically specified as `props.children`.
  71184. *
  71185. * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
  71186. *
  71187. * The provided forEachFunc(child, index) will be called for each
  71188. * leaf child.
  71189. *
  71190. * @param {?*} children Children tree container.
  71191. * @param {function(*, int)} forEachFunc
  71192. * @param {*} forEachContext Context for forEachContext.
  71193. */
  71194. function forEachChildren(children, forEachFunc, forEachContext) {
  71195. if (children == null) {
  71196. return children;
  71197. }
  71198. var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
  71199. traverseAllChildren(children, forEachSingleChild, traverseContext);
  71200. releaseTraverseContext(traverseContext);
  71201. }
  71202. function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  71203. var result = bookKeeping.result,
  71204. keyPrefix = bookKeeping.keyPrefix,
  71205. func = bookKeeping.func,
  71206. context = bookKeeping.context;
  71207. var mappedChild = func.call(context, child, bookKeeping.count++);
  71208. if (Array.isArray(mappedChild)) {
  71209. mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
  71210. return c;
  71211. });
  71212. } else if (mappedChild != null) {
  71213. if (isValidElement(mappedChild)) {
  71214. mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
  71215. // traverseAllChildren used to do for objects as children
  71216. keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
  71217. }
  71218. result.push(mappedChild);
  71219. }
  71220. }
  71221. function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  71222. var escapedPrefix = '';
  71223. if (prefix != null) {
  71224. escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  71225. }
  71226. var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
  71227. traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  71228. releaseTraverseContext(traverseContext);
  71229. }
  71230. /**
  71231. * Maps children that are typically specified as `props.children`.
  71232. *
  71233. * See https://reactjs.org/docs/react-api.html#reactchildrenmap
  71234. *
  71235. * The provided mapFunction(child, key, index) will be called for each
  71236. * leaf child.
  71237. *
  71238. * @param {?*} children Children tree container.
  71239. * @param {function(*, int)} func The map function.
  71240. * @param {*} context Context for mapFunction.
  71241. * @return {object} Object containing the ordered map of results.
  71242. */
  71243. function mapChildren(children, func, context) {
  71244. if (children == null) {
  71245. return children;
  71246. }
  71247. var result = [];
  71248. mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  71249. return result;
  71250. }
  71251. /**
  71252. * Count the number of children that are typically specified as
  71253. * `props.children`.
  71254. *
  71255. * See https://reactjs.org/docs/react-api.html#reactchildrencount
  71256. *
  71257. * @param {?*} children Children tree container.
  71258. * @return {number} The number of children.
  71259. */
  71260. function countChildren(children) {
  71261. return traverseAllChildren(children, function () {
  71262. return null;
  71263. }, null);
  71264. }
  71265. /**
  71266. * Flatten a children object (typically specified as `props.children`) and
  71267. * return an array with appropriately re-keyed children.
  71268. *
  71269. * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
  71270. */
  71271. function toArray(children) {
  71272. var result = [];
  71273. mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
  71274. return child;
  71275. });
  71276. return result;
  71277. }
  71278. /**
  71279. * Returns the first child in a collection of children and verifies that there
  71280. * is only one child in the collection.
  71281. *
  71282. * See https://reactjs.org/docs/react-api.html#reactchildrenonly
  71283. *
  71284. * The current implementation of this function assumes that a single child gets
  71285. * passed without a wrapper, but the purpose of this helper function is to
  71286. * abstract away the particular structure of children.
  71287. *
  71288. * @param {?object} children Child collection structure.
  71289. * @return {ReactElement} The first and only `ReactElement` contained in the
  71290. * structure.
  71291. */
  71292. function onlyChild(children) {
  71293. if (!isValidElement(children)) {
  71294. {
  71295. throw Error("React.Children.only expected to receive a single React element child.");
  71296. }
  71297. }
  71298. return children;
  71299. }
  71300. function createContext(defaultValue, calculateChangedBits) {
  71301. if (calculateChangedBits === undefined) {
  71302. calculateChangedBits = null;
  71303. } else {
  71304. {
  71305. !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
  71306. }
  71307. }
  71308. var context = {
  71309. $$typeof: REACT_CONTEXT_TYPE,
  71310. _calculateChangedBits: calculateChangedBits,
  71311. // As a workaround to support multiple concurrent renderers, we categorize
  71312. // some renderers as primary and others as secondary. We only expect
  71313. // there to be two concurrent renderers at most: React Native (primary) and
  71314. // Fabric (secondary); React DOM (primary) and React ART (secondary).
  71315. // Secondary renderers store their context values on separate fields.
  71316. _currentValue: defaultValue,
  71317. _currentValue2: defaultValue,
  71318. // Used to track how many concurrent renderers this context currently
  71319. // supports within in a single renderer. Such as parallel server rendering.
  71320. _threadCount: 0,
  71321. // These are circular
  71322. Provider: null,
  71323. Consumer: null
  71324. };
  71325. context.Provider = {
  71326. $$typeof: REACT_PROVIDER_TYPE,
  71327. _context: context
  71328. };
  71329. var hasWarnedAboutUsingNestedContextConsumers = false;
  71330. var hasWarnedAboutUsingConsumerProvider = false;
  71331. {
  71332. // A separate object, but proxies back to the original context object for
  71333. // backwards compatibility. It has a different $$typeof, so we can properly
  71334. // warn for the incorrect usage of Context as a Consumer.
  71335. var Consumer = {
  71336. $$typeof: REACT_CONTEXT_TYPE,
  71337. _context: context,
  71338. _calculateChangedBits: context._calculateChangedBits
  71339. }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
  71340. Object.defineProperties(Consumer, {
  71341. Provider: {
  71342. get: function () {
  71343. if (!hasWarnedAboutUsingConsumerProvider) {
  71344. hasWarnedAboutUsingConsumerProvider = true;
  71345. warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
  71346. }
  71347. return context.Provider;
  71348. },
  71349. set: function (_Provider) {
  71350. context.Provider = _Provider;
  71351. }
  71352. },
  71353. _currentValue: {
  71354. get: function () {
  71355. return context._currentValue;
  71356. },
  71357. set: function (_currentValue) {
  71358. context._currentValue = _currentValue;
  71359. }
  71360. },
  71361. _currentValue2: {
  71362. get: function () {
  71363. return context._currentValue2;
  71364. },
  71365. set: function (_currentValue2) {
  71366. context._currentValue2 = _currentValue2;
  71367. }
  71368. },
  71369. _threadCount: {
  71370. get: function () {
  71371. return context._threadCount;
  71372. },
  71373. set: function (_threadCount) {
  71374. context._threadCount = _threadCount;
  71375. }
  71376. },
  71377. Consumer: {
  71378. get: function () {
  71379. if (!hasWarnedAboutUsingNestedContextConsumers) {
  71380. hasWarnedAboutUsingNestedContextConsumers = true;
  71381. warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
  71382. }
  71383. return context.Consumer;
  71384. }
  71385. }
  71386. }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
  71387. context.Consumer = Consumer;
  71388. }
  71389. {
  71390. context._currentRenderer = null;
  71391. context._currentRenderer2 = null;
  71392. }
  71393. return context;
  71394. }
  71395. function lazy(ctor) {
  71396. var lazyType = {
  71397. $$typeof: REACT_LAZY_TYPE,
  71398. _ctor: ctor,
  71399. // React uses these fields to store the result.
  71400. _status: -1,
  71401. _result: null
  71402. };
  71403. {
  71404. // In production, this would just set it on the object.
  71405. var defaultProps;
  71406. var propTypes;
  71407. Object.defineProperties(lazyType, {
  71408. defaultProps: {
  71409. configurable: true,
  71410. get: function () {
  71411. return defaultProps;
  71412. },
  71413. set: function (newDefaultProps) {
  71414. warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
  71415. defaultProps = newDefaultProps; // Match production behavior more closely:
  71416. Object.defineProperty(lazyType, 'defaultProps', {
  71417. enumerable: true
  71418. });
  71419. }
  71420. },
  71421. propTypes: {
  71422. configurable: true,
  71423. get: function () {
  71424. return propTypes;
  71425. },
  71426. set: function (newPropTypes) {
  71427. warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
  71428. propTypes = newPropTypes; // Match production behavior more closely:
  71429. Object.defineProperty(lazyType, 'propTypes', {
  71430. enumerable: true
  71431. });
  71432. }
  71433. }
  71434. });
  71435. }
  71436. return lazyType;
  71437. }
  71438. function forwardRef(render) {
  71439. {
  71440. if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
  71441. warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
  71442. } else if (typeof render !== 'function') {
  71443. warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
  71444. } else {
  71445. !( // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
  71446. render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
  71447. }
  71448. if (render != null) {
  71449. !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
  71450. }
  71451. }
  71452. return {
  71453. $$typeof: REACT_FORWARD_REF_TYPE,
  71454. render: render
  71455. };
  71456. }
  71457. function isValidElementType(type) {
  71458. return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  71459. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
  71460. }
  71461. function memo(type, compare) {
  71462. {
  71463. if (!isValidElementType(type)) {
  71464. warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
  71465. }
  71466. }
  71467. return {
  71468. $$typeof: REACT_MEMO_TYPE,
  71469. type: type,
  71470. compare: compare === undefined ? null : compare
  71471. };
  71472. }
  71473. function resolveDispatcher() {
  71474. var dispatcher = ReactCurrentDispatcher.current;
  71475. if (!(dispatcher !== null)) {
  71476. {
  71477. throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
  71478. }
  71479. }
  71480. return dispatcher;
  71481. }
  71482. function useContext(Context, unstable_observedBits) {
  71483. var dispatcher = resolveDispatcher();
  71484. {
  71485. !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; // TODO: add a more generic warning for invalid values.
  71486. if (Context._context !== undefined) {
  71487. var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
  71488. // and nobody should be using this in existing code.
  71489. if (realContext.Consumer === Context) {
  71490. warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
  71491. } else if (realContext.Provider === Context) {
  71492. warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
  71493. }
  71494. }
  71495. }
  71496. return dispatcher.useContext(Context, unstable_observedBits);
  71497. }
  71498. function useState(initialState) {
  71499. var dispatcher = resolveDispatcher();
  71500. return dispatcher.useState(initialState);
  71501. }
  71502. function useReducer(reducer, initialArg, init) {
  71503. var dispatcher = resolveDispatcher();
  71504. return dispatcher.useReducer(reducer, initialArg, init);
  71505. }
  71506. function useRef(initialValue) {
  71507. var dispatcher = resolveDispatcher();
  71508. return dispatcher.useRef(initialValue);
  71509. }
  71510. function useEffect(create, inputs) {
  71511. var dispatcher = resolveDispatcher();
  71512. return dispatcher.useEffect(create, inputs);
  71513. }
  71514. function useLayoutEffect(create, inputs) {
  71515. var dispatcher = resolveDispatcher();
  71516. return dispatcher.useLayoutEffect(create, inputs);
  71517. }
  71518. function useCallback(callback, inputs) {
  71519. var dispatcher = resolveDispatcher();
  71520. return dispatcher.useCallback(callback, inputs);
  71521. }
  71522. function useMemo(create, inputs) {
  71523. var dispatcher = resolveDispatcher();
  71524. return dispatcher.useMemo(create, inputs);
  71525. }
  71526. function useImperativeHandle(ref, create, inputs) {
  71527. var dispatcher = resolveDispatcher();
  71528. return dispatcher.useImperativeHandle(ref, create, inputs);
  71529. }
  71530. function useDebugValue(value, formatterFn) {
  71531. {
  71532. var dispatcher = resolveDispatcher();
  71533. return dispatcher.useDebugValue(value, formatterFn);
  71534. }
  71535. }
  71536. var emptyObject$1 = {};
  71537. function useResponder(responder, listenerProps) {
  71538. var dispatcher = resolveDispatcher();
  71539. {
  71540. if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
  71541. warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
  71542. return;
  71543. }
  71544. }
  71545. return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
  71546. }
  71547. function useTransition(config) {
  71548. var dispatcher = resolveDispatcher();
  71549. return dispatcher.useTransition(config);
  71550. }
  71551. function useDeferredValue(value, config) {
  71552. var dispatcher = resolveDispatcher();
  71553. return dispatcher.useDeferredValue(value, config);
  71554. }
  71555. function withSuspenseConfig(scope, config) {
  71556. var previousConfig = ReactCurrentBatchConfig.suspense;
  71557. ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
  71558. try {
  71559. scope();
  71560. } finally {
  71561. ReactCurrentBatchConfig.suspense = previousConfig;
  71562. }
  71563. }
  71564. /**
  71565. * ReactElementValidator provides a wrapper around a element factory
  71566. * which validates the props passed to the element. This is intended to be
  71567. * used only in DEV and could be replaced by a static type checker for languages
  71568. * that support it.
  71569. */
  71570. var propTypesMisspellWarningShown;
  71571. {
  71572. propTypesMisspellWarningShown = false;
  71573. }
  71574. var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  71575. function getDeclarationErrorAddendum() {
  71576. if (ReactCurrentOwner.current) {
  71577. var name = getComponentName(ReactCurrentOwner.current.type);
  71578. if (name) {
  71579. return '\n\nCheck the render method of `' + name + '`.';
  71580. }
  71581. }
  71582. return '';
  71583. }
  71584. function getSourceInfoErrorAddendum(source) {
  71585. if (source !== undefined) {
  71586. var fileName = source.fileName.replace(/^.*[\\\/]/, '');
  71587. var lineNumber = source.lineNumber;
  71588. return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
  71589. }
  71590. return '';
  71591. }
  71592. function getSourceInfoErrorAddendumForProps(elementProps) {
  71593. if (elementProps !== null && elementProps !== undefined) {
  71594. return getSourceInfoErrorAddendum(elementProps.__source);
  71595. }
  71596. return '';
  71597. }
  71598. /**
  71599. * Warn if there's no key explicitly set on dynamic arrays of children or
  71600. * object keys are not valid. This allows us to keep track of children between
  71601. * updates.
  71602. */
  71603. var ownerHasKeyUseWarning = {};
  71604. function getCurrentComponentErrorInfo(parentType) {
  71605. var info = getDeclarationErrorAddendum();
  71606. if (!info) {
  71607. var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
  71608. if (parentName) {
  71609. info = "\n\nCheck the top-level render call using <" + parentName + ">.";
  71610. }
  71611. }
  71612. return info;
  71613. }
  71614. /**
  71615. * Warn if the element doesn't have an explicit key assigned to it.
  71616. * This element is in an array. The array could grow and shrink or be
  71617. * reordered. All children that haven't already been validated are required to
  71618. * have a "key" property assigned to it. Error statuses are cached so a warning
  71619. * will only be shown once.
  71620. *
  71621. * @internal
  71622. * @param {ReactElement} element Element that requires a key.
  71623. * @param {*} parentType element's parent's type.
  71624. */
  71625. function validateExplicitKey(element, parentType) {
  71626. if (!element._store || element._store.validated || element.key != null) {
  71627. return;
  71628. }
  71629. element._store.validated = true;
  71630. var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
  71631. if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
  71632. return;
  71633. }
  71634. ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
  71635. // property, it may be the creator of the child that's responsible for
  71636. // assigning it a key.
  71637. var childOwner = '';
  71638. if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
  71639. // Give the component that originally created this child.
  71640. childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
  71641. }
  71642. setCurrentlyValidatingElement(element);
  71643. {
  71644. warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
  71645. }
  71646. setCurrentlyValidatingElement(null);
  71647. }
  71648. /**
  71649. * Ensure that every element either is passed in a static location, in an
  71650. * array with an explicit keys property defined, or in an object literal
  71651. * with valid key property.
  71652. *
  71653. * @internal
  71654. * @param {ReactNode} node Statically passed child of any type.
  71655. * @param {*} parentType node's parent's type.
  71656. */
  71657. function validateChildKeys(node, parentType) {
  71658. if (typeof node !== 'object') {
  71659. return;
  71660. }
  71661. if (Array.isArray(node)) {
  71662. for (var i = 0; i < node.length; i++) {
  71663. var child = node[i];
  71664. if (isValidElement(child)) {
  71665. validateExplicitKey(child, parentType);
  71666. }
  71667. }
  71668. } else if (isValidElement(node)) {
  71669. // This element was passed in a valid location.
  71670. if (node._store) {
  71671. node._store.validated = true;
  71672. }
  71673. } else if (node) {
  71674. var iteratorFn = getIteratorFn(node);
  71675. if (typeof iteratorFn === 'function') {
  71676. // Entry iterators used to provide implicit keys,
  71677. // but now we print a separate warning for them later.
  71678. if (iteratorFn !== node.entries) {
  71679. var iterator = iteratorFn.call(node);
  71680. var step;
  71681. while (!(step = iterator.next()).done) {
  71682. if (isValidElement(step.value)) {
  71683. validateExplicitKey(step.value, parentType);
  71684. }
  71685. }
  71686. }
  71687. }
  71688. }
  71689. }
  71690. /**
  71691. * Given an element, validate that its props follow the propTypes definition,
  71692. * provided by the type.
  71693. *
  71694. * @param {ReactElement} element
  71695. */
  71696. function validatePropTypes(element) {
  71697. var type = element.type;
  71698. if (type === null || type === undefined || typeof type === 'string') {
  71699. return;
  71700. }
  71701. var name = getComponentName(type);
  71702. var propTypes;
  71703. if (typeof type === 'function') {
  71704. propTypes = type.propTypes;
  71705. } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
  71706. // Inner props are checked in the reconciler.
  71707. type.$$typeof === REACT_MEMO_TYPE)) {
  71708. propTypes = type.propTypes;
  71709. } else {
  71710. return;
  71711. }
  71712. if (propTypes) {
  71713. setCurrentlyValidatingElement(element);
  71714. checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
  71715. setCurrentlyValidatingElement(null);
  71716. } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
  71717. propTypesMisspellWarningShown = true;
  71718. warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
  71719. }
  71720. if (typeof type.getDefaultProps === 'function') {
  71721. !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
  71722. }
  71723. }
  71724. /**
  71725. * Given a fragment, validate that it can only be provided with fragment props
  71726. * @param {ReactElement} fragment
  71727. */
  71728. function validateFragmentProps(fragment) {
  71729. setCurrentlyValidatingElement(fragment);
  71730. var keys = Object.keys(fragment.props);
  71731. for (var i = 0; i < keys.length; i++) {
  71732. var key = keys[i];
  71733. if (key !== 'children' && key !== 'key') {
  71734. warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
  71735. break;
  71736. }
  71737. }
  71738. if (fragment.ref !== null) {
  71739. warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
  71740. }
  71741. setCurrentlyValidatingElement(null);
  71742. }
  71743. function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
  71744. var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
  71745. // succeed and there will likely be errors in render.
  71746. if (!validType) {
  71747. var info = '';
  71748. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  71749. info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
  71750. }
  71751. var sourceInfo = getSourceInfoErrorAddendum(source);
  71752. if (sourceInfo) {
  71753. info += sourceInfo;
  71754. } else {
  71755. info += getDeclarationErrorAddendum();
  71756. }
  71757. var typeString;
  71758. if (type === null) {
  71759. typeString = 'null';
  71760. } else if (Array.isArray(type)) {
  71761. typeString = 'array';
  71762. } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
  71763. typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
  71764. info = ' Did you accidentally export a JSX literal instead of a component?';
  71765. } else {
  71766. typeString = typeof type;
  71767. }
  71768. warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
  71769. }
  71770. var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
  71771. // TODO: Drop this when these are no longer allowed as the type argument.
  71772. if (element == null) {
  71773. return element;
  71774. } // Skip key warning if the type isn't valid since our key validation logic
  71775. // doesn't expect a non-string/function type and can throw confusing errors.
  71776. // We don't want exception behavior to differ between dev and prod.
  71777. // (Rendering will throw with a helpful message and as soon as the type is
  71778. // fixed, the key warnings will appear.)
  71779. if (validType) {
  71780. var children = props.children;
  71781. if (children !== undefined) {
  71782. if (isStaticChildren) {
  71783. if (Array.isArray(children)) {
  71784. for (var i = 0; i < children.length; i++) {
  71785. validateChildKeys(children[i], type);
  71786. }
  71787. if (Object.freeze) {
  71788. Object.freeze(children);
  71789. }
  71790. } else {
  71791. warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
  71792. }
  71793. } else {
  71794. validateChildKeys(children, type);
  71795. }
  71796. }
  71797. }
  71798. if (hasOwnProperty$1.call(props, 'key')) {
  71799. warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
  71800. }
  71801. if (type === REACT_FRAGMENT_TYPE) {
  71802. validateFragmentProps(element);
  71803. } else {
  71804. validatePropTypes(element);
  71805. }
  71806. return element;
  71807. } // These two functions exist to still get child warnings in dev
  71808. // even with the prod transform. This means that jsxDEV is purely
  71809. // opt-in behavior for better messages but that we won't stop
  71810. // giving you warnings if you use production apis.
  71811. function jsxWithValidationStatic(type, props, key) {
  71812. return jsxWithValidation(type, props, key, true);
  71813. }
  71814. function jsxWithValidationDynamic(type, props, key) {
  71815. return jsxWithValidation(type, props, key, false);
  71816. }
  71817. function createElementWithValidation(type, props, children) {
  71818. var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
  71819. // succeed and there will likely be errors in render.
  71820. if (!validType) {
  71821. var info = '';
  71822. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  71823. info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
  71824. }
  71825. var sourceInfo = getSourceInfoErrorAddendumForProps(props);
  71826. if (sourceInfo) {
  71827. info += sourceInfo;
  71828. } else {
  71829. info += getDeclarationErrorAddendum();
  71830. }
  71831. var typeString;
  71832. if (type === null) {
  71833. typeString = 'null';
  71834. } else if (Array.isArray(type)) {
  71835. typeString = 'array';
  71836. } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
  71837. typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
  71838. info = ' Did you accidentally export a JSX literal instead of a component?';
  71839. } else {
  71840. typeString = typeof type;
  71841. }
  71842. warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
  71843. }
  71844. var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
  71845. // TODO: Drop this when these are no longer allowed as the type argument.
  71846. if (element == null) {
  71847. return element;
  71848. } // Skip key warning if the type isn't valid since our key validation logic
  71849. // doesn't expect a non-string/function type and can throw confusing errors.
  71850. // We don't want exception behavior to differ between dev and prod.
  71851. // (Rendering will throw with a helpful message and as soon as the type is
  71852. // fixed, the key warnings will appear.)
  71853. if (validType) {
  71854. for (var i = 2; i < arguments.length; i++) {
  71855. validateChildKeys(arguments[i], type);
  71856. }
  71857. }
  71858. if (type === REACT_FRAGMENT_TYPE) {
  71859. validateFragmentProps(element);
  71860. } else {
  71861. validatePropTypes(element);
  71862. }
  71863. return element;
  71864. }
  71865. function createFactoryWithValidation(type) {
  71866. var validatedFactory = createElementWithValidation.bind(null, type);
  71867. validatedFactory.type = type; // Legacy hook: remove it
  71868. {
  71869. Object.defineProperty(validatedFactory, 'type', {
  71870. enumerable: false,
  71871. get: function () {
  71872. lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
  71873. Object.defineProperty(this, 'type', {
  71874. value: type
  71875. });
  71876. return type;
  71877. }
  71878. });
  71879. }
  71880. return validatedFactory;
  71881. }
  71882. function cloneElementWithValidation(element, props, children) {
  71883. var newElement = cloneElement.apply(this, arguments);
  71884. for (var i = 2; i < arguments.length; i++) {
  71885. validateChildKeys(arguments[i], newElement.type);
  71886. }
  71887. validatePropTypes(newElement);
  71888. return newElement;
  71889. }
  71890. var hasBadMapPolyfill;
  71891. {
  71892. hasBadMapPolyfill = false;
  71893. try {
  71894. var frozenObject = Object.freeze({});
  71895. var testMap = new Map([[frozenObject, null]]);
  71896. var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
  71897. // https://github.com/rollup/rollup/issues/1771
  71898. // TODO: we can remove these if Rollup fixes the bug.
  71899. testMap.set(0, 0);
  71900. testSet.add(0);
  71901. } catch (e) {
  71902. // TODO: Consider warning about bad polyfills
  71903. hasBadMapPolyfill = true;
  71904. }
  71905. }
  71906. function createFundamentalComponent(impl) {
  71907. // We use responder as a Map key later on. When we have a bad
  71908. // polyfill, then we can't use it as a key as the polyfill tries
  71909. // to add a property to the object.
  71910. if ( true && !hasBadMapPolyfill) {
  71911. Object.freeze(impl);
  71912. }
  71913. var fundamantalComponent = {
  71914. $$typeof: REACT_FUNDAMENTAL_TYPE,
  71915. impl: impl
  71916. };
  71917. {
  71918. Object.freeze(fundamantalComponent);
  71919. }
  71920. return fundamantalComponent;
  71921. }
  71922. function createEventResponder(displayName, responderConfig) {
  71923. var getInitialState = responderConfig.getInitialState,
  71924. onEvent = responderConfig.onEvent,
  71925. onMount = responderConfig.onMount,
  71926. onUnmount = responderConfig.onUnmount,
  71927. onRootEvent = responderConfig.onRootEvent,
  71928. rootEventTypes = responderConfig.rootEventTypes,
  71929. targetEventTypes = responderConfig.targetEventTypes,
  71930. targetPortalPropagation = responderConfig.targetPortalPropagation;
  71931. var eventResponder = {
  71932. $$typeof: REACT_RESPONDER_TYPE,
  71933. displayName: displayName,
  71934. getInitialState: getInitialState || null,
  71935. onEvent: onEvent || null,
  71936. onMount: onMount || null,
  71937. onRootEvent: onRootEvent || null,
  71938. onUnmount: onUnmount || null,
  71939. rootEventTypes: rootEventTypes || null,
  71940. targetEventTypes: targetEventTypes || null,
  71941. targetPortalPropagation: targetPortalPropagation || false
  71942. }; // We use responder as a Map key later on. When we have a bad
  71943. // polyfill, then we can't use it as a key as the polyfill tries
  71944. // to add a property to the object.
  71945. if ( true && !hasBadMapPolyfill) {
  71946. Object.freeze(eventResponder);
  71947. }
  71948. return eventResponder;
  71949. }
  71950. function createScope() {
  71951. var scopeComponent = {
  71952. $$typeof: REACT_SCOPE_TYPE
  71953. };
  71954. {
  71955. Object.freeze(scopeComponent);
  71956. }
  71957. return scopeComponent;
  71958. }
  71959. // Helps identify side effects in render-phase lifecycle hooks and setState
  71960. // reducers by double invoking them in Strict Mode.
  71961. // To preserve the "Pause on caught exceptions" behavior of the debugger, we
  71962. // replay the begin phase of a failed component inside invokeGuardedCallback.
  71963. // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
  71964. // Gather advanced timing metrics for Profiler subtrees.
  71965. // Trace which interactions trigger each commit.
  71966. // SSR experiments
  71967. // Only used in www builds.
  71968. // Only used in www builds.
  71969. // Disable javascript: URL strings in href for XSS protection.
  71970. // React Fire: prevent the value and checked attributes from syncing
  71971. // with their related DOM properties
  71972. // These APIs will no longer be "unstable" in the upcoming 16.7 release,
  71973. // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
  71974. var exposeConcurrentModeAPIs = false;
  71975. // Experimental React Flare event system and event components support.
  71976. var enableFlareAPI = false; // Experimental Host Component support.
  71977. var enableFundamentalAPI = false; // Experimental Scope support.
  71978. var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
  71979. var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
  71980. // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
  71981. // For tests, we flush suspense fallbacks in an act scope;
  71982. // *except* in some of our own tests, where we test incremental loading states.
  71983. // Add a callback property to suspense to notify which promises are currently
  71984. // in the update queue. This allows reporting and tracing of what is causing
  71985. // the user to see a loading state.
  71986. // Also allows hydration callbacks to fire when a dehydrated boundary gets
  71987. // hydrated or deleted.
  71988. // Part of the simplification of React.createElement so we can eventually move
  71989. // from React.createElement to React.jsx
  71990. // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
  71991. // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
  71992. var React = {
  71993. Children: {
  71994. map: mapChildren,
  71995. forEach: forEachChildren,
  71996. count: countChildren,
  71997. toArray: toArray,
  71998. only: onlyChild
  71999. },
  72000. createRef: createRef,
  72001. Component: Component,
  72002. PureComponent: PureComponent,
  72003. createContext: createContext,
  72004. forwardRef: forwardRef,
  72005. lazy: lazy,
  72006. memo: memo,
  72007. useCallback: useCallback,
  72008. useContext: useContext,
  72009. useEffect: useEffect,
  72010. useImperativeHandle: useImperativeHandle,
  72011. useDebugValue: useDebugValue,
  72012. useLayoutEffect: useLayoutEffect,
  72013. useMemo: useMemo,
  72014. useReducer: useReducer,
  72015. useRef: useRef,
  72016. useState: useState,
  72017. Fragment: REACT_FRAGMENT_TYPE,
  72018. Profiler: REACT_PROFILER_TYPE,
  72019. StrictMode: REACT_STRICT_MODE_TYPE,
  72020. Suspense: REACT_SUSPENSE_TYPE,
  72021. createElement: createElementWithValidation,
  72022. cloneElement: cloneElementWithValidation,
  72023. createFactory: createFactoryWithValidation,
  72024. isValidElement: isValidElement,
  72025. version: ReactVersion,
  72026. __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
  72027. };
  72028. if (exposeConcurrentModeAPIs) {
  72029. React.useTransition = useTransition;
  72030. React.useDeferredValue = useDeferredValue;
  72031. React.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
  72032. React.unstable_withSuspenseConfig = withSuspenseConfig;
  72033. }
  72034. if (enableFlareAPI) {
  72035. React.unstable_useResponder = useResponder;
  72036. React.unstable_createResponder = createEventResponder;
  72037. }
  72038. if (enableFundamentalAPI) {
  72039. React.unstable_createFundamental = createFundamentalComponent;
  72040. }
  72041. if (enableScopeAPI) {
  72042. React.unstable_createScope = createScope;
  72043. } // Note: some APIs are added with feature flags.
  72044. // Make sure that stable builds for open source
  72045. // don't modify the React object to avoid deopts.
  72046. // Also let's not expose their names in stable builds.
  72047. if (enableJSXTransformAPI) {
  72048. {
  72049. React.jsxDEV = jsxWithValidation;
  72050. React.jsx = jsxWithValidationDynamic;
  72051. React.jsxs = jsxWithValidationStatic;
  72052. }
  72053. }
  72054. var React$2 = Object.freeze({
  72055. default: React
  72056. });
  72057. var React$3 = ( React$2 && React ) || React$2;
  72058. // TODO: decide on the top-level export form.
  72059. // This is hacky but makes it work with both Rollup and Jest.
  72060. var react = React$3.default || React$3;
  72061. module.exports = react;
  72062. })();
  72063. }
  72064. /***/ }),
  72065. /***/ "./node_modules/react/index.js":
  72066. /*!*************************************!*\
  72067. !*** ./node_modules/react/index.js ***!
  72068. \*************************************/
  72069. /*! no static exports found */
  72070. /***/ (function(module, exports, __webpack_require__) {
  72071. "use strict";
  72072. if (false) {} else {
  72073. module.exports = __webpack_require__(/*! ./cjs/react.development.js */ "./node_modules/react/cjs/react.development.js");
  72074. }
  72075. /***/ }),
  72076. /***/ "./node_modules/scheduler/cjs/scheduler-tracing.development.js":
  72077. /*!*********************************************************************!*\
  72078. !*** ./node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
  72079. \*********************************************************************/
  72080. /*! no static exports found */
  72081. /***/ (function(module, exports, __webpack_require__) {
  72082. "use strict";
  72083. /** @license React v0.18.0
  72084. * scheduler-tracing.development.js
  72085. *
  72086. * Copyright (c) Facebook, Inc. and its affiliates.
  72087. *
  72088. * This source code is licensed under the MIT license found in the
  72089. * LICENSE file in the root directory of this source tree.
  72090. */
  72091. if (true) {
  72092. (function() {
  72093. 'use strict';
  72094. Object.defineProperty(exports, '__esModule', { value: true });
  72095. // Helps identify side effects in render-phase lifecycle hooks and setState
  72096. // reducers by double invoking them in Strict Mode.
  72097. // To preserve the "Pause on caught exceptions" behavior of the debugger, we
  72098. // replay the begin phase of a failed component inside invokeGuardedCallback.
  72099. // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
  72100. // Gather advanced timing metrics for Profiler subtrees.
  72101. // Trace which interactions trigger each commit.
  72102. var enableSchedulerTracing = true; // SSR experiments
  72103. // Only used in www builds.
  72104. // Only used in www builds.
  72105. // Disable javascript: URL strings in href for XSS protection.
  72106. // React Fire: prevent the value and checked attributes from syncing
  72107. // with their related DOM properties
  72108. // These APIs will no longer be "unstable" in the upcoming 16.7 release,
  72109. // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
  72110. // Experimental React Flare event system and event components support.
  72111. // Experimental Host Component support.
  72112. // Experimental Scope support.
  72113. // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
  72114. // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
  72115. // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
  72116. // For tests, we flush suspense fallbacks in an act scope;
  72117. // *except* in some of our own tests, where we test incremental loading states.
  72118. // Add a callback property to suspense to notify which promises are currently
  72119. // in the update queue. This allows reporting and tracing of what is causing
  72120. // the user to see a loading state.
  72121. // Also allows hydration callbacks to fire when a dehydrated boundary gets
  72122. // hydrated or deleted.
  72123. // Part of the simplification of React.createElement so we can eventually move
  72124. // from React.createElement to React.jsx
  72125. // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
  72126. // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
  72127. var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.
  72128. var interactionIDCounter = 0;
  72129. var threadIDCounter = 0; // Set of currently traced interactions.
  72130. // Interactions "stack"–
  72131. // Meaning that newly traced interactions are appended to the previously active set.
  72132. // When an interaction goes out of scope, the previous set (if any) is restored.
  72133. exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.
  72134. exports.__subscriberRef = null;
  72135. if (enableSchedulerTracing) {
  72136. exports.__interactionsRef = {
  72137. current: new Set()
  72138. };
  72139. exports.__subscriberRef = {
  72140. current: null
  72141. };
  72142. }
  72143. function unstable_clear(callback) {
  72144. if (!enableSchedulerTracing) {
  72145. return callback();
  72146. }
  72147. var prevInteractions = exports.__interactionsRef.current;
  72148. exports.__interactionsRef.current = new Set();
  72149. try {
  72150. return callback();
  72151. } finally {
  72152. exports.__interactionsRef.current = prevInteractions;
  72153. }
  72154. }
  72155. function unstable_getCurrent() {
  72156. if (!enableSchedulerTracing) {
  72157. return null;
  72158. } else {
  72159. return exports.__interactionsRef.current;
  72160. }
  72161. }
  72162. function unstable_getThreadID() {
  72163. return ++threadIDCounter;
  72164. }
  72165. function unstable_trace(name, timestamp, callback) {
  72166. var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;
  72167. if (!enableSchedulerTracing) {
  72168. return callback();
  72169. }
  72170. var interaction = {
  72171. __count: 1,
  72172. id: interactionIDCounter++,
  72173. name: name,
  72174. timestamp: timestamp
  72175. };
  72176. var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.
  72177. // To do that, clone the current interactions.
  72178. // The previous set will be restored upon completion.
  72179. var interactions = new Set(prevInteractions);
  72180. interactions.add(interaction);
  72181. exports.__interactionsRef.current = interactions;
  72182. var subscriber = exports.__subscriberRef.current;
  72183. var returnValue;
  72184. try {
  72185. if (subscriber !== null) {
  72186. subscriber.onInteractionTraced(interaction);
  72187. }
  72188. } finally {
  72189. try {
  72190. if (subscriber !== null) {
  72191. subscriber.onWorkStarted(interactions, threadID);
  72192. }
  72193. } finally {
  72194. try {
  72195. returnValue = callback();
  72196. } finally {
  72197. exports.__interactionsRef.current = prevInteractions;
  72198. try {
  72199. if (subscriber !== null) {
  72200. subscriber.onWorkStopped(interactions, threadID);
  72201. }
  72202. } finally {
  72203. interaction.__count--; // If no async work was scheduled for this interaction,
  72204. // Notify subscribers that it's completed.
  72205. if (subscriber !== null && interaction.__count === 0) {
  72206. subscriber.onInteractionScheduledWorkCompleted(interaction);
  72207. }
  72208. }
  72209. }
  72210. }
  72211. }
  72212. return returnValue;
  72213. }
  72214. function unstable_wrap(callback) {
  72215. var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;
  72216. if (!enableSchedulerTracing) {
  72217. return callback;
  72218. }
  72219. var wrappedInteractions = exports.__interactionsRef.current;
  72220. var subscriber = exports.__subscriberRef.current;
  72221. if (subscriber !== null) {
  72222. subscriber.onWorkScheduled(wrappedInteractions, threadID);
  72223. } // Update the pending async work count for the current interactions.
  72224. // Update after calling subscribers in case of error.
  72225. wrappedInteractions.forEach(function (interaction) {
  72226. interaction.__count++;
  72227. });
  72228. var hasRun = false;
  72229. function wrapped() {
  72230. var prevInteractions = exports.__interactionsRef.current;
  72231. exports.__interactionsRef.current = wrappedInteractions;
  72232. subscriber = exports.__subscriberRef.current;
  72233. try {
  72234. var returnValue;
  72235. try {
  72236. if (subscriber !== null) {
  72237. subscriber.onWorkStarted(wrappedInteractions, threadID);
  72238. }
  72239. } finally {
  72240. try {
  72241. returnValue = callback.apply(undefined, arguments);
  72242. } finally {
  72243. exports.__interactionsRef.current = prevInteractions;
  72244. if (subscriber !== null) {
  72245. subscriber.onWorkStopped(wrappedInteractions, threadID);
  72246. }
  72247. }
  72248. }
  72249. return returnValue;
  72250. } finally {
  72251. if (!hasRun) {
  72252. // We only expect a wrapped function to be executed once,
  72253. // But in the event that it's executed more than once–
  72254. // Only decrement the outstanding interaction counts once.
  72255. hasRun = true; // Update pending async counts for all wrapped interactions.
  72256. // If this was the last scheduled async work for any of them,
  72257. // Mark them as completed.
  72258. wrappedInteractions.forEach(function (interaction) {
  72259. interaction.__count--;
  72260. if (subscriber !== null && interaction.__count === 0) {
  72261. subscriber.onInteractionScheduledWorkCompleted(interaction);
  72262. }
  72263. });
  72264. }
  72265. }
  72266. }
  72267. wrapped.cancel = function cancel() {
  72268. subscriber = exports.__subscriberRef.current;
  72269. try {
  72270. if (subscriber !== null) {
  72271. subscriber.onWorkCanceled(wrappedInteractions, threadID);
  72272. }
  72273. } finally {
  72274. // Update pending async counts for all wrapped interactions.
  72275. // If this was the last scheduled async work for any of them,
  72276. // Mark them as completed.
  72277. wrappedInteractions.forEach(function (interaction) {
  72278. interaction.__count--;
  72279. if (subscriber && interaction.__count === 0) {
  72280. subscriber.onInteractionScheduledWorkCompleted(interaction);
  72281. }
  72282. });
  72283. }
  72284. };
  72285. return wrapped;
  72286. }
  72287. var subscribers = null;
  72288. if (enableSchedulerTracing) {
  72289. subscribers = new Set();
  72290. }
  72291. function unstable_subscribe(subscriber) {
  72292. if (enableSchedulerTracing) {
  72293. subscribers.add(subscriber);
  72294. if (subscribers.size === 1) {
  72295. exports.__subscriberRef.current = {
  72296. onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
  72297. onInteractionTraced: onInteractionTraced,
  72298. onWorkCanceled: onWorkCanceled,
  72299. onWorkScheduled: onWorkScheduled,
  72300. onWorkStarted: onWorkStarted,
  72301. onWorkStopped: onWorkStopped
  72302. };
  72303. }
  72304. }
  72305. }
  72306. function unstable_unsubscribe(subscriber) {
  72307. if (enableSchedulerTracing) {
  72308. subscribers.delete(subscriber);
  72309. if (subscribers.size === 0) {
  72310. exports.__subscriberRef.current = null;
  72311. }
  72312. }
  72313. }
  72314. function onInteractionTraced(interaction) {
  72315. var didCatchError = false;
  72316. var caughtError = null;
  72317. subscribers.forEach(function (subscriber) {
  72318. try {
  72319. subscriber.onInteractionTraced(interaction);
  72320. } catch (error) {
  72321. if (!didCatchError) {
  72322. didCatchError = true;
  72323. caughtError = error;
  72324. }
  72325. }
  72326. });
  72327. if (didCatchError) {
  72328. throw caughtError;
  72329. }
  72330. }
  72331. function onInteractionScheduledWorkCompleted(interaction) {
  72332. var didCatchError = false;
  72333. var caughtError = null;
  72334. subscribers.forEach(function (subscriber) {
  72335. try {
  72336. subscriber.onInteractionScheduledWorkCompleted(interaction);
  72337. } catch (error) {
  72338. if (!didCatchError) {
  72339. didCatchError = true;
  72340. caughtError = error;
  72341. }
  72342. }
  72343. });
  72344. if (didCatchError) {
  72345. throw caughtError;
  72346. }
  72347. }
  72348. function onWorkScheduled(interactions, threadID) {
  72349. var didCatchError = false;
  72350. var caughtError = null;
  72351. subscribers.forEach(function (subscriber) {
  72352. try {
  72353. subscriber.onWorkScheduled(interactions, threadID);
  72354. } catch (error) {
  72355. if (!didCatchError) {
  72356. didCatchError = true;
  72357. caughtError = error;
  72358. }
  72359. }
  72360. });
  72361. if (didCatchError) {
  72362. throw caughtError;
  72363. }
  72364. }
  72365. function onWorkStarted(interactions, threadID) {
  72366. var didCatchError = false;
  72367. var caughtError = null;
  72368. subscribers.forEach(function (subscriber) {
  72369. try {
  72370. subscriber.onWorkStarted(interactions, threadID);
  72371. } catch (error) {
  72372. if (!didCatchError) {
  72373. didCatchError = true;
  72374. caughtError = error;
  72375. }
  72376. }
  72377. });
  72378. if (didCatchError) {
  72379. throw caughtError;
  72380. }
  72381. }
  72382. function onWorkStopped(interactions, threadID) {
  72383. var didCatchError = false;
  72384. var caughtError = null;
  72385. subscribers.forEach(function (subscriber) {
  72386. try {
  72387. subscriber.onWorkStopped(interactions, threadID);
  72388. } catch (error) {
  72389. if (!didCatchError) {
  72390. didCatchError = true;
  72391. caughtError = error;
  72392. }
  72393. }
  72394. });
  72395. if (didCatchError) {
  72396. throw caughtError;
  72397. }
  72398. }
  72399. function onWorkCanceled(interactions, threadID) {
  72400. var didCatchError = false;
  72401. var caughtError = null;
  72402. subscribers.forEach(function (subscriber) {
  72403. try {
  72404. subscriber.onWorkCanceled(interactions, threadID);
  72405. } catch (error) {
  72406. if (!didCatchError) {
  72407. didCatchError = true;
  72408. caughtError = error;
  72409. }
  72410. }
  72411. });
  72412. if (didCatchError) {
  72413. throw caughtError;
  72414. }
  72415. }
  72416. exports.unstable_clear = unstable_clear;
  72417. exports.unstable_getCurrent = unstable_getCurrent;
  72418. exports.unstable_getThreadID = unstable_getThreadID;
  72419. exports.unstable_trace = unstable_trace;
  72420. exports.unstable_wrap = unstable_wrap;
  72421. exports.unstable_subscribe = unstable_subscribe;
  72422. exports.unstable_unsubscribe = unstable_unsubscribe;
  72423. })();
  72424. }
  72425. /***/ }),
  72426. /***/ "./node_modules/scheduler/cjs/scheduler.development.js":
  72427. /*!*************************************************************!*\
  72428. !*** ./node_modules/scheduler/cjs/scheduler.development.js ***!
  72429. \*************************************************************/
  72430. /*! no static exports found */
  72431. /***/ (function(module, exports, __webpack_require__) {
  72432. "use strict";
  72433. /** @license React v0.18.0
  72434. * scheduler.development.js
  72435. *
  72436. * Copyright (c) Facebook, Inc. and its affiliates.
  72437. *
  72438. * This source code is licensed under the MIT license found in the
  72439. * LICENSE file in the root directory of this source tree.
  72440. */
  72441. if (true) {
  72442. (function() {
  72443. 'use strict';
  72444. Object.defineProperty(exports, '__esModule', { value: true });
  72445. var enableSchedulerDebugging = false;
  72446. var enableIsInputPending = false;
  72447. var enableProfiling = true;
  72448. var requestHostCallback;
  72449. var requestHostTimeout;
  72450. var cancelHostTimeout;
  72451. var shouldYieldToHost;
  72452. var requestPaint;
  72453. if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
  72454. // implementation using setTimeout.
  72455. typeof window === 'undefined' || // Check if MessageChannel is supported, too.
  72456. typeof MessageChannel !== 'function') {
  72457. // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
  72458. // fallback to a naive implementation.
  72459. var _callback = null;
  72460. var _timeoutID = null;
  72461. var _flushCallback = function () {
  72462. if (_callback !== null) {
  72463. try {
  72464. var currentTime = exports.unstable_now();
  72465. var hasRemainingTime = true;
  72466. _callback(hasRemainingTime, currentTime);
  72467. _callback = null;
  72468. } catch (e) {
  72469. setTimeout(_flushCallback, 0);
  72470. throw e;
  72471. }
  72472. }
  72473. };
  72474. var initialTime = Date.now();
  72475. exports.unstable_now = function () {
  72476. return Date.now() - initialTime;
  72477. };
  72478. requestHostCallback = function (cb) {
  72479. if (_callback !== null) {
  72480. // Protect against re-entrancy.
  72481. setTimeout(requestHostCallback, 0, cb);
  72482. } else {
  72483. _callback = cb;
  72484. setTimeout(_flushCallback, 0);
  72485. }
  72486. };
  72487. requestHostTimeout = function (cb, ms) {
  72488. _timeoutID = setTimeout(cb, ms);
  72489. };
  72490. cancelHostTimeout = function () {
  72491. clearTimeout(_timeoutID);
  72492. };
  72493. shouldYieldToHost = function () {
  72494. return false;
  72495. };
  72496. requestPaint = exports.unstable_forceFrameRate = function () {};
  72497. } else {
  72498. // Capture local references to native APIs, in case a polyfill overrides them.
  72499. var performance = window.performance;
  72500. var _Date = window.Date;
  72501. var _setTimeout = window.setTimeout;
  72502. var _clearTimeout = window.clearTimeout;
  72503. if (typeof console !== 'undefined') {
  72504. // TODO: Scheduler no longer requires these methods to be polyfilled. But
  72505. // maybe we want to continue warning if they don't exist, to preserve the
  72506. // option to rely on it in the future?
  72507. var requestAnimationFrame = window.requestAnimationFrame;
  72508. var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link
  72509. if (typeof requestAnimationFrame !== 'function') {
  72510. console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  72511. }
  72512. if (typeof cancelAnimationFrame !== 'function') {
  72513. console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  72514. }
  72515. }
  72516. if (typeof performance === 'object' && typeof performance.now === 'function') {
  72517. exports.unstable_now = function () {
  72518. return performance.now();
  72519. };
  72520. } else {
  72521. var _initialTime = _Date.now();
  72522. exports.unstable_now = function () {
  72523. return _Date.now() - _initialTime;
  72524. };
  72525. }
  72526. var isMessageLoopRunning = false;
  72527. var scheduledHostCallback = null;
  72528. var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
  72529. // thread, like user events. By default, it yields multiple times per frame.
  72530. // It does not attempt to align with frame boundaries, since most tasks don't
  72531. // need to be frame aligned; for those that do, use requestAnimationFrame.
  72532. var yieldInterval = 5;
  72533. var deadline = 0; // TODO: Make this configurable
  72534. // TODO: Adjust this based on priority?
  72535. var maxYieldInterval = 300;
  72536. var needsPaint = false;
  72537. if (enableIsInputPending && navigator !== undefined && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined) {
  72538. var scheduling = navigator.scheduling;
  72539. shouldYieldToHost = function () {
  72540. var currentTime = exports.unstable_now();
  72541. if (currentTime >= deadline) {
  72542. // There's no time left. We may want to yield control of the main
  72543. // thread, so the browser can perform high priority tasks. The main ones
  72544. // are painting and user input. If there's a pending paint or a pending
  72545. // input, then we should yield. But if there's neither, then we can
  72546. // yield less often while remaining responsive. We'll eventually yield
  72547. // regardless, since there could be a pending paint that wasn't
  72548. // accompanied by a call to `requestPaint`, or other main thread tasks
  72549. // like network events.
  72550. if (needsPaint || scheduling.isInputPending()) {
  72551. // There is either a pending paint or a pending input.
  72552. return true;
  72553. } // There's no pending input. Only yield if we've reached the max
  72554. // yield interval.
  72555. return currentTime >= maxYieldInterval;
  72556. } else {
  72557. // There's still time left in the frame.
  72558. return false;
  72559. }
  72560. };
  72561. requestPaint = function () {
  72562. needsPaint = true;
  72563. };
  72564. } else {
  72565. // `isInputPending` is not available. Since we have no way of knowing if
  72566. // there's pending input, always yield at the end of the frame.
  72567. shouldYieldToHost = function () {
  72568. return exports.unstable_now() >= deadline;
  72569. }; // Since we yield every frame regardless, `requestPaint` has no effect.
  72570. requestPaint = function () {};
  72571. }
  72572. exports.unstable_forceFrameRate = function (fps) {
  72573. if (fps < 0 || fps > 125) {
  72574. console.error('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');
  72575. return;
  72576. }
  72577. if (fps > 0) {
  72578. yieldInterval = Math.floor(1000 / fps);
  72579. } else {
  72580. // reset the framerate
  72581. yieldInterval = 5;
  72582. }
  72583. };
  72584. var performWorkUntilDeadline = function () {
  72585. if (scheduledHostCallback !== null) {
  72586. var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
  72587. // cycle. This means there's always time remaining at the beginning of
  72588. // the message event.
  72589. deadline = currentTime + yieldInterval;
  72590. var hasTimeRemaining = true;
  72591. try {
  72592. var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
  72593. if (!hasMoreWork) {
  72594. isMessageLoopRunning = false;
  72595. scheduledHostCallback = null;
  72596. } else {
  72597. // If there's more work, schedule the next message event at the end
  72598. // of the preceding one.
  72599. port.postMessage(null);
  72600. }
  72601. } catch (error) {
  72602. // If a scheduler task throws, exit the current browser task so the
  72603. // error can be observed.
  72604. port.postMessage(null);
  72605. throw error;
  72606. }
  72607. } else {
  72608. isMessageLoopRunning = false;
  72609. } // Yielding to the browser will give it a chance to paint, so we can
  72610. // reset this.
  72611. needsPaint = false;
  72612. };
  72613. var channel = new MessageChannel();
  72614. var port = channel.port2;
  72615. channel.port1.onmessage = performWorkUntilDeadline;
  72616. requestHostCallback = function (callback) {
  72617. scheduledHostCallback = callback;
  72618. if (!isMessageLoopRunning) {
  72619. isMessageLoopRunning = true;
  72620. port.postMessage(null);
  72621. }
  72622. };
  72623. requestHostTimeout = function (callback, ms) {
  72624. taskTimeoutID = _setTimeout(function () {
  72625. callback(exports.unstable_now());
  72626. }, ms);
  72627. };
  72628. cancelHostTimeout = function () {
  72629. _clearTimeout(taskTimeoutID);
  72630. taskTimeoutID = -1;
  72631. };
  72632. }
  72633. function push(heap, node) {
  72634. var index = heap.length;
  72635. heap.push(node);
  72636. siftUp(heap, node, index);
  72637. }
  72638. function peek(heap) {
  72639. var first = heap[0];
  72640. return first === undefined ? null : first;
  72641. }
  72642. function pop(heap) {
  72643. var first = heap[0];
  72644. if (first !== undefined) {
  72645. var last = heap.pop();
  72646. if (last !== first) {
  72647. heap[0] = last;
  72648. siftDown(heap, last, 0);
  72649. }
  72650. return first;
  72651. } else {
  72652. return null;
  72653. }
  72654. }
  72655. function siftUp(heap, node, i) {
  72656. var index = i;
  72657. while (true) {
  72658. var parentIndex = Math.floor((index - 1) / 2);
  72659. var parent = heap[parentIndex];
  72660. if (parent !== undefined && compare(parent, node) > 0) {
  72661. // The parent is larger. Swap positions.
  72662. heap[parentIndex] = node;
  72663. heap[index] = parent;
  72664. index = parentIndex;
  72665. } else {
  72666. // The parent is smaller. Exit.
  72667. return;
  72668. }
  72669. }
  72670. }
  72671. function siftDown(heap, node, i) {
  72672. var index = i;
  72673. var length = heap.length;
  72674. while (index < length) {
  72675. var leftIndex = (index + 1) * 2 - 1;
  72676. var left = heap[leftIndex];
  72677. var rightIndex = leftIndex + 1;
  72678. var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
  72679. if (left !== undefined && compare(left, node) < 0) {
  72680. if (right !== undefined && compare(right, left) < 0) {
  72681. heap[index] = right;
  72682. heap[rightIndex] = node;
  72683. index = rightIndex;
  72684. } else {
  72685. heap[index] = left;
  72686. heap[leftIndex] = node;
  72687. index = leftIndex;
  72688. }
  72689. } else if (right !== undefined && compare(right, node) < 0) {
  72690. heap[index] = right;
  72691. heap[rightIndex] = node;
  72692. index = rightIndex;
  72693. } else {
  72694. // Neither child is smaller. Exit.
  72695. return;
  72696. }
  72697. }
  72698. }
  72699. function compare(a, b) {
  72700. // Compare sort index first, then task id.
  72701. var diff = a.sortIndex - b.sortIndex;
  72702. return diff !== 0 ? diff : a.id - b.id;
  72703. }
  72704. // TODO: Use symbols?
  72705. var NoPriority = 0;
  72706. var ImmediatePriority = 1;
  72707. var UserBlockingPriority = 2;
  72708. var NormalPriority = 3;
  72709. var LowPriority = 4;
  72710. var IdlePriority = 5;
  72711. var runIdCounter = 0;
  72712. var mainThreadIdCounter = 0;
  72713. var profilingStateSize = 4;
  72714. var sharedProfilingBuffer = enableProfiling ? // $FlowFixMe Flow doesn't know about SharedArrayBuffer
  72715. typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer
  72716. typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9
  72717. : null;
  72718. var profilingState = enableProfiling && sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks
  72719. var PRIORITY = 0;
  72720. var CURRENT_TASK_ID = 1;
  72721. var CURRENT_RUN_ID = 2;
  72722. var QUEUE_SIZE = 3;
  72723. if (enableProfiling) {
  72724. profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue
  72725. // array might include canceled tasks.
  72726. profilingState[QUEUE_SIZE] = 0;
  72727. profilingState[CURRENT_TASK_ID] = 0;
  72728. } // Bytes per element is 4
  72729. var INITIAL_EVENT_LOG_SIZE = 131072;
  72730. var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes
  72731. var eventLogSize = 0;
  72732. var eventLogBuffer = null;
  72733. var eventLog = null;
  72734. var eventLogIndex = 0;
  72735. var TaskStartEvent = 1;
  72736. var TaskCompleteEvent = 2;
  72737. var TaskErrorEvent = 3;
  72738. var TaskCancelEvent = 4;
  72739. var TaskRunEvent = 5;
  72740. var TaskYieldEvent = 6;
  72741. var SchedulerSuspendEvent = 7;
  72742. var SchedulerResumeEvent = 8;
  72743. function logEvent(entries) {
  72744. if (eventLog !== null) {
  72745. var offset = eventLogIndex;
  72746. eventLogIndex += entries.length;
  72747. if (eventLogIndex + 1 > eventLogSize) {
  72748. eventLogSize *= 2;
  72749. if (eventLogSize > MAX_EVENT_LOG_SIZE) {
  72750. console.error("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.');
  72751. stopLoggingProfilingEvents();
  72752. return;
  72753. }
  72754. var newEventLog = new Int32Array(eventLogSize * 4);
  72755. newEventLog.set(eventLog);
  72756. eventLogBuffer = newEventLog.buffer;
  72757. eventLog = newEventLog;
  72758. }
  72759. eventLog.set(entries, offset);
  72760. }
  72761. }
  72762. function startLoggingProfilingEvents() {
  72763. eventLogSize = INITIAL_EVENT_LOG_SIZE;
  72764. eventLogBuffer = new ArrayBuffer(eventLogSize * 4);
  72765. eventLog = new Int32Array(eventLogBuffer);
  72766. eventLogIndex = 0;
  72767. }
  72768. function stopLoggingProfilingEvents() {
  72769. var buffer = eventLogBuffer;
  72770. eventLogSize = 0;
  72771. eventLogBuffer = null;
  72772. eventLog = null;
  72773. eventLogIndex = 0;
  72774. return buffer;
  72775. }
  72776. function markTaskStart(task, ms) {
  72777. if (enableProfiling) {
  72778. profilingState[QUEUE_SIZE]++;
  72779. if (eventLog !== null) {
  72780. // performance.now returns a float, representing milliseconds. When the
  72781. // event is logged, it's coerced to an int. Convert to microseconds to
  72782. // maintain extra degrees of precision.
  72783. logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);
  72784. }
  72785. }
  72786. }
  72787. function markTaskCompleted(task, ms) {
  72788. if (enableProfiling) {
  72789. profilingState[PRIORITY] = NoPriority;
  72790. profilingState[CURRENT_TASK_ID] = 0;
  72791. profilingState[QUEUE_SIZE]--;
  72792. if (eventLog !== null) {
  72793. logEvent([TaskCompleteEvent, ms * 1000, task.id]);
  72794. }
  72795. }
  72796. }
  72797. function markTaskCanceled(task, ms) {
  72798. if (enableProfiling) {
  72799. profilingState[QUEUE_SIZE]--;
  72800. if (eventLog !== null) {
  72801. logEvent([TaskCancelEvent, ms * 1000, task.id]);
  72802. }
  72803. }
  72804. }
  72805. function markTaskErrored(task, ms) {
  72806. if (enableProfiling) {
  72807. profilingState[PRIORITY] = NoPriority;
  72808. profilingState[CURRENT_TASK_ID] = 0;
  72809. profilingState[QUEUE_SIZE]--;
  72810. if (eventLog !== null) {
  72811. logEvent([TaskErrorEvent, ms * 1000, task.id]);
  72812. }
  72813. }
  72814. }
  72815. function markTaskRun(task, ms) {
  72816. if (enableProfiling) {
  72817. runIdCounter++;
  72818. profilingState[PRIORITY] = task.priorityLevel;
  72819. profilingState[CURRENT_TASK_ID] = task.id;
  72820. profilingState[CURRENT_RUN_ID] = runIdCounter;
  72821. if (eventLog !== null) {
  72822. logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);
  72823. }
  72824. }
  72825. }
  72826. function markTaskYield(task, ms) {
  72827. if (enableProfiling) {
  72828. profilingState[PRIORITY] = NoPriority;
  72829. profilingState[CURRENT_TASK_ID] = 0;
  72830. profilingState[CURRENT_RUN_ID] = 0;
  72831. if (eventLog !== null) {
  72832. logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);
  72833. }
  72834. }
  72835. }
  72836. function markSchedulerSuspended(ms) {
  72837. if (enableProfiling) {
  72838. mainThreadIdCounter++;
  72839. if (eventLog !== null) {
  72840. logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);
  72841. }
  72842. }
  72843. }
  72844. function markSchedulerUnsuspended(ms) {
  72845. if (enableProfiling) {
  72846. if (eventLog !== null) {
  72847. logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);
  72848. }
  72849. }
  72850. }
  72851. /* eslint-disable no-var */
  72852. // Math.pow(2, 30) - 1
  72853. // 0b111111111111111111111111111111
  72854. var maxSigned31BitInt = 1073741823; // Times out immediately
  72855. var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
  72856. var USER_BLOCKING_PRIORITY = 250;
  72857. var NORMAL_PRIORITY_TIMEOUT = 5000;
  72858. var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
  72859. var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap
  72860. var taskQueue = [];
  72861. var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
  72862. var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
  72863. var isSchedulerPaused = false;
  72864. var currentTask = null;
  72865. var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.
  72866. var isPerformingWork = false;
  72867. var isHostCallbackScheduled = false;
  72868. var isHostTimeoutScheduled = false;
  72869. function advanceTimers(currentTime) {
  72870. // Check for tasks that are no longer delayed and add them to the queue.
  72871. var timer = peek(timerQueue);
  72872. while (timer !== null) {
  72873. if (timer.callback === null) {
  72874. // Timer was cancelled.
  72875. pop(timerQueue);
  72876. } else if (timer.startTime <= currentTime) {
  72877. // Timer fired. Transfer to the task queue.
  72878. pop(timerQueue);
  72879. timer.sortIndex = timer.expirationTime;
  72880. push(taskQueue, timer);
  72881. if (enableProfiling) {
  72882. markTaskStart(timer, currentTime);
  72883. timer.isQueued = true;
  72884. }
  72885. } else {
  72886. // Remaining timers are pending.
  72887. return;
  72888. }
  72889. timer = peek(timerQueue);
  72890. }
  72891. }
  72892. function handleTimeout(currentTime) {
  72893. isHostTimeoutScheduled = false;
  72894. advanceTimers(currentTime);
  72895. if (!isHostCallbackScheduled) {
  72896. if (peek(taskQueue) !== null) {
  72897. isHostCallbackScheduled = true;
  72898. requestHostCallback(flushWork);
  72899. } else {
  72900. var firstTimer = peek(timerQueue);
  72901. if (firstTimer !== null) {
  72902. requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
  72903. }
  72904. }
  72905. }
  72906. }
  72907. function flushWork(hasTimeRemaining, initialTime) {
  72908. if (enableProfiling) {
  72909. markSchedulerUnsuspended(initialTime);
  72910. } // We'll need a host callback the next time work is scheduled.
  72911. isHostCallbackScheduled = false;
  72912. if (isHostTimeoutScheduled) {
  72913. // We scheduled a timeout but it's no longer needed. Cancel it.
  72914. isHostTimeoutScheduled = false;
  72915. cancelHostTimeout();
  72916. }
  72917. isPerformingWork = true;
  72918. var previousPriorityLevel = currentPriorityLevel;
  72919. try {
  72920. if (enableProfiling) {
  72921. try {
  72922. return workLoop(hasTimeRemaining, initialTime);
  72923. } catch (error) {
  72924. if (currentTask !== null) {
  72925. var currentTime = exports.unstable_now();
  72926. markTaskErrored(currentTask, currentTime);
  72927. currentTask.isQueued = false;
  72928. }
  72929. throw error;
  72930. }
  72931. } else {
  72932. // No catch in prod codepath.
  72933. return workLoop(hasTimeRemaining, initialTime);
  72934. }
  72935. } finally {
  72936. currentTask = null;
  72937. currentPriorityLevel = previousPriorityLevel;
  72938. isPerformingWork = false;
  72939. if (enableProfiling) {
  72940. var _currentTime = exports.unstable_now();
  72941. markSchedulerSuspended(_currentTime);
  72942. }
  72943. }
  72944. }
  72945. function workLoop(hasTimeRemaining, initialTime) {
  72946. var currentTime = initialTime;
  72947. advanceTimers(currentTime);
  72948. currentTask = peek(taskQueue);
  72949. while (currentTask !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
  72950. if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
  72951. // This currentTask hasn't expired, and we've reached the deadline.
  72952. break;
  72953. }
  72954. var callback = currentTask.callback;
  72955. if (callback !== null) {
  72956. currentTask.callback = null;
  72957. currentPriorityLevel = currentTask.priorityLevel;
  72958. var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
  72959. markTaskRun(currentTask, currentTime);
  72960. var continuationCallback = callback(didUserCallbackTimeout);
  72961. currentTime = exports.unstable_now();
  72962. if (typeof continuationCallback === 'function') {
  72963. currentTask.callback = continuationCallback;
  72964. markTaskYield(currentTask, currentTime);
  72965. } else {
  72966. if (enableProfiling) {
  72967. markTaskCompleted(currentTask, currentTime);
  72968. currentTask.isQueued = false;
  72969. }
  72970. if (currentTask === peek(taskQueue)) {
  72971. pop(taskQueue);
  72972. }
  72973. }
  72974. advanceTimers(currentTime);
  72975. } else {
  72976. pop(taskQueue);
  72977. }
  72978. currentTask = peek(taskQueue);
  72979. } // Return whether there's additional work
  72980. if (currentTask !== null) {
  72981. return true;
  72982. } else {
  72983. var firstTimer = peek(timerQueue);
  72984. if (firstTimer !== null) {
  72985. requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
  72986. }
  72987. return false;
  72988. }
  72989. }
  72990. function unstable_runWithPriority(priorityLevel, eventHandler) {
  72991. switch (priorityLevel) {
  72992. case ImmediatePriority:
  72993. case UserBlockingPriority:
  72994. case NormalPriority:
  72995. case LowPriority:
  72996. case IdlePriority:
  72997. break;
  72998. default:
  72999. priorityLevel = NormalPriority;
  73000. }
  73001. var previousPriorityLevel = currentPriorityLevel;
  73002. currentPriorityLevel = priorityLevel;
  73003. try {
  73004. return eventHandler();
  73005. } finally {
  73006. currentPriorityLevel = previousPriorityLevel;
  73007. }
  73008. }
  73009. function unstable_next(eventHandler) {
  73010. var priorityLevel;
  73011. switch (currentPriorityLevel) {
  73012. case ImmediatePriority:
  73013. case UserBlockingPriority:
  73014. case NormalPriority:
  73015. // Shift down to normal priority
  73016. priorityLevel = NormalPriority;
  73017. break;
  73018. default:
  73019. // Anything lower than normal priority should remain at the current level.
  73020. priorityLevel = currentPriorityLevel;
  73021. break;
  73022. }
  73023. var previousPriorityLevel = currentPriorityLevel;
  73024. currentPriorityLevel = priorityLevel;
  73025. try {
  73026. return eventHandler();
  73027. } finally {
  73028. currentPriorityLevel = previousPriorityLevel;
  73029. }
  73030. }
  73031. function unstable_wrapCallback(callback) {
  73032. var parentPriorityLevel = currentPriorityLevel;
  73033. return function () {
  73034. // This is a fork of runWithPriority, inlined for performance.
  73035. var previousPriorityLevel = currentPriorityLevel;
  73036. currentPriorityLevel = parentPriorityLevel;
  73037. try {
  73038. return callback.apply(this, arguments);
  73039. } finally {
  73040. currentPriorityLevel = previousPriorityLevel;
  73041. }
  73042. };
  73043. }
  73044. function timeoutForPriorityLevel(priorityLevel) {
  73045. switch (priorityLevel) {
  73046. case ImmediatePriority:
  73047. return IMMEDIATE_PRIORITY_TIMEOUT;
  73048. case UserBlockingPriority:
  73049. return USER_BLOCKING_PRIORITY;
  73050. case IdlePriority:
  73051. return IDLE_PRIORITY;
  73052. case LowPriority:
  73053. return LOW_PRIORITY_TIMEOUT;
  73054. case NormalPriority:
  73055. default:
  73056. return NORMAL_PRIORITY_TIMEOUT;
  73057. }
  73058. }
  73059. function unstable_scheduleCallback(priorityLevel, callback, options) {
  73060. var currentTime = exports.unstable_now();
  73061. var startTime;
  73062. var timeout;
  73063. if (typeof options === 'object' && options !== null) {
  73064. var delay = options.delay;
  73065. if (typeof delay === 'number' && delay > 0) {
  73066. startTime = currentTime + delay;
  73067. } else {
  73068. startTime = currentTime;
  73069. }
  73070. timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
  73071. } else {
  73072. timeout = timeoutForPriorityLevel(priorityLevel);
  73073. startTime = currentTime;
  73074. }
  73075. var expirationTime = startTime + timeout;
  73076. var newTask = {
  73077. id: taskIdCounter++,
  73078. callback: callback,
  73079. priorityLevel: priorityLevel,
  73080. startTime: startTime,
  73081. expirationTime: expirationTime,
  73082. sortIndex: -1
  73083. };
  73084. if (enableProfiling) {
  73085. newTask.isQueued = false;
  73086. }
  73087. if (startTime > currentTime) {
  73088. // This is a delayed task.
  73089. newTask.sortIndex = startTime;
  73090. push(timerQueue, newTask);
  73091. if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
  73092. // All tasks are delayed, and this is the task with the earliest delay.
  73093. if (isHostTimeoutScheduled) {
  73094. // Cancel an existing timeout.
  73095. cancelHostTimeout();
  73096. } else {
  73097. isHostTimeoutScheduled = true;
  73098. } // Schedule a timeout.
  73099. requestHostTimeout(handleTimeout, startTime - currentTime);
  73100. }
  73101. } else {
  73102. newTask.sortIndex = expirationTime;
  73103. push(taskQueue, newTask);
  73104. if (enableProfiling) {
  73105. markTaskStart(newTask, currentTime);
  73106. newTask.isQueued = true;
  73107. } // Schedule a host callback, if needed. If we're already performing work,
  73108. // wait until the next time we yield.
  73109. if (!isHostCallbackScheduled && !isPerformingWork) {
  73110. isHostCallbackScheduled = true;
  73111. requestHostCallback(flushWork);
  73112. }
  73113. }
  73114. return newTask;
  73115. }
  73116. function unstable_pauseExecution() {
  73117. isSchedulerPaused = true;
  73118. }
  73119. function unstable_continueExecution() {
  73120. isSchedulerPaused = false;
  73121. if (!isHostCallbackScheduled && !isPerformingWork) {
  73122. isHostCallbackScheduled = true;
  73123. requestHostCallback(flushWork);
  73124. }
  73125. }
  73126. function unstable_getFirstCallbackNode() {
  73127. return peek(taskQueue);
  73128. }
  73129. function unstable_cancelCallback(task) {
  73130. if (enableProfiling) {
  73131. if (task.isQueued) {
  73132. var currentTime = exports.unstable_now();
  73133. markTaskCanceled(task, currentTime);
  73134. task.isQueued = false;
  73135. }
  73136. } // Null out the callback to indicate the task has been canceled. (Can't
  73137. // remove from the queue because you can't remove arbitrary nodes from an
  73138. // array based heap, only the first one.)
  73139. task.callback = null;
  73140. }
  73141. function unstable_getCurrentPriorityLevel() {
  73142. return currentPriorityLevel;
  73143. }
  73144. function unstable_shouldYield() {
  73145. var currentTime = exports.unstable_now();
  73146. advanceTimers(currentTime);
  73147. var firstTask = peek(taskQueue);
  73148. return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
  73149. }
  73150. var unstable_requestPaint = requestPaint;
  73151. var unstable_Profiling = enableProfiling ? {
  73152. startLoggingProfilingEvents: startLoggingProfilingEvents,
  73153. stopLoggingProfilingEvents: stopLoggingProfilingEvents,
  73154. sharedProfilingBuffer: sharedProfilingBuffer
  73155. } : null;
  73156. exports.unstable_ImmediatePriority = ImmediatePriority;
  73157. exports.unstable_UserBlockingPriority = UserBlockingPriority;
  73158. exports.unstable_NormalPriority = NormalPriority;
  73159. exports.unstable_IdlePriority = IdlePriority;
  73160. exports.unstable_LowPriority = LowPriority;
  73161. exports.unstable_runWithPriority = unstable_runWithPriority;
  73162. exports.unstable_next = unstable_next;
  73163. exports.unstable_scheduleCallback = unstable_scheduleCallback;
  73164. exports.unstable_cancelCallback = unstable_cancelCallback;
  73165. exports.unstable_wrapCallback = unstable_wrapCallback;
  73166. exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
  73167. exports.unstable_shouldYield = unstable_shouldYield;
  73168. exports.unstable_requestPaint = unstable_requestPaint;
  73169. exports.unstable_continueExecution = unstable_continueExecution;
  73170. exports.unstable_pauseExecution = unstable_pauseExecution;
  73171. exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
  73172. exports.unstable_Profiling = unstable_Profiling;
  73173. })();
  73174. }
  73175. /***/ }),
  73176. /***/ "./node_modules/scheduler/index.js":
  73177. /*!*****************************************!*\
  73178. !*** ./node_modules/scheduler/index.js ***!
  73179. \*****************************************/
  73180. /*! no static exports found */
  73181. /***/ (function(module, exports, __webpack_require__) {
  73182. "use strict";
  73183. if (false) {} else {
  73184. module.exports = __webpack_require__(/*! ./cjs/scheduler.development.js */ "./node_modules/scheduler/cjs/scheduler.development.js");
  73185. }
  73186. /***/ }),
  73187. /***/ "./node_modules/scheduler/tracing.js":
  73188. /*!*******************************************!*\
  73189. !*** ./node_modules/scheduler/tracing.js ***!
  73190. \*******************************************/
  73191. /*! no static exports found */
  73192. /***/ (function(module, exports, __webpack_require__) {
  73193. "use strict";
  73194. if (false) {} else {
  73195. module.exports = __webpack_require__(/*! ./cjs/scheduler-tracing.development.js */ "./node_modules/scheduler/cjs/scheduler-tracing.development.js");
  73196. }
  73197. /***/ }),
  73198. /***/ "./node_modules/uncontrollable/esm/hook.js":
  73199. /*!*************************************************!*\
  73200. !*** ./node_modules/uncontrollable/esm/hook.js ***!
  73201. \*************************************************/
  73202. /*! exports provided: useUncontrolledProp, default */
  73203. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73204. "use strict";
  73205. __webpack_require__.r(__webpack_exports__);
  73206. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useUncontrolledProp", function() { return useUncontrolledProp; });
  73207. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useUncontrolled; });
  73208. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  73209. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  73210. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  73211. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  73212. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/uncontrollable/esm/utils.js");
  73213. function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
  73214. function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
  73215. function useUncontrolledProp(propValue, defaultValue, handler) {
  73216. var wasPropRef = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(propValue !== undefined);
  73217. var _useState = Object(react__WEBPACK_IMPORTED_MODULE_2__["useState"])(defaultValue),
  73218. stateValue = _useState[0],
  73219. setState = _useState[1];
  73220. var isProp = propValue !== undefined;
  73221. var wasProp = wasPropRef.current;
  73222. wasPropRef.current = isProp;
  73223. /**
  73224. * If a prop switches from controlled to Uncontrolled
  73225. * reset its value to the defaultValue
  73226. */
  73227. if (!isProp && wasProp && stateValue !== defaultValue) {
  73228. setState(defaultValue);
  73229. }
  73230. return [isProp ? propValue : stateValue, Object(react__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (value) {
  73231. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  73232. args[_key - 1] = arguments[_key];
  73233. }
  73234. if (handler) handler.apply(void 0, [value].concat(args));
  73235. setState(value);
  73236. }, [handler])];
  73237. }
  73238. function useUncontrolled(props, config) {
  73239. return Object.keys(config).reduce(function (result, fieldName) {
  73240. var _extends2;
  73241. var _ref = result,
  73242. defaultValue = _ref[_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName)],
  73243. propsValue = _ref[fieldName],
  73244. rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, [_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName), fieldName].map(_toPropertyKey));
  73245. var handlerName = config[fieldName];
  73246. var _useUncontrolledProp = useUncontrolledProp(propsValue, defaultValue, props[handlerName]),
  73247. value = _useUncontrolledProp[0],
  73248. handler = _useUncontrolledProp[1];
  73249. return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, (_extends2 = {}, _extends2[fieldName] = value, _extends2[handlerName] = handler, _extends2));
  73250. }, props);
  73251. }
  73252. /***/ }),
  73253. /***/ "./node_modules/uncontrollable/esm/index.js":
  73254. /*!**************************************************!*\
  73255. !*** ./node_modules/uncontrollable/esm/index.js ***!
  73256. \**************************************************/
  73257. /*! exports provided: useUncontrolled, useUncontrolledProp, uncontrollable */
  73258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73259. "use strict";
  73260. __webpack_require__.r(__webpack_exports__);
  73261. /* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hook */ "./node_modules/uncontrollable/esm/hook.js");
  73262. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useUncontrolled", function() { return _hook__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  73263. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useUncontrolledProp", function() { return _hook__WEBPACK_IMPORTED_MODULE_0__["useUncontrolledProp"]; });
  73264. /* harmony import */ var _uncontrollable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uncontrollable */ "./node_modules/uncontrollable/esm/uncontrollable.js");
  73265. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uncontrollable", function() { return _uncontrollable__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  73266. /***/ }),
  73267. /***/ "./node_modules/uncontrollable/esm/uncontrollable.js":
  73268. /*!***********************************************************!*\
  73269. !*** ./node_modules/uncontrollable/esm/uncontrollable.js ***!
  73270. \***********************************************************/
  73271. /*! exports provided: default */
  73272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73273. "use strict";
  73274. __webpack_require__.r(__webpack_exports__);
  73275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return uncontrollable; });
  73276. /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
  73277. /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
  73278. /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
  73279. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  73280. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  73281. /* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js");
  73282. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
  73283. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_5__);
  73284. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ "./node_modules/uncontrollable/esm/utils.js");
  73285. function uncontrollable(Component, controlledValues, methods) {
  73286. if (methods === void 0) {
  73287. methods = [];
  73288. }
  73289. var displayName = Component.displayName || Component.name || 'Component';
  73290. var canAcceptRef = _utils__WEBPACK_IMPORTED_MODULE_6__["canAcceptRef"](Component);
  73291. var controlledProps = Object.keys(controlledValues);
  73292. var PROPS_TO_OMIT = controlledProps.map(_utils__WEBPACK_IMPORTED_MODULE_6__["defaultKey"]);
  73293. !(canAcceptRef || !methods.length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_5___default()(false, '[uncontrollable] stateless function components cannot pass through methods ' + 'because they have no associated instances. Check component: ' + displayName + ', ' + 'attempting to pass through methods: ' + methods.join(', ')) : undefined : void 0;
  73294. var UncontrolledComponent =
  73295. /*#__PURE__*/
  73296. function (_React$Component) {
  73297. Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(UncontrolledComponent, _React$Component);
  73298. function UncontrolledComponent() {
  73299. var _this;
  73300. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  73301. args[_key] = arguments[_key];
  73302. }
  73303. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  73304. _this.handlers = Object.create(null);
  73305. controlledProps.forEach(function (propName) {
  73306. var handlerName = controlledValues[propName];
  73307. var handleChange = function handleChange(value) {
  73308. if (_this.props[handlerName]) {
  73309. var _this$props;
  73310. _this._notifying = true;
  73311. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  73312. args[_key2 - 1] = arguments[_key2];
  73313. }
  73314. (_this$props = _this.props)[handlerName].apply(_this$props, [value].concat(args));
  73315. _this._notifying = false;
  73316. }
  73317. if (!_this.unmounted) _this.setState(function (_ref) {
  73318. var _extends2;
  73319. var values = _ref.values;
  73320. return {
  73321. values: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])(Object.create(null), values, (_extends2 = {}, _extends2[propName] = value, _extends2))
  73322. };
  73323. });
  73324. };
  73325. _this.handlers[handlerName] = handleChange;
  73326. });
  73327. if (methods.length) _this.attachRef = function (ref) {
  73328. _this.inner = ref;
  73329. };
  73330. var values = Object.create(null);
  73331. controlledProps.forEach(function (key) {
  73332. values[key] = _this.props[_utils__WEBPACK_IMPORTED_MODULE_6__["defaultKey"](key)];
  73333. });
  73334. _this.state = {
  73335. values: values,
  73336. prevProps: {}
  73337. };
  73338. return _this;
  73339. }
  73340. var _proto = UncontrolledComponent.prototype;
  73341. _proto.shouldComponentUpdate = function shouldComponentUpdate() {
  73342. //let setState trigger the update
  73343. return !this._notifying;
  73344. };
  73345. UncontrolledComponent.getDerivedStateFromProps = function getDerivedStateFromProps(props, _ref2) {
  73346. var values = _ref2.values,
  73347. prevProps = _ref2.prevProps;
  73348. var nextState = {
  73349. values: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])(Object.create(null), values),
  73350. prevProps: {}
  73351. };
  73352. controlledProps.forEach(function (key) {
  73353. /**
  73354. * If a prop switches from controlled to Uncontrolled
  73355. * reset its value to the defaultValue
  73356. */
  73357. nextState.prevProps[key] = props[key];
  73358. if (!_utils__WEBPACK_IMPORTED_MODULE_6__["isProp"](props, key) && _utils__WEBPACK_IMPORTED_MODULE_6__["isProp"](prevProps, key)) {
  73359. nextState.values[key] = props[_utils__WEBPACK_IMPORTED_MODULE_6__["defaultKey"](key)];
  73360. }
  73361. });
  73362. return nextState;
  73363. };
  73364. _proto.componentWillUnmount = function componentWillUnmount() {
  73365. this.unmounted = true;
  73366. };
  73367. _proto.render = function render() {
  73368. var _this2 = this;
  73369. var _this$props2 = this.props,
  73370. innerRef = _this$props2.innerRef,
  73371. props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props2, ["innerRef"]);
  73372. PROPS_TO_OMIT.forEach(function (prop) {
  73373. delete props[prop];
  73374. });
  73375. var newProps = {};
  73376. controlledProps.forEach(function (propName) {
  73377. var propValue = _this2.props[propName];
  73378. newProps[propName] = propValue !== undefined ? propValue : _this2.state.values[propName];
  73379. });
  73380. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, newProps, this.handlers, {
  73381. ref: innerRef || this.attachRef
  73382. }));
  73383. };
  73384. return UncontrolledComponent;
  73385. }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
  73386. Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_4__["polyfill"])(UncontrolledComponent);
  73387. UncontrolledComponent.displayName = "Uncontrolled(" + displayName + ")";
  73388. UncontrolledComponent.propTypes = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
  73389. innerRef: function innerRef() {}
  73390. }, _utils__WEBPACK_IMPORTED_MODULE_6__["uncontrolledPropTypes"](controlledValues, displayName));
  73391. methods.forEach(function (method) {
  73392. UncontrolledComponent.prototype[method] = function $proxiedMethod() {
  73393. var _this$inner;
  73394. return (_this$inner = this.inner)[method].apply(_this$inner, arguments);
  73395. };
  73396. });
  73397. var WrappedComponent = UncontrolledComponent;
  73398. if (react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef) {
  73399. WrappedComponent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
  73400. return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(UncontrolledComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, {
  73401. innerRef: ref
  73402. }));
  73403. });
  73404. WrappedComponent.propTypes = UncontrolledComponent.propTypes;
  73405. }
  73406. WrappedComponent.ControlledComponent = Component;
  73407. /**
  73408. * useful when wrapping a Component and you want to control
  73409. * everything
  73410. */
  73411. WrappedComponent.deferControlTo = function (newComponent, additions, nextMethods) {
  73412. if (additions === void 0) {
  73413. additions = {};
  73414. }
  73415. return uncontrollable(newComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, controlledValues, additions), nextMethods);
  73416. };
  73417. return WrappedComponent;
  73418. }
  73419. /***/ }),
  73420. /***/ "./node_modules/uncontrollable/esm/utils.js":
  73421. /*!**************************************************!*\
  73422. !*** ./node_modules/uncontrollable/esm/utils.js ***!
  73423. \**************************************************/
  73424. /*! exports provided: uncontrolledPropTypes, isProp, defaultKey, canAcceptRef */
  73425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73426. "use strict";
  73427. __webpack_require__.r(__webpack_exports__);
  73428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uncontrolledPropTypes", function() { return uncontrolledPropTypes; });
  73429. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isProp", function() { return isProp; });
  73430. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultKey", function() { return defaultKey; });
  73431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canAcceptRef", function() { return canAcceptRef; });
  73432. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
  73433. /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
  73434. var noop = function noop() {};
  73435. function readOnlyPropType(handler, name) {
  73436. return function (props, propName) {
  73437. if (props[propName] !== undefined) {
  73438. if (!props[handler]) {
  73439. return new Error("You have provided a `" + propName + "` prop to `" + name + "` " + ("without an `" + handler + "` handler prop. This will render a read-only field. ") + ("If the field should be mutable use `" + defaultKey(propName) + "`. ") + ("Otherwise, set `" + handler + "`."));
  73440. }
  73441. }
  73442. };
  73443. }
  73444. function uncontrolledPropTypes(controlledValues, displayName) {
  73445. var propTypes = {};
  73446. Object.keys(controlledValues).forEach(function (prop) {
  73447. // add default propTypes for folks that use runtime checks
  73448. propTypes[defaultKey(prop)] = noop;
  73449. if (true) {
  73450. var handler = controlledValues[prop];
  73451. !(typeof handler === 'string' && handler.trim().length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_0___default()(false, 'Uncontrollable - [%s]: the prop `%s` needs a valid handler key name in order to make it uncontrollable', displayName, prop) : undefined : void 0;
  73452. propTypes[prop] = readOnlyPropType(handler, displayName);
  73453. }
  73454. });
  73455. return propTypes;
  73456. }
  73457. function isProp(props, prop) {
  73458. return props[prop] !== undefined;
  73459. }
  73460. function defaultKey(key) {
  73461. return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
  73462. }
  73463. /**
  73464. * Copyright (c) 2013-present, Facebook, Inc.
  73465. * All rights reserved.
  73466. *
  73467. * This source code is licensed under the BSD-style license found in the
  73468. * LICENSE file in the root directory of this source tree. An additional grant
  73469. * of patent rights can be found in the PATENTS file in the same directory.
  73470. */
  73471. function canAcceptRef(component) {
  73472. return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent);
  73473. }
  73474. /***/ }),
  73475. /***/ "./node_modules/warning/warning.js":
  73476. /*!*****************************************!*\
  73477. !*** ./node_modules/warning/warning.js ***!
  73478. \*****************************************/
  73479. /*! no static exports found */
  73480. /***/ (function(module, exports, __webpack_require__) {
  73481. "use strict";
  73482. /**
  73483. * Copyright (c) 2014-present, Facebook, Inc.
  73484. *
  73485. * This source code is licensed under the MIT license found in the
  73486. * LICENSE file in the root directory of this source tree.
  73487. */
  73488. /**
  73489. * Similar to invariant but only logs a warning if the condition is not met.
  73490. * This can be used to log issues in development environments in critical
  73491. * paths. Removing the logging code for production environments will keep the
  73492. * same logic and follow the same code paths.
  73493. */
  73494. var __DEV__ = "development" !== 'production';
  73495. var warning = function() {};
  73496. if (__DEV__) {
  73497. var printWarning = function printWarning(format, args) {
  73498. var len = arguments.length;
  73499. args = new Array(len > 1 ? len - 1 : 0);
  73500. for (var key = 1; key < len; key++) {
  73501. args[key - 1] = arguments[key];
  73502. }
  73503. var argIndex = 0;
  73504. var message = 'Warning: ' +
  73505. format.replace(/%s/g, function() {
  73506. return args[argIndex++];
  73507. });
  73508. if (typeof console !== 'undefined') {
  73509. console.error(message);
  73510. }
  73511. try {
  73512. // --- Welcome to debugging React ---
  73513. // This error was thrown as a convenience so that you can use this stack
  73514. // to find the callsite that caused this warning to fire.
  73515. throw new Error(message);
  73516. } catch (x) {}
  73517. }
  73518. warning = function(condition, format, args) {
  73519. var len = arguments.length;
  73520. args = new Array(len > 2 ? len - 2 : 0);
  73521. for (var key = 2; key < len; key++) {
  73522. args[key - 2] = arguments[key];
  73523. }
  73524. if (format === undefined) {
  73525. throw new Error(
  73526. '`warning(condition, format, ...args)` requires a warning ' +
  73527. 'message argument'
  73528. );
  73529. }
  73530. if (!condition) {
  73531. printWarning.apply(null, [format].concat(args));
  73532. }
  73533. };
  73534. }
  73535. module.exports = warning;
  73536. /***/ }),
  73537. /***/ "./node_modules/webpack/buildin/global.js":
  73538. /*!***********************************!*\
  73539. !*** (webpack)/buildin/global.js ***!
  73540. \***********************************/
  73541. /*! no static exports found */
  73542. /***/ (function(module, exports) {
  73543. var g;
  73544. // This works in non-strict mode
  73545. g = (function() {
  73546. return this;
  73547. })();
  73548. try {
  73549. // This works if eval is allowed (see CSP)
  73550. g = g || new Function("return this")();
  73551. } catch (e) {
  73552. // This works if the window reference is available
  73553. if (typeof window === "object") g = window;
  73554. }
  73555. // g can still be undefined, but nothing to do about it...
  73556. // We return undefined, instead of nothing here, so it's
  73557. // easier to handle this case. if(!global) { ...}
  73558. module.exports = g;
  73559. /***/ }),
  73560. /***/ "./node_modules/webpack/buildin/module.js":
  73561. /*!***********************************!*\
  73562. !*** (webpack)/buildin/module.js ***!
  73563. \***********************************/
  73564. /*! no static exports found */
  73565. /***/ (function(module, exports) {
  73566. module.exports = function(module) {
  73567. if (!module.webpackPolyfill) {
  73568. module.deprecate = function() {};
  73569. module.paths = [];
  73570. // module.parent = undefined by default
  73571. if (!module.children) module.children = [];
  73572. Object.defineProperty(module, "loaded", {
  73573. enumerable: true,
  73574. get: function() {
  73575. return module.l;
  73576. }
  73577. });
  73578. Object.defineProperty(module, "id", {
  73579. enumerable: true,
  73580. get: function() {
  73581. return module.i;
  73582. }
  73583. });
  73584. module.webpackPolyfill = 1;
  73585. }
  73586. return module;
  73587. };
  73588. /***/ }),
  73589. /***/ "./node_modules/xlsx/dist/cpexcel.js":
  73590. /*!*******************************************!*\
  73591. !*** ./node_modules/xlsx/dist/cpexcel.js ***!
  73592. \*******************************************/
  73593. /*! no static exports found */
  73594. /***/ (function(module, exports, __webpack_require__) {
  73595. /* WEBPACK VAR INJECTION */(function(Buffer) {/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
  73596. /*jshint -W100 */
  73597. var cptable = {version:"1.14.0"};
  73598. cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73599. cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖܢ٥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73600. cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73601. cptable[850] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73602. cptable[852] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73603. cptable[857] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73604. cptable[861] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73605. cptable[865] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73606. cptable[866] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73607. cptable[874] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73608. cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  73609. cptable[932] = (function(){ var d = [], e = {}, D = [], j;
  73610. D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚��������������������������������".split("");
  73611. for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
  73612. D[129] = "���������������������������������������������������������������� 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈〉《》「」『』【】+-±×�÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓�����������∈∋⊆⊇⊂⊃∪∩��������∧∨¬⇒⇔∀∃�����������∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬�������ʼn♯♭♪†‡¶����◯���".split("");
  73613. for(j = 0; j != D[129].length; ++j) if(D[129][j].charCodeAt(0) !== 0xFFFD) { e[D[129][j]] = 33024 + j; d[33024 + j] = D[129][j];}
  73614. D[130] = "�������������������������������������������������������������������������������0123456789�������ABCDEFGHIJKLMNOPQRSTUVWXYZ�������abcdefghijklmnopqrstuvwxyz����ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん��������������".split("");
  73615. for(j = 0; j != D[130].length; ++j) if(D[130][j].charCodeAt(0) !== 0xFFFD) { e[D[130][j]] = 33280 + j; d[33280 + j] = D[130][j];}
  73616. D[131] = "����������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミ�ムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ��������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�����������������������������������������".split("");
  73617. for(j = 0; j != D[131].length; ++j) if(D[131][j].charCodeAt(0) !== 0xFFFD) { e[D[131][j]] = 33536 + j; d[33536 + j] = D[131][j];}
  73618. D[132] = "����������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмн�опрстуфхцчшщъыьэюя�������������─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂�����������������������������������������������������������������".split("");
  73619. for(j = 0; j != D[132].length; ++j) if(D[132][j].charCodeAt(0) !== 0xFFFD) { e[D[132][j]] = 33792 + j; d[33792 + j] = D[132][j];}
  73620. D[135] = "����������������������������������������������������������������①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ�㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡��������㍻�〝〟№㏍℡㊤㊥㊦㊧㊨㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪���������������������������������������������������������������������������������������������������".split("");
  73621. for(j = 0; j != D[135].length; ++j) if(D[135][j].charCodeAt(0) !== 0xFFFD) { e[D[135][j]] = 34560 + j; d[34560 + j] = D[135][j];}
  73622. D[136] = "���������������������������������������������������������������������������������������������������������������������������������������������������������������亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭���".split("");
  73623. for(j = 0; j != D[136].length; ++j) if(D[136][j].charCodeAt(0) !== 0xFFFD) { e[D[136][j]] = 34816 + j; d[34816 + j] = D[136][j];}
  73624. D[137] = "����������������������������������������������������������������院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円�園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改���".split("");
  73625. for(j = 0; j != D[137].length; ++j) if(D[137][j].charCodeAt(0) !== 0xFFFD) { e[D[137][j]] = 35072 + j; d[35072 + j] = D[137][j];}
  73626. D[138] = "����������������������������������������������������������������魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫�橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄���".split("");
  73627. for(j = 0; j != D[138].length; ++j) if(D[138][j].charCodeAt(0) !== 0xFFFD) { e[D[138][j]] = 35328 + j; d[35328 + j] = D[138][j];}
  73628. D[139] = "����������������������������������������������������������������機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救�朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈���".split("");
  73629. for(j = 0; j != D[139].length; ++j) if(D[139][j].charCodeAt(0) !== 0xFFFD) { e[D[139][j]] = 35584 + j; d[35584 + j] = D[139][j];}
  73630. D[140] = "����������������������������������������������������������������掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨�劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向���".split("");
  73631. for(j = 0; j != D[140].length; ++j) if(D[140][j].charCodeAt(0) !== 0xFFFD) { e[D[140][j]] = 35840 + j; d[35840 + j] = D[140][j];}
  73632. D[141] = "����������������������������������������������������������������后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降�項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷���".split("");
  73633. for(j = 0; j != D[141].length; ++j) if(D[141][j].charCodeAt(0) !== 0xFFFD) { e[D[141][j]] = 36096 + j; d[36096 + j] = D[141][j];}
  73634. D[142] = "����������������������������������������������������������������察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止�死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周���".split("");
  73635. for(j = 0; j != D[142].length; ++j) if(D[142][j].charCodeAt(0) !== 0xFFFD) { e[D[142][j]] = 36352 + j; d[36352 + j] = D[142][j];}
  73636. D[143] = "����������������������������������������������������������������宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳�準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾���".split("");
  73637. for(j = 0; j != D[143].length; ++j) if(D[143][j].charCodeAt(0) !== 0xFFFD) { e[D[143][j]] = 36608 + j; d[36608 + j] = D[143][j];}
  73638. D[144] = "����������������������������������������������������������������拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨�逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線���".split("");
  73639. for(j = 0; j != D[144].length; ++j) if(D[144][j].charCodeAt(0) !== 0xFFFD) { e[D[144][j]] = 36864 + j; d[36864 + j] = D[144][j];}
  73640. D[145] = "����������������������������������������������������������������繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻�操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只���".split("");
  73641. for(j = 0; j != D[145].length; ++j) if(D[145][j].charCodeAt(0) !== 0xFFFD) { e[D[145][j]] = 37120 + j; d[37120 + j] = D[145][j];}
  73642. D[146] = "����������������������������������������������������������������叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄�逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓���".split("");
  73643. for(j = 0; j != D[146].length; ++j) if(D[146][j].charCodeAt(0) !== 0xFFFD) { e[D[146][j]] = 37376 + j; d[37376 + j] = D[146][j];}
  73644. D[147] = "����������������������������������������������������������������邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬�凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入���".split("");
  73645. for(j = 0; j != D[147].length; ++j) if(D[147][j].charCodeAt(0) !== 0xFFFD) { e[D[147][j]] = 37632 + j; d[37632 + j] = D[147][j];}
  73646. D[148] = "����������������������������������������������������������������如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅�楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美���".split("");
  73647. for(j = 0; j != D[148].length; ++j) if(D[148][j].charCodeAt(0) !== 0xFFFD) { e[D[148][j]] = 37888 + j; d[37888 + j] = D[148][j];}
  73648. D[149] = "����������������������������������������������������������������鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷�斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋���".split("");
  73649. for(j = 0; j != D[149].length; ++j) if(D[149][j].charCodeAt(0) !== 0xFFFD) { e[D[149][j]] = 38144 + j; d[38144 + j] = D[149][j];}
  73650. D[150] = "����������������������������������������������������������������法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆�摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒���".split("");
  73651. for(j = 0; j != D[150].length; ++j) if(D[150][j].charCodeAt(0) !== 0xFFFD) { e[D[150][j]] = 38400 + j; d[38400 + j] = D[150][j];}
  73652. D[151] = "����������������������������������������������������������������諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲�沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯���".split("");
  73653. for(j = 0; j != D[151].length; ++j) if(D[151][j].charCodeAt(0) !== 0xFFFD) { e[D[151][j]] = 38656 + j; d[38656 + j] = D[151][j];}
  73654. D[152] = "����������������������������������������������������������������蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕��������������������������������������������弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲���".split("");
  73655. for(j = 0; j != D[152].length; ++j) if(D[152][j].charCodeAt(0) !== 0xFFFD) { e[D[152][j]] = 38912 + j; d[38912 + j] = D[152][j];}
  73656. D[153] = "����������������������������������������������������������������僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭�凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨���".split("");
  73657. for(j = 0; j != D[153].length; ++j) if(D[153][j].charCodeAt(0) !== 0xFFFD) { e[D[153][j]] = 39168 + j; d[39168 + j] = D[153][j];}
  73658. D[154] = "����������������������������������������������������������������咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸�噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩���".split("");
  73659. for(j = 0; j != D[154].length; ++j) if(D[154][j].charCodeAt(0) !== 0xFFFD) { e[D[154][j]] = 39424 + j; d[39424 + j] = D[154][j];}
  73660. D[155] = "����������������������������������������������������������������奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀�它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏���".split("");
  73661. for(j = 0; j != D[155].length; ++j) if(D[155][j].charCodeAt(0) !== 0xFFFD) { e[D[155][j]] = 39680 + j; d[39680 + j] = D[155][j];}
  73662. D[156] = "����������������������������������������������������������������廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠�怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛���".split("");
  73663. for(j = 0; j != D[156].length; ++j) if(D[156][j].charCodeAt(0) !== 0xFFFD) { e[D[156][j]] = 39936 + j; d[39936 + j] = D[156][j];}
  73664. D[157] = "����������������������������������������������������������������戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫�捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼���".split("");
  73665. for(j = 0; j != D[157].length; ++j) if(D[157][j].charCodeAt(0) !== 0xFFFD) { e[D[157][j]] = 40192 + j; d[40192 + j] = D[157][j];}
  73666. D[158] = "����������������������������������������������������������������曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎�梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣���".split("");
  73667. for(j = 0; j != D[158].length; ++j) if(D[158][j].charCodeAt(0) !== 0xFFFD) { e[D[158][j]] = 40448 + j; d[40448 + j] = D[158][j];}
  73668. D[159] = "����������������������������������������������������������������檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯�麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌���".split("");
  73669. for(j = 0; j != D[159].length; ++j) if(D[159][j].charCodeAt(0) !== 0xFFFD) { e[D[159][j]] = 40704 + j; d[40704 + j] = D[159][j];}
  73670. D[224] = "����������������������������������������������������������������漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝�烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱���".split("");
  73671. for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
  73672. D[225] = "����������������������������������������������������������������瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿�痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬���".split("");
  73673. for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
  73674. D[226] = "����������������������������������������������������������������磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰�窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆���".split("");
  73675. for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
  73676. D[227] = "����������������������������������������������������������������紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷�縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋���".split("");
  73677. for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
  73678. D[228] = "����������������������������������������������������������������隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤�艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈���".split("");
  73679. for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
  73680. D[229] = "����������������������������������������������������������������蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬�蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞���".split("");
  73681. for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
  73682. D[230] = "����������������������������������������������������������������襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧�諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊���".split("");
  73683. for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
  73684. D[231] = "����������������������������������������������������������������蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜�轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮���".split("");
  73685. for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
  73686. D[232] = "����������������������������������������������������������������錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙�閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰���".split("");
  73687. for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
  73688. D[233] = "����������������������������������������������������������������顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃�騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈���".split("");
  73689. for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
  73690. D[234] = "����������������������������������������������������������������鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯�黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙�������������������������������������������������������������������������������������������".split("");
  73691. for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
  73692. D[237] = "����������������������������������������������������������������纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏�塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱���".split("");
  73693. for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
  73694. D[238] = "����������������������������������������������������������������犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙�蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑��ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ¬¦'"���".split("");
  73695. for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
  73696. D[250] = "����������������������������������������������������������������ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊�兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯���".split("");
  73697. for(j = 0; j != D[250].length; ++j) if(D[250][j].charCodeAt(0) !== 0xFFFD) { e[D[250][j]] = 64000 + j; d[64000 + j] = D[250][j];}
  73698. D[251] = "����������������������������������������������������������������涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神�祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙���".split("");
  73699. for(j = 0; j != D[251].length; ++j) if(D[251][j].charCodeAt(0) !== 0xFFFD) { e[D[251][j]] = 64256 + j; d[64256 + j] = D[251][j];}
  73700. D[252] = "����������������������������������������������������������������髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������".split("");
  73701. for(j = 0; j != D[252].length; ++j) if(D[252][j].charCodeAt(0) !== 0xFFFD) { e[D[252][j]] = 64512 + j; d[64512 + j] = D[252][j];}
  73702. return {"enc": e, "dec": d }; })();
  73703. cptable[936] = (function(){ var d = [], e = {}, D = [], j;
  73704. D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�������������������������������������������������������������������������������������������������������������������������������".split("");
  73705. for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
  73706. D[129] = "����������������������������������������������������������������丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪乫乬乭乮乯乲乴乵乶乷乸乹乺乻乼乽乿亀亁亂亃亄亅亇亊�亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂伃伄伅伆伇伈伋伌伒伓伔伕伖伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾伿佀佁佂佄佅佇佈佉佊佋佌佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢�".split("");
  73707. for(j = 0; j != D[129].length; ++j) if(D[129][j].charCodeAt(0) !== 0xFFFD) { e[D[129][j]] = 33024 + j; d[33024 + j] = D[129][j];}
  73708. D[130] = "����������������������������������������������������������������侤侫侭侰侱侲侳侴侶侷侸侹侺侻侼侽侾俀俁係俆俇俈俉俋俌俍俒俓俔俕俖俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿倀倁倂倃倄倅倆倇倈倉倊�個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯倰倱倲倳倴倵倶倷倸倹倻倽倿偀偁偂偄偅偆偉偊偋偍偐偑偒偓偔偖偗偘偙偛偝偞偟偠偡偢偣偤偦偧偨偩偪偫偭偮偯偰偱偲偳側偵偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎傏傐傑傒傓傔傕傖傗傘備傚傛傜傝傞傟傠傡傢傤傦傪傫傭傮傯傰傱傳傴債傶傷傸傹傼�".split("");
  73709. for(j = 0; j != D[130].length; ++j) if(D[130][j].charCodeAt(0) !== 0xFFFD) { e[D[130][j]] = 33280 + j; d[33280 + j] = D[130][j];}
  73710. D[131] = "����������������������������������������������������������������傽傾傿僀僁僂僃僄僅僆僇僈僉僊僋僌働僎僐僑僒僓僔僕僗僘僙僛僜僝僞僟僠僡僢僣僤僥僨僩僪僫僯僰僱僲僴僶僷僸價僺僼僽僾僿儀儁儂儃億儅儈�儉儊儌儍儎儏儐儑儓儔儕儖儗儘儙儚儛儜儝儞償儠儢儣儤儥儦儧儨儩優儫儬儭儮儯儰儱儲儳儴儵儶儷儸儹儺儻儼儽儾兂兇兊兌兎兏児兒兓兗兘兙兛兝兞兟兠兡兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦冧冨冩冪冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒凓凔凕凖凗�".split("");
  73711. for(j = 0; j != D[131].length; ++j) if(D[131][j].charCodeAt(0) !== 0xFFFD) { e[D[131][j]] = 33536 + j; d[33536 + j] = D[131][j];}
  73712. D[132] = "����������������������������������������������������������������凘凙凚凜凞凟凢凣凥処凧凨凩凪凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄剅剆則剈剉剋剎剏剒剓剕剗剘�剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳剴創剶剷剸剹剺剻剼剾劀劃劄劅劆劇劉劊劋劌劍劎劏劑劒劔劕劖劗劘劙劚劜劤劥劦劧劮劯劰労劵劶劷劸効劺劻劼劽勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務勚勛勜勝勞勠勡勢勣勥勦勧勨勩勪勫勬勭勮勯勱勲勳勴勵勶勷勸勻勼勽匁匂匃匄匇匉匊匋匌匎�".split("");
  73713. for(j = 0; j != D[132].length; ++j) if(D[132][j].charCodeAt(0) !== 0xFFFD) { e[D[132][j]] = 33792 + j; d[33792 + j] = D[132][j];}
  73714. D[133] = "����������������������������������������������������������������匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯匰匱匲匳匴匵匶匷匸匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏�厐厑厒厓厔厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯厰厱厲厳厴厵厷厸厹厺厼厽厾叀參叄叅叆叇収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝呞呟呠呡呣呥呧呩呪呫呬呭呮呯呰呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡�".split("");
  73715. for(j = 0; j != D[133].length; ++j) if(D[133][j].charCodeAt(0) !== 0xFFFD) { e[D[133][j]] = 34048 + j; d[34048 + j] = D[133][j];}
  73716. D[134] = "����������������������������������������������������������������咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠員哢哣哤哫哬哯哰哱哴哵哶哷哸哹哻哾唀唂唃唄唅唈唊唋唌唍唎唒唓唕唖唗唘唙唚唜唝唞唟唡唥唦�唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋啌啍啎問啑啒啓啔啗啘啙啚啛啝啞啟啠啢啣啨啩啫啯啰啱啲啳啴啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠喡喢喣喤喥喦喨喩喪喫喬喭單喯喰喲喴営喸喺喼喿嗀嗁嗂嗃嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗嗘嗙嗚嗛嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸嗹嗺嗻嗼嗿嘂嘃嘄嘅�".split("");
  73717. for(j = 0; j != D[134].length; ++j) if(D[134][j].charCodeAt(0) !== 0xFFFD) { e[D[134][j]] = 34304 + j; d[34304 + j] = D[134][j];}
  73718. D[135] = "����������������������������������������������������������������嘆嘇嘊嘋嘍嘐嘑嘒嘓嘔嘕嘖嘗嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀噁噂噃噄噅噆噇噈噉噊噋噏噐噑噒噓噕噖噚噛噝噞噟噠噡�噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽噾噿嚀嚁嚂嚃嚄嚇嚈嚉嚊嚋嚌嚍嚐嚑嚒嚔嚕嚖嚗嚘嚙嚚嚛嚜嚝嚞嚟嚠嚡嚢嚤嚥嚦嚧嚨嚩嚪嚫嚬嚭嚮嚰嚱嚲嚳嚴嚵嚶嚸嚹嚺嚻嚽嚾嚿囀囁囂囃囄囅囆囇囈囉囋囌囍囎囏囐囑囒囓囕囖囘囙囜団囥囦囧囨囩囪囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國圌圍圎圏圐圑�".split("");
  73719. for(j = 0; j != D[135].length; ++j) if(D[135][j].charCodeAt(0) !== 0xFFFD) { e[D[135][j]] = 34560 + j; d[34560 + j] = D[135][j];}
  73720. D[136] = "����������������������������������������������������������������園圓圔圕圖圗團圙圚圛圝圞圠圡圢圤圥圦圧圫圱圲圴圵圶圷圸圼圽圿坁坃坄坅坆坈坉坋坒坓坔坕坖坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀�垁垇垈垉垊垍垎垏垐垑垔垕垖垗垘垙垚垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹垺垻垼垽垾垿埀埁埄埅埆埇埈埉埊埌埍埐埑埓埖埗埛埜埞埡埢埣埥埦埧埨埩埪埫埬埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥堦堧堨堩堫堬堭堮堯報堲堳場堶堷堸堹堺堻堼堽�".split("");
  73721. for(j = 0; j != D[136].length; ++j) if(D[136][j].charCodeAt(0) !== 0xFFFD) { e[D[136][j]] = 34816 + j; d[34816 + j] = D[136][j];}
  73722. D[137] = "����������������������������������������������������������������堾堿塀塁塂塃塅塆塇塈塉塊塋塎塏塐塒塓塕塖塗塙塚塛塜塝塟塠塡塢塣塤塦塧塨塩塪塭塮塯塰塱塲塳塴塵塶塷塸塹塺塻塼塽塿墂墄墆墇墈墊墋墌�墍墎墏墐墑墔墕墖増墘墛墜墝墠墡墢墣墤墥墦墧墪墫墬墭墮墯墰墱墲墳墴墵墶墷墸墹墺墻墽墾墿壀壂壃壄壆壇壈壉壊壋壌壍壎壏壐壒壓壔壖壗壘壙壚壛壜壝壞壟壠壡壢壣壥壦壧壨壩壪壭壯壱売壴壵壷壸壺壻壼壽壾壿夀夁夃夅夆夈変夊夋夌夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻�".split("");
  73723. for(j = 0; j != D[137].length; ++j) if(D[137][j].charCodeAt(0) !== 0xFFFD) { e[D[137][j]] = 35072 + j; d[35072 + j] = D[137][j];}
  73724. D[138] = "����������������������������������������������������������������夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛奜奝奞奟奡奣奤奦奧奨奩奪奫奬奭奮奯奰奱奲奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦�妧妬妭妰妱妳妴妵妶妷妸妺妼妽妿姀姁姂姃姄姅姇姈姉姌姍姎姏姕姖姙姛姞姟姠姡姢姤姦姧姩姪姫姭姮姯姰姱姲姳姴姵姶姷姸姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪娫娬娭娮娯娰娳娵娷娸娹娺娻娽娾娿婁婂婃婄婅婇婈婋婌婍婎婏婐婑婒婓婔婖婗婘婙婛婜婝婞婟婠�".split("");
  73725. for(j = 0; j != D[138].length; ++j) if(D[138][j].charCodeAt(0) !== 0xFFFD) { e[D[138][j]] = 35328 + j; d[35328 + j] = D[138][j];}
  73726. D[139] = "����������������������������������������������������������������婡婣婤婥婦婨婩婫婬婭婮婯婰婱婲婳婸婹婻婼婽婾媀媁媂媃媄媅媆媇媈媉媊媋媌媍媎媏媐媑媓媔媕媖媗媘媙媜媝媞媟媠媡媢媣媤媥媦媧媨媩媫媬�媭媮媯媰媱媴媶媷媹媺媻媼媽媿嫀嫃嫄嫅嫆嫇嫈嫊嫋嫍嫎嫏嫐嫑嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬嫭嫮嫯嫰嫲嫳嫴嫵嫶嫷嫸嫹嫺嫻嫼嫽嫾嫿嬀嬁嬂嬃嬄嬅嬆嬇嬈嬊嬋嬌嬍嬎嬏嬐嬑嬒嬓嬔嬕嬘嬙嬚嬛嬜嬝嬞嬟嬠嬡嬢嬣嬤嬥嬦嬧嬨嬩嬪嬫嬬嬭嬮嬯嬰嬱嬳嬵嬶嬸嬹嬺嬻嬼嬽嬾嬿孁孂孃孄孅孆孇�".split("");
  73727. for(j = 0; j != D[139].length; ++j) if(D[139][j].charCodeAt(0) !== 0xFFFD) { e[D[139][j]] = 35584 + j; d[35584 + j] = D[139][j];}
  73728. D[140] = "����������������������������������������������������������������孈孉孊孋孌孍孎孏孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏�寑寔寕寖寗寘寙寚寛寜寠寢寣實寧審寪寫寬寭寯寱寲寳寴寵寶寷寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧屨屩屪屫屬屭屰屲屳屴屵屶屷屸屻屼屽屾岀岃岄岅岆岇岉岊岋岎岏岒岓岕岝岞岟岠岡岤岥岦岧岨�".split("");
  73729. for(j = 0; j != D[140].length; ++j) if(D[140][j].charCodeAt(0) !== 0xFFFD) { e[D[140][j]] = 35840 + j; d[35840 + j] = D[140][j];}
  73730. D[141] = "����������������������������������������������������������������岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅峆峇峈峉峊峌峍峎峏峐峑峓峔峕峖峗峘峚峛峜峝峞峟峠峢峣峧峩峫峬峮峯峱峲峳峴峵島峷峸峹峺峼峽峾峿崀�崁崄崅崈崉崊崋崌崍崏崐崑崒崓崕崗崘崙崚崜崝崟崠崡崢崣崥崨崪崫崬崯崰崱崲崳崵崶崷崸崹崺崻崼崿嵀嵁嵂嵃嵄嵅嵆嵈嵉嵍嵎嵏嵐嵑嵒嵓嵔嵕嵖嵗嵙嵚嵜嵞嵟嵠嵡嵢嵣嵤嵥嵦嵧嵨嵪嵭嵮嵰嵱嵲嵳嵵嵶嵷嵸嵹嵺嵻嵼嵽嵾嵿嶀嶁嶃嶄嶅嶆嶇嶈嶉嶊嶋嶌嶍嶎嶏嶐嶑嶒嶓嶔嶕嶖嶗嶘嶚嶛嶜嶞嶟嶠�".split("");
  73731. for(j = 0; j != D[141].length; ++j) if(D[141][j].charCodeAt(0) !== 0xFFFD) { e[D[141][j]] = 36096 + j; d[36096 + j] = D[141][j];}
  73732. D[142] = "����������������������������������������������������������������嶡嶢嶣嶤嶥嶦嶧嶨嶩嶪嶫嶬嶭嶮嶯嶰嶱嶲嶳嶴嶵嶶嶸嶹嶺嶻嶼嶽嶾嶿巀巁巂巃巄巆巇巈巉巊巋巌巎巏巐巑巒巓巔巕巖巗巘巙巚巜巟巠巣巤巪巬巭�巰巵巶巸巹巺巻巼巿帀帄帇帉帊帋帍帎帒帓帗帞帟帠帡帢帣帤帥帨帩帪師帬帯帰帲帳帴帵帶帹帺帾帿幀幁幃幆幇幈幉幊幋幍幎幏幐幑幒幓幖幗幘幙幚幜幝幟幠幣幤幥幦幧幨幩幪幫幬幭幮幯幰幱幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨庩庪庫庬庮庯庰庱庲庴庺庻庼庽庿廀廁廂廃廄廅�".split("");
  73733. for(j = 0; j != D[142].length; ++j) if(D[142][j].charCodeAt(0) !== 0xFFFD) { e[D[142][j]] = 36352 + j; d[36352 + j] = D[142][j];}
  73734. D[143] = "����������������������������������������������������������������廆廇廈廋廌廍廎廏廐廔廕廗廘廙廚廜廝廞廟廠廡廢廣廤廥廦廧廩廫廬廭廮廯廰廱廲廳廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤�弨弫弬弮弰弲弳弴張弶強弸弻弽弾弿彁彂彃彄彅彆彇彈彉彊彋彌彍彎彏彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢徣徤徥徦徧復徫徬徯徰徱徲徳徴徶徸徹徺徻徾徿忀忁忂忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇�".split("");
  73735. for(j = 0; j != D[143].length; ++j) if(D[143][j].charCodeAt(0) !== 0xFFFD) { e[D[143][j]] = 36608 + j; d[36608 + j] = D[143][j];}
  73736. D[144] = "����������������������������������������������������������������怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰怱怲怳怴怶怷怸怹怺怽怾恀恄恅恆恇恈恉恊恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀�悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽悾悿惀惁惂惃惄惇惈惉惌惍惎惏惐惒惓惔惖惗惙惛惞惡惢惣惤惥惪惱惲惵惷惸惻惼惽惾惿愂愃愄愅愇愊愋愌愐愑愒愓愔愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬愭愮愯愰愱愲愳愴愵愶愷愸愹愺愻愼愽愾慀慁慂慃慄慅慆�".split("");
  73737. for(j = 0; j != D[144].length; ++j) if(D[144][j].charCodeAt(0) !== 0xFFFD) { e[D[144][j]] = 36864 + j; d[36864 + j] = D[144][j];}
  73738. D[145] = "����������������������������������������������������������������慇慉態慍慏慐慒慓慔慖慗慘慙慚慛慜慞慟慠慡慣慤慥慦慩慪慫慬慭慮慯慱慲慳慴慶慸慹慺慻慼慽慾慿憀憁憂憃憄憅憆憇憈憉憊憌憍憏憐憑憒憓憕�憖憗憘憙憚憛憜憞憟憠憡憢憣憤憥憦憪憫憭憮憯憰憱憲憳憴憵憶憸憹憺憻憼憽憿懀懁懃懄懅懆懇應懌懍懎懏懐懓懕懖懗懘懙懚懛懜懝懞懟懠懡懢懣懤懥懧懨懩懪懫懬懭懮懯懰懱懲懳懴懶懷懸懹懺懻懼懽懾戀戁戂戃戄戅戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸戹戺戻戼扂扄扅扆扊�".split("");
  73739. for(j = 0; j != D[145].length; ++j) if(D[145][j].charCodeAt(0) !== 0xFFFD) { e[D[145][j]] = 37120 + j; d[37120 + j] = D[145][j];}
  73740. D[146] = "����������������������������������������������������������������扏扐払扖扗扙扚扜扝扞扟扠扡扢扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋抌抍抎抏抐抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁�拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳挴挵挶挷挸挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖捗捘捙捚捛捜捝捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙掚掛掜掝掞掟採掤掦掫掯掱掲掵掶掹掻掽掿揀�".split("");
  73741. for(j = 0; j != D[146].length; ++j) if(D[146][j].charCodeAt(0) !== 0xFFFD) { e[D[146][j]] = 37376 + j; d[37376 + j] = D[146][j];}
  73742. D[147] = "����������������������������������������������������������������揁揂揃揅揇揈揊揋揌揑揓揔揕揗揘揙揚換揜揝揟揢揤揥揦揧揨揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆搇搈搉搊損搎搑搒搕搖搗搘搙搚搝搟搢搣搤�搥搧搨搩搫搮搯搰搱搲搳搵搶搷搸搹搻搼搾摀摂摃摉摋摌摍摎摏摐摑摓摕摖摗摙摚摛摜摝摟摠摡摢摣摤摥摦摨摪摫摬摮摯摰摱摲摳摴摵摶摷摻摼摽摾摿撀撁撃撆撈撉撊撋撌撍撎撏撐撓撔撗撘撚撛撜撝撟撠撡撢撣撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆擇擈擉擊擋擌擏擑擓擔擕擖擙據�".split("");
  73743. for(j = 0; j != D[147].length; ++j) if(D[147][j].charCodeAt(0) !== 0xFFFD) { e[D[147][j]] = 37632 + j; d[37632 + j] = D[147][j];}
  73744. D[148] = "����������������������������������������������������������������擛擜擝擟擠擡擣擥擧擨擩擪擫擬擭擮擯擰擱擲擳擴擵擶擷擸擹擺擻擼擽擾擿攁攂攃攄攅攆攇攈攊攋攌攍攎攏攐攑攓攔攕攖攗攙攚攛攜攝攞攟攠攡�攢攣攤攦攧攨攩攪攬攭攰攱攲攳攷攺攼攽敀敁敂敃敄敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數敹敺敻敼敽敾敿斀斁斂斃斄斅斆斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱斲斳斴斵斶斷斸斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘旙旚旛旜旝旞旟旡旣旤旪旫�".split("");
  73745. for(j = 0; j != D[148].length; ++j) if(D[148][j].charCodeAt(0) !== 0xFFFD) { e[D[148][j]] = 37888 + j; d[37888 + j] = D[148][j];}
  73746. D[149] = "����������������������������������������������������������������旲旳旴旵旸旹旻旼旽旾旿昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷昸昹昺昻昽昿晀時晄晅晆晇晈晉晊晍晎晐晑晘�晙晛晜晝晞晠晢晣晥晧晩晪晫晬晭晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘暙暚暛暜暞暟暠暡暢暣暤暥暦暩暪暫暬暭暯暰暱暲暳暵暶暷暸暺暻暼暽暿曀曁曂曃曄曅曆曇曈曉曊曋曌曍曎曏曐曑曒曓曔曕曖曗曘曚曞曟曠曡曢曣曤曥曧曨曪曫曬曭曮曯曱曵曶書曺曻曽朁朂會�".split("");
  73747. for(j = 0; j != D[149].length; ++j) if(D[149][j].charCodeAt(0) !== 0xFFFD) { e[D[149][j]] = 38144 + j; d[38144 + j] = D[149][j];}
  73748. D[150] = "����������������������������������������������������������������朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠朡朢朣朤朥朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗杘杙杚杛杝杢杣杤杦杧杫杬杮東杴杶�杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹枺枻枼枽枾枿柀柂柅柆柇柈柉柊柋柌柍柎柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵柶柷柸柹柺査柼柾栁栂栃栄栆栍栐栒栔栕栘栙栚栛栜栞栟栠栢栣栤栥栦栧栨栫栬栭栮栯栰栱栴栵栶栺栻栿桇桋桍桏桒桖桗桘桙桚桛�".split("");
  73749. for(j = 0; j != D[150].length; ++j) if(D[150][j].charCodeAt(0) !== 0xFFFD) { e[D[150][j]] = 38400 + j; d[38400 + j] = D[150][j];}
  73750. D[151] = "����������������������������������������������������������������桜桝桞桟桪桬桭桮桯桰桱桲桳桵桸桹桺桻桼桽桾桿梀梂梄梇梈梉梊梋梌梍梎梐梑梒梔梕梖梘梙梚梛梜條梞梟梠梡梣梤梥梩梪梫梬梮梱梲梴梶梷梸�梹梺梻梼梽梾梿棁棃棄棅棆棇棈棊棌棎棏棐棑棓棔棖棗棙棛棜棝棞棟棡棢棤棥棦棧棨棩棪棫棬棭棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆椇椈椉椊椌椏椑椓椔椕椖椗椘椙椚椛検椝椞椡椢椣椥椦椧椨椩椪椫椬椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃楄楅楆楇楈楉楊楋楌楍楎楏楐楑楒楓楕楖楘楙楛楜楟�".split("");
  73751. for(j = 0; j != D[151].length; ++j) if(D[151][j].charCodeAt(0) !== 0xFFFD) { e[D[151][j]] = 38656 + j; d[38656 + j] = D[151][j];}
  73752. D[152] = "����������������������������������������������������������������楡楢楤楥楧楨楩楪楬業楯楰楲楳楴極楶楺楻楽楾楿榁榃榅榊榋榌榎榏榐榑榒榓榖榗榙榚榝榞榟榠榡榢榣榤榥榦榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽�榾榿槀槂槃槄槅槆槇槈槉構槍槏槑槒槓槕槖槗様槙槚槜槝槞槡槢槣槤槥槦槧槨槩槪槫槬槮槯槰槱槳槴槵槶槷槸槹槺槻槼槾樀樁樂樃樄樅樆樇樈樉樋樌樍樎樏樐樑樒樓樔樕樖標樚樛樜樝樞樠樢樣樤樥樦樧権樫樬樭樮樰樲樳樴樶樷樸樹樺樻樼樿橀橁橂橃橅橆橈橉橊橋橌橍橎橏橑橒橓橔橕橖橗橚�".split("");
  73753. for(j = 0; j != D[152].length; ++j) if(D[152][j].charCodeAt(0) !== 0xFFFD) { e[D[152][j]] = 38912 + j; d[38912 + j] = D[152][j];}
  73754. D[153] = "����������������������������������������������������������������橜橝橞機橠橢橣橤橦橧橨橩橪橫橬橭橮橯橰橲橳橴橵橶橷橸橺橻橽橾橿檁檂檃檅檆檇檈檉檊檋檌檍檏檒檓檔檕檖檘檙檚檛檜檝檞檟檡檢檣檤檥檦�檧檨檪檭檮檯檰檱檲檳檴檵檶檷檸檹檺檻檼檽檾檿櫀櫁櫂櫃櫄櫅櫆櫇櫈櫉櫊櫋櫌櫍櫎櫏櫐櫑櫒櫓櫔櫕櫖櫗櫘櫙櫚櫛櫜櫝櫞櫟櫠櫡櫢櫣櫤櫥櫦櫧櫨櫩櫪櫫櫬櫭櫮櫯櫰櫱櫲櫳櫴櫵櫶櫷櫸櫹櫺櫻櫼櫽櫾櫿欀欁欂欃欄欅欆欇欈欉權欋欌欍欎欏欐欑欒欓欔欕欖欗欘欙欚欛欜欝欞欟欥欦欨欩欪欫欬欭欮�".split("");
  73755. for(j = 0; j != D[153].length; ++j) if(D[153][j].charCodeAt(0) !== 0xFFFD) { e[D[153][j]] = 39168 + j; d[39168 + j] = D[153][j];}
  73756. D[154] = "����������������������������������������������������������������欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍歎歏歐歑歒歓歔歕歖歗歘歚歛歜歝歞歟歠歡歨歩歫歬歭歮歯歰歱歲歳歴歵歶歷歸歺歽歾歿殀殅殈�殌殎殏殐殑殔殕殗殘殙殜殝殞殟殠殢殣殤殥殦殧殨殩殫殬殭殮殯殰殱殲殶殸殹殺殻殼殽殾毀毃毄毆毇毈毉毊毌毎毐毑毘毚毜毝毞毟毠毢毣毤毥毦毧毨毩毬毭毮毰毱毲毴毶毷毸毺毻毼毾毿氀氁氂氃氄氈氉氊氋氌氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋汌汍汎汏汑汒汓汖汘�".split("");
  73757. for(j = 0; j != D[154].length; ++j) if(D[154][j].charCodeAt(0) !== 0xFFFD) { e[D[154][j]] = 39424 + j; d[39424 + j] = D[154][j];}
  73758. D[155] = "����������������������������������������������������������������汙汚汢汣汥汦汧汫汬汭汮汯汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘�泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟洠洡洢洣洤洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽浾浿涀涁涃涄涆涇涊涋涍涏涐涒涖涗涘涙涚涜涢涥涬涭涰涱涳涴涶涷涹涺涻涼涽涾淁淂淃淈淉淊�".split("");
  73759. for(j = 0; j != D[155].length; ++j) if(D[155][j].charCodeAt(0) !== 0xFFFD) { e[D[155][j]] = 39680 + j; d[39680 + j] = D[155][j];}
  73760. D[156] = "����������������������������������������������������������������淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽淾淿渀渁渂渃渄渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵�渶渷渹渻渼渽渾渿湀湁湂湅湆湇湈湉湊湋湌湏湐湑湒湕湗湙湚湜湝湞湠湡湢湣湤湥湦湧湨湩湪湬湭湯湰湱湲湳湴湵湶湷湸湹湺湻湼湽満溁溂溄溇溈溊溋溌溍溎溑溒溓溔溕準溗溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪滫滬滭滮滯�".split("");
  73761. for(j = 0; j != D[156].length; ++j) if(D[156][j].charCodeAt(0) !== 0xFFFD) { e[D[156][j]] = 39936 + j; d[39936 + j] = D[156][j];}
  73762. D[157] = "����������������������������������������������������������������滰滱滲滳滵滶滷滸滺滻滼滽滾滿漀漁漃漄漅漇漈漊漋漌漍漎漐漑漒漖漗漘漙漚漛漜漝漞漟漡漢漣漥漦漧漨漬漮漰漲漴漵漷漸漹漺漻漼漽漿潀潁潂�潃潄潅潈潉潊潌潎潏潐潑潒潓潔潕潖潗潙潚潛潝潟潠潡潣潤潥潧潨潩潪潫潬潯潰潱潳潵潶潷潹潻潽潾潿澀澁澂澃澅澆澇澊澋澏澐澑澒澓澔澕澖澗澘澙澚澛澝澞澟澠澢澣澤澥澦澨澩澪澫澬澭澮澯澰澱澲澴澵澷澸澺澻澼澽澾澿濁濃濄濅濆濇濈濊濋濌濍濎濏濐濓濔濕濖濗濘濙濚濛濜濝濟濢濣濤濥�".split("");
  73763. for(j = 0; j != D[157].length; ++j) if(D[157][j].charCodeAt(0) !== 0xFFFD) { e[D[157][j]] = 40192 + j; d[40192 + j] = D[157][j];}
  73764. D[158] = "����������������������������������������������������������������濦濧濨濩濪濫濬濭濰濱濲濳濴濵濶濷濸濹濺濻濼濽濾濿瀀瀁瀂瀃瀄瀅瀆瀇瀈瀉瀊瀋瀌瀍瀎瀏瀐瀒瀓瀔瀕瀖瀗瀘瀙瀜瀝瀞瀟瀠瀡瀢瀤瀥瀦瀧瀨瀩瀪�瀫瀬瀭瀮瀯瀰瀱瀲瀳瀴瀶瀷瀸瀺瀻瀼瀽瀾瀿灀灁灂灃灄灅灆灇灈灉灊灋灍灎灐灑灒灓灔灕灖灗灘灙灚灛灜灝灟灠灡灢灣灤灥灦灧灨灩灪灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞炟炠炡炢炣炤炥炦炧炨炩炪炰炲炴炵炶為炾炿烄烅烆烇烉烋烌烍烎烏烐烑烒烓烔烕烖烗烚�".split("");
  73765. for(j = 0; j != D[158].length; ++j) if(D[158][j].charCodeAt(0) !== 0xFFFD) { e[D[158][j]] = 40448 + j; d[40448 + j] = D[158][j];}
  73766. D[159] = "����������������������������������������������������������������烜烝烞烠烡烢烣烥烪烮烰烱烲烳烴烵烶烸烺烻烼烾烿焀焁焂焃焄焅焆焇焈焋焌焍焎焏焑焒焔焗焛焜焝焞焟焠無焢焣焤焥焧焨焩焪焫焬焭焮焲焳焴�焵焷焸焹焺焻焼焽焾焿煀煁煂煃煄煆煇煈煉煋煍煏煐煑煒煓煔煕煖煗煘煙煚煛煝煟煠煡煢煣煥煩煪煫煬煭煯煰煱煴煵煶煷煹煻煼煾煿熀熁熂熃熅熆熇熈熉熋熌熍熎熐熑熒熓熕熖熗熚熛熜熝熞熡熢熣熤熥熦熧熩熪熫熭熮熯熰熱熲熴熶熷熸熺熻熼熽熾熿燀燁燂燄燅燆燇燈燉燊燋燌燍燏燐燑燒燓�".split("");
  73767. for(j = 0; j != D[159].length; ++j) if(D[159][j].charCodeAt(0) !== 0xFFFD) { e[D[159][j]] = 40704 + j; d[40704 + j] = D[159][j];}
  73768. D[160] = "����������������������������������������������������������������燖燗燘燙燚燛燜燝燞營燡燢燣燤燦燨燩燪燫燬燭燯燰燱燲燳燴燵燶燷燸燺燻燼燽燾燿爀爁爂爃爄爅爇爈爉爊爋爌爍爎爏爐爑爒爓爔爕爖爗爘爙爚�爛爜爞爟爠爡爢爣爤爥爦爧爩爫爭爮爯爲爳爴爺爼爾牀牁牂牃牄牅牆牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅犆犇犈犉犌犎犐犑犓犔犕犖犗犘犙犚犛犜犝犞犠犡犢犣犤犥犦犧犨犩犪犫犮犱犲犳犵犺犻犼犽犾犿狀狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛�".split("");
  73769. for(j = 0; j != D[160].length; ++j) if(D[160][j].charCodeAt(0) !== 0xFFFD) { e[D[160][j]] = 40960 + j; d[40960 + j] = D[160][j];}
  73770. D[161] = "����������������������������������������������������������������������������������������������������������������������������������������������������������������� 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈〉《》「」『』〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓�".split("");
  73771. for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
  73772. D[162] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ������⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇①②③④⑤⑥⑦⑧⑨⑩��㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩��ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ���".split("");
  73773. for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
  73774. D[163] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������!"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split("");
  73775. for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
  73776. D[164] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split("");
  73777. for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
  73778. D[165] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split("");
  73779. for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
  73780. D[166] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�������︵︶︹︺︿﹀︽︾﹁﹂﹃﹄��︻︼︷︸︱�︳︴����������".split("");
  73781. for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
  73782. D[167] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split("");
  73783. for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
  73784. D[168] = "����������������������������������������������������������������ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳▁▂▃▄▅▆▇�█▉▊▋▌▍▎▏▓▔▕▼▽◢◣◤◥☉⊕〒〝〞�����������āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ�ńň�ɡ����ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ����������������������".split("");
  73785. for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
  73786. D[169] = "����������������������������������������������������������������〡〢〣〤〥〦〧〨〩㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦�℡㈱�‐���ー゛゜ヽヾ〆ゝゞ﹉﹊﹋﹌﹍﹎﹏﹐﹑﹒﹔﹕﹖﹗﹙﹚﹛﹜﹝﹞﹟﹠﹡�﹢﹣﹤﹥﹦﹨﹩﹪﹫�������������〇�������������─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋����������������".split("");
  73787. for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
  73788. D[170] = "����������������������������������������������������������������狜狝狟狢狣狤狥狦狧狪狫狵狶狹狽狾狿猀猂猄猅猆猇猈猉猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀獁獂獃獄獅獆獇獈�獉獊獋獌獎獏獑獓獔獕獖獘獙獚獛獜獝獞獟獡獢獣獤獥獦獧獨獩獪獫獮獰獱�����������������������������������������������������������������������������������������������".split("");
  73789. for(j = 0; j != D[170].length; ++j) if(D[170][j].charCodeAt(0) !== 0xFFFD) { e[D[170][j]] = 43520 + j; d[43520 + j] = D[170][j];}
  73790. D[171] = "����������������������������������������������������������������獲獳獴獵獶獷獸獹獺獻獼獽獿玀玁玂玃玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣玤玥玦玧玨玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃珄珅珆珇�珋珌珎珒珓珔珕珖珗珘珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳珴珵珶珷�����������������������������������������������������������������������������������������������".split("");
  73791. for(j = 0; j != D[171].length; ++j) if(D[171][j].charCodeAt(0) !== 0xFFFD) { e[D[171][j]] = 43776 + j; d[43776 + j] = D[171][j];}
  73792. D[172] = "����������������������������������������������������������������珸珹珺珻珼珽現珿琀琁琂琄琇琈琋琌琍琎琑琒琓琔琕琖琗琘琙琜琝琞琟琠琡琣琤琧琩琫琭琯琱琲琷琸琹琺琻琽琾琿瑀瑂瑃瑄瑅瑆瑇瑈瑉瑊瑋瑌瑍�瑎瑏瑐瑑瑒瑓瑔瑖瑘瑝瑠瑡瑢瑣瑤瑥瑦瑧瑨瑩瑪瑫瑬瑮瑯瑱瑲瑳瑴瑵瑸瑹瑺�����������������������������������������������������������������������������������������������".split("");
  73793. for(j = 0; j != D[172].length; ++j) if(D[172][j].charCodeAt(0) !== 0xFFFD) { e[D[172][j]] = 44032 + j; d[44032 + j] = D[172][j];}
  73794. D[173] = "����������������������������������������������������������������瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑璒璓璔璕璖璗璘璙璚璛璝璟璠璡璢璣璤璥璦璪璫璬璭璮璯環璱璲璳璴璵璶璷璸璹璻璼璽璾璿瓀瓁瓂瓃瓄瓅瓆瓇�瓈瓉瓊瓋瓌瓍瓎瓏瓐瓑瓓瓔瓕瓖瓗瓘瓙瓚瓛瓝瓟瓡瓥瓧瓨瓩瓪瓫瓬瓭瓰瓱瓲�����������������������������������������������������������������������������������������������".split("");
  73795. for(j = 0; j != D[173].length; ++j) if(D[173][j].charCodeAt(0) !== 0xFFFD) { e[D[173][j]] = 44288 + j; d[44288 + j] = D[173][j];}
  73796. D[174] = "����������������������������������������������������������������瓳瓵瓸瓹瓺瓻瓼瓽瓾甀甁甂甃甅甆甇甈甉甊甋甌甎甐甒甔甕甖甗甛甝甞甠甡產産甤甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘�畝畞畟畠畡畢畣畤畧畨畩畫畬畭畮畯異畱畳畵當畷畺畻畼畽畾疀疁疂疄疅疇�����������������������������������������������������������������������������������������������".split("");
  73797. for(j = 0; j != D[174].length; ++j) if(D[174][j].charCodeAt(0) !== 0xFFFD) { e[D[174][j]] = 44544 + j; d[44544 + j] = D[174][j];}
  73798. D[175] = "����������������������������������������������������������������疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦疧疨疩疪疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇�瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄�����������������������������������������������������������������������������������������������".split("");
  73799. for(j = 0; j != D[175].length; ++j) if(D[175][j].charCodeAt(0) !== 0xFFFD) { e[D[175][j]] = 44800 + j; d[44800 + j] = D[175][j];}
  73800. D[176] = "����������������������������������������������������������������癅癆癇癈癉癊癋癎癏癐癑癒癓癕癗癘癙癚癛癝癟癠癡癢癤癥癦癧癨癩癪癬癭癮癰癱癲癳癴癵癶癷癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛�皜皝皞皟皠皡皢皣皥皦皧皨皩皪皫皬皭皯皰皳皵皶皷皸皹皺皻皼皽皾盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥�".split("");
  73801. for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
  73802. D[177] = "����������������������������������������������������������������盄盇盉盋盌盓盕盙盚盜盝盞盠盡盢監盤盦盧盨盩盪盫盬盭盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎眏眐眑眒眓眔眕眖眗眘眛眜眝眞眡眣眤眥眧眪眫�眬眮眰眱眲眳眴眹眻眽眾眿睂睄睅睆睈睉睊睋睌睍睎睏睒睓睔睕睖睗睘睙睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳�".split("");
  73803. for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
  73804. D[178] = "����������������������������������������������������������������睝睞睟睠睤睧睩睪睭睮睯睰睱睲睳睴睵睶睷睸睺睻睼瞁瞂瞃瞆瞇瞈瞉瞊瞋瞏瞐瞓瞔瞕瞖瞗瞘瞙瞚瞛瞜瞝瞞瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶瞷瞸瞹瞺�瞼瞾矀矁矂矃矄矅矆矇矈矉矊矋矌矎矏矐矑矒矓矔矕矖矘矙矚矝矞矟矠矡矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖�".split("");
  73805. for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
  73806. D[179] = "����������������������������������������������������������������矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃砄砅砆砇砈砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚�硛硜硞硟硠硡硢硣硤硥硦硧硨硩硯硰硱硲硳硴硵硶硸硹硺硻硽硾硿碀碁碂碃场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚�".split("");
  73807. for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
  73808. D[180] = "����������������������������������������������������������������碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨碩碪碫碬碭碮碯碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚磛磜磝磞磟磠磡磢磣�磤磥磦磧磩磪磫磭磮磯磰磱磳磵磶磸磹磻磼磽磾磿礀礂礃礄礆礇礈礉礊礋礌础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮�".split("");
  73809. for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
  73810. D[181] = "����������������������������������������������������������������礍礎礏礐礑礒礔礕礖礗礘礙礚礛礜礝礟礠礡礢礣礥礦礧礨礩礪礫礬礭礮礯礰礱礲礳礵礶礷礸礹礽礿祂祃祄祅祇祊祋祌祍祎祏祐祑祒祔祕祘祙祡祣�祤祦祩祪祫祬祮祰祱祲祳祴祵祶祹祻祼祽祾祿禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠�".split("");
  73811. for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
  73812. D[182] = "����������������������������������������������������������������禓禔禕禖禗禘禙禛禜禝禞禟禠禡禢禣禤禥禦禨禩禪禫禬禭禮禯禰禱禲禴禵禶禷禸禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙秚秛秜秝秞秠秡秢秥秨秪�秬秮秱秲秳秴秵秶秷秹秺秼秾秿稁稄稅稇稈稉稊稌稏稐稑稒稓稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二�".split("");
  73813. for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
  73814. D[183] = "����������������������������������������������������������������稝稟稡稢稤稥稦稧稨稩稪稫稬稭種稯稰稱稲稴稵稶稸稺稾穀穁穂穃穄穅穇穈穉穊穋穌積穎穏穐穒穓穔穕穖穘穙穚穛穜穝穞穟穠穡穢穣穤穥穦穧穨�穩穪穫穬穭穮穯穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服�".split("");
  73815. for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
  73816. D[184] = "����������������������������������������������������������������窣窤窧窩窪窫窮窯窰窱窲窴窵窶窷窸窹窺窻窼窽窾竀竁竂竃竄竅竆竇竈竉竊竌竍竎竏竐竑竒竓竔竕竗竘竚竛竜竝竡竢竤竧竨竩竪竫竬竮竰竱竲竳�竴竵競竷竸竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹�".split("");
  73817. for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
  73818. D[185] = "����������������������������������������������������������������笯笰笲笴笵笶笷笹笻笽笿筀筁筂筃筄筆筈筊筍筎筓筕筗筙筜筞筟筡筣筤筥筦筧筨筩筪筫筬筭筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆箇箈箉箊箋箌箎箏�箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹箺箻箼箽箾箿節篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈�".split("");
  73819. for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
  73820. D[186] = "����������������������������������������������������������������篅篈築篊篋篍篎篏篐篒篔篕篖篗篘篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲篳篴篵篶篸篹篺篻篽篿簀簁簂簃簄簅簆簈簉簊簍簎簐簑簒簓簔簕簗簘簙�簚簛簜簝簞簠簡簢簣簤簥簨簩簫簬簭簮簯簰簱簲簳簴簵簶簷簹簺簻簼簽簾籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖�".split("");
  73821. for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
  73822. D[187] = "����������������������������������������������������������������籃籄籅籆籇籈籉籊籋籌籎籏籐籑籒籓籔籕籖籗籘籙籚籛籜籝籞籟籠籡籢籣籤籥籦籧籨籩籪籫籬籭籮籯籰籱籲籵籶籷籸籹籺籾籿粀粁粂粃粄粅粆粇�粈粊粋粌粍粎粏粐粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴粵粶粷粸粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕�".split("");
  73823. for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
  73824. D[188] = "����������������������������������������������������������������粿糀糂糃糄糆糉糋糎糏糐糑糒糓糔糘糚糛糝糞糡糢糣糤糥糦糧糩糪糫糬糭糮糰糱糲糳糴糵糶糷糹糺糼糽糾糿紀紁紂紃約紅紆紇紈紉紋紌納紎紏紐�紑紒紓純紕紖紗紘紙級紛紜紝紞紟紡紣紤紥紦紨紩紪紬紭紮細紱紲紳紴紵紶肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件�".split("");
  73825. for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
  73826. D[189] = "����������������������������������������������������������������紷紸紹紺紻紼紽紾紿絀絁終絃組絅絆絇絈絉絊絋経絍絎絏結絑絒絓絔絕絖絗絘絙絚絛絜絝絞絟絠絡絢絣絤絥給絧絨絩絪絫絬絭絯絰統絲絳絴絵絶�絸絹絺絻絼絽絾絿綀綁綂綃綄綅綆綇綈綉綊綋綌綍綎綏綐綑綒經綔綕綖綗綘健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸�".split("");
  73827. for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
  73828. D[190] = "����������������������������������������������������������������継続綛綜綝綞綟綠綡綢綣綤綥綧綨綩綪綫綬維綯綰綱網綳綴綵綶綷綸綹綺綻綼綽綾綿緀緁緂緃緄緅緆緇緈緉緊緋緌緍緎総緐緑緒緓緔緕緖緗緘緙�線緛緜緝緞緟締緡緢緣緤緥緦緧編緩緪緫緬緭緮緯緰緱緲緳練緵緶緷緸緹緺尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻�".split("");
  73829. for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
  73830. D[191] = "����������������������������������������������������������������緻緼緽緾緿縀縁縂縃縄縅縆縇縈縉縊縋縌縍縎縏縐縑縒縓縔縕縖縗縘縙縚縛縜縝縞縟縠縡縢縣縤縥縦縧縨縩縪縫縬縭縮縯縰縱縲縳縴縵縶縷縸縹�縺縼總績縿繀繂繃繄繅繆繈繉繊繋繌繍繎繏繐繑繒繓織繕繖繗繘繙繚繛繜繝俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀�".split("");
  73831. for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
  73832. D[192] = "����������������������������������������������������������������繞繟繠繡繢繣繤繥繦繧繨繩繪繫繬繭繮繯繰繱繲繳繴繵繶繷繸繹繺繻繼繽繾繿纀纁纃纄纅纆纇纈纉纊纋續纍纎纏纐纑纒纓纔纕纖纗纘纙纚纜纝纞�纮纴纻纼绖绤绬绹缊缐缞缷缹缻缼缽缾缿罀罁罃罆罇罈罉罊罋罌罍罎罏罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐�".split("");
  73833. for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
  73834. D[193] = "����������������������������������������������������������������罖罙罛罜罝罞罠罣罤罥罦罧罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂羃羄羅羆羇羈羉羋羍羏羐羑羒羓羕羖羗羘羙羛羜羠羢羣羥羦羨義羪羫羬羭羮羱�羳羴羵羶羷羺羻羾翀翂翃翄翆翇翈翉翋翍翏翐翑習翓翖翗翙翚翛翜翝翞翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿�".split("");
  73835. for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
  73836. D[194] = "����������������������������������������������������������������翤翧翨翪翫翬翭翯翲翴翵翶翷翸翹翺翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫耬耭耮耯耰耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗�聙聛聜聝聞聟聠聡聢聣聤聥聦聧聨聫聬聭聮聯聰聲聳聴聵聶職聸聹聺聻聼聽隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫�".split("");
  73837. for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
  73838. D[195] = "����������������������������������������������������������������聾肁肂肅肈肊肍肎肏肐肑肒肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇胈胉胊胋胏胐胑胒胓胔胕胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋�脌脕脗脙脛脜脝脟脠脡脢脣脤脥脦脧脨脩脪脫脭脮脰脳脴脵脷脹脺脻脼脽脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸�".split("");
  73839. for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
  73840. D[196] = "����������������������������������������������������������������腀腁腂腃腄腅腇腉腍腎腏腒腖腗腘腛腜腝腞腟腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃膄膅膆膇膉膋膌膍膎膐膒膓膔膕膖膗膙膚膞膟膠膡膢膤膥�膧膩膫膬膭膮膯膰膱膲膴膵膶膷膸膹膼膽膾膿臄臅臇臈臉臋臍臎臏臐臑臒臓摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁�".split("");
  73841. for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
  73842. D[197] = "����������������������������������������������������������������臔臕臖臗臘臙臚臛臜臝臞臟臠臡臢臤臥臦臨臩臫臮臯臰臱臲臵臶臷臸臹臺臽臿舃與興舉舊舋舎舏舑舓舕舖舗舘舙舚舝舠舤舥舦舧舩舮舲舺舼舽舿�艀艁艂艃艅艆艈艊艌艍艎艐艑艒艓艔艕艖艗艙艛艜艝艞艠艡艢艣艤艥艦艧艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗�".split("");
  73843. for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
  73844. D[198] = "����������������������������������������������������������������艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸�苺苼苽苾苿茀茊茋茍茐茒茓茖茘茙茝茞茟茠茡茢茣茤茥茦茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐�".split("");
  73845. for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
  73846. D[199] = "����������������������������������������������������������������茾茿荁荂荄荅荈荊荋荌荍荎荓荕荖荗荘荙荝荢荰荱荲荳荴荵荶荹荺荾荿莀莁莂莃莄莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡莢莣莤莥莦莧莬莭莮�莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠�".split("");
  73847. for(j = 0; j != D[199].length; ++j) if(D[199][j].charCodeAt(0) !== 0xFFFD) { e[D[199][j]] = 50944 + j; d[50944 + j] = D[199][j];}
  73848. D[200] = "����������������������������������������������������������������菮華菳菴菵菶菷菺菻菼菾菿萀萂萅萇萈萉萊萐萒萓萔萕萖萗萙萚萛萞萟萠萡萢萣萩萪萫萬萭萮萯萰萲萳萴萵萶萷萹萺萻萾萿葀葁葂葃葄葅葇葈葉�葊葋葌葍葎葏葐葒葓葔葕葖葘葝葞葟葠葢葤葥葦葧葨葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁�".split("");
  73849. for(j = 0; j != D[200].length; ++j) if(D[200][j].charCodeAt(0) !== 0xFFFD) { e[D[200][j]] = 51200 + j; d[51200 + j] = D[200][j];}
  73850. D[201] = "����������������������������������������������������������������葽葾葿蒀蒁蒃蒄蒅蒆蒊蒍蒏蒐蒑蒒蒓蒔蒕蒖蒘蒚蒛蒝蒞蒟蒠蒢蒣蒤蒥蒦蒧蒨蒩蒪蒫蒬蒭蒮蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗�蓘蓙蓚蓛蓜蓞蓡蓢蓤蓧蓨蓩蓪蓫蓭蓮蓯蓱蓲蓳蓴蓵蓶蓷蓸蓹蓺蓻蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳�".split("");
  73851. for(j = 0; j != D[201].length; ++j) if(D[201][j].charCodeAt(0) !== 0xFFFD) { e[D[201][j]] = 51456 + j; d[51456 + j] = D[201][j];}
  73852. D[202] = "����������������������������������������������������������������蔃蔄蔅蔆蔇蔈蔉蔊蔋蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢蔣蔤蔥蔦蔧蔨蔩蔪蔭蔮蔯蔰蔱蔲蔳蔴蔵蔶蔾蔿蕀蕁蕂蕄蕅蕆蕇蕋蕌蕍蕎蕏蕐蕑蕒蕓蕔蕕�蕗蕘蕚蕛蕜蕝蕟蕠蕡蕢蕣蕥蕦蕧蕩蕪蕫蕬蕭蕮蕯蕰蕱蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱�".split("");
  73853. for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
  73854. D[203] = "����������������������������������������������������������������薂薃薆薈薉薊薋薌薍薎薐薑薒薓薔薕薖薗薘薙薚薝薞薟薠薡薢薣薥薦薧薩薫薬薭薱薲薳薴薵薶薸薺薻薼薽薾薿藀藂藃藄藅藆藇藈藊藋藌藍藎藑藒�藔藖藗藘藙藚藛藝藞藟藠藡藢藣藥藦藧藨藪藫藬藭藮藯藰藱藲藳藴藵藶藷藸恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔�".split("");
  73855. for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
  73856. D[204] = "����������������������������������������������������������������藹藺藼藽藾蘀蘁蘂蘃蘄蘆蘇蘈蘉蘊蘋蘌蘍蘎蘏蘐蘒蘓蘔蘕蘗蘘蘙蘚蘛蘜蘝蘞蘟蘠蘡蘢蘣蘤蘥蘦蘨蘪蘫蘬蘭蘮蘯蘰蘱蘲蘳蘴蘵蘶蘷蘹蘺蘻蘽蘾蘿虀�虁虂虃虄虅虆虇虈虉虊虋虌虒虓處虖虗虘虙虛虜虝號虠虡虣虤虥虦虧虨虩虪獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃�".split("");
  73857. for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
  73858. D[205] = "����������������������������������������������������������������虭虯虰虲虳虴虵虶虷虸蚃蚄蚅蚆蚇蚈蚉蚎蚏蚐蚑蚒蚔蚖蚗蚘蚙蚚蚛蚞蚟蚠蚡蚢蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻蚼蚽蚾蚿蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜�蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威�".split("");
  73859. for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
  73860. D[206] = "����������������������������������������������������������������蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀蝁蝂蝃蝄蝅蝆蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚蝛蝜蝝蝞蝟蝡蝢蝦蝧蝨蝩蝪蝫蝬蝭蝯蝱蝲蝳蝵�蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎螏螐螑螒螔螕螖螘螙螚螛螜螝螞螠螡螢螣螤巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺�".split("");
  73861. for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
  73862. D[207] = "����������������������������������������������������������������螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁蟂蟃蟄蟅蟇蟈蟉蟌蟍蟎蟏蟐蟔蟕蟖蟗蟘蟙蟚蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯蟰蟱蟲蟳蟴蟵蟶蟷蟸�蟺蟻蟼蟽蟿蠀蠁蠂蠄蠅蠆蠇蠈蠉蠋蠌蠍蠎蠏蠐蠑蠒蠔蠗蠘蠙蠚蠜蠝蠞蠟蠠蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓�".split("");
  73863. for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
  73864. D[208] = "����������������������������������������������������������������蠤蠥蠦蠧蠨蠩蠪蠫蠬蠭蠮蠯蠰蠱蠳蠴蠵蠶蠷蠸蠺蠻蠽蠾蠿衁衂衃衆衇衈衉衊衋衎衏衐衑衒術衕衖衘衚衛衜衝衞衟衠衦衧衪衭衯衱衳衴衵衶衸衹衺�衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗袘袙袚袛袝袞袟袠袡袣袥袦袧袨袩袪小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄�".split("");
  73865. for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
  73866. D[209] = "����������������������������������������������������������������袬袮袯袰袲袳袴袵袶袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚裛補裝裞裠裡裦裧裩裪裫裬裭裮裯裲裵裶裷裺裻製裿褀褁褃褄褅褆複褈�褉褋褌褍褎褏褑褔褕褖褗褘褜褝褞褟褠褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶�".split("");
  73867. for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
  73868. D[210] = "����������������������������������������������������������������褸褹褺褻褼褽褾褿襀襂襃襅襆襇襈襉襊襋襌襍襎襏襐襑襒襓襔襕襖襗襘襙襚襛襜襝襠襡襢襣襤襥襧襨襩襪襫襬襭襮襯襰襱襲襳襴襵襶襷襸襹襺襼�襽襾覀覂覄覅覇覈覉覊見覌覍覎規覐覑覒覓覔覕視覗覘覙覚覛覜覝覞覟覠覡摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐�".split("");
  73869. for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
  73870. D[211] = "����������������������������������������������������������������覢覣覤覥覦覧覨覩親覫覬覭覮覯覰覱覲観覴覵覶覷覸覹覺覻覼覽覾覿觀觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴觵觶觷觸觹觺�觻觼觽觾觿訁訂訃訄訅訆計訉訊訋訌訍討訏訐訑訒訓訔訕訖託記訙訚訛訜訝印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉�".split("");
  73871. for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
  73872. D[212] = "����������������������������������������������������������������訞訟訠訡訢訣訤訥訦訧訨訩訪訫訬設訮訯訰許訲訳訴訵訶訷訸訹診註証訽訿詀詁詂詃詄詅詆詇詉詊詋詌詍詎詏詐詑詒詓詔評詖詗詘詙詚詛詜詝詞�詟詠詡詢詣詤詥試詧詨詩詪詫詬詭詮詯詰話該詳詴詵詶詷詸詺詻詼詽詾詿誀浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧�".split("");
  73873. for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
  73874. D[213] = "����������������������������������������������������������������誁誂誃誄誅誆誇誈誋誌認誎誏誐誑誒誔誕誖誗誘誙誚誛誜誝語誟誠誡誢誣誤誥誦誧誨誩說誫説読誮誯誰誱課誳誴誵誶誷誸誹誺誻誼誽誾調諀諁諂�諃諄諅諆談諈諉諊請諌諍諎諏諐諑諒諓諔諕論諗諘諙諚諛諜諝諞諟諠諡諢諣铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政�".split("");
  73875. for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
  73876. D[214] = "����������������������������������������������������������������諤諥諦諧諨諩諪諫諬諭諮諯諰諱諲諳諴諵諶諷諸諹諺諻諼諽諾諿謀謁謂謃謄謅謆謈謉謊謋謌謍謎謏謐謑謒謓謔謕謖謗謘謙謚講謜謝謞謟謠謡謢謣�謤謥謧謨謩謪謫謬謭謮謯謰謱謲謳謴謵謶謷謸謹謺謻謼謽謾謿譀譁譂譃譄譅帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑�".split("");
  73877. for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
  73878. D[215] = "����������������������������������������������������������������譆譇譈證譊譋譌譍譎譏譐譑譒譓譔譕譖譗識譙譚譛譜譝譞譟譠譡譢譣譤譥譧譨譩譪譫譭譮譯議譱譲譳譴譵譶護譸譹譺譻譼譽譾譿讀讁讂讃讄讅讆�讇讈讉變讋讌讍讎讏讐讑讒讓讔讕讖讗讘讙讚讛讜讝讞讟讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座������".split("");
  73879. for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
  73880. D[216] = "����������������������������������������������������������������谸谹谺谻谼谽谾谿豀豂豃豄豅豈豊豋豍豎豏豐豑豒豓豔豖豗豘豙豛豜豝豞豟豠豣豤豥豦豧豨豩豬豭豮豯豰豱豲豴豵豶豷豻豼豽豾豿貀貁貃貄貆貇�貈貋貍貎貏貐貑貒貓貕貖貗貙貚貛貜貝貞貟負財貢貣貤貥貦貧貨販貪貫責貭亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝�".split("");
  73881. for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
  73882. D[217] = "����������������������������������������������������������������貮貯貰貱貲貳貴貵貶買貸貹貺費貼貽貾貿賀賁賂賃賄賅賆資賈賉賊賋賌賍賎賏賐賑賒賓賔賕賖賗賘賙賚賛賜賝賞賟賠賡賢賣賤賥賦賧賨賩質賫賬�賭賮賯賰賱賲賳賴賵賶賷賸賹賺賻購賽賾賿贀贁贂贃贄贅贆贇贈贉贊贋贌贍佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼�".split("");
  73883. for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
  73884. D[218] = "����������������������������������������������������������������贎贏贐贑贒贓贔贕贖贗贘贙贚贛贜贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸赹赺赻赼赽赾赿趀趂趃趆趇趈趉趌趍趎趏趐趒趓趕趖趗趘趙趚趛趜趝趞趠趡�趢趤趥趦趧趨趩趪趫趬趭趮趯趰趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺�".split("");
  73885. for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
  73886. D[219] = "����������������������������������������������������������������跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾跿踀踁踂踃踄踆踇踈踋踍踎踐踑踒踓踕踖踗踘踙踚踛踜踠踡踤踥踦踧踨踫踭踰踲踳踴踶踷踸踻踼踾�踿蹃蹅蹆蹌蹍蹎蹏蹐蹓蹔蹕蹖蹗蹘蹚蹛蹜蹝蹞蹟蹠蹡蹢蹣蹤蹥蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝�".split("");
  73887. for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
  73888. D[220] = "����������������������������������������������������������������蹳蹵蹷蹸蹹蹺蹻蹽蹾躀躂躃躄躆躈躉躊躋躌躍躎躑躒躓躕躖躗躘躙躚躛躝躟躠躡躢躣躤躥躦躧躨躩躪躭躮躰躱躳躴躵躶躷躸躹躻躼躽躾躿軀軁軂�軃軄軅軆軇軈軉車軋軌軍軏軐軑軒軓軔軕軖軗軘軙軚軛軜軝軞軟軠軡転軣軤堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥�".split("");
  73889. for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
  73890. D[221] = "����������������������������������������������������������������軥軦軧軨軩軪軫軬軭軮軯軰軱軲軳軴軵軶軷軸軹軺軻軼軽軾軿輀輁輂較輄輅輆輇輈載輊輋輌輍輎輏輐輑輒輓輔輕輖輗輘輙輚輛輜輝輞輟輠輡輢輣�輤輥輦輧輨輩輪輫輬輭輮輯輰輱輲輳輴輵輶輷輸輹輺輻輼輽輾輿轀轁轂轃轄荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺�".split("");
  73891. for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
  73892. D[222] = "����������������������������������������������������������������轅轆轇轈轉轊轋轌轍轎轏轐轑轒轓轔轕轖轗轘轙轚轛轜轝轞轟轠轡轢轣轤轥轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆�迉迊迋迌迍迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖�".split("");
  73893. for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
  73894. D[223] = "����������������������������������������������������������������這逜連逤逥逧逨逩逪逫逬逰週進逳逴逷逹逺逽逿遀遃遅遆遈遉遊運遌過達違遖遙遚遜遝遞遟遠遡遤遦遧適遪遫遬遯遰遱遲遳遶遷選遹遺遻遼遾邁�還邅邆邇邉邊邌邍邎邏邐邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼�".split("");
  73895. for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
  73896. D[224] = "����������������������������������������������������������������郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅鄆鄇鄈鄉鄊鄋鄌鄍鄎鄏鄐鄑鄒鄓鄔鄕鄖鄗鄘鄚鄛鄜�鄝鄟鄠鄡鄤鄥鄦鄧鄨鄩鄪鄫鄬鄭鄮鄰鄲鄳鄴鄵鄶鄷鄸鄺鄻鄼鄽鄾鄿酀酁酂酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼�".split("");
  73897. for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
  73898. D[225] = "����������������������������������������������������������������酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀醁醂醃醄醆醈醊醎醏醓醔醕醖醗醘醙醜醝醞醟醠醡醤醥醦醧醨醩醫醬醰醱醲醳醶醷醸醹醻�醼醽醾醿釀釁釂釃釄釅釆釈釋釐釒釓釔釕釖釗釘釙釚釛針釞釟釠釡釢釣釤釥帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺�".split("");
  73899. for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
  73900. D[226] = "����������������������������������������������������������������釦釧釨釩釪釫釬釭釮釯釰釱釲釳釴釵釶釷釸釹釺釻釼釽釾釿鈀鈁鈂鈃鈄鈅鈆鈇鈈鈉鈊鈋鈌鈍鈎鈏鈐鈑鈒鈓鈔鈕鈖鈗鈘鈙鈚鈛鈜鈝鈞鈟鈠鈡鈢鈣鈤�鈥鈦鈧鈨鈩鈪鈫鈬鈭鈮鈯鈰鈱鈲鈳鈴鈵鈶鈷鈸鈹鈺鈻鈼鈽鈾鈿鉀鉁鉂鉃鉄鉅狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧饨饩饪饫饬饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂�".split("");
  73901. for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
  73902. D[227] = "����������������������������������������������������������������鉆鉇鉈鉉鉊鉋鉌鉍鉎鉏鉐鉑鉒鉓鉔鉕鉖鉗鉘鉙鉚鉛鉜鉝鉞鉟鉠鉡鉢鉣鉤鉥鉦鉧鉨鉩鉪鉫鉬鉭鉮鉯鉰鉱鉲鉳鉵鉶鉷鉸鉹鉺鉻鉼鉽鉾鉿銀銁銂銃銄銅�銆銇銈銉銊銋銌銍銏銐銑銒銓銔銕銖銗銘銙銚銛銜銝銞銟銠銡銢銣銤銥銦銧恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾�".split("");
  73903. for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
  73904. D[228] = "����������������������������������������������������������������銨銩銪銫銬銭銯銰銱銲銳銴銵銶銷銸銹銺銻銼銽銾銿鋀鋁鋂鋃鋄鋅鋆鋇鋉鋊鋋鋌鋍鋎鋏鋐鋑鋒鋓鋔鋕鋖鋗鋘鋙鋚鋛鋜鋝鋞鋟鋠鋡鋢鋣鋤鋥鋦鋧鋨�鋩鋪鋫鋬鋭鋮鋯鋰鋱鋲鋳鋴鋵鋶鋷鋸鋹鋺鋻鋼鋽鋾鋿錀錁錂錃錄錅錆錇錈錉洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑�".split("");
  73905. for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
  73906. D[229] = "����������������������������������������������������������������錊錋錌錍錎錏錐錑錒錓錔錕錖錗錘錙錚錛錜錝錞錟錠錡錢錣錤錥錦錧錨錩錪錫錬錭錮錯錰錱録錳錴錵錶錷錸錹錺錻錼錽錿鍀鍁鍂鍃鍄鍅鍆鍇鍈鍉�鍊鍋鍌鍍鍎鍏鍐鍑鍒鍓鍔鍕鍖鍗鍘鍙鍚鍛鍜鍝鍞鍟鍠鍡鍢鍣鍤鍥鍦鍧鍨鍩鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣�".split("");
  73907. for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
  73908. D[230] = "����������������������������������������������������������������鍬鍭鍮鍯鍰鍱鍲鍳鍴鍵鍶鍷鍸鍹鍺鍻鍼鍽鍾鍿鎀鎁鎂鎃鎄鎅鎆鎇鎈鎉鎊鎋鎌鎍鎎鎐鎑鎒鎓鎔鎕鎖鎗鎘鎙鎚鎛鎜鎝鎞鎟鎠鎡鎢鎣鎤鎥鎦鎧鎨鎩鎪鎫�鎬鎭鎮鎯鎰鎱鎲鎳鎴鎵鎶鎷鎸鎹鎺鎻鎼鎽鎾鎿鏀鏁鏂鏃鏄鏅鏆鏇鏈鏉鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩�".split("");
  73909. for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
  73910. D[231] = "����������������������������������������������������������������鏎鏏鏐鏑鏒鏓鏔鏕鏗鏘鏙鏚鏛鏜鏝鏞鏟鏠鏡鏢鏣鏤鏥鏦鏧鏨鏩鏪鏫鏬鏭鏮鏯鏰鏱鏲鏳鏴鏵鏶鏷鏸鏹鏺鏻鏼鏽鏾鏿鐀鐁鐂鐃鐄鐅鐆鐇鐈鐉鐊鐋鐌鐍�鐎鐏鐐鐑鐒鐓鐔鐕鐖鐗鐘鐙鐚鐛鐜鐝鐞鐟鐠鐡鐢鐣鐤鐥鐦鐧鐨鐩鐪鐫鐬鐭鐮纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡缢缣缤缥缦缧缪缫缬缭缯缰缱缲缳缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬�".split("");
  73911. for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
  73912. D[232] = "����������������������������������������������������������������鐯鐰鐱鐲鐳鐴鐵鐶鐷鐸鐹鐺鐻鐼鐽鐿鑀鑁鑂鑃鑄鑅鑆鑇鑈鑉鑊鑋鑌鑍鑎鑏鑐鑑鑒鑓鑔鑕鑖鑗鑘鑙鑚鑛鑜鑝鑞鑟鑠鑡鑢鑣鑤鑥鑦鑧鑨鑩鑪鑬鑭鑮鑯�鑰鑱鑲鑳鑴鑵鑶鑷鑸鑹鑺鑻鑼鑽鑾鑿钀钁钂钃钄钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹�".split("");
  73913. for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
  73914. D[233] = "����������������������������������������������������������������锧锳锽镃镈镋镕镚镠镮镴镵長镸镹镺镻镼镽镾門閁閂閃閄閅閆閇閈閉閊開閌閍閎閏閐閑閒間閔閕閖閗閘閙閚閛閜閝閞閟閠閡関閣閤閥閦閧閨閩閪�閫閬閭閮閯閰閱閲閳閴閵閶閷閸閹閺閻閼閽閾閿闀闁闂闃闄闅闆闇闈闉闊闋椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋�".split("");
  73915. for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
  73916. D[234] = "����������������������������������������������������������������闌闍闎闏闐闑闒闓闔闕闖闗闘闙闚闛關闝闞闟闠闡闢闣闤闥闦闧闬闿阇阓阘阛阞阠阣阤阥阦阧阨阩阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗�陘陙陚陜陝陞陠陣陥陦陫陭陮陯陰陱陳陸陹険陻陼陽陾陿隀隁隂隃隄隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰�".split("");
  73917. for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
  73918. D[235] = "����������������������������������������������������������������隌階隑隒隓隕隖隚際隝隞隟隠隡隢隣隤隥隦隨隩險隫隬隭隮隯隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖雗雘雙雚雛雜雝雞雟雡離難雤雥雦雧雫�雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗霘霙霚霛霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻�".split("");
  73919. for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
  73920. D[236] = "����������������������������������������������������������������霡霢霣霤霥霦霧霨霩霫霬霮霯霱霳霴霵霶霷霺霻霼霽霿靀靁靂靃靄靅靆靇靈靉靊靋靌靍靎靏靐靑靔靕靗靘靚靜靝靟靣靤靦靧靨靪靫靬靭靮靯靰靱�靲靵靷靸靹靺靻靽靾靿鞀鞁鞂鞃鞄鞆鞇鞈鞉鞊鞌鞎鞏鞐鞓鞕鞖鞗鞙鞚鞛鞜鞝臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐�".split("");
  73921. for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
  73922. D[237] = "����������������������������������������������������������������鞞鞟鞡鞢鞤鞥鞦鞧鞨鞩鞪鞬鞮鞰鞱鞳鞵鞶鞷鞸鞹鞺鞻鞼鞽鞾鞿韀韁韂韃韄韅韆韇韈韉韊韋韌韍韎韏韐韑韒韓韔韕韖韗韘韙韚韛韜韝韞韟韠韡韢韣�韤韥韨韮韯韰韱韲韴韷韸韹韺韻韼韽韾響頀頁頂頃頄項順頇須頉頊頋頌頍頎怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨�".split("");
  73923. for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
  73924. D[238] = "����������������������������������������������������������������頏預頑頒頓頔頕頖頗領頙頚頛頜頝頞頟頠頡頢頣頤頥頦頧頨頩頪頫頬頭頮頯頰頱頲頳頴頵頶頷頸頹頺頻頼頽頾頿顀顁顂顃顄顅顆顇顈顉顊顋題額�顎顏顐顑顒顓顔顕顖顗願顙顚顛顜顝類顟顠顡顢顣顤顥顦顧顨顩顪顫顬顭顮睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶钷钸钹钺钼钽钿铄铈铉铊铋铌铍铎铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪�".split("");
  73925. for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
  73926. D[239] = "����������������������������������������������������������������顯顰顱顲顳顴颋颎颒颕颙颣風颩颪颫颬颭颮颯颰颱颲颳颴颵颶颷颸颹颺颻颼颽颾颿飀飁飂飃飄飅飆飇飈飉飊飋飌飍飏飐飔飖飗飛飜飝飠飡飢飣飤�飥飦飩飪飫飬飭飮飯飰飱飲飳飴飵飶飷飸飹飺飻飼飽飾飿餀餁餂餃餄餅餆餇铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒锓锔锕锖锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤镥镦镧镨镩镪镫镬镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔�".split("");
  73927. for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
  73928. D[240] = "����������������������������������������������������������������餈餉養餋餌餎餏餑餒餓餔餕餖餗餘餙餚餛餜餝餞餟餠餡餢餣餤餥餦餧館餩餪餫餬餭餯餰餱餲餳餴餵餶餷餸餹餺餻餼餽餾餿饀饁饂饃饄饅饆饇饈饉�饊饋饌饍饎饏饐饑饒饓饖饗饘饙饚饛饜饝饞饟饠饡饢饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨鸩鸪鸫鸬鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦鹧鹨鹩鹪鹫鹬鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙�".split("");
  73929. for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
  73930. D[241] = "����������������������������������������������������������������馌馎馚馛馜馝馞馟馠馡馢馣馤馦馧馩馪馫馬馭馮馯馰馱馲馳馴馵馶馷馸馹馺馻馼馽馾馿駀駁駂駃駄駅駆駇駈駉駊駋駌駍駎駏駐駑駒駓駔駕駖駗駘�駙駚駛駜駝駞駟駠駡駢駣駤駥駦駧駨駩駪駫駬駭駮駯駰駱駲駳駴駵駶駷駸駹瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃�".split("");
  73931. for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
  73932. D[242] = "����������������������������������������������������������������駺駻駼駽駾駿騀騁騂騃騄騅騆騇騈騉騊騋騌騍騎騏騐騑騒験騔騕騖騗騘騙騚騛騜騝騞騟騠騡騢騣騤騥騦騧騨騩騪騫騬騭騮騯騰騱騲騳騴騵騶騷騸�騹騺騻騼騽騾騿驀驁驂驃驄驅驆驇驈驉驊驋驌驍驎驏驐驑驒驓驔驕驖驗驘驙颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒�".split("");
  73933. for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
  73934. D[243] = "����������������������������������������������������������������驚驛驜驝驞驟驠驡驢驣驤驥驦驧驨驩驪驫驲骃骉骍骎骔骕骙骦骩骪骫骬骭骮骯骲骳骴骵骹骻骽骾骿髃髄髆髇髈髉髊髍髎髏髐髒體髕髖髗髙髚髛髜�髝髞髠髢髣髤髥髧髨髩髪髬髮髰髱髲髳髴髵髶髷髸髺髼髽髾髿鬀鬁鬂鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋�".split("");
  73935. for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
  73936. D[244] = "����������������������������������������������������������������鬇鬉鬊鬋鬌鬍鬎鬐鬑鬒鬔鬕鬖鬗鬘鬙鬚鬛鬜鬝鬞鬠鬡鬢鬤鬥鬦鬧鬨鬩鬪鬫鬬鬭鬮鬰鬱鬳鬴鬵鬶鬷鬸鬹鬺鬽鬾鬿魀魆魊魋魌魎魐魒魓魕魖魗魘魙魚�魛魜魝魞魟魠魡魢魣魤魥魦魧魨魩魪魫魬魭魮魯魰魱魲魳魴魵魶魷魸魹魺魻簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤�".split("");
  73937. for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
  73938. D[245] = "����������������������������������������������������������������魼魽魾魿鮀鮁鮂鮃鮄鮅鮆鮇鮈鮉鮊鮋鮌鮍鮎鮏鮐鮑鮒鮓鮔鮕鮖鮗鮘鮙鮚鮛鮜鮝鮞鮟鮠鮡鮢鮣鮤鮥鮦鮧鮨鮩鮪鮫鮬鮭鮮鮯鮰鮱鮲鮳鮴鮵鮶鮷鮸鮹鮺�鮻鮼鮽鮾鮿鯀鯁鯂鯃鯄鯅鯆鯇鯈鯉鯊鯋鯌鯍鯎鯏鯐鯑鯒鯓鯔鯕鯖鯗鯘鯙鯚鯛酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜�".split("");
  73939. for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
  73940. D[246] = "����������������������������������������������������������������鯜鯝鯞鯟鯠鯡鯢鯣鯤鯥鯦鯧鯨鯩鯪鯫鯬鯭鯮鯯鯰鯱鯲鯳鯴鯵鯶鯷鯸鯹鯺鯻鯼鯽鯾鯿鰀鰁鰂鰃鰄鰅鰆鰇鰈鰉鰊鰋鰌鰍鰎鰏鰐鰑鰒鰓鰔鰕鰖鰗鰘鰙鰚�鰛鰜鰝鰞鰟鰠鰡鰢鰣鰤鰥鰦鰧鰨鰩鰪鰫鰬鰭鰮鰯鰰鰱鰲鰳鰴鰵鰶鰷鰸鰹鰺鰻觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅龆龇龈龉龊龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞鲟鲠鲡鲢鲣鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲶鲷鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋�".split("");
  73941. for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
  73942. D[247] = "����������������������������������������������������������������鰼鰽鰾鰿鱀鱁鱂鱃鱄鱅鱆鱇鱈鱉鱊鱋鱌鱍鱎鱏鱐鱑鱒鱓鱔鱕鱖鱗鱘鱙鱚鱛鱜鱝鱞鱟鱠鱡鱢鱣鱤鱥鱦鱧鱨鱩鱪鱫鱬鱭鱮鱯鱰鱱鱲鱳鱴鱵鱶鱷鱸鱹鱺�鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾鲿鳀鳁鳂鳈鳉鳑鳒鳚鳛鳠鳡鳌鳍鳎鳏鳐鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄�".split("");
  73943. for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
  73944. D[248] = "����������������������������������������������������������������鳣鳤鳥鳦鳧鳨鳩鳪鳫鳬鳭鳮鳯鳰鳱鳲鳳鳴鳵鳶鳷鳸鳹鳺鳻鳼鳽鳾鳿鴀鴁鴂鴃鴄鴅鴆鴇鴈鴉鴊鴋鴌鴍鴎鴏鴐鴑鴒鴓鴔鴕鴖鴗鴘鴙鴚鴛鴜鴝鴞鴟鴠鴡�鴢鴣鴤鴥鴦鴧鴨鴩鴪鴫鴬鴭鴮鴯鴰鴱鴲鴳鴴鴵鴶鴷鴸鴹鴺鴻鴼鴽鴾鴿鵀鵁鵂�����������������������������������������������������������������������������������������������".split("");
  73945. for(j = 0; j != D[248].length; ++j) if(D[248][j].charCodeAt(0) !== 0xFFFD) { e[D[248][j]] = 63488 + j; d[63488 + j] = D[248][j];}
  73946. D[249] = "����������������������������������������������������������������鵃鵄鵅鵆鵇鵈鵉鵊鵋鵌鵍鵎鵏鵐鵑鵒鵓鵔鵕鵖鵗鵘鵙鵚鵛鵜鵝鵞鵟鵠鵡鵢鵣鵤鵥鵦鵧鵨鵩鵪鵫鵬鵭鵮鵯鵰鵱鵲鵳鵴鵵鵶鵷鵸鵹鵺鵻鵼鵽鵾鵿鶀鶁�鶂鶃鶄鶅鶆鶇鶈鶉鶊鶋鶌鶍鶎鶏鶐鶑鶒鶓鶔鶕鶖鶗鶘鶙鶚鶛鶜鶝鶞鶟鶠鶡鶢�����������������������������������������������������������������������������������������������".split("");
  73947. for(j = 0; j != D[249].length; ++j) if(D[249][j].charCodeAt(0) !== 0xFFFD) { e[D[249][j]] = 63744 + j; d[63744 + j] = D[249][j];}
  73948. D[250] = "����������������������������������������������������������������鶣鶤鶥鶦鶧鶨鶩鶪鶫鶬鶭鶮鶯鶰鶱鶲鶳鶴鶵鶶鶷鶸鶹鶺鶻鶼鶽鶾鶿鷀鷁鷂鷃鷄鷅鷆鷇鷈鷉鷊鷋鷌鷍鷎鷏鷐鷑鷒鷓鷔鷕鷖鷗鷘鷙鷚鷛鷜鷝鷞鷟鷠鷡�鷢鷣鷤鷥鷦鷧鷨鷩鷪鷫鷬鷭鷮鷯鷰鷱鷲鷳鷴鷵鷶鷷鷸鷹鷺鷻鷼鷽鷾鷿鸀鸁鸂�����������������������������������������������������������������������������������������������".split("");
  73949. for(j = 0; j != D[250].length; ++j) if(D[250][j].charCodeAt(0) !== 0xFFFD) { e[D[250][j]] = 64000 + j; d[64000 + j] = D[250][j];}
  73950. D[251] = "����������������������������������������������������������������鸃鸄鸅鸆鸇鸈鸉鸊鸋鸌鸍鸎鸏鸐鸑鸒鸓鸔鸕鸖鸗鸘鸙鸚鸛鸜鸝鸞鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴鹵鹶鹷鹸鹹鹺鹻鹼鹽麀�麁麃麄麅麆麉麊麌麍麎麏麐麑麔麕麖麗麘麙麚麛麜麞麠麡麢麣麤麥麧麨麩麪�����������������������������������������������������������������������������������������������".split("");
  73951. for(j = 0; j != D[251].length; ++j) if(D[251][j].charCodeAt(0) !== 0xFFFD) { e[D[251][j]] = 64256 + j; d[64256 + j] = D[251][j];}
  73952. D[252] = "����������������������������������������������������������������麫麬麭麮麯麰麱麲麳麵麶麷麹麺麼麿黀黁黂黃黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰黱黲黳黴黵黶黷黸黺黽黿鼀鼁鼂鼃鼄鼅�鼆鼇鼈鼉鼊鼌鼏鼑鼒鼔鼕鼖鼘鼚鼛鼜鼝鼞鼟鼡鼣鼤鼥鼦鼧鼨鼩鼪鼫鼭鼮鼰鼱�����������������������������������������������������������������������������������������������".split("");
  73953. for(j = 0; j != D[252].length; ++j) if(D[252][j].charCodeAt(0) !== 0xFFFD) { e[D[252][j]] = 64512 + j; d[64512 + j] = D[252][j];}
  73954. D[253] = "����������������������������������������������������������������鼲鼳鼴鼵鼶鼸鼺鼼鼿齀齁齂齃齅齆齇齈齉齊齋齌齍齎齏齒齓齔齕齖齗齘齙齚齛齜齝齞齟齠齡齢齣齤齥齦齧齨齩齪齫齬齭齮齯齰齱齲齳齴齵齶齷齸�齹齺齻齼齽齾龁龂龍龎龏龐龑龒龓龔龕龖龗龘龜龝龞龡龢龣龤龥郎凉秊裏隣�����������������������������������������������������������������������������������������������".split("");
  73955. for(j = 0; j != D[253].length; ++j) if(D[253][j].charCodeAt(0) !== 0xFFFD) { e[D[253][j]] = 64768 + j; d[64768 + j] = D[253][j];}
  73956. D[254] = "����������������������������������������������������������������兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������".split("");
  73957. for(j = 0; j != D[254].length; ++j) if(D[254][j].charCodeAt(0) !== 0xFFFD) { e[D[254][j]] = 65024 + j; d[65024 + j] = D[254][j];}
  73958. return {"enc": e, "dec": d }; })();
  73959. cptable[949] = (function(){ var d = [], e = {}, D = [], j;
  73960. D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������".split("");
  73961. for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
  73962. D[129] = "�����������������������������������������������������������������갂갃갅갆갋갌갍갎갏갘갞갟갡갢갣갥갦갧갨갩갪갫갮갲갳갴������갵갶갷갺갻갽갾갿걁걂걃걄걅걆걇걈걉걊걌걎걏걐걑걒걓걕������걖걗걙걚걛걝걞걟걠걡걢걣걤걥걦걧걨걩걪걫걬걭걮걯걲걳걵걶걹걻걼걽걾걿겂겇겈겍겎겏겑겒겓겕겖겗겘겙겚겛겞겢겣겤겥겦겧겫겭겮겱겲겳겴겵겶겷겺겾겿곀곂곃곅곆곇곉곊곋곍곎곏곐곑곒곓곔곖곘곙곚곛곜곝곞곟곢곣곥곦곩곫곭곮곲곴곷곸곹곺곻곾곿괁괂괃괅괇괈괉괊괋괎괐괒괓�".split("");
  73963. for(j = 0; j != D[129].length; ++j) if(D[129][j].charCodeAt(0) !== 0xFFFD) { e[D[129][j]] = 33024 + j; d[33024 + j] = D[129][j];}
  73964. D[130] = "�����������������������������������������������������������������괔괕괖괗괙괚괛괝괞괟괡괢괣괤괥괦괧괨괪괫괮괯괰괱괲괳������괶괷괹괺괻괽괾괿굀굁굂굃굆굈굊굋굌굍굎굏굑굒굓굕굖굗������굙굚굛굜굝굞굟굠굢굤굥굦굧굨굩굪굫굮굯굱굲굷굸굹굺굾궀궃궄궅궆궇궊궋궍궎궏궑궒궓궔궕궖궗궘궙궚궛궞궟궠궡궢궣궥궦궧궨궩궪궫궬궭궮궯궰궱궲궳궴궵궶궸궹궺궻궼궽궾궿귂귃귅귆귇귉귊귋귌귍귎귏귒귔귕귖귗귘귙귚귛귝귞귟귡귢귣귥귦귧귨귩귪귫귬귭귮귯귰귱귲귳귴귵귶귷�".split("");
  73965. for(j = 0; j != D[130].length; ++j) if(D[130][j].charCodeAt(0) !== 0xFFFD) { e[D[130][j]] = 33280 + j; d[33280 + j] = D[130][j];}
  73966. D[131] = "�����������������������������������������������������������������귺귻귽귾긂긃긄긅긆긇긊긌긎긏긐긑긒긓긕긖긗긘긙긚긛긜������긝긞긟긠긡긢긣긤긥긦긧긨긩긪긫긬긭긮긯긲긳긵긶긹긻긼������긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗깘깙깚깛깞깢깣깤깦깧깪깫깭깮깯깱깲깳깴깵깶깷깺깾깿꺀꺁꺂꺃꺆꺇꺈꺉꺊꺋꺍꺎꺏꺐꺑꺒꺓꺔꺕꺖꺗꺘꺙꺚꺛꺜꺝꺞꺟꺠꺡꺢꺣꺤꺥꺦꺧꺨꺩꺪꺫꺬꺭꺮꺯꺰꺱꺲꺳꺴꺵꺶꺷꺸꺹꺺꺻꺿껁껂껃껅껆껇껈껉껊껋껎껒껓껔껕껖껗껚껛껝껞껟껠껡껢껣껤껥�".split("");
  73967. for(j = 0; j != D[131].length; ++j) if(D[131][j].charCodeAt(0) !== 0xFFFD) { e[D[131][j]] = 33536 + j; d[33536 + j] = D[131][j];}
  73968. D[132] = "�����������������������������������������������������������������껦껧껩껪껬껮껯껰껱껲껳껵껶껷껹껺껻껽껾껿꼀꼁꼂꼃꼄꼅������꼆꼉꼊꼋꼌꼎꼏꼑꼒꼓꼔꼕꼖꼗꼘꼙꼚꼛꼜꼝꼞꼟꼠꼡꼢꼣������꼤꼥꼦꼧꼨꼩꼪꼫꼮꼯꼱꼳꼵꼶꼷꼸꼹꼺꼻꼾꽀꽄꽅꽆꽇꽊꽋꽌꽍꽎꽏꽑꽒꽓꽔꽕꽖꽗꽘꽙꽚꽛꽞꽟꽠꽡꽢꽣꽦꽧꽨꽩꽪꽫꽬꽭꽮꽯꽰꽱꽲꽳꽴꽵꽶꽷꽸꽺꽻꽼꽽꽾꽿꾁꾂꾃꾅꾆꾇꾉꾊꾋꾌꾍꾎꾏꾒꾓꾔꾖꾗꾘꾙꾚꾛꾝꾞꾟꾠꾡꾢꾣꾤꾥꾦꾧꾨꾩꾪꾫꾬꾭꾮꾯꾰꾱꾲꾳꾴꾵꾶꾷꾺꾻꾽꾾�".split("");
  73969. for(j = 0; j != D[132].length; ++j) if(D[132][j].charCodeAt(0) !== 0xFFFD) { e[D[132][j]] = 33792 + j; d[33792 + j] = D[132][j];}
  73970. D[133] = "�����������������������������������������������������������������꾿꿁꿂꿃꿄꿅꿆꿊꿌꿏꿐꿑꿒꿓꿕꿖꿗꿘꿙꿚꿛꿝꿞꿟꿠꿡������꿢꿣꿤꿥꿦꿧꿪꿫꿬꿭꿮꿯꿲꿳꿵꿶꿷꿹꿺꿻꿼꿽꿾꿿뀂뀃������뀅뀆뀇뀈뀉뀊뀋뀍뀎뀏뀑뀒뀓뀕뀖뀗뀘뀙뀚뀛뀞뀟뀠뀡뀢뀣뀤뀥뀦뀧뀩뀪뀫뀬뀭뀮뀯뀰뀱뀲뀳뀴뀵뀶뀷뀸뀹뀺뀻뀼뀽뀾뀿끀끁끂끃끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞끟끠끡끢끣끤끥끦끧끨끩끪끫끬끭끮끯끰끱끲끳끴끵끶끷끸끹끺끻끾끿낁낂낃낅낆낇낈낉낊낋낎낐낒낓낔낕낖낗낛낝낞낣낤�".split("");
  73971. for(j = 0; j != D[133].length; ++j) if(D[133][j].charCodeAt(0) !== 0xFFFD) { e[D[133][j]] = 34048 + j; d[34048 + j] = D[133][j];}
  73972. D[134] = "�����������������������������������������������������������������낥낦낧낪낰낲낶낷낹낺낻낽낾낿냀냁냂냃냆냊냋냌냍냎냏냒������냓냕냖냗냙냚냛냜냝냞냟냡냢냣냤냦냧냨냩냪냫냬냭냮냯냰������냱냲냳냴냵냶냷냸냹냺냻냼냽냾냿넀넁넂넃넄넅넆넇넊넍넎넏넑넔넕넖넗넚넞넟넠넡넢넦넧넩넪넫넭넮넯넰넱넲넳넶넺넻넼넽넾넿녂녃녅녆녇녉녊녋녌녍녎녏녒녓녖녗녙녚녛녝녞녟녡녢녣녤녥녦녧녨녩녪녫녬녭녮녯녰녱녲녳녴녵녶녷녺녻녽녾녿놁놃놄놅놆놇놊놌놎놏놐놑놕놖놗놙놚놛놝�".split("");
  73973. for(j = 0; j != D[134].length; ++j) if(D[134][j].charCodeAt(0) !== 0xFFFD) { e[D[134][j]] = 34304 + j; d[34304 + j] = D[134][j];}
  73974. D[135] = "�����������������������������������������������������������������놞놟놠놡놢놣놤놥놦놧놩놪놫놬놭놮놯놰놱놲놳놴놵놶놷놸������놹놺놻놼놽놾놿뇀뇁뇂뇃뇄뇅뇆뇇뇈뇉뇊뇋뇍뇎뇏뇑뇒뇓뇕������뇖뇗뇘뇙뇚뇛뇞뇠뇡뇢뇣뇤뇥뇦뇧뇪뇫뇭뇮뇯뇱뇲뇳뇴뇵뇶뇷뇸뇺뇼뇾뇿눀눁눂눃눆눇눉눊눍눎눏눐눑눒눓눖눘눚눛눜눝눞눟눡눢눣눤눥눦눧눨눩눪눫눬눭눮눯눰눱눲눳눵눶눷눸눹눺눻눽눾눿뉀뉁뉂뉃뉄뉅뉆뉇뉈뉉뉊뉋뉌뉍뉎뉏뉐뉑뉒뉓뉔뉕뉖뉗뉙뉚뉛뉝뉞뉟뉡뉢뉣뉤뉥뉦뉧뉪뉫뉬뉭뉮�".split("");
  73975. for(j = 0; j != D[135].length; ++j) if(D[135][j].charCodeAt(0) !== 0xFFFD) { e[D[135][j]] = 34560 + j; d[34560 + j] = D[135][j];}
  73976. D[136] = "�����������������������������������������������������������������뉯뉰뉱뉲뉳뉶뉷뉸뉹뉺뉻뉽뉾뉿늀늁늂늃늆늇늈늊늋늌늍늎������늏늒늓늕늖늗늛늜늝늞늟늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷������늸늹늺늻늼늽늾늿닀닁닂닃닄닅닆닇닊닋닍닎닏닑닓닔닕닖닗닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉댊댋댌댍댎댏댒댖댗댘댙댚댛댝댞댟댠댡댢댣댤댥댦댧댨댩댪댫댬댭댮댯댰댱댲댳댴댵댶댷댸댹댺댻댼댽댾댿덀덁덂덃덄덅덆덇덈덉덊덋덌덍덎덏덐덑덒덓덗덙덚덝덠덡덢덣�".split("");
  73977. for(j = 0; j != D[136].length; ++j) if(D[136][j].charCodeAt(0) !== 0xFFFD) { e[D[136][j]] = 34816 + j; d[34816 + j] = D[136][j];}
  73978. D[137] = "�����������������������������������������������������������������덦덨덪덬덭덯덲덳덵덶덷덹덺덻덼덽덾덿뎂뎆뎇뎈뎉뎊뎋뎍������뎎뎏뎑뎒뎓뎕뎖뎗뎘뎙뎚뎛뎜뎝뎞뎟뎢뎣뎤뎥뎦뎧뎩뎪뎫뎭������뎮뎯뎰뎱뎲뎳뎴뎵뎶뎷뎸뎹뎺뎻뎼뎽뎾뎿돀돁돂돃돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩돪돫돬돭돮돯돰돱돲돳돴돵돶돷돸돹돺돻돽돾돿됀됁됂됃됄됅됆됇됈됉됊됋됌됍됎됏됑됒됓됔됕됖됗됙됚됛됝됞됟됡됢됣됤됥됦됧됪됬됭됮됯됰됱됲됳됵됶됷됸됹됺됻됼됽됾됿둀둁둂둃둄�".split("");
  73979. for(j = 0; j != D[137].length; ++j) if(D[137][j].charCodeAt(0) !== 0xFFFD) { e[D[137][j]] = 35072 + j; d[35072 + j] = D[137][j];}
  73980. D[138] = "�����������������������������������������������������������������둅둆둇둈둉둊둋둌둍둎둏둒둓둕둖둗둙둚둛둜둝둞둟둢둤둦������둧둨둩둪둫둭둮둯둰둱둲둳둴둵둶둷둸둹둺둻둼둽둾둿뒁뒂������뒃뒄뒅뒆뒇뒉뒊뒋뒌뒍뒎뒏뒐뒑뒒뒓뒔뒕뒖뒗뒘뒙뒚뒛뒜뒞뒟뒠뒡뒢뒣뒥뒦뒧뒩뒪뒫뒭뒮뒯뒰뒱뒲뒳뒴뒶뒸뒺뒻뒼뒽뒾뒿듁듂듃듅듆듇듉듊듋듌듍듎듏듑듒듓듔듖듗듘듙듚듛듞듟듡듢듥듧듨듩듪듫듮듰듲듳듴듵듶듷듹듺듻듼듽듾듿딀딁딂딃딄딅딆딇딈딉딊딋딌딍딎딏딐딑딒딓딖딗딙딚딝�".split("");
  73981. for(j = 0; j != D[138].length; ++j) if(D[138][j].charCodeAt(0) !== 0xFFFD) { e[D[138][j]] = 35328 + j; d[35328 + j] = D[138][j];}
  73982. D[139] = "�����������������������������������������������������������������딞딟딠딡딢딣딦딫딬딭딮딯딲딳딵딶딷딹딺딻딼딽딾딿땂땆������땇땈땉땊땎땏땑땒땓땕땖땗땘땙땚땛땞땢땣땤땥땦땧땨땩땪������땫땬땭땮땯땰땱땲땳땴땵땶땷땸땹땺땻땼땽땾땿떀떁떂떃떄떅떆떇떈떉떊떋떌떍떎떏떐떑떒떓떔떕떖떗떘떙떚떛떜떝떞떟떢떣떥떦떧떩떬떭떮떯떲떶떷떸떹떺떾떿뗁뗂뗃뗅뗆뗇뗈뗉뗊뗋뗎뗒뗓뗔뗕뗖뗗뗙뗚뗛뗜뗝뗞뗟뗠뗡뗢뗣뗤뗥뗦뗧뗨뗩뗪뗫뗭뗮뗯뗰뗱뗲뗳뗴뗵뗶뗷뗸뗹뗺뗻뗼뗽뗾뗿�".split("");
  73983. for(j = 0; j != D[139].length; ++j) if(D[139][j].charCodeAt(0) !== 0xFFFD) { e[D[139][j]] = 35584 + j; d[35584 + j] = D[139][j];}
  73984. D[140] = "�����������������������������������������������������������������똀똁똂똃똄똅똆똇똈똉똊똋똌똍똎똏똒똓똕똖똗똙똚똛똜똝������똞똟똠똡똢똣똤똦똧똨똩똪똫똭똮똯똰똱똲똳똵똶똷똸똹똺������똻똼똽똾똿뙀뙁뙂뙃뙄뙅뙆뙇뙉뙊뙋뙌뙍뙎뙏뙐뙑뙒뙓뙔뙕뙖뙗뙘뙙뙚뙛뙜뙝뙞뙟뙠뙡뙢뙣뙥뙦뙧뙩뙪뙫뙬뙭뙮뙯뙰뙱뙲뙳뙴뙵뙶뙷뙸뙹뙺뙻뙼뙽뙾뙿뚀뚁뚂뚃뚄뚅뚆뚇뚈뚉뚊뚋뚌뚍뚎뚏뚐뚑뚒뚓뚔뚕뚖뚗뚘뚙뚚뚛뚞뚟뚡뚢뚣뚥뚦뚧뚨뚩뚪뚭뚮뚯뚰뚲뚳뚴뚵뚶뚷뚸뚹뚺뚻뚼뚽뚾뚿뛀뛁뛂�".split("");
  73985. for(j = 0; j != D[140].length; ++j) if(D[140][j].charCodeAt(0) !== 0xFFFD) { e[D[140][j]] = 35840 + j; d[35840 + j] = D[140][j];}
  73986. D[141] = "�����������������������������������������������������������������뛃뛄뛅뛆뛇뛈뛉뛊뛋뛌뛍뛎뛏뛐뛑뛒뛓뛕뛖뛗뛘뛙뛚뛛뛜뛝������뛞뛟뛠뛡뛢뛣뛤뛥뛦뛧뛨뛩뛪뛫뛬뛭뛮뛯뛱뛲뛳뛵뛶뛷뛹뛺������뛻뛼뛽뛾뛿뜂뜃뜄뜆뜇뜈뜉뜊뜋뜌뜍뜎뜏뜐뜑뜒뜓뜔뜕뜖뜗뜘뜙뜚뜛뜜뜝뜞뜟뜠뜡뜢뜣뜤뜥뜦뜧뜪뜫뜭뜮뜱뜲뜳뜴뜵뜶뜷뜺뜼뜽뜾뜿띀띁띂띃띅띆띇띉띊띋띍띎띏띐띑띒띓띖띗띘띙띚띛띜띝띞띟띡띢띣띥띦띧띩띪띫띬띭띮띯띲띴띶띷띸띹띺띻띾띿랁랂랃랅랆랇랈랉랊랋랎랓랔랕랚랛랝랞�".split("");
  73987. for(j = 0; j != D[141].length; ++j) if(D[141][j].charCodeAt(0) !== 0xFFFD) { e[D[141][j]] = 36096 + j; d[36096 + j] = D[141][j];}
  73988. D[142] = "�����������������������������������������������������������������랟랡랢랣랤랥랦랧랪랮랯랰랱랲랳랶랷랹랺랻랼랽랾랿럀럁������럂럃럄럅럆럈럊럋럌럍럎럏럐럑럒럓럔럕럖럗럘럙럚럛럜럝������럞럟럠럡럢럣럤럥럦럧럨럩럪럫럮럯럱럲럳럵럶럷럸럹럺럻럾렂렃렄렅렆렊렋렍렎렏렑렒렓렔렕렖렗렚렜렞렟렠렡렢렣렦렧렩렪렫렭렮렯렰렱렲렳렶렺렻렼렽렾렿롁롂롃롅롆롇롈롉롊롋롌롍롎롏롐롒롔롕롖롗롘롙롚롛롞롟롡롢롣롥롦롧롨롩롪롫롮롰롲롳롴롵롶롷롹롺롻롽롾롿뢀뢁뢂뢃뢄�".split("");
  73989. for(j = 0; j != D[142].length; ++j) if(D[142][j].charCodeAt(0) !== 0xFFFD) { e[D[142][j]] = 36352 + j; d[36352 + j] = D[142][j];}
  73990. D[143] = "�����������������������������������������������������������������뢅뢆뢇뢈뢉뢊뢋뢌뢎뢏뢐뢑뢒뢓뢔뢕뢖뢗뢘뢙뢚뢛뢜뢝뢞뢟������뢠뢡뢢뢣뢤뢥뢦뢧뢩뢪뢫뢬뢭뢮뢯뢱뢲뢳뢵뢶뢷뢹뢺뢻뢼뢽������뢾뢿룂룄룆룇룈룉룊룋룍룎룏룑룒룓룕룖룗룘룙룚룛룜룞룠룢룣룤룥룦룧룪룫룭룮룯룱룲룳룴룵룶룷룺룼룾룿뤀뤁뤂뤃뤅뤆뤇뤈뤉뤊뤋뤌뤍뤎뤏뤐뤑뤒뤓뤔뤕뤖뤗뤙뤚뤛뤜뤝뤞뤟뤡뤢뤣뤤뤥뤦뤧뤨뤩뤪뤫뤬뤭뤮뤯뤰뤱뤲뤳뤴뤵뤶뤷뤸뤹뤺뤻뤾뤿륁륂륃륅륆륇륈륉륊륋륍륎륐륒륓륔륕륖륗�".split("");
  73991. for(j = 0; j != D[143].length; ++j) if(D[143][j].charCodeAt(0) !== 0xFFFD) { e[D[143][j]] = 36608 + j; d[36608 + j] = D[143][j];}
  73992. D[144] = "�����������������������������������������������������������������륚륛륝륞륟륡륢륣륤륥륦륧륪륬륮륯륰륱륲륳륶륷륹륺륻륽������륾륿릀릁릂릃릆릈릋릌릏릐릑릒릓릔릕릖릗릘릙릚릛릜릝릞������릟릠릡릢릣릤릥릦릧릨릩릪릫릮릯릱릲릳릵릶릷릸릹릺릻릾맀맂맃맄맅맆맇맊맋맍맓맔맕맖맗맚맜맟맠맢맦맧맩맪맫맭맮맯맰맱맲맳맶맻맼맽맾맿먂먃먄먅먆먇먉먊먋먌먍먎먏먐먑먒먓먔먖먗먘먙먚먛먜먝먞먟먠먡먢먣먤먥먦먧먨먩먪먫먬먭먮먯먰먱먲먳먴먵먶먷먺먻먽먾먿멁멃멄멅멆�".split("");
  73993. for(j = 0; j != D[144].length; ++j) if(D[144][j].charCodeAt(0) !== 0xFFFD) { e[D[144][j]] = 36864 + j; d[36864 + j] = D[144][j];}
  73994. D[145] = "�����������������������������������������������������������������멇멊멌멏멐멑멒멖멗멙멚멛멝멞멟멠멡멢멣멦멪멫멬멭멮멯������멲멳멵멶멷멹멺멻멼멽멾멿몀몁몂몆몈몉몊몋몍몎몏몐몑몒������몓몔몕몖몗몘몙몚몛몜몝몞몟몠몡몢몣몤몥몦몧몪몭몮몯몱몳몴몵몶몷몺몼몾몿뫀뫁뫂뫃뫅뫆뫇뫉뫊뫋뫌뫍뫎뫏뫐뫑뫒뫓뫔뫕뫖뫗뫚뫛뫜뫝뫞뫟뫠뫡뫢뫣뫤뫥뫦뫧뫨뫩뫪뫫뫬뫭뫮뫯뫰뫱뫲뫳뫴뫵뫶뫷뫸뫹뫺뫻뫽뫾뫿묁묂묃묅묆묇묈묉묊묋묌묎묐묒묓묔묕묖묗묙묚묛묝묞묟묡묢묣묤묥묦묧�".split("");
  73995. for(j = 0; j != D[145].length; ++j) if(D[145][j].charCodeAt(0) !== 0xFFFD) { e[D[145][j]] = 37120 + j; d[37120 + j] = D[145][j];}
  73996. D[146] = "�����������������������������������������������������������������묨묪묬묭묮묯묰묱묲묳묷묹묺묿뭀뭁뭂뭃뭆뭈뭊뭋뭌뭎뭑뭒������뭓뭕뭖뭗뭙뭚뭛뭜뭝뭞뭟뭠뭢뭤뭥뭦뭧뭨뭩뭪뭫뭭뭮뭯뭰뭱������뭲뭳뭴뭵뭶뭷뭸뭹뭺뭻뭼뭽뭾뭿뮀뮁뮂뮃뮄뮅뮆뮇뮉뮊뮋뮍뮎뮏뮑뮒뮓뮔뮕뮖뮗뮘뮙뮚뮛뮜뮝뮞뮟뮠뮡뮢뮣뮥뮦뮧뮩뮪뮫뮭뮮뮯뮰뮱뮲뮳뮵뮶뮸뮹뮺뮻뮼뮽뮾뮿믁믂믃믅믆믇믉믊믋믌믍믎믏믑믒믔믕믖믗믘믙믚믛믜믝믞믟믠믡믢믣믤믥믦믧믨믩믪믫믬믭믮믯믰믱믲믳믴믵믶믷믺믻믽믾밁�".split("");
  73997. for(j = 0; j != D[146].length; ++j) if(D[146][j].charCodeAt(0) !== 0xFFFD) { e[D[146][j]] = 37376 + j; d[37376 + j] = D[146][j];}
  73998. D[147] = "�����������������������������������������������������������������밃밄밅밆밇밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵������밶밷밹밺밻밼밽밾밿뱂뱆뱇뱈뱊뱋뱎뱏뱑뱒뱓뱔뱕뱖뱗뱘뱙������뱚뱛뱜뱞뱟뱠뱡뱢뱣뱤뱥뱦뱧뱨뱩뱪뱫뱬뱭뱮뱯뱰뱱뱲뱳뱴뱵뱶뱷뱸뱹뱺뱻뱼뱽뱾뱿벀벁벂벃벆벇벉벊벍벏벐벑벒벓벖벘벛벜벝벞벟벢벣벥벦벩벪벫벬벭벮벯벲벶벷벸벹벺벻벾벿볁볂볃볅볆볇볈볉볊볋볌볎볒볓볔볖볗볙볚볛볝볞볟볠볡볢볣볤볥볦볧볨볩볪볫볬볭볮볯볰볱볲볳볷볹볺볻볽�".split("");
  73999. for(j = 0; j != D[147].length; ++j) if(D[147][j].charCodeAt(0) !== 0xFFFD) { e[D[147][j]] = 37632 + j; d[37632 + j] = D[147][j];}
  74000. D[148] = "�����������������������������������������������������������������볾볿봀봁봂봃봆봈봊봋봌봍봎봏봑봒봓봕봖봗봘봙봚봛봜봝������봞봟봠봡봢봣봥봦봧봨봩봪봫봭봮봯봰봱봲봳봴봵봶봷봸봹������봺봻봼봽봾봿뵁뵂뵃뵄뵅뵆뵇뵊뵋뵍뵎뵏뵑뵒뵓뵔뵕뵖뵗뵚뵛뵜뵝뵞뵟뵠뵡뵢뵣뵥뵦뵧뵩뵪뵫뵬뵭뵮뵯뵰뵱뵲뵳뵴뵵뵶뵷뵸뵹뵺뵻뵼뵽뵾뵿붂붃붅붆붋붌붍붎붏붒붔붖붗붘붛붝붞붟붠붡붢붣붥붦붧붨붩붪붫붬붭붮붯붱붲붳붴붵붶붷붹붺붻붼붽붾붿뷀뷁뷂뷃뷄뷅뷆뷇뷈뷉뷊뷋뷌뷍뷎뷏뷐뷑�".split("");
  74001. for(j = 0; j != D[148].length; ++j) if(D[148][j].charCodeAt(0) !== 0xFFFD) { e[D[148][j]] = 37888 + j; d[37888 + j] = D[148][j];}
  74002. D[149] = "�����������������������������������������������������������������뷒뷓뷖뷗뷙뷚뷛뷝뷞뷟뷠뷡뷢뷣뷤뷥뷦뷧뷨뷪뷫뷬뷭뷮뷯뷱������뷲뷳뷵뷶뷷뷹뷺뷻뷼뷽뷾뷿븁븂븄븆븇븈븉븊븋븎븏븑븒븓������븕븖븗븘븙븚븛븞븠븡븢븣븤븥븦븧븨븩븪븫븬븭븮븯븰븱븲븳븴븵븶븷븸븹븺븻븼븽븾븿빀빁빂빃빆빇빉빊빋빍빏빐빑빒빓빖빘빜빝빞빟빢빣빥빦빧빩빫빬빭빮빯빲빶빷빸빹빺빾빿뺁뺂뺃뺅뺆뺇뺈뺉뺊뺋뺎뺒뺓뺔뺕뺖뺗뺚뺛뺜뺝뺞뺟뺠뺡뺢뺣뺤뺥뺦뺧뺩뺪뺫뺬뺭뺮뺯뺰뺱뺲뺳뺴뺵뺶뺷�".split("");
  74003. for(j = 0; j != D[149].length; ++j) if(D[149][j].charCodeAt(0) !== 0xFFFD) { e[D[149][j]] = 38144 + j; d[38144 + j] = D[149][j];}
  74004. D[150] = "�����������������������������������������������������������������뺸뺹뺺뺻뺼뺽뺾뺿뻀뻁뻂뻃뻄뻅뻆뻇뻈뻉뻊뻋뻌뻍뻎뻏뻒뻓������뻕뻖뻙뻚뻛뻜뻝뻞뻟뻡뻢뻦뻧뻨뻩뻪뻫뻭뻮뻯뻰뻱뻲뻳뻴뻵������뻶뻷뻸뻹뻺뻻뻼뻽뻾뻿뼀뼂뼃뼄뼅뼆뼇뼊뼋뼌뼍뼎뼏뼐뼑뼒뼓뼔뼕뼖뼗뼚뼞뼟뼠뼡뼢뼣뼤뼥뼦뼧뼨뼩뼪뼫뼬뼭뼮뼯뼰뼱뼲뼳뼴뼵뼶뼷뼸뼹뼺뼻뼼뼽뼾뼿뽂뽃뽅뽆뽇뽉뽊뽋뽌뽍뽎뽏뽒뽓뽔뽖뽗뽘뽙뽚뽛뽜뽝뽞뽟뽠뽡뽢뽣뽤뽥뽦뽧뽨뽩뽪뽫뽬뽭뽮뽯뽰뽱뽲뽳뽴뽵뽶뽷뽸뽹뽺뽻뽼뽽뽾뽿뾀뾁뾂�".split("");
  74005. for(j = 0; j != D[150].length; ++j) if(D[150][j].charCodeAt(0) !== 0xFFFD) { e[D[150][j]] = 38400 + j; d[38400 + j] = D[150][j];}
  74006. D[151] = "�����������������������������������������������������������������뾃뾄뾅뾆뾇뾈뾉뾊뾋뾌뾍뾎뾏뾐뾑뾒뾓뾕뾖뾗뾘뾙뾚뾛뾜뾝������뾞뾟뾠뾡뾢뾣뾤뾥뾦뾧뾨뾩뾪뾫뾬뾭뾮뾯뾱뾲뾳뾴뾵뾶뾷뾸������뾹뾺뾻뾼뾽뾾뾿뿀뿁뿂뿃뿄뿆뿇뿈뿉뿊뿋뿎뿏뿑뿒뿓뿕뿖뿗뿘뿙뿚뿛뿝뿞뿠뿢뿣뿤뿥뿦뿧뿨뿩뿪뿫뿬뿭뿮뿯뿰뿱뿲뿳뿴뿵뿶뿷뿸뿹뿺뿻뿼뿽뿾뿿쀀쀁쀂쀃쀄쀅쀆쀇쀈쀉쀊쀋쀌쀍쀎쀏쀐쀑쀒쀓쀔쀕쀖쀗쀘쀙쀚쀛쀜쀝쀞쀟쀠쀡쀢쀣쀤쀥쀦쀧쀨쀩쀪쀫쀬쀭쀮쀯쀰쀱쀲쀳쀴쀵쀶쀷쀸쀹쀺쀻쀽쀾쀿�".split("");
  74007. for(j = 0; j != D[151].length; ++j) if(D[151][j].charCodeAt(0) !== 0xFFFD) { e[D[151][j]] = 38656 + j; d[38656 + j] = D[151][j];}
  74008. D[152] = "�����������������������������������������������������������������쁀쁁쁂쁃쁄쁅쁆쁇쁈쁉쁊쁋쁌쁍쁎쁏쁐쁒쁓쁔쁕쁖쁗쁙쁚쁛������쁝쁞쁟쁡쁢쁣쁤쁥쁦쁧쁪쁫쁬쁭쁮쁯쁰쁱쁲쁳쁴쁵쁶쁷쁸쁹������쁺쁻쁼쁽쁾쁿삀삁삂삃삄삅삆삇삈삉삊삋삌삍삎삏삒삓삕삖삗삙삚삛삜삝삞삟삢삤삦삧삨삩삪삫삮삱삲삷삸삹삺삻삾샂샃샄샆샇샊샋샍샎샏샑샒샓샔샕샖샗샚샞샟샠샡샢샣샦샧샩샪샫샭샮샯샰샱샲샳샶샸샺샻샼샽샾샿섁섂섃섅섆섇섉섊섋섌섍섎섏섑섒섓섔섖섗섘섙섚섛섡섢섥섨섩섪섫섮�".split("");
  74009. for(j = 0; j != D[152].length; ++j) if(D[152][j].charCodeAt(0) !== 0xFFFD) { e[D[152][j]] = 38912 + j; d[38912 + j] = D[152][j];}
  74010. D[153] = "�����������������������������������������������������������������섲섳섴섵섷섺섻섽섾섿셁셂셃셄셅셆셇셊셎셏셐셑셒셓셖셗������셙셚셛셝셞셟셠셡셢셣셦셪셫셬셭셮셯셱셲셳셵셶셷셹셺셻������셼셽셾셿솀솁솂솃솄솆솇솈솉솊솋솏솑솒솓솕솗솘솙솚솛솞솠솢솣솤솦솧솪솫솭솮솯솱솲솳솴솵솶솷솸솹솺솻솼솾솿쇀쇁쇂쇃쇅쇆쇇쇉쇊쇋쇍쇎쇏쇐쇑쇒쇓쇕쇖쇙쇚쇛쇜쇝쇞쇟쇡쇢쇣쇥쇦쇧쇩쇪쇫쇬쇭쇮쇯쇲쇴쇵쇶쇷쇸쇹쇺쇻쇾쇿숁숂숃숅숆숇숈숉숊숋숎숐숒숓숔숕숖숗숚숛숝숞숡숢숣�".split("");
  74011. for(j = 0; j != D[153].length; ++j) if(D[153][j].charCodeAt(0) !== 0xFFFD) { e[D[153][j]] = 39168 + j; d[39168 + j] = D[153][j];}
  74012. D[154] = "�����������������������������������������������������������������숤숥숦숧숪숬숮숰숳숵숶숷숸숹숺숻숼숽숾숿쉀쉁쉂쉃쉄쉅������쉆쉇쉉쉊쉋쉌쉍쉎쉏쉒쉓쉕쉖쉗쉙쉚쉛쉜쉝쉞쉟쉡쉢쉣쉤쉦������쉧쉨쉩쉪쉫쉮쉯쉱쉲쉳쉵쉶쉷쉸쉹쉺쉻쉾슀슂슃슄슅슆슇슊슋슌슍슎슏슑슒슓슔슕슖슗슙슚슜슞슟슠슡슢슣슦슧슩슪슫슮슯슰슱슲슳슶슸슺슻슼슽슾슿싀싁싂싃싄싅싆싇싈싉싊싋싌싍싎싏싐싑싒싓싔싕싖싗싘싙싚싛싞싟싡싢싥싦싧싨싩싪싮싰싲싳싴싵싷싺싽싾싿쌁쌂쌃쌄쌅쌆쌇쌊쌋쌎쌏�".split("");
  74013. for(j = 0; j != D[154].length; ++j) if(D[154][j].charCodeAt(0) !== 0xFFFD) { e[D[154][j]] = 39424 + j; d[39424 + j] = D[154][j];}
  74014. D[155] = "�����������������������������������������������������������������쌐쌑쌒쌖쌗쌙쌚쌛쌝쌞쌟쌠쌡쌢쌣쌦쌧쌪쌫쌬쌭쌮쌯쌰쌱쌲������쌳쌴쌵쌶쌷쌸쌹쌺쌻쌼쌽쌾쌿썀썁썂썃썄썆썇썈썉썊썋썌썍������썎썏썐썑썒썓썔썕썖썗썘썙썚썛썜썝썞썟썠썡썢썣썤썥썦썧썪썫썭썮썯썱썳썴썵썶썷썺썻썾썿쎀쎁쎂쎃쎅쎆쎇쎉쎊쎋쎍쎎쎏쎐쎑쎒쎓쎔쎕쎖쎗쎘쎙쎚쎛쎜쎝쎞쎟쎠쎡쎢쎣쎤쎥쎦쎧쎨쎩쎪쎫쎬쎭쎮쎯쎰쎱쎲쎳쎴쎵쎶쎷쎸쎹쎺쎻쎼쎽쎾쎿쏁쏂쏃쏄쏅쏆쏇쏈쏉쏊쏋쏌쏍쏎쏏쏐쏑쏒쏓쏔쏕쏖쏗쏚�".split("");
  74015. for(j = 0; j != D[155].length; ++j) if(D[155][j].charCodeAt(0) !== 0xFFFD) { e[D[155][j]] = 39680 + j; d[39680 + j] = D[155][j];}
  74016. D[156] = "�����������������������������������������������������������������쏛쏝쏞쏡쏣쏤쏥쏦쏧쏪쏫쏬쏮쏯쏰쏱쏲쏳쏶쏷쏹쏺쏻쏼쏽쏾������쏿쐀쐁쐂쐃쐄쐅쐆쐇쐉쐊쐋쐌쐍쐎쐏쐑쐒쐓쐔쐕쐖쐗쐘쐙쐚������쐛쐜쐝쐞쐟쐠쐡쐢쐣쐥쐦쐧쐨쐩쐪쐫쐭쐮쐯쐱쐲쐳쐵쐶쐷쐸쐹쐺쐻쐾쐿쑀쑁쑂쑃쑄쑅쑆쑇쑉쑊쑋쑌쑍쑎쑏쑐쑑쑒쑓쑔쑕쑖쑗쑘쑙쑚쑛쑜쑝쑞쑟쑠쑡쑢쑣쑦쑧쑩쑪쑫쑭쑮쑯쑰쑱쑲쑳쑶쑷쑸쑺쑻쑼쑽쑾쑿쒁쒂쒃쒄쒅쒆쒇쒈쒉쒊쒋쒌쒍쒎쒏쒐쒑쒒쒓쒕쒖쒗쒘쒙쒚쒛쒝쒞쒟쒠쒡쒢쒣쒤쒥쒦쒧쒨쒩�".split("");
  74017. for(j = 0; j != D[156].length; ++j) if(D[156][j].charCodeAt(0) !== 0xFFFD) { e[D[156][j]] = 39936 + j; d[39936 + j] = D[156][j];}
  74018. D[157] = "�����������������������������������������������������������������쒪쒫쒬쒭쒮쒯쒰쒱쒲쒳쒴쒵쒶쒷쒹쒺쒻쒽쒾쒿쓀쓁쓂쓃쓄쓅������쓆쓇쓈쓉쓊쓋쓌쓍쓎쓏쓐쓑쓒쓓쓔쓕쓖쓗쓘쓙쓚쓛쓜쓝쓞쓟������쓠쓡쓢쓣쓤쓥쓦쓧쓨쓪쓫쓬쓭쓮쓯쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂씃씄씅씆씇씈씉씊씋씍씎씏씑씒씓씕씖씗씘씙씚씛씝씞씟씠씡씢씣씤씥씦씧씪씫씭씮씯씱씲씳씴씵씶씷씺씼씾씿앀앁앂앃앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩앪앫앬앭앮앯앲앶앷앸앹앺앻앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔�".split("");
  74019. for(j = 0; j != D[157].length; ++j) if(D[157][j].charCodeAt(0) !== 0xFFFD) { e[D[157][j]] = 40192 + j; d[40192 + j] = D[157][j];}
  74020. D[158] = "�����������������������������������������������������������������얖얙얚얛얝얞얟얡얢얣얤얥얦얧얨얪얫얬얭얮얯얰얱얲얳얶������얷얺얿엀엁엂엃엋엍엏엒엓엕엖엗엙엚엛엜엝엞엟엢엤엦엧������엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑옒옓옔옕옖옗옚옝옞옟옠옡옢옣옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉왊왋왌왍왎왏왒왖왗왘왙왚왛왞왟왡왢왣왤왥왦왧왨왩왪왫왭왮왰왲왳왴왵왶왷왺왻왽왾왿욁욂욃욄욅욆욇욊욌욎욏욐욑욒욓욖욗욙욚욛욝욞욟욠욡욢욣욦�".split("");
  74021. for(j = 0; j != D[158].length; ++j) if(D[158][j].charCodeAt(0) !== 0xFFFD) { e[D[158][j]] = 40448 + j; d[40448 + j] = D[158][j];}
  74022. D[159] = "�����������������������������������������������������������������욨욪욫욬욭욮욯욲욳욵욶욷욻욼욽욾욿웂웄웆웇웈웉웊웋웎������웏웑웒웓웕웖웗웘웙웚웛웞웟웢웣웤웥웦웧웪웫웭웮웯웱웲������웳웴웵웶웷웺웻웼웾웿윀윁윂윃윆윇윉윊윋윍윎윏윐윑윒윓윖윘윚윛윜윝윞윟윢윣윥윦윧윩윪윫윬윭윮윯윲윴윶윸윹윺윻윾윿읁읂읃읅읆읇읈읉읋읎읐읙읚읛읝읞읟읡읢읣읤읥읦읧읩읪읬읭읮읯읰읱읲읳읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛잜잝잞잟잢잧잨잩잪잫잮잯잱잲잳잵잶잷�".split("");
  74023. for(j = 0; j != D[159].length; ++j) if(D[159][j].charCodeAt(0) !== 0xFFFD) { e[D[159][j]] = 40704 + j; d[40704 + j] = D[159][j];}
  74024. D[160] = "�����������������������������������������������������������������잸잹잺잻잾쟂쟃쟄쟅쟆쟇쟊쟋쟍쟏쟑쟒쟓쟔쟕쟖쟗쟙쟚쟛쟜������쟞쟟쟠쟡쟢쟣쟥쟦쟧쟩쟪쟫쟭쟮쟯쟰쟱쟲쟳쟴쟵쟶쟷쟸쟹쟺������쟻쟼쟽쟾쟿젂젃젅젆젇젉젋젌젍젎젏젒젔젗젘젙젚젛젞젟젡젢젣젥젦젧젨젩젪젫젮젰젲젳젴젵젶젷젹젺젻젽젾젿졁졂졃졄졅졆졇졊졋졎졏졐졑졒졓졕졖졗졘졙졚졛졜졝졞졟졠졡졢졣졤졥졦졧졨졩졪졫졬졭졮졯졲졳졵졶졷졹졻졼졽졾졿좂좄좈좉좊좎좏좐좑좒좓좕좖좗좘좙좚좛좜좞좠좢좣좤�".split("");
  74025. for(j = 0; j != D[160].length; ++j) if(D[160][j].charCodeAt(0) !== 0xFFFD) { e[D[160][j]] = 40960 + j; d[40960 + j] = D[160][j];}
  74026. D[161] = "�����������������������������������������������������������������좥좦좧좩좪좫좬좭좮좯좰좱좲좳좴좵좶좷좸좹좺좻좾좿죀죁������죂죃죅죆죇죉죊죋죍죎죏죐죑죒죓죖죘죚죛죜죝죞죟죢죣죥������죦죧죨죩죪죫죬죭죮죯죰죱죲죳죴죶죷죸죹죺죻죾죿줁줂줃줇줈줉줊줋줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈〉《》「」『』【】±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬�".split("");
  74027. for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
  74028. D[162] = "�����������������������������������������������������������������줐줒줓줔줕줖줗줙줚줛줜줝줞줟줠줡줢줣줤줥줦줧줨줩줪줫������줭줮줯줰줱줲줳줵줶줷줸줹줺줻줼줽줾줿쥀쥁쥂쥃쥄쥅쥆쥇������쥈쥉쥊쥋쥌쥍쥎쥏쥒쥓쥕쥖쥗쥙쥚쥛쥜쥝쥞쥟쥢쥤쥥쥦쥧쥨쥩쥪쥫쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®������������������������".split("");
  74029. for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
  74030. D[163] = "�����������������������������������������������������������������쥱쥲쥳쥵쥶쥷쥸쥹쥺쥻쥽쥾쥿즀즁즂즃즄즅즆즇즊즋즍즎즏������즑즒즓즔즕즖즗즚즜즞즟즠즡즢즣즤즥즦즧즨즩즪즫즬즭즮������즯즰즱즲즳즴즵즶즷즸즹즺즻즼즽즾즿짂짃짅짆짉짋짌짍짎짏짒짔짗짘짛!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[₩]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split("");
  74031. for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
  74032. D[164] = "�����������������������������������������������������������������짞짟짡짣짥짦짨짩짪짫짮짲짳짴짵짶짷짺짻짽짾짿쨁쨂쨃쨄������쨅쨆쨇쨊쨎쨏쨐쨑쨒쨓쨕쨖쨗쨙쨚쨛쨜쨝쨞쨟쨠쨡쨢쨣쨤쨥������쨦쨧쨨쨪쨫쨬쨭쨮쨯쨰쨱쨲쨳쨴쨵쨶쨷쨸쨹쨺쨻쨼쨽쨾쨿쩀쩁쩂쩃쩄쩅쩆ㄱㄲㄳㄴㄵㄶㄷㄸㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅃㅄㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡㅢㅣㅤㅥㅦㅧㅨㅩㅪㅫㅬㅭㅮㅯㅰㅱㅲㅳㅴㅵㅶㅷㅸㅹㅺㅻㅼㅽㅾㅿㆀㆁㆂㆃㆄㆅㆆㆇㆈㆉㆊㆋㆌㆍㆎ�".split("");
  74033. for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
  74034. D[165] = "�����������������������������������������������������������������쩇쩈쩉쩊쩋쩎쩏쩑쩒쩓쩕쩖쩗쩘쩙쩚쩛쩞쩢쩣쩤쩥쩦쩧쩩쩪������쩫쩬쩭쩮쩯쩰쩱쩲쩳쩴쩵쩶쩷쩸쩹쩺쩻쩼쩾쩿쪀쪁쪂쪃쪅쪆������쪇쪈쪉쪊쪋쪌쪍쪎쪏쪐쪑쪒쪓쪔쪕쪖쪗쪙쪚쪛쪜쪝쪞쪟쪠쪡쪢쪣쪤쪥쪦쪧ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ�����ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ�������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�������".split("");
  74035. for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
  74036. D[166] = "�����������������������������������������������������������������쪨쪩쪪쪫쪬쪭쪮쪯쪰쪱쪲쪳쪴쪵쪶쪷쪸쪹쪺쪻쪾쪿쫁쫂쫃쫅������쫆쫇쫈쫉쫊쫋쫎쫐쫒쫔쫕쫖쫗쫚쫛쫜쫝쫞쫟쫡쫢쫣쫤쫥쫦쫧������쫨쫩쫪쫫쫭쫮쫯쫰쫱쫲쫳쫵쫶쫷쫸쫹쫺쫻쫼쫽쫾쫿쬀쬁쬂쬃쬄쬅쬆쬇쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃╄╅╆╇╈╉╊���������������������������".split("");
  74037. for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
  74038. D[167] = "�����������������������������������������������������������������쬋쬌쬍쬎쬏쬑쬒쬓쬕쬖쬗쬙쬚쬛쬜쬝쬞쬟쬢쬣쬤쬥쬦쬧쬨쬩������쬪쬫쬬쬭쬮쬯쬰쬱쬲쬳쬴쬵쬶쬷쬸쬹쬺쬻쬼쬽쬾쬿쭀쭂쭃쭄������쭅쭆쭇쭊쭋쭍쭎쭏쭑쭒쭓쭔쭕쭖쭗쭚쭛쭜쭞쭟쭠쭡쭢쭣쭥쭦쭧쭨쭩쭪쭫쭬㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙㎚㎛㎜㎝㎞㎟㎠㎡㎢㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰㎱㎲㎳㎴㎵㎶㎷㎸㎹㎀㎁㎂㎃㎄㎺㎻㎼㎽㎾㎿㎐㎑㎒㎓㎔Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆����������������".split("");
  74039. for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
  74040. D[168] = "�����������������������������������������������������������������쭭쭮쭯쭰쭱쭲쭳쭴쭵쭶쭷쭺쭻쭼쭽쭾쭿쮀쮁쮂쮃쮄쮅쮆쮇쮈������쮉쮊쮋쮌쮍쮎쮏쮐쮑쮒쮓쮔쮕쮖쮗쮘쮙쮚쮛쮝쮞쮟쮠쮡쮢쮣������쮤쮥쮦쮧쮨쮩쮪쮫쮬쮭쮮쮯쮰쮱쮲쮳쮴쮵쮶쮷쮹쮺쮻쮼쮽쮾쮿쯀쯁쯂쯃쯄ÆÐªĦ�IJ�ĿŁØŒºÞŦŊ�㉠㉡㉢㉣㉤㉥㉦㉧㉨㉩㉪㉫㉬㉭㉮㉯㉰㉱㉲㉳㉴㉵㉶㉷㉸㉹㉺㉻ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮½⅓⅔¼¾⅛⅜⅝⅞�".split("");
  74041. for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
  74042. D[169] = "�����������������������������������������������������������������쯅쯆쯇쯈쯉쯊쯋쯌쯍쯎쯏쯐쯑쯒쯓쯕쯖쯗쯘쯙쯚쯛쯜쯝쯞쯟������쯠쯡쯢쯣쯥쯦쯨쯪쯫쯬쯭쯮쯯쯰쯱쯲쯳쯴쯵쯶쯷쯸쯹쯺쯻쯼������쯽쯾쯿찀찁찂찃찄찅찆찇찈찉찊찋찎찏찑찒찓찕찖찗찘찙찚찛찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀㈁㈂㈃㈄㈅㈆㈇㈈㈉㈊㈋㈌㈍㈎㈏㈐㈑㈒㈓㈔㈕㈖㈗㈘㈙㈚㈛⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂¹²³⁴ⁿ₁₂₃₄�".split("");
  74043. for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
  74044. D[170] = "�����������������������������������������������������������������찥찦찪찫찭찯찱찲찳찴찵찶찷찺찿챀챁챂챃챆챇챉챊챋챍챎������챏챐챑챒챓챖챚챛챜챝챞챟챡챢챣챥챧챩챪챫챬챭챮챯챱챲������챳챴챶챷챸챹챺챻챼챽챾챿첀첁첂첃첄첅첆첇첈첉첊첋첌첍첎첏첐첑첒첓ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split("");
  74045. for(j = 0; j != D[170].length; ++j) if(D[170][j].charCodeAt(0) !== 0xFFFD) { e[D[170][j]] = 43520 + j; d[43520 + j] = D[170][j];}
  74046. D[171] = "�����������������������������������������������������������������첔첕첖첗첚첛첝첞첟첡첢첣첤첥첦첧첪첮첯첰첱첲첳첶첷첹������첺첻첽첾첿쳀쳁쳂쳃쳆쳈쳊쳋쳌쳍쳎쳏쳑쳒쳓쳕쳖쳗쳘쳙쳚������쳛쳜쳝쳞쳟쳠쳡쳢쳣쳥쳦쳧쳨쳩쳪쳫쳭쳮쳯쳱쳲쳳쳴쳵쳶쳷쳸쳹쳺쳻쳼쳽ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split("");
  74047. for(j = 0; j != D[171].length; ++j) if(D[171][j].charCodeAt(0) !== 0xFFFD) { e[D[171][j]] = 43776 + j; d[43776 + j] = D[171][j];}
  74048. D[172] = "�����������������������������������������������������������������쳾쳿촀촂촃촄촅촆촇촊촋촍촎촏촑촒촓촔촕촖촗촚촜촞촟촠������촡촢촣촥촦촧촩촪촫촭촮촯촰촱촲촳촴촵촶촷촸촺촻촼촽촾������촿쵀쵁쵂쵃쵄쵅쵆쵇쵈쵉쵊쵋쵌쵍쵎쵏쵐쵑쵒쵓쵔쵕쵖쵗쵘쵙쵚쵛쵝쵞쵟АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split("");
  74049. for(j = 0; j != D[172].length; ++j) if(D[172][j].charCodeAt(0) !== 0xFFFD) { e[D[172][j]] = 44032 + j; d[44032 + j] = D[172][j];}
  74050. D[173] = "�����������������������������������������������������������������쵡쵢쵣쵥쵦쵧쵨쵩쵪쵫쵮쵰쵲쵳쵴쵵쵶쵷쵹쵺쵻쵼쵽쵾쵿춀������춁춂춃춄춅춆춇춉춊춋춌춍춎춏춐춑춒춓춖춗춙춚춛춝춞춟������춠춡춢춣춦춨춪춫춬춭춮춯춱춲춳춴춵춶춷춸춹춺춻춼춽춾춿췀췁췂췃췅�����������������������������������������������������������������������������������������������".split("");
  74051. for(j = 0; j != D[173].length; ++j) if(D[173][j].charCodeAt(0) !== 0xFFFD) { e[D[173][j]] = 44288 + j; d[44288 + j] = D[173][j];}
  74052. D[174] = "�����������������������������������������������������������������췆췇췈췉췊췋췍췎췏췑췒췓췔췕췖췗췘췙췚췛췜췝췞췟췠췡������췢췣췤췥췦췧췩췪췫췭췮췯췱췲췳췴췵췶췷췺췼췾췿츀츁츂������츃츅츆츇츉츊츋츍츎츏츐츑츒츓츕츖츗츘츚츛츜츝츞츟츢츣츥츦츧츩츪츫�����������������������������������������������������������������������������������������������".split("");
  74053. for(j = 0; j != D[174].length; ++j) if(D[174][j].charCodeAt(0) !== 0xFFFD) { e[D[174][j]] = 44544 + j; d[44544 + j] = D[174][j];}
  74054. D[175] = "�����������������������������������������������������������������츬츭츮츯츲츴츶츷츸츹츺츻츼츽츾츿칀칁칂칃칄칅칆칇칈칉������칊칋칌칍칎칏칐칑칒칓칔칕칖칗칚칛칝칞칢칣칤칥칦칧칪칬������칮칯칰칱칲칳칶칷칹칺칻칽칾칿캀캁캂캃캆캈캊캋캌캍캎캏캒캓캕캖캗캙�����������������������������������������������������������������������������������������������".split("");
  74055. for(j = 0; j != D[175].length; ++j) if(D[175][j].charCodeAt(0) !== 0xFFFD) { e[D[175][j]] = 44800 + j; d[44800 + j] = D[175][j];}
  74056. D[176] = "�����������������������������������������������������������������캚캛캜캝캞캟캢캦캧캨캩캪캫캮캯캰캱캲캳캴캵캶캷캸캹캺������캻캼캽캾캿컀컂컃컄컅컆컇컈컉컊컋컌컍컎컏컐컑컒컓컔컕������컖컗컘컙컚컛컜컝컞컟컠컡컢컣컦컧컩컪컭컮컯컰컱컲컳컶컺컻컼컽컾컿가각간갇갈갉갊감갑값갓갔강갖갗같갚갛개객갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆�".split("");
  74057. for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
  74058. D[177] = "�����������������������������������������������������������������켂켃켅켆켇켉켊켋켌켍켎켏켒켔켖켗켘켙켚켛켝켞켟켡켢켣������켥켦켧켨켩켪켫켮켲켳켴켵켶켷켹켺켻켼켽켾켿콀콁콂콃콄������콅콆콇콈콉콊콋콌콍콎콏콐콑콒콓콖콗콙콚콛콝콞콟콠콡콢콣콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸�".split("");
  74059. for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
  74060. D[178] = "�����������������������������������������������������������������콭콮콯콲콳콵콶콷콹콺콻콼콽콾콿쾁쾂쾃쾄쾆쾇쾈쾉쾊쾋쾍������쾎쾏쾐쾑쾒쾓쾔쾕쾖쾗쾘쾙쾚쾛쾜쾝쾞쾟쾠쾢쾣쾤쾥쾦쾧쾩������쾪쾫쾬쾭쾮쾯쾱쾲쾳쾴쾵쾶쾷쾸쾹쾺쾻쾼쾽쾾쾿쿀쿁쿂쿃쿅쿆쿇쿈쿉쿊쿋깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙�".split("");
  74061. for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
  74062. D[179] = "�����������������������������������������������������������������쿌쿍쿎쿏쿐쿑쿒쿓쿔쿕쿖쿗쿘쿙쿚쿛쿜쿝쿞쿟쿢쿣쿥쿦쿧쿩������쿪쿫쿬쿭쿮쿯쿲쿴쿶쿷쿸쿹쿺쿻쿽쿾쿿퀁퀂퀃퀅퀆퀇퀈퀉퀊������퀋퀌퀍퀎퀏퀐퀒퀓퀔퀕퀖퀗퀙퀚퀛퀜퀝퀞퀟퀠퀡퀢퀣퀤퀥퀦퀧퀨퀩퀪퀫퀬끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫났낭낮낯낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝�".split("");
  74063. for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
  74064. D[180] = "�����������������������������������������������������������������퀮퀯퀰퀱퀲퀳퀶퀷퀹퀺퀻퀽퀾퀿큀큁큂큃큆큈큊큋큌큍큎큏������큑큒큓큕큖큗큙큚큛큜큝큞큟큡큢큣큤큥큦큧큨큩큪큫큮큯������큱큲큳큵큶큷큸큹큺큻큾큿킀킂킃킄킅킆킇킈킉킊킋킌킍킎킏킐킑킒킓킔뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫달닭닮닯닳담답닷닸당닺닻닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥�".split("");
  74065. for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
  74066. D[181] = "�����������������������������������������������������������������킕킖킗킘킙킚킛킜킝킞킟킠킡킢킣킦킧킩킪킫킭킮킯킰킱킲������킳킶킸킺킻킼킽킾킿탂탃탅탆탇탊탋탌탍탎탏탒탖탗탘탙탚������탛탞탟탡탢탣탥탦탧탨탩탪탫탮탲탳탴탵탶탷탹탺탻탼탽탾탿턀턁턂턃턄덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸�".split("");
  74067. for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
  74068. D[182] = "�����������������������������������������������������������������턅턆턇턈턉턊턋턌턎턏턐턑턒턓턔턕턖턗턘턙턚턛턜턝턞턟������턠턡턢턣턤턥턦턧턨턩턪턫턬턭턮턯턲턳턵턶턷턹턻턼턽턾������턿텂텆텇텈텉텊텋텎텏텑텒텓텕텖텗텘텙텚텛텞텠텢텣텤텥텦텧텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗�".split("");
  74069. for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
  74070. D[183] = "�����������������������������������������������������������������텮텯텰텱텲텳텴텵텶텷텸텹텺텻텽텾텿톀톁톂톃톅톆톇톉톊������톋톌톍톎톏톐톑톒톓톔톕톖톗톘톙톚톛톜톝톞톟톢톣톥톦톧������톩톪톫톬톭톮톯톲톴톶톷톸톹톻톽톾톿퇁퇂퇃퇄퇅퇆퇇퇈퇉퇊퇋퇌퇍퇎퇏래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩�".split("");
  74071. for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
  74072. D[184] = "�����������������������������������������������������������������퇐퇑퇒퇓퇔퇕퇖퇗퇙퇚퇛퇜퇝퇞퇟퇠퇡퇢퇣퇤퇥퇦퇧퇨퇩퇪������퇫퇬퇭퇮퇯퇰퇱퇲퇳퇵퇶퇷퇹퇺퇻퇼퇽퇾퇿툀툁툂툃툄툅툆������툈툊툋툌툍툎툏툑툒툓툔툕툖툗툘툙툚툛툜툝툞툟툠툡툢툣툤툥툦툧툨툩륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많맏말맑맒맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼�".split("");
  74073. for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
  74074. D[185] = "�����������������������������������������������������������������툪툫툮툯툱툲툳툵툶툷툸툹툺툻툾퉀퉂퉃퉄퉅퉆퉇퉉퉊퉋퉌������퉍퉎퉏퉐퉑퉒퉓퉔퉕퉖퉗퉘퉙퉚퉛퉝퉞퉟퉠퉡퉢퉣퉥퉦퉧퉨������퉩퉪퉫퉬퉭퉮퉯퉰퉱퉲퉳퉴퉵퉶퉷퉸퉹퉺퉻퉼퉽퉾퉿튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바박밖밗반받발밝밞밟밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗�".split("");
  74075. for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
  74076. D[186] = "�����������������������������������������������������������������튍튎튏튒튓튔튖튗튘튙튚튛튝튞튟튡튢튣튥튦튧튨튩튪튫튭������튮튯튰튲튳튴튵튶튷튺튻튽튾틁틃틄틅틆틇틊틌틍틎틏틐틑������틒틓틕틖틗틙틚틛틝틞틟틠틡틢틣틦틧틨틩틪틫틬틭틮틯틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤�".split("");
  74077. for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
  74078. D[187] = "�����������������������������������������������������������������틻틼틽틾틿팂팄팆팇팈팉팊팋팏팑팒팓팕팗팘팙팚팛팞팢팣������팤팦팧팪팫팭팮팯팱팲팳팴팵팶팷팺팾팿퍀퍁퍂퍃퍆퍇퍈퍉������퍊퍋퍌퍍퍎퍏퍐퍑퍒퍓퍔퍕퍖퍗퍘퍙퍚퍛퍜퍝퍞퍟퍠퍡퍢퍣퍤퍥퍦퍧퍨퍩빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤�".split("");
  74079. for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
  74080. D[188] = "�����������������������������������������������������������������퍪퍫퍬퍭퍮퍯퍰퍱퍲퍳퍴퍵퍶퍷퍸퍹퍺퍻퍾퍿펁펂펃펅펆펇������펈펉펊펋펎펒펓펔펕펖펗펚펛펝펞펟펡펢펣펤펥펦펧펪펬펮������펯펰펱펲펳펵펶펷펹펺펻펽펾펿폀폁폂폃폆폇폊폋폌폍폎폏폑폒폓폔폕폖샥샨샬샴샵샷샹섀섄섈섐섕서석섞섟선섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭�".split("");
  74081. for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
  74082. D[189] = "�����������������������������������������������������������������폗폙폚폛폜폝폞폟폠폢폤폥폦폧폨폩폪폫폮폯폱폲폳폵폶폷������폸폹폺폻폾퐀퐂퐃퐄퐅퐆퐇퐉퐊퐋퐌퐍퐎퐏퐐퐑퐒퐓퐔퐕퐖������퐗퐘퐙퐚퐛퐜퐞퐟퐠퐡퐢퐣퐤퐥퐦퐧퐨퐩퐪퐫퐬퐭퐮퐯퐰퐱퐲퐳퐴퐵퐶퐷숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰�".split("");
  74083. for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
  74084. D[190] = "�����������������������������������������������������������������퐸퐹퐺퐻퐼퐽퐾퐿푁푂푃푅푆푇푈푉푊푋푌푍푎푏푐푑푒푓������푔푕푖푗푘푙푚푛푝푞푟푡푢푣푥푦푧푨푩푪푫푬푮푰푱푲������푳푴푵푶푷푺푻푽푾풁풃풄풅풆풇풊풌풎풏풐풑풒풓풕풖풗풘풙풚풛풜풝쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄업없엇었엉엊엌엎�".split("");
  74085. for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
  74086. D[191] = "�����������������������������������������������������������������풞풟풠풡풢풣풤풥풦풧풨풪풫풬풭풮풯풰풱풲풳풴풵풶풷풸������풹풺풻풼풽풾풿퓀퓁퓂퓃퓄퓅퓆퓇퓈퓉퓊퓋퓍퓎퓏퓑퓒퓓퓕������퓖퓗퓘퓙퓚퓛퓝퓞퓠퓡퓢퓣퓤퓥퓦퓧퓩퓪퓫퓭퓮퓯퓱퓲퓳퓴퓵퓶퓷퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염엽엾엿였영옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨�".split("");
  74087. for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
  74088. D[192] = "�����������������������������������������������������������������퓾퓿픀픁픂픃픅픆픇픉픊픋픍픎픏픐픑픒픓픖픘픙픚픛픜픝������픞픟픠픡픢픣픤픥픦픧픨픩픪픫픬픭픮픯픰픱픲픳픴픵픶픷������픸픹픺픻픾픿핁핂핃핅핆핇핈핉핊핋핎핐핒핓핔핕핖핗핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응읒읓읔읕읖읗의읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊�".split("");
  74089. for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
  74090. D[193] = "�����������������������������������������������������������������핤핦핧핪핬핮핯핰핱핲핳핶핷핹핺핻핽핾핿햀햁햂햃햆햊햋������햌햍햎햏햑햒햓햔햕햖햗햘햙햚햛햜햝햞햟햠햡햢햣햤햦햧������햨햩햪햫햬햭햮햯햰햱햲햳햴햵햶햷햸햹햺햻햼햽햾햿헀헁헂헃헄헅헆헇점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓�".split("");
  74091. for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
  74092. D[194] = "�����������������������������������������������������������������헊헋헍헎헏헑헓헔헕헖헗헚헜헞헟헠헡헢헣헦헧헩헪헫헭헮������헯헰헱헲헳헶헸헺헻헼헽헾헿혂혃혅혆혇혉혊혋혌혍혎혏혒������혖혗혘혙혚혛혝혞혟혡혢혣혥혦혧혨혩혪혫혬혮혯혰혱혲혳혴혵혶혷혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻�".split("");
  74093. for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
  74094. D[195] = "�����������������������������������������������������������������혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝홞홟홠홡������홢홣홤홥홦홨홪홫홬홭홮홯홲홳홵홶홷홸홹홺홻홼홽홾홿횀������횁횂횄횆횇횈횉횊횋횎횏횑횒횓횕횖횗횘횙횚횛횜횞횠횢횣횤횥횦횧횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층�".split("");
  74095. for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
  74096. D[196] = "�����������������������������������������������������������������횫횭횮횯횱횲횳횴횵횶횷횸횺횼횽횾횿훀훁훂훃훆훇훉훊훋������훍훎훏훐훒훓훕훖훘훚훛훜훝훞훟훡훢훣훥훦훧훩훪훫훬훭������훮훯훱훲훳훴훶훷훸훹훺훻훾훿휁휂휃휅휆휇휈휉휊휋휌휍휎휏휐휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼�".split("");
  74097. for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
  74098. D[197] = "�����������������������������������������������������������������휕휖휗휚휛휝휞휟휡휢휣휤휥휦휧휪휬휮휯휰휱휲휳휶휷휹������휺휻휽휾휿흀흁흂흃흅흆흈흊흋흌흍흎흏흒흓흕흚흛흜흝흞������흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵흶흷흸흹흺흻흾흿힀힂힃힄힅힆힇힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜�".split("");
  74099. for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
  74100. D[198] = "�����������������������������������������������������������������힍힎힏힑힒힓힔힕힖힗힚힜힞힟힠힡힢힣������������������������������������������������������������������������������퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁�".split("");
  74101. for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
  74102. D[199] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠�".split("");
  74103. for(j = 0; j != D[199].length; ++j) if(D[199][j].charCodeAt(0) !== 0xFFFD) { e[D[199][j]] = 50944 + j; d[50944 + j] = D[199][j];}
  74104. D[200] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝�".split("");
  74105. for(j = 0; j != D[200].length; ++j) if(D[200][j].charCodeAt(0) !== 0xFFFD) { e[D[200][j]] = 51200 + j; d[51200 + j] = D[200][j];}
  74106. D[202] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕�".split("");
  74107. for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
  74108. D[203] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢�".split("");
  74109. for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
  74110. D[204] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械�".split("");
  74111. for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
  74112. D[205] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜�".split("");
  74113. for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
  74114. D[206] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾�".split("");
  74115. for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
  74116. D[207] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴�".split("");
  74117. for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
  74118. D[208] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣�".split("");
  74119. for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
  74120. D[209] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩羅蘿螺裸邏那樂洛烙珞落諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉�".split("");
  74121. for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
  74122. D[210] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������納臘蠟衲囊娘廊朗浪狼郎乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧老蘆虜路露駑魯鷺碌祿綠菉錄鹿論壟弄濃籠聾膿農惱牢磊腦賂雷尿壘屢樓淚漏累縷陋嫩訥杻紐勒肋凜凌稜綾能菱陵尼泥匿溺多茶�".split("");
  74123. for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
  74124. D[211] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃�".split("");
  74125. for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
  74126. D[212] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅�".split("");
  74127. for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
  74128. D[213] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣�".split("");
  74129. for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
  74130. D[214] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼�".split("");
  74131. for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
  74132. D[215] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬�".split("");
  74133. for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
  74134. D[216] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅�".split("");
  74135. for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
  74136. D[217] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文�".split("");
  74137. for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
  74138. D[218] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑�".split("");
  74139. for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
  74140. D[219] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖�".split("");
  74141. for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
  74142. D[220] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦�".split("");
  74143. for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
  74144. D[221] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥�".split("");
  74145. for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
  74146. D[222] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索�".split("");
  74147. for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
  74148. D[223] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署�".split("");
  74149. for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
  74150. D[224] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬�".split("");
  74151. for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
  74152. D[225] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁�".split("");
  74153. for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
  74154. D[226] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧�".split("");
  74155. for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
  74156. D[227] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁�".split("");
  74157. for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
  74158. D[228] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額�".split("");
  74159. for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
  74160. D[229] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬�".split("");
  74161. for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
  74162. D[230] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒�".split("");
  74163. for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
  74164. D[231] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳�".split("");
  74165. for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
  74166. D[232] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療�".split("");
  74167. for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
  74168. D[233] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓�".split("");
  74169. for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
  74170. D[234] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜�".split("");
  74171. for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
  74172. D[235] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼�".split("");
  74173. for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
  74174. D[236] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄�".split("");
  74175. for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
  74176. D[237] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長�".split("");
  74177. for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
  74178. D[238] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱�".split("");
  74179. for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
  74180. D[239] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖�".split("");
  74181. for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
  74182. D[240] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫�".split("");
  74183. for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
  74184. D[241] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只�".split("");
  74185. for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
  74186. D[242] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯�".split("");
  74187. for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
  74188. D[243] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策�".split("");
  74189. for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
  74190. D[244] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢�".split("");
  74191. for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
  74192. D[245] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃�".split("");
  74193. for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
  74194. D[246] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託�".split("");
  74195. for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
  74196. D[247] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑�".split("");
  74197. for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
  74198. D[248] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃�".split("");
  74199. for(j = 0; j != D[248].length; ++j) if(D[248][j].charCodeAt(0) !== 0xFFFD) { e[D[248][j]] = 63488 + j; d[63488 + j] = D[248][j];}
  74200. D[249] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航�".split("");
  74201. for(j = 0; j != D[249].length; ++j) if(D[249][j].charCodeAt(0) !== 0xFFFD) { e[D[249][j]] = 63744 + j; d[63744 + j] = D[249][j];}
  74202. D[250] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型�".split("");
  74203. for(j = 0; j != D[250].length; ++j) if(D[250][j].charCodeAt(0) !== 0xFFFD) { e[D[250][j]] = 64000 + j; d[64000 + j] = D[250][j];}
  74204. D[251] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵�".split("");
  74205. for(j = 0; j != D[251].length; ++j) if(D[251][j].charCodeAt(0) !== 0xFFFD) { e[D[251][j]] = 64256 + j; d[64256 + j] = D[251][j];}
  74206. D[252] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆�".split("");
  74207. for(j = 0; j != D[252].length; ++j) if(D[252][j].charCodeAt(0) !== 0xFFFD) { e[D[252][j]] = 64512 + j; d[64512 + j] = D[252][j];}
  74208. D[253] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰�".split("");
  74209. for(j = 0; j != D[253].length; ++j) if(D[253][j].charCodeAt(0) !== 0xFFFD) { e[D[253][j]] = 64768 + j; d[64768 + j] = D[253][j];}
  74210. return {"enc": e, "dec": d }; })();
  74211. cptable[950] = (function(){ var d = [], e = {}, D = [], j;
  74212. D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������".split("");
  74213. for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
  74214. D[161] = "���������������������������������������������������������������� ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚����������������������������������﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢﹣﹤﹥﹦~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/�".split("");
  74215. for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
  74216. D[162] = "����������������������������������������������������������������\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁▂▃▄▅▆▇█▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭����������������������������������╮╰╯═╞╪╡◢◣◥◤╱╲╳0123456789ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ〡〢〣〤〥〦〧〨〩十卄卅ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv�".split("");
  74217. for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
  74218. D[163] = "����������������������������������������������������������������wxyzΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψωㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏ����������������������������������ㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ˙ˉˊˇˋ���������������������������������€������������������������������".split("");
  74219. for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
  74220. D[164] = "����������������������������������������������������������������一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才����������������������������������丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙�".split("");
  74221. for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
  74222. D[165] = "����������������������������������������������������������������世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外����������������������������������央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全�".split("");
  74223. for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
  74224. D[166] = "����������������������������������������������������������������共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年����������������������������������式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣�".split("");
  74225. for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
  74226. D[167] = "����������������������������������������������������������������作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍����������������������������������均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠�".split("");
  74227. for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
  74228. D[168] = "����������������������������������������������������������������杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒����������������������������������芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵�".split("");
  74229. for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
  74230. D[169] = "����������������������������������������������������������������咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居����������������������������������屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊�".split("");
  74231. for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
  74232. D[170] = "����������������������������������������������������������������昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠����������������������������������炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附�".split("");
  74233. for(j = 0; j != D[170].length; ++j) if(D[170][j].charCodeAt(0) !== 0xFFFD) { e[D[170][j]] = 43520 + j; d[43520 + j] = D[170][j];}
  74234. D[171] = "����������������������������������������������������������������陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品����������������������������������哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷�".split("");
  74235. for(j = 0; j != D[171].length; ++j) if(D[171][j].charCodeAt(0) !== 0xFFFD) { e[D[171][j]] = 43776 + j; d[43776 + j] = D[171][j];}
  74236. D[172] = "����������������������������������������������������������������拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗����������������������������������活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄�".split("");
  74237. for(j = 0; j != D[172].length; ++j) if(D[172][j].charCodeAt(0) !== 0xFFFD) { e[D[172][j]] = 44032 + j; d[44032 + j] = D[172][j];}
  74238. D[173] = "����������������������������������������������������������������耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥����������������������������������迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪�".split("");
  74239. for(j = 0; j != D[173].length; ++j) if(D[173][j].charCodeAt(0) !== 0xFFFD) { e[D[173][j]] = 44288 + j; d[44288 + j] = D[173][j];}
  74240. D[174] = "����������������������������������������������������������������哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙����������������������������������恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓�".split("");
  74241. for(j = 0; j != D[174].length; ++j) if(D[174][j].charCodeAt(0) !== 0xFFFD) { e[D[174][j]] = 44544 + j; d[44544 + j] = D[174][j];}
  74242. D[175] = "����������������������������������������������������������������浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷����������������������������������砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃�".split("");
  74243. for(j = 0; j != D[175].length; ++j) if(D[175][j].charCodeAt(0) !== 0xFFFD) { e[D[175][j]] = 44800 + j; d[44800 + j] = D[175][j];}
  74244. D[176] = "����������������������������������������������������������������虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡����������������������������������陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀�".split("");
  74245. for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
  74246. D[177] = "����������������������������������������������������������������娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽����������������������������������情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺�".split("");
  74247. for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
  74248. D[178] = "����������������������������������������������������������������毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶����������������������������������瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼�".split("");
  74249. for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
  74250. D[179] = "����������������������������������������������������������������莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途����������������������������������部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠�".split("");
  74251. for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
  74252. D[180] = "����������������������������������������������������������������婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍����������������������������������插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋�".split("");
  74253. for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
  74254. D[181] = "����������������������������������������������������������������溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘����������������������������������窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁�".split("");
  74255. for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
  74256. D[182] = "����������������������������������������������������������������詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑����������������������������������間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼�".split("");
  74257. for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
  74258. D[183] = "����������������������������������������������������������������媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業����������������������������������楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督�".split("");
  74259. for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
  74260. D[184] = "����������������������������������������������������������������睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫����������������������������������腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊�".split("");
  74261. for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
  74262. D[185] = "����������������������������������������������������������������辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴����������������������������������飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇�".split("");
  74263. for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
  74264. D[186] = "����������������������������������������������������������������愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢����������������������������������滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬�".split("");
  74265. for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
  74266. D[187] = "����������������������������������������������������������������罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤����������������������������������說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜�".split("");
  74267. for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
  74268. D[188] = "����������������������������������������������������������������劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂����������������������������������慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃�".split("");
  74269. for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
  74270. D[189] = "����������������������������������������������������������������瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯����������������������������������翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞�".split("");
  74271. for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
  74272. D[190] = "����������������������������������������������������������������輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉����������������������������������鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡�".split("");
  74273. for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
  74274. D[191] = "����������������������������������������������������������������濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊����������������������������������縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚�".split("");
  74275. for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
  74276. D[192] = "����������������������������������������������������������������錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇����������������������������������嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬�".split("");
  74277. for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
  74278. D[193] = "����������������������������������������������������������������瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪����������������������������������薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁�".split("");
  74279. for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
  74280. D[194] = "����������������������������������������������������������������駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘����������������������������������癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦�".split("");
  74281. for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
  74282. D[195] = "����������������������������������������������������������������鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸����������������������������������獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類�".split("");
  74283. for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
  74284. D[196] = "����������������������������������������������������������������願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼����������������������������������纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴�".split("");
  74285. for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
  74286. D[197] = "����������������������������������������������������������������護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬����������������������������������禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒�".split("");
  74287. for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
  74288. D[198] = "����������������������������������������������������������������讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲���������������������������������������������������������������������������������������������������������������������������������".split("");
  74289. for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
  74290. D[201] = "����������������������������������������������������������������乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕����������������������������������氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋�".split("");
  74291. for(j = 0; j != D[201].length; ++j) if(D[201][j].charCodeAt(0) !== 0xFFFD) { e[D[201][j]] = 51456 + j; d[51456 + j] = D[201][j];}
  74292. D[202] = "����������������������������������������������������������������汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘����������������������������������吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇�".split("");
  74293. for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
  74294. D[203] = "����������������������������������������������������������������杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓����������������������������������芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢�".split("");
  74295. for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
  74296. D[204] = "����������������������������������������������������������������坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋����������������������������������怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲�".split("");
  74297. for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
  74298. D[205] = "����������������������������������������������������������������泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺����������������������������������矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏�".split("");
  74299. for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
  74300. D[206] = "����������������������������������������������������������������哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛����������������������������������峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺�".split("");
  74301. for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
  74302. D[207] = "����������������������������������������������������������������柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂����������������������������������洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀�".split("");
  74303. for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
  74304. D[208] = "����������������������������������������������������������������穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪����������������������������������苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱�".split("");
  74305. for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
  74306. D[209] = "����������������������������������������������������������������唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧����������������������������������恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤�".split("");
  74307. for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
  74308. D[210] = "����������������������������������������������������������������毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸����������������������������������牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐�".split("");
  74309. for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
  74310. D[211] = "����������������������������������������������������������������笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢����������������������������������荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐�".split("");
  74311. for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
  74312. D[212] = "����������������������������������������������������������������酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅����������������������������������唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏�".split("");
  74313. for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
  74314. D[213] = "����������������������������������������������������������������崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟����������������������������������捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉�".split("");
  74315. for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
  74316. D[214] = "����������������������������������������������������������������淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏����������������������������������痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟�".split("");
  74317. for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
  74318. D[215] = "����������������������������������������������������������������耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷����������������������������������蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪�".split("");
  74319. for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
  74320. D[216] = "����������������������������������������������������������������釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷����������������������������������堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔�".split("");
  74321. for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
  74322. D[217] = "����������������������������������������������������������������惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒����������������������������������晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞�".split("");
  74323. for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
  74324. D[218] = "����������������������������������������������������������������湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖����������������������������������琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥�".split("");
  74325. for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
  74326. D[219] = "����������������������������������������������������������������罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳����������������������������������菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺�".split("");
  74327. for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
  74328. D[220] = "����������������������������������������������������������������軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈����������������������������������隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆�".split("");
  74329. for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
  74330. D[221] = "����������������������������������������������������������������媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤����������������������������������搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼�".split("");
  74331. for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
  74332. D[222] = "����������������������������������������������������������������毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓����������������������������������煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓�".split("");
  74333. for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
  74334. D[223] = "����������������������������������������������������������������稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯����������������������������������腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤�".split("");
  74335. for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
  74336. D[224] = "����������������������������������������������������������������觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿����������������������������������遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠�".split("");
  74337. for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
  74338. D[225] = "����������������������������������������������������������������凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠����������������������������������寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉�".split("");
  74339. for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
  74340. D[226] = "����������������������������������������������������������������榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊����������������������������������漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓�".split("");
  74341. for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
  74342. D[227] = "����������������������������������������������������������������禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞����������������������������������耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻�".split("");
  74343. for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
  74344. D[228] = "����������������������������������������������������������������裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍����������������������������������銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘�".split("");
  74345. for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
  74346. D[229] = "����������������������������������������������������������������噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉����������������������������������憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒�".split("");
  74347. for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
  74348. D[230] = "����������������������������������������������������������������澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙����������������������������������獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟�".split("");
  74349. for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
  74350. D[231] = "����������������������������������������������������������������膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢����������������������������������蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧�".split("");
  74351. for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
  74352. D[232] = "����������������������������������������������������������������踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓����������������������������������銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮�".split("");
  74353. for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
  74354. D[233] = "����������������������������������������������������������������噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺����������������������������������憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸�".split("");
  74355. for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
  74356. D[234] = "����������������������������������������������������������������澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙����������������������������������瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘�".split("");
  74357. for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
  74358. D[235] = "����������������������������������������������������������������蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠����������������������������������諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌�".split("");
  74359. for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
  74360. D[236] = "����������������������������������������������������������������錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕����������������������������������魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎�".split("");
  74361. for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
  74362. D[237] = "����������������������������������������������������������������檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶����������������������������������瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞�".split("");
  74363. for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
  74364. D[238] = "����������������������������������������������������������������蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞����������������������������������謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜�".split("");
  74365. for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
  74366. D[239] = "����������������������������������������������������������������鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰����������������������������������鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶�".split("");
  74367. for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
  74368. D[240] = "����������������������������������������������������������������璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒����������������������������������臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧�".split("");
  74369. for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
  74370. D[241] = "����������������������������������������������������������������蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪����������������������������������鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰�".split("");
  74371. for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
  74372. D[242] = "����������������������������������������������������������������徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛����������������������������������礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕�".split("");
  74373. for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
  74374. D[243] = "����������������������������������������������������������������譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦����������������������������������鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲�".split("");
  74375. for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
  74376. D[244] = "����������������������������������������������������������������嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩����������������������������������禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿�".split("");
  74377. for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
  74378. D[245] = "����������������������������������������������������������������鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛����������������������������������鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥�".split("");
  74379. for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
  74380. D[246] = "����������������������������������������������������������������蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺����������������������������������騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚�".split("");
  74381. for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
  74382. D[247] = "����������������������������������������������������������������糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊����������������������������������驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾�".split("");
  74383. for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
  74384. D[248] = "����������������������������������������������������������������讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏����������������������������������齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚�".split("");
  74385. for(j = 0; j != D[248].length; ++j) if(D[248][j].charCodeAt(0) !== 0xFFFD) { e[D[248][j]] = 63488 + j; d[63488 + j] = D[248][j];}
  74386. D[249] = "����������������������������������������������������������������纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊����������������������������������龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓�".split("");
  74387. for(j = 0; j != D[249].length; ++j) if(D[249][j].charCodeAt(0) !== 0xFFFD) { e[D[249][j]] = 63744 + j; d[63744 + j] = D[249][j];}
  74388. return {"enc": e, "dec": d }; })();
  74389. cptable[1250] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74390. cptable[1251] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74391. cptable[1252] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74392. cptable[1253] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74393. cptable[1254] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74394. cptable[1255] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ�ֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74395. cptable[1256] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74396. cptable[1257] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74397. cptable[1258] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74398. cptable[10000] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74399. cptable[10006] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74400. cptable[10007] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74401. cptable[10008] = (function(){ var d = [], e = {}, D = [], j;
  74402. D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€���������������������������������������������������������������������������������������".split("");
  74403. for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
  74404. D[161] = "����������������������������������������������������������������������������������������������������������������������������������������������������������������� 、。・ˉˇ¨〃々―~�…‘’“”〔〕〈〉《》「」『』〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓�".split("");
  74405. for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
  74406. D[162] = "���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇①②③④⑤⑥⑦⑧⑨⑩��㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩��ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ���".split("");
  74407. for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
  74408. D[163] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������!"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split("");
  74409. for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
  74410. D[164] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split("");
  74411. for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
  74412. D[165] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split("");
  74413. for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
  74414. D[166] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω���������������������������������������".split("");
  74415. for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
  74416. D[167] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split("");
  74417. for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
  74418. D[168] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüê����������ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ����������������������".split("");
  74419. for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
  74420. D[169] = "��������������������������������������������������������������������������������������������������������������������������������������������������������������������─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋����������������".split("");
  74421. for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
  74422. D[176] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥�".split("");
  74423. for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
  74424. D[177] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳�".split("");
  74425. for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
  74426. D[178] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖�".split("");
  74427. for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
  74428. D[179] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚�".split("");
  74429. for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
  74430. D[180] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮�".split("");
  74431. for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
  74432. D[181] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠�".split("");
  74433. for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
  74434. D[182] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二�".split("");
  74435. for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
  74436. D[183] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服�".split("");
  74437. for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
  74438. D[184] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹�".split("");
  74439. for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
  74440. D[185] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈�".split("");
  74441. for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
  74442. D[186] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖�".split("");
  74443. for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
  74444. D[187] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕�".split("");
  74445. for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
  74446. D[188] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件�".split("");
  74447. for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
  74448. D[189] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸�".split("");
  74449. for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
  74450. D[190] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻�".split("");
  74451. for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
  74452. D[191] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀�".split("");
  74453. for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
  74454. D[192] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐�".split("");
  74455. for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
  74456. D[193] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿�".split("");
  74457. for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
  74458. D[194] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫�".split("");
  74459. for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
  74460. D[195] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸�".split("");
  74461. for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
  74462. D[196] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁�".split("");
  74463. for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
  74464. D[197] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗�".split("");
  74465. for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
  74466. D[198] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐�".split("");
  74467. for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
  74468. D[199] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠�".split("");
  74469. for(j = 0; j != D[199].length; ++j) if(D[199][j].charCodeAt(0) !== 0xFFFD) { e[D[199][j]] = 50944 + j; d[50944 + j] = D[199][j];}
  74470. D[200] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁�".split("");
  74471. for(j = 0; j != D[200].length; ++j) if(D[200][j].charCodeAt(0) !== 0xFFFD) { e[D[200][j]] = 51200 + j; d[51200 + j] = D[200][j];}
  74472. D[201] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳�".split("");
  74473. for(j = 0; j != D[201].length; ++j) if(D[201][j].charCodeAt(0) !== 0xFFFD) { e[D[201][j]] = 51456 + j; d[51456 + j] = D[201][j];}
  74474. D[202] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱�".split("");
  74475. for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
  74476. D[203] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔�".split("");
  74477. for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
  74478. D[204] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃�".split("");
  74479. for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
  74480. D[205] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威�".split("");
  74481. for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
  74482. D[206] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺�".split("");
  74483. for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
  74484. D[207] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓�".split("");
  74485. for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
  74486. D[208] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄�".split("");
  74487. for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
  74488. D[209] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶�".split("");
  74489. for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
  74490. D[210] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐�".split("");
  74491. for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
  74492. D[211] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉�".split("");
  74493. for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
  74494. D[212] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧�".split("");
  74495. for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
  74496. D[213] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政�".split("");
  74497. for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
  74498. D[214] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑�".split("");
  74499. for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
  74500. D[215] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座������".split("");
  74501. for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
  74502. D[216] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝�".split("");
  74503. for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
  74504. D[217] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼�".split("");
  74505. for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
  74506. D[218] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺�".split("");
  74507. for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
  74508. D[219] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝�".split("");
  74509. for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
  74510. D[220] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥�".split("");
  74511. for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
  74512. D[221] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺�".split("");
  74513. for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
  74514. D[222] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖�".split("");
  74515. for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
  74516. D[223] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼�".split("");
  74517. for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
  74518. D[224] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼�".split("");
  74519. for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
  74520. D[225] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺�".split("");
  74521. for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
  74522. D[226] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧饨饩饪饫饬饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂�".split("");
  74523. for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
  74524. D[227] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾�".split("");
  74525. for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
  74526. D[228] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑�".split("");
  74527. for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
  74528. D[229] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣�".split("");
  74529. for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
  74530. D[230] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩�".split("");
  74531. for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
  74532. D[231] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡缢缣缤缥缦缧缪缫缬缭缯缰缱缲缳缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬�".split("");
  74533. for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
  74534. D[232] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹�".split("");
  74535. for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
  74536. D[233] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋�".split("");
  74537. for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
  74538. D[234] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰�".split("");
  74539. for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
  74540. D[235] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻�".split("");
  74541. for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
  74542. D[236] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐�".split("");
  74543. for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
  74544. D[237] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨�".split("");
  74545. for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
  74546. D[238] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶钷钸钹钺钼钽钿铄铈铉铊铋铌铍铎铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪�".split("");
  74547. for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
  74548. D[239] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒锓锔锕锖锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤镥镦镧镨镩镪镫镬镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔�".split("");
  74549. for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
  74550. D[240] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨鸩鸪鸫鸬鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦鹧鹨鹩鹪鹫鹬鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙�".split("");
  74551. for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
  74552. D[241] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃�".split("");
  74553. for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
  74554. D[242] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒�".split("");
  74555. for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
  74556. D[243] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋�".split("");
  74557. for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
  74558. D[244] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤�".split("");
  74559. for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
  74560. D[245] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜�".split("");
  74561. for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
  74562. D[246] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅龆龇龈龉龊龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞鲟鲠鲡鲢鲣鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲶鲷鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋�".split("");
  74563. for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
  74564. D[247] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鳌鳍鳎鳏鳐鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄�".split("");
  74565. for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
  74566. return {"enc": e, "dec": d }; })();
  74567. cptable[10029] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74568. cptable[10079] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74569. cptable[10081] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
  74570. // eslint-disable-next-line no-undef
  74571. if ( true && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;
  74572. /* cputils.js (C) 2013-present SheetJS -- http://sheetjs.com */
  74573. /* vim: set ft=javascript: */
  74574. /*jshint newcap: false */
  74575. (function(root, factory) {
  74576. /*jshint ignore:start */
  74577. /*eslint-disable */
  74578. "use strict";
  74579. if(typeof cptable === "undefined") {
  74580. if(true){
  74581. var cpt = cptable;
  74582. if ( true && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = factory(cpt);
  74583. else root.cptable = factory(cpt);
  74584. } else {}
  74585. } else cptable = factory(cptable);
  74586. /*eslint-enable */
  74587. /*jshint ignore:end */
  74588. }(this, function(cpt){
  74589. "use strict";
  74590. /*global module, Buffer */
  74591. var magic = {
  74592. "1200":"utf16le",
  74593. "1201":"utf16be",
  74594. "12000":"utf32le",
  74595. "12001":"utf32be",
  74596. "16969":"utf64le",
  74597. "20127":"ascii",
  74598. "65000":"utf7",
  74599. "65001":"utf8"
  74600. };
  74601. var sbcs_cache = [874,1250,1251,1252,1253,1254,1255,1256,10000];
  74602. var dbcs_cache = [932,936,949,950];
  74603. var magic_cache = [65001];
  74604. var magic_decode = {};
  74605. var magic_encode = {};
  74606. var cpdcache = {};
  74607. var cpecache = {};
  74608. var sfcc = function sfcc(x) { return String.fromCharCode(x); };
  74609. var cca = function cca(x) { return x.charCodeAt(0); };
  74610. var has_buf = (typeof Buffer !== 'undefined');
  74611. var Buffer_from = function(){};
  74612. if(has_buf) {
  74613. var nbfs = !Buffer.from;
  74614. if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
  74615. Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
  74616. // $FlowIgnore
  74617. if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
  74618. var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
  74619. var make_EE = function make_EE(E){
  74620. var EE = Buffer.allocUnsafe(65536);
  74621. for(var i = 0; i < 65536;++i) EE[i] = 0;
  74622. var keys = Object.keys(E), len = keys.length;
  74623. for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
  74624. if(!(e = keys[ee])) continue;
  74625. EE[e.charCodeAt(0)] = E[e];
  74626. }
  74627. return EE;
  74628. };
  74629. var sbcs_encode = function make_sbcs_encode(cp) {
  74630. var EE = make_EE(cpt[cp].enc);
  74631. return function sbcs_e(data, ofmt) {
  74632. var len = data.length;
  74633. var out, i=0, j=0, D=0, w=0;
  74634. if(typeof data === 'string') {
  74635. out = Buffer.allocUnsafe(len);
  74636. for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
  74637. } else if(Buffer.isBuffer(data)) {
  74638. out = Buffer.allocUnsafe(2*len);
  74639. j = 0;
  74640. for(i = 0; i < len; ++i) {
  74641. D = data[i];
  74642. if(D < 128) out[j++] = EE[D];
  74643. else if(D < 224) { out[j++] = EE[((D&31)<<6)+(data[i+1]&63)]; ++i; }
  74644. else if(D < 240) { out[j++] = EE[((D&15)<<12)+((data[i+1]&63)<<6)+(data[i+2]&63)]; i+=2; }
  74645. else {
  74646. w = ((D&7)<<18)+((data[i+1]&63)<<12)+((data[i+2]&63)<<6)+(data[i+3]&63); i+=3;
  74647. if(w < 65536) out[j++] = EE[w];
  74648. else { w -= 65536; out[j++] = EE[0xD800 + ((w>>10)&1023)]; out[j++] = EE[0xDC00 + (w&1023)]; }
  74649. }
  74650. }
  74651. out = out.slice(0,j);
  74652. } else {
  74653. out = Buffer.allocUnsafe(len);
  74654. for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
  74655. }
  74656. if(!ofmt || ofmt === 'buf') return out;
  74657. if(ofmt !== 'arr') return out.toString('binary');
  74658. return [].slice.call(out);
  74659. };
  74660. };
  74661. var sbcs_decode = function make_sbcs_decode(cp) {
  74662. var D = cpt[cp].dec;
  74663. var DD = Buffer.allocUnsafe(131072), d=0, c="";
  74664. for(d=0;d<D.length;++d) {
  74665. if(!(c=D[d])) continue;
  74666. var w = c.charCodeAt(0);
  74667. DD[2*d] = w&255; DD[2*d+1] = w>>8;
  74668. }
  74669. return function sbcs_d(data) {
  74670. var len = data.length, i=0, j=0;
  74671. if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
  74672. if(Buffer.isBuffer(data)) {
  74673. for(i = 0; i < len; i++) {
  74674. j = 2*data[i];
  74675. mdb[2*i] = DD[j]; mdb[2*i+1] = DD[j+1];
  74676. }
  74677. } else if(typeof data === "string") {
  74678. for(i = 0; i < len; i++) {
  74679. j = 2*data.charCodeAt(i);
  74680. mdb[2*i] = DD[j]; mdb[2*i+1] = DD[j+1];
  74681. }
  74682. } else {
  74683. for(i = 0; i < len; i++) {
  74684. j = 2*data[i];
  74685. mdb[2*i] = DD[j]; mdb[2*i+1] = DD[j+1];
  74686. }
  74687. }
  74688. return mdb.slice(0, 2 * len).toString('ucs2');
  74689. };
  74690. };
  74691. var dbcs_encode = function make_dbcs_encode(cp) {
  74692. var E = cpt[cp].enc;
  74693. var EE = Buffer.allocUnsafe(131072);
  74694. for(var i = 0; i < 131072; ++i) EE[i] = 0;
  74695. var keys = Object.keys(E);
  74696. for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
  74697. if(!(e = keys[ee])) continue;
  74698. var f = e.charCodeAt(0);
  74699. EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
  74700. }
  74701. return function dbcs_e(data, ofmt) {
  74702. var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
  74703. if(typeof data === 'string') {
  74704. for(i = k = 0; i < len; ++i) {
  74705. j = data.charCodeAt(i)*2;
  74706. out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
  74707. }
  74708. out = out.slice(0,k);
  74709. } else if(Buffer.isBuffer(data)) {
  74710. for(i = k = 0; i < len; ++i) {
  74711. D = data[i];
  74712. if(D < 128) j = D;
  74713. else if(D < 224) { j = ((D&31)<<6)+(data[i+1]&63); ++i; }
  74714. else if(D < 240) { j = ((D&15)<<12)+((data[i+1]&63)<<6)+(data[i+2]&63); i+=2; }
  74715. else { j = ((D&7)<<18)+((data[i+1]&63)<<12)+((data[i+2]&63)<<6)+(data[i+3]&63); i+=3; }
  74716. if(j<65536) { j*=2; out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j]; }
  74717. else { jj = j-65536;
  74718. j=2*(0xD800 + ((jj>>10)&1023)); out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
  74719. j=2*(0xDC00 + (jj&1023)); out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
  74720. }
  74721. }
  74722. out = out.slice(0,k);
  74723. } else {
  74724. for(i = k = 0; i < len; i++) {
  74725. j = data[i].charCodeAt(0)*2;
  74726. out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
  74727. }
  74728. }
  74729. if(!ofmt || ofmt === 'buf') return out;
  74730. if(ofmt !== 'arr') return out.toString('binary');
  74731. return [].slice.call(out);
  74732. };
  74733. };
  74734. var dbcs_decode = function make_dbcs_decode(cp) {
  74735. var D = cpt[cp].dec;
  74736. var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
  74737. for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
  74738. for(d = 0; d < D.length; ++d) {
  74739. if(!(c=D[d])) continue;
  74740. w = c.charCodeAt(0);
  74741. j = 2*d;
  74742. DD[j] = w&255; DD[j+1] = w>>8;
  74743. }
  74744. return function dbcs_d(data) {
  74745. var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
  74746. if(Buffer.isBuffer(data)) {
  74747. for(i = 0; i < len; i++) {
  74748. j = 2*data[i];
  74749. if(DD[j]===0xFF && DD[j+1]===0xFD) { j=2*((data[i]<<8)+data[i+1]); ++i; }
  74750. out[k++] = DD[j]; out[k++] = DD[j+1];
  74751. }
  74752. } else if(typeof data === "string") {
  74753. for(i = 0; i < len; i++) {
  74754. j = 2*data.charCodeAt(i);
  74755. if(DD[j]===0xFF && DD[j+1]===0xFD) { j=2*((data.charCodeAt(i)<<8)+data.charCodeAt(i+1)); ++i; }
  74756. out[k++] = DD[j]; out[k++] = DD[j+1];
  74757. }
  74758. } else {
  74759. for(i = 0; i < len; i++) {
  74760. j = 2*data[i];
  74761. if(DD[j]===0xFF && DD[j+1]===0xFD) { j=2*((data[i]<<8)+data[i+1]); ++i; }
  74762. out[k++] = DD[j]; out[k++] = DD[j+1];
  74763. }
  74764. }
  74765. return out.slice(0,k).toString('ucs2');
  74766. };
  74767. };
  74768. magic_decode[65001] = function utf8_d(data) {
  74769. if(typeof data === "string") return utf8_d(data.split("").map(cca));
  74770. var len = data.length, w = 0, ww = 0;
  74771. if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
  74772. var i = 0;
  74773. if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
  74774. for(var j = 1, k = 0, D = 0; i < len; i+=j) {
  74775. j = 1; D = data[i];
  74776. if(D < 128) w = D;
  74777. else if(D < 224) { w=(D&31)*64+(data[i+1]&63); j=2; }
  74778. else if(D < 240) { w=((D&15)<<12)+(data[i+1]&63)*64+(data[i+2]&63); j=3; }
  74779. else { w=(D&7)*262144+((data[i+1]&63)<<12)+(data[i+2]&63)*64+(data[i+3]&63); j=4; }
  74780. if(w < 65536) { mdb[k++] = w&255; mdb[k++] = w>>8; }
  74781. else {
  74782. w -= 65536; ww = 0xD800 + ((w>>10)&1023); w = 0xDC00 + (w&1023);
  74783. mdb[k++] = ww&255; mdb[k++] = ww>>>8; mdb[k++] = w&255; mdb[k++] = (w>>>8)&255;
  74784. }
  74785. }
  74786. return mdb.slice(0,k).toString('ucs2');
  74787. };
  74788. magic_encode[65001] = function utf8_e(data, ofmt) {
  74789. if(has_buf && Buffer.isBuffer(data)) {
  74790. if(!ofmt || ofmt === 'buf') return data;
  74791. if(ofmt !== 'arr') return data.toString('binary');
  74792. return [].slice.call(data);
  74793. }
  74794. var len = data.length, w = 0, ww = 0, j = 0;
  74795. var direct = typeof data === "string";
  74796. if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
  74797. for(var i = 0; i < len; ++i) {
  74798. w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
  74799. if(w <= 0x007F) mdb[j++] = w;
  74800. else if(w <= 0x07FF) {
  74801. mdb[j++] = 192 + (w >> 6);
  74802. mdb[j++] = 128 + (w&63);
  74803. } else if(w >= 0xD800 && w <= 0xDFFF) {
  74804. w -= 0xD800; ++i;
  74805. ww = (direct ? data.charCodeAt(i) : data[i].charCodeAt(0)) - 0xDC00 + (w << 10);
  74806. mdb[j++] = 240 + ((ww>>>18) & 0x07);
  74807. mdb[j++] = 144 + ((ww>>>12) & 0x3F);
  74808. mdb[j++] = 128 + ((ww>>>6) & 0x3F);
  74809. mdb[j++] = 128 + (ww & 0x3F);
  74810. } else {
  74811. mdb[j++] = 224 + (w >> 12);
  74812. mdb[j++] = 128 + ((w >> 6)&63);
  74813. mdb[j++] = 128 + (w&63);
  74814. }
  74815. }
  74816. if(!ofmt || ofmt === 'buf') return mdb.slice(0,j);
  74817. if(ofmt !== 'arr') return mdb.slice(0,j).toString('binary');
  74818. return [].slice.call(mdb, 0, j);
  74819. };
  74820. }
  74821. var encache = function encache() {
  74822. if(has_buf) {
  74823. if(cpdcache[sbcs_cache[0]]) return;
  74824. var i=0, s=0;
  74825. for(i = 0; i < sbcs_cache.length; ++i) {
  74826. s = sbcs_cache[i];
  74827. if(cpt[s]) {
  74828. cpdcache[s] = sbcs_decode(s);
  74829. cpecache[s] = sbcs_encode(s);
  74830. }
  74831. }
  74832. for(i = 0; i < dbcs_cache.length; ++i) {
  74833. s = dbcs_cache[i];
  74834. if(cpt[s]) {
  74835. cpdcache[s] = dbcs_decode(s);
  74836. cpecache[s] = dbcs_encode(s);
  74837. }
  74838. }
  74839. for(i = 0; i < magic_cache.length; ++i) {
  74840. s = magic_cache[i];
  74841. if(magic_decode[s]) cpdcache[s] = magic_decode[s];
  74842. if(magic_encode[s]) cpecache[s] = magic_encode[s];
  74843. }
  74844. }
  74845. };
  74846. var null_enc = function(data, ofmt) { void ofmt; return ""; };
  74847. var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
  74848. var decache = function decache() {
  74849. if(has_buf) {
  74850. if(!cpdcache[sbcs_cache[0]]) return;
  74851. sbcs_cache.forEach(cp_decache);
  74852. dbcs_cache.forEach(cp_decache);
  74853. magic_cache.forEach(cp_decache);
  74854. }
  74855. last_enc = null_enc; last_cp = 0;
  74856. };
  74857. var cache = {
  74858. encache: encache,
  74859. decache: decache,
  74860. sbcs: sbcs_cache,
  74861. dbcs: dbcs_cache
  74862. };
  74863. encache();
  74864. var BM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  74865. var SetD = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?";
  74866. var last_enc = null_enc, last_cp = 0;
  74867. var encode = function encode(cp, data, ofmt) {
  74868. if(cp === last_cp && last_enc) { return last_enc(data, ofmt); }
  74869. if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
  74870. if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
  74871. var len = data.length;
  74872. var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
  74873. var C = cpt[cp], E, M = "";
  74874. var isstr = typeof data === 'string';
  74875. if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
  74876. w = E[isstr? data.charAt(i) : data[i]];
  74877. if(w > 255) {
  74878. out[j] = w>>8;
  74879. out[++j] = w&255;
  74880. } else out[j] = w&255;
  74881. }
  74882. else if((M=magic[cp])) switch(M) {
  74883. case "utf8":
  74884. if(has_buf && isstr) { out = Buffer_from(data, M); j = out.length; break; }
  74885. for(i = 0; i < len; ++i, ++j) {
  74886. w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
  74887. if(w <= 0x007F) out[j] = w;
  74888. else if(w <= 0x07FF) {
  74889. out[j] = 192 + (w >> 6);
  74890. out[++j] = 128 + (w&63);
  74891. } else if(w >= 0xD800 && w <= 0xDFFF) {
  74892. w -= 0xD800;
  74893. ww = (isstr ? data.charCodeAt(++i) : data[++i].charCodeAt(0)) - 0xDC00 + (w << 10);
  74894. out[j] = 240 + ((ww>>>18) & 0x07);
  74895. out[++j] = 144 + ((ww>>>12) & 0x3F);
  74896. out[++j] = 128 + ((ww>>>6) & 0x3F);
  74897. out[++j] = 128 + (ww & 0x3F);
  74898. } else {
  74899. out[j] = 224 + (w >> 12);
  74900. out[++j] = 128 + ((w >> 6)&63);
  74901. out[++j] = 128 + (w&63);
  74902. }
  74903. }
  74904. break;
  74905. case "ascii":
  74906. if(has_buf && typeof data === "string") { out = Buffer_from(data, M); j = out.length; break; }
  74907. for(i = 0; i < len; ++i, ++j) {
  74908. w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
  74909. if(w <= 0x007F) out[j] = w;
  74910. else throw new Error("bad ascii " + w);
  74911. }
  74912. break;
  74913. case "utf16le":
  74914. if(has_buf && typeof data === "string") { out = Buffer_from(data, M); j = out.length; break; }
  74915. for(i = 0; i < len; ++i) {
  74916. w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
  74917. out[j++] = w&255;
  74918. out[j++] = w>>8;
  74919. }
  74920. break;
  74921. case "utf16be":
  74922. for(i = 0; i < len; ++i) {
  74923. w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
  74924. out[j++] = w>>8;
  74925. out[j++] = w&255;
  74926. }
  74927. break;
  74928. case "utf32le":
  74929. for(i = 0; i < len; ++i) {
  74930. w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
  74931. if(w >= 0xD800 && w <= 0xDFFF) w = 0x10000 + ((w - 0xD800) << 10) + (data[++i].charCodeAt(0) - 0xDC00);
  74932. out[j++] = w&255; w >>= 8;
  74933. out[j++] = w&255; w >>= 8;
  74934. out[j++] = w&255; w >>= 8;
  74935. out[j++] = w&255;
  74936. }
  74937. break;
  74938. case "utf32be":
  74939. for(i = 0; i < len; ++i) {
  74940. w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
  74941. if(w >= 0xD800 && w <= 0xDFFF) w = 0x10000 + ((w - 0xD800) << 10) + (data[++i].charCodeAt(0) - 0xDC00);
  74942. out[j+3] = w&255; w >>= 8;
  74943. out[j+2] = w&255; w >>= 8;
  74944. out[j+1] = w&255; w >>= 8;
  74945. out[j] = w&255;
  74946. j+=4;
  74947. }
  74948. break;
  74949. case "utf7":
  74950. for(i = 0; i < len; i++) {
  74951. var c = isstr ? data.charAt(i) : data[i].charAt(0);
  74952. if(c === "+") { out[j++] = 0x2b; out[j++] = 0x2d; continue; }
  74953. if(SetD.indexOf(c) > -1) { out[j++] = c.charCodeAt(0); continue; }
  74954. var tt = encode(1201, c);
  74955. out[j++] = 0x2b;
  74956. out[j++] = BM.charCodeAt(tt[0]>>2);
  74957. out[j++] = BM.charCodeAt(((tt[0]&0x03)<<4) + ((tt[1]||0)>>4));
  74958. out[j++] = BM.charCodeAt(((tt[1]&0x0F)<<2) + ((tt[2]||0)>>6));
  74959. out[j++] = 0x2d;
  74960. }
  74961. break;
  74962. default: throw new Error("Unsupported magic: " + cp + " " + magic[cp]);
  74963. }
  74964. else throw new Error("Unrecognized CP: " + cp);
  74965. out = out.slice(0,j);
  74966. if(!has_buf) return (ofmt == 'str') ? (out).map(sfcc).join("") : out;
  74967. if(!ofmt || ofmt === 'buf') return out;
  74968. if(ofmt !== 'arr') return out.toString('binary');
  74969. return [].slice.call(out);
  74970. };
  74971. var decode = function decode(cp, data) {
  74972. var F; if((F=cpdcache[cp])) return F(data);
  74973. if(typeof data === "string") return decode(cp, data.split("").map(cca));
  74974. var len = data.length, out = new Array(len), s="", w=0, i=0, j=1, k=0, ww=0;
  74975. var C = cpt[cp], D, M="";
  74976. if(C && (D=C.dec)) {
  74977. for(i = 0; i < len; i+=j) {
  74978. j = 2;
  74979. s = D[(data[i]<<8)+ data[i+1]];
  74980. if(!s) {
  74981. j = 1;
  74982. s = D[data[i]];
  74983. }
  74984. if(!s) throw new Error('Unrecognized code: ' + data[i] + ' ' + data[i+j-1] + ' ' + i + ' ' + j + ' ' + D[data[i]]);
  74985. out[k++] = s;
  74986. }
  74987. }
  74988. else if((M=magic[cp])) switch(M) {
  74989. case "utf8":
  74990. if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
  74991. for(; i < len; i+=j) {
  74992. j = 1;
  74993. if(data[i] < 128) w = data[i];
  74994. else if(data[i] < 224) { w=(data[i]&31)*64+(data[i+1]&63); j=2; }
  74995. else if(data[i] < 240) { w=((data[i]&15)<<12)+(data[i+1]&63)*64+(data[i+2]&63); j=3; }
  74996. else { w=(data[i]&7)*262144+((data[i+1]&63)<<12)+(data[i+2]&63)*64+(data[i+3]&63); j=4; }
  74997. if(w < 65536) { out[k++] = String.fromCharCode(w); }
  74998. else {
  74999. w -= 65536; ww = 0xD800 + ((w>>10)&1023); w = 0xDC00 + (w&1023);
  75000. out[k++] = String.fromCharCode(ww); out[k++] = String.fromCharCode(w);
  75001. }
  75002. }
  75003. break;
  75004. case "ascii":
  75005. if(has_buf && Buffer.isBuffer(data)) return data.toString(M);
  75006. for(i = 0; i < len; i++) out[i] = String.fromCharCode(data[i]);
  75007. k = len; break;
  75008. case "utf16le":
  75009. if(len >= 2 && data[0] == 0xFF) if(data[1] == 0xFE) i = 2;
  75010. if(has_buf && Buffer.isBuffer(data)) return data.toString(M);
  75011. j = 2;
  75012. for(; i+1 < len; i+=j) {
  75013. out[k++] = String.fromCharCode((data[i+1]<<8) + data[i]);
  75014. }
  75015. break;
  75016. case "utf16be":
  75017. if(len >= 2 && data[0] == 0xFE) if(data[1] == 0xFF) i = 2;
  75018. j = 2;
  75019. for(; i+1 < len; i+=j) {
  75020. out[k++] = String.fromCharCode((data[i]<<8) + data[i+1]);
  75021. }
  75022. break;
  75023. case "utf32le":
  75024. if(len >= 4 && data[0] == 0xFF) if(data[1] == 0xFE && data[2] === 0 && data[3] === 0) i = 4;
  75025. j = 4;
  75026. for(; i < len; i+=j) {
  75027. w = (data[i+3]<<24) + (data[i+2]<<16) + (data[i+1]<<8) + (data[i]);
  75028. if(w > 0xFFFF) {
  75029. w -= 0x10000;
  75030. out[k++] = String.fromCharCode(0xD800 + ((w >> 10) & 0x3FF));
  75031. out[k++] = String.fromCharCode(0xDC00 + (w & 0x3FF));
  75032. }
  75033. else out[k++] = String.fromCharCode(w);
  75034. }
  75035. break;
  75036. case "utf32be":
  75037. if(len >= 4 && data[3] == 0xFF) if(data[2] == 0xFE && data[1] === 0 && data[0] === 0) i = 4;
  75038. j = 4;
  75039. for(; i < len; i+=j) {
  75040. w = (data[i]<<24) + (data[i+1]<<16) + (data[i+2]<<8) + (data[i+3]);
  75041. if(w > 0xFFFF) {
  75042. w -= 0x10000;
  75043. out[k++] = String.fromCharCode(0xD800 + ((w >> 10) & 0x3FF));
  75044. out[k++] = String.fromCharCode(0xDC00 + (w & 0x3FF));
  75045. }
  75046. else out[k++] = String.fromCharCode(w);
  75047. }
  75048. break;
  75049. case "utf7":
  75050. if(len >= 4 && data[0] == 0x2B && data[1] == 0x2F && data[2] == 0x76) {
  75051. if(len >= 5 && data[3] == 0x38 && data[4] == 0x2D) i = 5;
  75052. else if(data[3] == 0x38 || data[3] == 0x39 || data[3] == 0x2B || data[3] == 0x2F) i = 4;
  75053. }
  75054. for(; i < len; i+=j) {
  75055. if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
  75056. j=1;
  75057. if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
  75058. // eslint-disable-next-line no-useless-escape
  75059. while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
  75060. var dash = 0;
  75061. if(data[i+j] === 0x2d) { ++j; dash=1; }
  75062. var tt = [];
  75063. var o64 = "";
  75064. var c1=0, c2=0, c3=0;
  75065. var e1=0, e2=0, e3=0, e4=0;
  75066. for(var l = 1; l < j - dash;) {
  75067. e1 = BM.indexOf(String.fromCharCode(data[i+l++]));
  75068. e2 = BM.indexOf(String.fromCharCode(data[i+l++]));
  75069. c1 = e1 << 2 | e2 >> 4;
  75070. tt.push(c1);
  75071. e3 = BM.indexOf(String.fromCharCode(data[i+l++]));
  75072. if(e3 === -1) break;
  75073. c2 = (e2 & 15) << 4 | e3 >> 2;
  75074. tt.push(c2);
  75075. e4 = BM.indexOf(String.fromCharCode(data[i+l++]));
  75076. if(e4 === -1) break;
  75077. c3 = (e3 & 3) << 6 | e4;
  75078. if(e4 < 64) tt.push(c3);
  75079. }
  75080. o64 = decode(1201, tt);
  75081. for(l = 0; l < o64.length; ++l) out[k++] = o64.charAt(l);
  75082. }
  75083. break;
  75084. default: throw new Error("Unsupported magic: " + cp + " " + magic[cp]);
  75085. }
  75086. else throw new Error("Unrecognized CP: " + cp);
  75087. return out.slice(0,k).join("");
  75088. };
  75089. var hascp = function hascp(cp) { return !!(cpt[cp] || magic[cp]); };
  75090. cpt.utils = { decode: decode, encode: encode, hascp: hascp, magic: magic, cache:cache };
  75091. return cpt;
  75092. }));
  75093. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  75094. /***/ }),
  75095. /***/ "./node_modules/xlsx/jszip.js":
  75096. /*!************************************!*\
  75097. !*** ./node_modules/xlsx/jszip.js ***!
  75098. \************************************/
  75099. /*! no static exports found */
  75100. /***/ (function(module, exports, __webpack_require__) {
  75101. /* WEBPACK VAR INJECTION */(function(Buffer, global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var require;var require;/*
  75102. JSZip - A Javascript class for generating and reading zip files
  75103. <http://stuartk.com/jszip>
  75104. (c) 2009-2014 Stuart Knightley <stuart [at] stuartk.com>
  75105. Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
  75106. JSZip uses the library pako released under the MIT license :
  75107. https://github.com/nodeca/pako/blob/master/LICENSE
  75108. Note: since JSZip 3 removed critical functionality, this version assigns to the
  75109. `JSZipSync` variable. Another JSZip version can be loaded in parallel.
  75110. */
  75111. (function(e){
  75112. if( true&&"undefined"==typeof DO_NOT_EXPORT_JSZIP)module.exports=e();
  75113. else if( true&&"undefined"==typeof DO_NOT_EXPORT_JSZIP){JSZipSync=e();!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (e),
  75114. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  75115. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  75116. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));}
  75117. else{
  75118. var f;
  75119. "undefined"!=typeof window?f=window:
  75120. "undefined"!=typeof global?f=global:
  75121. "undefined"!=typeof $ && $.global?f=$.global:
  75122. "undefined"!=typeof self&&(f=self),f.JSZipSync=e()
  75123. }
  75124. }(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
  75125. 'use strict';
  75126. // private property
  75127. var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  75128. // public method for encoding
  75129. exports.encode = function(input, utf8) {
  75130. var output = "";
  75131. var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  75132. var i = 0;
  75133. while (i < input.length) {
  75134. chr1 = input.charCodeAt(i++);
  75135. chr2 = input.charCodeAt(i++);
  75136. chr3 = input.charCodeAt(i++);
  75137. enc1 = chr1 >> 2;
  75138. enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  75139. enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  75140. enc4 = chr3 & 63;
  75141. if (isNaN(chr2)) {
  75142. enc3 = enc4 = 64;
  75143. }
  75144. else if (isNaN(chr3)) {
  75145. enc4 = 64;
  75146. }
  75147. output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
  75148. }
  75149. return output;
  75150. };
  75151. // public method for decoding
  75152. exports.decode = function(input, utf8) {
  75153. var output = "";
  75154. var chr1, chr2, chr3;
  75155. var enc1, enc2, enc3, enc4;
  75156. var i = 0;
  75157. input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  75158. while (i < input.length) {
  75159. enc1 = _keyStr.indexOf(input.charAt(i++));
  75160. enc2 = _keyStr.indexOf(input.charAt(i++));
  75161. enc3 = _keyStr.indexOf(input.charAt(i++));
  75162. enc4 = _keyStr.indexOf(input.charAt(i++));
  75163. chr1 = (enc1 << 2) | (enc2 >> 4);
  75164. chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
  75165. chr3 = ((enc3 & 3) << 6) | enc4;
  75166. output = output + String.fromCharCode(chr1);
  75167. if (enc3 != 64) {
  75168. output = output + String.fromCharCode(chr2);
  75169. }
  75170. if (enc4 != 64) {
  75171. output = output + String.fromCharCode(chr3);
  75172. }
  75173. }
  75174. return output;
  75175. };
  75176. },{}],2:[function(_dereq_,module,exports){
  75177. 'use strict';
  75178. function CompressedObject() {
  75179. this.compressedSize = 0;
  75180. this.uncompressedSize = 0;
  75181. this.crc32 = 0;
  75182. this.compressionMethod = null;
  75183. this.compressedContent = null;
  75184. }
  75185. CompressedObject.prototype = {
  75186. /**
  75187. * Return the decompressed content in an unspecified format.
  75188. * The format will depend on the decompressor.
  75189. * @return {Object} the decompressed content.
  75190. */
  75191. getContent: function() {
  75192. return null; // see implementation
  75193. },
  75194. /**
  75195. * Return the compressed content in an unspecified format.
  75196. * The format will depend on the compressed conten source.
  75197. * @return {Object} the compressed content.
  75198. */
  75199. getCompressedContent: function() {
  75200. return null; // see implementation
  75201. }
  75202. };
  75203. module.exports = CompressedObject;
  75204. },{}],3:[function(_dereq_,module,exports){
  75205. 'use strict';
  75206. exports.STORE = {
  75207. magic: "\x00\x00",
  75208. compress: function(content) {
  75209. return content; // no compression
  75210. },
  75211. uncompress: function(content) {
  75212. return content; // no compression
  75213. },
  75214. compressInputType: null,
  75215. uncompressInputType: null
  75216. };
  75217. exports.DEFLATE = _dereq_('./flate');
  75218. },{"./flate":8}],4:[function(_dereq_,module,exports){
  75219. 'use strict';
  75220. var utils = _dereq_('./utils');
  75221. var table = [
  75222. 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
  75223. 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
  75224. 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
  75225. 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
  75226. 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
  75227. 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
  75228. 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
  75229. 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
  75230. 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
  75231. 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
  75232. 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
  75233. 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
  75234. 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
  75235. 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
  75236. 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
  75237. 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
  75238. 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
  75239. 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
  75240. 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
  75241. 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
  75242. 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
  75243. 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
  75244. 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
  75245. 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
  75246. 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
  75247. 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
  75248. 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
  75249. 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
  75250. 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
  75251. 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
  75252. 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
  75253. 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
  75254. 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
  75255. 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
  75256. 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
  75257. 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
  75258. 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
  75259. 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
  75260. 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
  75261. 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
  75262. 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
  75263. 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
  75264. 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
  75265. 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
  75266. 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
  75267. 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
  75268. 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
  75269. 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
  75270. 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
  75271. 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
  75272. 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
  75273. 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
  75274. 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
  75275. 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
  75276. 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
  75277. 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
  75278. 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
  75279. 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
  75280. 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
  75281. 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
  75282. 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
  75283. 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
  75284. 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
  75285. 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
  75286. ];
  75287. /**
  75288. *
  75289. * Javascript crc32
  75290. * http://www.webtoolkit.info/
  75291. *
  75292. */
  75293. module.exports = function crc32(input, crc) {
  75294. if (typeof input === "undefined" || !input.length) {
  75295. return 0;
  75296. }
  75297. var isArray = utils.getTypeOf(input) !== "string";
  75298. if (typeof(crc) == "undefined") {
  75299. crc = 0;
  75300. }
  75301. var x = 0;
  75302. var y = 0;
  75303. var b = 0;
  75304. crc = crc ^ (-1);
  75305. for (var i = 0, iTop = input.length; i < iTop; i++) {
  75306. b = isArray ? input[i] : input.charCodeAt(i);
  75307. y = (crc ^ b) & 0xFF;
  75308. x = table[y];
  75309. crc = (crc >>> 8) ^ x;
  75310. }
  75311. return crc ^ (-1);
  75312. };
  75313. // vim: set shiftwidth=4 softtabstop=4:
  75314. },{"./utils":21}],5:[function(_dereq_,module,exports){
  75315. 'use strict';
  75316. var utils = _dereq_('./utils');
  75317. function DataReader(data) {
  75318. this.data = null; // type : see implementation
  75319. this.length = 0;
  75320. this.index = 0;
  75321. }
  75322. DataReader.prototype = {
  75323. /**
  75324. * Check that the offset will not go too far.
  75325. * @param {string} offset the additional offset to check.
  75326. * @throws {Error} an Error if the offset is out of bounds.
  75327. */
  75328. checkOffset: function(offset) {
  75329. this.checkIndex(this.index + offset);
  75330. },
  75331. /**
  75332. * Check that the specifed index will not be too far.
  75333. * @param {string} newIndex the index to check.
  75334. * @throws {Error} an Error if the index is out of bounds.
  75335. */
  75336. checkIndex: function(newIndex) {
  75337. if (this.length < newIndex || newIndex < 0) {
  75338. throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?");
  75339. }
  75340. },
  75341. /**
  75342. * Change the index.
  75343. * @param {number} newIndex The new index.
  75344. * @throws {Error} if the new index is out of the data.
  75345. */
  75346. setIndex: function(newIndex) {
  75347. this.checkIndex(newIndex);
  75348. this.index = newIndex;
  75349. },
  75350. /**
  75351. * Skip the next n bytes.
  75352. * @param {number} n the number of bytes to skip.
  75353. * @throws {Error} if the new index is out of the data.
  75354. */
  75355. skip: function(n) {
  75356. this.setIndex(this.index + n);
  75357. },
  75358. /**
  75359. * Get the byte at the specified index.
  75360. * @param {number} i the index to use.
  75361. * @return {number} a byte.
  75362. */
  75363. byteAt: function(i) {
  75364. // see implementations
  75365. },
  75366. /**
  75367. * Get the next number with a given byte size.
  75368. * @param {number} size the number of bytes to read.
  75369. * @return {number} the corresponding number.
  75370. */
  75371. readInt: function(size) {
  75372. var result = 0,
  75373. i;
  75374. this.checkOffset(size);
  75375. for (i = this.index + size - 1; i >= this.index; i--) {
  75376. result = (result << 8) + this.byteAt(i);
  75377. }
  75378. this.index += size;
  75379. return result;
  75380. },
  75381. /**
  75382. * Get the next string with a given byte size.
  75383. * @param {number} size the number of bytes to read.
  75384. * @return {string} the corresponding string.
  75385. */
  75386. readString: function(size) {
  75387. return utils.transformTo("string", this.readData(size));
  75388. },
  75389. /**
  75390. * Get raw data without conversion, <size> bytes.
  75391. * @param {number} size the number of bytes to read.
  75392. * @return {Object} the raw data, implementation specific.
  75393. */
  75394. readData: function(size) {
  75395. // see implementations
  75396. },
  75397. /**
  75398. * Find the last occurence of a zip signature (4 bytes).
  75399. * @param {string} sig the signature to find.
  75400. * @return {number} the index of the last occurence, -1 if not found.
  75401. */
  75402. lastIndexOfSignature: function(sig) {
  75403. // see implementations
  75404. },
  75405. /**
  75406. * Get the next date.
  75407. * @return {Date} the date.
  75408. */
  75409. readDate: function() {
  75410. var dostime = this.readInt(4);
  75411. return new Date(
  75412. ((dostime >> 25) & 0x7f) + 1980, // year
  75413. ((dostime >> 21) & 0x0f) - 1, // month
  75414. (dostime >> 16) & 0x1f, // day
  75415. (dostime >> 11) & 0x1f, // hour
  75416. (dostime >> 5) & 0x3f, // minute
  75417. (dostime & 0x1f) << 1); // second
  75418. }
  75419. };
  75420. module.exports = DataReader;
  75421. },{"./utils":21}],6:[function(_dereq_,module,exports){
  75422. 'use strict';
  75423. exports.base64 = false;
  75424. exports.binary = false;
  75425. exports.dir = false;
  75426. exports.createFolders = false;
  75427. exports.date = null;
  75428. exports.compression = null;
  75429. exports.comment = null;
  75430. },{}],7:[function(_dereq_,module,exports){
  75431. 'use strict';
  75432. var utils = _dereq_('./utils');
  75433. /**
  75434. * @deprecated
  75435. * This function will be removed in a future version without replacement.
  75436. */
  75437. exports.string2binary = function(str) {
  75438. return utils.string2binary(str);
  75439. };
  75440. /**
  75441. * @deprecated
  75442. * This function will be removed in a future version without replacement.
  75443. */
  75444. exports.string2Uint8Array = function(str) {
  75445. return utils.transformTo("uint8array", str);
  75446. };
  75447. /**
  75448. * @deprecated
  75449. * This function will be removed in a future version without replacement.
  75450. */
  75451. exports.uint8Array2String = function(array) {
  75452. return utils.transformTo("string", array);
  75453. };
  75454. /**
  75455. * @deprecated
  75456. * This function will be removed in a future version without replacement.
  75457. */
  75458. exports.string2Blob = function(str) {
  75459. var buffer = utils.transformTo("arraybuffer", str);
  75460. return utils.arrayBuffer2Blob(buffer);
  75461. };
  75462. /**
  75463. * @deprecated
  75464. * This function will be removed in a future version without replacement.
  75465. */
  75466. exports.arrayBuffer2Blob = function(buffer) {
  75467. return utils.arrayBuffer2Blob(buffer);
  75468. };
  75469. /**
  75470. * @deprecated
  75471. * This function will be removed in a future version without replacement.
  75472. */
  75473. exports.transformTo = function(outputType, input) {
  75474. return utils.transformTo(outputType, input);
  75475. };
  75476. /**
  75477. * @deprecated
  75478. * This function will be removed in a future version without replacement.
  75479. */
  75480. exports.getTypeOf = function(input) {
  75481. return utils.getTypeOf(input);
  75482. };
  75483. /**
  75484. * @deprecated
  75485. * This function will be removed in a future version without replacement.
  75486. */
  75487. exports.checkSupport = function(type) {
  75488. return utils.checkSupport(type);
  75489. };
  75490. /**
  75491. * @deprecated
  75492. * This value will be removed in a future version without replacement.
  75493. */
  75494. exports.MAX_VALUE_16BITS = utils.MAX_VALUE_16BITS;
  75495. /**
  75496. * @deprecated
  75497. * This value will be removed in a future version without replacement.
  75498. */
  75499. exports.MAX_VALUE_32BITS = utils.MAX_VALUE_32BITS;
  75500. /**
  75501. * @deprecated
  75502. * This function will be removed in a future version without replacement.
  75503. */
  75504. exports.pretty = function(str) {
  75505. return utils.pretty(str);
  75506. };
  75507. /**
  75508. * @deprecated
  75509. * This function will be removed in a future version without replacement.
  75510. */
  75511. exports.findCompression = function(compressionMethod) {
  75512. return utils.findCompression(compressionMethod);
  75513. };
  75514. /**
  75515. * @deprecated
  75516. * This function will be removed in a future version without replacement.
  75517. */
  75518. exports.isRegExp = function (object) {
  75519. return utils.isRegExp(object);
  75520. };
  75521. },{"./utils":21}],8:[function(_dereq_,module,exports){
  75522. 'use strict';
  75523. var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
  75524. var pako = _dereq_("pako");
  75525. exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
  75526. exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
  75527. exports.magic = "\x08\x00";
  75528. exports.compress = function(input) {
  75529. return pako.deflateRaw(input);
  75530. };
  75531. exports.uncompress = function(input) {
  75532. return pako.inflateRaw(input);
  75533. };
  75534. },{"pako":24}],9:[function(_dereq_,module,exports){
  75535. 'use strict';
  75536. var base64 = _dereq_('./base64');
  75537. /**
  75538. Usage:
  75539. zip = new JSZip();
  75540. zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing");
  75541. zip.folder("images").file("smile.gif", base64Data, {base64: true});
  75542. zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")});
  75543. zip.remove("tempfile");
  75544. base64zip = zip.generate();
  75545. **/
  75546. /**
  75547. * Representation a of zip file in js
  75548. * @constructor
  75549. * @param {String=|ArrayBuffer=|Uint8Array=} data the data to load, if any (optional).
  75550. * @param {Object=} options the options for creating this objects (optional).
  75551. */
  75552. function JSZipSync(data, options) {
  75553. // if this constructor is used without `new`, it adds `new` before itself:
  75554. if(!(this instanceof JSZipSync)) return new JSZipSync(data, options);
  75555. // object containing the files :
  75556. // {
  75557. // "folder/" : {...},
  75558. // "folder/data.txt" : {...}
  75559. // }
  75560. this.files = {};
  75561. this.comment = null;
  75562. // Where we are in the hierarchy
  75563. this.root = "";
  75564. if (data) {
  75565. this.load(data, options);
  75566. }
  75567. this.clone = function() {
  75568. var newObj = new JSZipSync();
  75569. for (var i in this) {
  75570. if (typeof this[i] !== "function") {
  75571. newObj[i] = this[i];
  75572. }
  75573. }
  75574. return newObj;
  75575. };
  75576. }
  75577. JSZipSync.prototype = _dereq_('./object');
  75578. JSZipSync.prototype.load = _dereq_('./load');
  75579. JSZipSync.support = _dereq_('./support');
  75580. JSZipSync.defaults = _dereq_('./defaults');
  75581. /**
  75582. * @deprecated
  75583. * This namespace will be removed in a future version without replacement.
  75584. */
  75585. JSZipSync.utils = _dereq_('./deprecatedPublicUtils');
  75586. JSZipSync.base64 = {
  75587. /**
  75588. * @deprecated
  75589. * This method will be removed in a future version without replacement.
  75590. */
  75591. encode : function(input) {
  75592. return base64.encode(input);
  75593. },
  75594. /**
  75595. * @deprecated
  75596. * This method will be removed in a future version without replacement.
  75597. */
  75598. decode : function(input) {
  75599. return base64.decode(input);
  75600. }
  75601. };
  75602. JSZipSync.compressions = _dereq_('./compressions');
  75603. module.exports = JSZipSync;
  75604. },{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_,module,exports){
  75605. 'use strict';
  75606. var base64 = _dereq_('./base64');
  75607. var ZipEntries = _dereq_('./zipEntries');
  75608. module.exports = function(data, options) {
  75609. var files, zipEntries, i, input;
  75610. options = options || {};
  75611. if (options.base64) {
  75612. data = base64.decode(data);
  75613. }
  75614. zipEntries = new ZipEntries(data, options);
  75615. files = zipEntries.files;
  75616. for (i = 0; i < files.length; i++) {
  75617. input = files[i];
  75618. this.file(input.fileName, input.decompressed, {
  75619. binary: true,
  75620. optimizedBinaryString: true,
  75621. date: input.date,
  75622. dir: input.dir,
  75623. comment : input.fileComment.length ? input.fileComment : null,
  75624. createFolders: options.createFolders
  75625. });
  75626. }
  75627. if (zipEntries.zipComment.length) {
  75628. this.comment = zipEntries.zipComment;
  75629. }
  75630. return this;
  75631. };
  75632. },{"./base64":1,"./zipEntries":22}],11:[function(_dereq_,module,exports){
  75633. (function (Buffer){
  75634. 'use strict';
  75635. var Buffer_from = /*::(*/function(){}/*:: :any)*/;
  75636. if(typeof Buffer !== 'undefined') {
  75637. var nbfs = !Buffer.from;
  75638. if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
  75639. Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
  75640. // $FlowIgnore
  75641. if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
  75642. }
  75643. module.exports = function(data, encoding){
  75644. return typeof data == 'number' ? Buffer.alloc(data) : Buffer_from(data, encoding);
  75645. };
  75646. module.exports.test = function(b){
  75647. return Buffer.isBuffer(b);
  75648. };
  75649. }).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
  75650. },{}],12:[function(_dereq_,module,exports){
  75651. 'use strict';
  75652. var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
  75653. function NodeBufferReader(data) {
  75654. this.data = data;
  75655. this.length = this.data.length;
  75656. this.index = 0;
  75657. }
  75658. NodeBufferReader.prototype = new Uint8ArrayReader();
  75659. /**
  75660. * @see DataReader.readData
  75661. */
  75662. NodeBufferReader.prototype.readData = function(size) {
  75663. this.checkOffset(size);
  75664. var result = this.data.slice(this.index, this.index + size);
  75665. this.index += size;
  75666. return result;
  75667. };
  75668. module.exports = NodeBufferReader;
  75669. },{"./uint8ArrayReader":18}],13:[function(_dereq_,module,exports){
  75670. 'use strict';
  75671. var support = _dereq_('./support');
  75672. var utils = _dereq_('./utils');
  75673. var crc32 = _dereq_('./crc32');
  75674. var signature = _dereq_('./signature');
  75675. var defaults = _dereq_('./defaults');
  75676. var base64 = _dereq_('./base64');
  75677. var compressions = _dereq_('./compressions');
  75678. var CompressedObject = _dereq_('./compressedObject');
  75679. var nodeBuffer = _dereq_('./nodeBuffer');
  75680. var utf8 = _dereq_('./utf8');
  75681. var StringWriter = _dereq_('./stringWriter');
  75682. var Uint8ArrayWriter = _dereq_('./uint8ArrayWriter');
  75683. /**
  75684. * Returns the raw data of a ZipObject, decompress the content if necessary.
  75685. * @param {ZipObject} file the file to use.
  75686. * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
  75687. */
  75688. var getRawData = function(file) {
  75689. if (file._data instanceof CompressedObject) {
  75690. file._data = file._data.getContent();
  75691. file.options.binary = true;
  75692. file.options.base64 = false;
  75693. if (utils.getTypeOf(file._data) === "uint8array") {
  75694. var copy = file._data;
  75695. // when reading an arraybuffer, the CompressedObject mechanism will keep it and subarray() a Uint8Array.
  75696. // if we request a file in the same format, we might get the same Uint8Array or its ArrayBuffer (the original zip file).
  75697. file._data = new Uint8Array(copy.length);
  75698. // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
  75699. if (copy.length !== 0) {
  75700. file._data.set(copy, 0);
  75701. }
  75702. }
  75703. }
  75704. return file._data;
  75705. };
  75706. /**
  75707. * Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it.
  75708. * @param {ZipObject} file the file to use.
  75709. * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
  75710. */
  75711. var getBinaryData = function(file) {
  75712. var result = getRawData(file),
  75713. type = utils.getTypeOf(result);
  75714. if (type === "string") {
  75715. if (!file.options.binary) {
  75716. // unicode text !
  75717. // unicode string => binary string is a painful process, check if we can avoid it.
  75718. if (support.nodebuffer) {
  75719. return nodeBuffer(result, "utf-8");
  75720. }
  75721. }
  75722. return file.asBinary();
  75723. }
  75724. return result;
  75725. };
  75726. /**
  75727. * Transform this._data into a string.
  75728. * @param {function} filter a function String -> String, applied if not null on the result.
  75729. * @return {String} the string representing this._data.
  75730. */
  75731. var dataToString = function(asUTF8) {
  75732. var result = getRawData(this);
  75733. if (result === null || typeof result === "undefined") {
  75734. return "";
  75735. }
  75736. // if the data is a base64 string, we decode it before checking the encoding !
  75737. if (this.options.base64) {
  75738. result = base64.decode(result);
  75739. }
  75740. if (asUTF8 && this.options.binary) {
  75741. // JSZip.prototype.utf8decode supports arrays as input
  75742. // skip to array => string step, utf8decode will do it.
  75743. result = out.utf8decode(result);
  75744. }
  75745. else {
  75746. // no utf8 transformation, do the array => string step.
  75747. result = utils.transformTo("string", result);
  75748. }
  75749. if (!asUTF8 && !this.options.binary) {
  75750. result = utils.transformTo("string", out.utf8encode(result));
  75751. }
  75752. return result;
  75753. };
  75754. /**
  75755. * A simple object representing a file in the zip file.
  75756. * @constructor
  75757. * @param {string} name the name of the file
  75758. * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data
  75759. * @param {Object} options the options of the file
  75760. */
  75761. var ZipObject = function(name, data, options) {
  75762. this.name = name;
  75763. this.dir = options.dir;
  75764. this.date = options.date;
  75765. this.comment = options.comment;
  75766. this._data = data;
  75767. this.options = options;
  75768. /*
  75769. * This object contains initial values for dir and date.
  75770. * With them, we can check if the user changed the deprecated metadata in
  75771. * `ZipObject#options` or not.
  75772. */
  75773. this._initialMetadata = {
  75774. dir : options.dir,
  75775. date : options.date
  75776. };
  75777. };
  75778. ZipObject.prototype = {
  75779. /**
  75780. * Return the content as UTF8 string.
  75781. * @return {string} the UTF8 string.
  75782. */
  75783. asText: function() {
  75784. return dataToString.call(this, true);
  75785. },
  75786. /**
  75787. * Returns the binary content.
  75788. * @return {string} the content as binary.
  75789. */
  75790. asBinary: function() {
  75791. return dataToString.call(this, false);
  75792. },
  75793. /**
  75794. * Returns the content as a nodejs Buffer.
  75795. * @return {Buffer} the content as a Buffer.
  75796. */
  75797. asNodeBuffer: function() {
  75798. var result = getBinaryData(this);
  75799. return utils.transformTo("nodebuffer", result);
  75800. },
  75801. /**
  75802. * Returns the content as an Uint8Array.
  75803. * @return {Uint8Array} the content as an Uint8Array.
  75804. */
  75805. asUint8Array: function() {
  75806. var result = getBinaryData(this);
  75807. return utils.transformTo("uint8array", result);
  75808. },
  75809. /**
  75810. * Returns the content as an ArrayBuffer.
  75811. * @return {ArrayBuffer} the content as an ArrayBufer.
  75812. */
  75813. asArrayBuffer: function() {
  75814. return this.asUint8Array().buffer;
  75815. }
  75816. };
  75817. /**
  75818. * Transform an integer into a string in hexadecimal.
  75819. * @private
  75820. * @param {number} dec the number to convert.
  75821. * @param {number} bytes the number of bytes to generate.
  75822. * @returns {string} the result.
  75823. */
  75824. var decToHex = function(dec, bytes) {
  75825. var hex = "",
  75826. i;
  75827. for (i = 0; i < bytes; i++) {
  75828. hex += String.fromCharCode(dec & 0xff);
  75829. dec = dec >>> 8;
  75830. }
  75831. return hex;
  75832. };
  75833. /**
  75834. * Merge the objects passed as parameters into a new one.
  75835. * @private
  75836. * @param {...Object} var_args All objects to merge.
  75837. * @return {Object} a new object with the data of the others.
  75838. */
  75839. var extend = function() {
  75840. var result = {}, i, attr;
  75841. for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers
  75842. for (attr in arguments[i]) {
  75843. if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") {
  75844. result[attr] = arguments[i][attr];
  75845. }
  75846. }
  75847. }
  75848. return result;
  75849. };
  75850. /**
  75851. * Transforms the (incomplete) options from the user into the complete
  75852. * set of options to create a file.
  75853. * @private
  75854. * @param {Object} o the options from the user.
  75855. * @return {Object} the complete set of options.
  75856. */
  75857. var prepareFileAttrs = function(o) {
  75858. o = o || {};
  75859. if (o.base64 === true && (o.binary === null || o.binary === undefined)) {
  75860. o.binary = true;
  75861. }
  75862. o = extend(o, defaults);
  75863. o.date = o.date || new Date();
  75864. if (o.compression !== null) o.compression = o.compression.toUpperCase();
  75865. return o;
  75866. };
  75867. /**
  75868. * Add a file in the current folder.
  75869. * @private
  75870. * @param {string} name the name of the file
  75871. * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file
  75872. * @param {Object} o the options of the file
  75873. * @return {Object} the new file.
  75874. */
  75875. var fileAdd = function(name, data, o) {
  75876. // be sure sub folders exist
  75877. var dataType = utils.getTypeOf(data),
  75878. parent;
  75879. o = prepareFileAttrs(o);
  75880. if (o.createFolders && (parent = parentFolder(name))) {
  75881. folderAdd.call(this, parent, true);
  75882. }
  75883. if (o.dir || data === null || typeof data === "undefined") {
  75884. o.base64 = false;
  75885. o.binary = false;
  75886. data = null;
  75887. }
  75888. else if (dataType === "string") {
  75889. if (o.binary && !o.base64) {
  75890. // optimizedBinaryString == true means that the file has already been filtered with a 0xFF mask
  75891. if (o.optimizedBinaryString !== true) {
  75892. // this is a string, not in a base64 format.
  75893. // Be sure that this is a correct "binary string"
  75894. data = utils.string2binary(data);
  75895. }
  75896. }
  75897. }
  75898. else { // arraybuffer, uint8array, ...
  75899. o.base64 = false;
  75900. o.binary = true;
  75901. if (!dataType && !(data instanceof CompressedObject)) {
  75902. throw new Error("The data of '" + name + "' is in an unsupported format !");
  75903. }
  75904. // special case : it's way easier to work with Uint8Array than with ArrayBuffer
  75905. if (dataType === "arraybuffer") {
  75906. data = utils.transformTo("uint8array", data);
  75907. }
  75908. }
  75909. var object = new ZipObject(name, data, o);
  75910. this.files[name] = object;
  75911. return object;
  75912. };
  75913. /**
  75914. * Find the parent folder of the path.
  75915. * @private
  75916. * @param {string} path the path to use
  75917. * @return {string} the parent folder, or ""
  75918. */
  75919. var parentFolder = function (path) {
  75920. if (path.slice(-1) == '/') {
  75921. path = path.substring(0, path.length - 1);
  75922. }
  75923. var lastSlash = path.lastIndexOf('/');
  75924. return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
  75925. };
  75926. /**
  75927. * Add a (sub) folder in the current folder.
  75928. * @private
  75929. * @param {string} name the folder's name
  75930. * @param {boolean=} [createFolders] If true, automatically create sub
  75931. * folders. Defaults to false.
  75932. * @return {Object} the new folder.
  75933. */
  75934. var folderAdd = function(name, createFolders) {
  75935. // Check the name ends with a /
  75936. if (name.slice(-1) != "/") {
  75937. name += "/"; // IE doesn't like substr(-1)
  75938. }
  75939. createFolders = (typeof createFolders !== 'undefined') ? createFolders : false;
  75940. // Does this folder already exist?
  75941. if (!this.files[name]) {
  75942. fileAdd.call(this, name, null, {
  75943. dir: true,
  75944. createFolders: createFolders
  75945. });
  75946. }
  75947. return this.files[name];
  75948. };
  75949. /**
  75950. * Generate a JSZip.CompressedObject for a given zipOject.
  75951. * @param {ZipObject} file the object to read.
  75952. * @param {JSZip.compression} compression the compression to use.
  75953. * @return {JSZip.CompressedObject} the compressed result.
  75954. */
  75955. var generateCompressedObjectFrom = function(file, compression) {
  75956. var result = new CompressedObject(),
  75957. content;
  75958. // the data has not been decompressed, we might reuse things !
  75959. if (file._data instanceof CompressedObject) {
  75960. result.uncompressedSize = file._data.uncompressedSize;
  75961. result.crc32 = file._data.crc32;
  75962. if (result.uncompressedSize === 0 || file.dir) {
  75963. compression = compressions['STORE'];
  75964. result.compressedContent = "";
  75965. result.crc32 = 0;
  75966. }
  75967. else if (file._data.compressionMethod === compression.magic) {
  75968. result.compressedContent = file._data.getCompressedContent();
  75969. }
  75970. else {
  75971. content = file._data.getContent();
  75972. // need to decompress / recompress
  75973. result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content));
  75974. }
  75975. }
  75976. else {
  75977. // have uncompressed data
  75978. content = getBinaryData(file);
  75979. if (!content || content.length === 0 || file.dir) {
  75980. compression = compressions['STORE'];
  75981. content = "";
  75982. }
  75983. result.uncompressedSize = content.length;
  75984. result.crc32 = crc32(content);
  75985. result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content));
  75986. }
  75987. result.compressedSize = result.compressedContent.length;
  75988. result.compressionMethod = compression.magic;
  75989. return result;
  75990. };
  75991. /**
  75992. * Generate the various parts used in the construction of the final zip file.
  75993. * @param {string} name the file name.
  75994. * @param {ZipObject} file the file content.
  75995. * @param {JSZip.CompressedObject} compressedObject the compressed object.
  75996. * @param {number} offset the current offset from the start of the zip file.
  75997. * @return {object} the zip parts.
  75998. */
  75999. var generateZipParts = function(name, file, compressedObject, offset) {
  76000. var data = compressedObject.compressedContent,
  76001. utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)),
  76002. comment = file.comment || "",
  76003. utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)),
  76004. useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,
  76005. useUTF8ForComment = utfEncodedComment.length !== comment.length,
  76006. o = file.options,
  76007. dosTime,
  76008. dosDate,
  76009. extraFields = "",
  76010. unicodePathExtraField = "",
  76011. unicodeCommentExtraField = "",
  76012. dir, date;
  76013. // handle the deprecated options.dir
  76014. if (file._initialMetadata.dir !== file.dir) {
  76015. dir = file.dir;
  76016. } else {
  76017. dir = o.dir;
  76018. }
  76019. // handle the deprecated options.date
  76020. if(file._initialMetadata.date !== file.date) {
  76021. date = file.date;
  76022. } else {
  76023. date = o.date;
  76024. }
  76025. dosTime = date.getHours();
  76026. dosTime = dosTime << 6;
  76027. dosTime = dosTime | date.getMinutes();
  76028. dosTime = dosTime << 5;
  76029. dosTime = dosTime | date.getSeconds() / 2;
  76030. dosDate = date.getFullYear() - 1980;
  76031. dosDate = dosDate << 4;
  76032. dosDate = dosDate | (date.getMonth() + 1);
  76033. dosDate = dosDate << 5;
  76034. dosDate = dosDate | date.getDate();
  76035. if (useUTF8ForFileName) {
  76036. // set the unicode path extra field. unzip needs at least one extra
  76037. // field to correctly handle unicode path, so using the path is as good
  76038. // as any other information. This could improve the situation with
  76039. // other archive managers too.
  76040. // This field is usually used without the utf8 flag, with a non
  76041. // unicode path in the header (winrar, winzip). This helps (a bit)
  76042. // with the messy Windows' default compressed folders feature but
  76043. // breaks on p7zip which doesn't seek the unicode path extra field.
  76044. // So for now, UTF-8 everywhere !
  76045. unicodePathExtraField =
  76046. // Version
  76047. decToHex(1, 1) +
  76048. // NameCRC32
  76049. decToHex(crc32(utfEncodedFileName), 4) +
  76050. // UnicodeName
  76051. utfEncodedFileName;
  76052. extraFields +=
  76053. // Info-ZIP Unicode Path Extra Field
  76054. "\x75\x70" +
  76055. // size
  76056. decToHex(unicodePathExtraField.length, 2) +
  76057. // content
  76058. unicodePathExtraField;
  76059. }
  76060. if(useUTF8ForComment) {
  76061. unicodeCommentExtraField =
  76062. // Version
  76063. decToHex(1, 1) +
  76064. // CommentCRC32
  76065. decToHex(this.crc32(utfEncodedComment), 4) +
  76066. // UnicodeName
  76067. utfEncodedComment;
  76068. extraFields +=
  76069. // Info-ZIP Unicode Path Extra Field
  76070. "\x75\x63" +
  76071. // size
  76072. decToHex(unicodeCommentExtraField.length, 2) +
  76073. // content
  76074. unicodeCommentExtraField;
  76075. }
  76076. var header = "";
  76077. // version needed to extract
  76078. header += "\x0A\x00";
  76079. // general purpose bit flag
  76080. // set bit 11 if utf8
  76081. header += (useUTF8ForFileName || useUTF8ForComment) ? "\x00\x08" : "\x00\x00";
  76082. // compression method
  76083. header += compressedObject.compressionMethod;
  76084. // last mod file time
  76085. header += decToHex(dosTime, 2);
  76086. // last mod file date
  76087. header += decToHex(dosDate, 2);
  76088. // crc-32
  76089. header += decToHex(compressedObject.crc32, 4);
  76090. // compressed size
  76091. header += decToHex(compressedObject.compressedSize, 4);
  76092. // uncompressed size
  76093. header += decToHex(compressedObject.uncompressedSize, 4);
  76094. // file name length
  76095. header += decToHex(utfEncodedFileName.length, 2);
  76096. // extra field length
  76097. header += decToHex(extraFields.length, 2);
  76098. var fileRecord = signature.LOCAL_FILE_HEADER + header + utfEncodedFileName + extraFields;
  76099. var dirRecord = signature.CENTRAL_FILE_HEADER +
  76100. // version made by (00: DOS)
  76101. "\x14\x00" +
  76102. // file header (common to file and central directory)
  76103. header +
  76104. // file comment length
  76105. decToHex(utfEncodedComment.length, 2) +
  76106. // disk number start
  76107. "\x00\x00" +
  76108. // internal file attributes TODO
  76109. "\x00\x00" +
  76110. // external file attributes
  76111. (dir === true ? "\x10\x00\x00\x00" : "\x00\x00\x00\x00") +
  76112. // relative offset of local header
  76113. decToHex(offset, 4) +
  76114. // file name
  76115. utfEncodedFileName +
  76116. // extra field
  76117. extraFields +
  76118. // file comment
  76119. utfEncodedComment;
  76120. return {
  76121. fileRecord: fileRecord,
  76122. dirRecord: dirRecord,
  76123. compressedObject: compressedObject
  76124. };
  76125. };
  76126. // return the actual prototype of JSZip
  76127. var out = {
  76128. /**
  76129. * Read an existing zip and merge the data in the current JSZip object.
  76130. * The implementation is in jszip-load.js, don't forget to include it.
  76131. * @param {String|ArrayBuffer|Uint8Array|Buffer} stream The stream to load
  76132. * @param {Object} options Options for loading the stream.
  76133. * options.base64 : is the stream in base64 ? default : false
  76134. * @return {JSZip} the current JSZip object
  76135. */
  76136. load: function(stream, options) {
  76137. throw new Error("Load method is not defined. Is the file jszip-load.js included ?");
  76138. },
  76139. /**
  76140. * Filter nested files/folders with the specified function.
  76141. * @param {Function} search the predicate to use :
  76142. * function (relativePath, file) {...}
  76143. * It takes 2 arguments : the relative path and the file.
  76144. * @return {Array} An array of matching elements.
  76145. */
  76146. filter: function(search) {
  76147. var result = [],
  76148. filename, relativePath, file, fileClone;
  76149. for (filename in this.files) {
  76150. if (!this.files.hasOwnProperty(filename)) {
  76151. continue;
  76152. }
  76153. file = this.files[filename];
  76154. // return a new object, don't let the user mess with our internal objects :)
  76155. fileClone = new ZipObject(file.name, file._data, extend(file.options));
  76156. relativePath = filename.slice(this.root.length, filename.length);
  76157. if (filename.slice(0, this.root.length) === this.root && // the file is in the current root
  76158. search(relativePath, fileClone)) { // and the file matches the function
  76159. result.push(fileClone);
  76160. }
  76161. }
  76162. return result;
  76163. },
  76164. /**
  76165. * Add a file to the zip file, or search a file.
  76166. * @param {string|RegExp} name The name of the file to add (if data is defined),
  76167. * the name of the file to find (if no data) or a regex to match files.
  76168. * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded
  76169. * @param {Object} o File options
  76170. * @return {JSZip|Object|Array} this JSZip object (when adding a file),
  76171. * a file (when searching by string) or an array of files (when searching by regex).
  76172. */
  76173. file: function(name, data, o) {
  76174. if (arguments.length === 1) {
  76175. if (utils.isRegExp(name)) {
  76176. var regexp = name;
  76177. return this.filter(function(relativePath, file) {
  76178. return !file.dir && regexp.test(relativePath);
  76179. });
  76180. }
  76181. else { // text
  76182. return this.filter(function(relativePath, file) {
  76183. return !file.dir && relativePath === name;
  76184. })[0] || null;
  76185. }
  76186. }
  76187. else { // more than one argument : we have data !
  76188. name = this.root + name;
  76189. fileAdd.call(this, name, data, o);
  76190. }
  76191. return this;
  76192. },
  76193. /**
  76194. * Add a directory to the zip file, or search.
  76195. * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders.
  76196. * @return {JSZip} an object with the new directory as the root, or an array containing matching folders.
  76197. */
  76198. folder: function(arg) {
  76199. if (!arg) {
  76200. return this;
  76201. }
  76202. if (utils.isRegExp(arg)) {
  76203. return this.filter(function(relativePath, file) {
  76204. return file.dir && arg.test(relativePath);
  76205. });
  76206. }
  76207. // else, name is a new folder
  76208. var name = this.root + arg;
  76209. var newFolder = folderAdd.call(this, name);
  76210. // Allow chaining by returning a new object with this folder as the root
  76211. var ret = this.clone();
  76212. ret.root = newFolder.name;
  76213. return ret;
  76214. },
  76215. /**
  76216. * Delete a file, or a directory and all sub-files, from the zip
  76217. * @param {string} name the name of the file to delete
  76218. * @return {JSZip} this JSZip object
  76219. */
  76220. remove: function(name) {
  76221. name = this.root + name;
  76222. var file = this.files[name];
  76223. if (!file) {
  76224. // Look for any folders
  76225. if (name.slice(-1) != "/") {
  76226. name += "/";
  76227. }
  76228. file = this.files[name];
  76229. }
  76230. if (file && !file.dir) {
  76231. // file
  76232. delete this.files[name];
  76233. } else {
  76234. // maybe a folder, delete recursively
  76235. var kids = this.filter(function(relativePath, file) {
  76236. return file.name.slice(0, name.length) === name;
  76237. });
  76238. for (var i = 0; i < kids.length; i++) {
  76239. delete this.files[kids[i].name];
  76240. }
  76241. }
  76242. return this;
  76243. },
  76244. /**
  76245. * Generate the complete zip file
  76246. * @param {Object} options the options to generate the zip file :
  76247. * - base64, (deprecated, use type instead) true to generate base64.
  76248. * - compression, "STORE" by default.
  76249. * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob.
  76250. * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file
  76251. */
  76252. generate: function(options) {
  76253. options = extend(options || {}, {
  76254. base64: true,
  76255. compression: "STORE",
  76256. type: "base64",
  76257. comment: null
  76258. });
  76259. utils.checkSupport(options.type);
  76260. var zipData = [],
  76261. localDirLength = 0,
  76262. centralDirLength = 0,
  76263. writer, i,
  76264. utfEncodedComment = utils.transformTo("string", this.utf8encode(options.comment || this.comment || ""));
  76265. // first, generate all the zip parts.
  76266. for (var name in this.files) {
  76267. if (!this.files.hasOwnProperty(name)) {
  76268. continue;
  76269. }
  76270. var file = this.files[name];
  76271. var compressionName = file.options.compression || options.compression.toUpperCase();
  76272. var compression = compressions[compressionName];
  76273. if (!compression) {
  76274. throw new Error(compressionName + " is not a valid compression method !");
  76275. }
  76276. var compressedObject = generateCompressedObjectFrom.call(this, file, compression);
  76277. var zipPart = generateZipParts.call(this, name, file, compressedObject, localDirLength);
  76278. localDirLength += zipPart.fileRecord.length + compressedObject.compressedSize;
  76279. centralDirLength += zipPart.dirRecord.length;
  76280. zipData.push(zipPart);
  76281. }
  76282. var dirEnd = "";
  76283. // end of central dir signature
  76284. dirEnd = signature.CENTRAL_DIRECTORY_END +
  76285. // number of this disk
  76286. "\x00\x00" +
  76287. // number of the disk with the start of the central directory
  76288. "\x00\x00" +
  76289. // total number of entries in the central directory on this disk
  76290. decToHex(zipData.length, 2) +
  76291. // total number of entries in the central directory
  76292. decToHex(zipData.length, 2) +
  76293. // size of the central directory 4 bytes
  76294. decToHex(centralDirLength, 4) +
  76295. // offset of start of central directory with respect to the starting disk number
  76296. decToHex(localDirLength, 4) +
  76297. // .ZIP file comment length
  76298. decToHex(utfEncodedComment.length, 2) +
  76299. // .ZIP file comment
  76300. utfEncodedComment;
  76301. // we have all the parts (and the total length)
  76302. // time to create a writer !
  76303. var typeName = options.type.toLowerCase();
  76304. if(typeName==="uint8array"||typeName==="arraybuffer"||typeName==="blob"||typeName==="nodebuffer") {
  76305. writer = new Uint8ArrayWriter(localDirLength + centralDirLength + dirEnd.length);
  76306. }else{
  76307. writer = new StringWriter(localDirLength + centralDirLength + dirEnd.length);
  76308. }
  76309. for (i = 0; i < zipData.length; i++) {
  76310. writer.append(zipData[i].fileRecord);
  76311. writer.append(zipData[i].compressedObject.compressedContent);
  76312. }
  76313. for (i = 0; i < zipData.length; i++) {
  76314. writer.append(zipData[i].dirRecord);
  76315. }
  76316. writer.append(dirEnd);
  76317. var zip = writer.finalize();
  76318. switch(options.type.toLowerCase()) {
  76319. // case "zip is an Uint8Array"
  76320. case "uint8array" :
  76321. case "arraybuffer" :
  76322. case "nodebuffer" :
  76323. return utils.transformTo(options.type.toLowerCase(), zip);
  76324. case "blob" :
  76325. return utils.arrayBuffer2Blob(utils.transformTo("arraybuffer", zip));
  76326. // case "zip is a string"
  76327. case "base64" :
  76328. return (options.base64) ? base64.encode(zip) : zip;
  76329. default : // case "string" :
  76330. return zip;
  76331. }
  76332. },
  76333. /**
  76334. * @deprecated
  76335. * This method will be removed in a future version without replacement.
  76336. */
  76337. crc32: function (input, crc) {
  76338. return crc32(input, crc);
  76339. },
  76340. /**
  76341. * @deprecated
  76342. * This method will be removed in a future version without replacement.
  76343. */
  76344. utf8encode: function (string) {
  76345. return utils.transformTo("string", utf8.utf8encode(string));
  76346. },
  76347. /**
  76348. * @deprecated
  76349. * This method will be removed in a future version without replacement.
  76350. */
  76351. utf8decode: function (input) {
  76352. return utf8.utf8decode(input);
  76353. }
  76354. };
  76355. module.exports = out;
  76356. },{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(_dereq_,module,exports){
  76357. 'use strict';
  76358. exports.LOCAL_FILE_HEADER = "PK\x03\x04";
  76359. exports.CENTRAL_FILE_HEADER = "PK\x01\x02";
  76360. exports.CENTRAL_DIRECTORY_END = "PK\x05\x06";
  76361. exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07";
  76362. exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06";
  76363. exports.DATA_DESCRIPTOR = "PK\x07\x08";
  76364. },{}],15:[function(_dereq_,module,exports){
  76365. 'use strict';
  76366. var DataReader = _dereq_('./dataReader');
  76367. var utils = _dereq_('./utils');
  76368. function StringReader(data, optimizedBinaryString) {
  76369. this.data = data;
  76370. if (!optimizedBinaryString) {
  76371. this.data = utils.string2binary(this.data);
  76372. }
  76373. this.length = this.data.length;
  76374. this.index = 0;
  76375. }
  76376. StringReader.prototype = new DataReader();
  76377. /**
  76378. * @see DataReader.byteAt
  76379. */
  76380. StringReader.prototype.byteAt = function(i) {
  76381. return this.data.charCodeAt(i);
  76382. };
  76383. /**
  76384. * @see DataReader.lastIndexOfSignature
  76385. */
  76386. StringReader.prototype.lastIndexOfSignature = function(sig) {
  76387. return this.data.lastIndexOf(sig);
  76388. };
  76389. /**
  76390. * @see DataReader.readData
  76391. */
  76392. StringReader.prototype.readData = function(size) {
  76393. this.checkOffset(size);
  76394. // this will work because the constructor applied the "& 0xff" mask.
  76395. var result = this.data.slice(this.index, this.index + size);
  76396. this.index += size;
  76397. return result;
  76398. };
  76399. module.exports = StringReader;
  76400. },{"./dataReader":5,"./utils":21}],16:[function(_dereq_,module,exports){
  76401. 'use strict';
  76402. var utils = _dereq_('./utils');
  76403. /**
  76404. * An object to write any content to a string.
  76405. * @constructor
  76406. */
  76407. var StringWriter = function() {
  76408. this.data = [];
  76409. };
  76410. StringWriter.prototype = {
  76411. /**
  76412. * Append any content to the current string.
  76413. * @param {Object} input the content to add.
  76414. */
  76415. append: function(input) {
  76416. input = utils.transformTo("string", input);
  76417. this.data.push(input);
  76418. },
  76419. /**
  76420. * Finalize the construction an return the result.
  76421. * @return {string} the generated string.
  76422. */
  76423. finalize: function() {
  76424. return this.data.join("");
  76425. }
  76426. };
  76427. module.exports = StringWriter;
  76428. },{"./utils":21}],17:[function(_dereq_,module,exports){
  76429. (function (Buffer){
  76430. 'use strict';
  76431. exports.base64 = true;
  76432. exports.array = true;
  76433. exports.string = true;
  76434. exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
  76435. // contains true if JSZip can read/generate nodejs Buffer, false otherwise.
  76436. // Browserify will provide a Buffer implementation for browsers, which is
  76437. // an augmented Uint8Array (i.e., can be used as either Buffer or U8).
  76438. exports.nodebuffer = typeof Buffer !== "undefined";
  76439. // contains true if JSZip can read/generate Uint8Array, false otherwise.
  76440. exports.uint8array = typeof Uint8Array !== "undefined";
  76441. if (typeof ArrayBuffer === "undefined") {
  76442. exports.blob = false;
  76443. }
  76444. else {
  76445. var buffer = new ArrayBuffer(0);
  76446. try {
  76447. exports.blob = new Blob([buffer], {
  76448. type: "application/zip"
  76449. }).size === 0;
  76450. }
  76451. catch (e) {
  76452. try {
  76453. var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
  76454. var builder = new Builder();
  76455. builder.append(buffer);
  76456. exports.blob = builder.getBlob('application/zip').size === 0;
  76457. }
  76458. catch (e) {
  76459. exports.blob = false;
  76460. }
  76461. }
  76462. }
  76463. }).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
  76464. },{}],18:[function(_dereq_,module,exports){
  76465. 'use strict';
  76466. var DataReader = _dereq_('./dataReader');
  76467. function Uint8ArrayReader(data) {
  76468. if (data) {
  76469. this.data = data;
  76470. this.length = this.data.length;
  76471. this.index = 0;
  76472. }
  76473. }
  76474. Uint8ArrayReader.prototype = new DataReader();
  76475. /**
  76476. * @see DataReader.byteAt
  76477. */
  76478. Uint8ArrayReader.prototype.byteAt = function(i) {
  76479. return this.data[i];
  76480. };
  76481. /**
  76482. * @see DataReader.lastIndexOfSignature
  76483. */
  76484. Uint8ArrayReader.prototype.lastIndexOfSignature = function(sig) {
  76485. var sig0 = sig.charCodeAt(0),
  76486. sig1 = sig.charCodeAt(1),
  76487. sig2 = sig.charCodeAt(2),
  76488. sig3 = sig.charCodeAt(3);
  76489. for (var i = this.length - 4; i >= 0; --i) {
  76490. if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {
  76491. return i;
  76492. }
  76493. }
  76494. return -1;
  76495. };
  76496. /**
  76497. * @see DataReader.readData
  76498. */
  76499. Uint8ArrayReader.prototype.readData = function(size) {
  76500. this.checkOffset(size);
  76501. if(size === 0) {
  76502. // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].
  76503. return new Uint8Array(0);
  76504. }
  76505. var result = this.data.subarray(this.index, this.index + size);
  76506. this.index += size;
  76507. return result;
  76508. };
  76509. module.exports = Uint8ArrayReader;
  76510. },{"./dataReader":5}],19:[function(_dereq_,module,exports){
  76511. 'use strict';
  76512. var utils = _dereq_('./utils');
  76513. /**
  76514. * An object to write any content to an Uint8Array.
  76515. * @constructor
  76516. * @param {number} length The length of the array.
  76517. */
  76518. var Uint8ArrayWriter = function(length) {
  76519. this.data = new Uint8Array(length);
  76520. this.index = 0;
  76521. };
  76522. Uint8ArrayWriter.prototype = {
  76523. /**
  76524. * Append any content to the current array.
  76525. * @param {Object} input the content to add.
  76526. */
  76527. append: function(input) {
  76528. if (input.length !== 0) {
  76529. // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
  76530. input = utils.transformTo("uint8array", input);
  76531. this.data.set(input, this.index);
  76532. this.index += input.length;
  76533. }
  76534. },
  76535. /**
  76536. * Finalize the construction an return the result.
  76537. * @return {Uint8Array} the generated array.
  76538. */
  76539. finalize: function() {
  76540. return this.data;
  76541. }
  76542. };
  76543. module.exports = Uint8ArrayWriter;
  76544. },{"./utils":21}],20:[function(_dereq_,module,exports){
  76545. 'use strict';
  76546. var utils = _dereq_('./utils');
  76547. var support = _dereq_('./support');
  76548. var nodeBuffer = _dereq_('./nodeBuffer');
  76549. /**
  76550. * The following functions come from pako, from pako/lib/utils/strings
  76551. * released under the MIT license, see pako https://github.com/nodeca/pako/
  76552. */
  76553. // Table with utf8 lengths (calculated by first byte of sequence)
  76554. // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
  76555. // because max possible codepoint is 0x10ffff
  76556. var _utf8len = new Array(256);
  76557. for (var i=0; i<256; i++) {
  76558. _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
  76559. }
  76560. _utf8len[254]=_utf8len[254]=1; // Invalid sequence start
  76561. // convert string to array (typed, when possible)
  76562. var string2buf = function (str) {
  76563. var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
  76564. // count binary size
  76565. for (m_pos = 0; m_pos < str_len; m_pos++) {
  76566. c = str.charCodeAt(m_pos);
  76567. if (((c & 0xfc00) === 0xd800) && (m_pos+1 < str_len)) {
  76568. c2 = str.charCodeAt(m_pos+1);
  76569. if ((c2 & 0xfc00) === 0xdc00) {
  76570. c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
  76571. m_pos++;
  76572. }
  76573. }
  76574. buf_len += (c < 0x80) ? 1 : ((c < 0x800) ? 2 : ((c < 0x10000) ? 3 : 4));
  76575. }
  76576. // allocate buffer
  76577. if (support.uint8array) {
  76578. buf = new Uint8Array(buf_len);
  76579. } else {
  76580. buf = new Array(buf_len);
  76581. }
  76582. // convert
  76583. for (i=0, m_pos = 0; i < buf_len; m_pos++) {
  76584. c = str.charCodeAt(m_pos);
  76585. if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
  76586. c2 = str.charCodeAt(m_pos+1);
  76587. if ((c2 & 0xfc00) === 0xdc00) {
  76588. c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
  76589. m_pos++;
  76590. }
  76591. }
  76592. if (c < 0x80) {
  76593. /* one byte */
  76594. buf[i++] = c;
  76595. } else if (c < 0x800) {
  76596. /* two bytes */
  76597. buf[i++] = 0xC0 | (c >>> 6);
  76598. buf[i++] = 0x80 | (c & 0x3f);
  76599. } else if (c < 0x10000) {
  76600. /* three bytes */
  76601. buf[i++] = 0xE0 | (c >>> 12);
  76602. buf[i++] = 0x80 | ((c >>> 6) & 0x3f);
  76603. buf[i++] = 0x80 | (c & 0x3f);
  76604. } else {
  76605. /* four bytes */
  76606. buf[i++] = 0xf0 | (c >>> 18);
  76607. buf[i++] = 0x80 | ((c >>> 12) & 0x3f);
  76608. buf[i++] = 0x80 | ((c >>> 6) & 0x3f);
  76609. buf[i++] = 0x80 | (c & 0x3f);
  76610. }
  76611. }
  76612. return buf;
  76613. };
  76614. // Calculate max possible position in utf8 buffer,
  76615. // that will not break sequence. If that's not possible
  76616. // - (very small limits) return max size as is.
  76617. //
  76618. // buf[] - utf8 bytes array
  76619. // max - length limit (mandatory);
  76620. var utf8border = function(buf, max) {
  76621. var pos;
  76622. max = max || buf.length;
  76623. if (max > buf.length) { max = buf.length; }
  76624. // go back from last position, until start of sequence found
  76625. pos = max-1;
  76626. while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
  76627. // Fuckup - very small and broken sequence,
  76628. // return max, because we should return something anyway.
  76629. if (pos < 0) { return max; }
  76630. // If we came to start of buffer - that means vuffer is too small,
  76631. // return max too.
  76632. if (pos === 0) { return max; }
  76633. return (pos + _utf8len[buf[pos]] > max) ? pos : max;
  76634. };
  76635. // convert array to string
  76636. var buf2string = function (buf) {
  76637. var str, i, out, c, c_len;
  76638. var len = buf.length;
  76639. // Reserve max possible length (2 words per char)
  76640. // NB: by unknown reasons, Array is significantly faster for
  76641. // String.fromCharCode.apply than Uint16Array.
  76642. var utf16buf = new Array(len*2);
  76643. for (out=0, i=0; i<len;) {
  76644. c = buf[i++];
  76645. // quick process ascii
  76646. if (c < 0x80) { utf16buf[out++] = c; continue; }
  76647. c_len = _utf8len[c];
  76648. // skip 5 & 6 byte codes
  76649. if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }
  76650. // apply mask on first byte
  76651. c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
  76652. // join the rest
  76653. while (c_len > 1 && i < len) {
  76654. c = (c << 6) | (buf[i++] & 0x3f);
  76655. c_len--;
  76656. }
  76657. // terminated by end of string?
  76658. if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
  76659. if (c < 0x10000) {
  76660. utf16buf[out++] = c;
  76661. } else {
  76662. c -= 0x10000;
  76663. utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
  76664. utf16buf[out++] = 0xdc00 | (c & 0x3ff);
  76665. }
  76666. }
  76667. // shrinkBuf(utf16buf, out)
  76668. if (utf16buf.length !== out) {
  76669. if(utf16buf.subarray) {
  76670. utf16buf = utf16buf.subarray(0, out);
  76671. } else {
  76672. utf16buf.length = out;
  76673. }
  76674. }
  76675. // return String.fromCharCode.apply(null, utf16buf);
  76676. return utils.applyFromCharCode(utf16buf);
  76677. };
  76678. // That's all for the pako functions.
  76679. /**
  76680. * Transform a javascript string into an array (typed if possible) of bytes,
  76681. * UTF-8 encoded.
  76682. * @param {String} str the string to encode
  76683. * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string.
  76684. */
  76685. exports.utf8encode = function utf8encode(str) {
  76686. if (support.nodebuffer) {
  76687. return nodeBuffer(str, "utf-8");
  76688. }
  76689. return string2buf(str);
  76690. };
  76691. /**
  76692. * Transform a bytes array (or a representation) representing an UTF-8 encoded
  76693. * string into a javascript string.
  76694. * @param {Array|Uint8Array|Buffer} buf the data de decode
  76695. * @return {String} the decoded string.
  76696. */
  76697. exports.utf8decode = function utf8decode(buf) {
  76698. if (support.nodebuffer) {
  76699. return utils.transformTo("nodebuffer", buf).toString("utf-8");
  76700. }
  76701. buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf);
  76702. // return buf2string(buf);
  76703. // Chrome prefers to work with "small" chunks of data
  76704. // for the method buf2string.
  76705. // Firefox and Chrome has their own shortcut, IE doesn't seem to really care.
  76706. var result = [], k = 0, len = buf.length, chunk = 65536;
  76707. while (k < len) {
  76708. var nextBoundary = utf8border(buf, Math.min(k + chunk, len));
  76709. if (support.uint8array) {
  76710. result.push(buf2string(buf.subarray(k, nextBoundary)));
  76711. } else {
  76712. result.push(buf2string(buf.slice(k, nextBoundary)));
  76713. }
  76714. k = nextBoundary;
  76715. }
  76716. return result.join("");
  76717. };
  76718. // vim: set shiftwidth=4 softtabstop=4:
  76719. },{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(_dereq_,module,exports){
  76720. 'use strict';
  76721. var support = _dereq_('./support');
  76722. var compressions = _dereq_('./compressions');
  76723. var nodeBuffer = _dereq_('./nodeBuffer');
  76724. /**
  76725. * Convert a string to a "binary string" : a string containing only char codes between 0 and 255.
  76726. * @param {string} str the string to transform.
  76727. * @return {String} the binary string.
  76728. */
  76729. exports.string2binary = function(str) {
  76730. var result = "";
  76731. for (var i = 0; i < str.length; i++) {
  76732. result += String.fromCharCode(str.charCodeAt(i) & 0xff);
  76733. }
  76734. return result;
  76735. };
  76736. exports.arrayBuffer2Blob = function(buffer) {
  76737. exports.checkSupport("blob");
  76738. try {
  76739. // Blob constructor
  76740. return new Blob([buffer], {
  76741. type: "application/zip"
  76742. });
  76743. }
  76744. catch (e) {
  76745. try {
  76746. // deprecated, browser only, old way
  76747. var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
  76748. var builder = new Builder();
  76749. builder.append(buffer);
  76750. return builder.getBlob('application/zip');
  76751. }
  76752. catch (e) {
  76753. // well, fuck ?!
  76754. throw new Error("Bug : can't construct the Blob.");
  76755. }
  76756. }
  76757. };
  76758. /**
  76759. * The identity function.
  76760. * @param {Object} input the input.
  76761. * @return {Object} the same input.
  76762. */
  76763. function identity(input) {
  76764. return input;
  76765. }
  76766. /**
  76767. * Fill in an array with a string.
  76768. * @param {String} str the string to use.
  76769. * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated).
  76770. * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.
  76771. */
  76772. function stringToArrayLike(str, array) {
  76773. for (var i = 0; i < str.length; ++i) {
  76774. array[i] = str.charCodeAt(i) & 0xFF;
  76775. }
  76776. return array;
  76777. }
  76778. /**
  76779. * Transform an array-like object to a string.
  76780. * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
  76781. * @return {String} the result.
  76782. */
  76783. function arrayLikeToString(array) {
  76784. // Performances notes :
  76785. // --------------------
  76786. // String.fromCharCode.apply(null, array) is the fastest, see
  76787. // see http://jsperf.com/converting-a-uint8array-to-a-string/2
  76788. // but the stack is limited (and we can get huge arrays !).
  76789. //
  76790. // result += String.fromCharCode(array[i]); generate too many strings !
  76791. //
  76792. // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2
  76793. var chunk = 65536;
  76794. var result = [],
  76795. len = array.length,
  76796. type = exports.getTypeOf(array),
  76797. k = 0,
  76798. canUseApply = true;
  76799. try {
  76800. switch(type) {
  76801. case "uint8array":
  76802. String.fromCharCode.apply(null, new Uint8Array(0));
  76803. break;
  76804. case "nodebuffer":
  76805. String.fromCharCode.apply(null, nodeBuffer(0));
  76806. break;
  76807. }
  76808. } catch(e) {
  76809. canUseApply = false;
  76810. }
  76811. // no apply : slow and painful algorithm
  76812. // default browser on android 4.*
  76813. if (!canUseApply) {
  76814. var resultStr = "";
  76815. for(var i = 0; i < array.length;i++) {
  76816. resultStr += String.fromCharCode(array[i]);
  76817. }
  76818. return resultStr;
  76819. }
  76820. while (k < len && chunk > 1) {
  76821. try {
  76822. if (type === "array" || type === "nodebuffer") {
  76823. result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));
  76824. }
  76825. else {
  76826. result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));
  76827. }
  76828. k += chunk;
  76829. }
  76830. catch (e) {
  76831. chunk = Math.floor(chunk / 2);
  76832. }
  76833. }
  76834. return result.join("");
  76835. }
  76836. exports.applyFromCharCode = arrayLikeToString;
  76837. /**
  76838. * Copy the data from an array-like to an other array-like.
  76839. * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array.
  76840. * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated.
  76841. * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array.
  76842. */
  76843. function arrayLikeToArrayLike(arrayFrom, arrayTo) {
  76844. for (var i = 0; i < arrayFrom.length; i++) {
  76845. arrayTo[i] = arrayFrom[i];
  76846. }
  76847. return arrayTo;
  76848. }
  76849. // a matrix containing functions to transform everything into everything.
  76850. var transform = {};
  76851. // string to ?
  76852. transform["string"] = {
  76853. "string": identity,
  76854. "array": function(input) {
  76855. return stringToArrayLike(input, new Array(input.length));
  76856. },
  76857. "arraybuffer": function(input) {
  76858. return transform["string"]["uint8array"](input).buffer;
  76859. },
  76860. "uint8array": function(input) {
  76861. return stringToArrayLike(input, new Uint8Array(input.length));
  76862. },
  76863. "nodebuffer": function(input) {
  76864. return stringToArrayLike(input, nodeBuffer(input.length));
  76865. }
  76866. };
  76867. // array to ?
  76868. transform["array"] = {
  76869. "string": arrayLikeToString,
  76870. "array": identity,
  76871. "arraybuffer": function(input) {
  76872. return (new Uint8Array(input)).buffer;
  76873. },
  76874. "uint8array": function(input) {
  76875. return new Uint8Array(input);
  76876. },
  76877. "nodebuffer": function(input) {
  76878. return nodeBuffer(input);
  76879. }
  76880. };
  76881. // arraybuffer to ?
  76882. transform["arraybuffer"] = {
  76883. "string": function(input) {
  76884. return arrayLikeToString(new Uint8Array(input));
  76885. },
  76886. "array": function(input) {
  76887. return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength));
  76888. },
  76889. "arraybuffer": identity,
  76890. "uint8array": function(input) {
  76891. return new Uint8Array(input);
  76892. },
  76893. "nodebuffer": function(input) {
  76894. return nodeBuffer(new Uint8Array(input));
  76895. }
  76896. };
  76897. // uint8array to ?
  76898. transform["uint8array"] = {
  76899. "string": arrayLikeToString,
  76900. "array": function(input) {
  76901. return arrayLikeToArrayLike(input, new Array(input.length));
  76902. },
  76903. "arraybuffer": function(input) {
  76904. return input.buffer;
  76905. },
  76906. "uint8array": identity,
  76907. "nodebuffer": function(input) {
  76908. return nodeBuffer(input);
  76909. }
  76910. };
  76911. // nodebuffer to ?
  76912. transform["nodebuffer"] = {
  76913. "string": arrayLikeToString,
  76914. "array": function(input) {
  76915. return arrayLikeToArrayLike(input, new Array(input.length));
  76916. },
  76917. "arraybuffer": function(input) {
  76918. return transform["nodebuffer"]["uint8array"](input).buffer;
  76919. },
  76920. "uint8array": function(input) {
  76921. return arrayLikeToArrayLike(input, new Uint8Array(input.length));
  76922. },
  76923. "nodebuffer": identity
  76924. };
  76925. /**
  76926. * Transform an input into any type.
  76927. * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer.
  76928. * If no output type is specified, the unmodified input will be returned.
  76929. * @param {String} outputType the output type.
  76930. * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert.
  76931. * @throws {Error} an Error if the browser doesn't support the requested output type.
  76932. */
  76933. exports.transformTo = function(outputType, input) {
  76934. if (!input) {
  76935. // undefined, null, etc
  76936. // an empty string won't harm.
  76937. input = "";
  76938. }
  76939. if (!outputType) {
  76940. return input;
  76941. }
  76942. exports.checkSupport(outputType);
  76943. var inputType = exports.getTypeOf(input);
  76944. var result = transform[inputType][outputType](input);
  76945. return result;
  76946. };
  76947. /**
  76948. * Return the type of the input.
  76949. * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.
  76950. * @param {Object} input the input to identify.
  76951. * @return {String} the (lowercase) type of the input.
  76952. */
  76953. exports.getTypeOf = function(input) {
  76954. if (typeof input === "string") {
  76955. return "string";
  76956. }
  76957. if (Object.prototype.toString.call(input) === "[object Array]") {
  76958. return "array";
  76959. }
  76960. if (support.nodebuffer && nodeBuffer.test(input)) {
  76961. return "nodebuffer";
  76962. }
  76963. if (support.uint8array && input instanceof Uint8Array) {
  76964. return "uint8array";
  76965. }
  76966. if (support.arraybuffer && input instanceof ArrayBuffer) {
  76967. return "arraybuffer";
  76968. }
  76969. };
  76970. /**
  76971. * Throw an exception if the type is not supported.
  76972. * @param {String} type the type to check.
  76973. * @throws {Error} an Error if the browser doesn't support the requested type.
  76974. */
  76975. exports.checkSupport = function(type) {
  76976. var supported = support[type.toLowerCase()];
  76977. if (!supported) {
  76978. throw new Error(type + " is not supported by this browser");
  76979. }
  76980. };
  76981. exports.MAX_VALUE_16BITS = 65535;
  76982. exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1
  76983. /**
  76984. * Prettify a string read as binary.
  76985. * @param {string} str the string to prettify.
  76986. * @return {string} a pretty string.
  76987. */
  76988. exports.pretty = function(str) {
  76989. var res = '',
  76990. code, i;
  76991. for (i = 0; i < (str || "").length; i++) {
  76992. code = str.charCodeAt(i);
  76993. res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase();
  76994. }
  76995. return res;
  76996. };
  76997. /**
  76998. * Find a compression registered in JSZip.
  76999. * @param {string} compressionMethod the method magic to find.
  77000. * @return {Object|null} the JSZip compression object, null if none found.
  77001. */
  77002. exports.findCompression = function(compressionMethod) {
  77003. for (var method in compressions) {
  77004. if (!compressions.hasOwnProperty(method)) {
  77005. continue;
  77006. }
  77007. if (compressions[method].magic === compressionMethod) {
  77008. return compressions[method];
  77009. }
  77010. }
  77011. return null;
  77012. };
  77013. /**
  77014. * Cross-window, cross-Node-context regular expression detection
  77015. * @param {Object} object Anything
  77016. * @return {Boolean} true if the object is a regular expression,
  77017. * false otherwise
  77018. */
  77019. exports.isRegExp = function (object) {
  77020. return Object.prototype.toString.call(object) === "[object RegExp]";
  77021. };
  77022. },{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){
  77023. 'use strict';
  77024. var StringReader = _dereq_('./stringReader');
  77025. var NodeBufferReader = _dereq_('./nodeBufferReader');
  77026. var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
  77027. var utils = _dereq_('./utils');
  77028. var sig = _dereq_('./signature');
  77029. var ZipEntry = _dereq_('./zipEntry');
  77030. var support = _dereq_('./support');
  77031. var jszipProto = _dereq_('./object');
  77032. // class ZipEntries {{{
  77033. /**
  77034. * All the entries in the zip file.
  77035. * @constructor
  77036. * @param {String|ArrayBuffer|Uint8Array} data the binary stream to load.
  77037. * @param {Object} loadOptions Options for loading the stream.
  77038. */
  77039. function ZipEntries(data, loadOptions) {
  77040. this.files = [];
  77041. this.loadOptions = loadOptions;
  77042. if (data) {
  77043. this.load(data);
  77044. }
  77045. }
  77046. ZipEntries.prototype = {
  77047. /**
  77048. * Check that the reader is on the speficied signature.
  77049. * @param {string} expectedSignature the expected signature.
  77050. * @throws {Error} if it is an other signature.
  77051. */
  77052. checkSignature: function(expectedSignature) {
  77053. var signature = this.reader.readString(4);
  77054. if (signature !== expectedSignature) {
  77055. throw new Error("Corrupted zip or bug : unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")");
  77056. }
  77057. },
  77058. /**
  77059. * Read the end of the central directory.
  77060. */
  77061. readBlockEndOfCentral: function() {
  77062. this.diskNumber = this.reader.readInt(2);
  77063. this.diskWithCentralDirStart = this.reader.readInt(2);
  77064. this.centralDirRecordsOnThisDisk = this.reader.readInt(2);
  77065. this.centralDirRecords = this.reader.readInt(2);
  77066. this.centralDirSize = this.reader.readInt(4);
  77067. this.centralDirOffset = this.reader.readInt(4);
  77068. this.zipCommentLength = this.reader.readInt(2);
  77069. // warning : the encoding depends of the system locale
  77070. // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.
  77071. // On a windows machine, this field is encoded with the localized windows code page.
  77072. this.zipComment = this.reader.readString(this.zipCommentLength);
  77073. // To get consistent behavior with the generation part, we will assume that
  77074. // this is utf8 encoded.
  77075. this.zipComment = jszipProto.utf8decode(this.zipComment);
  77076. },
  77077. /**
  77078. * Read the end of the Zip 64 central directory.
  77079. * Not merged with the method readEndOfCentral :
  77080. * The end of central can coexist with its Zip64 brother,
  77081. * I don't want to read the wrong number of bytes !
  77082. */
  77083. readBlockZip64EndOfCentral: function() {
  77084. this.zip64EndOfCentralSize = this.reader.readInt(8);
  77085. this.versionMadeBy = this.reader.readString(2);
  77086. this.versionNeeded = this.reader.readInt(2);
  77087. this.diskNumber = this.reader.readInt(4);
  77088. this.diskWithCentralDirStart = this.reader.readInt(4);
  77089. this.centralDirRecordsOnThisDisk = this.reader.readInt(8);
  77090. this.centralDirRecords = this.reader.readInt(8);
  77091. this.centralDirSize = this.reader.readInt(8);
  77092. this.centralDirOffset = this.reader.readInt(8);
  77093. this.zip64ExtensibleData = {};
  77094. var extraDataSize = this.zip64EndOfCentralSize - 44,
  77095. index = 0,
  77096. extraFieldId,
  77097. extraFieldLength,
  77098. extraFieldValue;
  77099. while (index < extraDataSize) {
  77100. extraFieldId = this.reader.readInt(2);
  77101. extraFieldLength = this.reader.readInt(4);
  77102. extraFieldValue = this.reader.readString(extraFieldLength);
  77103. this.zip64ExtensibleData[extraFieldId] = {
  77104. id: extraFieldId,
  77105. length: extraFieldLength,
  77106. value: extraFieldValue
  77107. };
  77108. }
  77109. },
  77110. /**
  77111. * Read the end of the Zip 64 central directory locator.
  77112. */
  77113. readBlockZip64EndOfCentralLocator: function() {
  77114. this.diskWithZip64CentralDirStart = this.reader.readInt(4);
  77115. this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8);
  77116. this.disksCount = this.reader.readInt(4);
  77117. if (this.disksCount > 1) {
  77118. throw new Error("Multi-volumes zip are not supported");
  77119. }
  77120. },
  77121. /**
  77122. * Read the local files, based on the offset read in the central part.
  77123. */
  77124. readLocalFiles: function() {
  77125. var i, file;
  77126. for (i = 0; i < this.files.length; i++) {
  77127. file = this.files[i];
  77128. this.reader.setIndex(file.localHeaderOffset);
  77129. this.checkSignature(sig.LOCAL_FILE_HEADER);
  77130. file.readLocalPart(this.reader);
  77131. file.handleUTF8();
  77132. }
  77133. },
  77134. /**
  77135. * Read the central directory.
  77136. */
  77137. readCentralDir: function() {
  77138. var file;
  77139. this.reader.setIndex(this.centralDirOffset);
  77140. while (this.reader.readString(4) === sig.CENTRAL_FILE_HEADER) {
  77141. file = new ZipEntry({
  77142. zip64: this.zip64
  77143. }, this.loadOptions);
  77144. file.readCentralPart(this.reader);
  77145. this.files.push(file);
  77146. }
  77147. },
  77148. /**
  77149. * Read the end of central directory.
  77150. */
  77151. readEndOfCentral: function() {
  77152. var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
  77153. if (offset === -1) {
  77154. throw new Error("Corrupted zip : can't find end of central directory");
  77155. }
  77156. this.reader.setIndex(offset);
  77157. this.checkSignature(sig.CENTRAL_DIRECTORY_END);
  77158. this.readBlockEndOfCentral();
  77159. /* extract from the zip spec :
  77160. 4) If one of the fields in the end of central directory
  77161. record is too small to hold required data, the field
  77162. should be set to -1 (0xFFFF or 0xFFFFFFFF) and the
  77163. ZIP64 format record should be created.
  77164. 5) The end of central directory record and the
  77165. Zip64 end of central directory locator record must
  77166. reside on the same disk when splitting or spanning
  77167. an archive.
  77168. */
  77169. if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) {
  77170. this.zip64 = true;
  77171. /*
  77172. Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from
  77173. the zip file can fit into a 32bits integer. This cannot be solved : Javascript represents
  77174. all numbers as 64-bit double precision IEEE 754 floating point numbers.
  77175. So, we have 53bits for integers and bitwise operations treat everything as 32bits.
  77176. see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators
  77177. and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5
  77178. */
  77179. // should look for a zip64 EOCD locator
  77180. offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
  77181. if (offset === -1) {
  77182. throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");
  77183. }
  77184. this.reader.setIndex(offset);
  77185. this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
  77186. this.readBlockZip64EndOfCentralLocator();
  77187. // now the zip64 EOCD record
  77188. this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);
  77189. this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);
  77190. this.readBlockZip64EndOfCentral();
  77191. }
  77192. },
  77193. prepareReader: function(data) {
  77194. var type = utils.getTypeOf(data);
  77195. if (type === "string" && !support.uint8array) {
  77196. this.reader = new StringReader(data, this.loadOptions.optimizedBinaryString);
  77197. }
  77198. else if (type === "nodebuffer") {
  77199. this.reader = new NodeBufferReader(data);
  77200. }
  77201. else {
  77202. this.reader = new Uint8ArrayReader(utils.transformTo("uint8array", data));
  77203. }
  77204. },
  77205. /**
  77206. * Read a zip file and create ZipEntries.
  77207. * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.
  77208. */
  77209. load: function(data) {
  77210. this.prepareReader(data);
  77211. this.readEndOfCentral();
  77212. this.readCentralDir();
  77213. this.readLocalFiles();
  77214. }
  77215. };
  77216. // }}} end of ZipEntries
  77217. module.exports = ZipEntries;
  77218. },{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(_dereq_,module,exports){
  77219. 'use strict';
  77220. var StringReader = _dereq_('./stringReader');
  77221. var utils = _dereq_('./utils');
  77222. var CompressedObject = _dereq_('./compressedObject');
  77223. var jszipProto = _dereq_('./object');
  77224. // class ZipEntry {{{
  77225. /**
  77226. * An entry in the zip file.
  77227. * @constructor
  77228. * @param {Object} options Options of the current file.
  77229. * @param {Object} loadOptions Options for loading the stream.
  77230. */
  77231. function ZipEntry(options, loadOptions) {
  77232. this.options = options;
  77233. this.loadOptions = loadOptions;
  77234. }
  77235. ZipEntry.prototype = {
  77236. /**
  77237. * say if the file is encrypted.
  77238. * @return {boolean} true if the file is encrypted, false otherwise.
  77239. */
  77240. isEncrypted: function() {
  77241. // bit 1 is set
  77242. return (this.bitFlag & 0x0001) === 0x0001;
  77243. },
  77244. /**
  77245. * say if the file has utf-8 filename/comment.
  77246. * @return {boolean} true if the filename/comment is in utf-8, false otherwise.
  77247. */
  77248. useUTF8: function() {
  77249. // bit 11 is set
  77250. return (this.bitFlag & 0x0800) === 0x0800;
  77251. },
  77252. /**
  77253. * Prepare the function used to generate the compressed content from this ZipFile.
  77254. * @param {DataReader} reader the reader to use.
  77255. * @param {number} from the offset from where we should read the data.
  77256. * @param {number} length the length of the data to read.
  77257. * @return {Function} the callback to get the compressed content (the type depends of the DataReader class).
  77258. */
  77259. prepareCompressedContent: function(reader, from, length) {
  77260. return function() {
  77261. var previousIndex = reader.index;
  77262. reader.setIndex(from);
  77263. var compressedFileData = reader.readData(length);
  77264. reader.setIndex(previousIndex);
  77265. return compressedFileData;
  77266. };
  77267. },
  77268. /**
  77269. * Prepare the function used to generate the uncompressed content from this ZipFile.
  77270. * @param {DataReader} reader the reader to use.
  77271. * @param {number} from the offset from where we should read the data.
  77272. * @param {number} length the length of the data to read.
  77273. * @param {JSZip.compression} compression the compression used on this file.
  77274. * @param {number} uncompressedSize the uncompressed size to expect.
  77275. * @return {Function} the callback to get the uncompressed content (the type depends of the DataReader class).
  77276. */
  77277. prepareContent: function(reader, from, length, compression, uncompressedSize) {
  77278. return function() {
  77279. var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent());
  77280. var uncompressedFileData = compression.uncompress(compressedFileData);
  77281. if (uncompressedFileData.length !== uncompressedSize) {
  77282. throw new Error("Bug : uncompressed data size mismatch");
  77283. }
  77284. return uncompressedFileData;
  77285. };
  77286. },
  77287. /**
  77288. * Read the local part of a zip file and add the info in this object.
  77289. * @param {DataReader} reader the reader to use.
  77290. */
  77291. readLocalPart: function(reader) {
  77292. var compression, localExtraFieldsLength;
  77293. // we already know everything from the central dir !
  77294. // If the central dir data are false, we are doomed.
  77295. // On the bright side, the local part is scary : zip64, data descriptors, both, etc.
  77296. // The less data we get here, the more reliable this should be.
  77297. // Let's skip the whole header and dash to the data !
  77298. reader.skip(22);
  77299. // in some zip created on windows, the filename stored in the central dir contains \ instead of /.
  77300. // Strangely, the filename here is OK.
  77301. // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes
  77302. // or APPNOTE#4.4.17.1, "All slashes MUST be forward slashes '/'") but there are a lot of bad zip generators...
  77303. // Search "unzip mismatching "local" filename continuing with "central" filename version" on
  77304. // the internet.
  77305. //
  77306. // I think I see the logic here : the central directory is used to display
  77307. // content and the local directory is used to extract the files. Mixing / and \
  77308. // may be used to display \ to windows users and use / when extracting the files.
  77309. // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394
  77310. this.fileNameLength = reader.readInt(2);
  77311. localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir
  77312. this.fileName = reader.readString(this.fileNameLength);
  77313. reader.skip(localExtraFieldsLength);
  77314. if (this.compressedSize == -1 || this.uncompressedSize == -1) {
  77315. throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize == -1 || uncompressedSize == -1)");
  77316. }
  77317. compression = utils.findCompression(this.compressionMethod);
  77318. if (compression === null) { // no compression found
  77319. throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + this.fileName + ")");
  77320. }
  77321. this.decompressed = new CompressedObject();
  77322. this.decompressed.compressedSize = this.compressedSize;
  77323. this.decompressed.uncompressedSize = this.uncompressedSize;
  77324. this.decompressed.crc32 = this.crc32;
  77325. this.decompressed.compressionMethod = this.compressionMethod;
  77326. this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression);
  77327. this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize);
  77328. // we need to compute the crc32...
  77329. if (this.loadOptions.checkCRC32) {
  77330. this.decompressed = utils.transformTo("string", this.decompressed.getContent());
  77331. if (jszipProto.crc32(this.decompressed) !== this.crc32) {
  77332. throw new Error("Corrupted zip : CRC32 mismatch");
  77333. }
  77334. }
  77335. },
  77336. /**
  77337. * Read the central part of a zip file and add the info in this object.
  77338. * @param {DataReader} reader the reader to use.
  77339. */
  77340. readCentralPart: function(reader) {
  77341. this.versionMadeBy = reader.readString(2);
  77342. this.versionNeeded = reader.readInt(2);
  77343. this.bitFlag = reader.readInt(2);
  77344. this.compressionMethod = reader.readString(2);
  77345. this.date = reader.readDate();
  77346. this.crc32 = reader.readInt(4);
  77347. this.compressedSize = reader.readInt(4);
  77348. this.uncompressedSize = reader.readInt(4);
  77349. this.fileNameLength = reader.readInt(2);
  77350. this.extraFieldsLength = reader.readInt(2);
  77351. this.fileCommentLength = reader.readInt(2);
  77352. this.diskNumberStart = reader.readInt(2);
  77353. this.internalFileAttributes = reader.readInt(2);
  77354. this.externalFileAttributes = reader.readInt(4);
  77355. this.localHeaderOffset = reader.readInt(4);
  77356. if (this.isEncrypted()) {
  77357. throw new Error("Encrypted zip are not supported");
  77358. }
  77359. this.fileName = reader.readString(this.fileNameLength);
  77360. this.readExtraFields(reader);
  77361. this.parseZIP64ExtraField(reader);
  77362. this.fileComment = reader.readString(this.fileCommentLength);
  77363. // warning, this is true only for zip with madeBy == DOS (plateform dependent feature)
  77364. this.dir = this.externalFileAttributes & 0x00000010 ? true : false;
  77365. },
  77366. /**
  77367. * Parse the ZIP64 extra field and merge the info in the current ZipEntry.
  77368. * @param {DataReader} reader the reader to use.
  77369. */
  77370. parseZIP64ExtraField: function(reader) {
  77371. if (!this.extraFields[0x0001]) {
  77372. return;
  77373. }
  77374. // should be something, preparing the extra reader
  77375. var extraReader = new StringReader(this.extraFields[0x0001].value);
  77376. // I really hope that these 64bits integer can fit in 32 bits integer, because js
  77377. // won't let us have more.
  77378. if (this.uncompressedSize === utils.MAX_VALUE_32BITS) {
  77379. this.uncompressedSize = extraReader.readInt(8);
  77380. }
  77381. if (this.compressedSize === utils.MAX_VALUE_32BITS) {
  77382. this.compressedSize = extraReader.readInt(8);
  77383. }
  77384. if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) {
  77385. this.localHeaderOffset = extraReader.readInt(8);
  77386. }
  77387. if (this.diskNumberStart === utils.MAX_VALUE_32BITS) {
  77388. this.diskNumberStart = extraReader.readInt(4);
  77389. }
  77390. },
  77391. /**
  77392. * Read the central part of a zip file and add the info in this object.
  77393. * @param {DataReader} reader the reader to use.
  77394. */
  77395. readExtraFields: function(reader) {
  77396. var start = reader.index,
  77397. extraFieldId,
  77398. extraFieldLength,
  77399. extraFieldValue;
  77400. this.extraFields = this.extraFields || {};
  77401. while (reader.index < start + this.extraFieldsLength) {
  77402. extraFieldId = reader.readInt(2);
  77403. extraFieldLength = reader.readInt(2);
  77404. extraFieldValue = reader.readString(extraFieldLength);
  77405. this.extraFields[extraFieldId] = {
  77406. id: extraFieldId,
  77407. length: extraFieldLength,
  77408. value: extraFieldValue
  77409. };
  77410. }
  77411. },
  77412. /**
  77413. * Apply an UTF8 transformation if needed.
  77414. */
  77415. handleUTF8: function() {
  77416. if (this.useUTF8()) {
  77417. this.fileName = jszipProto.utf8decode(this.fileName);
  77418. this.fileComment = jszipProto.utf8decode(this.fileComment);
  77419. } else {
  77420. var upath = this.findExtraFieldUnicodePath();
  77421. if (upath !== null) {
  77422. this.fileName = upath;
  77423. }
  77424. var ucomment = this.findExtraFieldUnicodeComment();
  77425. if (ucomment !== null) {
  77426. this.fileComment = ucomment;
  77427. }
  77428. }
  77429. },
  77430. /**
  77431. * Find the unicode path declared in the extra field, if any.
  77432. * @return {String} the unicode path, null otherwise.
  77433. */
  77434. findExtraFieldUnicodePath: function() {
  77435. var upathField = this.extraFields[0x7075];
  77436. if (upathField) {
  77437. var extraReader = new StringReader(upathField.value);
  77438. // wrong version
  77439. if (extraReader.readInt(1) !== 1) {
  77440. return null;
  77441. }
  77442. // the crc of the filename changed, this field is out of date.
  77443. if (jszipProto.crc32(this.fileName) !== extraReader.readInt(4)) {
  77444. return null;
  77445. }
  77446. return jszipProto.utf8decode(extraReader.readString(upathField.length - 5));
  77447. }
  77448. return null;
  77449. },
  77450. /**
  77451. * Find the unicode comment declared in the extra field, if any.
  77452. * @return {String} the unicode comment, null otherwise.
  77453. */
  77454. findExtraFieldUnicodeComment: function() {
  77455. var ucommentField = this.extraFields[0x6375];
  77456. if (ucommentField) {
  77457. var extraReader = new StringReader(ucommentField.value);
  77458. // wrong version
  77459. if (extraReader.readInt(1) !== 1) {
  77460. return null;
  77461. }
  77462. // the crc of the comment changed, this field is out of date.
  77463. if (jszipProto.crc32(this.fileComment) !== extraReader.readInt(4)) {
  77464. return null;
  77465. }
  77466. return jszipProto.utf8decode(extraReader.readString(ucommentField.length - 5));
  77467. }
  77468. return null;
  77469. }
  77470. };
  77471. module.exports = ZipEntry;
  77472. },{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(_dereq_,module,exports){
  77473. // Top level file is just a mixin of submodules & constants
  77474. 'use strict';
  77475. var assign = _dereq_('./lib/utils/common').assign;
  77476. var deflate = _dereq_('./lib/deflate');
  77477. var inflate = _dereq_('./lib/inflate');
  77478. var constants = _dereq_('./lib/zlib/constants');
  77479. var pako = {};
  77480. assign(pako, deflate, inflate, constants);
  77481. module.exports = pako;
  77482. },{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(_dereq_,module,exports){
  77483. 'use strict';
  77484. var zlib_deflate = _dereq_('./zlib/deflate.js');
  77485. var utils = _dereq_('./utils/common');
  77486. var strings = _dereq_('./utils/strings');
  77487. var msg = _dereq_('./zlib/messages');
  77488. var zstream = _dereq_('./zlib/zstream');
  77489. /* Public constants ==========================================================*/
  77490. /* ===========================================================================*/
  77491. var Z_NO_FLUSH = 0;
  77492. var Z_FINISH = 4;
  77493. var Z_OK = 0;
  77494. var Z_STREAM_END = 1;
  77495. var Z_DEFAULT_COMPRESSION = -1;
  77496. var Z_DEFAULT_STRATEGY = 0;
  77497. var Z_DEFLATED = 8;
  77498. /* ===========================================================================*/
  77499. /**
  77500. * class Deflate
  77501. *
  77502. * Generic JS-style wrapper for zlib calls. If you don't need
  77503. * streaming behaviour - use more simple functions: [[deflate]],
  77504. * [[deflateRaw]] and [[gzip]].
  77505. **/
  77506. /* internal
  77507. * Deflate.chunks -> Array
  77508. *
  77509. * Chunks of output data, if [[Deflate#onData]] not overriden.
  77510. **/
  77511. /**
  77512. * Deflate.result -> Uint8Array|Array
  77513. *
  77514. * Compressed result, generated by default [[Deflate#onData]]
  77515. * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
  77516. * (call [[Deflate#push]] with `Z_FINISH` / `true` param).
  77517. **/
  77518. /**
  77519. * Deflate.err -> Number
  77520. *
  77521. * Error code after deflate finished. 0 (Z_OK) on success.
  77522. * You will not need it in real life, because deflate errors
  77523. * are possible only on wrong options or bad `onData` / `onEnd`
  77524. * custom handlers.
  77525. **/
  77526. /**
  77527. * Deflate.msg -> String
  77528. *
  77529. * Error message, if [[Deflate.err]] != 0
  77530. **/
  77531. /**
  77532. * new Deflate(options)
  77533. * - options (Object): zlib deflate options.
  77534. *
  77535. * Creates new deflator instance with specified params. Throws exception
  77536. * on bad params. Supported options:
  77537. *
  77538. * - `level`
  77539. * - `windowBits`
  77540. * - `memLevel`
  77541. * - `strategy`
  77542. *
  77543. * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
  77544. * for more information on these.
  77545. *
  77546. * Additional options, for internal needs:
  77547. *
  77548. * - `chunkSize` - size of generated data chunks (16K by default)
  77549. * - `raw` (Boolean) - do raw deflate
  77550. * - `gzip` (Boolean) - create gzip wrapper
  77551. * - `to` (String) - if equal to 'string', then result will be "binary string"
  77552. * (each char code [0..255])
  77553. * - `header` (Object) - custom header for gzip
  77554. * - `text` (Boolean) - true if compressed data believed to be text
  77555. * - `time` (Number) - modification time, unix timestamp
  77556. * - `os` (Number) - operation system code
  77557. * - `extra` (Array) - array of bytes with extra data (max 65536)
  77558. * - `name` (String) - file name (binary string)
  77559. * - `comment` (String) - comment (binary string)
  77560. * - `hcrc` (Boolean) - true if header crc should be added
  77561. *
  77562. * ##### Example:
  77563. *
  77564. * ```javascript
  77565. * var pako = require('pako')
  77566. * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
  77567. * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
  77568. *
  77569. * var deflate = new pako.Deflate({ level: 3});
  77570. *
  77571. * deflate.push(chunk1, false);
  77572. * deflate.push(chunk2, true); // true -> last chunk
  77573. *
  77574. * if (deflate.err) { throw new Error(deflate.err); }
  77575. *
  77576. * console.log(deflate.result);
  77577. * ```
  77578. **/
  77579. var Deflate = function(options) {
  77580. this.options = utils.assign({
  77581. level: Z_DEFAULT_COMPRESSION,
  77582. method: Z_DEFLATED,
  77583. chunkSize: 16384,
  77584. windowBits: 15,
  77585. memLevel: 8,
  77586. strategy: Z_DEFAULT_STRATEGY,
  77587. to: ''
  77588. }, options || {});
  77589. var opt = this.options;
  77590. if (opt.raw && (opt.windowBits > 0)) {
  77591. opt.windowBits = -opt.windowBits;
  77592. }
  77593. else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
  77594. opt.windowBits += 16;
  77595. }
  77596. this.err = 0; // error code, if happens (0 = Z_OK)
  77597. this.msg = ''; // error message
  77598. this.ended = false; // used to avoid multiple onEnd() calls
  77599. this.chunks = []; // chunks of compressed data
  77600. this.strm = new zstream();
  77601. this.strm.avail_out = 0;
  77602. var status = zlib_deflate.deflateInit2(
  77603. this.strm,
  77604. opt.level,
  77605. opt.method,
  77606. opt.windowBits,
  77607. opt.memLevel,
  77608. opt.strategy
  77609. );
  77610. if (status !== Z_OK) {
  77611. throw new Error(msg[status]);
  77612. }
  77613. if (opt.header) {
  77614. zlib_deflate.deflateSetHeader(this.strm, opt.header);
  77615. }
  77616. };
  77617. /**
  77618. * Deflate#push(data[, mode]) -> Boolean
  77619. * - data (Uint8Array|Array|String): input data. Strings will be converted to
  77620. * utf8 byte sequence.
  77621. * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
  77622. * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
  77623. *
  77624. * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
  77625. * new compressed chunks. Returns `true` on success. The last data block must have
  77626. * mode Z_FINISH (or `true`). That flush internal pending buffers and call
  77627. * [[Deflate#onEnd]].
  77628. *
  77629. * On fail call [[Deflate#onEnd]] with error code and return false.
  77630. *
  77631. * We strongly recommend to use `Uint8Array` on input for best speed (output
  77632. * array format is detected automatically). Also, don't skip last param and always
  77633. * use the same type in your code (boolean or number). That will improve JS speed.
  77634. *
  77635. * For regular `Array`-s make sure all elements are [0..255].
  77636. *
  77637. * ##### Example
  77638. *
  77639. * ```javascript
  77640. * push(chunk, false); // push one of data chunks
  77641. * ...
  77642. * push(chunk, true); // push last chunk
  77643. * ```
  77644. **/
  77645. Deflate.prototype.push = function(data, mode) {
  77646. var strm = this.strm;
  77647. var chunkSize = this.options.chunkSize;
  77648. var status, _mode;
  77649. if (this.ended) { return false; }
  77650. _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);
  77651. // Convert data if needed
  77652. if (typeof data === 'string') {
  77653. // If we need to compress text, change encoding to utf8.
  77654. strm.input = strings.string2buf(data);
  77655. } else {
  77656. strm.input = data;
  77657. }
  77658. strm.next_in = 0;
  77659. strm.avail_in = strm.input.length;
  77660. do {
  77661. if (strm.avail_out === 0) {
  77662. strm.output = new utils.Buf8(chunkSize);
  77663. strm.next_out = 0;
  77664. strm.avail_out = chunkSize;
  77665. }
  77666. status = zlib_deflate.deflate(strm, _mode); /* no bad return value */
  77667. if (status !== Z_STREAM_END && status !== Z_OK) {
  77668. this.onEnd(status);
  77669. this.ended = true;
  77670. return false;
  77671. }
  77672. if (strm.avail_out === 0 || (strm.avail_in === 0 && _mode === Z_FINISH)) {
  77673. if (this.options.to === 'string') {
  77674. this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
  77675. } else {
  77676. this.onData(utils.shrinkBuf(strm.output, strm.next_out));
  77677. }
  77678. }
  77679. } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
  77680. // Finalize on the last chunk.
  77681. if (_mode === Z_FINISH) {
  77682. status = zlib_deflate.deflateEnd(this.strm);
  77683. this.onEnd(status);
  77684. this.ended = true;
  77685. return status === Z_OK;
  77686. }
  77687. return true;
  77688. };
  77689. /**
  77690. * Deflate#onData(chunk) -> Void
  77691. * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
  77692. * on js engine support. When string output requested, each chunk
  77693. * will be string.
  77694. *
  77695. * By default, stores data blocks in `chunks[]` property and glue
  77696. * those in `onEnd`. Override this handler, if you need another behaviour.
  77697. **/
  77698. Deflate.prototype.onData = function(chunk) {
  77699. this.chunks.push(chunk);
  77700. };
  77701. /**
  77702. * Deflate#onEnd(status) -> Void
  77703. * - status (Number): deflate status. 0 (Z_OK) on success,
  77704. * other if not.
  77705. *
  77706. * Called once after you tell deflate that input stream complete
  77707. * or error happenned. By default - join collected chunks,
  77708. * free memory and fill `results` / `err` properties.
  77709. **/
  77710. Deflate.prototype.onEnd = function(status) {
  77711. // On success - join
  77712. if (status === Z_OK) {
  77713. if (this.options.to === 'string') {
  77714. this.result = this.chunks.join('');
  77715. } else {
  77716. this.result = utils.flattenChunks(this.chunks);
  77717. }
  77718. }
  77719. this.chunks = [];
  77720. this.err = status;
  77721. this.msg = this.strm.msg;
  77722. };
  77723. /**
  77724. * deflate(data[, options]) -> Uint8Array|Array|String
  77725. * - data (Uint8Array|Array|String): input data to compress.
  77726. * - options (Object): zlib deflate options.
  77727. *
  77728. * Compress `data` with deflate alrorythm and `options`.
  77729. *
  77730. * Supported options are:
  77731. *
  77732. * - level
  77733. * - windowBits
  77734. * - memLevel
  77735. * - strategy
  77736. *
  77737. * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
  77738. * for more information on these.
  77739. *
  77740. * Sugar (options):
  77741. *
  77742. * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
  77743. * negative windowBits implicitly.
  77744. * - `to` (String) - if equal to 'string', then result will be "binary string"
  77745. * (each char code [0..255])
  77746. *
  77747. * ##### Example:
  77748. *
  77749. * ```javascript
  77750. * var pako = require('pako')
  77751. * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
  77752. *
  77753. * console.log(pako.deflate(data));
  77754. * ```
  77755. **/
  77756. function deflate(input, options) {
  77757. var deflator = new Deflate(options);
  77758. deflator.push(input, true);
  77759. // That will never happens, if you don't cheat with options :)
  77760. if (deflator.err) { throw deflator.msg; }
  77761. return deflator.result;
  77762. }
  77763. /**
  77764. * deflateRaw(data[, options]) -> Uint8Array|Array|String
  77765. * - data (Uint8Array|Array|String): input data to compress.
  77766. * - options (Object): zlib deflate options.
  77767. *
  77768. * The same as [[deflate]], but creates raw data, without wrapper
  77769. * (header and adler32 crc).
  77770. **/
  77771. function deflateRaw(input, options) {
  77772. options = options || {};
  77773. options.raw = true;
  77774. return deflate(input, options);
  77775. }
  77776. /**
  77777. * gzip(data[, options]) -> Uint8Array|Array|String
  77778. * - data (Uint8Array|Array|String): input data to compress.
  77779. * - options (Object): zlib deflate options.
  77780. *
  77781. * The same as [[deflate]], but create gzip wrapper instead of
  77782. * deflate one.
  77783. **/
  77784. function gzip(input, options) {
  77785. options = options || {};
  77786. options.gzip = true;
  77787. return deflate(input, options);
  77788. }
  77789. exports.Deflate = Deflate;
  77790. exports.deflate = deflate;
  77791. exports.deflateRaw = deflateRaw;
  77792. exports.gzip = gzip;
  77793. },{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(_dereq_,module,exports){
  77794. 'use strict';
  77795. var zlib_inflate = _dereq_('./zlib/inflate.js');
  77796. var utils = _dereq_('./utils/common');
  77797. var strings = _dereq_('./utils/strings');
  77798. var c = _dereq_('./zlib/constants');
  77799. var msg = _dereq_('./zlib/messages');
  77800. var zstream = _dereq_('./zlib/zstream');
  77801. var gzheader = _dereq_('./zlib/gzheader');
  77802. /**
  77803. * class Inflate
  77804. *
  77805. * Generic JS-style wrapper for zlib calls. If you don't need
  77806. * streaming behaviour - use more simple functions: [[inflate]]
  77807. * and [[inflateRaw]].
  77808. **/
  77809. /* internal
  77810. * inflate.chunks -> Array
  77811. *
  77812. * Chunks of output data, if [[Inflate#onData]] not overriden.
  77813. **/
  77814. /**
  77815. * Inflate.result -> Uint8Array|Array|String
  77816. *
  77817. * Uncompressed result, generated by default [[Inflate#onData]]
  77818. * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
  77819. * (call [[Inflate#push]] with `Z_FINISH` / `true` param).
  77820. **/
  77821. /**
  77822. * Inflate.err -> Number
  77823. *
  77824. * Error code after inflate finished. 0 (Z_OK) on success.
  77825. * Should be checked if broken data possible.
  77826. **/
  77827. /**
  77828. * Inflate.msg -> String
  77829. *
  77830. * Error message, if [[Inflate.err]] != 0
  77831. **/
  77832. /**
  77833. * new Inflate(options)
  77834. * - options (Object): zlib inflate options.
  77835. *
  77836. * Creates new inflator instance with specified params. Throws exception
  77837. * on bad params. Supported options:
  77838. *
  77839. * - `windowBits`
  77840. *
  77841. * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
  77842. * for more information on these.
  77843. *
  77844. * Additional options, for internal needs:
  77845. *
  77846. * - `chunkSize` - size of generated data chunks (16K by default)
  77847. * - `raw` (Boolean) - do raw inflate
  77848. * - `to` (String) - if equal to 'string', then result will be converted
  77849. * from utf8 to utf16 (javascript) string. When string output requested,
  77850. * chunk length can differ from `chunkSize`, depending on content.
  77851. *
  77852. * By default, when no options set, autodetect deflate/gzip data format via
  77853. * wrapper header.
  77854. *
  77855. * ##### Example:
  77856. *
  77857. * ```javascript
  77858. * var pako = require('pako')
  77859. * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
  77860. * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
  77861. *
  77862. * var inflate = new pako.Inflate({ level: 3});
  77863. *
  77864. * inflate.push(chunk1, false);
  77865. * inflate.push(chunk2, true); // true -> last chunk
  77866. *
  77867. * if (inflate.err) { throw new Error(inflate.err); }
  77868. *
  77869. * console.log(inflate.result);
  77870. * ```
  77871. **/
  77872. var Inflate = function(options) {
  77873. this.options = utils.assign({
  77874. chunkSize: 16384,
  77875. windowBits: 0,
  77876. to: ''
  77877. }, options || {});
  77878. var opt = this.options;
  77879. // Force window size for `raw` data, if not set directly,
  77880. // because we have no header for autodetect.
  77881. if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
  77882. opt.windowBits = -opt.windowBits;
  77883. if (opt.windowBits === 0) { opt.windowBits = -15; }
  77884. }
  77885. // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
  77886. if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
  77887. !(options && options.windowBits)) {
  77888. opt.windowBits += 32;
  77889. }
  77890. // Gzip header has no info about windows size, we can do autodetect only
  77891. // for deflate. So, if window size not set, force it to max when gzip possible
  77892. if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
  77893. // bit 3 (16) -> gzipped data
  77894. // bit 4 (32) -> autodetect gzip/deflate
  77895. if ((opt.windowBits & 15) === 0) {
  77896. opt.windowBits |= 15;
  77897. }
  77898. }
  77899. this.err = 0; // error code, if happens (0 = Z_OK)
  77900. this.msg = ''; // error message
  77901. this.ended = false; // used to avoid multiple onEnd() calls
  77902. this.chunks = []; // chunks of compressed data
  77903. this.strm = new zstream();
  77904. this.strm.avail_out = 0;
  77905. var status = zlib_inflate.inflateInit2(
  77906. this.strm,
  77907. opt.windowBits
  77908. );
  77909. if (status !== c.Z_OK) {
  77910. throw new Error(msg[status]);
  77911. }
  77912. this.header = new gzheader();
  77913. zlib_inflate.inflateGetHeader(this.strm, this.header);
  77914. };
  77915. /**
  77916. * Inflate#push(data[, mode]) -> Boolean
  77917. * - data (Uint8Array|Array|String): input data
  77918. * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
  77919. * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
  77920. *
  77921. * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
  77922. * new output chunks. Returns `true` on success. The last data block must have
  77923. * mode Z_FINISH (or `true`). That flush internal pending buffers and call
  77924. * [[Inflate#onEnd]].
  77925. *
  77926. * On fail call [[Inflate#onEnd]] with error code and return false.
  77927. *
  77928. * We strongly recommend to use `Uint8Array` on input for best speed (output
  77929. * format is detected automatically). Also, don't skip last param and always
  77930. * use the same type in your code (boolean or number). That will improve JS speed.
  77931. *
  77932. * For regular `Array`-s make sure all elements are [0..255].
  77933. *
  77934. * ##### Example
  77935. *
  77936. * ```javascript
  77937. * push(chunk, false); // push one of data chunks
  77938. * ...
  77939. * push(chunk, true); // push last chunk
  77940. * ```
  77941. **/
  77942. Inflate.prototype.push = function(data, mode) {
  77943. var strm = this.strm;
  77944. var chunkSize = this.options.chunkSize;
  77945. var status, _mode;
  77946. var next_out_utf8, tail, utf8str;
  77947. if (this.ended) { return false; }
  77948. _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
  77949. // Convert data if needed
  77950. if (typeof data === 'string') {
  77951. // Only binary strings can be decompressed on practice
  77952. strm.input = strings.binstring2buf(data);
  77953. } else {
  77954. strm.input = data;
  77955. }
  77956. strm.next_in = 0;
  77957. strm.avail_in = strm.input.length;
  77958. do {
  77959. if (strm.avail_out === 0) {
  77960. strm.output = new utils.Buf8(chunkSize);
  77961. strm.next_out = 0;
  77962. strm.avail_out = chunkSize;
  77963. }
  77964. status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
  77965. if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
  77966. this.onEnd(status);
  77967. this.ended = true;
  77968. return false;
  77969. }
  77970. if (strm.next_out) {
  77971. if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && _mode === c.Z_FINISH)) {
  77972. if (this.options.to === 'string') {
  77973. next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
  77974. tail = strm.next_out - next_out_utf8;
  77975. utf8str = strings.buf2string(strm.output, next_out_utf8);
  77976. // move tail
  77977. strm.next_out = tail;
  77978. strm.avail_out = chunkSize - tail;
  77979. if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
  77980. this.onData(utf8str);
  77981. } else {
  77982. this.onData(utils.shrinkBuf(strm.output, strm.next_out));
  77983. }
  77984. }
  77985. }
  77986. } while ((strm.avail_in > 0) && status !== c.Z_STREAM_END);
  77987. if (status === c.Z_STREAM_END) {
  77988. _mode = c.Z_FINISH;
  77989. }
  77990. // Finalize on the last chunk.
  77991. if (_mode === c.Z_FINISH) {
  77992. status = zlib_inflate.inflateEnd(this.strm);
  77993. this.onEnd(status);
  77994. this.ended = true;
  77995. return status === c.Z_OK;
  77996. }
  77997. return true;
  77998. };
  77999. /**
  78000. * Inflate#onData(chunk) -> Void
  78001. * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
  78002. * on js engine support. When string output requested, each chunk
  78003. * will be string.
  78004. *
  78005. * By default, stores data blocks in `chunks[]` property and glue
  78006. * those in `onEnd`. Override this handler, if you need another behaviour.
  78007. **/
  78008. Inflate.prototype.onData = function(chunk) {
  78009. this.chunks.push(chunk);
  78010. };
  78011. /**
  78012. * Inflate#onEnd(status) -> Void
  78013. * - status (Number): inflate status. 0 (Z_OK) on success,
  78014. * other if not.
  78015. *
  78016. * Called once after you tell inflate that input stream complete
  78017. * or error happenned. By default - join collected chunks,
  78018. * free memory and fill `results` / `err` properties.
  78019. **/
  78020. Inflate.prototype.onEnd = function(status) {
  78021. // On success - join
  78022. if (status === c.Z_OK) {
  78023. if (this.options.to === 'string') {
  78024. // Glue & convert here, until we teach pako to send
  78025. // utf8 alligned strings to onData
  78026. this.result = this.chunks.join('');
  78027. } else {
  78028. this.result = utils.flattenChunks(this.chunks);
  78029. }
  78030. }
  78031. this.chunks = [];
  78032. this.err = status;
  78033. this.msg = this.strm.msg;
  78034. };
  78035. /**
  78036. * inflate(data[, options]) -> Uint8Array|Array|String
  78037. * - data (Uint8Array|Array|String): input data to decompress.
  78038. * - options (Object): zlib inflate options.
  78039. *
  78040. * Decompress `data` with inflate/ungzip and `options`. Autodetect
  78041. * format via wrapper header by default. That's why we don't provide
  78042. * separate `ungzip` method.
  78043. *
  78044. * Supported options are:
  78045. *
  78046. * - windowBits
  78047. *
  78048. * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
  78049. * for more information.
  78050. *
  78051. * Sugar (options):
  78052. *
  78053. * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
  78054. * negative windowBits implicitly.
  78055. * - `to` (String) - if equal to 'string', then result will be converted
  78056. * from utf8 to utf16 (javascript) string. When string output requested,
  78057. * chunk length can differ from `chunkSize`, depending on content.
  78058. *
  78059. *
  78060. * ##### Example:
  78061. *
  78062. * ```javascript
  78063. * var pako = require('pako')
  78064. * , input = pako.deflate([1,2,3,4,5,6,7,8,9])
  78065. * , output;
  78066. *
  78067. * try {
  78068. * output = pako.inflate(input);
  78069. * } catch (err)
  78070. * console.log(err);
  78071. * }
  78072. * ```
  78073. **/
  78074. function inflate(input, options) {
  78075. var inflator = new Inflate(options);
  78076. inflator.push(input, true);
  78077. // That will never happens, if you don't cheat with options :)
  78078. if (inflator.err) { throw inflator.msg; }
  78079. return inflator.result;
  78080. }
  78081. /**
  78082. * inflateRaw(data[, options]) -> Uint8Array|Array|String
  78083. * - data (Uint8Array|Array|String): input data to decompress.
  78084. * - options (Object): zlib inflate options.
  78085. *
  78086. * The same as [[inflate]], but creates raw data, without wrapper
  78087. * (header and adler32 crc).
  78088. **/
  78089. function inflateRaw(input, options) {
  78090. options = options || {};
  78091. options.raw = true;
  78092. return inflate(input, options);
  78093. }
  78094. /**
  78095. * ungzip(data[, options]) -> Uint8Array|Array|String
  78096. * - data (Uint8Array|Array|String): input data to decompress.
  78097. * - options (Object): zlib inflate options.
  78098. *
  78099. * Just shortcut to [[inflate]], because it autodetects format
  78100. * by header.content. Done for convenience.
  78101. **/
  78102. exports.Inflate = Inflate;
  78103. exports.inflate = inflate;
  78104. exports.inflateRaw = inflateRaw;
  78105. exports.ungzip = inflate;
  78106. },{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(_dereq_,module,exports){
  78107. 'use strict';
  78108. var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
  78109. (typeof Uint16Array !== 'undefined') &&
  78110. (typeof Int32Array !== 'undefined');
  78111. exports.assign = function (obj /*from1, from2, from3, ...*/) {
  78112. var sources = Array.prototype.slice.call(arguments, 1);
  78113. while (sources.length) {
  78114. var source = sources.shift();
  78115. if (!source) { continue; }
  78116. if (typeof(source) !== 'object') {
  78117. throw new TypeError(source + 'must be non-object');
  78118. }
  78119. for (var p in source) {
  78120. if (source.hasOwnProperty(p)) {
  78121. obj[p] = source[p];
  78122. }
  78123. }
  78124. }
  78125. return obj;
  78126. };
  78127. // reduce buffer size, avoiding mem copy
  78128. exports.shrinkBuf = function (buf, size) {
  78129. if (buf.length === size) { return buf; }
  78130. if (buf.subarray) { return buf.subarray(0, size); }
  78131. buf.length = size;
  78132. return buf;
  78133. };
  78134. var fnTyped = {
  78135. arraySet: function (dest, src, src_offs, len, dest_offs) {
  78136. if (src.subarray && dest.subarray) {
  78137. dest.set(src.subarray(src_offs, src_offs+len), dest_offs);
  78138. return;
  78139. }
  78140. // Fallback to ordinary array
  78141. for(var i=0; i<len; i++) {
  78142. dest[dest_offs + i] = src[src_offs + i];
  78143. }
  78144. },
  78145. // Join array of chunks to single array.
  78146. flattenChunks: function(chunks) {
  78147. var i, l, len, pos, chunk, result;
  78148. // calculate data length
  78149. len = 0;
  78150. for (i=0, l=chunks.length; i<l; i++) {
  78151. len += chunks[i].length;
  78152. }
  78153. // join chunks
  78154. result = new Uint8Array(len);
  78155. pos = 0;
  78156. for (i=0, l=chunks.length; i<l; i++) {
  78157. chunk = chunks[i];
  78158. result.set(chunk, pos);
  78159. pos += chunk.length;
  78160. }
  78161. return result;
  78162. }
  78163. };
  78164. var fnUntyped = {
  78165. arraySet: function (dest, src, src_offs, len, dest_offs) {
  78166. for(var i=0; i<len; i++) {
  78167. dest[dest_offs + i] = src[src_offs + i];
  78168. }
  78169. },
  78170. // Join array of chunks to single array.
  78171. flattenChunks: function(chunks) {
  78172. return [].concat.apply([], chunks);
  78173. }
  78174. };
  78175. // Enable/Disable typed arrays use, for testing
  78176. //
  78177. exports.setTyped = function (on) {
  78178. if (on) {
  78179. exports.Buf8 = Uint8Array;
  78180. exports.Buf16 = Uint16Array;
  78181. exports.Buf32 = Int32Array;
  78182. exports.assign(exports, fnTyped);
  78183. } else {
  78184. exports.Buf8 = Array;
  78185. exports.Buf16 = Array;
  78186. exports.Buf32 = Array;
  78187. exports.assign(exports, fnUntyped);
  78188. }
  78189. };
  78190. exports.setTyped(TYPED_OK);
  78191. },{}],28:[function(_dereq_,module,exports){
  78192. // String encode/decode helpers
  78193. 'use strict';
  78194. var utils = _dereq_('./common');
  78195. // Quick check if we can use fast array to bin string conversion
  78196. //
  78197. // - apply(Array) can fail on Android 2.2
  78198. // - apply(Uint8Array) can fail on iOS 5.1 Safary
  78199. //
  78200. var STR_APPLY_OK = true;
  78201. var STR_APPLY_UIA_OK = true;
  78202. try { String.fromCharCode.apply(null, [0]); } catch(__) { STR_APPLY_OK = false; }
  78203. try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch(__) { STR_APPLY_UIA_OK = false; }
  78204. // Table with utf8 lengths (calculated by first byte of sequence)
  78205. // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
  78206. // because max possible codepoint is 0x10ffff
  78207. var _utf8len = new utils.Buf8(256);
  78208. for (var i=0; i<256; i++) {
  78209. _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
  78210. }
  78211. _utf8len[254]=_utf8len[254]=1; // Invalid sequence start
  78212. // convert string to array (typed, when possible)
  78213. exports.string2buf = function (str) {
  78214. var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
  78215. // count binary size
  78216. for (m_pos = 0; m_pos < str_len; m_pos++) {
  78217. c = str.charCodeAt(m_pos);
  78218. if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
  78219. c2 = str.charCodeAt(m_pos+1);
  78220. if ((c2 & 0xfc00) === 0xdc00) {
  78221. c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
  78222. m_pos++;
  78223. }
  78224. }
  78225. buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
  78226. }
  78227. // allocate buffer
  78228. buf = new utils.Buf8(buf_len);
  78229. // convert
  78230. for (i=0, m_pos = 0; i < buf_len; m_pos++) {
  78231. c = str.charCodeAt(m_pos);
  78232. if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
  78233. c2 = str.charCodeAt(m_pos+1);
  78234. if ((c2 & 0xfc00) === 0xdc00) {
  78235. c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
  78236. m_pos++;
  78237. }
  78238. }
  78239. if (c < 0x80) {
  78240. /* one byte */
  78241. buf[i++] = c;
  78242. } else if (c < 0x800) {
  78243. /* two bytes */
  78244. buf[i++] = 0xC0 | (c >>> 6);
  78245. buf[i++] = 0x80 | (c & 0x3f);
  78246. } else if (c < 0x10000) {
  78247. /* three bytes */
  78248. buf[i++] = 0xE0 | (c >>> 12);
  78249. buf[i++] = 0x80 | (c >>> 6 & 0x3f);
  78250. buf[i++] = 0x80 | (c & 0x3f);
  78251. } else {
  78252. /* four bytes */
  78253. buf[i++] = 0xf0 | (c >>> 18);
  78254. buf[i++] = 0x80 | (c >>> 12 & 0x3f);
  78255. buf[i++] = 0x80 | (c >>> 6 & 0x3f);
  78256. buf[i++] = 0x80 | (c & 0x3f);
  78257. }
  78258. }
  78259. return buf;
  78260. };
  78261. // Helper (used in 2 places)
  78262. function buf2binstring(buf, len) {
  78263. // use fallback for big arrays to avoid stack overflow
  78264. if (len < 65537) {
  78265. if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
  78266. return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
  78267. }
  78268. }
  78269. var result = '';
  78270. for(var i=0; i < len; i++) {
  78271. result += String.fromCharCode(buf[i]);
  78272. }
  78273. return result;
  78274. }
  78275. // Convert byte array to binary string
  78276. exports.buf2binstring = function(buf) {
  78277. return buf2binstring(buf, buf.length);
  78278. };
  78279. // Convert binary string (typed, when possible)
  78280. exports.binstring2buf = function(str) {
  78281. var buf = new utils.Buf8(str.length);
  78282. for(var i=0, len=buf.length; i < len; i++) {
  78283. buf[i] = str.charCodeAt(i);
  78284. }
  78285. return buf;
  78286. };
  78287. // convert array to string
  78288. exports.buf2string = function (buf, max) {
  78289. var i, out, c, c_len;
  78290. var len = max || buf.length;
  78291. // Reserve max possible length (2 words per char)
  78292. // NB: by unknown reasons, Array is significantly faster for
  78293. // String.fromCharCode.apply than Uint16Array.
  78294. var utf16buf = new Array(len*2);
  78295. for (out=0, i=0; i<len;) {
  78296. c = buf[i++];
  78297. // quick process ascii
  78298. if (c < 0x80) { utf16buf[out++] = c; continue; }
  78299. c_len = _utf8len[c];
  78300. // skip 5 & 6 byte codes
  78301. if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }
  78302. // apply mask on first byte
  78303. c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
  78304. // join the rest
  78305. while (c_len > 1 && i < len) {
  78306. c = (c << 6) | (buf[i++] & 0x3f);
  78307. c_len--;
  78308. }
  78309. // terminated by end of string?
  78310. if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
  78311. if (c < 0x10000) {
  78312. utf16buf[out++] = c;
  78313. } else {
  78314. c -= 0x10000;
  78315. utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
  78316. utf16buf[out++] = 0xdc00 | (c & 0x3ff);
  78317. }
  78318. }
  78319. return buf2binstring(utf16buf, out);
  78320. };
  78321. // Calculate max possible position in utf8 buffer,
  78322. // that will not break sequence. If that's not possible
  78323. // - (very small limits) return max size as is.
  78324. //
  78325. // buf[] - utf8 bytes array
  78326. // max - length limit (mandatory);
  78327. exports.utf8border = function(buf, max) {
  78328. var pos;
  78329. max = max || buf.length;
  78330. if (max > buf.length) { max = buf.length; }
  78331. // go back from last position, until start of sequence found
  78332. pos = max-1;
  78333. while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
  78334. // Fuckup - very small and broken sequence,
  78335. // return max, because we should return something anyway.
  78336. if (pos < 0) { return max; }
  78337. // If we came to start of buffer - that means vuffer is too small,
  78338. // return max too.
  78339. if (pos === 0) { return max; }
  78340. return (pos + _utf8len[buf[pos]] > max) ? pos : max;
  78341. };
  78342. },{"./common":27}],29:[function(_dereq_,module,exports){
  78343. 'use strict';
  78344. // Note: adler32 takes 12% for level 0 and 2% for level 6.
  78345. // It doesn't worth to make additional optimizationa as in original.
  78346. // Small size is preferable.
  78347. function adler32(adler, buf, len, pos) {
  78348. var s1 = (adler & 0xffff) |0
  78349. , s2 = ((adler >>> 16) & 0xffff) |0
  78350. , n = 0;
  78351. while (len !== 0) {
  78352. // Set limit ~ twice less than 5552, to keep
  78353. // s2 in 31-bits, because we force signed ints.
  78354. // in other case %= will fail.
  78355. n = len > 2000 ? 2000 : len;
  78356. len -= n;
  78357. do {
  78358. s1 = (s1 + buf[pos++]) |0;
  78359. s2 = (s2 + s1) |0;
  78360. } while (--n);
  78361. s1 %= 65521;
  78362. s2 %= 65521;
  78363. }
  78364. return (s1 | (s2 << 16)) |0;
  78365. }
  78366. module.exports = adler32;
  78367. },{}],30:[function(_dereq_,module,exports){
  78368. module.exports = {
  78369. /* Allowed flush values; see deflate() and inflate() below for details */
  78370. Z_NO_FLUSH: 0,
  78371. Z_PARTIAL_FLUSH: 1,
  78372. Z_SYNC_FLUSH: 2,
  78373. Z_FULL_FLUSH: 3,
  78374. Z_FINISH: 4,
  78375. Z_BLOCK: 5,
  78376. Z_TREES: 6,
  78377. /* Return codes for the compression/decompression functions. Negative values
  78378. * are errors, positive values are used for special but normal events.
  78379. */
  78380. Z_OK: 0,
  78381. Z_STREAM_END: 1,
  78382. Z_NEED_DICT: 2,
  78383. Z_ERRNO: -1,
  78384. Z_STREAM_ERROR: -2,
  78385. Z_DATA_ERROR: -3,
  78386. //Z_MEM_ERROR: -4,
  78387. Z_BUF_ERROR: -5,
  78388. //Z_VERSION_ERROR: -6,
  78389. /* compression levels */
  78390. Z_NO_COMPRESSION: 0,
  78391. Z_BEST_SPEED: 1,
  78392. Z_BEST_COMPRESSION: 9,
  78393. Z_DEFAULT_COMPRESSION: -1,
  78394. Z_FILTERED: 1,
  78395. Z_HUFFMAN_ONLY: 2,
  78396. Z_RLE: 3,
  78397. Z_FIXED: 4,
  78398. Z_DEFAULT_STRATEGY: 0,
  78399. /* Possible values of the data_type field (though see inflate()) */
  78400. Z_BINARY: 0,
  78401. Z_TEXT: 1,
  78402. //Z_ASCII: 1, // = Z_TEXT (deprecated)
  78403. Z_UNKNOWN: 2,
  78404. /* The deflate compression method */
  78405. Z_DEFLATED: 8
  78406. //Z_NULL: null // Use -1 or null inline, depending on var type
  78407. };
  78408. },{}],31:[function(_dereq_,module,exports){
  78409. 'use strict';
  78410. // Note: we can't get significant speed boost here.
  78411. // So write code to minimize size - no pregenerated tables
  78412. // and array tools dependencies.
  78413. // Use ordinary array, since untyped makes no boost here
  78414. function makeTable() {
  78415. var c, table = [];
  78416. for(var n =0; n < 256; n++){
  78417. c = n;
  78418. for(var k =0; k < 8; k++){
  78419. c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
  78420. }
  78421. table[n] = c;
  78422. }
  78423. return table;
  78424. }
  78425. // Create table on load. Just 255 signed longs. Not a problem.
  78426. var crcTable = makeTable();
  78427. function crc32(crc, buf, len, pos) {
  78428. var t = crcTable
  78429. , end = pos + len;
  78430. crc = crc ^ (-1);
  78431. for (var i = pos; i < end; i++ ) {
  78432. crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
  78433. }
  78434. return (crc ^ (-1)); // >>> 0;
  78435. }
  78436. module.exports = crc32;
  78437. },{}],32:[function(_dereq_,module,exports){
  78438. 'use strict';
  78439. var utils = _dereq_('../utils/common');
  78440. var trees = _dereq_('./trees');
  78441. var adler32 = _dereq_('./adler32');
  78442. var crc32 = _dereq_('./crc32');
  78443. var msg = _dereq_('./messages');
  78444. /* Public constants ==========================================================*/
  78445. /* ===========================================================================*/
  78446. /* Allowed flush values; see deflate() and inflate() below for details */
  78447. var Z_NO_FLUSH = 0;
  78448. var Z_PARTIAL_FLUSH = 1;
  78449. //var Z_SYNC_FLUSH = 2;
  78450. var Z_FULL_FLUSH = 3;
  78451. var Z_FINISH = 4;
  78452. var Z_BLOCK = 5;
  78453. //var Z_TREES = 6;
  78454. /* Return codes for the compression/decompression functions. Negative values
  78455. * are errors, positive values are used for special but normal events.
  78456. */
  78457. var Z_OK = 0;
  78458. var Z_STREAM_END = 1;
  78459. //var Z_NEED_DICT = 2;
  78460. //var Z_ERRNO = -1;
  78461. var Z_STREAM_ERROR = -2;
  78462. var Z_DATA_ERROR = -3;
  78463. //var Z_MEM_ERROR = -4;
  78464. var Z_BUF_ERROR = -5;
  78465. //var Z_VERSION_ERROR = -6;
  78466. /* compression levels */
  78467. //var Z_NO_COMPRESSION = 0;
  78468. //var Z_BEST_SPEED = 1;
  78469. //var Z_BEST_COMPRESSION = 9;
  78470. var Z_DEFAULT_COMPRESSION = -1;
  78471. var Z_FILTERED = 1;
  78472. var Z_HUFFMAN_ONLY = 2;
  78473. var Z_RLE = 3;
  78474. var Z_FIXED = 4;
  78475. var Z_DEFAULT_STRATEGY = 0;
  78476. /* Possible values of the data_type field (though see inflate()) */
  78477. //var Z_BINARY = 0;
  78478. //var Z_TEXT = 1;
  78479. //var Z_ASCII = 1; // = Z_TEXT
  78480. var Z_UNKNOWN = 2;
  78481. /* The deflate compression method */
  78482. var Z_DEFLATED = 8;
  78483. /*============================================================================*/
  78484. var MAX_MEM_LEVEL = 9;
  78485. /* Maximum value for memLevel in deflateInit2 */
  78486. var MAX_WBITS = 15;
  78487. /* 32K LZ77 window */
  78488. var DEF_MEM_LEVEL = 8;
  78489. var LENGTH_CODES = 29;
  78490. /* number of length codes, not counting the special END_BLOCK code */
  78491. var LITERALS = 256;
  78492. /* number of literal bytes 0..255 */
  78493. var L_CODES = LITERALS + 1 + LENGTH_CODES;
  78494. /* number of Literal or Length codes, including the END_BLOCK code */
  78495. var D_CODES = 30;
  78496. /* number of distance codes */
  78497. var BL_CODES = 19;
  78498. /* number of codes used to transfer the bit lengths */
  78499. var HEAP_SIZE = 2*L_CODES + 1;
  78500. /* maximum heap size */
  78501. var MAX_BITS = 15;
  78502. /* All codes must not exceed MAX_BITS bits */
  78503. var MIN_MATCH = 3;
  78504. var MAX_MATCH = 258;
  78505. var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
  78506. var PRESET_DICT = 0x20;
  78507. var INIT_STATE = 42;
  78508. var EXTRA_STATE = 69;
  78509. var NAME_STATE = 73;
  78510. var COMMENT_STATE = 91;
  78511. var HCRC_STATE = 103;
  78512. var BUSY_STATE = 113;
  78513. var FINISH_STATE = 666;
  78514. var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
  78515. var BS_BLOCK_DONE = 2; /* block flush performed */
  78516. var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
  78517. var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
  78518. var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
  78519. function err(strm, errorCode) {
  78520. strm.msg = msg[errorCode];
  78521. return errorCode;
  78522. }
  78523. function rank(f) {
  78524. return ((f) << 1) - ((f) > 4 ? 9 : 0);
  78525. }
  78526. function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
  78527. /* =========================================================================
  78528. * Flush as much pending output as possible. All deflate() output goes
  78529. * through this function so some applications may wish to modify it
  78530. * to avoid allocating a large strm->output buffer and copying into it.
  78531. * (See also read_buf()).
  78532. */
  78533. function flush_pending(strm) {
  78534. var s = strm.state;
  78535. //_tr_flush_bits(s);
  78536. var len = s.pending;
  78537. if (len > strm.avail_out) {
  78538. len = strm.avail_out;
  78539. }
  78540. if (len === 0) { return; }
  78541. utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  78542. strm.next_out += len;
  78543. s.pending_out += len;
  78544. strm.total_out += len;
  78545. strm.avail_out -= len;
  78546. s.pending -= len;
  78547. if (s.pending === 0) {
  78548. s.pending_out = 0;
  78549. }
  78550. }
  78551. function flush_block_only (s, last) {
  78552. trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
  78553. s.block_start = s.strstart;
  78554. flush_pending(s.strm);
  78555. }
  78556. function put_byte(s, b) {
  78557. s.pending_buf[s.pending++] = b;
  78558. }
  78559. /* =========================================================================
  78560. * Put a short in the pending buffer. The 16-bit value is put in MSB order.
  78561. * IN assertion: the stream state is correct and there is enough room in
  78562. * pending_buf.
  78563. */
  78564. function putShortMSB(s, b) {
  78565. // put_byte(s, (Byte)(b >> 8));
  78566. // put_byte(s, (Byte)(b & 0xff));
  78567. s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
  78568. s.pending_buf[s.pending++] = b & 0xff;
  78569. }
  78570. /* ===========================================================================
  78571. * Read a new buffer from the current input stream, update the adler32
  78572. * and total number of bytes read. All deflate() input goes through
  78573. * this function so some applications may wish to modify it to avoid
  78574. * allocating a large strm->input buffer and copying from it.
  78575. * (See also flush_pending()).
  78576. */
  78577. function read_buf(strm, buf, start, size) {
  78578. var len = strm.avail_in;
  78579. if (len > size) { len = size; }
  78580. if (len === 0) { return 0; }
  78581. strm.avail_in -= len;
  78582. utils.arraySet(buf, strm.input, strm.next_in, len, start);
  78583. if (strm.state.wrap === 1) {
  78584. strm.adler = adler32(strm.adler, buf, len, start);
  78585. }
  78586. else if (strm.state.wrap === 2) {
  78587. strm.adler = crc32(strm.adler, buf, len, start);
  78588. }
  78589. strm.next_in += len;
  78590. strm.total_in += len;
  78591. return len;
  78592. }
  78593. /* ===========================================================================
  78594. * Set match_start to the longest match starting at the given string and
  78595. * return its length. Matches shorter or equal to prev_length are discarded,
  78596. * in which case the result is equal to prev_length and match_start is
  78597. * garbage.
  78598. * IN assertions: cur_match is the head of the hash chain for the current
  78599. * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
  78600. * OUT assertion: the match length is not greater than s->lookahead.
  78601. */
  78602. function longest_match(s, cur_match) {
  78603. var chain_length = s.max_chain_length; /* max hash chain length */
  78604. var scan = s.strstart; /* current string */
  78605. var match; /* matched string */
  78606. var len; /* length of current match */
  78607. var best_len = s.prev_length; /* best match length so far */
  78608. var nice_match = s.nice_match; /* stop if match long enough */
  78609. var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
  78610. s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
  78611. var _win = s.window; // shortcut
  78612. var wmask = s.w_mask;
  78613. var prev = s.prev;
  78614. /* Stop when cur_match becomes <= limit. To simplify the code,
  78615. * we prevent matches with the string of window index 0.
  78616. */
  78617. var strend = s.strstart + MAX_MATCH;
  78618. var scan_end1 = _win[scan + best_len - 1];
  78619. var scan_end = _win[scan + best_len];
  78620. /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
  78621. * It is easy to get rid of this optimization if necessary.
  78622. */
  78623. // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
  78624. /* Do not waste too much time if we already have a good match: */
  78625. if (s.prev_length >= s.good_match) {
  78626. chain_length >>= 2;
  78627. }
  78628. /* Do not look for matches beyond the end of the input. This is necessary
  78629. * to make deflate deterministic.
  78630. */
  78631. if (nice_match > s.lookahead) { nice_match = s.lookahead; }
  78632. // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
  78633. do {
  78634. // Assert(cur_match < s->strstart, "no future");
  78635. match = cur_match;
  78636. /* Skip to next match if the match length cannot increase
  78637. * or if the match length is less than 2. Note that the checks below
  78638. * for insufficient lookahead only occur occasionally for performance
  78639. * reasons. Therefore uninitialized memory will be accessed, and
  78640. * conditional jumps will be made that depend on those values.
  78641. * However the length of the match is limited to the lookahead, so
  78642. * the output of deflate is not affected by the uninitialized values.
  78643. */
  78644. if (_win[match + best_len] !== scan_end ||
  78645. _win[match + best_len - 1] !== scan_end1 ||
  78646. _win[match] !== _win[scan] ||
  78647. _win[++match] !== _win[scan + 1]) {
  78648. continue;
  78649. }
  78650. /* The check at best_len-1 can be removed because it will be made
  78651. * again later. (This heuristic is not always a win.)
  78652. * It is not necessary to compare scan[2] and match[2] since they
  78653. * are always equal when the other bytes match, given that
  78654. * the hash keys are equal and that HASH_BITS >= 8.
  78655. */
  78656. scan += 2;
  78657. match++;
  78658. // Assert(*scan == *match, "match[2]?");
  78659. /* We check for insufficient lookahead only every 8th comparison;
  78660. * the 256th check will be made at strstart+258.
  78661. */
  78662. do {
  78663. /*jshint noempty:false*/
  78664. } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  78665. _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  78666. _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  78667. _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  78668. scan < strend);
  78669. // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
  78670. len = MAX_MATCH - (strend - scan);
  78671. scan = strend - MAX_MATCH;
  78672. if (len > best_len) {
  78673. s.match_start = cur_match;
  78674. best_len = len;
  78675. if (len >= nice_match) {
  78676. break;
  78677. }
  78678. scan_end1 = _win[scan + best_len - 1];
  78679. scan_end = _win[scan + best_len];
  78680. }
  78681. } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
  78682. if (best_len <= s.lookahead) {
  78683. return best_len;
  78684. }
  78685. return s.lookahead;
  78686. }
  78687. /* ===========================================================================
  78688. * Fill the window when the lookahead becomes insufficient.
  78689. * Updates strstart and lookahead.
  78690. *
  78691. * IN assertion: lookahead < MIN_LOOKAHEAD
  78692. * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
  78693. * At least one byte has been read, or avail_in == 0; reads are
  78694. * performed for at least two bytes (required for the zip translate_eol
  78695. * option -- not supported here).
  78696. */
  78697. function fill_window(s) {
  78698. var _w_size = s.w_size;
  78699. var p, n, m, more, str;
  78700. //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  78701. do {
  78702. more = s.window_size - s.lookahead - s.strstart;
  78703. // JS ints have 32 bit, block below not needed
  78704. /* Deal with !@#$% 64K limit: */
  78705. //if (sizeof(int) <= 2) {
  78706. // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
  78707. // more = wsize;
  78708. //
  78709. // } else if (more == (unsigned)(-1)) {
  78710. // /* Very unlikely, but possible on 16 bit machine if
  78711. // * strstart == 0 && lookahead == 1 (input done a byte at time)
  78712. // */
  78713. // more--;
  78714. // }
  78715. //}
  78716. /* If the window is almost full and there is insufficient lookahead,
  78717. * move the upper half to the lower one to make room in the upper half.
  78718. */
  78719. if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
  78720. utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
  78721. s.match_start -= _w_size;
  78722. s.strstart -= _w_size;
  78723. /* we now have strstart >= MAX_DIST */
  78724. s.block_start -= _w_size;
  78725. /* Slide the hash table (could be avoided with 32 bit values
  78726. at the expense of memory usage). We slide even when level == 0
  78727. to keep the hash table consistent if we switch back to level > 0
  78728. later. (Using level 0 permanently is not an optimal usage of
  78729. zlib, so we don't care about this pathological case.)
  78730. */
  78731. n = s.hash_size;
  78732. p = n;
  78733. do {
  78734. m = s.head[--p];
  78735. s.head[p] = (m >= _w_size ? m - _w_size : 0);
  78736. } while (--n);
  78737. n = _w_size;
  78738. p = n;
  78739. do {
  78740. m = s.prev[--p];
  78741. s.prev[p] = (m >= _w_size ? m - _w_size : 0);
  78742. /* If n is not on any hash chain, prev[n] is garbage but
  78743. * its value will never be used.
  78744. */
  78745. } while (--n);
  78746. more += _w_size;
  78747. }
  78748. if (s.strm.avail_in === 0) {
  78749. break;
  78750. }
  78751. /* If there was no sliding:
  78752. * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
  78753. * more == window_size - lookahead - strstart
  78754. * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
  78755. * => more >= window_size - 2*WSIZE + 2
  78756. * In the BIG_MEM or MMAP case (not yet supported),
  78757. * window_size == input_size + MIN_LOOKAHEAD &&
  78758. * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
  78759. * Otherwise, window_size == 2*WSIZE so more >= 2.
  78760. * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
  78761. */
  78762. //Assert(more >= 2, "more < 2");
  78763. n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
  78764. s.lookahead += n;
  78765. /* Initialize the hash value now that we have some input: */
  78766. if (s.lookahead + s.insert >= MIN_MATCH) {
  78767. str = s.strstart - s.insert;
  78768. s.ins_h = s.window[str];
  78769. /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
  78770. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
  78771. //#if MIN_MATCH != 3
  78772. // Call update_hash() MIN_MATCH-3 more times
  78773. //#endif
  78774. while (s.insert) {
  78775. /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
  78776. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask;
  78777. s.prev[str & s.w_mask] = s.head[s.ins_h];
  78778. s.head[s.ins_h] = str;
  78779. str++;
  78780. s.insert--;
  78781. if (s.lookahead + s.insert < MIN_MATCH) {
  78782. break;
  78783. }
  78784. }
  78785. }
  78786. /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
  78787. * but this is not important since only literal bytes will be emitted.
  78788. */
  78789. } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
  78790. /* If the WIN_INIT bytes after the end of the current data have never been
  78791. * written, then zero those bytes in order to avoid memory check reports of
  78792. * the use of uninitialized (or uninitialised as Julian writes) bytes by
  78793. * the longest match routines. Update the high water mark for the next
  78794. * time through here. WIN_INIT is set to MAX_MATCH since the longest match
  78795. * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
  78796. */
  78797. // if (s.high_water < s.window_size) {
  78798. // var curr = s.strstart + s.lookahead;
  78799. // var init = 0;
  78800. //
  78801. // if (s.high_water < curr) {
  78802. // /* Previous high water mark below current data -- zero WIN_INIT
  78803. // * bytes or up to end of window, whichever is less.
  78804. // */
  78805. // init = s.window_size - curr;
  78806. // if (init > WIN_INIT)
  78807. // init = WIN_INIT;
  78808. // zmemzero(s->window + curr, (unsigned)init);
  78809. // s->high_water = curr + init;
  78810. // }
  78811. // else if (s->high_water < (ulg)curr + WIN_INIT) {
  78812. // /* High water mark at or above current data, but below current data
  78813. // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
  78814. // * to end of window, whichever is less.
  78815. // */
  78816. // init = (ulg)curr + WIN_INIT - s->high_water;
  78817. // if (init > s->window_size - s->high_water)
  78818. // init = s->window_size - s->high_water;
  78819. // zmemzero(s->window + s->high_water, (unsigned)init);
  78820. // s->high_water += init;
  78821. // }
  78822. // }
  78823. //
  78824. // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  78825. // "not enough room for search");
  78826. }
  78827. /* ===========================================================================
  78828. * Copy without compression as much as possible from the input stream, return
  78829. * the current block state.
  78830. * This function does not insert new strings in the dictionary since
  78831. * uncompressible data is probably not useful. This function is used
  78832. * only for the level=0 compression option.
  78833. * NOTE: this function should be optimized to avoid extra copying from
  78834. * window to pending_buf.
  78835. */
  78836. function deflate_stored(s, flush) {
  78837. /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
  78838. * to pending_buf_size, and each stored block has a 5 byte header:
  78839. */
  78840. var max_block_size = 0xffff;
  78841. if (max_block_size > s.pending_buf_size - 5) {
  78842. max_block_size = s.pending_buf_size - 5;
  78843. }
  78844. /* Copy as much as possible from input to output: */
  78845. for (;;) {
  78846. /* Fill the window as much as possible: */
  78847. if (s.lookahead <= 1) {
  78848. //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
  78849. // s->block_start >= (long)s->w_size, "slide too late");
  78850. // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
  78851. // s.block_start >= s.w_size)) {
  78852. // throw new Error("slide too late");
  78853. // }
  78854. fill_window(s);
  78855. if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
  78856. return BS_NEED_MORE;
  78857. }
  78858. if (s.lookahead === 0) {
  78859. break;
  78860. }
  78861. /* flush the current block */
  78862. }
  78863. //Assert(s->block_start >= 0L, "block gone");
  78864. // if (s.block_start < 0) throw new Error("block gone");
  78865. s.strstart += s.lookahead;
  78866. s.lookahead = 0;
  78867. /* Emit a stored block if pending_buf will be full: */
  78868. var max_start = s.block_start + max_block_size;
  78869. if (s.strstart === 0 || s.strstart >= max_start) {
  78870. /* strstart == 0 is possible when wraparound on 16-bit machine */
  78871. s.lookahead = s.strstart - max_start;
  78872. s.strstart = max_start;
  78873. /*** FLUSH_BLOCK(s, 0); ***/
  78874. flush_block_only(s, false);
  78875. if (s.strm.avail_out === 0) {
  78876. return BS_NEED_MORE;
  78877. }
  78878. /***/
  78879. }
  78880. /* Flush if we may have to slide, otherwise block_start may become
  78881. * negative and the data will be gone:
  78882. */
  78883. if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
  78884. /*** FLUSH_BLOCK(s, 0); ***/
  78885. flush_block_only(s, false);
  78886. if (s.strm.avail_out === 0) {
  78887. return BS_NEED_MORE;
  78888. }
  78889. /***/
  78890. }
  78891. }
  78892. s.insert = 0;
  78893. if (flush === Z_FINISH) {
  78894. /*** FLUSH_BLOCK(s, 1); ***/
  78895. flush_block_only(s, true);
  78896. if (s.strm.avail_out === 0) {
  78897. return BS_FINISH_STARTED;
  78898. }
  78899. /***/
  78900. return BS_FINISH_DONE;
  78901. }
  78902. if (s.strstart > s.block_start) {
  78903. /*** FLUSH_BLOCK(s, 0); ***/
  78904. flush_block_only(s, false);
  78905. if (s.strm.avail_out === 0) {
  78906. return BS_NEED_MORE;
  78907. }
  78908. /***/
  78909. }
  78910. return BS_NEED_MORE;
  78911. }
  78912. /* ===========================================================================
  78913. * Compress as much as possible from the input stream, return the current
  78914. * block state.
  78915. * This function does not perform lazy evaluation of matches and inserts
  78916. * new strings in the dictionary only for unmatched strings or for short
  78917. * matches. It is used only for the fast compression options.
  78918. */
  78919. function deflate_fast(s, flush) {
  78920. var hash_head; /* head of the hash chain */
  78921. var bflush; /* set if current block must be flushed */
  78922. for (;;) {
  78923. /* Make sure that we always have enough lookahead, except
  78924. * at the end of the input file. We need MAX_MATCH bytes
  78925. * for the next match, plus MIN_MATCH bytes to insert the
  78926. * string following the next match.
  78927. */
  78928. if (s.lookahead < MIN_LOOKAHEAD) {
  78929. fill_window(s);
  78930. if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
  78931. return BS_NEED_MORE;
  78932. }
  78933. if (s.lookahead === 0) {
  78934. break; /* flush the current block */
  78935. }
  78936. }
  78937. /* Insert the string window[strstart .. strstart+2] in the
  78938. * dictionary, and set hash_head to the head of the hash chain:
  78939. */
  78940. hash_head = 0/*NIL*/;
  78941. if (s.lookahead >= MIN_MATCH) {
  78942. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  78943. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  78944. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  78945. s.head[s.ins_h] = s.strstart;
  78946. /***/
  78947. }
  78948. /* Find the longest match, discarding those <= prev_length.
  78949. * At this point we have always match_length < MIN_MATCH
  78950. */
  78951. if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
  78952. /* To simplify the code, we prevent matches with the string
  78953. * of window index 0 (in particular we have to avoid a match
  78954. * of the string with itself at the start of the input file).
  78955. */
  78956. s.match_length = longest_match(s, hash_head);
  78957. /* longest_match() sets match_start */
  78958. }
  78959. if (s.match_length >= MIN_MATCH) {
  78960. // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
  78961. /*** _tr_tally_dist(s, s.strstart - s.match_start,
  78962. s.match_length - MIN_MATCH, bflush); ***/
  78963. bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
  78964. s.lookahead -= s.match_length;
  78965. /* Insert new strings in the hash table only if the match length
  78966. * is not too large. This saves time but degrades compression.
  78967. */
  78968. if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
  78969. s.match_length--; /* string at strstart already in table */
  78970. do {
  78971. s.strstart++;
  78972. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  78973. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  78974. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  78975. s.head[s.ins_h] = s.strstart;
  78976. /***/
  78977. /* strstart never exceeds WSIZE-MAX_MATCH, so there are
  78978. * always MIN_MATCH bytes ahead.
  78979. */
  78980. } while (--s.match_length !== 0);
  78981. s.strstart++;
  78982. } else
  78983. {
  78984. s.strstart += s.match_length;
  78985. s.match_length = 0;
  78986. s.ins_h = s.window[s.strstart];
  78987. /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
  78988. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
  78989. //#if MIN_MATCH != 3
  78990. // Call UPDATE_HASH() MIN_MATCH-3 more times
  78991. //#endif
  78992. /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
  78993. * matter since it will be recomputed at next deflate call.
  78994. */
  78995. }
  78996. } else {
  78997. /* No match, output a literal byte */
  78998. //Tracevv((stderr,"%c", s.window[s.strstart]));
  78999. /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
  79000. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  79001. s.lookahead--;
  79002. s.strstart++;
  79003. }
  79004. if (bflush) {
  79005. /*** FLUSH_BLOCK(s, 0); ***/
  79006. flush_block_only(s, false);
  79007. if (s.strm.avail_out === 0) {
  79008. return BS_NEED_MORE;
  79009. }
  79010. /***/
  79011. }
  79012. }
  79013. s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);
  79014. if (flush === Z_FINISH) {
  79015. /*** FLUSH_BLOCK(s, 1); ***/
  79016. flush_block_only(s, true);
  79017. if (s.strm.avail_out === 0) {
  79018. return BS_FINISH_STARTED;
  79019. }
  79020. /***/
  79021. return BS_FINISH_DONE;
  79022. }
  79023. if (s.last_lit) {
  79024. /*** FLUSH_BLOCK(s, 0); ***/
  79025. flush_block_only(s, false);
  79026. if (s.strm.avail_out === 0) {
  79027. return BS_NEED_MORE;
  79028. }
  79029. /***/
  79030. }
  79031. return BS_BLOCK_DONE;
  79032. }
  79033. /* ===========================================================================
  79034. * Same as above, but achieves better compression. We use a lazy
  79035. * evaluation for matches: a match is finally adopted only if there is
  79036. * no better match at the next window position.
  79037. */
  79038. function deflate_slow(s, flush) {
  79039. var hash_head; /* head of hash chain */
  79040. var bflush; /* set if current block must be flushed */
  79041. var max_insert;
  79042. /* Process the input block. */
  79043. for (;;) {
  79044. /* Make sure that we always have enough lookahead, except
  79045. * at the end of the input file. We need MAX_MATCH bytes
  79046. * for the next match, plus MIN_MATCH bytes to insert the
  79047. * string following the next match.
  79048. */
  79049. if (s.lookahead < MIN_LOOKAHEAD) {
  79050. fill_window(s);
  79051. if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
  79052. return BS_NEED_MORE;
  79053. }
  79054. if (s.lookahead === 0) { break; } /* flush the current block */
  79055. }
  79056. /* Insert the string window[strstart .. strstart+2] in the
  79057. * dictionary, and set hash_head to the head of the hash chain:
  79058. */
  79059. hash_head = 0/*NIL*/;
  79060. if (s.lookahead >= MIN_MATCH) {
  79061. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  79062. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  79063. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  79064. s.head[s.ins_h] = s.strstart;
  79065. /***/
  79066. }
  79067. /* Find the longest match, discarding those <= prev_length.
  79068. */
  79069. s.prev_length = s.match_length;
  79070. s.prev_match = s.match_start;
  79071. s.match_length = MIN_MATCH-1;
  79072. if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
  79073. s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
  79074. /* To simplify the code, we prevent matches with the string
  79075. * of window index 0 (in particular we have to avoid a match
  79076. * of the string with itself at the start of the input file).
  79077. */
  79078. s.match_length = longest_match(s, hash_head);
  79079. /* longest_match() sets match_start */
  79080. if (s.match_length <= 5 &&
  79081. (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
  79082. /* If prev_match is also MIN_MATCH, match_start is garbage
  79083. * but we will ignore the current match anyway.
  79084. */
  79085. s.match_length = MIN_MATCH-1;
  79086. }
  79087. }
  79088. /* If there was a match at the previous step and the current
  79089. * match is not better, output the previous match:
  79090. */
  79091. if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
  79092. max_insert = s.strstart + s.lookahead - MIN_MATCH;
  79093. /* Do not insert strings in hash table beyond this. */
  79094. //check_match(s, s.strstart-1, s.prev_match, s.prev_length);
  79095. /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
  79096. s.prev_length - MIN_MATCH, bflush);***/
  79097. bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);
  79098. /* Insert in hash table all strings up to the end of the match.
  79099. * strstart-1 and strstart are already inserted. If there is not
  79100. * enough lookahead, the last two strings are not inserted in
  79101. * the hash table.
  79102. */
  79103. s.lookahead -= s.prev_length-1;
  79104. s.prev_length -= 2;
  79105. do {
  79106. if (++s.strstart <= max_insert) {
  79107. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  79108. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  79109. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  79110. s.head[s.ins_h] = s.strstart;
  79111. /***/
  79112. }
  79113. } while (--s.prev_length !== 0);
  79114. s.match_available = 0;
  79115. s.match_length = MIN_MATCH-1;
  79116. s.strstart++;
  79117. if (bflush) {
  79118. /*** FLUSH_BLOCK(s, 0); ***/
  79119. flush_block_only(s, false);
  79120. if (s.strm.avail_out === 0) {
  79121. return BS_NEED_MORE;
  79122. }
  79123. /***/
  79124. }
  79125. } else if (s.match_available) {
  79126. /* If there was no match at the previous position, output a
  79127. * single literal. If there was a match but the current match
  79128. * is longer, truncate the previous match to a single literal.
  79129. */
  79130. //Tracevv((stderr,"%c", s->window[s->strstart-1]));
  79131. /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
  79132. bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
  79133. if (bflush) {
  79134. /*** FLUSH_BLOCK_ONLY(s, 0) ***/
  79135. flush_block_only(s, false);
  79136. /***/
  79137. }
  79138. s.strstart++;
  79139. s.lookahead--;
  79140. if (s.strm.avail_out === 0) {
  79141. return BS_NEED_MORE;
  79142. }
  79143. } else {
  79144. /* There is no previous match to compare with, wait for
  79145. * the next step to decide.
  79146. */
  79147. s.match_available = 1;
  79148. s.strstart++;
  79149. s.lookahead--;
  79150. }
  79151. }
  79152. //Assert (flush != Z_NO_FLUSH, "no flush?");
  79153. if (s.match_available) {
  79154. //Tracevv((stderr,"%c", s->window[s->strstart-1]));
  79155. /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
  79156. bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
  79157. s.match_available = 0;
  79158. }
  79159. s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;
  79160. if (flush === Z_FINISH) {
  79161. /*** FLUSH_BLOCK(s, 1); ***/
  79162. flush_block_only(s, true);
  79163. if (s.strm.avail_out === 0) {
  79164. return BS_FINISH_STARTED;
  79165. }
  79166. /***/
  79167. return BS_FINISH_DONE;
  79168. }
  79169. if (s.last_lit) {
  79170. /*** FLUSH_BLOCK(s, 0); ***/
  79171. flush_block_only(s, false);
  79172. if (s.strm.avail_out === 0) {
  79173. return BS_NEED_MORE;
  79174. }
  79175. /***/
  79176. }
  79177. return BS_BLOCK_DONE;
  79178. }
  79179. /* ===========================================================================
  79180. * For Z_RLE, simply look for runs of bytes, generate matches only of distance
  79181. * one. Do not maintain a hash table. (It will be regenerated if this run of
  79182. * deflate switches away from Z_RLE.)
  79183. */
  79184. function deflate_rle(s, flush) {
  79185. var bflush; /* set if current block must be flushed */
  79186. var prev; /* byte at distance one to match */
  79187. var scan, strend; /* scan goes up to strend for length of run */
  79188. var _win = s.window;
  79189. for (;;) {
  79190. /* Make sure that we always have enough lookahead, except
  79191. * at the end of the input file. We need MAX_MATCH bytes
  79192. * for the longest run, plus one for the unrolled loop.
  79193. */
  79194. if (s.lookahead <= MAX_MATCH) {
  79195. fill_window(s);
  79196. if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
  79197. return BS_NEED_MORE;
  79198. }
  79199. if (s.lookahead === 0) { break; } /* flush the current block */
  79200. }
  79201. /* See how many times the previous byte repeats */
  79202. s.match_length = 0;
  79203. if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
  79204. scan = s.strstart - 1;
  79205. prev = _win[scan];
  79206. if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
  79207. strend = s.strstart + MAX_MATCH;
  79208. do {
  79209. /*jshint noempty:false*/
  79210. } while (prev === _win[++scan] && prev === _win[++scan] &&
  79211. prev === _win[++scan] && prev === _win[++scan] &&
  79212. prev === _win[++scan] && prev === _win[++scan] &&
  79213. prev === _win[++scan] && prev === _win[++scan] &&
  79214. scan < strend);
  79215. s.match_length = MAX_MATCH - (strend - scan);
  79216. if (s.match_length > s.lookahead) {
  79217. s.match_length = s.lookahead;
  79218. }
  79219. }
  79220. //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
  79221. }
  79222. /* Emit match if have run of MIN_MATCH or longer, else emit literal */
  79223. if (s.match_length >= MIN_MATCH) {
  79224. //check_match(s, s.strstart, s.strstart - 1, s.match_length);
  79225. /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
  79226. bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
  79227. s.lookahead -= s.match_length;
  79228. s.strstart += s.match_length;
  79229. s.match_length = 0;
  79230. } else {
  79231. /* No match, output a literal byte */
  79232. //Tracevv((stderr,"%c", s->window[s->strstart]));
  79233. /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
  79234. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  79235. s.lookahead--;
  79236. s.strstart++;
  79237. }
  79238. if (bflush) {
  79239. /*** FLUSH_BLOCK(s, 0); ***/
  79240. flush_block_only(s, false);
  79241. if (s.strm.avail_out === 0) {
  79242. return BS_NEED_MORE;
  79243. }
  79244. /***/
  79245. }
  79246. }
  79247. s.insert = 0;
  79248. if (flush === Z_FINISH) {
  79249. /*** FLUSH_BLOCK(s, 1); ***/
  79250. flush_block_only(s, true);
  79251. if (s.strm.avail_out === 0) {
  79252. return BS_FINISH_STARTED;
  79253. }
  79254. /***/
  79255. return BS_FINISH_DONE;
  79256. }
  79257. if (s.last_lit) {
  79258. /*** FLUSH_BLOCK(s, 0); ***/
  79259. flush_block_only(s, false);
  79260. if (s.strm.avail_out === 0) {
  79261. return BS_NEED_MORE;
  79262. }
  79263. /***/
  79264. }
  79265. return BS_BLOCK_DONE;
  79266. }
  79267. /* ===========================================================================
  79268. * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
  79269. * (It will be regenerated if this run of deflate switches away from Huffman.)
  79270. */
  79271. function deflate_huff(s, flush) {
  79272. var bflush; /* set if current block must be flushed */
  79273. for (;;) {
  79274. /* Make sure that we have a literal to write. */
  79275. if (s.lookahead === 0) {
  79276. fill_window(s);
  79277. if (s.lookahead === 0) {
  79278. if (flush === Z_NO_FLUSH) {
  79279. return BS_NEED_MORE;
  79280. }
  79281. break; /* flush the current block */
  79282. }
  79283. }
  79284. /* Output a literal byte */
  79285. s.match_length = 0;
  79286. //Tracevv((stderr,"%c", s->window[s->strstart]));
  79287. /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
  79288. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  79289. s.lookahead--;
  79290. s.strstart++;
  79291. if (bflush) {
  79292. /*** FLUSH_BLOCK(s, 0); ***/
  79293. flush_block_only(s, false);
  79294. if (s.strm.avail_out === 0) {
  79295. return BS_NEED_MORE;
  79296. }
  79297. /***/
  79298. }
  79299. }
  79300. s.insert = 0;
  79301. if (flush === Z_FINISH) {
  79302. /*** FLUSH_BLOCK(s, 1); ***/
  79303. flush_block_only(s, true);
  79304. if (s.strm.avail_out === 0) {
  79305. return BS_FINISH_STARTED;
  79306. }
  79307. /***/
  79308. return BS_FINISH_DONE;
  79309. }
  79310. if (s.last_lit) {
  79311. /*** FLUSH_BLOCK(s, 0); ***/
  79312. flush_block_only(s, false);
  79313. if (s.strm.avail_out === 0) {
  79314. return BS_NEED_MORE;
  79315. }
  79316. /***/
  79317. }
  79318. return BS_BLOCK_DONE;
  79319. }
  79320. /* Values for max_lazy_match, good_match and max_chain_length, depending on
  79321. * the desired pack level (0..9). The values given below have been tuned to
  79322. * exclude worst case performance for pathological files. Better values may be
  79323. * found for specific files.
  79324. */
  79325. var Config = function (good_length, max_lazy, nice_length, max_chain, func) {
  79326. this.good_length = good_length;
  79327. this.max_lazy = max_lazy;
  79328. this.nice_length = nice_length;
  79329. this.max_chain = max_chain;
  79330. this.func = func;
  79331. };
  79332. var configuration_table;
  79333. configuration_table = [
  79334. /* good lazy nice chain */
  79335. new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
  79336. new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
  79337. new Config(4, 5, 16, 8, deflate_fast), /* 2 */
  79338. new Config(4, 6, 32, 32, deflate_fast), /* 3 */
  79339. new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
  79340. new Config(8, 16, 32, 32, deflate_slow), /* 5 */
  79341. new Config(8, 16, 128, 128, deflate_slow), /* 6 */
  79342. new Config(8, 32, 128, 256, deflate_slow), /* 7 */
  79343. new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
  79344. new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
  79345. ];
  79346. /* ===========================================================================
  79347. * Initialize the "longest match" routines for a new zlib stream
  79348. */
  79349. function lm_init(s) {
  79350. s.window_size = 2 * s.w_size;
  79351. /*** CLEAR_HASH(s); ***/
  79352. zero(s.head); // Fill with NIL (= 0);
  79353. /* Set the default configuration parameters:
  79354. */
  79355. s.max_lazy_match = configuration_table[s.level].max_lazy;
  79356. s.good_match = configuration_table[s.level].good_length;
  79357. s.nice_match = configuration_table[s.level].nice_length;
  79358. s.max_chain_length = configuration_table[s.level].max_chain;
  79359. s.strstart = 0;
  79360. s.block_start = 0;
  79361. s.lookahead = 0;
  79362. s.insert = 0;
  79363. s.match_length = s.prev_length = MIN_MATCH - 1;
  79364. s.match_available = 0;
  79365. s.ins_h = 0;
  79366. }
  79367. function DeflateState() {
  79368. this.strm = null; /* pointer back to this zlib stream */
  79369. this.status = 0; /* as the name implies */
  79370. this.pending_buf = null; /* output still pending */
  79371. this.pending_buf_size = 0; /* size of pending_buf */
  79372. this.pending_out = 0; /* next pending byte to output to the stream */
  79373. this.pending = 0; /* nb of bytes in the pending buffer */
  79374. this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
  79375. this.gzhead = null; /* gzip header information to write */
  79376. this.gzindex = 0; /* where in extra, name, or comment */
  79377. this.method = Z_DEFLATED; /* can only be DEFLATED */
  79378. this.last_flush = -1; /* value of flush param for previous deflate call */
  79379. this.w_size = 0; /* LZ77 window size (32K by default) */
  79380. this.w_bits = 0; /* log2(w_size) (8..16) */
  79381. this.w_mask = 0; /* w_size - 1 */
  79382. this.window = null;
  79383. /* Sliding window. Input bytes are read into the second half of the window,
  79384. * and move to the first half later to keep a dictionary of at least wSize
  79385. * bytes. With this organization, matches are limited to a distance of
  79386. * wSize-MAX_MATCH bytes, but this ensures that IO is always
  79387. * performed with a length multiple of the block size.
  79388. */
  79389. this.window_size = 0;
  79390. /* Actual size of window: 2*wSize, except when the user input buffer
  79391. * is directly used as sliding window.
  79392. */
  79393. this.prev = null;
  79394. /* Link to older string with same hash index. To limit the size of this
  79395. * array to 64K, this link is maintained only for the last 32K strings.
  79396. * An index in this array is thus a window index modulo 32K.
  79397. */
  79398. this.head = null; /* Heads of the hash chains or NIL. */
  79399. this.ins_h = 0; /* hash index of string to be inserted */
  79400. this.hash_size = 0; /* number of elements in hash table */
  79401. this.hash_bits = 0; /* log2(hash_size) */
  79402. this.hash_mask = 0; /* hash_size-1 */
  79403. this.hash_shift = 0;
  79404. /* Number of bits by which ins_h must be shifted at each input
  79405. * step. It must be such that after MIN_MATCH steps, the oldest
  79406. * byte no longer takes part in the hash key, that is:
  79407. * hash_shift * MIN_MATCH >= hash_bits
  79408. */
  79409. this.block_start = 0;
  79410. /* Window position at the beginning of the current output block. Gets
  79411. * negative when the window is moved backwards.
  79412. */
  79413. this.match_length = 0; /* length of best match */
  79414. this.prev_match = 0; /* previous match */
  79415. this.match_available = 0; /* set if previous match exists */
  79416. this.strstart = 0; /* start of string to insert */
  79417. this.match_start = 0; /* start of matching string */
  79418. this.lookahead = 0; /* number of valid bytes ahead in window */
  79419. this.prev_length = 0;
  79420. /* Length of the best match at previous step. Matches not greater than this
  79421. * are discarded. This is used in the lazy match evaluation.
  79422. */
  79423. this.max_chain_length = 0;
  79424. /* To speed up deflation, hash chains are never searched beyond this
  79425. * length. A higher limit improves compression ratio but degrades the
  79426. * speed.
  79427. */
  79428. this.max_lazy_match = 0;
  79429. /* Attempt to find a better match only when the current match is strictly
  79430. * smaller than this value. This mechanism is used only for compression
  79431. * levels >= 4.
  79432. */
  79433. // That's alias to max_lazy_match, don't use directly
  79434. //this.max_insert_length = 0;
  79435. /* Insert new strings in the hash table only if the match length is not
  79436. * greater than this length. This saves time but degrades compression.
  79437. * max_insert_length is used only for compression levels <= 3.
  79438. */
  79439. this.level = 0; /* compression level (1..9) */
  79440. this.strategy = 0; /* favor or force Huffman coding*/
  79441. this.good_match = 0;
  79442. /* Use a faster search when the previous match is longer than this */
  79443. this.nice_match = 0; /* Stop searching when current match exceeds this */
  79444. /* used by trees.c: */
  79445. /* Didn't use ct_data typedef below to suppress compiler warning */
  79446. // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
  79447. // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
  79448. // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
  79449. // Use flat array of DOUBLE size, with interleaved fata,
  79450. // because JS does not support effective
  79451. this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
  79452. this.dyn_dtree = new utils.Buf16((2*D_CODES+1) * 2);
  79453. this.bl_tree = new utils.Buf16((2*BL_CODES+1) * 2);
  79454. zero(this.dyn_ltree);
  79455. zero(this.dyn_dtree);
  79456. zero(this.bl_tree);
  79457. this.l_desc = null; /* desc. for literal tree */
  79458. this.d_desc = null; /* desc. for distance tree */
  79459. this.bl_desc = null; /* desc. for bit length tree */
  79460. //ush bl_count[MAX_BITS+1];
  79461. this.bl_count = new utils.Buf16(MAX_BITS+1);
  79462. /* number of codes at each bit length for an optimal tree */
  79463. //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
  79464. this.heap = new utils.Buf16(2*L_CODES+1); /* heap used to build the Huffman trees */
  79465. zero(this.heap);
  79466. this.heap_len = 0; /* number of elements in the heap */
  79467. this.heap_max = 0; /* element of largest frequency */
  79468. /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
  79469. * The same heap array is used to build all trees.
  79470. */
  79471. this.depth = new utils.Buf16(2*L_CODES+1); //uch depth[2*L_CODES+1];
  79472. zero(this.depth);
  79473. /* Depth of each subtree used as tie breaker for trees of equal frequency
  79474. */
  79475. this.l_buf = 0; /* buffer index for literals or lengths */
  79476. this.lit_bufsize = 0;
  79477. /* Size of match buffer for literals/lengths. There are 4 reasons for
  79478. * limiting lit_bufsize to 64K:
  79479. * - frequencies can be kept in 16 bit counters
  79480. * - if compression is not successful for the first block, all input
  79481. * data is still in the window so we can still emit a stored block even
  79482. * when input comes from standard input. (This can also be done for
  79483. * all blocks if lit_bufsize is not greater than 32K.)
  79484. * - if compression is not successful for a file smaller than 64K, we can
  79485. * even emit a stored file instead of a stored block (saving 5 bytes).
  79486. * This is applicable only for zip (not gzip or zlib).
  79487. * - creating new Huffman trees less frequently may not provide fast
  79488. * adaptation to changes in the input data statistics. (Take for
  79489. * example a binary file with poorly compressible code followed by
  79490. * a highly compressible string table.) Smaller buffer sizes give
  79491. * fast adaptation but have of course the overhead of transmitting
  79492. * trees more frequently.
  79493. * - I can't count above 4
  79494. */
  79495. this.last_lit = 0; /* running index in l_buf */
  79496. this.d_buf = 0;
  79497. /* Buffer index for distances. To simplify the code, d_buf and l_buf have
  79498. * the same number of elements. To use different lengths, an extra flag
  79499. * array would be necessary.
  79500. */
  79501. this.opt_len = 0; /* bit length of current block with optimal trees */
  79502. this.static_len = 0; /* bit length of current block with static trees */
  79503. this.matches = 0; /* number of string matches in current block */
  79504. this.insert = 0; /* bytes at end of window left to insert */
  79505. this.bi_buf = 0;
  79506. /* Output buffer. bits are inserted starting at the bottom (least
  79507. * significant bits).
  79508. */
  79509. this.bi_valid = 0;
  79510. /* Number of valid bits in bi_buf. All bits above the last valid bit
  79511. * are always zero.
  79512. */
  79513. // Used for window memory init. We safely ignore it for JS. That makes
  79514. // sense only for pointers and memory check tools.
  79515. //this.high_water = 0;
  79516. /* High water mark offset in window for initialized bytes -- bytes above
  79517. * this are set to zero in order to avoid memory check warnings when
  79518. * longest match routines access bytes past the input. This is then
  79519. * updated to the new high water mark.
  79520. */
  79521. }
  79522. function deflateResetKeep(strm) {
  79523. var s;
  79524. if (!strm || !strm.state) {
  79525. return err(strm, Z_STREAM_ERROR);
  79526. }
  79527. strm.total_in = strm.total_out = 0;
  79528. strm.data_type = Z_UNKNOWN;
  79529. s = strm.state;
  79530. s.pending = 0;
  79531. s.pending_out = 0;
  79532. if (s.wrap < 0) {
  79533. s.wrap = -s.wrap;
  79534. /* was made negative by deflate(..., Z_FINISH); */
  79535. }
  79536. s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
  79537. strm.adler = (s.wrap === 2) ?
  79538. 0 // crc32(0, Z_NULL, 0)
  79539. :
  79540. 1; // adler32(0, Z_NULL, 0)
  79541. s.last_flush = Z_NO_FLUSH;
  79542. trees._tr_init(s);
  79543. return Z_OK;
  79544. }
  79545. function deflateReset(strm) {
  79546. var ret = deflateResetKeep(strm);
  79547. if (ret === Z_OK) {
  79548. lm_init(strm.state);
  79549. }
  79550. return ret;
  79551. }
  79552. function deflateSetHeader(strm, head) {
  79553. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  79554. if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
  79555. strm.state.gzhead = head;
  79556. return Z_OK;
  79557. }
  79558. function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
  79559. if (!strm) { // === Z_NULL
  79560. return Z_STREAM_ERROR;
  79561. }
  79562. var wrap = 1;
  79563. if (level === Z_DEFAULT_COMPRESSION) {
  79564. level = 6;
  79565. }
  79566. if (windowBits < 0) { /* suppress zlib wrapper */
  79567. wrap = 0;
  79568. windowBits = -windowBits;
  79569. }
  79570. else if (windowBits > 15) {
  79571. wrap = 2; /* write gzip wrapper instead */
  79572. windowBits -= 16;
  79573. }
  79574. if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
  79575. windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  79576. strategy < 0 || strategy > Z_FIXED) {
  79577. return err(strm, Z_STREAM_ERROR);
  79578. }
  79579. if (windowBits === 8) {
  79580. windowBits = 9;
  79581. }
  79582. /* until 256-byte window bug fixed */
  79583. var s = new DeflateState();
  79584. strm.state = s;
  79585. s.strm = strm;
  79586. s.wrap = wrap;
  79587. s.gzhead = null;
  79588. s.w_bits = windowBits;
  79589. s.w_size = 1 << s.w_bits;
  79590. s.w_mask = s.w_size - 1;
  79591. s.hash_bits = memLevel + 7;
  79592. s.hash_size = 1 << s.hash_bits;
  79593. s.hash_mask = s.hash_size - 1;
  79594. s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
  79595. s.window = new utils.Buf8(s.w_size * 2);
  79596. s.head = new utils.Buf16(s.hash_size);
  79597. s.prev = new utils.Buf16(s.w_size);
  79598. // Don't need mem init magic for JS.
  79599. //s.high_water = 0; /* nothing written to s->window yet */
  79600. s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
  79601. s.pending_buf_size = s.lit_bufsize * 4;
  79602. s.pending_buf = new utils.Buf8(s.pending_buf_size);
  79603. s.d_buf = s.lit_bufsize >> 1;
  79604. s.l_buf = (1 + 2) * s.lit_bufsize;
  79605. s.level = level;
  79606. s.strategy = strategy;
  79607. s.method = method;
  79608. return deflateReset(strm);
  79609. }
  79610. function deflateInit(strm, level) {
  79611. return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
  79612. }
  79613. function deflate(strm, flush) {
  79614. var old_flush, s;
  79615. var beg, val; // for gzip header write only
  79616. if (!strm || !strm.state ||
  79617. flush > Z_BLOCK || flush < 0) {
  79618. return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
  79619. }
  79620. s = strm.state;
  79621. if (!strm.output ||
  79622. (!strm.input && strm.avail_in !== 0) ||
  79623. (s.status === FINISH_STATE && flush !== Z_FINISH)) {
  79624. return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
  79625. }
  79626. s.strm = strm; /* just in case */
  79627. old_flush = s.last_flush;
  79628. s.last_flush = flush;
  79629. /* Write the header */
  79630. if (s.status === INIT_STATE) {
  79631. if (s.wrap === 2) { // GZIP header
  79632. strm.adler = 0; //crc32(0L, Z_NULL, 0);
  79633. put_byte(s, 31);
  79634. put_byte(s, 139);
  79635. put_byte(s, 8);
  79636. if (!s.gzhead) { // s->gzhead == Z_NULL
  79637. put_byte(s, 0);
  79638. put_byte(s, 0);
  79639. put_byte(s, 0);
  79640. put_byte(s, 0);
  79641. put_byte(s, 0);
  79642. put_byte(s, s.level === 9 ? 2 :
  79643. (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
  79644. 4 : 0));
  79645. put_byte(s, OS_CODE);
  79646. s.status = BUSY_STATE;
  79647. }
  79648. else {
  79649. put_byte(s, (s.gzhead.text ? 1 : 0) +
  79650. (s.gzhead.hcrc ? 2 : 0) +
  79651. (!s.gzhead.extra ? 0 : 4) +
  79652. (!s.gzhead.name ? 0 : 8) +
  79653. (!s.gzhead.comment ? 0 : 16)
  79654. );
  79655. put_byte(s, s.gzhead.time & 0xff);
  79656. put_byte(s, (s.gzhead.time >> 8) & 0xff);
  79657. put_byte(s, (s.gzhead.time >> 16) & 0xff);
  79658. put_byte(s, (s.gzhead.time >> 24) & 0xff);
  79659. put_byte(s, s.level === 9 ? 2 :
  79660. (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
  79661. 4 : 0));
  79662. put_byte(s, s.gzhead.os & 0xff);
  79663. if (s.gzhead.extra && s.gzhead.extra.length) {
  79664. put_byte(s, s.gzhead.extra.length & 0xff);
  79665. put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
  79666. }
  79667. if (s.gzhead.hcrc) {
  79668. strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
  79669. }
  79670. s.gzindex = 0;
  79671. s.status = EXTRA_STATE;
  79672. }
  79673. }
  79674. else // DEFLATE header
  79675. {
  79676. var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
  79677. var level_flags = -1;
  79678. if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
  79679. level_flags = 0;
  79680. } else if (s.level < 6) {
  79681. level_flags = 1;
  79682. } else if (s.level === 6) {
  79683. level_flags = 2;
  79684. } else {
  79685. level_flags = 3;
  79686. }
  79687. header |= (level_flags << 6);
  79688. if (s.strstart !== 0) { header |= PRESET_DICT; }
  79689. header += 31 - (header % 31);
  79690. s.status = BUSY_STATE;
  79691. putShortMSB(s, header);
  79692. /* Save the adler32 of the preset dictionary: */
  79693. if (s.strstart !== 0) {
  79694. putShortMSB(s, strm.adler >>> 16);
  79695. putShortMSB(s, strm.adler & 0xffff);
  79696. }
  79697. strm.adler = 1; // adler32(0L, Z_NULL, 0);
  79698. }
  79699. }
  79700. //#ifdef GZIP
  79701. if (s.status === EXTRA_STATE) {
  79702. if (s.gzhead.extra/* != Z_NULL*/) {
  79703. beg = s.pending; /* start of bytes to update crc */
  79704. while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
  79705. if (s.pending === s.pending_buf_size) {
  79706. if (s.gzhead.hcrc && s.pending > beg) {
  79707. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  79708. }
  79709. flush_pending(strm);
  79710. beg = s.pending;
  79711. if (s.pending === s.pending_buf_size) {
  79712. break;
  79713. }
  79714. }
  79715. put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
  79716. s.gzindex++;
  79717. }
  79718. if (s.gzhead.hcrc && s.pending > beg) {
  79719. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  79720. }
  79721. if (s.gzindex === s.gzhead.extra.length) {
  79722. s.gzindex = 0;
  79723. s.status = NAME_STATE;
  79724. }
  79725. }
  79726. else {
  79727. s.status = NAME_STATE;
  79728. }
  79729. }
  79730. if (s.status === NAME_STATE) {
  79731. if (s.gzhead.name/* != Z_NULL*/) {
  79732. beg = s.pending; /* start of bytes to update crc */
  79733. //int val;
  79734. do {
  79735. if (s.pending === s.pending_buf_size) {
  79736. if (s.gzhead.hcrc && s.pending > beg) {
  79737. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  79738. }
  79739. flush_pending(strm);
  79740. beg = s.pending;
  79741. if (s.pending === s.pending_buf_size) {
  79742. val = 1;
  79743. break;
  79744. }
  79745. }
  79746. // JS specific: little magic to add zero terminator to end of string
  79747. if (s.gzindex < s.gzhead.name.length) {
  79748. val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
  79749. } else {
  79750. val = 0;
  79751. }
  79752. put_byte(s, val);
  79753. } while (val !== 0);
  79754. if (s.gzhead.hcrc && s.pending > beg){
  79755. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  79756. }
  79757. if (val === 0) {
  79758. s.gzindex = 0;
  79759. s.status = COMMENT_STATE;
  79760. }
  79761. }
  79762. else {
  79763. s.status = COMMENT_STATE;
  79764. }
  79765. }
  79766. if (s.status === COMMENT_STATE) {
  79767. if (s.gzhead.comment/* != Z_NULL*/) {
  79768. beg = s.pending; /* start of bytes to update crc */
  79769. //int val;
  79770. do {
  79771. if (s.pending === s.pending_buf_size) {
  79772. if (s.gzhead.hcrc && s.pending > beg) {
  79773. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  79774. }
  79775. flush_pending(strm);
  79776. beg = s.pending;
  79777. if (s.pending === s.pending_buf_size) {
  79778. val = 1;
  79779. break;
  79780. }
  79781. }
  79782. // JS specific: little magic to add zero terminator to end of string
  79783. if (s.gzindex < s.gzhead.comment.length) {
  79784. val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
  79785. } else {
  79786. val = 0;
  79787. }
  79788. put_byte(s, val);
  79789. } while (val !== 0);
  79790. if (s.gzhead.hcrc && s.pending > beg) {
  79791. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  79792. }
  79793. if (val === 0) {
  79794. s.status = HCRC_STATE;
  79795. }
  79796. }
  79797. else {
  79798. s.status = HCRC_STATE;
  79799. }
  79800. }
  79801. if (s.status === HCRC_STATE) {
  79802. if (s.gzhead.hcrc) {
  79803. if (s.pending + 2 > s.pending_buf_size) {
  79804. flush_pending(strm);
  79805. }
  79806. if (s.pending + 2 <= s.pending_buf_size) {
  79807. put_byte(s, strm.adler & 0xff);
  79808. put_byte(s, (strm.adler >> 8) & 0xff);
  79809. strm.adler = 0; //crc32(0L, Z_NULL, 0);
  79810. s.status = BUSY_STATE;
  79811. }
  79812. }
  79813. else {
  79814. s.status = BUSY_STATE;
  79815. }
  79816. }
  79817. //#endif
  79818. /* Flush as much pending output as possible */
  79819. if (s.pending !== 0) {
  79820. flush_pending(strm);
  79821. if (strm.avail_out === 0) {
  79822. /* Since avail_out is 0, deflate will be called again with
  79823. * more output space, but possibly with both pending and
  79824. * avail_in equal to zero. There won't be anything to do,
  79825. * but this is not an error situation so make sure we
  79826. * return OK instead of BUF_ERROR at next call of deflate:
  79827. */
  79828. s.last_flush = -1;
  79829. return Z_OK;
  79830. }
  79831. /* Make sure there is something to do and avoid duplicate consecutive
  79832. * flushes. For repeated and useless calls with Z_FINISH, we keep
  79833. * returning Z_STREAM_END instead of Z_BUF_ERROR.
  79834. */
  79835. } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
  79836. flush !== Z_FINISH) {
  79837. return err(strm, Z_BUF_ERROR);
  79838. }
  79839. /* User must not provide more input after the first FINISH: */
  79840. if (s.status === FINISH_STATE && strm.avail_in !== 0) {
  79841. return err(strm, Z_BUF_ERROR);
  79842. }
  79843. /* Start a new block or continue the current one.
  79844. */
  79845. if (strm.avail_in !== 0 || s.lookahead !== 0 ||
  79846. (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
  79847. var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
  79848. (s.strategy === Z_RLE ? deflate_rle(s, flush) :
  79849. configuration_table[s.level].func(s, flush));
  79850. if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
  79851. s.status = FINISH_STATE;
  79852. }
  79853. if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
  79854. if (strm.avail_out === 0) {
  79855. s.last_flush = -1;
  79856. /* avoid BUF_ERROR next call, see above */
  79857. }
  79858. return Z_OK;
  79859. /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
  79860. * of deflate should use the same flush parameter to make sure
  79861. * that the flush is complete. So we don't have to output an
  79862. * empty block here, this will be done at next call. This also
  79863. * ensures that for a very small output buffer, we emit at most
  79864. * one empty block.
  79865. */
  79866. }
  79867. if (bstate === BS_BLOCK_DONE) {
  79868. if (flush === Z_PARTIAL_FLUSH) {
  79869. trees._tr_align(s);
  79870. }
  79871. else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
  79872. trees._tr_stored_block(s, 0, 0, false);
  79873. /* For a full flush, this empty block will be recognized
  79874. * as a special marker by inflate_sync().
  79875. */
  79876. if (flush === Z_FULL_FLUSH) {
  79877. /*** CLEAR_HASH(s); ***/ /* forget history */
  79878. zero(s.head); // Fill with NIL (= 0);
  79879. if (s.lookahead === 0) {
  79880. s.strstart = 0;
  79881. s.block_start = 0;
  79882. s.insert = 0;
  79883. }
  79884. }
  79885. }
  79886. flush_pending(strm);
  79887. if (strm.avail_out === 0) {
  79888. s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
  79889. return Z_OK;
  79890. }
  79891. }
  79892. }
  79893. //Assert(strm->avail_out > 0, "bug2");
  79894. //if (strm.avail_out <= 0) { throw new Error("bug2");}
  79895. if (flush !== Z_FINISH) { return Z_OK; }
  79896. if (s.wrap <= 0) { return Z_STREAM_END; }
  79897. /* Write the trailer */
  79898. if (s.wrap === 2) {
  79899. put_byte(s, strm.adler & 0xff);
  79900. put_byte(s, (strm.adler >> 8) & 0xff);
  79901. put_byte(s, (strm.adler >> 16) & 0xff);
  79902. put_byte(s, (strm.adler >> 24) & 0xff);
  79903. put_byte(s, strm.total_in & 0xff);
  79904. put_byte(s, (strm.total_in >> 8) & 0xff);
  79905. put_byte(s, (strm.total_in >> 16) & 0xff);
  79906. put_byte(s, (strm.total_in >> 24) & 0xff);
  79907. }
  79908. else
  79909. {
  79910. putShortMSB(s, strm.adler >>> 16);
  79911. putShortMSB(s, strm.adler & 0xffff);
  79912. }
  79913. flush_pending(strm);
  79914. /* If avail_out is zero, the application will call deflate again
  79915. * to flush the rest.
  79916. */
  79917. if (s.wrap > 0) { s.wrap = -s.wrap; }
  79918. /* write the trailer only once! */
  79919. return s.pending !== 0 ? Z_OK : Z_STREAM_END;
  79920. }
  79921. function deflateEnd(strm) {
  79922. var status;
  79923. if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
  79924. return Z_STREAM_ERROR;
  79925. }
  79926. status = strm.state.status;
  79927. if (status !== INIT_STATE &&
  79928. status !== EXTRA_STATE &&
  79929. status !== NAME_STATE &&
  79930. status !== COMMENT_STATE &&
  79931. status !== HCRC_STATE &&
  79932. status !== BUSY_STATE &&
  79933. status !== FINISH_STATE
  79934. ) {
  79935. return err(strm, Z_STREAM_ERROR);
  79936. }
  79937. strm.state = null;
  79938. return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
  79939. }
  79940. /* =========================================================================
  79941. * Copy the source state to the destination state
  79942. */
  79943. //function deflateCopy(dest, source) {
  79944. //
  79945. //}
  79946. exports.deflateInit = deflateInit;
  79947. exports.deflateInit2 = deflateInit2;
  79948. exports.deflateReset = deflateReset;
  79949. exports.deflateResetKeep = deflateResetKeep;
  79950. exports.deflateSetHeader = deflateSetHeader;
  79951. exports.deflate = deflate;
  79952. exports.deflateEnd = deflateEnd;
  79953. exports.deflateInfo = 'pako deflate (from Nodeca project)';
  79954. /* Not implemented
  79955. exports.deflateBound = deflateBound;
  79956. exports.deflateCopy = deflateCopy;
  79957. exports.deflateSetDictionary = deflateSetDictionary;
  79958. exports.deflateParams = deflateParams;
  79959. exports.deflatePending = deflatePending;
  79960. exports.deflatePrime = deflatePrime;
  79961. exports.deflateTune = deflateTune;
  79962. */
  79963. },{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(_dereq_,module,exports){
  79964. 'use strict';
  79965. function GZheader() {
  79966. /* true if compressed data believed to be text */
  79967. this.text = 0;
  79968. /* modification time */
  79969. this.time = 0;
  79970. /* extra flags (not used when writing a gzip file) */
  79971. this.xflags = 0;
  79972. /* operating system */
  79973. this.os = 0;
  79974. /* pointer to extra field or Z_NULL if none */
  79975. this.extra = null;
  79976. /* extra field length (valid if extra != Z_NULL) */
  79977. this.extra_len = 0; // Actually, we don't need it in JS,
  79978. // but leave for few code modifications
  79979. //
  79980. // Setup limits is not necessary because in js we should not preallocate memory
  79981. // for inflate use constant limit in 65536 bytes
  79982. //
  79983. /* space at extra (only when reading header) */
  79984. // this.extra_max = 0;
  79985. /* pointer to zero-terminated file name or Z_NULL */
  79986. this.name = '';
  79987. /* space at name (only when reading header) */
  79988. // this.name_max = 0;
  79989. /* pointer to zero-terminated comment or Z_NULL */
  79990. this.comment = '';
  79991. /* space at comment (only when reading header) */
  79992. // this.comm_max = 0;
  79993. /* true if there was or will be a header crc */
  79994. this.hcrc = 0;
  79995. /* true when done reading gzip header (not used when writing a gzip file) */
  79996. this.done = false;
  79997. }
  79998. module.exports = GZheader;
  79999. },{}],34:[function(_dereq_,module,exports){
  80000. 'use strict';
  80001. // See state defs from inflate.js
  80002. var BAD = 30; /* got a data error -- remain here until reset */
  80003. var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
  80004. /*
  80005. Decode literal, length, and distance codes and write out the resulting
  80006. literal and match bytes until either not enough input or output is
  80007. available, an end-of-block is encountered, or a data error is encountered.
  80008. When large enough input and output buffers are supplied to inflate(), for
  80009. example, a 16K input buffer and a 64K output buffer, more than 95% of the
  80010. inflate execution time is spent in this routine.
  80011. Entry assumptions:
  80012. state.mode === LEN
  80013. strm.avail_in >= 6
  80014. strm.avail_out >= 258
  80015. start >= strm.avail_out
  80016. state.bits < 8
  80017. On return, state.mode is one of:
  80018. LEN -- ran out of enough output space or enough available input
  80019. TYPE -- reached end of block code, inflate() to interpret next block
  80020. BAD -- error in block data
  80021. Notes:
  80022. - The maximum input bits used by a length/distance pair is 15 bits for the
  80023. length code, 5 bits for the length extra, 15 bits for the distance code,
  80024. and 13 bits for the distance extra. This totals 48 bits, or six bytes.
  80025. Therefore if strm.avail_in >= 6, then there is enough input to avoid
  80026. checking for available input while decoding.
  80027. - The maximum bytes that a single length/distance pair can output is 258
  80028. bytes, which is the maximum length that can be coded. inflate_fast()
  80029. requires strm.avail_out >= 258 for each loop to avoid checking for
  80030. output space.
  80031. */
  80032. module.exports = function inflate_fast(strm, start) {
  80033. var state;
  80034. var _in; /* local strm.input */
  80035. var last; /* have enough input while in < last */
  80036. var _out; /* local strm.output */
  80037. var beg; /* inflate()'s initial strm.output */
  80038. var end; /* while out < end, enough space available */
  80039. //#ifdef INFLATE_STRICT
  80040. var dmax; /* maximum distance from zlib header */
  80041. //#endif
  80042. var wsize; /* window size or zero if not using window */
  80043. var whave; /* valid bytes in the window */
  80044. var wnext; /* window write index */
  80045. var window; /* allocated sliding window, if wsize != 0 */
  80046. var hold; /* local strm.hold */
  80047. var bits; /* local strm.bits */
  80048. var lcode; /* local strm.lencode */
  80049. var dcode; /* local strm.distcode */
  80050. var lmask; /* mask for first level of length codes */
  80051. var dmask; /* mask for first level of distance codes */
  80052. var here; /* retrieved table entry */
  80053. var op; /* code bits, operation, extra bits, or */
  80054. /* window position, window bytes to copy */
  80055. var len; /* match length, unused bytes */
  80056. var dist; /* match distance */
  80057. var from; /* where to copy match from */
  80058. var from_source;
  80059. var input, output; // JS specific, because we have no pointers
  80060. /* copy state to local variables */
  80061. state = strm.state;
  80062. //here = state.here;
  80063. _in = strm.next_in;
  80064. input = strm.input;
  80065. last = _in + (strm.avail_in - 5);
  80066. _out = strm.next_out;
  80067. output = strm.output;
  80068. beg = _out - (start - strm.avail_out);
  80069. end = _out + (strm.avail_out - 257);
  80070. //#ifdef INFLATE_STRICT
  80071. dmax = state.dmax;
  80072. //#endif
  80073. wsize = state.wsize;
  80074. whave = state.whave;
  80075. wnext = state.wnext;
  80076. window = state.window;
  80077. hold = state.hold;
  80078. bits = state.bits;
  80079. lcode = state.lencode;
  80080. dcode = state.distcode;
  80081. lmask = (1 << state.lenbits) - 1;
  80082. dmask = (1 << state.distbits) - 1;
  80083. /* decode literals and length/distances until end-of-block or not enough
  80084. input data or output space */
  80085. top:
  80086. do {
  80087. if (bits < 15) {
  80088. hold += input[_in++] << bits;
  80089. bits += 8;
  80090. hold += input[_in++] << bits;
  80091. bits += 8;
  80092. }
  80093. here = lcode[hold & lmask];
  80094. dolen:
  80095. for (;;) { // Goto emulation
  80096. op = here >>> 24/*here.bits*/;
  80097. hold >>>= op;
  80098. bits -= op;
  80099. op = (here >>> 16) & 0xff/*here.op*/;
  80100. if (op === 0) { /* literal */
  80101. //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  80102. // "inflate: literal '%c'\n" :
  80103. // "inflate: literal 0x%02x\n", here.val));
  80104. output[_out++] = here & 0xffff/*here.val*/;
  80105. }
  80106. else if (op & 16) { /* length base */
  80107. len = here & 0xffff/*here.val*/;
  80108. op &= 15; /* number of extra bits */
  80109. if (op) {
  80110. if (bits < op) {
  80111. hold += input[_in++] << bits;
  80112. bits += 8;
  80113. }
  80114. len += hold & ((1 << op) - 1);
  80115. hold >>>= op;
  80116. bits -= op;
  80117. }
  80118. //Tracevv((stderr, "inflate: length %u\n", len));
  80119. if (bits < 15) {
  80120. hold += input[_in++] << bits;
  80121. bits += 8;
  80122. hold += input[_in++] << bits;
  80123. bits += 8;
  80124. }
  80125. here = dcode[hold & dmask];
  80126. dodist:
  80127. for (;;) { // goto emulation
  80128. op = here >>> 24/*here.bits*/;
  80129. hold >>>= op;
  80130. bits -= op;
  80131. op = (here >>> 16) & 0xff/*here.op*/;
  80132. if (op & 16) { /* distance base */
  80133. dist = here & 0xffff/*here.val*/;
  80134. op &= 15; /* number of extra bits */
  80135. if (bits < op) {
  80136. hold += input[_in++] << bits;
  80137. bits += 8;
  80138. if (bits < op) {
  80139. hold += input[_in++] << bits;
  80140. bits += 8;
  80141. }
  80142. }
  80143. dist += hold & ((1 << op) - 1);
  80144. //#ifdef INFLATE_STRICT
  80145. if (dist > dmax) {
  80146. strm.msg = 'invalid distance too far back';
  80147. state.mode = BAD;
  80148. break top;
  80149. }
  80150. //#endif
  80151. hold >>>= op;
  80152. bits -= op;
  80153. //Tracevv((stderr, "inflate: distance %u\n", dist));
  80154. op = _out - beg; /* max distance in output */
  80155. if (dist > op) { /* see if copy from window */
  80156. op = dist - op; /* distance back in window */
  80157. if (op > whave) {
  80158. if (state.sane) {
  80159. strm.msg = 'invalid distance too far back';
  80160. state.mode = BAD;
  80161. break top;
  80162. }
  80163. // (!) This block is disabled in zlib defailts,
  80164. // don't enable it for binary compatibility
  80165. //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  80166. // if (len <= op - whave) {
  80167. // do {
  80168. // output[_out++] = 0;
  80169. // } while (--len);
  80170. // continue top;
  80171. // }
  80172. // len -= op - whave;
  80173. // do {
  80174. // output[_out++] = 0;
  80175. // } while (--op > whave);
  80176. // if (op === 0) {
  80177. // from = _out - dist;
  80178. // do {
  80179. // output[_out++] = output[from++];
  80180. // } while (--len);
  80181. // continue top;
  80182. // }
  80183. //#endif
  80184. }
  80185. from = 0; // window index
  80186. from_source = window;
  80187. if (wnext === 0) { /* very common case */
  80188. from += wsize - op;
  80189. if (op < len) { /* some from window */
  80190. len -= op;
  80191. do {
  80192. output[_out++] = window[from++];
  80193. } while (--op);
  80194. from = _out - dist; /* rest from output */
  80195. from_source = output;
  80196. }
  80197. }
  80198. else if (wnext < op) { /* wrap around window */
  80199. from += wsize + wnext - op;
  80200. op -= wnext;
  80201. if (op < len) { /* some from end of window */
  80202. len -= op;
  80203. do {
  80204. output[_out++] = window[from++];
  80205. } while (--op);
  80206. from = 0;
  80207. if (wnext < len) { /* some from start of window */
  80208. op = wnext;
  80209. len -= op;
  80210. do {
  80211. output[_out++] = window[from++];
  80212. } while (--op);
  80213. from = _out - dist; /* rest from output */
  80214. from_source = output;
  80215. }
  80216. }
  80217. }
  80218. else { /* contiguous in window */
  80219. from += wnext - op;
  80220. if (op < len) { /* some from window */
  80221. len -= op;
  80222. do {
  80223. output[_out++] = window[from++];
  80224. } while (--op);
  80225. from = _out - dist; /* rest from output */
  80226. from_source = output;
  80227. }
  80228. }
  80229. while (len > 2) {
  80230. output[_out++] = from_source[from++];
  80231. output[_out++] = from_source[from++];
  80232. output[_out++] = from_source[from++];
  80233. len -= 3;
  80234. }
  80235. if (len) {
  80236. output[_out++] = from_source[from++];
  80237. if (len > 1) {
  80238. output[_out++] = from_source[from++];
  80239. }
  80240. }
  80241. }
  80242. else {
  80243. from = _out - dist; /* copy direct from output */
  80244. do { /* minimum length is three */
  80245. output[_out++] = output[from++];
  80246. output[_out++] = output[from++];
  80247. output[_out++] = output[from++];
  80248. len -= 3;
  80249. } while (len > 2);
  80250. if (len) {
  80251. output[_out++] = output[from++];
  80252. if (len > 1) {
  80253. output[_out++] = output[from++];
  80254. }
  80255. }
  80256. }
  80257. }
  80258. else if ((op & 64) === 0) { /* 2nd level distance code */
  80259. here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
  80260. continue dodist;
  80261. }
  80262. else {
  80263. strm.msg = 'invalid distance code';
  80264. state.mode = BAD;
  80265. break top;
  80266. }
  80267. break; // need to emulate goto via "continue"
  80268. }
  80269. }
  80270. else if ((op & 64) === 0) { /* 2nd level length code */
  80271. here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
  80272. continue dolen;
  80273. }
  80274. else if (op & 32) { /* end-of-block */
  80275. //Tracevv((stderr, "inflate: end of block\n"));
  80276. state.mode = TYPE;
  80277. break top;
  80278. }
  80279. else {
  80280. strm.msg = 'invalid literal/length code';
  80281. state.mode = BAD;
  80282. break top;
  80283. }
  80284. break; // need to emulate goto via "continue"
  80285. }
  80286. } while (_in < last && _out < end);
  80287. /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  80288. len = bits >> 3;
  80289. _in -= len;
  80290. bits -= len << 3;
  80291. hold &= (1 << bits) - 1;
  80292. /* update state and return */
  80293. strm.next_in = _in;
  80294. strm.next_out = _out;
  80295. strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
  80296. strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
  80297. state.hold = hold;
  80298. state.bits = bits;
  80299. return;
  80300. };
  80301. },{}],35:[function(_dereq_,module,exports){
  80302. 'use strict';
  80303. var utils = _dereq_('../utils/common');
  80304. var adler32 = _dereq_('./adler32');
  80305. var crc32 = _dereq_('./crc32');
  80306. var inflate_fast = _dereq_('./inffast');
  80307. var inflate_table = _dereq_('./inftrees');
  80308. var CODES = 0;
  80309. var LENS = 1;
  80310. var DISTS = 2;
  80311. /* Public constants ==========================================================*/
  80312. /* ===========================================================================*/
  80313. /* Allowed flush values; see deflate() and inflate() below for details */
  80314. //var Z_NO_FLUSH = 0;
  80315. //var Z_PARTIAL_FLUSH = 1;
  80316. //var Z_SYNC_FLUSH = 2;
  80317. //var Z_FULL_FLUSH = 3;
  80318. var Z_FINISH = 4;
  80319. var Z_BLOCK = 5;
  80320. var Z_TREES = 6;
  80321. /* Return codes for the compression/decompression functions. Negative values
  80322. * are errors, positive values are used for special but normal events.
  80323. */
  80324. var Z_OK = 0;
  80325. var Z_STREAM_END = 1;
  80326. var Z_NEED_DICT = 2;
  80327. //var Z_ERRNO = -1;
  80328. var Z_STREAM_ERROR = -2;
  80329. var Z_DATA_ERROR = -3;
  80330. var Z_MEM_ERROR = -4;
  80331. var Z_BUF_ERROR = -5;
  80332. //var Z_VERSION_ERROR = -6;
  80333. /* The deflate compression method */
  80334. var Z_DEFLATED = 8;
  80335. /* STATES ====================================================================*/
  80336. /* ===========================================================================*/
  80337. var HEAD = 1; /* i: waiting for magic header */
  80338. var FLAGS = 2; /* i: waiting for method and flags (gzip) */
  80339. var TIME = 3; /* i: waiting for modification time (gzip) */
  80340. var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
  80341. var EXLEN = 5; /* i: waiting for extra length (gzip) */
  80342. var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
  80343. var NAME = 7; /* i: waiting for end of file name (gzip) */
  80344. var COMMENT = 8; /* i: waiting for end of comment (gzip) */
  80345. var HCRC = 9; /* i: waiting for header crc (gzip) */
  80346. var DICTID = 10; /* i: waiting for dictionary check value */
  80347. var DICT = 11; /* waiting for inflateSetDictionary() call */
  80348. var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
  80349. var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
  80350. var STORED = 14; /* i: waiting for stored size (length and complement) */
  80351. var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
  80352. var COPY = 16; /* i/o: waiting for input or output to copy stored block */
  80353. var TABLE = 17; /* i: waiting for dynamic block table lengths */
  80354. var LENLENS = 18; /* i: waiting for code length code lengths */
  80355. var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
  80356. var LEN_ = 20; /* i: same as LEN below, but only first time in */
  80357. var LEN = 21; /* i: waiting for length/lit/eob code */
  80358. var LENEXT = 22; /* i: waiting for length extra bits */
  80359. var DIST = 23; /* i: waiting for distance code */
  80360. var DISTEXT = 24; /* i: waiting for distance extra bits */
  80361. var MATCH = 25; /* o: waiting for output space to copy string */
  80362. var LIT = 26; /* o: waiting for output space to write literal */
  80363. var CHECK = 27; /* i: waiting for 32-bit check value */
  80364. var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
  80365. var DONE = 29; /* finished check, done -- remain here until reset */
  80366. var BAD = 30; /* got a data error -- remain here until reset */
  80367. var MEM = 31; /* got an inflate() memory error -- remain here until reset */
  80368. var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
  80369. /* ===========================================================================*/
  80370. var ENOUGH_LENS = 852;
  80371. var ENOUGH_DISTS = 592;
  80372. //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
  80373. var MAX_WBITS = 15;
  80374. /* 32K LZ77 window */
  80375. var DEF_WBITS = MAX_WBITS;
  80376. function ZSWAP32(q) {
  80377. return (((q >>> 24) & 0xff) +
  80378. ((q >>> 8) & 0xff00) +
  80379. ((q & 0xff00) << 8) +
  80380. ((q & 0xff) << 24));
  80381. }
  80382. function InflateState() {
  80383. this.mode = 0; /* current inflate mode */
  80384. this.last = false; /* true if processing last block */
  80385. this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
  80386. this.havedict = false; /* true if dictionary provided */
  80387. this.flags = 0; /* gzip header method and flags (0 if zlib) */
  80388. this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
  80389. this.check = 0; /* protected copy of check value */
  80390. this.total = 0; /* protected copy of output count */
  80391. // TODO: may be {}
  80392. this.head = null; /* where to save gzip header information */
  80393. /* sliding window */
  80394. this.wbits = 0; /* log base 2 of requested window size */
  80395. this.wsize = 0; /* window size or zero if not using window */
  80396. this.whave = 0; /* valid bytes in the window */
  80397. this.wnext = 0; /* window write index */
  80398. this.window = null; /* allocated sliding window, if needed */
  80399. /* bit accumulator */
  80400. this.hold = 0; /* input bit accumulator */
  80401. this.bits = 0; /* number of bits in "in" */
  80402. /* for string and stored block copying */
  80403. this.length = 0; /* literal or length of data to copy */
  80404. this.offset = 0; /* distance back to copy string from */
  80405. /* for table and code decoding */
  80406. this.extra = 0; /* extra bits needed */
  80407. /* fixed and dynamic code tables */
  80408. this.lencode = null; /* starting table for length/literal codes */
  80409. this.distcode = null; /* starting table for distance codes */
  80410. this.lenbits = 0; /* index bits for lencode */
  80411. this.distbits = 0; /* index bits for distcode */
  80412. /* dynamic table building */
  80413. this.ncode = 0; /* number of code length code lengths */
  80414. this.nlen = 0; /* number of length code lengths */
  80415. this.ndist = 0; /* number of distance code lengths */
  80416. this.have = 0; /* number of code lengths in lens[] */
  80417. this.next = null; /* next available space in codes[] */
  80418. this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
  80419. this.work = new utils.Buf16(288); /* work area for code table building */
  80420. /*
  80421. because we don't have pointers in js, we use lencode and distcode directly
  80422. as buffers so we don't need codes
  80423. */
  80424. //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
  80425. this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
  80426. this.distdyn = null; /* dynamic table for distance codes (JS specific) */
  80427. this.sane = 0; /* if false, allow invalid distance too far */
  80428. this.back = 0; /* bits back of last unprocessed length/lit */
  80429. this.was = 0; /* initial length of match */
  80430. }
  80431. function inflateResetKeep(strm) {
  80432. var state;
  80433. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  80434. state = strm.state;
  80435. strm.total_in = strm.total_out = state.total = 0;
  80436. strm.msg = ''; /*Z_NULL*/
  80437. if (state.wrap) { /* to support ill-conceived Java test suite */
  80438. strm.adler = state.wrap & 1;
  80439. }
  80440. state.mode = HEAD;
  80441. state.last = 0;
  80442. state.havedict = 0;
  80443. state.dmax = 32768;
  80444. state.head = null/*Z_NULL*/;
  80445. state.hold = 0;
  80446. state.bits = 0;
  80447. //state.lencode = state.distcode = state.next = state.codes;
  80448. state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
  80449. state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
  80450. state.sane = 1;
  80451. state.back = -1;
  80452. //Tracev((stderr, "inflate: reset\n"));
  80453. return Z_OK;
  80454. }
  80455. function inflateReset(strm) {
  80456. var state;
  80457. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  80458. state = strm.state;
  80459. state.wsize = 0;
  80460. state.whave = 0;
  80461. state.wnext = 0;
  80462. return inflateResetKeep(strm);
  80463. }
  80464. function inflateReset2(strm, windowBits) {
  80465. var wrap;
  80466. var state;
  80467. /* get the state */
  80468. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  80469. state = strm.state;
  80470. /* extract wrap request from windowBits parameter */
  80471. if (windowBits < 0) {
  80472. wrap = 0;
  80473. windowBits = -windowBits;
  80474. }
  80475. else {
  80476. wrap = (windowBits >> 4) + 1;
  80477. if (windowBits < 48) {
  80478. windowBits &= 15;
  80479. }
  80480. }
  80481. /* set number of window bits, free window if different */
  80482. if (windowBits && (windowBits < 8 || windowBits > 15)) {
  80483. return Z_STREAM_ERROR;
  80484. }
  80485. if (state.window !== null && state.wbits !== windowBits) {
  80486. state.window = null;
  80487. }
  80488. /* update state and reset the rest of it */
  80489. state.wrap = wrap;
  80490. state.wbits = windowBits;
  80491. return inflateReset(strm);
  80492. }
  80493. function inflateInit2(strm, windowBits) {
  80494. var ret;
  80495. var state;
  80496. if (!strm) { return Z_STREAM_ERROR; }
  80497. //strm.msg = Z_NULL; /* in case we return an error */
  80498. state = new InflateState();
  80499. //if (state === Z_NULL) return Z_MEM_ERROR;
  80500. //Tracev((stderr, "inflate: allocated\n"));
  80501. strm.state = state;
  80502. state.window = null/*Z_NULL*/;
  80503. ret = inflateReset2(strm, windowBits);
  80504. if (ret !== Z_OK) {
  80505. strm.state = null/*Z_NULL*/;
  80506. }
  80507. return ret;
  80508. }
  80509. function inflateInit(strm) {
  80510. return inflateInit2(strm, DEF_WBITS);
  80511. }
  80512. /*
  80513. Return state with length and distance decoding tables and index sizes set to
  80514. fixed code decoding. Normally this returns fixed tables from inffixed.h.
  80515. If BUILDFIXED is defined, then instead this routine builds the tables the
  80516. first time it's called, and returns those tables the first time and
  80517. thereafter. This reduces the size of the code by about 2K bytes, in
  80518. exchange for a little execution time. However, BUILDFIXED should not be
  80519. used for threaded applications, since the rewriting of the tables and virgin
  80520. may not be thread-safe.
  80521. */
  80522. var virgin = true;
  80523. var lenfix, distfix; // We have no pointers in JS, so keep tables separate
  80524. function fixedtables(state) {
  80525. /* build fixed huffman tables if first call (may not be thread safe) */
  80526. if (virgin) {
  80527. var sym;
  80528. lenfix = new utils.Buf32(512);
  80529. distfix = new utils.Buf32(32);
  80530. /* literal/length table */
  80531. sym = 0;
  80532. while (sym < 144) { state.lens[sym++] = 8; }
  80533. while (sym < 256) { state.lens[sym++] = 9; }
  80534. while (sym < 280) { state.lens[sym++] = 7; }
  80535. while (sym < 288) { state.lens[sym++] = 8; }
  80536. inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits: 9});
  80537. /* distance table */
  80538. sym = 0;
  80539. while (sym < 32) { state.lens[sym++] = 5; }
  80540. inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits: 5});
  80541. /* do this just once */
  80542. virgin = false;
  80543. }
  80544. state.lencode = lenfix;
  80545. state.lenbits = 9;
  80546. state.distcode = distfix;
  80547. state.distbits = 5;
  80548. }
  80549. /*
  80550. Update the window with the last wsize (normally 32K) bytes written before
  80551. returning. If window does not exist yet, create it. This is only called
  80552. when a window is already in use, or when output has been written during this
  80553. inflate call, but the end of the deflate stream has not been reached yet.
  80554. It is also called to create a window for dictionary data when a dictionary
  80555. is loaded.
  80556. Providing output buffers larger than 32K to inflate() should provide a speed
  80557. advantage, since only the last 32K of output is copied to the sliding window
  80558. upon return from inflate(), and since all distances after the first 32K of
  80559. output will fall in the output data, making match copies simpler and faster.
  80560. The advantage may be dependent on the size of the processor's data caches.
  80561. */
  80562. function updatewindow(strm, src, end, copy) {
  80563. var dist;
  80564. var state = strm.state;
  80565. /* if it hasn't been done already, allocate space for the window */
  80566. if (state.window === null) {
  80567. state.wsize = 1 << state.wbits;
  80568. state.wnext = 0;
  80569. state.whave = 0;
  80570. state.window = new utils.Buf8(state.wsize);
  80571. }
  80572. /* copy state->wsize or less output bytes into the circular window */
  80573. if (copy >= state.wsize) {
  80574. utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0);
  80575. state.wnext = 0;
  80576. state.whave = state.wsize;
  80577. }
  80578. else {
  80579. dist = state.wsize - state.wnext;
  80580. if (dist > copy) {
  80581. dist = copy;
  80582. }
  80583. //zmemcpy(state->window + state->wnext, end - copy, dist);
  80584. utils.arraySet(state.window,src, end - copy, dist, state.wnext);
  80585. copy -= dist;
  80586. if (copy) {
  80587. //zmemcpy(state->window, end - copy, copy);
  80588. utils.arraySet(state.window,src, end - copy, copy, 0);
  80589. state.wnext = copy;
  80590. state.whave = state.wsize;
  80591. }
  80592. else {
  80593. state.wnext += dist;
  80594. if (state.wnext === state.wsize) { state.wnext = 0; }
  80595. if (state.whave < state.wsize) { state.whave += dist; }
  80596. }
  80597. }
  80598. return 0;
  80599. }
  80600. function inflate(strm, flush) {
  80601. var state;
  80602. var input, output; // input/output buffers
  80603. var next; /* next input INDEX */
  80604. var put; /* next output INDEX */
  80605. var have, left; /* available input and output */
  80606. var hold; /* bit buffer */
  80607. var bits; /* bits in bit buffer */
  80608. var _in, _out; /* save starting available input and output */
  80609. var copy; /* number of stored or match bytes to copy */
  80610. var from; /* where to copy match bytes from */
  80611. var from_source;
  80612. var here = 0; /* current decoding table entry */
  80613. var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
  80614. //var last; /* parent table entry */
  80615. var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
  80616. var len; /* length to copy for repeats, bits to drop */
  80617. var ret; /* return code */
  80618. var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
  80619. var opts;
  80620. var n; // temporary var for NEED_BITS
  80621. var order = /* permutation of code lengths */
  80622. [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  80623. if (!strm || !strm.state || !strm.output ||
  80624. (!strm.input && strm.avail_in !== 0)) {
  80625. return Z_STREAM_ERROR;
  80626. }
  80627. state = strm.state;
  80628. if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
  80629. //--- LOAD() ---
  80630. put = strm.next_out;
  80631. output = strm.output;
  80632. left = strm.avail_out;
  80633. next = strm.next_in;
  80634. input = strm.input;
  80635. have = strm.avail_in;
  80636. hold = state.hold;
  80637. bits = state.bits;
  80638. //---
  80639. _in = have;
  80640. _out = left;
  80641. ret = Z_OK;
  80642. inf_leave: // goto emulation
  80643. for (;;) {
  80644. switch (state.mode) {
  80645. case HEAD:
  80646. if (state.wrap === 0) {
  80647. state.mode = TYPEDO;
  80648. break;
  80649. }
  80650. //=== NEEDBITS(16);
  80651. while (bits < 16) {
  80652. if (have === 0) { break inf_leave; }
  80653. have--;
  80654. hold += input[next++] << bits;
  80655. bits += 8;
  80656. }
  80657. //===//
  80658. if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
  80659. state.check = 0/*crc32(0L, Z_NULL, 0)*/;
  80660. //=== CRC2(state.check, hold);
  80661. hbuf[0] = hold & 0xff;
  80662. hbuf[1] = (hold >>> 8) & 0xff;
  80663. state.check = crc32(state.check, hbuf, 2, 0);
  80664. //===//
  80665. //=== INITBITS();
  80666. hold = 0;
  80667. bits = 0;
  80668. //===//
  80669. state.mode = FLAGS;
  80670. break;
  80671. }
  80672. state.flags = 0; /* expect zlib header */
  80673. if (state.head) {
  80674. state.head.done = false;
  80675. }
  80676. if (!(state.wrap & 1) || /* check if zlib header allowed */
  80677. (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
  80678. strm.msg = 'incorrect header check';
  80679. state.mode = BAD;
  80680. break;
  80681. }
  80682. if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
  80683. strm.msg = 'unknown compression method';
  80684. state.mode = BAD;
  80685. break;
  80686. }
  80687. //--- DROPBITS(4) ---//
  80688. hold >>>= 4;
  80689. bits -= 4;
  80690. //---//
  80691. len = (hold & 0x0f)/*BITS(4)*/ + 8;
  80692. if (state.wbits === 0) {
  80693. state.wbits = len;
  80694. }
  80695. else if (len > state.wbits) {
  80696. strm.msg = 'invalid window size';
  80697. state.mode = BAD;
  80698. break;
  80699. }
  80700. state.dmax = 1 << len;
  80701. //Tracev((stderr, "inflate: zlib header ok\n"));
  80702. strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
  80703. state.mode = hold & 0x200 ? DICTID : TYPE;
  80704. //=== INITBITS();
  80705. hold = 0;
  80706. bits = 0;
  80707. //===//
  80708. break;
  80709. case FLAGS:
  80710. //=== NEEDBITS(16); */
  80711. while (bits < 16) {
  80712. if (have === 0) { break inf_leave; }
  80713. have--;
  80714. hold += input[next++] << bits;
  80715. bits += 8;
  80716. }
  80717. //===//
  80718. state.flags = hold;
  80719. if ((state.flags & 0xff) !== Z_DEFLATED) {
  80720. strm.msg = 'unknown compression method';
  80721. state.mode = BAD;
  80722. break;
  80723. }
  80724. if (state.flags & 0xe000) {
  80725. strm.msg = 'unknown header flags set';
  80726. state.mode = BAD;
  80727. break;
  80728. }
  80729. if (state.head) {
  80730. state.head.text = ((hold >> 8) & 1);
  80731. }
  80732. if (state.flags & 0x0200) {
  80733. //=== CRC2(state.check, hold);
  80734. hbuf[0] = hold & 0xff;
  80735. hbuf[1] = (hold >>> 8) & 0xff;
  80736. state.check = crc32(state.check, hbuf, 2, 0);
  80737. //===//
  80738. }
  80739. //=== INITBITS();
  80740. hold = 0;
  80741. bits = 0;
  80742. //===//
  80743. state.mode = TIME;
  80744. /* falls through */
  80745. case TIME:
  80746. //=== NEEDBITS(32); */
  80747. while (bits < 32) {
  80748. if (have === 0) { break inf_leave; }
  80749. have--;
  80750. hold += input[next++] << bits;
  80751. bits += 8;
  80752. }
  80753. //===//
  80754. if (state.head) {
  80755. state.head.time = hold;
  80756. }
  80757. if (state.flags & 0x0200) {
  80758. //=== CRC4(state.check, hold)
  80759. hbuf[0] = hold & 0xff;
  80760. hbuf[1] = (hold >>> 8) & 0xff;
  80761. hbuf[2] = (hold >>> 16) & 0xff;
  80762. hbuf[3] = (hold >>> 24) & 0xff;
  80763. state.check = crc32(state.check, hbuf, 4, 0);
  80764. //===
  80765. }
  80766. //=== INITBITS();
  80767. hold = 0;
  80768. bits = 0;
  80769. //===//
  80770. state.mode = OS;
  80771. /* falls through */
  80772. case OS:
  80773. //=== NEEDBITS(16); */
  80774. while (bits < 16) {
  80775. if (have === 0) { break inf_leave; }
  80776. have--;
  80777. hold += input[next++] << bits;
  80778. bits += 8;
  80779. }
  80780. //===//
  80781. if (state.head) {
  80782. state.head.xflags = (hold & 0xff);
  80783. state.head.os = (hold >> 8);
  80784. }
  80785. if (state.flags & 0x0200) {
  80786. //=== CRC2(state.check, hold);
  80787. hbuf[0] = hold & 0xff;
  80788. hbuf[1] = (hold >>> 8) & 0xff;
  80789. state.check = crc32(state.check, hbuf, 2, 0);
  80790. //===//
  80791. }
  80792. //=== INITBITS();
  80793. hold = 0;
  80794. bits = 0;
  80795. //===//
  80796. state.mode = EXLEN;
  80797. /* falls through */
  80798. case EXLEN:
  80799. if (state.flags & 0x0400) {
  80800. //=== NEEDBITS(16); */
  80801. while (bits < 16) {
  80802. if (have === 0) { break inf_leave; }
  80803. have--;
  80804. hold += input[next++] << bits;
  80805. bits += 8;
  80806. }
  80807. //===//
  80808. state.length = hold;
  80809. if (state.head) {
  80810. state.head.extra_len = hold;
  80811. }
  80812. if (state.flags & 0x0200) {
  80813. //=== CRC2(state.check, hold);
  80814. hbuf[0] = hold & 0xff;
  80815. hbuf[1] = (hold >>> 8) & 0xff;
  80816. state.check = crc32(state.check, hbuf, 2, 0);
  80817. //===//
  80818. }
  80819. //=== INITBITS();
  80820. hold = 0;
  80821. bits = 0;
  80822. //===//
  80823. }
  80824. else if (state.head) {
  80825. state.head.extra = null/*Z_NULL*/;
  80826. }
  80827. state.mode = EXTRA;
  80828. /* falls through */
  80829. case EXTRA:
  80830. if (state.flags & 0x0400) {
  80831. copy = state.length;
  80832. if (copy > have) { copy = have; }
  80833. if (copy) {
  80834. if (state.head) {
  80835. len = state.head.extra_len - state.length;
  80836. if (!state.head.extra) {
  80837. // Use untyped array for more conveniend processing later
  80838. state.head.extra = new Array(state.head.extra_len);
  80839. }
  80840. utils.arraySet(
  80841. state.head.extra,
  80842. input,
  80843. next,
  80844. // extra field is limited to 65536 bytes
  80845. // - no need for additional size check
  80846. copy,
  80847. /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
  80848. len
  80849. );
  80850. //zmemcpy(state.head.extra + len, next,
  80851. // len + copy > state.head.extra_max ?
  80852. // state.head.extra_max - len : copy);
  80853. }
  80854. if (state.flags & 0x0200) {
  80855. state.check = crc32(state.check, input, copy, next);
  80856. }
  80857. have -= copy;
  80858. next += copy;
  80859. state.length -= copy;
  80860. }
  80861. if (state.length) { break inf_leave; }
  80862. }
  80863. state.length = 0;
  80864. state.mode = NAME;
  80865. /* falls through */
  80866. case NAME:
  80867. if (state.flags & 0x0800) {
  80868. if (have === 0) { break inf_leave; }
  80869. copy = 0;
  80870. do {
  80871. // TODO: 2 or 1 bytes?
  80872. len = input[next + copy++];
  80873. /* use constant limit because in js we should not preallocate memory */
  80874. if (state.head && len &&
  80875. (state.length < 65536 /*state.head.name_max*/)) {
  80876. state.head.name += String.fromCharCode(len);
  80877. }
  80878. } while (len && copy < have);
  80879. if (state.flags & 0x0200) {
  80880. state.check = crc32(state.check, input, copy, next);
  80881. }
  80882. have -= copy;
  80883. next += copy;
  80884. if (len) { break inf_leave; }
  80885. }
  80886. else if (state.head) {
  80887. state.head.name = null;
  80888. }
  80889. state.length = 0;
  80890. state.mode = COMMENT;
  80891. /* falls through */
  80892. case COMMENT:
  80893. if (state.flags & 0x1000) {
  80894. if (have === 0) { break inf_leave; }
  80895. copy = 0;
  80896. do {
  80897. len = input[next + copy++];
  80898. /* use constant limit because in js we should not preallocate memory */
  80899. if (state.head && len &&
  80900. (state.length < 65536 /*state.head.comm_max*/)) {
  80901. state.head.comment += String.fromCharCode(len);
  80902. }
  80903. } while (len && copy < have);
  80904. if (state.flags & 0x0200) {
  80905. state.check = crc32(state.check, input, copy, next);
  80906. }
  80907. have -= copy;
  80908. next += copy;
  80909. if (len) { break inf_leave; }
  80910. }
  80911. else if (state.head) {
  80912. state.head.comment = null;
  80913. }
  80914. state.mode = HCRC;
  80915. /* falls through */
  80916. case HCRC:
  80917. if (state.flags & 0x0200) {
  80918. //=== NEEDBITS(16); */
  80919. while (bits < 16) {
  80920. if (have === 0) { break inf_leave; }
  80921. have--;
  80922. hold += input[next++] << bits;
  80923. bits += 8;
  80924. }
  80925. //===//
  80926. if (hold !== (state.check & 0xffff)) {
  80927. strm.msg = 'header crc mismatch';
  80928. state.mode = BAD;
  80929. break;
  80930. }
  80931. //=== INITBITS();
  80932. hold = 0;
  80933. bits = 0;
  80934. //===//
  80935. }
  80936. if (state.head) {
  80937. state.head.hcrc = ((state.flags >> 9) & 1);
  80938. state.head.done = true;
  80939. }
  80940. strm.adler = state.check = 0 /*crc32(0L, Z_NULL, 0)*/;
  80941. state.mode = TYPE;
  80942. break;
  80943. case DICTID:
  80944. //=== NEEDBITS(32); */
  80945. while (bits < 32) {
  80946. if (have === 0) { break inf_leave; }
  80947. have--;
  80948. hold += input[next++] << bits;
  80949. bits += 8;
  80950. }
  80951. //===//
  80952. strm.adler = state.check = ZSWAP32(hold);
  80953. //=== INITBITS();
  80954. hold = 0;
  80955. bits = 0;
  80956. //===//
  80957. state.mode = DICT;
  80958. /* falls through */
  80959. case DICT:
  80960. if (state.havedict === 0) {
  80961. //--- RESTORE() ---
  80962. strm.next_out = put;
  80963. strm.avail_out = left;
  80964. strm.next_in = next;
  80965. strm.avail_in = have;
  80966. state.hold = hold;
  80967. state.bits = bits;
  80968. //---
  80969. return Z_NEED_DICT;
  80970. }
  80971. strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
  80972. state.mode = TYPE;
  80973. /* falls through */
  80974. case TYPE:
  80975. if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
  80976. /* falls through */
  80977. case TYPEDO:
  80978. if (state.last) {
  80979. //--- BYTEBITS() ---//
  80980. hold >>>= bits & 7;
  80981. bits -= bits & 7;
  80982. //---//
  80983. state.mode = CHECK;
  80984. break;
  80985. }
  80986. //=== NEEDBITS(3); */
  80987. while (bits < 3) {
  80988. if (have === 0) { break inf_leave; }
  80989. have--;
  80990. hold += input[next++] << bits;
  80991. bits += 8;
  80992. }
  80993. //===//
  80994. state.last = (hold & 0x01)/*BITS(1)*/;
  80995. //--- DROPBITS(1) ---//
  80996. hold >>>= 1;
  80997. bits -= 1;
  80998. //---//
  80999. switch ((hold & 0x03)/*BITS(2)*/) {
  81000. case 0: /* stored block */
  81001. //Tracev((stderr, "inflate: stored block%s\n",
  81002. // state.last ? " (last)" : ""));
  81003. state.mode = STORED;
  81004. break;
  81005. case 1: /* fixed block */
  81006. fixedtables(state);
  81007. //Tracev((stderr, "inflate: fixed codes block%s\n",
  81008. // state.last ? " (last)" : ""));
  81009. state.mode = LEN_; /* decode codes */
  81010. if (flush === Z_TREES) {
  81011. //--- DROPBITS(2) ---//
  81012. hold >>>= 2;
  81013. bits -= 2;
  81014. //---//
  81015. break inf_leave;
  81016. }
  81017. break;
  81018. case 2: /* dynamic block */
  81019. //Tracev((stderr, "inflate: dynamic codes block%s\n",
  81020. // state.last ? " (last)" : ""));
  81021. state.mode = TABLE;
  81022. break;
  81023. case 3:
  81024. strm.msg = 'invalid block type';
  81025. state.mode = BAD;
  81026. }
  81027. //--- DROPBITS(2) ---//
  81028. hold >>>= 2;
  81029. bits -= 2;
  81030. //---//
  81031. break;
  81032. case STORED:
  81033. //--- BYTEBITS() ---// /* go to byte boundary */
  81034. hold >>>= bits & 7;
  81035. bits -= bits & 7;
  81036. //---//
  81037. //=== NEEDBITS(32); */
  81038. while (bits < 32) {
  81039. if (have === 0) { break inf_leave; }
  81040. have--;
  81041. hold += input[next++] << bits;
  81042. bits += 8;
  81043. }
  81044. //===//
  81045. if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
  81046. strm.msg = 'invalid stored block lengths';
  81047. state.mode = BAD;
  81048. break;
  81049. }
  81050. state.length = hold & 0xffff;
  81051. //Tracev((stderr, "inflate: stored length %u\n",
  81052. // state.length));
  81053. //=== INITBITS();
  81054. hold = 0;
  81055. bits = 0;
  81056. //===//
  81057. state.mode = COPY_;
  81058. if (flush === Z_TREES) { break inf_leave; }
  81059. /* falls through */
  81060. case COPY_:
  81061. state.mode = COPY;
  81062. /* falls through */
  81063. case COPY:
  81064. copy = state.length;
  81065. if (copy) {
  81066. if (copy > have) { copy = have; }
  81067. if (copy > left) { copy = left; }
  81068. if (copy === 0) { break inf_leave; }
  81069. //--- zmemcpy(put, next, copy); ---
  81070. utils.arraySet(output, input, next, copy, put);
  81071. //---//
  81072. have -= copy;
  81073. next += copy;
  81074. left -= copy;
  81075. put += copy;
  81076. state.length -= copy;
  81077. break;
  81078. }
  81079. //Tracev((stderr, "inflate: stored end\n"));
  81080. state.mode = TYPE;
  81081. break;
  81082. case TABLE:
  81083. //=== NEEDBITS(14); */
  81084. while (bits < 14) {
  81085. if (have === 0) { break inf_leave; }
  81086. have--;
  81087. hold += input[next++] << bits;
  81088. bits += 8;
  81089. }
  81090. //===//
  81091. state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
  81092. //--- DROPBITS(5) ---//
  81093. hold >>>= 5;
  81094. bits -= 5;
  81095. //---//
  81096. state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
  81097. //--- DROPBITS(5) ---//
  81098. hold >>>= 5;
  81099. bits -= 5;
  81100. //---//
  81101. state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
  81102. //--- DROPBITS(4) ---//
  81103. hold >>>= 4;
  81104. bits -= 4;
  81105. //---//
  81106. //#ifndef PKZIP_BUG_WORKAROUND
  81107. if (state.nlen > 286 || state.ndist > 30) {
  81108. strm.msg = 'too many length or distance symbols';
  81109. state.mode = BAD;
  81110. break;
  81111. }
  81112. //#endif
  81113. //Tracev((stderr, "inflate: table sizes ok\n"));
  81114. state.have = 0;
  81115. state.mode = LENLENS;
  81116. /* falls through */
  81117. case LENLENS:
  81118. while (state.have < state.ncode) {
  81119. //=== NEEDBITS(3);
  81120. while (bits < 3) {
  81121. if (have === 0) { break inf_leave; }
  81122. have--;
  81123. hold += input[next++] << bits;
  81124. bits += 8;
  81125. }
  81126. //===//
  81127. state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
  81128. //--- DROPBITS(3) ---//
  81129. hold >>>= 3;
  81130. bits -= 3;
  81131. //---//
  81132. }
  81133. while (state.have < 19) {
  81134. state.lens[order[state.have++]] = 0;
  81135. }
  81136. // We have separate tables & no pointers. 2 commented lines below not needed.
  81137. //state.next = state.codes;
  81138. //state.lencode = state.next;
  81139. // Switch to use dynamic table
  81140. state.lencode = state.lendyn;
  81141. state.lenbits = 7;
  81142. opts = {bits: state.lenbits};
  81143. ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
  81144. state.lenbits = opts.bits;
  81145. if (ret) {
  81146. strm.msg = 'invalid code lengths set';
  81147. state.mode = BAD;
  81148. break;
  81149. }
  81150. //Tracev((stderr, "inflate: code lengths ok\n"));
  81151. state.have = 0;
  81152. state.mode = CODELENS;
  81153. /* falls through */
  81154. case CODELENS:
  81155. while (state.have < state.nlen + state.ndist) {
  81156. for (;;) {
  81157. here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
  81158. here_bits = here >>> 24;
  81159. here_op = (here >>> 16) & 0xff;
  81160. here_val = here & 0xffff;
  81161. if ((here_bits) <= bits) { break; }
  81162. //--- PULLBYTE() ---//
  81163. if (have === 0) { break inf_leave; }
  81164. have--;
  81165. hold += input[next++] << bits;
  81166. bits += 8;
  81167. //---//
  81168. }
  81169. if (here_val < 16) {
  81170. //--- DROPBITS(here.bits) ---//
  81171. hold >>>= here_bits;
  81172. bits -= here_bits;
  81173. //---//
  81174. state.lens[state.have++] = here_val;
  81175. }
  81176. else {
  81177. if (here_val === 16) {
  81178. //=== NEEDBITS(here.bits + 2);
  81179. n = here_bits + 2;
  81180. while (bits < n) {
  81181. if (have === 0) { break inf_leave; }
  81182. have--;
  81183. hold += input[next++] << bits;
  81184. bits += 8;
  81185. }
  81186. //===//
  81187. //--- DROPBITS(here.bits) ---//
  81188. hold >>>= here_bits;
  81189. bits -= here_bits;
  81190. //---//
  81191. if (state.have === 0) {
  81192. strm.msg = 'invalid bit length repeat';
  81193. state.mode = BAD;
  81194. break;
  81195. }
  81196. len = state.lens[state.have - 1];
  81197. copy = 3 + (hold & 0x03);//BITS(2);
  81198. //--- DROPBITS(2) ---//
  81199. hold >>>= 2;
  81200. bits -= 2;
  81201. //---//
  81202. }
  81203. else if (here_val === 17) {
  81204. //=== NEEDBITS(here.bits + 3);
  81205. n = here_bits + 3;
  81206. while (bits < n) {
  81207. if (have === 0) { break inf_leave; }
  81208. have--;
  81209. hold += input[next++] << bits;
  81210. bits += 8;
  81211. }
  81212. //===//
  81213. //--- DROPBITS(here.bits) ---//
  81214. hold >>>= here_bits;
  81215. bits -= here_bits;
  81216. //---//
  81217. len = 0;
  81218. copy = 3 + (hold & 0x07);//BITS(3);
  81219. //--- DROPBITS(3) ---//
  81220. hold >>>= 3;
  81221. bits -= 3;
  81222. //---//
  81223. }
  81224. else {
  81225. //=== NEEDBITS(here.bits + 7);
  81226. n = here_bits + 7;
  81227. while (bits < n) {
  81228. if (have === 0) { break inf_leave; }
  81229. have--;
  81230. hold += input[next++] << bits;
  81231. bits += 8;
  81232. }
  81233. //===//
  81234. //--- DROPBITS(here.bits) ---//
  81235. hold >>>= here_bits;
  81236. bits -= here_bits;
  81237. //---//
  81238. len = 0;
  81239. copy = 11 + (hold & 0x7f);//BITS(7);
  81240. //--- DROPBITS(7) ---//
  81241. hold >>>= 7;
  81242. bits -= 7;
  81243. //---//
  81244. }
  81245. if (state.have + copy > state.nlen + state.ndist) {
  81246. strm.msg = 'invalid bit length repeat';
  81247. state.mode = BAD;
  81248. break;
  81249. }
  81250. while (copy--) {
  81251. state.lens[state.have++] = len;
  81252. }
  81253. }
  81254. }
  81255. /* handle error breaks in while */
  81256. if (state.mode === BAD) { break; }
  81257. /* check for end-of-block code (better have one) */
  81258. if (state.lens[256] === 0) {
  81259. strm.msg = 'invalid code -- missing end-of-block';
  81260. state.mode = BAD;
  81261. break;
  81262. }
  81263. /* build code tables -- note: do not change the lenbits or distbits
  81264. values here (9 and 6) without reading the comments in inftrees.h
  81265. concerning the ENOUGH constants, which depend on those values */
  81266. state.lenbits = 9;
  81267. opts = {bits: state.lenbits};
  81268. ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
  81269. // We have separate tables & no pointers. 2 commented lines below not needed.
  81270. // state.next_index = opts.table_index;
  81271. state.lenbits = opts.bits;
  81272. // state.lencode = state.next;
  81273. if (ret) {
  81274. strm.msg = 'invalid literal/lengths set';
  81275. state.mode = BAD;
  81276. break;
  81277. }
  81278. state.distbits = 6;
  81279. //state.distcode.copy(state.codes);
  81280. // Switch to use dynamic table
  81281. state.distcode = state.distdyn;
  81282. opts = {bits: state.distbits};
  81283. ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
  81284. // We have separate tables & no pointers. 2 commented lines below not needed.
  81285. // state.next_index = opts.table_index;
  81286. state.distbits = opts.bits;
  81287. // state.distcode = state.next;
  81288. if (ret) {
  81289. strm.msg = 'invalid distances set';
  81290. state.mode = BAD;
  81291. break;
  81292. }
  81293. //Tracev((stderr, 'inflate: codes ok\n'));
  81294. state.mode = LEN_;
  81295. if (flush === Z_TREES) { break inf_leave; }
  81296. /* falls through */
  81297. case LEN_:
  81298. state.mode = LEN;
  81299. /* falls through */
  81300. case LEN:
  81301. if (have >= 6 && left >= 258) {
  81302. //--- RESTORE() ---
  81303. strm.next_out = put;
  81304. strm.avail_out = left;
  81305. strm.next_in = next;
  81306. strm.avail_in = have;
  81307. state.hold = hold;
  81308. state.bits = bits;
  81309. //---
  81310. inflate_fast(strm, _out);
  81311. //--- LOAD() ---
  81312. put = strm.next_out;
  81313. output = strm.output;
  81314. left = strm.avail_out;
  81315. next = strm.next_in;
  81316. input = strm.input;
  81317. have = strm.avail_in;
  81318. hold = state.hold;
  81319. bits = state.bits;
  81320. //---
  81321. if (state.mode === TYPE) {
  81322. state.back = -1;
  81323. }
  81324. break;
  81325. }
  81326. state.back = 0;
  81327. for (;;) {
  81328. here = state.lencode[hold & ((1 << state.lenbits) -1)]; /*BITS(state.lenbits)*/
  81329. here_bits = here >>> 24;
  81330. here_op = (here >>> 16) & 0xff;
  81331. here_val = here & 0xffff;
  81332. if (here_bits <= bits) { break; }
  81333. //--- PULLBYTE() ---//
  81334. if (have === 0) { break inf_leave; }
  81335. have--;
  81336. hold += input[next++] << bits;
  81337. bits += 8;
  81338. //---//
  81339. }
  81340. if (here_op && (here_op & 0xf0) === 0) {
  81341. last_bits = here_bits;
  81342. last_op = here_op;
  81343. last_val = here_val;
  81344. for (;;) {
  81345. here = state.lencode[last_val +
  81346. ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
  81347. here_bits = here >>> 24;
  81348. here_op = (here >>> 16) & 0xff;
  81349. here_val = here & 0xffff;
  81350. if ((last_bits + here_bits) <= bits) { break; }
  81351. //--- PULLBYTE() ---//
  81352. if (have === 0) { break inf_leave; }
  81353. have--;
  81354. hold += input[next++] << bits;
  81355. bits += 8;
  81356. //---//
  81357. }
  81358. //--- DROPBITS(last.bits) ---//
  81359. hold >>>= last_bits;
  81360. bits -= last_bits;
  81361. //---//
  81362. state.back += last_bits;
  81363. }
  81364. //--- DROPBITS(here.bits) ---//
  81365. hold >>>= here_bits;
  81366. bits -= here_bits;
  81367. //---//
  81368. state.back += here_bits;
  81369. state.length = here_val;
  81370. if (here_op === 0) {
  81371. //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  81372. // "inflate: literal '%c'\n" :
  81373. // "inflate: literal 0x%02x\n", here.val));
  81374. state.mode = LIT;
  81375. break;
  81376. }
  81377. if (here_op & 32) {
  81378. //Tracevv((stderr, "inflate: end of block\n"));
  81379. state.back = -1;
  81380. state.mode = TYPE;
  81381. break;
  81382. }
  81383. if (here_op & 64) {
  81384. strm.msg = 'invalid literal/length code';
  81385. state.mode = BAD;
  81386. break;
  81387. }
  81388. state.extra = here_op & 15;
  81389. state.mode = LENEXT;
  81390. /* falls through */
  81391. case LENEXT:
  81392. if (state.extra) {
  81393. //=== NEEDBITS(state.extra);
  81394. n = state.extra;
  81395. while (bits < n) {
  81396. if (have === 0) { break inf_leave; }
  81397. have--;
  81398. hold += input[next++] << bits;
  81399. bits += 8;
  81400. }
  81401. //===//
  81402. state.length += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
  81403. //--- DROPBITS(state.extra) ---//
  81404. hold >>>= state.extra;
  81405. bits -= state.extra;
  81406. //---//
  81407. state.back += state.extra;
  81408. }
  81409. //Tracevv((stderr, "inflate: length %u\n", state.length));
  81410. state.was = state.length;
  81411. state.mode = DIST;
  81412. /* falls through */
  81413. case DIST:
  81414. for (;;) {
  81415. here = state.distcode[hold & ((1 << state.distbits) -1)];/*BITS(state.distbits)*/
  81416. here_bits = here >>> 24;
  81417. here_op = (here >>> 16) & 0xff;
  81418. here_val = here & 0xffff;
  81419. if ((here_bits) <= bits) { break; }
  81420. //--- PULLBYTE() ---//
  81421. if (have === 0) { break inf_leave; }
  81422. have--;
  81423. hold += input[next++] << bits;
  81424. bits += 8;
  81425. //---//
  81426. }
  81427. if ((here_op & 0xf0) === 0) {
  81428. last_bits = here_bits;
  81429. last_op = here_op;
  81430. last_val = here_val;
  81431. for (;;) {
  81432. here = state.distcode[last_val +
  81433. ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
  81434. here_bits = here >>> 24;
  81435. here_op = (here >>> 16) & 0xff;
  81436. here_val = here & 0xffff;
  81437. if ((last_bits + here_bits) <= bits) { break; }
  81438. //--- PULLBYTE() ---//
  81439. if (have === 0) { break inf_leave; }
  81440. have--;
  81441. hold += input[next++] << bits;
  81442. bits += 8;
  81443. //---//
  81444. }
  81445. //--- DROPBITS(last.bits) ---//
  81446. hold >>>= last_bits;
  81447. bits -= last_bits;
  81448. //---//
  81449. state.back += last_bits;
  81450. }
  81451. //--- DROPBITS(here.bits) ---//
  81452. hold >>>= here_bits;
  81453. bits -= here_bits;
  81454. //---//
  81455. state.back += here_bits;
  81456. if (here_op & 64) {
  81457. strm.msg = 'invalid distance code';
  81458. state.mode = BAD;
  81459. break;
  81460. }
  81461. state.offset = here_val;
  81462. state.extra = (here_op) & 15;
  81463. state.mode = DISTEXT;
  81464. /* falls through */
  81465. case DISTEXT:
  81466. if (state.extra) {
  81467. //=== NEEDBITS(state.extra);
  81468. n = state.extra;
  81469. while (bits < n) {
  81470. if (have === 0) { break inf_leave; }
  81471. have--;
  81472. hold += input[next++] << bits;
  81473. bits += 8;
  81474. }
  81475. //===//
  81476. state.offset += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
  81477. //--- DROPBITS(state.extra) ---//
  81478. hold >>>= state.extra;
  81479. bits -= state.extra;
  81480. //---//
  81481. state.back += state.extra;
  81482. }
  81483. //#ifdef INFLATE_STRICT
  81484. if (state.offset > state.dmax) {
  81485. strm.msg = 'invalid distance too far back';
  81486. state.mode = BAD;
  81487. break;
  81488. }
  81489. //#endif
  81490. //Tracevv((stderr, "inflate: distance %u\n", state.offset));
  81491. state.mode = MATCH;
  81492. /* falls through */
  81493. case MATCH:
  81494. if (left === 0) { break inf_leave; }
  81495. copy = _out - left;
  81496. if (state.offset > copy) { /* copy from window */
  81497. copy = state.offset - copy;
  81498. if (copy > state.whave) {
  81499. if (state.sane) {
  81500. strm.msg = 'invalid distance too far back';
  81501. state.mode = BAD;
  81502. break;
  81503. }
  81504. // (!) This block is disabled in zlib defailts,
  81505. // don't enable it for binary compatibility
  81506. //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  81507. // Trace((stderr, "inflate.c too far\n"));
  81508. // copy -= state.whave;
  81509. // if (copy > state.length) { copy = state.length; }
  81510. // if (copy > left) { copy = left; }
  81511. // left -= copy;
  81512. // state.length -= copy;
  81513. // do {
  81514. // output[put++] = 0;
  81515. // } while (--copy);
  81516. // if (state.length === 0) { state.mode = LEN; }
  81517. // break;
  81518. //#endif
  81519. }
  81520. if (copy > state.wnext) {
  81521. copy -= state.wnext;
  81522. from = state.wsize - copy;
  81523. }
  81524. else {
  81525. from = state.wnext - copy;
  81526. }
  81527. if (copy > state.length) { copy = state.length; }
  81528. from_source = state.window;
  81529. }
  81530. else { /* copy from output */
  81531. from_source = output;
  81532. from = put - state.offset;
  81533. copy = state.length;
  81534. }
  81535. if (copy > left) { copy = left; }
  81536. left -= copy;
  81537. state.length -= copy;
  81538. do {
  81539. output[put++] = from_source[from++];
  81540. } while (--copy);
  81541. if (state.length === 0) { state.mode = LEN; }
  81542. break;
  81543. case LIT:
  81544. if (left === 0) { break inf_leave; }
  81545. output[put++] = state.length;
  81546. left--;
  81547. state.mode = LEN;
  81548. break;
  81549. case CHECK:
  81550. if (state.wrap) {
  81551. //=== NEEDBITS(32);
  81552. while (bits < 32) {
  81553. if (have === 0) { break inf_leave; }
  81554. have--;
  81555. // Use '|' insdead of '+' to make sure that result is signed
  81556. hold |= input[next++] << bits;
  81557. bits += 8;
  81558. }
  81559. //===//
  81560. _out -= left;
  81561. strm.total_out += _out;
  81562. state.total += _out;
  81563. if (_out) {
  81564. strm.adler = state.check =
  81565. /*UPDATE(state.check, put - _out, _out);*/
  81566. (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
  81567. }
  81568. _out = left;
  81569. // NB: crc32 stored as signed 32-bit int, ZSWAP32 returns signed too
  81570. if ((state.flags ? hold : ZSWAP32(hold)) !== state.check) {
  81571. strm.msg = 'incorrect data check';
  81572. state.mode = BAD;
  81573. break;
  81574. }
  81575. //=== INITBITS();
  81576. hold = 0;
  81577. bits = 0;
  81578. //===//
  81579. //Tracev((stderr, "inflate: check matches trailer\n"));
  81580. }
  81581. state.mode = LENGTH;
  81582. /* falls through */
  81583. case LENGTH:
  81584. if (state.wrap && state.flags) {
  81585. //=== NEEDBITS(32);
  81586. while (bits < 32) {
  81587. if (have === 0) { break inf_leave; }
  81588. have--;
  81589. hold += input[next++] << bits;
  81590. bits += 8;
  81591. }
  81592. //===//
  81593. if (hold !== (state.total & 0xffffffff)) {
  81594. strm.msg = 'incorrect length check';
  81595. state.mode = BAD;
  81596. break;
  81597. }
  81598. //=== INITBITS();
  81599. hold = 0;
  81600. bits = 0;
  81601. //===//
  81602. //Tracev((stderr, "inflate: length matches trailer\n"));
  81603. }
  81604. state.mode = DONE;
  81605. /* falls through */
  81606. case DONE:
  81607. ret = Z_STREAM_END;
  81608. break inf_leave;
  81609. case BAD:
  81610. ret = Z_DATA_ERROR;
  81611. break inf_leave;
  81612. case MEM:
  81613. return Z_MEM_ERROR;
  81614. case SYNC:
  81615. /* falls through */
  81616. default:
  81617. return Z_STREAM_ERROR;
  81618. }
  81619. }
  81620. // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
  81621. /*
  81622. Return from inflate(), updating the total counts and the check value.
  81623. If there was no progress during the inflate() call, return a buffer
  81624. error. Call updatewindow() to create and/or update the window state.
  81625. Note: a memory error from inflate() is non-recoverable.
  81626. */
  81627. //--- RESTORE() ---
  81628. strm.next_out = put;
  81629. strm.avail_out = left;
  81630. strm.next_in = next;
  81631. strm.avail_in = have;
  81632. state.hold = hold;
  81633. state.bits = bits;
  81634. //---
  81635. if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
  81636. (state.mode < CHECK || flush !== Z_FINISH))) {
  81637. if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
  81638. state.mode = MEM;
  81639. return Z_MEM_ERROR;
  81640. }
  81641. }
  81642. _in -= strm.avail_in;
  81643. _out -= strm.avail_out;
  81644. strm.total_in += _in;
  81645. strm.total_out += _out;
  81646. state.total += _out;
  81647. if (state.wrap && _out) {
  81648. strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
  81649. (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
  81650. }
  81651. strm.data_type = state.bits + (state.last ? 64 : 0) +
  81652. (state.mode === TYPE ? 128 : 0) +
  81653. (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
  81654. if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
  81655. ret = Z_BUF_ERROR;
  81656. }
  81657. return ret;
  81658. }
  81659. function inflateEnd(strm) {
  81660. if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
  81661. return Z_STREAM_ERROR;
  81662. }
  81663. var state = strm.state;
  81664. if (state.window) {
  81665. state.window = null;
  81666. }
  81667. strm.state = null;
  81668. return Z_OK;
  81669. }
  81670. function inflateGetHeader(strm, head) {
  81671. var state;
  81672. /* check state */
  81673. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  81674. state = strm.state;
  81675. if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
  81676. /* save header structure */
  81677. state.head = head;
  81678. head.done = false;
  81679. return Z_OK;
  81680. }
  81681. exports.inflateReset = inflateReset;
  81682. exports.inflateReset2 = inflateReset2;
  81683. exports.inflateResetKeep = inflateResetKeep;
  81684. exports.inflateInit = inflateInit;
  81685. exports.inflateInit2 = inflateInit2;
  81686. exports.inflate = inflate;
  81687. exports.inflateEnd = inflateEnd;
  81688. exports.inflateGetHeader = inflateGetHeader;
  81689. exports.inflateInfo = 'pako inflate (from Nodeca project)';
  81690. /* Not implemented
  81691. exports.inflateCopy = inflateCopy;
  81692. exports.inflateGetDictionary = inflateGetDictionary;
  81693. exports.inflateMark = inflateMark;
  81694. exports.inflatePrime = inflatePrime;
  81695. exports.inflateSetDictionary = inflateSetDictionary;
  81696. exports.inflateSync = inflateSync;
  81697. exports.inflateSyncPoint = inflateSyncPoint;
  81698. exports.inflateUndermine = inflateUndermine;
  81699. */
  81700. },{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(_dereq_,module,exports){
  81701. 'use strict';
  81702. var utils = _dereq_('../utils/common');
  81703. var MAXBITS = 15;
  81704. var ENOUGH_LENS = 852;
  81705. var ENOUGH_DISTS = 592;
  81706. //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
  81707. var CODES = 0;
  81708. var LENS = 1;
  81709. var DISTS = 2;
  81710. var lbase = [ /* Length codes 257..285 base */
  81711. 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  81712. 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
  81713. ];
  81714. var lext = [ /* Length codes 257..285 extra */
  81715. 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
  81716. 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
  81717. ];
  81718. var dbase = [ /* Distance codes 0..29 base */
  81719. 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  81720. 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  81721. 8193, 12289, 16385, 24577, 0, 0
  81722. ];
  81723. var dext = [ /* Distance codes 0..29 extra */
  81724. 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
  81725. 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
  81726. 28, 28, 29, 29, 64, 64
  81727. ];
  81728. module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
  81729. {
  81730. var bits = opts.bits;
  81731. //here = opts.here; /* table entry for duplication */
  81732. var len = 0; /* a code's length in bits */
  81733. var sym = 0; /* index of code symbols */
  81734. var min = 0, max = 0; /* minimum and maximum code lengths */
  81735. var root = 0; /* number of index bits for root table */
  81736. var curr = 0; /* number of index bits for current table */
  81737. var drop = 0; /* code bits to drop for sub-table */
  81738. var left = 0; /* number of prefix codes available */
  81739. var used = 0; /* code entries in table used */
  81740. var huff = 0; /* Huffman code */
  81741. var incr; /* for incrementing code, index */
  81742. var fill; /* index for replicating entries */
  81743. var low; /* low bits for current root entry */
  81744. var mask; /* mask for low root bits */
  81745. var next; /* next available space in table */
  81746. var base = null; /* base value table to use */
  81747. var base_index = 0;
  81748. // var shoextra; /* extra bits table to use */
  81749. var end; /* use base and extra for symbol > end */
  81750. var count = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* number of codes of each length */
  81751. var offs = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* offsets in table for each length */
  81752. var extra = null;
  81753. var extra_index = 0;
  81754. var here_bits, here_op, here_val;
  81755. /*
  81756. Process a set of code lengths to create a canonical Huffman code. The
  81757. code lengths are lens[0..codes-1]. Each length corresponds to the
  81758. symbols 0..codes-1. The Huffman code is generated by first sorting the
  81759. symbols by length from short to long, and retaining the symbol order
  81760. for codes with equal lengths. Then the code starts with all zero bits
  81761. for the first code of the shortest length, and the codes are integer
  81762. increments for the same length, and zeros are appended as the length
  81763. increases. For the deflate format, these bits are stored backwards
  81764. from their more natural integer increment ordering, and so when the
  81765. decoding tables are built in the large loop below, the integer codes
  81766. are incremented backwards.
  81767. This routine assumes, but does not check, that all of the entries in
  81768. lens[] are in the range 0..MAXBITS. The caller must assure this.
  81769. 1..MAXBITS is interpreted as that code length. zero means that that
  81770. symbol does not occur in this code.
  81771. The codes are sorted by computing a count of codes for each length,
  81772. creating from that a table of starting indices for each length in the
  81773. sorted table, and then entering the symbols in order in the sorted
  81774. table. The sorted table is work[], with that space being provided by
  81775. the caller.
  81776. The length counts are used for other purposes as well, i.e. finding
  81777. the minimum and maximum length codes, determining if there are any
  81778. codes at all, checking for a valid set of lengths, and looking ahead
  81779. at length counts to determine sub-table sizes when building the
  81780. decoding tables.
  81781. */
  81782. /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  81783. for (len = 0; len <= MAXBITS; len++) {
  81784. count[len] = 0;
  81785. }
  81786. for (sym = 0; sym < codes; sym++) {
  81787. count[lens[lens_index + sym]]++;
  81788. }
  81789. /* bound code lengths, force root to be within code lengths */
  81790. root = bits;
  81791. for (max = MAXBITS; max >= 1; max--) {
  81792. if (count[max] !== 0) { break; }
  81793. }
  81794. if (root > max) {
  81795. root = max;
  81796. }
  81797. if (max === 0) { /* no symbols to code at all */
  81798. //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
  81799. //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
  81800. //table.val[opts.table_index++] = 0; //here.val = (var short)0;
  81801. table[table_index++] = (1 << 24) | (64 << 16) | 0;
  81802. //table.op[opts.table_index] = 64;
  81803. //table.bits[opts.table_index] = 1;
  81804. //table.val[opts.table_index++] = 0;
  81805. table[table_index++] = (1 << 24) | (64 << 16) | 0;
  81806. opts.bits = 1;
  81807. return 0; /* no symbols, but wait for decoding to report error */
  81808. }
  81809. for (min = 1; min < max; min++) {
  81810. if (count[min] !== 0) { break; }
  81811. }
  81812. if (root < min) {
  81813. root = min;
  81814. }
  81815. /* check for an over-subscribed or incomplete set of lengths */
  81816. left = 1;
  81817. for (len = 1; len <= MAXBITS; len++) {
  81818. left <<= 1;
  81819. left -= count[len];
  81820. if (left < 0) {
  81821. return -1;
  81822. } /* over-subscribed */
  81823. }
  81824. if (left > 0 && (type === CODES || max !== 1)) {
  81825. return -1; /* incomplete set */
  81826. }
  81827. /* generate offsets into symbol table for each length for sorting */
  81828. offs[1] = 0;
  81829. for (len = 1; len < MAXBITS; len++) {
  81830. offs[len + 1] = offs[len] + count[len];
  81831. }
  81832. /* sort symbols by length, by symbol order within each length */
  81833. for (sym = 0; sym < codes; sym++) {
  81834. if (lens[lens_index + sym] !== 0) {
  81835. work[offs[lens[lens_index + sym]]++] = sym;
  81836. }
  81837. }
  81838. /*
  81839. Create and fill in decoding tables. In this loop, the table being
  81840. filled is at next and has curr index bits. The code being used is huff
  81841. with length len. That code is converted to an index by dropping drop
  81842. bits off of the bottom. For codes where len is less than drop + curr,
  81843. those top drop + curr - len bits are incremented through all values to
  81844. fill the table with replicated entries.
  81845. root is the number of index bits for the root table. When len exceeds
  81846. root, sub-tables are created pointed to by the root entry with an index
  81847. of the low root bits of huff. This is saved in low to check for when a
  81848. new sub-table should be started. drop is zero when the root table is
  81849. being filled, and drop is root when sub-tables are being filled.
  81850. When a new sub-table is needed, it is necessary to look ahead in the
  81851. code lengths to determine what size sub-table is needed. The length
  81852. counts are used for this, and so count[] is decremented as codes are
  81853. entered in the tables.
  81854. used keeps track of how many table entries have been allocated from the
  81855. provided *table space. It is checked for LENS and DIST tables against
  81856. the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
  81857. the initial root table size constants. See the comments in inftrees.h
  81858. for more information.
  81859. sym increments through all symbols, and the loop terminates when
  81860. all codes of length max, i.e. all codes, have been processed. This
  81861. routine permits incomplete codes, so another loop after this one fills
  81862. in the rest of the decoding tables with invalid code markers.
  81863. */
  81864. /* set up for code type */
  81865. // poor man optimization - use if-else instead of switch,
  81866. // to avoid deopts in old v8
  81867. if (type === CODES) {
  81868. base = extra = work; /* dummy value--not used */
  81869. end = 19;
  81870. } else if (type === LENS) {
  81871. base = lbase;
  81872. base_index -= 257;
  81873. extra = lext;
  81874. extra_index -= 257;
  81875. end = 256;
  81876. } else { /* DISTS */
  81877. base = dbase;
  81878. extra = dext;
  81879. end = -1;
  81880. }
  81881. /* initialize opts for loop */
  81882. huff = 0; /* starting code */
  81883. sym = 0; /* starting code symbol */
  81884. len = min; /* starting code length */
  81885. next = table_index; /* current table to fill in */
  81886. curr = root; /* current table index bits */
  81887. drop = 0; /* current bits to drop from code for index */
  81888. low = -1; /* trigger new sub-table when len > root */
  81889. used = 1 << root; /* use root table entries */
  81890. mask = used - 1; /* mask for comparing low */
  81891. /* check available table space */
  81892. if ((type === LENS && used > ENOUGH_LENS) ||
  81893. (type === DISTS && used > ENOUGH_DISTS)) {
  81894. return 1;
  81895. }
  81896. var i=0;
  81897. /* process all codes and make table entries */
  81898. for (;;) {
  81899. i++;
  81900. /* create table entry */
  81901. here_bits = len - drop;
  81902. if (work[sym] < end) {
  81903. here_op = 0;
  81904. here_val = work[sym];
  81905. }
  81906. else if (work[sym] > end) {
  81907. here_op = extra[extra_index + work[sym]];
  81908. here_val = base[base_index + work[sym]];
  81909. }
  81910. else {
  81911. here_op = 32 + 64; /* end of block */
  81912. here_val = 0;
  81913. }
  81914. /* replicate for those indices with low len bits equal to huff */
  81915. incr = 1 << (len - drop);
  81916. fill = 1 << curr;
  81917. min = fill; /* save offset to next table */
  81918. do {
  81919. fill -= incr;
  81920. table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
  81921. } while (fill !== 0);
  81922. /* backwards increment the len-bit code huff */
  81923. incr = 1 << (len - 1);
  81924. while (huff & incr) {
  81925. incr >>= 1;
  81926. }
  81927. if (incr !== 0) {
  81928. huff &= incr - 1;
  81929. huff += incr;
  81930. } else {
  81931. huff = 0;
  81932. }
  81933. /* go to next symbol, update count, len */
  81934. sym++;
  81935. if (--count[len] === 0) {
  81936. if (len === max) { break; }
  81937. len = lens[lens_index + work[sym]];
  81938. }
  81939. /* create new sub-table if needed */
  81940. if (len > root && (huff & mask) !== low) {
  81941. /* if first time, transition to sub-tables */
  81942. if (drop === 0) {
  81943. drop = root;
  81944. }
  81945. /* increment past last table */
  81946. next += min; /* here min is 1 << curr */
  81947. /* determine length of next table */
  81948. curr = len - drop;
  81949. left = 1 << curr;
  81950. while (curr + drop < max) {
  81951. left -= count[curr + drop];
  81952. if (left <= 0) { break; }
  81953. curr++;
  81954. left <<= 1;
  81955. }
  81956. /* check for enough space */
  81957. used += 1 << curr;
  81958. if ((type === LENS && used > ENOUGH_LENS) ||
  81959. (type === DISTS && used > ENOUGH_DISTS)) {
  81960. return 1;
  81961. }
  81962. /* point entry in root table to sub-table */
  81963. low = huff & mask;
  81964. /*table.op[low] = curr;
  81965. table.bits[low] = root;
  81966. table.val[low] = next - opts.table_index;*/
  81967. table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
  81968. }
  81969. }
  81970. /* fill in remaining table entry if code is incomplete (guaranteed to have
  81971. at most one remaining entry, since if the code is incomplete, the
  81972. maximum code length that was allowed to get this far is one bit) */
  81973. if (huff !== 0) {
  81974. //table.op[next + huff] = 64; /* invalid code marker */
  81975. //table.bits[next + huff] = len - drop;
  81976. //table.val[next + huff] = 0;
  81977. table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
  81978. }
  81979. /* set return parameters */
  81980. //opts.table_index += used;
  81981. opts.bits = root;
  81982. return 0;
  81983. };
  81984. },{"../utils/common":27}],37:[function(_dereq_,module,exports){
  81985. 'use strict';
  81986. module.exports = {
  81987. '2': 'need dictionary', /* Z_NEED_DICT 2 */
  81988. '1': 'stream end', /* Z_STREAM_END 1 */
  81989. '0': '', /* Z_OK 0 */
  81990. '-1': 'file error', /* Z_ERRNO (-1) */
  81991. '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
  81992. '-3': 'data error', /* Z_DATA_ERROR (-3) */
  81993. '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
  81994. '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
  81995. '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
  81996. };
  81997. },{}],38:[function(_dereq_,module,exports){
  81998. 'use strict';
  81999. var utils = _dereq_('../utils/common');
  82000. /* Public constants ==========================================================*/
  82001. /* ===========================================================================*/
  82002. //var Z_FILTERED = 1;
  82003. //var Z_HUFFMAN_ONLY = 2;
  82004. //var Z_RLE = 3;
  82005. var Z_FIXED = 4;
  82006. //var Z_DEFAULT_STRATEGY = 0;
  82007. /* Possible values of the data_type field (though see inflate()) */
  82008. var Z_BINARY = 0;
  82009. var Z_TEXT = 1;
  82010. //var Z_ASCII = 1; // = Z_TEXT
  82011. var Z_UNKNOWN = 2;
  82012. /*============================================================================*/
  82013. function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
  82014. // From zutil.h
  82015. var STORED_BLOCK = 0;
  82016. var STATIC_TREES = 1;
  82017. var DYN_TREES = 2;
  82018. /* The three kinds of block type */
  82019. var MIN_MATCH = 3;
  82020. var MAX_MATCH = 258;
  82021. /* The minimum and maximum match lengths */
  82022. // From deflate.h
  82023. /* ===========================================================================
  82024. * Internal compression state.
  82025. */
  82026. var LENGTH_CODES = 29;
  82027. /* number of length codes, not counting the special END_BLOCK code */
  82028. var LITERALS = 256;
  82029. /* number of literal bytes 0..255 */
  82030. var L_CODES = LITERALS + 1 + LENGTH_CODES;
  82031. /* number of Literal or Length codes, including the END_BLOCK code */
  82032. var D_CODES = 30;
  82033. /* number of distance codes */
  82034. var BL_CODES = 19;
  82035. /* number of codes used to transfer the bit lengths */
  82036. var HEAP_SIZE = 2*L_CODES + 1;
  82037. /* maximum heap size */
  82038. var MAX_BITS = 15;
  82039. /* All codes must not exceed MAX_BITS bits */
  82040. var Buf_size = 16;
  82041. /* size of bit buffer in bi_buf */
  82042. /* ===========================================================================
  82043. * Constants
  82044. */
  82045. var MAX_BL_BITS = 7;
  82046. /* Bit length codes must not exceed MAX_BL_BITS bits */
  82047. var END_BLOCK = 256;
  82048. /* end of block literal code */
  82049. var REP_3_6 = 16;
  82050. /* repeat previous bit length 3-6 times (2 bits of repeat count) */
  82051. var REPZ_3_10 = 17;
  82052. /* repeat a zero length 3-10 times (3 bits of repeat count) */
  82053. var REPZ_11_138 = 18;
  82054. /* repeat a zero length 11-138 times (7 bits of repeat count) */
  82055. var extra_lbits = /* extra bits for each length code */
  82056. [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
  82057. var extra_dbits = /* extra bits for each distance code */
  82058. [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
  82059. var extra_blbits = /* extra bits for each bit length code */
  82060. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
  82061. var bl_order =
  82062. [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
  82063. /* The lengths of the bit length codes are sent in order of decreasing
  82064. * probability, to avoid transmitting the lengths for unused bit length codes.
  82065. */
  82066. /* ===========================================================================
  82067. * Local data. These are initialized only once.
  82068. */
  82069. // We pre-fill arrays with 0 to avoid uninitialized gaps
  82070. var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
  82071. // !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
  82072. var static_ltree = new Array((L_CODES+2) * 2);
  82073. zero(static_ltree);
  82074. /* The static literal tree. Since the bit lengths are imposed, there is no
  82075. * need for the L_CODES extra codes used during heap construction. However
  82076. * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
  82077. * below).
  82078. */
  82079. var static_dtree = new Array(D_CODES * 2);
  82080. zero(static_dtree);
  82081. /* The static distance tree. (Actually a trivial tree since all codes use
  82082. * 5 bits.)
  82083. */
  82084. var _dist_code = new Array(DIST_CODE_LEN);
  82085. zero(_dist_code);
  82086. /* Distance codes. The first 256 values correspond to the distances
  82087. * 3 .. 258, the last 256 values correspond to the top 8 bits of
  82088. * the 15 bit distances.
  82089. */
  82090. var _length_code = new Array(MAX_MATCH-MIN_MATCH+1);
  82091. zero(_length_code);
  82092. /* length code for each normalized match length (0 == MIN_MATCH) */
  82093. var base_length = new Array(LENGTH_CODES);
  82094. zero(base_length);
  82095. /* First normalized length for each code (0 = MIN_MATCH) */
  82096. var base_dist = new Array(D_CODES);
  82097. zero(base_dist);
  82098. /* First normalized distance for each code (0 = distance of 1) */
  82099. var StaticTreeDesc = function (static_tree, extra_bits, extra_base, elems, max_length) {
  82100. this.static_tree = static_tree; /* static tree or NULL */
  82101. this.extra_bits = extra_bits; /* extra bits for each code or NULL */
  82102. this.extra_base = extra_base; /* base index for extra_bits */
  82103. this.elems = elems; /* max number of elements in the tree */
  82104. this.max_length = max_length; /* max bit length for the codes */
  82105. // show if `static_tree` has data or dummy - needed for monomorphic objects
  82106. this.has_stree = static_tree && static_tree.length;
  82107. };
  82108. var static_l_desc;
  82109. var static_d_desc;
  82110. var static_bl_desc;
  82111. var TreeDesc = function(dyn_tree, stat_desc) {
  82112. this.dyn_tree = dyn_tree; /* the dynamic tree */
  82113. this.max_code = 0; /* largest code with non zero frequency */
  82114. this.stat_desc = stat_desc; /* the corresponding static tree */
  82115. };
  82116. function d_code(dist) {
  82117. return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
  82118. }
  82119. /* ===========================================================================
  82120. * Output a short LSB first on the stream.
  82121. * IN assertion: there is enough room in pendingBuf.
  82122. */
  82123. function put_short (s, w) {
  82124. // put_byte(s, (uch)((w) & 0xff));
  82125. // put_byte(s, (uch)((ush)(w) >> 8));
  82126. s.pending_buf[s.pending++] = (w) & 0xff;
  82127. s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
  82128. }
  82129. /* ===========================================================================
  82130. * Send a value on a given number of bits.
  82131. * IN assertion: length <= 16 and value fits in length bits.
  82132. */
  82133. function send_bits(s, value, length) {
  82134. if (s.bi_valid > (Buf_size - length)) {
  82135. s.bi_buf |= (value << s.bi_valid) & 0xffff;
  82136. put_short(s, s.bi_buf);
  82137. s.bi_buf = value >> (Buf_size - s.bi_valid);
  82138. s.bi_valid += length - Buf_size;
  82139. } else {
  82140. s.bi_buf |= (value << s.bi_valid) & 0xffff;
  82141. s.bi_valid += length;
  82142. }
  82143. }
  82144. function send_code(s, c, tree) {
  82145. send_bits(s, tree[c*2]/*.Code*/, tree[c*2 + 1]/*.Len*/);
  82146. }
  82147. /* ===========================================================================
  82148. * Reverse the first len bits of a code, using straightforward code (a faster
  82149. * method would use a table)
  82150. * IN assertion: 1 <= len <= 15
  82151. */
  82152. function bi_reverse(code, len) {
  82153. var res = 0;
  82154. do {
  82155. res |= code & 1;
  82156. code >>>= 1;
  82157. res <<= 1;
  82158. } while (--len > 0);
  82159. return res >>> 1;
  82160. }
  82161. /* ===========================================================================
  82162. * Flush the bit buffer, keeping at most 7 bits in it.
  82163. */
  82164. function bi_flush(s) {
  82165. if (s.bi_valid === 16) {
  82166. put_short(s, s.bi_buf);
  82167. s.bi_buf = 0;
  82168. s.bi_valid = 0;
  82169. } else if (s.bi_valid >= 8) {
  82170. s.pending_buf[s.pending++] = s.bi_buf & 0xff;
  82171. s.bi_buf >>= 8;
  82172. s.bi_valid -= 8;
  82173. }
  82174. }
  82175. /* ===========================================================================
  82176. * Compute the optimal bit lengths for a tree and update the total bit length
  82177. * for the current block.
  82178. * IN assertion: the fields freq and dad are set, heap[heap_max] and
  82179. * above are the tree nodes sorted by increasing frequency.
  82180. * OUT assertions: the field len is set to the optimal bit length, the
  82181. * array bl_count contains the frequencies for each bit length.
  82182. * The length opt_len is updated; static_len is also updated if stree is
  82183. * not null.
  82184. */
  82185. function gen_bitlen(s, desc)
  82186. // deflate_state *s;
  82187. // tree_desc *desc; /* the tree descriptor */
  82188. {
  82189. var tree = desc.dyn_tree;
  82190. var max_code = desc.max_code;
  82191. var stree = desc.stat_desc.static_tree;
  82192. var has_stree = desc.stat_desc.has_stree;
  82193. var extra = desc.stat_desc.extra_bits;
  82194. var base = desc.stat_desc.extra_base;
  82195. var max_length = desc.stat_desc.max_length;
  82196. var h; /* heap index */
  82197. var n, m; /* iterate over the tree elements */
  82198. var bits; /* bit length */
  82199. var xbits; /* extra bits */
  82200. var f; /* frequency */
  82201. var overflow = 0; /* number of elements with bit length too large */
  82202. for (bits = 0; bits <= MAX_BITS; bits++) {
  82203. s.bl_count[bits] = 0;
  82204. }
  82205. /* In a first pass, compute the optimal bit lengths (which may
  82206. * overflow in the case of the bit length tree).
  82207. */
  82208. tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */
  82209. for (h = s.heap_max+1; h < HEAP_SIZE; h++) {
  82210. n = s.heap[h];
  82211. bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
  82212. if (bits > max_length) {
  82213. bits = max_length;
  82214. overflow++;
  82215. }
  82216. tree[n*2 + 1]/*.Len*/ = bits;
  82217. /* We overwrite tree[n].Dad which is no longer needed */
  82218. if (n > max_code) { continue; } /* not a leaf node */
  82219. s.bl_count[bits]++;
  82220. xbits = 0;
  82221. if (n >= base) {
  82222. xbits = extra[n-base];
  82223. }
  82224. f = tree[n * 2]/*.Freq*/;
  82225. s.opt_len += f * (bits + xbits);
  82226. if (has_stree) {
  82227. s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits);
  82228. }
  82229. }
  82230. if (overflow === 0) { return; }
  82231. // Trace((stderr,"\nbit length overflow\n"));
  82232. /* This happens for example on obj2 and pic of the Calgary corpus */
  82233. /* Find the first bit length which could increase: */
  82234. do {
  82235. bits = max_length-1;
  82236. while (s.bl_count[bits] === 0) { bits--; }
  82237. s.bl_count[bits]--; /* move one leaf down the tree */
  82238. s.bl_count[bits+1] += 2; /* move one overflow item as its brother */
  82239. s.bl_count[max_length]--;
  82240. /* The brother of the overflow item also moves one step up,
  82241. * but this does not affect bl_count[max_length]
  82242. */
  82243. overflow -= 2;
  82244. } while (overflow > 0);
  82245. /* Now recompute all bit lengths, scanning in increasing frequency.
  82246. * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
  82247. * lengths instead of fixing only the wrong ones. This idea is taken
  82248. * from 'ar' written by Haruhiko Okumura.)
  82249. */
  82250. for (bits = max_length; bits !== 0; bits--) {
  82251. n = s.bl_count[bits];
  82252. while (n !== 0) {
  82253. m = s.heap[--h];
  82254. if (m > max_code) { continue; }
  82255. if (tree[m*2 + 1]/*.Len*/ !== bits) {
  82256. // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  82257. s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/;
  82258. tree[m*2 + 1]/*.Len*/ = bits;
  82259. }
  82260. n--;
  82261. }
  82262. }
  82263. }
  82264. /* ===========================================================================
  82265. * Generate the codes for a given tree and bit counts (which need not be
  82266. * optimal).
  82267. * IN assertion: the array bl_count contains the bit length statistics for
  82268. * the given tree and the field len is set for all tree elements.
  82269. * OUT assertion: the field code is set for all tree elements of non
  82270. * zero code length.
  82271. */
  82272. function gen_codes(tree, max_code, bl_count)
  82273. // ct_data *tree; /* the tree to decorate */
  82274. // int max_code; /* largest code with non zero frequency */
  82275. // ushf *bl_count; /* number of codes at each bit length */
  82276. {
  82277. var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */
  82278. var code = 0; /* running code value */
  82279. var bits; /* bit index */
  82280. var n; /* code index */
  82281. /* The distribution counts are first used to generate the code values
  82282. * without bit reversal.
  82283. */
  82284. for (bits = 1; bits <= MAX_BITS; bits++) {
  82285. next_code[bits] = code = (code + bl_count[bits-1]) << 1;
  82286. }
  82287. /* Check that the bit counts in bl_count are consistent. The last code
  82288. * must be all ones.
  82289. */
  82290. //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
  82291. // "inconsistent bit counts");
  82292. //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  82293. for (n = 0; n <= max_code; n++) {
  82294. var len = tree[n*2 + 1]/*.Len*/;
  82295. if (len === 0) { continue; }
  82296. /* Now reverse the bits */
  82297. tree[n*2]/*.Code*/ = bi_reverse(next_code[len]++, len);
  82298. //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  82299. // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
  82300. }
  82301. }
  82302. /* ===========================================================================
  82303. * Initialize the various 'constant' tables.
  82304. */
  82305. function tr_static_init() {
  82306. var n; /* iterates over tree elements */
  82307. var bits; /* bit counter */
  82308. var length; /* length value */
  82309. var code; /* code value */
  82310. var dist; /* distance index */
  82311. var bl_count = new Array(MAX_BITS+1);
  82312. /* number of codes at each bit length for an optimal tree */
  82313. // do check in _tr_init()
  82314. //if (static_init_done) return;
  82315. /* For some embedded targets, global variables are not initialized: */
  82316. /*#ifdef NO_INIT_GLOBAL_POINTERS
  82317. static_l_desc.static_tree = static_ltree;
  82318. static_l_desc.extra_bits = extra_lbits;
  82319. static_d_desc.static_tree = static_dtree;
  82320. static_d_desc.extra_bits = extra_dbits;
  82321. static_bl_desc.extra_bits = extra_blbits;
  82322. #endif*/
  82323. /* Initialize the mapping length (0..255) -> length code (0..28) */
  82324. length = 0;
  82325. for (code = 0; code < LENGTH_CODES-1; code++) {
  82326. base_length[code] = length;
  82327. for (n = 0; n < (1<<extra_lbits[code]); n++) {
  82328. _length_code[length++] = code;
  82329. }
  82330. }
  82331. //Assert (length == 256, "tr_static_init: length != 256");
  82332. /* Note that the length 255 (match length 258) can be represented
  82333. * in two different ways: code 284 + 5 bits or code 285, so we
  82334. * overwrite length_code[255] to use the best encoding:
  82335. */
  82336. _length_code[length-1] = code;
  82337. /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  82338. dist = 0;
  82339. for (code = 0 ; code < 16; code++) {
  82340. base_dist[code] = dist;
  82341. for (n = 0; n < (1<<extra_dbits[code]); n++) {
  82342. _dist_code[dist++] = code;
  82343. }
  82344. }
  82345. //Assert (dist == 256, "tr_static_init: dist != 256");
  82346. dist >>= 7; /* from now on, all distances are divided by 128 */
  82347. for ( ; code < D_CODES; code++) {
  82348. base_dist[code] = dist << 7;
  82349. for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
  82350. _dist_code[256 + dist++] = code;
  82351. }
  82352. }
  82353. //Assert (dist == 256, "tr_static_init: 256+dist != 512");
  82354. /* Construct the codes of the static literal tree */
  82355. for (bits = 0; bits <= MAX_BITS; bits++) {
  82356. bl_count[bits] = 0;
  82357. }
  82358. n = 0;
  82359. while (n <= 143) {
  82360. static_ltree[n*2 + 1]/*.Len*/ = 8;
  82361. n++;
  82362. bl_count[8]++;
  82363. }
  82364. while (n <= 255) {
  82365. static_ltree[n*2 + 1]/*.Len*/ = 9;
  82366. n++;
  82367. bl_count[9]++;
  82368. }
  82369. while (n <= 279) {
  82370. static_ltree[n*2 + 1]/*.Len*/ = 7;
  82371. n++;
  82372. bl_count[7]++;
  82373. }
  82374. while (n <= 287) {
  82375. static_ltree[n*2 + 1]/*.Len*/ = 8;
  82376. n++;
  82377. bl_count[8]++;
  82378. }
  82379. /* Codes 286 and 287 do not exist, but we must include them in the
  82380. * tree construction to get a canonical Huffman tree (longest code
  82381. * all ones)
  82382. */
  82383. gen_codes(static_ltree, L_CODES+1, bl_count);
  82384. /* The static distance tree is trivial: */
  82385. for (n = 0; n < D_CODES; n++) {
  82386. static_dtree[n*2 + 1]/*.Len*/ = 5;
  82387. static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);
  82388. }
  82389. // Now data ready and we can init static trees
  82390. static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);
  82391. static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
  82392. static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
  82393. //static_init_done = true;
  82394. }
  82395. /* ===========================================================================
  82396. * Initialize a new block.
  82397. */
  82398. function init_block(s) {
  82399. var n; /* iterates over tree elements */
  82400. /* Initialize the trees. */
  82401. for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }
  82402. for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }
  82403. for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }
  82404. s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;
  82405. s.opt_len = s.static_len = 0;
  82406. s.last_lit = s.matches = 0;
  82407. }
  82408. /* ===========================================================================
  82409. * Flush the bit buffer and align the output on a byte boundary
  82410. */
  82411. function bi_windup(s)
  82412. {
  82413. if (s.bi_valid > 8) {
  82414. put_short(s, s.bi_buf);
  82415. } else if (s.bi_valid > 0) {
  82416. //put_byte(s, (Byte)s->bi_buf);
  82417. s.pending_buf[s.pending++] = s.bi_buf;
  82418. }
  82419. s.bi_buf = 0;
  82420. s.bi_valid = 0;
  82421. }
  82422. /* ===========================================================================
  82423. * Copy a stored block, storing first the length and its
  82424. * one's complement if requested.
  82425. */
  82426. function copy_block(s, buf, len, header)
  82427. //DeflateState *s;
  82428. //charf *buf; /* the input data */
  82429. //unsigned len; /* its length */
  82430. //int header; /* true if block header must be written */
  82431. {
  82432. bi_windup(s); /* align on byte boundary */
  82433. if (header) {
  82434. put_short(s, len);
  82435. put_short(s, ~len);
  82436. }
  82437. // while (len--) {
  82438. // put_byte(s, *buf++);
  82439. // }
  82440. utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
  82441. s.pending += len;
  82442. }
  82443. /* ===========================================================================
  82444. * Compares to subtrees, using the tree depth as tie breaker when
  82445. * the subtrees have equal frequency. This minimizes the worst case length.
  82446. */
  82447. function smaller(tree, n, m, depth) {
  82448. var _n2 = n*2;
  82449. var _m2 = m*2;
  82450. return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
  82451. (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
  82452. }
  82453. /* ===========================================================================
  82454. * Restore the heap property by moving down the tree starting at node k,
  82455. * exchanging a node with the smallest of its two sons if necessary, stopping
  82456. * when the heap property is re-established (each father smaller than its
  82457. * two sons).
  82458. */
  82459. function pqdownheap(s, tree, k)
  82460. // deflate_state *s;
  82461. // ct_data *tree; /* the tree to restore */
  82462. // int k; /* node to move down */
  82463. {
  82464. var v = s.heap[k];
  82465. var j = k << 1; /* left son of k */
  82466. while (j <= s.heap_len) {
  82467. /* Set j to the smallest of the two sons: */
  82468. if (j < s.heap_len &&
  82469. smaller(tree, s.heap[j+1], s.heap[j], s.depth)) {
  82470. j++;
  82471. }
  82472. /* Exit if v is smaller than both sons */
  82473. if (smaller(tree, v, s.heap[j], s.depth)) { break; }
  82474. /* Exchange v with the smallest son */
  82475. s.heap[k] = s.heap[j];
  82476. k = j;
  82477. /* And continue down the tree, setting j to the left son of k */
  82478. j <<= 1;
  82479. }
  82480. s.heap[k] = v;
  82481. }
  82482. // inlined manually
  82483. // var SMALLEST = 1;
  82484. /* ===========================================================================
  82485. * Send the block data compressed using the given Huffman trees
  82486. */
  82487. function compress_block(s, ltree, dtree)
  82488. // deflate_state *s;
  82489. // const ct_data *ltree; /* literal tree */
  82490. // const ct_data *dtree; /* distance tree */
  82491. {
  82492. var dist; /* distance of matched string */
  82493. var lc; /* match length or unmatched char (if dist == 0) */
  82494. var lx = 0; /* running index in l_buf */
  82495. var code; /* the code to send */
  82496. var extra; /* number of extra bits to send */
  82497. if (s.last_lit !== 0) {
  82498. do {
  82499. dist = (s.pending_buf[s.d_buf + lx*2] << 8) | (s.pending_buf[s.d_buf + lx*2 + 1]);
  82500. lc = s.pending_buf[s.l_buf + lx];
  82501. lx++;
  82502. if (dist === 0) {
  82503. send_code(s, lc, ltree); /* send a literal byte */
  82504. //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  82505. } else {
  82506. /* Here, lc is the match length - MIN_MATCH */
  82507. code = _length_code[lc];
  82508. send_code(s, code+LITERALS+1, ltree); /* send the length code */
  82509. extra = extra_lbits[code];
  82510. if (extra !== 0) {
  82511. lc -= base_length[code];
  82512. send_bits(s, lc, extra); /* send the extra length bits */
  82513. }
  82514. dist--; /* dist is now the match distance - 1 */
  82515. code = d_code(dist);
  82516. //Assert (code < D_CODES, "bad d_code");
  82517. send_code(s, code, dtree); /* send the distance code */
  82518. extra = extra_dbits[code];
  82519. if (extra !== 0) {
  82520. dist -= base_dist[code];
  82521. send_bits(s, dist, extra); /* send the extra distance bits */
  82522. }
  82523. } /* literal or match pair ? */
  82524. /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
  82525. //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
  82526. // "pendingBuf overflow");
  82527. } while (lx < s.last_lit);
  82528. }
  82529. send_code(s, END_BLOCK, ltree);
  82530. }
  82531. /* ===========================================================================
  82532. * Construct one Huffman tree and assigns the code bit strings and lengths.
  82533. * Update the total bit length for the current block.
  82534. * IN assertion: the field freq is set for all tree elements.
  82535. * OUT assertions: the fields len and code are set to the optimal bit length
  82536. * and corresponding code. The length opt_len is updated; static_len is
  82537. * also updated if stree is not null. The field max_code is set.
  82538. */
  82539. function build_tree(s, desc)
  82540. // deflate_state *s;
  82541. // tree_desc *desc; /* the tree descriptor */
  82542. {
  82543. var tree = desc.dyn_tree;
  82544. var stree = desc.stat_desc.static_tree;
  82545. var has_stree = desc.stat_desc.has_stree;
  82546. var elems = desc.stat_desc.elems;
  82547. var n, m; /* iterate over heap elements */
  82548. var max_code = -1; /* largest code with non zero frequency */
  82549. var node; /* new node being created */
  82550. /* Construct the initial heap, with least frequent element in
  82551. * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
  82552. * heap[0] is not used.
  82553. */
  82554. s.heap_len = 0;
  82555. s.heap_max = HEAP_SIZE;
  82556. for (n = 0; n < elems; n++) {
  82557. if (tree[n * 2]/*.Freq*/ !== 0) {
  82558. s.heap[++s.heap_len] = max_code = n;
  82559. s.depth[n] = 0;
  82560. } else {
  82561. tree[n*2 + 1]/*.Len*/ = 0;
  82562. }
  82563. }
  82564. /* The pkzip format requires that at least one distance code exists,
  82565. * and that at least one bit should be sent even if there is only one
  82566. * possible code. So to avoid special checks later on we force at least
  82567. * two codes of non zero frequency.
  82568. */
  82569. while (s.heap_len < 2) {
  82570. node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
  82571. tree[node * 2]/*.Freq*/ = 1;
  82572. s.depth[node] = 0;
  82573. s.opt_len--;
  82574. if (has_stree) {
  82575. s.static_len -= stree[node*2 + 1]/*.Len*/;
  82576. }
  82577. /* node is 0 or 1 so it does not have extra bits */
  82578. }
  82579. desc.max_code = max_code;
  82580. /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
  82581. * establish sub-heaps of increasing lengths:
  82582. */
  82583. for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
  82584. /* Construct the Huffman tree by repeatedly combining the least two
  82585. * frequent nodes.
  82586. */
  82587. node = elems; /* next internal node of the tree */
  82588. do {
  82589. //pqremove(s, tree, n); /* n = node of least frequency */
  82590. /*** pqremove ***/
  82591. n = s.heap[1/*SMALLEST*/];
  82592. s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
  82593. pqdownheap(s, tree, 1/*SMALLEST*/);
  82594. /***/
  82595. m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
  82596. s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
  82597. s.heap[--s.heap_max] = m;
  82598. /* Create a new node father of n and m */
  82599. tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
  82600. s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
  82601. tree[n*2 + 1]/*.Dad*/ = tree[m*2 + 1]/*.Dad*/ = node;
  82602. /* and insert the new node in the heap */
  82603. s.heap[1/*SMALLEST*/] = node++;
  82604. pqdownheap(s, tree, 1/*SMALLEST*/);
  82605. } while (s.heap_len >= 2);
  82606. s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
  82607. /* At this point, the fields freq and dad are set. We can now
  82608. * generate the bit lengths.
  82609. */
  82610. gen_bitlen(s, desc);
  82611. /* The field len is now set, we can generate the bit codes */
  82612. gen_codes(tree, max_code, s.bl_count);
  82613. }
  82614. /* ===========================================================================
  82615. * Scan a literal or distance tree to determine the frequencies of the codes
  82616. * in the bit length tree.
  82617. */
  82618. function scan_tree(s, tree, max_code)
  82619. // deflate_state *s;
  82620. // ct_data *tree; /* the tree to be scanned */
  82621. // int max_code; /* and its largest code of non zero frequency */
  82622. {
  82623. var n; /* iterates over all tree elements */
  82624. var prevlen = -1; /* last emitted length */
  82625. var curlen; /* length of current code */
  82626. var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
  82627. var count = 0; /* repeat count of the current code */
  82628. var max_count = 7; /* max repeat count */
  82629. var min_count = 4; /* min repeat count */
  82630. if (nextlen === 0) {
  82631. max_count = 138;
  82632. min_count = 3;
  82633. }
  82634. tree[(max_code+1)*2 + 1]/*.Len*/ = 0xffff; /* guard */
  82635. for (n = 0; n <= max_code; n++) {
  82636. curlen = nextlen;
  82637. nextlen = tree[(n+1)*2 + 1]/*.Len*/;
  82638. if (++count < max_count && curlen === nextlen) {
  82639. continue;
  82640. } else if (count < min_count) {
  82641. s.bl_tree[curlen * 2]/*.Freq*/ += count;
  82642. } else if (curlen !== 0) {
  82643. if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
  82644. s.bl_tree[REP_3_6*2]/*.Freq*/++;
  82645. } else if (count <= 10) {
  82646. s.bl_tree[REPZ_3_10*2]/*.Freq*/++;
  82647. } else {
  82648. s.bl_tree[REPZ_11_138*2]/*.Freq*/++;
  82649. }
  82650. count = 0;
  82651. prevlen = curlen;
  82652. if (nextlen === 0) {
  82653. max_count = 138;
  82654. min_count = 3;
  82655. } else if (curlen === nextlen) {
  82656. max_count = 6;
  82657. min_count = 3;
  82658. } else {
  82659. max_count = 7;
  82660. min_count = 4;
  82661. }
  82662. }
  82663. }
  82664. /* ===========================================================================
  82665. * Send a literal or distance tree in compressed form, using the codes in
  82666. * bl_tree.
  82667. */
  82668. function send_tree(s, tree, max_code)
  82669. // deflate_state *s;
  82670. // ct_data *tree; /* the tree to be scanned */
  82671. // int max_code; /* and its largest code of non zero frequency */
  82672. {
  82673. var n; /* iterates over all tree elements */
  82674. var prevlen = -1; /* last emitted length */
  82675. var curlen; /* length of current code */
  82676. var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
  82677. var count = 0; /* repeat count of the current code */
  82678. var max_count = 7; /* max repeat count */
  82679. var min_count = 4; /* min repeat count */
  82680. /* tree[max_code+1].Len = -1; */ /* guard already set */
  82681. if (nextlen === 0) {
  82682. max_count = 138;
  82683. min_count = 3;
  82684. }
  82685. for (n = 0; n <= max_code; n++) {
  82686. curlen = nextlen;
  82687. nextlen = tree[(n+1)*2 + 1]/*.Len*/;
  82688. if (++count < max_count && curlen === nextlen) {
  82689. continue;
  82690. } else if (count < min_count) {
  82691. do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
  82692. } else if (curlen !== 0) {
  82693. if (curlen !== prevlen) {
  82694. send_code(s, curlen, s.bl_tree);
  82695. count--;
  82696. }
  82697. //Assert(count >= 3 && count <= 6, " 3_6?");
  82698. send_code(s, REP_3_6, s.bl_tree);
  82699. send_bits(s, count-3, 2);
  82700. } else if (count <= 10) {
  82701. send_code(s, REPZ_3_10, s.bl_tree);
  82702. send_bits(s, count-3, 3);
  82703. } else {
  82704. send_code(s, REPZ_11_138, s.bl_tree);
  82705. send_bits(s, count-11, 7);
  82706. }
  82707. count = 0;
  82708. prevlen = curlen;
  82709. if (nextlen === 0) {
  82710. max_count = 138;
  82711. min_count = 3;
  82712. } else if (curlen === nextlen) {
  82713. max_count = 6;
  82714. min_count = 3;
  82715. } else {
  82716. max_count = 7;
  82717. min_count = 4;
  82718. }
  82719. }
  82720. }
  82721. /* ===========================================================================
  82722. * Construct the Huffman tree for the bit lengths and return the index in
  82723. * bl_order of the last bit length code to send.
  82724. */
  82725. function build_bl_tree(s) {
  82726. var max_blindex; /* index of last bit length code of non zero freq */
  82727. /* Determine the bit length frequencies for literal and distance trees */
  82728. scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
  82729. scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
  82730. /* Build the bit length tree: */
  82731. build_tree(s, s.bl_desc);
  82732. /* opt_len now includes the length of the tree representations, except
  82733. * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
  82734. */
  82735. /* Determine the number of bit length codes to send. The pkzip format
  82736. * requires that at least 4 bit length codes be sent. (appnote.txt says
  82737. * 3 but the actual value used is 4.)
  82738. */
  82739. for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  82740. if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) {
  82741. break;
  82742. }
  82743. }
  82744. /* Update opt_len to include the bit length tree and counts */
  82745. s.opt_len += 3*(max_blindex+1) + 5+5+4;
  82746. //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  82747. // s->opt_len, s->static_len));
  82748. return max_blindex;
  82749. }
  82750. /* ===========================================================================
  82751. * Send the header for a block using dynamic Huffman trees: the counts, the
  82752. * lengths of the bit length codes, the literal tree and the distance tree.
  82753. * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
  82754. */
  82755. function send_all_trees(s, lcodes, dcodes, blcodes)
  82756. // deflate_state *s;
  82757. // int lcodes, dcodes, blcodes; /* number of codes for each tree */
  82758. {
  82759. var rank; /* index in bl_order */
  82760. //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  82761. //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  82762. // "too many codes");
  82763. //Tracev((stderr, "\nbl counts: "));
  82764. send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
  82765. send_bits(s, dcodes-1, 5);
  82766. send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
  82767. for (rank = 0; rank < blcodes; rank++) {
  82768. //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  82769. send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);
  82770. }
  82771. //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
  82772. send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */
  82773. //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
  82774. send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */
  82775. //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
  82776. }
  82777. /* ===========================================================================
  82778. * Check if the data type is TEXT or BINARY, using the following algorithm:
  82779. * - TEXT if the two conditions below are satisfied:
  82780. * a) There are no non-portable control characters belonging to the
  82781. * "black list" (0..6, 14..25, 28..31).
  82782. * b) There is at least one printable character belonging to the
  82783. * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
  82784. * - BINARY otherwise.
  82785. * - The following partially-portable control characters form a
  82786. * "gray list" that is ignored in this detection algorithm:
  82787. * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
  82788. * IN assertion: the fields Freq of dyn_ltree are set.
  82789. */
  82790. function detect_data_type(s) {
  82791. /* black_mask is the bit mask of black-listed bytes
  82792. * set bits 0..6, 14..25, and 28..31
  82793. * 0xf3ffc07f = binary 11110011111111111100000001111111
  82794. */
  82795. var black_mask = 0xf3ffc07f;
  82796. var n;
  82797. /* Check for non-textual ("black-listed") bytes. */
  82798. for (n = 0; n <= 31; n++, black_mask >>>= 1) {
  82799. if ((black_mask & 1) && (s.dyn_ltree[n*2]/*.Freq*/ !== 0)) {
  82800. return Z_BINARY;
  82801. }
  82802. }
  82803. /* Check for textual ("white-listed") bytes. */
  82804. if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
  82805. s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
  82806. return Z_TEXT;
  82807. }
  82808. for (n = 32; n < LITERALS; n++) {
  82809. if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
  82810. return Z_TEXT;
  82811. }
  82812. }
  82813. /* There are no "black-listed" or "white-listed" bytes:
  82814. * this stream either is empty or has tolerated ("gray-listed") bytes only.
  82815. */
  82816. return Z_BINARY;
  82817. }
  82818. var static_init_done = false;
  82819. /* ===========================================================================
  82820. * Initialize the tree data structures for a new zlib stream.
  82821. */
  82822. function _tr_init(s)
  82823. {
  82824. if (!static_init_done) {
  82825. tr_static_init();
  82826. static_init_done = true;
  82827. }
  82828. s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
  82829. s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
  82830. s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
  82831. s.bi_buf = 0;
  82832. s.bi_valid = 0;
  82833. /* Initialize the first block of the first file: */
  82834. init_block(s);
  82835. }
  82836. /* ===========================================================================
  82837. * Send a stored block
  82838. */
  82839. function _tr_stored_block(s, buf, stored_len, last)
  82840. //DeflateState *s;
  82841. //charf *buf; /* input block */
  82842. //ulg stored_len; /* length of input block */
  82843. //int last; /* one if this is the last block for a file */
  82844. {
  82845. send_bits(s, (STORED_BLOCK<<1)+(last ? 1 : 0), 3); /* send block type */
  82846. copy_block(s, buf, stored_len, true); /* with header */
  82847. }
  82848. /* ===========================================================================
  82849. * Send one empty static block to give enough lookahead for inflate.
  82850. * This takes 10 bits, of which 7 may remain in the bit buffer.
  82851. */
  82852. function _tr_align(s) {
  82853. send_bits(s, STATIC_TREES<<1, 3);
  82854. send_code(s, END_BLOCK, static_ltree);
  82855. bi_flush(s);
  82856. }
  82857. /* ===========================================================================
  82858. * Determine the best encoding for the current block: dynamic trees, static
  82859. * trees or store, and output the encoded block to the zip file.
  82860. */
  82861. function _tr_flush_block(s, buf, stored_len, last)
  82862. //DeflateState *s;
  82863. //charf *buf; /* input block, or NULL if too old */
  82864. //ulg stored_len; /* length of input block */
  82865. //int last; /* one if this is the last block for a file */
  82866. {
  82867. var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
  82868. var max_blindex = 0; /* index of last bit length code of non zero freq */
  82869. /* Build the Huffman trees unless a stored block is forced */
  82870. if (s.level > 0) {
  82871. /* Check if the file is binary or text */
  82872. if (s.strm.data_type === Z_UNKNOWN) {
  82873. s.strm.data_type = detect_data_type(s);
  82874. }
  82875. /* Construct the literal and distance trees */
  82876. build_tree(s, s.l_desc);
  82877. // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
  82878. // s->static_len));
  82879. build_tree(s, s.d_desc);
  82880. // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
  82881. // s->static_len));
  82882. /* At this point, opt_len and static_len are the total bit lengths of
  82883. * the compressed block data, excluding the tree representations.
  82884. */
  82885. /* Build the bit length tree for the above two trees, and get the index
  82886. * in bl_order of the last bit length code to send.
  82887. */
  82888. max_blindex = build_bl_tree(s);
  82889. /* Determine the best encoding. Compute the block lengths in bytes. */
  82890. opt_lenb = (s.opt_len+3+7) >>> 3;
  82891. static_lenb = (s.static_len+3+7) >>> 3;
  82892. // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
  82893. // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
  82894. // s->last_lit));
  82895. if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
  82896. } else {
  82897. // Assert(buf != (char*)0, "lost buf");
  82898. opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
  82899. }
  82900. if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {
  82901. /* 4: two words for the lengths */
  82902. /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
  82903. * Otherwise we can't have processed more than WSIZE input bytes since
  82904. * the last block flush, because compression would have been
  82905. * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
  82906. * transform a block into a stored block.
  82907. */
  82908. _tr_stored_block(s, buf, stored_len, last);
  82909. } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
  82910. send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);
  82911. compress_block(s, static_ltree, static_dtree);
  82912. } else {
  82913. send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);
  82914. send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);
  82915. compress_block(s, s.dyn_ltree, s.dyn_dtree);
  82916. }
  82917. // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
  82918. /* The above check is made mod 2^32, for files larger than 512 MB
  82919. * and uLong implemented on 32 bits.
  82920. */
  82921. init_block(s);
  82922. if (last) {
  82923. bi_windup(s);
  82924. }
  82925. // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
  82926. // s->compressed_len-7*last));
  82927. }
  82928. /* ===========================================================================
  82929. * Save the match info and tally the frequency counts. Return true if
  82930. * the current block must be flushed.
  82931. */
  82932. function _tr_tally(s, dist, lc)
  82933. // deflate_state *s;
  82934. // unsigned dist; /* distance of matched string */
  82935. // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
  82936. {
  82937. //var out_length, in_length, dcode;
  82938. s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
  82939. s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
  82940. s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
  82941. s.last_lit++;
  82942. if (dist === 0) {
  82943. /* lc is the unmatched char */
  82944. s.dyn_ltree[lc*2]/*.Freq*/++;
  82945. } else {
  82946. s.matches++;
  82947. /* Here, lc is the match length - MIN_MATCH */
  82948. dist--; /* dist = match distance - 1 */
  82949. //Assert((ush)dist < (ush)MAX_DIST(s) &&
  82950. // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
  82951. // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
  82952. s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;
  82953. s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
  82954. }
  82955. // (!) This block is disabled in zlib defailts,
  82956. // don't enable it for binary compatibility
  82957. //#ifdef TRUNCATE_BLOCK
  82958. // /* Try to guess if it is profitable to stop the current block here */
  82959. // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
  82960. // /* Compute an upper bound for the compressed length */
  82961. // out_length = s.last_lit*8;
  82962. // in_length = s.strstart - s.block_start;
  82963. //
  82964. // for (dcode = 0; dcode < D_CODES; dcode++) {
  82965. // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
  82966. // }
  82967. // out_length >>>= 3;
  82968. // //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
  82969. // // s->last_lit, in_length, out_length,
  82970. // // 100L - out_length*100L/in_length));
  82971. // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
  82972. // return true;
  82973. // }
  82974. // }
  82975. //#endif
  82976. return (s.last_lit === s.lit_bufsize-1);
  82977. /* We avoid equality with lit_bufsize because of wraparound at 64K
  82978. * on 16 bit machines and because stored blocks are restricted to
  82979. * 64K-1 bytes.
  82980. */
  82981. }
  82982. exports._tr_init = _tr_init;
  82983. exports._tr_stored_block = _tr_stored_block;
  82984. exports._tr_flush_block = _tr_flush_block;
  82985. exports._tr_tally = _tr_tally;
  82986. exports._tr_align = _tr_align;
  82987. },{"../utils/common":27}],39:[function(_dereq_,module,exports){
  82988. 'use strict';
  82989. function ZStream() {
  82990. /* next input byte */
  82991. this.input = null; // JS specific, because we have no pointers
  82992. this.next_in = 0;
  82993. /* number of bytes available at input */
  82994. this.avail_in = 0;
  82995. /* total number of input bytes read so far */
  82996. this.total_in = 0;
  82997. /* next output byte should be put there */
  82998. this.output = null; // JS specific, because we have no pointers
  82999. this.next_out = 0;
  83000. /* remaining free space at output */
  83001. this.avail_out = 0;
  83002. /* total number of bytes output so far */
  83003. this.total_out = 0;
  83004. /* last error message, NULL if no error */
  83005. this.msg = ''/*Z_NULL*/;
  83006. /* not visible by applications */
  83007. this.state = null;
  83008. /* best guess about the data type: binary or text */
  83009. this.data_type = 2/*Z_UNKNOWN*/;
  83010. /* adler32 value of the uncompressed data */
  83011. this.adler = 0;
  83012. }
  83013. module.exports = ZStream;
  83014. },{}]},{},[9])
  83015. (9)
  83016. }));
  83017. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  83018. /***/ }),
  83019. /***/ "./node_modules/xlsx/xlsx.js":
  83020. /*!***********************************!*\
  83021. !*** ./node_modules/xlsx/xlsx.js ***!
  83022. \***********************************/
  83023. /*! no static exports found */
  83024. /***/ (function(module, exports, __webpack_require__) {
  83025. /* WEBPACK VAR INJECTION */(function(global, Buffer, process) {/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
  83026. /* vim: set ts=2: */
  83027. /*exported XLSX */
  83028. /*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
  83029. var XLSX = {};
  83030. function make_xlsx_lib(XLSX){
  83031. XLSX.version = '0.15.2';
  83032. var current_codepage = 1200, current_ansi = 1252;
  83033. /*global cptable:true, window */
  83034. if(true) {
  83035. if(typeof cptable === 'undefined') {
  83036. if(typeof global !== 'undefined') global.cptable = __webpack_require__(/*! ./dist/cpexcel.js */ "./node_modules/xlsx/dist/cpexcel.js");
  83037. else if(typeof window !== 'undefined') window.cptable = __webpack_require__(/*! ./dist/cpexcel.js */ "./node_modules/xlsx/dist/cpexcel.js");
  83038. }
  83039. }
  83040. var VALID_ANSI = [ 874, 932, 936, 949, 950 ];
  83041. for(var i = 0; i <= 8; ++i) VALID_ANSI.push(1250 + i);
  83042. /* ECMA-376 Part I 18.4.1 charset to codepage mapping */
  83043. var CS2CP = ({
  83044. 0: 1252, /* ANSI */
  83045. 1: 65001, /* DEFAULT */
  83046. 2: 65001, /* SYMBOL */
  83047. 77: 10000, /* MAC */
  83048. 128: 932, /* SHIFTJIS */
  83049. 129: 949, /* HANGUL */
  83050. 130: 1361, /* JOHAB */
  83051. 134: 936, /* GB2312 */
  83052. 136: 950, /* CHINESEBIG5 */
  83053. 161: 1253, /* GREEK */
  83054. 162: 1254, /* TURKISH */
  83055. 163: 1258, /* VIETNAMESE */
  83056. 177: 1255, /* HEBREW */
  83057. 178: 1256, /* ARABIC */
  83058. 186: 1257, /* BALTIC */
  83059. 204: 1251, /* RUSSIAN */
  83060. 222: 874, /* THAI */
  83061. 238: 1250, /* EASTEUROPE */
  83062. 255: 1252, /* OEM */
  83063. 69: 6969 /* MISC */
  83064. });
  83065. var set_ansi = function(cp) { if(VALID_ANSI.indexOf(cp) == -1) return; current_ansi = CS2CP[0] = cp; };
  83066. function reset_ansi() { set_ansi(1252); }
  83067. var set_cp = function(cp) { current_codepage = cp; set_ansi(cp); };
  83068. function reset_cp() { set_cp(1200); reset_ansi(); }
  83069. function char_codes(data) { var o = []; for(var i = 0, len = data.length; i < len; ++i) o[i] = data.charCodeAt(i); return o; }
  83070. function utf16leread(data) {
  83071. var o = [];
  83072. for(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i) + (data.charCodeAt(2*i+1)<<8));
  83073. return o.join("");
  83074. }
  83075. function utf16beread(data) {
  83076. var o = [];
  83077. for(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i+1) + (data.charCodeAt(2*i)<<8));
  83078. return o.join("");
  83079. }
  83080. var debom = function(data) {
  83081. var c1 = data.charCodeAt(0), c2 = data.charCodeAt(1);
  83082. if(c1 == 0xFF && c2 == 0xFE) return utf16leread(data.slice(2));
  83083. if(c1 == 0xFE && c2 == 0xFF) return utf16beread(data.slice(2));
  83084. if(c1 == 0xFEFF) return data.slice(1);
  83085. return data;
  83086. };
  83087. var _getchar = function _gc1(x) { return String.fromCharCode(x); };
  83088. var _getansi = function _ga1(x) { return String.fromCharCode(x); };
  83089. if(typeof cptable !== 'undefined') {
  83090. set_cp = function(cp) { current_codepage = cp; set_ansi(cp); };
  83091. debom = function(data) {
  83092. if(data.charCodeAt(0) === 0xFF && data.charCodeAt(1) === 0xFE) { return cptable.utils.decode(1200, char_codes(data.slice(2))); }
  83093. return data;
  83094. };
  83095. _getchar = function _gc2(x) {
  83096. if(current_codepage === 1200) return String.fromCharCode(x);
  83097. return cptable.utils.decode(current_codepage, [x&255,x>>8])[0];
  83098. };
  83099. _getansi = function _ga2(x) {
  83100. return cptable.utils.decode(current_ansi, [x])[0];
  83101. };
  83102. }
  83103. var DENSE = null;
  83104. var DIF_XL = true;
  83105. var Base64 = (function make_b64(){
  83106. var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  83107. return {
  83108. encode: function(input) {
  83109. var o = "";
  83110. var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
  83111. for(var i = 0; i < input.length; ) {
  83112. c1 = input.charCodeAt(i++);
  83113. e1 = (c1 >> 2);
  83114. c2 = input.charCodeAt(i++);
  83115. e2 = ((c1 & 3) << 4) | (c2 >> 4);
  83116. c3 = input.charCodeAt(i++);
  83117. e3 = ((c2 & 15) << 2) | (c3 >> 6);
  83118. e4 = (c3 & 63);
  83119. if (isNaN(c2)) { e3 = e4 = 64; }
  83120. else if (isNaN(c3)) { e4 = 64; }
  83121. o += map.charAt(e1) + map.charAt(e2) + map.charAt(e3) + map.charAt(e4);
  83122. }
  83123. return o;
  83124. },
  83125. decode: function b64_decode(input) {
  83126. var o = "";
  83127. var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
  83128. input = input.replace(/[^\w\+\/\=]/g, "");
  83129. for(var i = 0; i < input.length;) {
  83130. e1 = map.indexOf(input.charAt(i++));
  83131. e2 = map.indexOf(input.charAt(i++));
  83132. c1 = (e1 << 2) | (e2 >> 4);
  83133. o += String.fromCharCode(c1);
  83134. e3 = map.indexOf(input.charAt(i++));
  83135. c2 = ((e2 & 15) << 4) | (e3 >> 2);
  83136. if (e3 !== 64) { o += String.fromCharCode(c2); }
  83137. e4 = map.indexOf(input.charAt(i++));
  83138. c3 = ((e3 & 3) << 6) | e4;
  83139. if (e4 !== 64) { o += String.fromCharCode(c3); }
  83140. }
  83141. return o;
  83142. }
  83143. };
  83144. })();
  83145. var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && !!process.versions.node);
  83146. var Buffer_from = function(){};
  83147. if(typeof Buffer !== 'undefined') {
  83148. var nbfs = !Buffer.from;
  83149. if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
  83150. Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
  83151. // $FlowIgnore
  83152. if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
  83153. // $FlowIgnore
  83154. if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
  83155. }
  83156. function new_raw_buf(len) {
  83157. /* jshint -W056 */
  83158. return has_buf ? Buffer.alloc(len) : new Array(len);
  83159. /* jshint +W056 */
  83160. }
  83161. function new_unsafe_buf(len) {
  83162. /* jshint -W056 */
  83163. return has_buf ? Buffer.allocUnsafe(len) : new Array(len);
  83164. /* jshint +W056 */
  83165. }
  83166. var s2a = function s2a(s) {
  83167. if(has_buf) return Buffer_from(s, "binary");
  83168. return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
  83169. };
  83170. function s2ab(s) {
  83171. if(typeof ArrayBuffer === 'undefined') return s2a(s);
  83172. var buf = new ArrayBuffer(s.length), view = new Uint8Array(buf);
  83173. for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
  83174. return buf;
  83175. }
  83176. function a2s(data) {
  83177. if(Array.isArray(data)) return data.map(function(c) { return String.fromCharCode(c); }).join("");
  83178. var o = []; for(var i = 0; i < data.length; ++i) o[i] = String.fromCharCode(data[i]); return o.join("");
  83179. }
  83180. function a2u(data) {
  83181. if(typeof Uint8Array === 'undefined') throw new Error("Unsupported");
  83182. return new Uint8Array(data);
  83183. }
  83184. function ab2a(data) {
  83185. if(typeof ArrayBuffer == 'undefined') throw new Error("Unsupported");
  83186. if(data instanceof ArrayBuffer) return ab2a(new Uint8Array(data));
  83187. var o = new Array(data.length);
  83188. for(var i = 0; i < data.length; ++i) o[i] = data[i];
  83189. return o;
  83190. }
  83191. var bconcat = function(bufs) { return [].concat.apply([], bufs); };
  83192. var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g;
  83193. /* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */
  83194. /*jshint -W041 */
  83195. var SSF = ({});
  83196. var make_ssf = function make_ssf(SSF){
  83197. SSF.version = '0.10.2';
  83198. function _strrev(x) { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; }
  83199. function fill(c,l) { var o = ""; while(o.length < l) o+=c; return o; }
  83200. function pad0(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
  83201. function pad_(v,d){var t=""+v;return t.length>=d?t:fill(' ',d-t.length)+t;}
  83202. function rpad_(v,d){var t=""+v; return t.length>=d?t:t+fill(' ',d-t.length);}
  83203. function pad0r1(v,d){var t=""+Math.round(v); return t.length>=d?t:fill('0',d-t.length)+t;}
  83204. function pad0r2(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
  83205. var p2_32 = Math.pow(2,32);
  83206. function pad0r(v,d){if(v>p2_32||v<-p2_32) return pad0r1(v,d); var i = Math.round(v); return pad0r2(i,d); }
  83207. function isgeneral(s, i) { i = i || 0; return s.length >= 7 + i && (s.charCodeAt(i)|32) === 103 && (s.charCodeAt(i+1)|32) === 101 && (s.charCodeAt(i+2)|32) === 110 && (s.charCodeAt(i+3)|32) === 101 && (s.charCodeAt(i+4)|32) === 114 && (s.charCodeAt(i+5)|32) === 97 && (s.charCodeAt(i+6)|32) === 108; }
  83208. var days = [
  83209. ['Sun', 'Sunday'],
  83210. ['Mon', 'Monday'],
  83211. ['Tue', 'Tuesday'],
  83212. ['Wed', 'Wednesday'],
  83213. ['Thu', 'Thursday'],
  83214. ['Fri', 'Friday'],
  83215. ['Sat', 'Saturday']
  83216. ];
  83217. var months = [
  83218. ['J', 'Jan', 'January'],
  83219. ['F', 'Feb', 'February'],
  83220. ['M', 'Mar', 'March'],
  83221. ['A', 'Apr', 'April'],
  83222. ['M', 'May', 'May'],
  83223. ['J', 'Jun', 'June'],
  83224. ['J', 'Jul', 'July'],
  83225. ['A', 'Aug', 'August'],
  83226. ['S', 'Sep', 'September'],
  83227. ['O', 'Oct', 'October'],
  83228. ['N', 'Nov', 'November'],
  83229. ['D', 'Dec', 'December']
  83230. ];
  83231. function init_table(t) {
  83232. t[0]= 'General';
  83233. t[1]= '0';
  83234. t[2]= '0.00';
  83235. t[3]= '#,##0';
  83236. t[4]= '#,##0.00';
  83237. t[9]= '0%';
  83238. t[10]= '0.00%';
  83239. t[11]= '0.00E+00';
  83240. t[12]= '# ?/?';
  83241. t[13]= '# ??/??';
  83242. t[14]= 'm/d/yy';
  83243. t[15]= 'd-mmm-yy';
  83244. t[16]= 'd-mmm';
  83245. t[17]= 'mmm-yy';
  83246. t[18]= 'h:mm AM/PM';
  83247. t[19]= 'h:mm:ss AM/PM';
  83248. t[20]= 'h:mm';
  83249. t[21]= 'h:mm:ss';
  83250. t[22]= 'm/d/yy h:mm';
  83251. t[37]= '#,##0 ;(#,##0)';
  83252. t[38]= '#,##0 ;[Red](#,##0)';
  83253. t[39]= '#,##0.00;(#,##0.00)';
  83254. t[40]= '#,##0.00;[Red](#,##0.00)';
  83255. t[45]= 'mm:ss';
  83256. t[46]= '[h]:mm:ss';
  83257. t[47]= 'mmss.0';
  83258. t[48]= '##0.0E+0';
  83259. t[49]= '@';
  83260. t[56]= '"上午/下午 "hh"時"mm"分"ss"秒 "';
  83261. t[65535]= 'General';
  83262. }
  83263. var table_fmt = {};
  83264. init_table(table_fmt);
  83265. function frac(x, D, mixed) {
  83266. var sgn = x < 0 ? -1 : 1;
  83267. var B = x * sgn;
  83268. var P_2 = 0, P_1 = 1, P = 0;
  83269. var Q_2 = 1, Q_1 = 0, Q = 0;
  83270. var A = Math.floor(B);
  83271. while(Q_1 < D) {
  83272. A = Math.floor(B);
  83273. P = A * P_1 + P_2;
  83274. Q = A * Q_1 + Q_2;
  83275. if((B - A) < 0.00000005) break;
  83276. B = 1 / (B - A);
  83277. P_2 = P_1; P_1 = P;
  83278. Q_2 = Q_1; Q_1 = Q;
  83279. }
  83280. if(Q > D) { if(Q_1 > D) { Q = Q_2; P = P_2; } else { Q = Q_1; P = P_1; } }
  83281. if(!mixed) return [0, sgn * P, Q];
  83282. var q = Math.floor(sgn * P/Q);
  83283. return [q, sgn*P - q*Q, Q];
  83284. }
  83285. function parse_date_code(v,opts,b2) {
  83286. if(v > 2958465 || v < 0) return null;
  83287. var date = (v|0), time = Math.floor(86400 * (v - date)), dow=0;
  83288. var dout=[];
  83289. var out={D:date, T:time, u:86400*(v-date)-time,y:0,m:0,d:0,H:0,M:0,S:0,q:0};
  83290. if(Math.abs(out.u) < 1e-6) out.u = 0;
  83291. if(opts && opts.date1904) date += 1462;
  83292. if(out.u > 0.9999) {
  83293. out.u = 0;
  83294. if(++time == 86400) { out.T = time = 0; ++date; ++out.D; }
  83295. }
  83296. if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}
  83297. else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}
  83298. else {
  83299. if(date > 60) --date;
  83300. /* 1 = Jan 1 1900 in Gregorian */
  83301. var d = new Date(1900, 0, 1);
  83302. d.setDate(d.getDate() + date - 1);
  83303. dout = [d.getFullYear(), d.getMonth()+1,d.getDate()];
  83304. dow = d.getDay();
  83305. if(date < 60) dow = (dow + 6) % 7;
  83306. if(b2) dow = fix_hijri(d, dout);
  83307. }
  83308. out.y = dout[0]; out.m = dout[1]; out.d = dout[2];
  83309. out.S = time % 60; time = Math.floor(time / 60);
  83310. out.M = time % 60; time = Math.floor(time / 60);
  83311. out.H = time;
  83312. out.q = dow;
  83313. return out;
  83314. }
  83315. SSF.parse_date_code = parse_date_code;
  83316. var basedate = new Date(1899, 11, 31, 0, 0, 0);
  83317. var dnthresh = basedate.getTime();
  83318. var base1904 = new Date(1900, 2, 1, 0, 0, 0);
  83319. function datenum_local(v, date1904) {
  83320. var epoch = v.getTime();
  83321. if(date1904) epoch -= 1461*24*60*60*1000;
  83322. else if(v >= base1904) epoch += 24*60*60*1000;
  83323. return (epoch - (dnthresh + (v.getTimezoneOffset() - basedate.getTimezoneOffset()) * 60000)) / (24 * 60 * 60 * 1000);
  83324. }
  83325. function general_fmt_int(v) { return v.toString(10); }
  83326. SSF._general_int = general_fmt_int;
  83327. var general_fmt_num = (function make_general_fmt_num() {
  83328. var gnr1 = /\.(\d*[1-9])0+$/, gnr2 = /\.0*$/, gnr4 = /\.(\d*[1-9])0+/, gnr5 = /\.0*[Ee]/, gnr6 = /(E[+-])(\d)$/;
  83329. function gfn2(v) {
  83330. var w = (v<0?12:11);
  83331. var o = gfn5(v.toFixed(12)); if(o.length <= w) return o;
  83332. o = v.toPrecision(10); if(o.length <= w) return o;
  83333. return v.toExponential(5);
  83334. }
  83335. function gfn3(v) {
  83336. var o = v.toFixed(11).replace(gnr1,".$1");
  83337. if(o.length > (v<0?12:11)) o = v.toPrecision(6);
  83338. return o;
  83339. }
  83340. function gfn4(o) {
  83341. for(var i = 0; i != o.length; ++i) if((o.charCodeAt(i) | 0x20) === 101) return o.replace(gnr4,".$1").replace(gnr5,"E").replace("e","E").replace(gnr6,"$10$2");
  83342. return o;
  83343. }
  83344. function gfn5(o) {
  83345. return o.indexOf(".") > -1 ? o.replace(gnr2,"").replace(gnr1,".$1") : o;
  83346. }
  83347. return function general_fmt_num(v) {
  83348. var V = Math.floor(Math.log(Math.abs(v))*Math.LOG10E), o;
  83349. if(V >= -4 && V <= -1) o = v.toPrecision(10+V);
  83350. else if(Math.abs(V) <= 9) o = gfn2(v);
  83351. else if(V === 10) o = v.toFixed(10).substr(0,12);
  83352. else o = gfn3(v);
  83353. return gfn5(gfn4(o));
  83354. };})();
  83355. SSF._general_num = general_fmt_num;
  83356. function general_fmt(v, opts) {
  83357. switch(typeof v) {
  83358. case 'string': return v;
  83359. case 'boolean': return v ? "TRUE" : "FALSE";
  83360. case 'number': return (v|0) === v ? general_fmt_int(v) : general_fmt_num(v);
  83361. case 'undefined': return "";
  83362. case 'object':
  83363. if(v == null) return "";
  83364. if(v instanceof Date) return format(14, datenum_local(v, opts && opts.date1904), opts);
  83365. }
  83366. throw new Error("unsupported value in General format: " + v);
  83367. }
  83368. SSF._general = general_fmt;
  83369. function fix_hijri() { return 0; }
  83370. /*jshint -W086 */
  83371. function write_date(type, fmt, val, ss0) {
  83372. var o="", ss=0, tt=0, y = val.y, out, outl = 0;
  83373. switch(type) {
  83374. case 98: /* 'b' buddhist year */
  83375. y = val.y + 543;
  83376. /* falls through */
  83377. case 121: /* 'y' year */
  83378. switch(fmt.length) {
  83379. case 1: case 2: out = y % 100; outl = 2; break;
  83380. default: out = y % 10000; outl = 4; break;
  83381. } break;
  83382. case 109: /* 'm' month */
  83383. switch(fmt.length) {
  83384. case 1: case 2: out = val.m; outl = fmt.length; break;
  83385. case 3: return months[val.m-1][1];
  83386. case 5: return months[val.m-1][0];
  83387. default: return months[val.m-1][2];
  83388. } break;
  83389. case 100: /* 'd' day */
  83390. switch(fmt.length) {
  83391. case 1: case 2: out = val.d; outl = fmt.length; break;
  83392. case 3: return days[val.q][0];
  83393. default: return days[val.q][1];
  83394. } break;
  83395. case 104: /* 'h' 12-hour */
  83396. switch(fmt.length) {
  83397. case 1: case 2: out = 1+(val.H+11)%12; outl = fmt.length; break;
  83398. default: throw 'bad hour format: ' + fmt;
  83399. } break;
  83400. case 72: /* 'H' 24-hour */
  83401. switch(fmt.length) {
  83402. case 1: case 2: out = val.H; outl = fmt.length; break;
  83403. default: throw 'bad hour format: ' + fmt;
  83404. } break;
  83405. case 77: /* 'M' minutes */
  83406. switch(fmt.length) {
  83407. case 1: case 2: out = val.M; outl = fmt.length; break;
  83408. default: throw 'bad minute format: ' + fmt;
  83409. } break;
  83410. case 115: /* 's' seconds */
  83411. if(fmt != 's' && fmt != 'ss' && fmt != '.0' && fmt != '.00' && fmt != '.000') throw 'bad second format: ' + fmt;
  83412. if(val.u === 0 && (fmt == "s" || fmt == "ss")) return pad0(val.S, fmt.length);
  83413. if(ss0 >= 2) tt = ss0 === 3 ? 1000 : 100;
  83414. else tt = ss0 === 1 ? 10 : 1;
  83415. ss = Math.round((tt)*(val.S + val.u));
  83416. if(ss >= 60*tt) ss = 0;
  83417. if(fmt === 's') return ss === 0 ? "0" : ""+ss/tt;
  83418. o = pad0(ss,2 + ss0);
  83419. if(fmt === 'ss') return o.substr(0,2);
  83420. return "." + o.substr(2,fmt.length-1);
  83421. case 90: /* 'Z' absolute time */
  83422. switch(fmt) {
  83423. case '[h]': case '[hh]': out = val.D*24+val.H; break;
  83424. case '[m]': case '[mm]': out = (val.D*24+val.H)*60+val.M; break;
  83425. case '[s]': case '[ss]': out = ((val.D*24+val.H)*60+val.M)*60+Math.round(val.S+val.u); break;
  83426. default: throw 'bad abstime format: ' + fmt;
  83427. } outl = fmt.length === 3 ? 1 : 2; break;
  83428. case 101: /* 'e' era */
  83429. out = y; outl = 1;
  83430. }
  83431. if(outl > 0) return pad0(out, outl); else return "";
  83432. }
  83433. /*jshint +W086 */
  83434. function commaify(s) {
  83435. var w = 3;
  83436. if(s.length <= w) return s;
  83437. var j = (s.length % w), o = s.substr(0,j);
  83438. for(; j!=s.length; j+=w) o+=(o.length > 0 ? "," : "") + s.substr(j,w);
  83439. return o;
  83440. }
  83441. var write_num = (function make_write_num(){
  83442. var pct1 = /%/g;
  83443. function write_num_pct(type, fmt, val){
  83444. var sfmt = fmt.replace(pct1,""), mul = fmt.length - sfmt.length;
  83445. return write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill("%",mul);
  83446. }
  83447. function write_num_cm(type, fmt, val){
  83448. var idx = fmt.length - 1;
  83449. while(fmt.charCodeAt(idx-1) === 44) --idx;
  83450. return write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));
  83451. }
  83452. function write_num_exp(fmt, val){
  83453. var o;
  83454. var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
  83455. if(fmt.match(/^#+0.0E\+0$/)) {
  83456. if(val == 0) return "0.0E+0";
  83457. else if(val < 0) return "-" + write_num_exp(fmt, -val);
  83458. var period = fmt.indexOf("."); if(period === -1) period=fmt.indexOf('E');
  83459. var ee = Math.floor(Math.log(val)*Math.LOG10E)%period;
  83460. if(ee < 0) ee += period;
  83461. o = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);
  83462. if(o.indexOf("e") === -1) {
  83463. var fakee = Math.floor(Math.log(val)*Math.LOG10E);
  83464. if(o.indexOf(".") === -1) o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length+ee);
  83465. else o += "E+" + (fakee - ee);
  83466. while(o.substr(0,2) === "0.") {
  83467. o = o.charAt(0) + o.substr(2,period) + "." + o.substr(2+period);
  83468. o = o.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");
  83469. }
  83470. o = o.replace(/\+-/,"-");
  83471. }
  83472. o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + "." + $3.substr(ee) + "E"; });
  83473. } else o = val.toExponential(idx);
  83474. if(fmt.match(/E\+00$/) && o.match(/e[+-]\d$/)) o = o.substr(0,o.length-1) + "0" + o.charAt(o.length-1);
  83475. if(fmt.match(/E\-/) && o.match(/e\+/)) o = o.replace(/e\+/,"e");
  83476. return o.replace("e","E");
  83477. }
  83478. var frac1 = /# (\?+)( ?)\/( ?)(\d+)/;
  83479. function write_num_f1(r, aval, sign) {
  83480. var den = parseInt(r[4],10), rr = Math.round(aval * den), base = Math.floor(rr/den);
  83481. var myn = (rr - base*den), myd = den;
  83482. return sign + (base === 0 ? "" : ""+base) + " " + (myn === 0 ? fill(" ", r[1].length + 1 + r[4].length) : pad_(myn,r[1].length) + r[2] + "/" + r[3] + pad0(myd,r[4].length));
  83483. }
  83484. function write_num_f2(r, aval, sign) {
  83485. return sign + (aval === 0 ? "" : ""+aval) + fill(" ", r[1].length + 2 + r[4].length);
  83486. }
  83487. var dec1 = /^#*0*\.([0#]+)/;
  83488. var closeparen = /\).*[0#]/;
  83489. var phone = /\(###\) ###\\?-####/;
  83490. function hashq(str) {
  83491. var o = "", cc;
  83492. for(var i = 0; i != str.length; ++i) switch((cc=str.charCodeAt(i))) {
  83493. case 35: break;
  83494. case 63: o+= " "; break;
  83495. case 48: o+= "0"; break;
  83496. default: o+= String.fromCharCode(cc);
  83497. }
  83498. return o;
  83499. }
  83500. function rnd(val, d) { var dd = Math.pow(10,d); return ""+(Math.round(val * dd)/dd); }
  83501. function dec(val, d) {
  83502. if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {
  83503. return 0;
  83504. }
  83505. return Math.round((val-Math.floor(val))*Math.pow(10,d));
  83506. }
  83507. function carry(val, d) {
  83508. if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {
  83509. return 1;
  83510. }
  83511. return 0;
  83512. }
  83513. function flr(val) { if(val < 2147483647 && val > -2147483648) return ""+(val >= 0 ? (val|0) : (val-1|0)); return ""+Math.floor(val); }
  83514. function write_num_flt(type, fmt, val) {
  83515. if(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
  83516. var ffmt = fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");
  83517. if(val >= 0) return write_num_flt('n', ffmt, val);
  83518. return '(' + write_num_flt('n', ffmt, -val) + ')';
  83519. }
  83520. if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm(type, fmt, val);
  83521. if(fmt.indexOf('%') !== -1) return write_num_pct(type, fmt, val);
  83522. if(fmt.indexOf('E') !== -1) return write_num_exp(fmt, val);
  83523. if(fmt.charCodeAt(0) === 36) return "$"+write_num_flt(type,fmt.substr(fmt.charAt(1)==' '?2:1),val);
  83524. var o;
  83525. var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
  83526. if(fmt.match(/^00+$/)) return sign + pad0r(aval,fmt.length);
  83527. if(fmt.match(/^[#?]+$/)) {
  83528. o = pad0r(val,0); if(o === "0") o = "";
  83529. return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;
  83530. }
  83531. if((r = fmt.match(frac1))) return write_num_f1(r, aval, sign);
  83532. if(fmt.match(/^#+0+$/)) return sign + pad0r(aval,fmt.length - fmt.indexOf("0"));
  83533. if((r = fmt.match(dec1))) {
  83534. o = rnd(val, r[1].length).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1])).replace(/\.(\d*)$/,function($$, $1) { return "." + $1 + fill("0", hashq(r[1]).length-$1.length); });
  83535. return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,".");
  83536. }
  83537. fmt = fmt.replace(/^#+([0.])/, "$1");
  83538. if((r = fmt.match(/^(0*)\.(#*)$/))) {
  83539. return sign + rnd(aval, r[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
  83540. }
  83541. if((r = fmt.match(/^#{1,3},##0(\.?)$/))) return sign + commaify(pad0r(aval,0));
  83542. if((r = fmt.match(/^#,##0\.([#0]*0)$/))) {
  83543. return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(""+(Math.floor(val) + carry(val, r[1].length))) + "." + pad0(dec(val, r[1].length),r[1].length);
  83544. }
  83545. if((r = fmt.match(/^#,#*,#0/))) return write_num_flt(type,fmt.replace(/^#,#*,/,""),val);
  83546. if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/))) {
  83547. o = _strrev(write_num_flt(type, fmt.replace(/[\\-]/g,""), val));
  83548. ri = 0;
  83549. return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri<o.length?o.charAt(ri++):x==='0'?'0':"";}));
  83550. }
  83551. if(fmt.match(phone)) {
  83552. o = write_num_flt(type, "##########", val);
  83553. return "(" + o.substr(0,3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
  83554. }
  83555. var oa = "";
  83556. if((r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))) {
  83557. ri = Math.min(r[4].length,7);
  83558. ff = frac(aval, Math.pow(10,ri)-1, false);
  83559. o = "" + sign;
  83560. oa = write_num("n", r[1], ff[1]);
  83561. if(oa.charAt(oa.length-1) == " ") oa = oa.substr(0,oa.length-1) + "0";
  83562. o += oa + r[2] + "/" + r[3];
  83563. oa = rpad_(ff[2],ri);
  83564. if(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa;
  83565. o += oa;
  83566. return o;
  83567. }
  83568. if((r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))) {
  83569. ri = Math.min(Math.max(r[1].length, r[4].length),7);
  83570. ff = frac(aval, Math.pow(10,ri)-1, true);
  83571. return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1],ri) + r[2] + "/" + r[3] + rpad_(ff[2],ri): fill(" ", 2*ri+1 + r[2].length + r[3].length));
  83572. }
  83573. if((r = fmt.match(/^[#0?]+$/))) {
  83574. o = pad0r(val, 0);
  83575. if(fmt.length <= o.length) return o;
  83576. return hashq(fmt.substr(0,fmt.length-o.length)) + o;
  83577. }
  83578. if((r = fmt.match(/^([#0?]+)\.([#0]+)$/))) {
  83579. o = "" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1");
  83580. ri = o.indexOf(".");
  83581. var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres;
  83582. return hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres));
  83583. }
  83584. if((r = fmt.match(/^00,000\.([#0]*0)$/))) {
  83585. ri = dec(val, r[1].length);
  83586. return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(flr(val)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad0(0,3-$$.length) : "") + $$; }) + "." + pad0(ri,r[1].length);
  83587. }
  83588. switch(fmt) {
  83589. case "###,##0.00": return write_num_flt(type, "#,##0.00", val);
  83590. case "###,###":
  83591. case "##,###":
  83592. case "#,###": var x = commaify(pad0r(aval,0)); return x !== "0" ? sign + x : "";
  83593. case "###,###.00": return write_num_flt(type, "###,##0.00",val).replace(/^0\./,".");
  83594. case "#,###.00": return write_num_flt(type, "#,##0.00",val).replace(/^0\./,".");
  83595. default:
  83596. }
  83597. throw new Error("unsupported format |" + fmt + "|");
  83598. }
  83599. function write_num_cm2(type, fmt, val){
  83600. var idx = fmt.length - 1;
  83601. while(fmt.charCodeAt(idx-1) === 44) --idx;
  83602. return write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));
  83603. }
  83604. function write_num_pct2(type, fmt, val){
  83605. var sfmt = fmt.replace(pct1,""), mul = fmt.length - sfmt.length;
  83606. return write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill("%",mul);
  83607. }
  83608. function write_num_exp2(fmt, val){
  83609. var o;
  83610. var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
  83611. if(fmt.match(/^#+0.0E\+0$/)) {
  83612. if(val == 0) return "0.0E+0";
  83613. else if(val < 0) return "-" + write_num_exp2(fmt, -val);
  83614. var period = fmt.indexOf("."); if(period === -1) period=fmt.indexOf('E');
  83615. var ee = Math.floor(Math.log(val)*Math.LOG10E)%period;
  83616. if(ee < 0) ee += period;
  83617. o = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);
  83618. if(!o.match(/[Ee]/)) {
  83619. var fakee = Math.floor(Math.log(val)*Math.LOG10E);
  83620. if(o.indexOf(".") === -1) o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length+ee);
  83621. else o += "E+" + (fakee - ee);
  83622. o = o.replace(/\+-/,"-");
  83623. }
  83624. o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + "." + $3.substr(ee) + "E"; });
  83625. } else o = val.toExponential(idx);
  83626. if(fmt.match(/E\+00$/) && o.match(/e[+-]\d$/)) o = o.substr(0,o.length-1) + "0" + o.charAt(o.length-1);
  83627. if(fmt.match(/E\-/) && o.match(/e\+/)) o = o.replace(/e\+/,"e");
  83628. return o.replace("e","E");
  83629. }
  83630. function write_num_int(type, fmt, val) {
  83631. if(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
  83632. var ffmt = fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");
  83633. if(val >= 0) return write_num_int('n', ffmt, val);
  83634. return '(' + write_num_int('n', ffmt, -val) + ')';
  83635. }
  83636. if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm2(type, fmt, val);
  83637. if(fmt.indexOf('%') !== -1) return write_num_pct2(type, fmt, val);
  83638. if(fmt.indexOf('E') !== -1) return write_num_exp2(fmt, val);
  83639. if(fmt.charCodeAt(0) === 36) return "$"+write_num_int(type,fmt.substr(fmt.charAt(1)==' '?2:1),val);
  83640. var o;
  83641. var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
  83642. if(fmt.match(/^00+$/)) return sign + pad0(aval,fmt.length);
  83643. if(fmt.match(/^[#?]+$/)) {
  83644. o = (""+val); if(val === 0) o = "";
  83645. return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;
  83646. }
  83647. if((r = fmt.match(frac1))) return write_num_f2(r, aval, sign);
  83648. if(fmt.match(/^#+0+$/)) return sign + pad0(aval,fmt.length - fmt.indexOf("0"));
  83649. if((r = fmt.match(dec1))) {
  83650. o = (""+val).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1]));
  83651. o = o.replace(/\.(\d*)$/,function($$, $1) {
  83652. return "." + $1 + fill("0", hashq(r[1]).length-$1.length); });
  83653. return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,".");
  83654. }
  83655. fmt = fmt.replace(/^#+([0.])/, "$1");
  83656. if((r = fmt.match(/^(0*)\.(#*)$/))) {
  83657. return sign + (""+aval).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
  83658. }
  83659. if((r = fmt.match(/^#{1,3},##0(\.?)$/))) return sign + commaify((""+aval));
  83660. if((r = fmt.match(/^#,##0\.([#0]*0)$/))) {
  83661. return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify((""+val)) + "." + fill('0',r[1].length);
  83662. }
  83663. if((r = fmt.match(/^#,#*,#0/))) return write_num_int(type,fmt.replace(/^#,#*,/,""),val);
  83664. if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/))) {
  83665. o = _strrev(write_num_int(type, fmt.replace(/[\\-]/g,""), val));
  83666. ri = 0;
  83667. return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri<o.length?o.charAt(ri++):x==='0'?'0':"";}));
  83668. }
  83669. if(fmt.match(phone)) {
  83670. o = write_num_int(type, "##########", val);
  83671. return "(" + o.substr(0,3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
  83672. }
  83673. var oa = "";
  83674. if((r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))) {
  83675. ri = Math.min(r[4].length,7);
  83676. ff = frac(aval, Math.pow(10,ri)-1, false);
  83677. o = "" + sign;
  83678. oa = write_num("n", r[1], ff[1]);
  83679. if(oa.charAt(oa.length-1) == " ") oa = oa.substr(0,oa.length-1) + "0";
  83680. o += oa + r[2] + "/" + r[3];
  83681. oa = rpad_(ff[2],ri);
  83682. if(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa;
  83683. o += oa;
  83684. return o;
  83685. }
  83686. if((r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))) {
  83687. ri = Math.min(Math.max(r[1].length, r[4].length),7);
  83688. ff = frac(aval, Math.pow(10,ri)-1, true);
  83689. return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1],ri) + r[2] + "/" + r[3] + rpad_(ff[2],ri): fill(" ", 2*ri+1 + r[2].length + r[3].length));
  83690. }
  83691. if((r = fmt.match(/^[#0?]+$/))) {
  83692. o = "" + val;
  83693. if(fmt.length <= o.length) return o;
  83694. return hashq(fmt.substr(0,fmt.length-o.length)) + o;
  83695. }
  83696. if((r = fmt.match(/^([#0]+)\.([#0]+)$/))) {
  83697. o = "" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1");
  83698. ri = o.indexOf(".");
  83699. var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres;
  83700. return hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres));
  83701. }
  83702. if((r = fmt.match(/^00,000\.([#0]*0)$/))) {
  83703. return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify(""+val).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad0(0,3-$$.length) : "") + $$; }) + "." + pad0(0,r[1].length);
  83704. }
  83705. switch(fmt) {
  83706. case "###,###":
  83707. case "##,###":
  83708. case "#,###": var x = commaify(""+aval); return x !== "0" ? sign + x : "";
  83709. default:
  83710. if(fmt.match(/\.[0#?]*$/)) return write_num_int(type, fmt.slice(0,fmt.lastIndexOf(".")), val) + hashq(fmt.slice(fmt.lastIndexOf(".")));
  83711. }
  83712. throw new Error("unsupported format |" + fmt + "|");
  83713. }
  83714. return function write_num(type, fmt, val) {
  83715. return (val|0) === val ? write_num_int(type, fmt, val) : write_num_flt(type, fmt, val);
  83716. };})();
  83717. function split_fmt(fmt) {
  83718. var out = [];
  83719. var in_str = false/*, cc*/;
  83720. for(var i = 0, j = 0; i < fmt.length; ++i) switch((/*cc=*/fmt.charCodeAt(i))) {
  83721. case 34: /* '"' */
  83722. in_str = !in_str; break;
  83723. case 95: case 42: case 92: /* '_' '*' '\\' */
  83724. ++i; break;
  83725. case 59: /* ';' */
  83726. out[out.length] = fmt.substr(j,i-j);
  83727. j = i+1;
  83728. }
  83729. out[out.length] = fmt.substr(j);
  83730. if(in_str === true) throw new Error("Format |" + fmt + "| unterminated string ");
  83731. return out;
  83732. }
  83733. SSF._split = split_fmt;
  83734. var abstime = /\[[HhMmSs]*\]/;
  83735. function fmt_is_date(fmt) {
  83736. var i = 0, /*cc = 0,*/ c = "", o = "";
  83737. while(i < fmt.length) {
  83738. switch((c = fmt.charAt(i))) {
  83739. case 'G': if(isgeneral(fmt, i)) i+= 6; i++; break;
  83740. case '"': for(;(/*cc=*/fmt.charCodeAt(++i)) !== 34 && i < fmt.length;) ++i; ++i; break;
  83741. case '\\': i+=2; break;
  83742. case '_': i+=2; break;
  83743. case '@': ++i; break;
  83744. case 'B': case 'b':
  83745. if(fmt.charAt(i+1) === "1" || fmt.charAt(i+1) === "2") return true;
  83746. /* falls through */
  83747. case 'M': case 'D': case 'Y': case 'H': case 'S': case 'E':
  83748. /* falls through */
  83749. case 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g': return true;
  83750. case 'A': case 'a':
  83751. if(fmt.substr(i, 3).toUpperCase() === "A/P") return true;
  83752. if(fmt.substr(i, 5).toUpperCase() === "AM/PM") return true;
  83753. ++i; break;
  83754. case '[':
  83755. o = c;
  83756. while(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i);
  83757. if(o.match(abstime)) return true;
  83758. break;
  83759. case '.':
  83760. /* falls through */
  83761. case '0': case '#':
  83762. while(i < fmt.length && ("0#?.,E+-%".indexOf(c=fmt.charAt(++i)) > -1 || (c=='\\' && fmt.charAt(i+1) == "-" && "0#".indexOf(fmt.charAt(i+2))>-1))){/* empty */}
  83763. break;
  83764. case '?': while(fmt.charAt(++i) === c){/* empty */} break;
  83765. case '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break;
  83766. case '(': case ')': ++i; break;
  83767. case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
  83768. while(i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1){/* empty */} break;
  83769. case ' ': ++i; break;
  83770. default: ++i; break;
  83771. }
  83772. }
  83773. return false;
  83774. }
  83775. SSF.is_date = fmt_is_date;
  83776. function eval_fmt(fmt, v, opts, flen) {
  83777. var out = [], o = "", i = 0, c = "", lst='t', dt, j, cc;
  83778. var hr='H';
  83779. /* Tokenize */
  83780. while(i < fmt.length) {
  83781. switch((c = fmt.charAt(i))) {
  83782. case 'G': /* General */
  83783. if(!isgeneral(fmt, i)) throw new Error('unrecognized character ' + c + ' in ' +fmt);
  83784. out[out.length] = {t:'G', v:'General'}; i+=7; break;
  83785. case '"': /* Literal text */
  83786. for(o="";(cc=fmt.charCodeAt(++i)) !== 34 && i < fmt.length;) o += String.fromCharCode(cc);
  83787. out[out.length] = {t:'t', v:o}; ++i; break;
  83788. case '\\': var w = fmt.charAt(++i), t = (w === "(" || w === ")") ? w : 't';
  83789. out[out.length] = {t:t, v:w}; ++i; break;
  83790. case '_': out[out.length] = {t:'t', v:" "}; i+=2; break;
  83791. case '@': /* Text Placeholder */
  83792. out[out.length] = {t:'T', v:v}; ++i; break;
  83793. case 'B': case 'b':
  83794. if(fmt.charAt(i+1) === "1" || fmt.charAt(i+1) === "2") {
  83795. if(dt==null) { dt=parse_date_code(v, opts, fmt.charAt(i+1) === "2"); if(dt==null) return ""; }
  83796. out[out.length] = {t:'X', v:fmt.substr(i,2)}; lst = c; i+=2; break;
  83797. }
  83798. /* falls through */
  83799. case 'M': case 'D': case 'Y': case 'H': case 'S': case 'E':
  83800. c = c.toLowerCase();
  83801. /* falls through */
  83802. case 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g':
  83803. if(v < 0) return "";
  83804. if(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return ""; }
  83805. o = c; while(++i < fmt.length && fmt.charAt(i).toLowerCase() === c) o+=c;
  83806. if(c === 'm' && lst.toLowerCase() === 'h') c = 'M';
  83807. if(c === 'h') c = hr;
  83808. out[out.length] = {t:c, v:o}; lst = c; break;
  83809. case 'A': case 'a':
  83810. var q={t:c, v:c};
  83811. if(dt==null) dt=parse_date_code(v, opts);
  83812. if(fmt.substr(i, 3).toUpperCase() === "A/P") { if(dt!=null) q.v = dt.H >= 12 ? "P" : "A"; q.t = 'T'; hr='h';i+=3;}
  83813. else if(fmt.substr(i,5).toUpperCase() === "AM/PM") { if(dt!=null) q.v = dt.H >= 12 ? "PM" : "AM"; q.t = 'T'; i+=5; hr='h'; }
  83814. else { q.t = "t"; ++i; }
  83815. if(dt==null && q.t === 'T') return "";
  83816. out[out.length] = q; lst = c; break;
  83817. case '[':
  83818. o = c;
  83819. while(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i);
  83820. if(o.slice(-1) !== ']') throw 'unterminated "[" block: |' + o + '|';
  83821. if(o.match(abstime)) {
  83822. if(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return ""; }
  83823. out[out.length] = {t:'Z', v:o.toLowerCase()};
  83824. lst = o.charAt(1);
  83825. } else if(o.indexOf("$") > -1) {
  83826. o = (o.match(/\$([^-\[\]]*)/)||[])[1]||"$";
  83827. if(!fmt_is_date(fmt)) out[out.length] = {t:'t',v:o};
  83828. }
  83829. break;
  83830. /* Numbers */
  83831. case '.':
  83832. if(dt != null) {
  83833. o = c; while(++i < fmt.length && (c=fmt.charAt(i)) === "0") o += c;
  83834. out[out.length] = {t:'s', v:o}; break;
  83835. }
  83836. /* falls through */
  83837. case '0': case '#':
  83838. o = c; while((++i < fmt.length && "0#?.,E+-%".indexOf(c=fmt.charAt(i)) > -1) || (c=='\\' && fmt.charAt(i+1) == "-" && i < fmt.length - 2 && "0#".indexOf(fmt.charAt(i+2))>-1)) o += c;
  83839. out[out.length] = {t:'n', v:o}; break;
  83840. case '?':
  83841. o = c; while(fmt.charAt(++i) === c) o+=c;
  83842. out[out.length] = {t:c, v:o}; lst = c; break;
  83843. case '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break; // **
  83844. case '(': case ')': out[out.length] = {t:(flen===1?'t':c), v:c}; ++i; break;
  83845. case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
  83846. o = c; while(i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1) o+=fmt.charAt(i);
  83847. out[out.length] = {t:'D', v:o}; break;
  83848. case ' ': out[out.length] = {t:c, v:c}; ++i; break;
  83849. default:
  83850. if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c) === -1) throw new Error('unrecognized character ' + c + ' in ' + fmt);
  83851. out[out.length] = {t:'t', v:c}; ++i; break;
  83852. }
  83853. }
  83854. var bt = 0, ss0 = 0, ssm;
  83855. for(i=out.length-1, lst='t'; i >= 0; --i) {
  83856. switch(out[i].t) {
  83857. case 'h': case 'H': out[i].t = hr; lst='h'; if(bt < 1) bt = 1; break;
  83858. case 's':
  83859. if((ssm=out[i].v.match(/\.0+$/))) ss0=Math.max(ss0,ssm[0].length-1);
  83860. if(bt < 3) bt = 3;
  83861. /* falls through */
  83862. case 'd': case 'y': case 'M': case 'e': lst=out[i].t; break;
  83863. case 'm': if(lst === 's') { out[i].t = 'M'; if(bt < 2) bt = 2; } break;
  83864. case 'X': /*if(out[i].v === "B2");*/
  83865. break;
  83866. case 'Z':
  83867. if(bt < 1 && out[i].v.match(/[Hh]/)) bt = 1;
  83868. if(bt < 2 && out[i].v.match(/[Mm]/)) bt = 2;
  83869. if(bt < 3 && out[i].v.match(/[Ss]/)) bt = 3;
  83870. }
  83871. }
  83872. switch(bt) {
  83873. case 0: break;
  83874. case 1:
  83875. if(dt.u >= 0.5) { dt.u = 0; ++dt.S; }
  83876. if(dt.S >= 60) { dt.S = 0; ++dt.M; }
  83877. if(dt.M >= 60) { dt.M = 0; ++dt.H; }
  83878. break;
  83879. case 2:
  83880. if(dt.u >= 0.5) { dt.u = 0; ++dt.S; }
  83881. if(dt.S >= 60) { dt.S = 0; ++dt.M; }
  83882. break;
  83883. }
  83884. /* replace fields */
  83885. var nstr = "", jj;
  83886. for(i=0; i < out.length; ++i) {
  83887. switch(out[i].t) {
  83888. case 't': case 'T': case ' ': case 'D': break;
  83889. case 'X': out[i].v = ""; out[i].t = ";"; break;
  83890. case 'd': case 'm': case 'y': case 'h': case 'H': case 'M': case 's': case 'e': case 'b': case 'Z':
  83891. out[i].v = write_date(out[i].t.charCodeAt(0), out[i].v, dt, ss0);
  83892. out[i].t = 't'; break;
  83893. case 'n': case '(': case '?':
  83894. jj = i+1;
  83895. while(out[jj] != null && (
  83896. (c=out[jj].t) === "?" || c === "D" ||
  83897. ((c === " " || c === "t") && out[jj+1] != null && (out[jj+1].t === '?' || out[jj+1].t === "t" && out[jj+1].v === '/')) ||
  83898. (out[i].t === '(' && (c === ' ' || c === 'n' || c === ')')) ||
  83899. (c === 't' && (out[jj].v === '/' || out[jj].v === ' ' && out[jj+1] != null && out[jj+1].t == '?'))
  83900. )) {
  83901. out[i].v += out[jj].v;
  83902. out[jj] = {v:"", t:";"}; ++jj;
  83903. }
  83904. nstr += out[i].v;
  83905. i = jj-1; break;
  83906. case 'G': out[i].t = 't'; out[i].v = general_fmt(v,opts); break;
  83907. }
  83908. }
  83909. var vv = "", myv, ostr;
  83910. if(nstr.length > 0) {
  83911. if(nstr.charCodeAt(0) == 40) /* '(' */ {
  83912. myv = (v<0&&nstr.charCodeAt(0) === 45 ? -v : v);
  83913. ostr = write_num('(', nstr, myv);
  83914. } else {
  83915. myv = (v<0 && flen > 1 ? -v : v);
  83916. ostr = write_num('n', nstr, myv);
  83917. if(myv < 0 && out[0] && out[0].t == 't') {
  83918. ostr = ostr.substr(1);
  83919. out[0].v = "-" + out[0].v;
  83920. }
  83921. }
  83922. jj=ostr.length-1;
  83923. var decpt = out.length;
  83924. for(i=0; i < out.length; ++i) if(out[i] != null && out[i].t != 't' && out[i].v.indexOf(".") > -1) { decpt = i; break; }
  83925. var lasti=out.length;
  83926. if(decpt === out.length && ostr.indexOf("E") === -1) {
  83927. for(i=out.length-1; i>= 0;--i) {
  83928. if(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;
  83929. if(jj>=out[i].v.length-1) { jj -= out[i].v.length; out[i].v = ostr.substr(jj+1, out[i].v.length); }
  83930. else if(jj < 0) out[i].v = "";
  83931. else { out[i].v = ostr.substr(0, jj+1); jj = -1; }
  83932. out[i].t = 't';
  83933. lasti = i;
  83934. }
  83935. if(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v;
  83936. }
  83937. else if(decpt !== out.length && ostr.indexOf("E") === -1) {
  83938. jj = ostr.indexOf(".")-1;
  83939. for(i=decpt; i>= 0; --i) {
  83940. if(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;
  83941. j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")-1:out[i].v.length-1;
  83942. vv = out[i].v.substr(j+1);
  83943. for(; j>=0; --j) {
  83944. if(jj>=0 && (out[i].v.charAt(j) === "0" || out[i].v.charAt(j) === "#")) vv = ostr.charAt(jj--) + vv;
  83945. }
  83946. out[i].v = vv;
  83947. out[i].t = 't';
  83948. lasti = i;
  83949. }
  83950. if(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v;
  83951. jj = ostr.indexOf(".")+1;
  83952. for(i=decpt; i<out.length; ++i) {
  83953. if(out[i] == null || ('n?('.indexOf(out[i].t) === -1 && i !== decpt)) continue;
  83954. j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")+1:0;
  83955. vv = out[i].v.substr(0,j);
  83956. for(; j<out[i].v.length; ++j) {
  83957. if(jj<ostr.length) vv += ostr.charAt(jj++);
  83958. }
  83959. out[i].v = vv;
  83960. out[i].t = 't';
  83961. lasti = i;
  83962. }
  83963. }
  83964. }
  83965. for(i=0; i<out.length; ++i) if(out[i] != null && 'n(?'.indexOf(out[i].t)>-1) {
  83966. myv = (flen >1 && v < 0 && i>0 && out[i-1].v === "-" ? -v:v);
  83967. out[i].v = write_num(out[i].t, out[i].v, myv);
  83968. out[i].t = 't';
  83969. }
  83970. var retval = "";
  83971. for(i=0; i !== out.length; ++i) if(out[i] != null) retval += out[i].v;
  83972. return retval;
  83973. }
  83974. SSF._eval = eval_fmt;
  83975. var cfregex = /\[[=<>]/;
  83976. var cfregex2 = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
  83977. function chkcond(v, rr) {
  83978. if(rr == null) return false;
  83979. var thresh = parseFloat(rr[2]);
  83980. switch(rr[1]) {
  83981. case "=": if(v == thresh) return true; break;
  83982. case ">": if(v > thresh) return true; break;
  83983. case "<": if(v < thresh) return true; break;
  83984. case "<>": if(v != thresh) return true; break;
  83985. case ">=": if(v >= thresh) return true; break;
  83986. case "<=": if(v <= thresh) return true; break;
  83987. }
  83988. return false;
  83989. }
  83990. function choose_fmt(f, v) {
  83991. var fmt = split_fmt(f);
  83992. var l = fmt.length, lat = fmt[l-1].indexOf("@");
  83993. if(l<4 && lat>-1) --l;
  83994. if(fmt.length > 4) throw new Error("cannot find right format for |" + fmt.join("|") + "|");
  83995. if(typeof v !== "number") return [4, fmt.length === 4 || lat>-1?fmt[fmt.length-1]:"@"];
  83996. switch(fmt.length) {
  83997. case 1: fmt = lat>-1 ? ["General", "General", "General", fmt[0]] : [fmt[0], fmt[0], fmt[0], "@"]; break;
  83998. case 2: fmt = lat>-1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], "@"]; break;
  83999. case 3: fmt = lat>-1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], "@"]; break;
  84000. case 4: break;
  84001. }
  84002. var ff = v > 0 ? fmt[0] : v < 0 ? fmt[1] : fmt[2];
  84003. if(fmt[0].indexOf("[") === -1 && fmt[1].indexOf("[") === -1) return [l, ff];
  84004. if(fmt[0].match(cfregex) != null || fmt[1].match(cfregex) != null) {
  84005. var m1 = fmt[0].match(cfregex2);
  84006. var m2 = fmt[1].match(cfregex2);
  84007. return chkcond(v, m1) ? [l, fmt[0]] : chkcond(v, m2) ? [l, fmt[1]] : [l, fmt[m1 != null && m2 != null ? 2 : 1]];
  84008. }
  84009. return [l, ff];
  84010. }
  84011. function format(fmt,v,o) {
  84012. if(o == null) o = {};
  84013. var sfmt = "";
  84014. switch(typeof fmt) {
  84015. case "string":
  84016. if(fmt == "m/d/yy" && o.dateNF) sfmt = o.dateNF;
  84017. else sfmt = fmt;
  84018. break;
  84019. case "number":
  84020. if(fmt == 14 && o.dateNF) sfmt = o.dateNF;
  84021. else sfmt = (o.table != null ? (o.table) : table_fmt)[fmt];
  84022. break;
  84023. }
  84024. if(isgeneral(sfmt,0)) return general_fmt(v, o);
  84025. if(v instanceof Date) v = datenum_local(v, o.date1904);
  84026. var f = choose_fmt(sfmt, v);
  84027. if(isgeneral(f[1])) return general_fmt(v, o);
  84028. if(v === true) v = "TRUE"; else if(v === false) v = "FALSE";
  84029. else if(v === "" || v == null) return "";
  84030. return eval_fmt(f[1], v, o, f[0]);
  84031. }
  84032. function load_entry(fmt, idx) {
  84033. if(typeof idx != 'number') {
  84034. idx = +idx || -1;
  84035. for(var i = 0; i < 0x0188; ++i) {
  84036. if(table_fmt[i] == undefined) { if(idx < 0) idx = i; continue; }
  84037. if(table_fmt[i] == fmt) { idx = i; break; }
  84038. }
  84039. if(idx < 0) idx = 0x187;
  84040. }
  84041. table_fmt[idx] = fmt;
  84042. return idx;
  84043. }
  84044. SSF.load = load_entry;
  84045. SSF._table = table_fmt;
  84046. SSF.get_table = function get_table() { return table_fmt; };
  84047. SSF.load_table = function load_table(tbl) {
  84048. for(var i=0; i!=0x0188; ++i)
  84049. if(tbl[i] !== undefined) load_entry(tbl[i], i);
  84050. };
  84051. SSF.init_table = init_table;
  84052. SSF.format = format;
  84053. };
  84054. make_ssf(SSF);
  84055. /* map from xlml named formats to SSF TODO: localize */
  84056. var XLMLFormatMap/*{[string]:string}*/ = ({
  84057. "General Number": "General",
  84058. "General Date": SSF._table[22],
  84059. "Long Date": "dddd, mmmm dd, yyyy",
  84060. "Medium Date": SSF._table[15],
  84061. "Short Date": SSF._table[14],
  84062. "Long Time": SSF._table[19],
  84063. "Medium Time": SSF._table[18],
  84064. "Short Time": SSF._table[20],
  84065. "Currency": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
  84066. "Fixed": SSF._table[2],
  84067. "Standard": SSF._table[4],
  84068. "Percent": SSF._table[10],
  84069. "Scientific": SSF._table[11],
  84070. "Yes/No": '"Yes";"Yes";"No";@',
  84071. "True/False": '"True";"True";"False";@',
  84072. "On/Off": '"Yes";"Yes";"No";@'
  84073. });
  84074. var SSFImplicit/*{[number]:string}*/ = ({
  84075. "5": '"$"#,##0_);\\("$"#,##0\\)',
  84076. "6": '"$"#,##0_);[Red]\\("$"#,##0\\)',
  84077. "7": '"$"#,##0.00_);\\("$"#,##0.00\\)',
  84078. "8": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
  84079. "23": 'General', "24": 'General', "25": 'General', "26": 'General',
  84080. "27": 'm/d/yy', "28": 'm/d/yy', "29": 'm/d/yy', "30": 'm/d/yy', "31": 'm/d/yy',
  84081. "32": 'h:mm:ss', "33": 'h:mm:ss', "34": 'h:mm:ss', "35": 'h:mm:ss',
  84082. "36": 'm/d/yy',
  84083. "41": '_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)',
  84084. "42": '_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)',
  84085. "43": '_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)',
  84086. "44": '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)',
  84087. "50": 'm/d/yy', "51": 'm/d/yy', "52": 'm/d/yy', "53": 'm/d/yy', "54": 'm/d/yy',
  84088. "55": 'm/d/yy', "56": 'm/d/yy', "57": 'm/d/yy', "58": 'm/d/yy',
  84089. "59": '0',
  84090. "60": '0.00',
  84091. "61": '#,##0',
  84092. "62": '#,##0.00',
  84093. "63": '"$"#,##0_);\\("$"#,##0\\)',
  84094. "64": '"$"#,##0_);[Red]\\("$"#,##0\\)',
  84095. "65": '"$"#,##0.00_);\\("$"#,##0.00\\)',
  84096. "66": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
  84097. "67": '0%',
  84098. "68": '0.00%',
  84099. "69": '# ?/?',
  84100. "70": '# ??/??',
  84101. "71": 'm/d/yy',
  84102. "72": 'm/d/yy',
  84103. "73": 'd-mmm-yy',
  84104. "74": 'd-mmm',
  84105. "75": 'mmm-yy',
  84106. "76": 'h:mm',
  84107. "77": 'h:mm:ss',
  84108. "78": 'm/d/yy h:mm',
  84109. "79": 'mm:ss',
  84110. "80": '[h]:mm:ss',
  84111. "81": 'mmss.0'
  84112. });
  84113. /* dateNF parse TODO: move to SSF */
  84114. var dateNFregex = /[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;
  84115. function dateNF_regex(dateNF) {
  84116. var fmt = typeof dateNF == "number" ? SSF._table[dateNF] : dateNF;
  84117. fmt = fmt.replace(dateNFregex, "(\\d+)");
  84118. return new RegExp("^" + fmt + "$");
  84119. }
  84120. function dateNF_fix(str, dateNF, match) {
  84121. var Y = -1, m = -1, d = -1, H = -1, M = -1, S = -1;
  84122. (dateNF.match(dateNFregex)||[]).forEach(function(n, i) {
  84123. var v = parseInt(match[i+1], 10);
  84124. switch(n.toLowerCase().charAt(0)) {
  84125. case 'y': Y = v; break; case 'd': d = v; break;
  84126. case 'h': H = v; break; case 's': S = v; break;
  84127. case 'm': if(H >= 0) M = v; else m = v; break;
  84128. }
  84129. });
  84130. if(S >= 0 && M == -1 && m >= 0) { M = m; m = -1; }
  84131. var datestr = (("" + (Y>=0?Y: new Date().getFullYear())).slice(-4) + "-" + ("00" + (m>=1?m:1)).slice(-2) + "-" + ("00" + (d>=1?d:1)).slice(-2));
  84132. if(datestr.length == 7) datestr = "0" + datestr;
  84133. if(datestr.length == 8) datestr = "20" + datestr;
  84134. var timestr = (("00" + (H>=0?H:0)).slice(-2) + ":" + ("00" + (M>=0?M:0)).slice(-2) + ":" + ("00" + (S>=0?S:0)).slice(-2));
  84135. if(H == -1 && M == -1 && S == -1) return datestr;
  84136. if(Y == -1 && m == -1 && d == -1) return timestr;
  84137. return datestr + "T" + timestr;
  84138. }
  84139. var DO_NOT_EXPORT_CFB = true;
  84140. /* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */
  84141. /* vim: set ts=2: */
  84142. /*jshint eqnull:true */
  84143. /*exported CFB */
  84144. /*global module, require:false, process:false, Buffer:false, Uint8Array:false, Uint16Array:false */
  84145. /* crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
  84146. /* vim: set ts=2: */
  84147. /*exported CRC32 */
  84148. var CRC32;
  84149. (function (factory) {
  84150. /*jshint ignore:start */
  84151. /*eslint-disable */
  84152. factory(CRC32 = {});
  84153. /*eslint-enable */
  84154. /*jshint ignore:end */
  84155. }(function(CRC32) {
  84156. CRC32.version = '1.2.0';
  84157. /* see perf/crc32table.js */
  84158. /*global Int32Array */
  84159. function signed_crc_table() {
  84160. var c = 0, table = new Array(256);
  84161. for(var n =0; n != 256; ++n){
  84162. c = n;
  84163. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84164. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84165. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84166. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84167. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84168. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84169. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84170. c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
  84171. table[n] = c;
  84172. }
  84173. return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
  84174. }
  84175. var T = signed_crc_table();
  84176. function crc32_bstr(bstr, seed) {
  84177. var C = seed ^ -1, L = bstr.length - 1;
  84178. for(var i = 0; i < L;) {
  84179. C = (C>>>8) ^ T[(C^bstr.charCodeAt(i++))&0xFF];
  84180. C = (C>>>8) ^ T[(C^bstr.charCodeAt(i++))&0xFF];
  84181. }
  84182. if(i === L) C = (C>>>8) ^ T[(C ^ bstr.charCodeAt(i))&0xFF];
  84183. return C ^ -1;
  84184. }
  84185. function crc32_buf(buf, seed) {
  84186. if(buf.length > 10000) return crc32_buf_8(buf, seed);
  84187. var C = seed ^ -1, L = buf.length - 3;
  84188. for(var i = 0; i < L;) {
  84189. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84190. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84191. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84192. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84193. }
  84194. while(i < L+3) C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84195. return C ^ -1;
  84196. }
  84197. function crc32_buf_8(buf, seed) {
  84198. var C = seed ^ -1, L = buf.length - 7;
  84199. for(var i = 0; i < L;) {
  84200. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84201. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84202. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84203. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84204. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84205. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84206. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84207. C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84208. }
  84209. while(i < L+7) C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
  84210. return C ^ -1;
  84211. }
  84212. function crc32_str(str, seed) {
  84213. var C = seed ^ -1;
  84214. for(var i = 0, L=str.length, c, d; i < L;) {
  84215. c = str.charCodeAt(i++);
  84216. if(c < 0x80) {
  84217. C = (C>>>8) ^ T[(C ^ c)&0xFF];
  84218. } else if(c < 0x800) {
  84219. C = (C>>>8) ^ T[(C ^ (192|((c>>6)&31)))&0xFF];
  84220. C = (C>>>8) ^ T[(C ^ (128|(c&63)))&0xFF];
  84221. } else if(c >= 0xD800 && c < 0xE000) {
  84222. c = (c&1023)+64; d = str.charCodeAt(i++)&1023;
  84223. C = (C>>>8) ^ T[(C ^ (240|((c>>8)&7)))&0xFF];
  84224. C = (C>>>8) ^ T[(C ^ (128|((c>>2)&63)))&0xFF];
  84225. C = (C>>>8) ^ T[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];
  84226. C = (C>>>8) ^ T[(C ^ (128|(d&63)))&0xFF];
  84227. } else {
  84228. C = (C>>>8) ^ T[(C ^ (224|((c>>12)&15)))&0xFF];
  84229. C = (C>>>8) ^ T[(C ^ (128|((c>>6)&63)))&0xFF];
  84230. C = (C>>>8) ^ T[(C ^ (128|(c&63)))&0xFF];
  84231. }
  84232. }
  84233. return C ^ -1;
  84234. }
  84235. CRC32.table = T;
  84236. CRC32.bstr = crc32_bstr;
  84237. CRC32.buf = crc32_buf;
  84238. CRC32.str = crc32_str;
  84239. }));
  84240. /* [MS-CFB] v20171201 */
  84241. var CFB = (function _CFB(){
  84242. var exports = {};
  84243. exports.version = '1.1.3';
  84244. /* [MS-CFB] 2.6.4 */
  84245. function namecmp(l, r) {
  84246. var L = l.split("/"), R = r.split("/");
  84247. for(var i = 0, c = 0, Z = Math.min(L.length, R.length); i < Z; ++i) {
  84248. if((c = L[i].length - R[i].length)) return c;
  84249. if(L[i] != R[i]) return L[i] < R[i] ? -1 : 1;
  84250. }
  84251. return L.length - R.length;
  84252. }
  84253. function dirname(p) {
  84254. if(p.charAt(p.length - 1) == "/") return (p.slice(0,-1).indexOf("/") === -1) ? p : dirname(p.slice(0, -1));
  84255. var c = p.lastIndexOf("/");
  84256. return (c === -1) ? p : p.slice(0, c+1);
  84257. }
  84258. function filename(p) {
  84259. if(p.charAt(p.length - 1) == "/") return filename(p.slice(0, -1));
  84260. var c = p.lastIndexOf("/");
  84261. return (c === -1) ? p : p.slice(c+1);
  84262. }
  84263. /* -------------------------------------------------------------------------- */
  84264. /* DOS Date format:
  84265. high|YYYYYYYm.mmmddddd.HHHHHMMM.MMMSSSSS|low
  84266. add 1980 to stored year
  84267. stored second should be doubled
  84268. */
  84269. /* write JS date to buf as a DOS date */
  84270. function write_dos_date(buf, date) {
  84271. if(typeof date === "string") date = new Date(date);
  84272. var hms = date.getHours();
  84273. hms = hms << 6 | date.getMinutes();
  84274. hms = hms << 5 | (date.getSeconds()>>>1);
  84275. buf.write_shift(2, hms);
  84276. var ymd = (date.getFullYear() - 1980);
  84277. ymd = ymd << 4 | (date.getMonth()+1);
  84278. ymd = ymd << 5 | date.getDate();
  84279. buf.write_shift(2, ymd);
  84280. }
  84281. /* read four bytes from buf and interpret as a DOS date */
  84282. function parse_dos_date(buf) {
  84283. var hms = buf.read_shift(2) & 0xFFFF;
  84284. var ymd = buf.read_shift(2) & 0xFFFF;
  84285. var val = new Date();
  84286. var d = ymd & 0x1F; ymd >>>= 5;
  84287. var m = ymd & 0x0F; ymd >>>= 4;
  84288. val.setMilliseconds(0);
  84289. val.setFullYear(ymd + 1980);
  84290. val.setMonth(m-1);
  84291. val.setDate(d);
  84292. var S = hms & 0x1F; hms >>>= 5;
  84293. var M = hms & 0x3F; hms >>>= 6;
  84294. val.setHours(hms);
  84295. val.setMinutes(M);
  84296. val.setSeconds(S<<1);
  84297. return val;
  84298. }
  84299. function parse_extra_field(blob) {
  84300. prep_blob(blob, 0);
  84301. var o = {};
  84302. var flags = 0;
  84303. while(blob.l <= blob.length - 4) {
  84304. var type = blob.read_shift(2);
  84305. var sz = blob.read_shift(2), tgt = blob.l + sz;
  84306. var p = {};
  84307. switch(type) {
  84308. /* UNIX-style Timestamps */
  84309. case 0x5455: {
  84310. flags = blob.read_shift(1);
  84311. if(flags & 1) p.mtime = blob.read_shift(4);
  84312. /* for some reason, CD flag corresponds to LFH */
  84313. if(sz > 5) {
  84314. if(flags & 2) p.atime = blob.read_shift(4);
  84315. if(flags & 4) p.ctime = blob.read_shift(4);
  84316. }
  84317. if(p.mtime) p.mt = new Date(p.mtime*1000);
  84318. }
  84319. break;
  84320. }
  84321. blob.l = tgt;
  84322. o[type] = p;
  84323. }
  84324. return o;
  84325. }
  84326. var fs;
  84327. function get_fs() { return fs || (fs = __webpack_require__(/*! fs */ 1)); }
  84328. function parse(file, options) {
  84329. if(file[0] == 0x50 && file[1] == 0x4b) return parse_zip(file, options);
  84330. if(file.length < 512) throw new Error("CFB file size " + file.length + " < 512");
  84331. var mver = 3;
  84332. var ssz = 512;
  84333. var nmfs = 0; // number of mini FAT sectors
  84334. var difat_sec_cnt = 0;
  84335. var dir_start = 0;
  84336. var minifat_start = 0;
  84337. var difat_start = 0;
  84338. var fat_addrs = []; // locations of FAT sectors
  84339. /* [MS-CFB] 2.2 Compound File Header */
  84340. var blob = file.slice(0,512);
  84341. prep_blob(blob, 0);
  84342. /* major version */
  84343. var mv = check_get_mver(blob);
  84344. mver = mv[0];
  84345. switch(mver) {
  84346. case 3: ssz = 512; break; case 4: ssz = 4096; break;
  84347. case 0: if(mv[1] == 0) return parse_zip(file, options);
  84348. /* falls through */
  84349. default: throw new Error("Major Version: Expected 3 or 4 saw " + mver);
  84350. }
  84351. /* reprocess header */
  84352. if(ssz !== 512) { blob = file.slice(0,ssz); prep_blob(blob, 28 /* blob.l */); }
  84353. /* Save header for final object */
  84354. var header = file.slice(0,ssz);
  84355. check_shifts(blob, mver);
  84356. // Number of Directory Sectors
  84357. var dir_cnt = blob.read_shift(4, 'i');
  84358. if(mver === 3 && dir_cnt !== 0) throw new Error('# Directory Sectors: Expected 0 saw ' + dir_cnt);
  84359. // Number of FAT Sectors
  84360. blob.l += 4;
  84361. // First Directory Sector Location
  84362. dir_start = blob.read_shift(4, 'i');
  84363. // Transaction Signature
  84364. blob.l += 4;
  84365. // Mini Stream Cutoff Size
  84366. blob.chk('00100000', 'Mini Stream Cutoff Size: ');
  84367. // First Mini FAT Sector Location
  84368. minifat_start = blob.read_shift(4, 'i');
  84369. // Number of Mini FAT Sectors
  84370. nmfs = blob.read_shift(4, 'i');
  84371. // First DIFAT sector location
  84372. difat_start = blob.read_shift(4, 'i');
  84373. // Number of DIFAT Sectors
  84374. difat_sec_cnt = blob.read_shift(4, 'i');
  84375. // Grab FAT Sector Locations
  84376. for(var q = -1, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */
  84377. q = blob.read_shift(4, 'i');
  84378. if(q<0) break;
  84379. fat_addrs[j] = q;
  84380. }
  84381. /** Break the file up into sectors */
  84382. var sectors = sectorify(file, ssz);
  84383. sleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs);
  84384. /** Chains */
  84385. var sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);
  84386. sector_list[dir_start].name = "!Directory";
  84387. if(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = "!MiniFAT";
  84388. sector_list[fat_addrs[0]].name = "!FAT";
  84389. sector_list.fat_addrs = fat_addrs;
  84390. sector_list.ssz = ssz;
  84391. /* [MS-CFB] 2.6.1 Compound File Directory Entry */
  84392. var files = {}, Paths = [], FileIndex = [], FullPaths = [];
  84393. read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);
  84394. build_full_paths(FileIndex, FullPaths, Paths);
  84395. Paths.shift();
  84396. var o = {
  84397. FileIndex: FileIndex,
  84398. FullPaths: FullPaths
  84399. };
  84400. // $FlowIgnore
  84401. if(options && options.raw) o.raw = {header: header, sectors: sectors};
  84402. return o;
  84403. } // parse
  84404. /* [MS-CFB] 2.2 Compound File Header -- read up to major version */
  84405. function check_get_mver(blob) {
  84406. if(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];
  84407. // header signature 8
  84408. blob.chk(HEADER_SIGNATURE, 'Header Signature: ');
  84409. // clsid 16
  84410. //blob.chk(HEADER_CLSID, 'CLSID: ');
  84411. blob.l += 16;
  84412. // minor version 2
  84413. var mver = blob.read_shift(2, 'u');
  84414. return [blob.read_shift(2,'u'), mver];
  84415. }
  84416. function check_shifts(blob, mver) {
  84417. var shift = 0x09;
  84418. // Byte Order
  84419. //blob.chk('feff', 'Byte Order: '); // note: some writers put 0xffff
  84420. blob.l += 2;
  84421. // Sector Shift
  84422. switch((shift = blob.read_shift(2))) {
  84423. case 0x09: if(mver != 3) throw new Error('Sector Shift: Expected 9 saw ' + shift); break;
  84424. case 0x0c: if(mver != 4) throw new Error('Sector Shift: Expected 12 saw ' + shift); break;
  84425. default: throw new Error('Sector Shift: Expected 9 or 12 saw ' + shift);
  84426. }
  84427. // Mini Sector Shift
  84428. blob.chk('0600', 'Mini Sector Shift: ');
  84429. // Reserved
  84430. blob.chk('000000000000', 'Reserved: ');
  84431. }
  84432. /** Break the file up into sectors */
  84433. function sectorify(file, ssz) {
  84434. var nsectors = Math.ceil(file.length/ssz)-1;
  84435. var sectors = [];
  84436. for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);
  84437. sectors[nsectors-1] = file.slice(nsectors*ssz);
  84438. return sectors;
  84439. }
  84440. /* [MS-CFB] 2.6.4 Red-Black Tree */
  84441. function build_full_paths(FI, FP, Paths) {
  84442. var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;
  84443. var dad = [], q = [];
  84444. for(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }
  84445. for(; j < q.length; ++j) {
  84446. i = q[j];
  84447. L = FI[i].L; R = FI[i].R; C = FI[i].C;
  84448. if(dad[i] === i) {
  84449. if(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];
  84450. if(R !== -1 && dad[R] !== R) dad[i] = dad[R];
  84451. }
  84452. if(C !== -1 /*NOSTREAM*/) dad[C] = i;
  84453. if(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }
  84454. if(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }
  84455. }
  84456. for(i=1; i < pl; ++i) if(dad[i] === i) {
  84457. if(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];
  84458. else if(L !== -1 && dad[L] !== L) dad[i] = dad[L];
  84459. }
  84460. for(i=1; i < pl; ++i) {
  84461. if(FI[i].type === 0 /* unknown */) continue;
  84462. j = i;
  84463. if(j != dad[j]) do {
  84464. j = dad[j];
  84465. FP[i] = FP[j] + "/" + FP[i];
  84466. } while (j !== 0 && -1 !== dad[j] && j != dad[j]);
  84467. dad[i] = -1;
  84468. }
  84469. FP[0] += "/";
  84470. for(i=1; i < pl; ++i) {
  84471. if(FI[i].type !== 2 /* stream */) FP[i] += "/";
  84472. }
  84473. }
  84474. function get_mfat_entry(entry, payload, mini) {
  84475. var start = entry.start, size = entry.size;
  84476. //return (payload.slice(start*MSSZ, start*MSSZ + size));
  84477. var o = [];
  84478. var idx = start;
  84479. while(mini && size > 0 && idx >= 0) {
  84480. o.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));
  84481. size -= MSSZ;
  84482. idx = __readInt32LE(mini, idx * 4);
  84483. }
  84484. if(o.length === 0) return (new_buf(0));
  84485. return (bconcat(o).slice(0, entry.size));
  84486. }
  84487. /** Chase down the rest of the DIFAT chain to build a comprehensive list
  84488. DIFAT chains by storing the next sector number as the last 32 bits */
  84489. function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
  84490. var q = ENDOFCHAIN;
  84491. if(idx === ENDOFCHAIN) {
  84492. if(cnt !== 0) throw new Error("DIFAT chain shorter than expected");
  84493. } else if(idx !== -1 /*FREESECT*/) {
  84494. var sector = sectors[idx], m = (ssz>>>2)-1;
  84495. if(!sector) return;
  84496. for(var i = 0; i < m; ++i) {
  84497. if((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;
  84498. fat_addrs.push(q);
  84499. }
  84500. sleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);
  84501. }
  84502. }
  84503. /** Follow the linked list of sectors for a given starting point */
  84504. function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
  84505. var buf = [], buf_chain = [];
  84506. if(!chkd) chkd = [];
  84507. var modulus = ssz - 1, j = 0, jj = 0;
  84508. for(j=start; j>=0;) {
  84509. chkd[j] = true;
  84510. buf[buf.length] = j;
  84511. buf_chain.push(sectors[j]);
  84512. var addr = fat_addrs[Math.floor(j*4/ssz)];
  84513. jj = ((j*4) & modulus);
  84514. if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
  84515. if(!sectors[addr]) break;
  84516. j = __readInt32LE(sectors[addr], jj);
  84517. }
  84518. return {nodes: buf, data:__toBuffer([buf_chain])};
  84519. }
  84520. /** Chase down the sector linked lists */
  84521. function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
  84522. var sl = sectors.length, sector_list = ([]);
  84523. var chkd = [], buf = [], buf_chain = [];
  84524. var modulus = ssz - 1, i=0, j=0, k=0, jj=0;
  84525. for(i=0; i < sl; ++i) {
  84526. buf = ([]);
  84527. k = (i + dir_start); if(k >= sl) k-=sl;
  84528. if(chkd[k]) continue;
  84529. buf_chain = [];
  84530. for(j=k; j>=0;) {
  84531. chkd[j] = true;
  84532. buf[buf.length] = j;
  84533. buf_chain.push(sectors[j]);
  84534. var addr = fat_addrs[Math.floor(j*4/ssz)];
  84535. jj = ((j*4) & modulus);
  84536. if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
  84537. if(!sectors[addr]) break;
  84538. j = __readInt32LE(sectors[addr], jj);
  84539. }
  84540. sector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});
  84541. }
  84542. return sector_list;
  84543. }
  84544. /* [MS-CFB] 2.6.1 Compound File Directory Entry */
  84545. function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {
  84546. var minifat_store = 0, pl = (Paths.length?2:0);
  84547. var sector = sector_list[dir_start].data;
  84548. var i = 0, namelen = 0, name;
  84549. for(; i < sector.length; i+= 128) {
  84550. var blob = sector.slice(i, i+128);
  84551. prep_blob(blob, 64);
  84552. namelen = blob.read_shift(2);
  84553. name = __utf16le(blob,0,namelen-pl);
  84554. Paths.push(name);
  84555. var o = ({
  84556. name: name,
  84557. type: blob.read_shift(1),
  84558. color: blob.read_shift(1),
  84559. L: blob.read_shift(4, 'i'),
  84560. R: blob.read_shift(4, 'i'),
  84561. C: blob.read_shift(4, 'i'),
  84562. clsid: blob.read_shift(16),
  84563. state: blob.read_shift(4, 'i'),
  84564. start: 0,
  84565. size: 0
  84566. });
  84567. var ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
  84568. if(ctime !== 0) o.ct = read_date(blob, blob.l-8);
  84569. var mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
  84570. if(mtime !== 0) o.mt = read_date(blob, blob.l-8);
  84571. o.start = blob.read_shift(4, 'i');
  84572. o.size = blob.read_shift(4, 'i');
  84573. if(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = ""; }
  84574. if(o.type === 5) { /* root */
  84575. minifat_store = o.start;
  84576. if(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = "!StreamData";
  84577. /*minifat_size = o.size;*/
  84578. } else if(o.size >= 4096 /* MSCSZ */) {
  84579. o.storage = 'fat';
  84580. if(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);
  84581. sector_list[o.start].name = o.name;
  84582. o.content = (sector_list[o.start].data.slice(0,o.size));
  84583. } else {
  84584. o.storage = 'minifat';
  84585. if(o.size < 0) o.size = 0;
  84586. else if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {
  84587. o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);
  84588. }
  84589. }
  84590. if(o.content) prep_blob(o.content, 0);
  84591. files[name] = o;
  84592. FileIndex.push(o);
  84593. }
  84594. }
  84595. function read_date(blob, offset) {
  84596. return new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000);
  84597. }
  84598. function read_file(filename, options) {
  84599. get_fs();
  84600. return parse(fs.readFileSync(filename), options);
  84601. }
  84602. function read(blob, options) {
  84603. switch(options && options.type || "base64") {
  84604. case "file": return read_file(blob, options);
  84605. case "base64": return parse(s2a(Base64.decode(blob)), options);
  84606. case "binary": return parse(s2a(blob), options);
  84607. }
  84608. return parse(blob, options);
  84609. }
  84610. function init_cfb(cfb, opts) {
  84611. var o = opts || {}, root = o.root || "Root Entry";
  84612. if(!cfb.FullPaths) cfb.FullPaths = [];
  84613. if(!cfb.FileIndex) cfb.FileIndex = [];
  84614. if(cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error("inconsistent CFB structure");
  84615. if(cfb.FullPaths.length === 0) {
  84616. cfb.FullPaths[0] = root + "/";
  84617. cfb.FileIndex[0] = ({ name: root, type: 5 });
  84618. }
  84619. if(o.CLSID) cfb.FileIndex[0].clsid = o.CLSID;
  84620. seed_cfb(cfb);
  84621. }
  84622. function seed_cfb(cfb) {
  84623. var nm = "\u0001Sh33tJ5";
  84624. if(CFB.find(cfb, "/" + nm)) return;
  84625. var p = new_buf(4); p[0] = 55; p[1] = p[3] = 50; p[2] = 54;
  84626. cfb.FileIndex.push(({ name: nm, type: 2, content:p, size:4, L:69, R:69, C:69 }));
  84627. cfb.FullPaths.push(cfb.FullPaths[0] + nm);
  84628. rebuild_cfb(cfb);
  84629. }
  84630. function rebuild_cfb(cfb, f) {
  84631. init_cfb(cfb);
  84632. var gc = false, s = false;
  84633. for(var i = cfb.FullPaths.length - 1; i >= 0; --i) {
  84634. var _file = cfb.FileIndex[i];
  84635. switch(_file.type) {
  84636. case 0:
  84637. if(s) gc = true;
  84638. else { cfb.FileIndex.pop(); cfb.FullPaths.pop(); }
  84639. break;
  84640. case 1: case 2: case 5:
  84641. s = true;
  84642. if(isNaN(_file.R * _file.L * _file.C)) gc = true;
  84643. if(_file.R > -1 && _file.L > -1 && _file.R == _file.L) gc = true;
  84644. break;
  84645. default: gc = true; break;
  84646. }
  84647. }
  84648. if(!gc && !f) return;
  84649. var now = new Date(1987, 1, 19), j = 0;
  84650. var data = [];
  84651. for(i = 0; i < cfb.FullPaths.length; ++i) {
  84652. if(cfb.FileIndex[i].type === 0) continue;
  84653. data.push([cfb.FullPaths[i], cfb.FileIndex[i]]);
  84654. }
  84655. for(i = 0; i < data.length; ++i) {
  84656. var dad = dirname(data[i][0]);
  84657. s = false;
  84658. for(j = 0; j < data.length; ++j) if(data[j][0] === dad) s = true;
  84659. if(!s) data.push([dad, ({
  84660. name: filename(dad).replace("/",""),
  84661. type: 1,
  84662. clsid: HEADER_CLSID,
  84663. ct: now, mt: now,
  84664. content: null
  84665. })]);
  84666. }
  84667. data.sort(function(x,y) { return namecmp(x[0], y[0]); });
  84668. cfb.FullPaths = []; cfb.FileIndex = [];
  84669. for(i = 0; i < data.length; ++i) { cfb.FullPaths[i] = data[i][0]; cfb.FileIndex[i] = data[i][1]; }
  84670. for(i = 0; i < data.length; ++i) {
  84671. var elt = cfb.FileIndex[i];
  84672. var nm = cfb.FullPaths[i];
  84673. elt.name = filename(nm).replace("/","");
  84674. elt.L = elt.R = elt.C = -(elt.color = 1);
  84675. elt.size = elt.content ? elt.content.length : 0;
  84676. elt.start = 0;
  84677. elt.clsid = (elt.clsid || HEADER_CLSID);
  84678. if(i === 0) {
  84679. elt.C = data.length > 1 ? 1 : -1;
  84680. elt.size = 0;
  84681. elt.type = 5;
  84682. } else if(nm.slice(-1) == "/") {
  84683. for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==nm) break;
  84684. elt.C = j >= data.length ? -1 : j;
  84685. for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==dirname(nm)) break;
  84686. elt.R = j >= data.length ? -1 : j;
  84687. elt.type = 1;
  84688. } else {
  84689. if(dirname(cfb.FullPaths[i+1]||"") == dirname(nm)) elt.R = i + 1;
  84690. elt.type = 2;
  84691. }
  84692. }
  84693. }
  84694. function _write(cfb, options) {
  84695. var _opts = options || {};
  84696. rebuild_cfb(cfb);
  84697. if(_opts.fileType == 'zip') return write_zip(cfb, _opts);
  84698. var L = (function(cfb){
  84699. var mini_size = 0, fat_size = 0;
  84700. for(var i = 0; i < cfb.FileIndex.length; ++i) {
  84701. var file = cfb.FileIndex[i];
  84702. if(!file.content) continue;
  84703. var flen = file.content.length;
  84704. if(flen > 0){
  84705. if(flen < 0x1000) mini_size += (flen + 0x3F) >> 6;
  84706. else fat_size += (flen + 0x01FF) >> 9;
  84707. }
  84708. }
  84709. var dir_cnt = (cfb.FullPaths.length +3) >> 2;
  84710. var mini_cnt = (mini_size + 7) >> 3;
  84711. var mfat_cnt = (mini_size + 0x7F) >> 7;
  84712. var fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt;
  84713. var fat_cnt = (fat_base + 0x7F) >> 7;
  84714. var difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
  84715. while(((fat_base + fat_cnt + difat_cnt + 0x7F) >> 7) > fat_cnt) difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
  84716. var L = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0];
  84717. cfb.FileIndex[0].size = mini_size << 6;
  84718. L[7] = (cfb.FileIndex[0].start=L[0]+L[1]+L[2]+L[3]+L[4]+L[5])+((L[6]+7) >> 3);
  84719. return L;
  84720. })(cfb);
  84721. var o = new_buf(L[7] << 9);
  84722. var i = 0, T = 0;
  84723. {
  84724. for(i = 0; i < 8; ++i) o.write_shift(1, HEADER_SIG[i]);
  84725. for(i = 0; i < 8; ++i) o.write_shift(2, 0);
  84726. o.write_shift(2, 0x003E);
  84727. o.write_shift(2, 0x0003);
  84728. o.write_shift(2, 0xFFFE);
  84729. o.write_shift(2, 0x0009);
  84730. o.write_shift(2, 0x0006);
  84731. for(i = 0; i < 3; ++i) o.write_shift(2, 0);
  84732. o.write_shift(4, 0);
  84733. o.write_shift(4, L[2]);
  84734. o.write_shift(4, L[0] + L[1] + L[2] + L[3] - 1);
  84735. o.write_shift(4, 0);
  84736. o.write_shift(4, 1<<12);
  84737. o.write_shift(4, L[3] ? L[0] + L[1] + L[2] - 1: ENDOFCHAIN);
  84738. o.write_shift(4, L[3]);
  84739. o.write_shift(-4, L[1] ? L[0] - 1: ENDOFCHAIN);
  84740. o.write_shift(4, L[1]);
  84741. for(i = 0; i < 109; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
  84742. }
  84743. if(L[1]) {
  84744. for(T = 0; T < L[1]; ++T) {
  84745. for(; i < 236 + T * 127; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
  84746. o.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1);
  84747. }
  84748. }
  84749. var chainit = function(w) {
  84750. for(T += w; i<T-1; ++i) o.write_shift(-4, i+1);
  84751. if(w) { ++i; o.write_shift(-4, ENDOFCHAIN); }
  84752. };
  84753. T = i = 0;
  84754. for(T+=L[1]; i<T; ++i) o.write_shift(-4, consts.DIFSECT);
  84755. for(T+=L[2]; i<T; ++i) o.write_shift(-4, consts.FATSECT);
  84756. chainit(L[3]);
  84757. chainit(L[4]);
  84758. var j = 0, flen = 0;
  84759. var file = cfb.FileIndex[0];
  84760. for(; j < cfb.FileIndex.length; ++j) {
  84761. file = cfb.FileIndex[j];
  84762. if(!file.content) continue;
  84763. flen = file.content.length;
  84764. if(flen < 0x1000) continue;
  84765. file.start = T;
  84766. chainit((flen + 0x01FF) >> 9);
  84767. }
  84768. chainit((L[6] + 7) >> 3);
  84769. while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
  84770. T = i = 0;
  84771. for(j = 0; j < cfb.FileIndex.length; ++j) {
  84772. file = cfb.FileIndex[j];
  84773. if(!file.content) continue;
  84774. flen = file.content.length;
  84775. if(!flen || flen >= 0x1000) continue;
  84776. file.start = T;
  84777. chainit((flen + 0x3F) >> 6);
  84778. }
  84779. while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
  84780. for(i = 0; i < L[4]<<2; ++i) {
  84781. var nm = cfb.FullPaths[i];
  84782. if(!nm || nm.length === 0) {
  84783. for(j = 0; j < 17; ++j) o.write_shift(4, 0);
  84784. for(j = 0; j < 3; ++j) o.write_shift(4, -1);
  84785. for(j = 0; j < 12; ++j) o.write_shift(4, 0);
  84786. continue;
  84787. }
  84788. file = cfb.FileIndex[i];
  84789. if(i === 0) file.start = file.size ? file.start - 1 : ENDOFCHAIN;
  84790. var _nm = (i === 0 && _opts.root) || file.name;
  84791. flen = 2*(_nm.length+1);
  84792. o.write_shift(64, _nm, "utf16le");
  84793. o.write_shift(2, flen);
  84794. o.write_shift(1, file.type);
  84795. o.write_shift(1, file.color);
  84796. o.write_shift(-4, file.L);
  84797. o.write_shift(-4, file.R);
  84798. o.write_shift(-4, file.C);
  84799. if(!file.clsid) for(j = 0; j < 4; ++j) o.write_shift(4, 0);
  84800. else o.write_shift(16, file.clsid, "hex");
  84801. o.write_shift(4, file.state || 0);
  84802. o.write_shift(4, 0); o.write_shift(4, 0);
  84803. o.write_shift(4, 0); o.write_shift(4, 0);
  84804. o.write_shift(4, file.start);
  84805. o.write_shift(4, file.size); o.write_shift(4, 0);
  84806. }
  84807. for(i = 1; i < cfb.FileIndex.length; ++i) {
  84808. file = cfb.FileIndex[i];
  84809. if(file.size >= 0x1000) {
  84810. o.l = (file.start+1) << 9;
  84811. for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
  84812. for(; j & 0x1FF; ++j) o.write_shift(1, 0);
  84813. }
  84814. }
  84815. for(i = 1; i < cfb.FileIndex.length; ++i) {
  84816. file = cfb.FileIndex[i];
  84817. if(file.size > 0 && file.size < 0x1000) {
  84818. for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
  84819. for(; j & 0x3F; ++j) o.write_shift(1, 0);
  84820. }
  84821. }
  84822. while(o.l < o.length) o.write_shift(1, 0);
  84823. return o;
  84824. }
  84825. /* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */
  84826. function find(cfb, path) {
  84827. var UCFullPaths = cfb.FullPaths.map(function(x) { return x.toUpperCase(); });
  84828. var UCPaths = UCFullPaths.map(function(x) { var y = x.split("/"); return y[y.length - (x.slice(-1) == "/" ? 2 : 1)]; });
  84829. var k = false;
  84830. if(path.charCodeAt(0) === 47 /* "/" */) { k = true; path = UCFullPaths[0].slice(0, -1) + path; }
  84831. else k = path.indexOf("/") !== -1;
  84832. var UCPath = path.toUpperCase();
  84833. var w = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
  84834. if(w !== -1) return cfb.FileIndex[w];
  84835. var m = !UCPath.match(chr1);
  84836. UCPath = UCPath.replace(chr0,'');
  84837. if(m) UCPath = UCPath.replace(chr1,'!');
  84838. for(w = 0; w < UCFullPaths.length; ++w) {
  84839. if((m ? UCFullPaths[w].replace(chr1,'!') : UCFullPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
  84840. if((m ? UCPaths[w].replace(chr1,'!') : UCPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
  84841. }
  84842. return null;
  84843. }
  84844. /** CFB Constants */
  84845. var MSSZ = 64; /* Mini Sector Size = 1<<6 */
  84846. //var MSCSZ = 4096; /* Mini Stream Cutoff Size */
  84847. /* 2.1 Compound File Sector Numbers and Types */
  84848. var ENDOFCHAIN = -2;
  84849. /* 2.2 Compound File Header */
  84850. var HEADER_SIGNATURE = 'd0cf11e0a1b11ae1';
  84851. var HEADER_SIG = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1];
  84852. var HEADER_CLSID = '00000000000000000000000000000000';
  84853. var consts = {
  84854. /* 2.1 Compund File Sector Numbers and Types */
  84855. MAXREGSECT: -6,
  84856. DIFSECT: -4,
  84857. FATSECT: -3,
  84858. ENDOFCHAIN: ENDOFCHAIN,
  84859. FREESECT: -1,
  84860. /* 2.2 Compound File Header */
  84861. HEADER_SIGNATURE: HEADER_SIGNATURE,
  84862. HEADER_MINOR_VERSION: '3e00',
  84863. MAXREGSID: -6,
  84864. NOSTREAM: -1,
  84865. HEADER_CLSID: HEADER_CLSID,
  84866. /* 2.6.1 Compound File Directory Entry */
  84867. EntryTypes: ['unknown','storage','stream','lockbytes','property','root']
  84868. };
  84869. function write_file(cfb, filename, options) {
  84870. get_fs();
  84871. var o = _write(cfb, options);
  84872. fs.writeFileSync(filename, o);
  84873. }
  84874. function a2s(o) {
  84875. var out = new Array(o.length);
  84876. for(var i = 0; i < o.length; ++i) out[i] = String.fromCharCode(o[i]);
  84877. return out.join("");
  84878. }
  84879. function write(cfb, options) {
  84880. var o = _write(cfb, options);
  84881. switch(options && options.type) {
  84882. case "file": get_fs(); fs.writeFileSync(options.filename, (o)); return o;
  84883. case "binary": return a2s(o);
  84884. case "base64": return Base64.encode(a2s(o));
  84885. }
  84886. return o;
  84887. }
  84888. /* node < 8.1 zlib does not expose bytesRead, so default to pure JS */
  84889. var _zlib;
  84890. function use_zlib(zlib) { try {
  84891. var InflateRaw = zlib.InflateRaw;
  84892. var InflRaw = new InflateRaw();
  84893. InflRaw._processChunk(new Uint8Array([3, 0]), InflRaw._finishFlushFlag);
  84894. if(InflRaw.bytesRead) _zlib = zlib;
  84895. else throw new Error("zlib does not expose bytesRead");
  84896. } catch(e) {console.error("cannot use native zlib: " + (e.message || e)); } }
  84897. function _inflateRawSync(payload, usz) {
  84898. if(!_zlib) return _inflate(payload, usz);
  84899. var InflateRaw = _zlib.InflateRaw;
  84900. var InflRaw = new InflateRaw();
  84901. var out = InflRaw._processChunk(payload.slice(payload.l), InflRaw._finishFlushFlag);
  84902. payload.l += InflRaw.bytesRead;
  84903. return out;
  84904. }
  84905. function _deflateRawSync(payload) {
  84906. return _zlib ? _zlib.deflateRawSync(payload) : _deflate(payload);
  84907. }
  84908. var CLEN_ORDER = [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
  84909. /* LEN_ID = [ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285 ]; */
  84910. var LEN_LN = [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13 , 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 ];
  84911. /* DST_ID = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ]; */
  84912. var DST_LN = [ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 ];
  84913. function bit_swap_8(n) { var t = (((((n<<1)|(n<<11)) & 0x22110) | (((n<<5)|(n<<15)) & 0x88440))); return ((t>>16) | (t>>8) |t)&0xFF; }
  84914. var use_typed_arrays = typeof Uint8Array !== 'undefined';
  84915. var bitswap8 = use_typed_arrays ? new Uint8Array(1<<8) : [];
  84916. for(var q = 0; q < (1<<8); ++q) bitswap8[q] = bit_swap_8(q);
  84917. function bit_swap_n(n, b) {
  84918. var rev = bitswap8[n & 0xFF];
  84919. if(b <= 8) return rev >>> (8-b);
  84920. rev = (rev << 8) | bitswap8[(n>>8)&0xFF];
  84921. if(b <= 16) return rev >>> (16-b);
  84922. rev = (rev << 8) | bitswap8[(n>>16)&0xFF];
  84923. return rev >>> (24-b);
  84924. }
  84925. /* helpers for unaligned bit reads */
  84926. function read_bits_2(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 6 ? 0 : buf[h+1]<<8))>>>w)& 0x03; }
  84927. function read_bits_3(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 5 ? 0 : buf[h+1]<<8))>>>w)& 0x07; }
  84928. function read_bits_4(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 4 ? 0 : buf[h+1]<<8))>>>w)& 0x0F; }
  84929. function read_bits_5(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 3 ? 0 : buf[h+1]<<8))>>>w)& 0x1F; }
  84930. function read_bits_7(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 1 ? 0 : buf[h+1]<<8))>>>w)& 0x7F; }
  84931. /* works up to n = 3 * 8 + 1 = 25 */
  84932. function read_bits_n(buf, bl, n) {
  84933. var w = (bl&7), h = (bl>>>3), f = ((1<<n)-1);
  84934. var v = buf[h] >>> w;
  84935. if(n < 8 - w) return v & f;
  84936. v |= buf[h+1]<<(8-w);
  84937. if(n < 16 - w) return v & f;
  84938. v |= buf[h+2]<<(16-w);
  84939. if(n < 24 - w) return v & f;
  84940. v |= buf[h+3]<<(24-w);
  84941. return v & f;
  84942. }
  84943. /* until ArrayBuffer#realloc is a thing, fake a realloc */
  84944. function realloc(b, sz) {
  84945. var L = b.length, M = 2*L > sz ? 2*L : sz + 5, i = 0;
  84946. if(L >= sz) return b;
  84947. if(has_buf) {
  84948. var o = new_unsafe_buf(M);
  84949. // $FlowIgnore
  84950. if(b.copy) b.copy(o);
  84951. else for(; i < b.length; ++i) o[i] = b[i];
  84952. return o;
  84953. } else if(use_typed_arrays) {
  84954. var a = new Uint8Array(M);
  84955. if(a.set) a.set(b);
  84956. else for(; i < b.length; ++i) a[i] = b[i];
  84957. return a;
  84958. }
  84959. b.length = M;
  84960. return b;
  84961. }
  84962. /* zero-filled arrays for older browsers */
  84963. function zero_fill_array(n) {
  84964. var o = new Array(n);
  84965. for(var i = 0; i < n; ++i) o[i] = 0;
  84966. return o;
  84967. }var _deflate = (function() {
  84968. var _deflateRaw = (function() {
  84969. return function deflateRaw(data, out) {
  84970. var boff = 0;
  84971. while(boff < data.length) {
  84972. var L = Math.min(0xFFFF, data.length - boff);
  84973. var h = boff + L == data.length;
  84974. /* TODO: this is only type 0 stored */
  84975. out.write_shift(1, +h);
  84976. out.write_shift(2, L);
  84977. out.write_shift(2, (~L) & 0xFFFF);
  84978. while(L-- > 0) out[out.l++] = data[boff++];
  84979. }
  84980. return out.l;
  84981. };
  84982. })();
  84983. return function(data) {
  84984. var buf = new_buf(50+Math.floor(data.length*1.1));
  84985. var off = _deflateRaw(data, buf);
  84986. return buf.slice(0, off);
  84987. };
  84988. })();
  84989. /* modified inflate function also moves original read head */
  84990. /* build tree (used for literals and lengths) */
  84991. function build_tree(clens, cmap, MAX) {
  84992. var maxlen = 1, w = 0, i = 0, j = 0, ccode = 0, L = clens.length;
  84993. var bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
  84994. for(i = 0; i < 32; ++i) bl_count[i] = 0;
  84995. for(i = L; i < MAX; ++i) clens[i] = 0;
  84996. L = clens.length;
  84997. var ctree = use_typed_arrays ? new Uint16Array(L) : zero_fill_array(L); // []
  84998. /* build code tree */
  84999. for(i = 0; i < L; ++i) {
  85000. bl_count[(w = clens[i])]++;
  85001. if(maxlen < w) maxlen = w;
  85002. ctree[i] = 0;
  85003. }
  85004. bl_count[0] = 0;
  85005. for(i = 1; i <= maxlen; ++i) bl_count[i+16] = (ccode = (ccode + bl_count[i-1])<<1);
  85006. for(i = 0; i < L; ++i) {
  85007. ccode = clens[i];
  85008. if(ccode != 0) ctree[i] = bl_count[ccode+16]++;
  85009. }
  85010. /* cmap[maxlen + 4 bits] = (off&15) + (lit<<4) reverse mapping */
  85011. var cleni = 0;
  85012. for(i = 0; i < L; ++i) {
  85013. cleni = clens[i];
  85014. if(cleni != 0) {
  85015. ccode = bit_swap_n(ctree[i], maxlen)>>(maxlen-cleni);
  85016. for(j = (1<<(maxlen + 4 - cleni)) - 1; j>=0; --j)
  85017. cmap[ccode|(j<<cleni)] = (cleni&15) | (i<<4);
  85018. }
  85019. }
  85020. return maxlen;
  85021. }
  85022. var fix_lmap = use_typed_arrays ? new Uint16Array(512) : zero_fill_array(512);
  85023. var fix_dmap = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
  85024. if(!use_typed_arrays) {
  85025. for(var i = 0; i < 512; ++i) fix_lmap[i] = 0;
  85026. for(i = 0; i < 32; ++i) fix_dmap[i] = 0;
  85027. }
  85028. (function() {
  85029. var dlens = [];
  85030. var i = 0;
  85031. for(;i<32; i++) dlens.push(5);
  85032. build_tree(dlens, fix_dmap, 32);
  85033. var clens = [];
  85034. i = 0;
  85035. for(; i<=143; i++) clens.push(8);
  85036. for(; i<=255; i++) clens.push(9);
  85037. for(; i<=279; i++) clens.push(7);
  85038. for(; i<=287; i++) clens.push(8);
  85039. build_tree(clens, fix_lmap, 288);
  85040. })();
  85041. var dyn_lmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
  85042. var dyn_dmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
  85043. var dyn_cmap = use_typed_arrays ? new Uint16Array(128) : zero_fill_array(128);
  85044. var dyn_len_1 = 1, dyn_len_2 = 1;
  85045. /* 5.5.3 Expanding Huffman Codes */
  85046. function dyn(data, boff) {
  85047. /* nomenclature from RFC1951 refers to bit values; these are offset by the implicit constant */
  85048. var _HLIT = read_bits_5(data, boff) + 257; boff += 5;
  85049. var _HDIST = read_bits_5(data, boff) + 1; boff += 5;
  85050. var _HCLEN = read_bits_4(data, boff) + 4; boff += 4;
  85051. var w = 0;
  85052. /* grab and store code lengths */
  85053. var clens = use_typed_arrays ? new Uint8Array(19) : zero_fill_array(19);
  85054. var ctree = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
  85055. var maxlen = 1;
  85056. var bl_count = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
  85057. var next_code = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
  85058. var L = clens.length; /* 19 */
  85059. for(var i = 0; i < _HCLEN; ++i) {
  85060. clens[CLEN_ORDER[i]] = w = read_bits_3(data, boff);
  85061. if(maxlen < w) maxlen = w;
  85062. bl_count[w]++;
  85063. boff += 3;
  85064. }
  85065. /* build code tree */
  85066. var ccode = 0;
  85067. bl_count[0] = 0;
  85068. for(i = 1; i <= maxlen; ++i) next_code[i] = ccode = (ccode + bl_count[i-1])<<1;
  85069. for(i = 0; i < L; ++i) if((ccode = clens[i]) != 0) ctree[i] = next_code[ccode]++;
  85070. /* cmap[7 bits from stream] = (off&7) + (lit<<3) */
  85071. var cleni = 0;
  85072. for(i = 0; i < L; ++i) {
  85073. cleni = clens[i];
  85074. if(cleni != 0) {
  85075. ccode = bitswap8[ctree[i]]>>(8-cleni);
  85076. for(var j = (1<<(7-cleni))-1; j>=0; --j) dyn_cmap[ccode|(j<<cleni)] = (cleni&7) | (i<<3);
  85077. }
  85078. }
  85079. /* read literal and dist codes at once */
  85080. var hcodes = [];
  85081. maxlen = 1;
  85082. for(; hcodes.length < _HLIT + _HDIST;) {
  85083. ccode = dyn_cmap[read_bits_7(data, boff)];
  85084. boff += ccode & 7;
  85085. switch((ccode >>>= 3)) {
  85086. case 16:
  85087. w = 3 + read_bits_2(data, boff); boff += 2;
  85088. ccode = hcodes[hcodes.length - 1];
  85089. while(w-- > 0) hcodes.push(ccode);
  85090. break;
  85091. case 17:
  85092. w = 3 + read_bits_3(data, boff); boff += 3;
  85093. while(w-- > 0) hcodes.push(0);
  85094. break;
  85095. case 18:
  85096. w = 11 + read_bits_7(data, boff); boff += 7;
  85097. while(w -- > 0) hcodes.push(0);
  85098. break;
  85099. default:
  85100. hcodes.push(ccode);
  85101. if(maxlen < ccode) maxlen = ccode;
  85102. break;
  85103. }
  85104. }
  85105. /* build literal / length trees */
  85106. var h1 = hcodes.slice(0, _HLIT), h2 = hcodes.slice(_HLIT);
  85107. for(i = _HLIT; i < 286; ++i) h1[i] = 0;
  85108. for(i = _HDIST; i < 30; ++i) h2[i] = 0;
  85109. dyn_len_1 = build_tree(h1, dyn_lmap, 286);
  85110. dyn_len_2 = build_tree(h2, dyn_dmap, 30);
  85111. return boff;
  85112. }
  85113. /* return [ data, bytesRead ] */
  85114. function inflate(data, usz) {
  85115. /* shortcircuit for empty buffer [0x03, 0x00] */
  85116. if(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }
  85117. /* bit offset */
  85118. var boff = 0;
  85119. /* header includes final bit and type bits */
  85120. var header = 0;
  85121. var outbuf = new_unsafe_buf(usz ? usz : (1<<18));
  85122. var woff = 0;
  85123. var OL = outbuf.length>>>0;
  85124. var max_len_1 = 0, max_len_2 = 0;
  85125. while((header&1) == 0) {
  85126. header = read_bits_3(data, boff); boff += 3;
  85127. if((header >>> 1) == 0) {
  85128. /* Stored block */
  85129. if(boff & 7) boff += 8 - (boff&7);
  85130. /* 2 bytes sz, 2 bytes bit inverse */
  85131. var sz = data[boff>>>3] | data[(boff>>>3)+1]<<8;
  85132. boff += 32;
  85133. /* push sz bytes */
  85134. if(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; }
  85135. if(typeof data.copy === 'function') {
  85136. // $FlowIgnore
  85137. data.copy(outbuf, woff, boff>>>3, (boff>>>3)+sz);
  85138. woff += sz; boff += 8*sz;
  85139. } else while(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; }
  85140. continue;
  85141. } else if((header >>> 1) == 1) {
  85142. /* Fixed Huffman */
  85143. max_len_1 = 9; max_len_2 = 5;
  85144. } else {
  85145. /* Dynamic Huffman */
  85146. boff = dyn(data, boff);
  85147. max_len_1 = dyn_len_1; max_len_2 = dyn_len_2;
  85148. }
  85149. if(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; }
  85150. for(;;) { // while(true) is apparently out of vogue in modern JS circles
  85151. /* ingest code and move read head */
  85152. var bits = read_bits_n(data, boff, max_len_1);
  85153. var code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits];
  85154. boff += code & 15; code >>>= 4;
  85155. /* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */
  85156. if(((code>>>8)&0xFF) === 0) outbuf[woff++] = code;
  85157. else if(code == 256) break;
  85158. else {
  85159. code -= 257;
  85160. var len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0;
  85161. var tgt = woff + LEN_LN[code];
  85162. /* length extra bits */
  85163. if(len_eb > 0) {
  85164. tgt += read_bits_n(data, boff, len_eb);
  85165. boff += len_eb;
  85166. }
  85167. /* dist code */
  85168. bits = read_bits_n(data, boff, max_len_2);
  85169. code = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits];
  85170. boff += code & 15; code >>>= 4;
  85171. var dst_eb = (code < 4 ? 0 : (code-2)>>1);
  85172. var dst = DST_LN[code];
  85173. /* dist extra bits */
  85174. if(dst_eb > 0) {
  85175. dst += read_bits_n(data, boff, dst_eb);
  85176. boff += dst_eb;
  85177. }
  85178. /* in the common case, manual byte copy is faster than TA set / Buffer copy */
  85179. if(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt); OL = outbuf.length; }
  85180. while(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; }
  85181. }
  85182. }
  85183. }
  85184. return [usz ? outbuf : outbuf.slice(0, woff), (boff+7)>>>3];
  85185. }
  85186. function _inflate(payload, usz) {
  85187. var data = payload.slice(payload.l||0);
  85188. var out = inflate(data, usz);
  85189. payload.l += out[1];
  85190. return out[0];
  85191. }
  85192. function warn_or_throw(wrn, msg) {
  85193. if(wrn) { if(typeof console !== 'undefined') console.error(msg); }
  85194. else throw new Error(msg);
  85195. }
  85196. function parse_zip(file, options) {
  85197. var blob = file;
  85198. prep_blob(blob, 0);
  85199. var FileIndex = [], FullPaths = [];
  85200. var o = {
  85201. FileIndex: FileIndex,
  85202. FullPaths: FullPaths
  85203. };
  85204. init_cfb(o, { root: options.root });
  85205. /* find end of central directory, start just after signature */
  85206. var i = blob.length - 4;
  85207. while((blob[i] != 0x50 || blob[i+1] != 0x4b || blob[i+2] != 0x05 || blob[i+3] != 0x06) && i >= 0) --i;
  85208. blob.l = i + 4;
  85209. /* parse end of central directory */
  85210. blob.l += 4;
  85211. var fcnt = blob.read_shift(2);
  85212. blob.l += 6;
  85213. var start_cd = blob.read_shift(4);
  85214. /* parse central directory */
  85215. blob.l = start_cd;
  85216. for(i = 0; i < fcnt; ++i) {
  85217. /* trust local file header instead of CD entry */
  85218. blob.l += 20;
  85219. var csz = blob.read_shift(4);
  85220. var usz = blob.read_shift(4);
  85221. var namelen = blob.read_shift(2);
  85222. var efsz = blob.read_shift(2);
  85223. var fcsz = blob.read_shift(2);
  85224. blob.l += 8;
  85225. var offset = blob.read_shift(4);
  85226. var EF = parse_extra_field(blob.slice(blob.l+namelen, blob.l+namelen+efsz));
  85227. blob.l += namelen + efsz + fcsz;
  85228. var L = blob.l;
  85229. blob.l = offset + 4;
  85230. parse_local_file(blob, csz, usz, o, EF);
  85231. blob.l = L;
  85232. }
  85233. return o;
  85234. }
  85235. /* head starts just after local file header signature */
  85236. function parse_local_file(blob, csz, usz, o, EF) {
  85237. /* [local file header] */
  85238. blob.l += 2;
  85239. var flags = blob.read_shift(2);
  85240. var meth = blob.read_shift(2);
  85241. var date = parse_dos_date(blob);
  85242. if(flags & 0x2041) throw new Error("Unsupported ZIP encryption");
  85243. var crc32 = blob.read_shift(4);
  85244. var _csz = blob.read_shift(4);
  85245. var _usz = blob.read_shift(4);
  85246. var namelen = blob.read_shift(2);
  85247. var efsz = blob.read_shift(2);
  85248. // TODO: flags & (1<<11) // UTF8
  85249. var name = ""; for(var i = 0; i < namelen; ++i) name += String.fromCharCode(blob[blob.l++]);
  85250. if(efsz) {
  85251. var ef = parse_extra_field(blob.slice(blob.l, blob.l + efsz));
  85252. if((ef[0x5455]||{}).mt) date = ef[0x5455].mt;
  85253. if(((EF||{})[0x5455]||{}).mt) date = EF[0x5455].mt;
  85254. }
  85255. blob.l += efsz;
  85256. /* [encryption header] */
  85257. /* [file data] */
  85258. var data = blob.slice(blob.l, blob.l + _csz);
  85259. switch(meth) {
  85260. case 8: data = _inflateRawSync(blob, _usz); break;
  85261. case 0: break;
  85262. default: throw new Error("Unsupported ZIP Compression method " + meth);
  85263. }
  85264. /* [data descriptor] */
  85265. var wrn = false;
  85266. if(flags & 8) {
  85267. crc32 = blob.read_shift(4);
  85268. if(crc32 == 0x08074b50) { crc32 = blob.read_shift(4); wrn = true; }
  85269. _csz = blob.read_shift(4);
  85270. _usz = blob.read_shift(4);
  85271. }
  85272. if(_csz != csz) warn_or_throw(wrn, "Bad compressed size: " + csz + " != " + _csz);
  85273. if(_usz != usz) warn_or_throw(wrn, "Bad uncompressed size: " + usz + " != " + _usz);
  85274. var _crc32 = CRC32.buf(data, 0);
  85275. if((crc32>>0) != (_crc32>>0)) warn_or_throw(wrn, "Bad CRC32 checksum: " + crc32 + " != " + _crc32);
  85276. cfb_add(o, name, data, {unsafe: true, mt: date});
  85277. }
  85278. function write_zip(cfb, options) {
  85279. var _opts = options || {};
  85280. var out = [], cdirs = [];
  85281. var o = new_buf(1);
  85282. var method = (_opts.compression ? 8 : 0), flags = 0;
  85283. var desc = false;
  85284. if(desc) flags |= 8;
  85285. var i = 0, j = 0;
  85286. var start_cd = 0, fcnt = 0;
  85287. var root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0];
  85288. var crcs = [];
  85289. var sz_cd = 0;
  85290. for(i = 1; i < cfb.FullPaths.length; ++i) {
  85291. fp = cfb.FullPaths[i].slice(root.length); fi = cfb.FileIndex[i];
  85292. if(!fi.size || !fi.content || fp == "\u0001Sh33tJ5") continue;
  85293. var start = start_cd;
  85294. /* TODO: CP437 filename */
  85295. var namebuf = new_buf(fp.length);
  85296. for(j = 0; j < fp.length; ++j) namebuf.write_shift(1, fp.charCodeAt(j) & 0x7F);
  85297. namebuf = namebuf.slice(0, namebuf.l);
  85298. crcs[fcnt] = CRC32.buf(fi.content, 0);
  85299. var outbuf = fi.content;
  85300. if(method == 8) outbuf = _deflateRawSync(outbuf);
  85301. /* local file header */
  85302. o = new_buf(30);
  85303. o.write_shift(4, 0x04034b50);
  85304. o.write_shift(2, 20);
  85305. o.write_shift(2, flags);
  85306. o.write_shift(2, method);
  85307. /* TODO: last mod file time/date */
  85308. if(fi.mt) write_dos_date(o, fi.mt);
  85309. else o.write_shift(4, 0);
  85310. o.write_shift(-4, (flags & 8) ? 0 : crcs[fcnt]);
  85311. o.write_shift(4, (flags & 8) ? 0 : outbuf.length);
  85312. o.write_shift(4, (flags & 8) ? 0 : fi.content.length);
  85313. o.write_shift(2, namebuf.length);
  85314. o.write_shift(2, 0);
  85315. start_cd += o.length;
  85316. out.push(o);
  85317. start_cd += namebuf.length;
  85318. out.push(namebuf);
  85319. /* TODO: encryption header ? */
  85320. start_cd += outbuf.length;
  85321. out.push(outbuf);
  85322. /* data descriptor */
  85323. if(flags & 8) {
  85324. o = new_buf(12);
  85325. o.write_shift(-4, crcs[fcnt]);
  85326. o.write_shift(4, outbuf.length);
  85327. o.write_shift(4, fi.content.length);
  85328. start_cd += o.l;
  85329. out.push(o);
  85330. }
  85331. /* central directory */
  85332. o = new_buf(46);
  85333. o.write_shift(4, 0x02014b50);
  85334. o.write_shift(2, 0);
  85335. o.write_shift(2, 20);
  85336. o.write_shift(2, flags);
  85337. o.write_shift(2, method);
  85338. o.write_shift(4, 0); /* TODO: last mod file time/date */
  85339. o.write_shift(-4, crcs[fcnt]);
  85340. o.write_shift(4, outbuf.length);
  85341. o.write_shift(4, fi.content.length);
  85342. o.write_shift(2, namebuf.length);
  85343. o.write_shift(2, 0);
  85344. o.write_shift(2, 0);
  85345. o.write_shift(2, 0);
  85346. o.write_shift(2, 0);
  85347. o.write_shift(4, 0);
  85348. o.write_shift(4, start);
  85349. sz_cd += o.l;
  85350. cdirs.push(o);
  85351. sz_cd += namebuf.length;
  85352. cdirs.push(namebuf);
  85353. ++fcnt;
  85354. }
  85355. /* end of central directory */
  85356. o = new_buf(22);
  85357. o.write_shift(4, 0x06054b50);
  85358. o.write_shift(2, 0);
  85359. o.write_shift(2, 0);
  85360. o.write_shift(2, fcnt);
  85361. o.write_shift(2, fcnt);
  85362. o.write_shift(4, sz_cd);
  85363. o.write_shift(4, start_cd);
  85364. o.write_shift(2, 0);
  85365. return bconcat(([bconcat((out)), bconcat(cdirs), o]));
  85366. }
  85367. function cfb_new(opts) {
  85368. var o = ({});
  85369. init_cfb(o, opts);
  85370. return o;
  85371. }
  85372. function cfb_add(cfb, name, content, opts) {
  85373. var unsafe = opts && opts.unsafe;
  85374. if(!unsafe) init_cfb(cfb);
  85375. var file = !unsafe && CFB.find(cfb, name);
  85376. if(!file) {
  85377. var fpath = cfb.FullPaths[0];
  85378. if(name.slice(0, fpath.length) == fpath) fpath = name;
  85379. else {
  85380. if(fpath.slice(-1) != "/") fpath += "/";
  85381. fpath = (fpath + name).replace("//","/");
  85382. }
  85383. file = ({name: filename(name), type: 2});
  85384. cfb.FileIndex.push(file);
  85385. cfb.FullPaths.push(fpath);
  85386. if(!unsafe) CFB.utils.cfb_gc(cfb);
  85387. }
  85388. file.content = (content);
  85389. file.size = content ? content.length : 0;
  85390. if(opts) {
  85391. if(opts.CLSID) file.clsid = opts.CLSID;
  85392. if(opts.mt) file.mt = opts.mt;
  85393. if(opts.ct) file.ct = opts.ct;
  85394. }
  85395. return file;
  85396. }
  85397. function cfb_del(cfb, name) {
  85398. init_cfb(cfb);
  85399. var file = CFB.find(cfb, name);
  85400. if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
  85401. cfb.FileIndex.splice(j, 1);
  85402. cfb.FullPaths.splice(j, 1);
  85403. return true;
  85404. }
  85405. return false;
  85406. }
  85407. function cfb_mov(cfb, old_name, new_name) {
  85408. init_cfb(cfb);
  85409. var file = CFB.find(cfb, old_name);
  85410. if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
  85411. cfb.FileIndex[j].name = filename(new_name);
  85412. cfb.FullPaths[j] = new_name;
  85413. return true;
  85414. }
  85415. return false;
  85416. }
  85417. function cfb_gc(cfb) { rebuild_cfb(cfb, true); }
  85418. exports.find = find;
  85419. exports.read = read;
  85420. exports.parse = parse;
  85421. exports.write = write;
  85422. exports.writeFile = write_file;
  85423. exports.utils = {
  85424. cfb_new: cfb_new,
  85425. cfb_add: cfb_add,
  85426. cfb_del: cfb_del,
  85427. cfb_mov: cfb_mov,
  85428. cfb_gc: cfb_gc,
  85429. ReadShift: ReadShift,
  85430. CheckField: CheckField,
  85431. prep_blob: prep_blob,
  85432. bconcat: bconcat,
  85433. use_zlib: use_zlib,
  85434. _deflateRaw: _deflate,
  85435. _inflateRaw: _inflate,
  85436. consts: consts
  85437. };
  85438. return exports;
  85439. })();
  85440. if( true && typeof DO_NOT_EXPORT_CFB === 'undefined') { module.exports = CFB; }
  85441. var _fs;
  85442. if(true) try { _fs = __webpack_require__(/*! fs */ 1); } catch(e) {}
  85443. /* normalize data for blob ctor */
  85444. function blobify(data) {
  85445. if(typeof data === "string") return s2ab(data);
  85446. if(Array.isArray(data)) return a2u(data);
  85447. return data;
  85448. }
  85449. /* write or download file */
  85450. function write_dl(fname, payload, enc) {
  85451. /*global IE_SaveFile, Blob, navigator, saveAs, URL, document, File, chrome */
  85452. if(typeof _fs !== 'undefined' && _fs.writeFileSync) return enc ? _fs.writeFileSync(fname, payload, enc) : _fs.writeFileSync(fname, payload);
  85453. var data = (enc == "utf8") ? utf8write(payload) : payload;
  85454. if(typeof IE_SaveFile !== 'undefined') return IE_SaveFile(data, fname);
  85455. if(typeof Blob !== 'undefined') {
  85456. var blob = new Blob([blobify(data)], {type:"application/octet-stream"});
  85457. if(typeof navigator !== 'undefined' && navigator.msSaveBlob) return navigator.msSaveBlob(blob, fname);
  85458. if(typeof saveAs !== 'undefined') return saveAs(blob, fname);
  85459. if(typeof URL !== 'undefined' && typeof document !== 'undefined' && document.createElement && URL.createObjectURL) {
  85460. var url = URL.createObjectURL(blob);
  85461. if(typeof chrome === 'object' && typeof (chrome.downloads||{}).download == "function") {
  85462. if(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000);
  85463. return chrome.downloads.download({ url: url, filename: fname, saveAs: true});
  85464. }
  85465. var a = document.createElement("a");
  85466. if(a.download != null) {
  85467. a.download = fname; a.href = url; document.body.appendChild(a); a.click();
  85468. document.body.removeChild(a);
  85469. if(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000);
  85470. return url;
  85471. }
  85472. }
  85473. }
  85474. // $FlowIgnore
  85475. if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript
  85476. // $FlowIgnore
  85477. var out = File(fname); out.open("w"); out.encoding = "binary";
  85478. if(Array.isArray(payload)) payload = a2s(payload);
  85479. out.write(payload); out.close(); return payload;
  85480. } catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }
  85481. throw new Error("cannot save file " + fname);
  85482. }
  85483. /* read binary data from file */
  85484. function read_binary(path) {
  85485. if(typeof _fs !== 'undefined') return _fs.readFileSync(path);
  85486. // $FlowIgnore
  85487. if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript
  85488. // $FlowIgnore
  85489. var infile = File(path); infile.open("r"); infile.encoding = "binary";
  85490. var data = infile.read(); infile.close();
  85491. return data;
  85492. } catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }
  85493. throw new Error("Cannot access file " + path);
  85494. }
  85495. function keys(o) {
  85496. var ks = Object.keys(o), o2 = [];
  85497. for(var i = 0; i < ks.length; ++i) if(o.hasOwnProperty(ks[i])) o2.push(ks[i]);
  85498. return o2;
  85499. }
  85500. function evert_key(obj, key) {
  85501. var o = ([]), K = keys(obj);
  85502. for(var i = 0; i !== K.length; ++i) if(o[obj[K[i]][key]] == null) o[obj[K[i]][key]] = K[i];
  85503. return o;
  85504. }
  85505. function evert(obj) {
  85506. var o = ([]), K = keys(obj);
  85507. for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = K[i];
  85508. return o;
  85509. }
  85510. function evert_num(obj) {
  85511. var o = ([]), K = keys(obj);
  85512. for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = parseInt(K[i],10);
  85513. return o;
  85514. }
  85515. function evert_arr(obj) {
  85516. var o = ([]), K = keys(obj);
  85517. for(var i = 0; i !== K.length; ++i) {
  85518. if(o[obj[K[i]]] == null) o[obj[K[i]]] = [];
  85519. o[obj[K[i]]].push(K[i]);
  85520. }
  85521. return o;
  85522. }
  85523. var basedate = new Date(1899, 11, 30, 0, 0, 0); // 2209161600000
  85524. var dnthresh = basedate.getTime() + (new Date().getTimezoneOffset() - basedate.getTimezoneOffset()) * 60000;
  85525. function datenum(v, date1904) {
  85526. var epoch = v.getTime();
  85527. if(date1904) epoch -= 1462*24*60*60*1000;
  85528. return (epoch - dnthresh) / (24 * 60 * 60 * 1000);
  85529. }
  85530. function numdate(v) {
  85531. var out = new Date();
  85532. out.setTime(v * 24 * 60 * 60 * 1000 + dnthresh);
  85533. return out;
  85534. }
  85535. /* ISO 8601 Duration */
  85536. function parse_isodur(s) {
  85537. var sec = 0, mt = 0, time = false;
  85538. var m = s.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);
  85539. if(!m) throw new Error("|" + s + "| is not an ISO8601 Duration");
  85540. for(var i = 1; i != m.length; ++i) {
  85541. if(!m[i]) continue;
  85542. mt = 1;
  85543. if(i > 3) time = true;
  85544. switch(m[i].slice(m[i].length-1)) {
  85545. case 'Y':
  85546. throw new Error("Unsupported ISO Duration Field: " + m[i].slice(m[i].length-1));
  85547. case 'D': mt *= 24;
  85548. /* falls through */
  85549. case 'H': mt *= 60;
  85550. /* falls through */
  85551. case 'M':
  85552. if(!time) throw new Error("Unsupported ISO Duration Field: M");
  85553. else mt *= 60;
  85554. /* falls through */
  85555. case 'S': break;
  85556. }
  85557. sec += mt * parseInt(m[i], 10);
  85558. }
  85559. return sec;
  85560. }
  85561. var good_pd_date = new Date('2017-02-19T19:06:09.000Z');
  85562. if(isNaN(good_pd_date.getFullYear())) good_pd_date = new Date('2/19/17');
  85563. var good_pd = good_pd_date.getFullYear() == 2017;
  85564. /* parses a date as a local date */
  85565. function parseDate(str, fixdate) {
  85566. var d = new Date(str);
  85567. if(good_pd) {
  85568. if(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);
  85569. else if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);
  85570. return d;
  85571. }
  85572. if(str instanceof Date) return str;
  85573. if(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {
  85574. var s = d.getFullYear();
  85575. if(str.indexOf("" + s) > -1) return d;
  85576. d.setFullYear(d.getFullYear() + 100); return d;
  85577. }
  85578. var n = str.match(/\d+/g)||["2017","2","19","0","0","0"];
  85579. var out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));
  85580. if(str.indexOf("Z") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);
  85581. return out;
  85582. }
  85583. function cc2str(arr) {
  85584. var o = "";
  85585. for(var i = 0; i != arr.length; ++i) o += String.fromCharCode(arr[i]);
  85586. return o;
  85587. }
  85588. function dup(o) {
  85589. if(typeof JSON != 'undefined' && !Array.isArray(o)) return JSON.parse(JSON.stringify(o));
  85590. if(typeof o != 'object' || o == null) return o;
  85591. if(o instanceof Date) return new Date(o.getTime());
  85592. var out = {};
  85593. for(var k in o) if(o.hasOwnProperty(k)) out[k] = dup(o[k]);
  85594. return out;
  85595. }
  85596. function fill(c,l) { var o = ""; while(o.length < l) o+=c; return o; }
  85597. /* TODO: stress test */
  85598. function fuzzynum(s) {
  85599. var v = Number(s);
  85600. if(!isNaN(v)) return v;
  85601. var wt = 1;
  85602. var ss = s.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g, function() { wt *= 100; return "";});
  85603. if(!isNaN(v = Number(ss))) return v / wt;
  85604. ss = ss.replace(/[(](.*)[)]/,function($$, $1) { wt = -wt; return $1;});
  85605. if(!isNaN(v = Number(ss))) return v / wt;
  85606. return v;
  85607. }
  85608. function fuzzydate(s) {
  85609. var o = new Date(s), n = new Date(NaN);
  85610. var y = o.getYear(), m = o.getMonth(), d = o.getDate();
  85611. if(isNaN(d)) return n;
  85612. if(y < 0 || y > 8099) return n;
  85613. if((m > 0 || d > 1) && y != 101) return o;
  85614. if(s.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) return o;
  85615. if(s.match(/[^-0-9:,\/\\]/)) return n;
  85616. return o;
  85617. }
  85618. var safe_split_regex = "abacaba".split(/(:?b)/i).length == 5;
  85619. function split_regex(str, re, def) {
  85620. if(safe_split_regex || typeof re == "string") return str.split(re);
  85621. var p = str.split(re), o = [p[0]];
  85622. for(var i = 1; i < p.length; ++i) { o.push(def); o.push(p[i]); }
  85623. return o;
  85624. }
  85625. function getdatastr(data) {
  85626. if(!data) return null;
  85627. if(data.data) return debom(data.data);
  85628. if(data.asNodeBuffer && has_buf) return debom(data.asNodeBuffer().toString('binary'));
  85629. if(data.asBinary) return debom(data.asBinary());
  85630. if(data._data && data._data.getContent) return debom(cc2str(Array.prototype.slice.call(data._data.getContent(),0)));
  85631. if(data.content && data.type) return debom(cc2str(data.content));
  85632. return null;
  85633. }
  85634. function getdatabin(data) {
  85635. if(!data) return null;
  85636. if(data.data) return char_codes(data.data);
  85637. if(data.asNodeBuffer && has_buf) return data.asNodeBuffer();
  85638. if(data._data && data._data.getContent) {
  85639. var o = data._data.getContent();
  85640. if(typeof o == "string") return char_codes(o);
  85641. return Array.prototype.slice.call(o);
  85642. }
  85643. if(data.content && data.type) return data.content;
  85644. return null;
  85645. }
  85646. function getdata(data) { return (data && data.name.slice(-4) === ".bin") ? getdatabin(data) : getdatastr(data); }
  85647. /* Part 2 Section 10.1.2 "Mapping Content Types" Names are case-insensitive */
  85648. /* OASIS does not comment on filename case sensitivity */
  85649. function safegetzipfile(zip, file) {
  85650. var k = zip.FullPaths || keys(zip.files);
  85651. var f = file.toLowerCase(), g = f.replace(/\//g,'\\');
  85652. for(var i=0; i<k.length; ++i) {
  85653. var n = k[i].toLowerCase();
  85654. if(f == n || g == n) return zip.files[k[i]];
  85655. }
  85656. return null;
  85657. }
  85658. function getzipfile(zip, file) {
  85659. var o = safegetzipfile(zip, file);
  85660. if(o == null) throw new Error("Cannot find file " + file + " in zip");
  85661. return o;
  85662. }
  85663. function getzipdata(zip, file, safe) {
  85664. if(!safe) return getdata(getzipfile(zip, file));
  85665. if(!file) return null;
  85666. try { return getzipdata(zip, file); } catch(e) { return null; }
  85667. }
  85668. function getzipstr(zip, file, safe) {
  85669. if(!safe) return getdatastr(getzipfile(zip, file));
  85670. if(!file) return null;
  85671. try { return getzipstr(zip, file); } catch(e) { return null; }
  85672. }
  85673. function zipentries(zip) {
  85674. var k = zip.FullPaths || keys(zip.files), o = [];
  85675. for(var i = 0; i < k.length; ++i) if(k[i].slice(-1) != '/') o.push(k[i]);
  85676. return o.sort();
  85677. }
  85678. function zip_add_file(zip, path, content) {
  85679. if(zip.FullPaths) CFB.utils.cfb_add(zip, path, content);
  85680. else zip.file(path, content);
  85681. }
  85682. var jszip;
  85683. /*global JSZipSync:true */
  85684. if(typeof JSZipSync !== 'undefined') jszip = JSZipSync;
  85685. if(true) {
  85686. if( true && module.exports) {
  85687. if(typeof jszip === 'undefined') jszip = __webpack_require__(/*! ./jszip.js */ "./node_modules/xlsx/jszip.js");
  85688. }
  85689. }
  85690. function zip_new() {
  85691. if(!jszip) return CFB.utils.cfb_new();
  85692. return new jszip();
  85693. }
  85694. function zip_read(d, o) {
  85695. var zip;
  85696. if(jszip) switch(o.type) {
  85697. case "base64": zip = new jszip(d, { base64:true }); break;
  85698. case "binary": case "array": zip = new jszip(d, { base64:false }); break;
  85699. case "buffer": zip = new jszip(d); break;
  85700. default: throw new Error("Unrecognized type " + o.type);
  85701. }
  85702. else switch(o.type) {
  85703. case "base64": zip = CFB.read(d, { type: "base64" }); break;
  85704. case "binary": zip = CFB.read(d, { type: "binary" }); break;
  85705. case "buffer": case "array": zip = CFB.read(d, { type: "buffer" }); break;
  85706. default: throw new Error("Unrecognized type " + o.type);
  85707. }
  85708. return zip;
  85709. }
  85710. function resolve_path(path, base) {
  85711. if(path.charAt(0) == "/") return path.slice(1);
  85712. var result = base.split('/');
  85713. if(base.slice(-1) != "/") result.pop(); // folder path
  85714. var target = path.split('/');
  85715. while (target.length !== 0) {
  85716. var step = target.shift();
  85717. if (step === '..') result.pop();
  85718. else if (step !== '.') result.push(step);
  85719. }
  85720. return result.join('/');
  85721. }
  85722. var XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
  85723. var attregexg=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;
  85724. var tagregex=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s?[\/\?]?>/g;
  85725. if(!(XML_HEADER.match(tagregex))) tagregex = /<[^>]*>/g;
  85726. var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/;
  85727. function parsexmltag(tag, skip_root, skip_LC) {
  85728. var z = ({});
  85729. var eq = 0, c = 0;
  85730. for(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break;
  85731. if(!skip_root) z[0] = tag.slice(0, eq);
  85732. if(eq === tag.length) return z;
  85733. var m = tag.match(attregexg), j=0, v="", i=0, q="", cc="", quot = 1;
  85734. if(m) for(i = 0; i != m.length; ++i) {
  85735. cc = m[i];
  85736. for(c=0; c != cc.length; ++c) if(cc.charCodeAt(c) === 61) break;
  85737. q = cc.slice(0,c).trim();
  85738. while(cc.charCodeAt(c+1) == 32) ++c;
  85739. quot = ((eq=cc.charCodeAt(c+1)) == 34 || eq == 39) ? 1 : 0;
  85740. v = cc.slice(c+1+quot, cc.length-quot);
  85741. for(j=0;j!=q.length;++j) if(q.charCodeAt(j) === 58) break;
  85742. if(j===q.length) {
  85743. if(q.indexOf("_") > 0) q = q.slice(0, q.indexOf("_")); // from ods
  85744. z[q] = v;
  85745. if(!skip_LC) z[q.toLowerCase()] = v;
  85746. }
  85747. else {
  85748. var k = (j===5 && q.slice(0,5)==="xmlns"?"xmlns":"")+q.slice(j+1);
  85749. if(z[k] && q.slice(j-3,j) == "ext") continue; // from ods
  85750. z[k] = v;
  85751. if(!skip_LC) z[k.toLowerCase()] = v;
  85752. }
  85753. }
  85754. return z;
  85755. }
  85756. function strip_ns(x) { return x.replace(nsregex2, "<$1"); }
  85757. var encodings = {
  85758. '&quot;': '"',
  85759. '&apos;': "'",
  85760. '&gt;': '>',
  85761. '&lt;': '<',
  85762. '&amp;': '&'
  85763. };
  85764. var rencoding = evert(encodings);
  85765. //var rencstr = "&<>'\"".split("");
  85766. // TODO: CP remap (need to read file version to determine OS)
  85767. var unescapexml = (function() {
  85768. /* 22.4.2.4 bstr (Basic String) */
  85769. var encregex = /&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/g, coderegex = /_x([\da-fA-F]{4})_/g;
  85770. return function unescapexml(text) {
  85771. var s = text + '', i = s.indexOf("<![CDATA[");
  85772. if(i == -1) return s.replace(encregex, function($$, $1) { return encodings[$$]||String.fromCharCode(parseInt($1,$$.indexOf("x")>-1?16:10))||$$; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));});
  85773. var j = s.indexOf("]]>");
  85774. return unescapexml(s.slice(0, i)) + s.slice(i+9,j) + unescapexml(s.slice(j+3));
  85775. };
  85776. })();
  85777. var decregex=/[&<>'"]/g, charegex = /[\u0000-\u0008\u000b-\u001f]/g;
  85778. function escapexml(text){
  85779. var s = text + '';
  85780. return s.replace(decregex, function(y) { return rencoding[y]; }).replace(charegex,function(s) { return "_x" + ("000"+s.charCodeAt(0).toString(16)).slice(-4) + "_";});
  85781. }
  85782. function escapexmltag(text){ return escapexml(text).replace(/ /g,"_x0020_"); }
  85783. var htmlcharegex = /[\u0000-\u001f]/g;
  85784. function escapehtml(text){
  85785. var s = text + '';
  85786. return s.replace(decregex, function(y) { return rencoding[y]; }).replace(/\n/g, "<br/>").replace(htmlcharegex,function(s) { return "&#x" + ("000"+s.charCodeAt(0).toString(16)).slice(-4) + ";"; });
  85787. }
  85788. function escapexlml(text){
  85789. var s = text + '';
  85790. return s.replace(decregex, function(y) { return rencoding[y]; }).replace(htmlcharegex,function(s) { return "&#x" + (s.charCodeAt(0).toString(16)).toUpperCase() + ";"; });
  85791. }
  85792. /* TODO: handle codepages */
  85793. var xlml_fixstr = (function() {
  85794. var entregex = /&#(\d+);/g;
  85795. function entrepl($$,$1) { return String.fromCharCode(parseInt($1,10)); }
  85796. return function xlml_fixstr(str) { return str.replace(entregex,entrepl); };
  85797. })();
  85798. var xlml_unfixstr = (function() {
  85799. return function xlml_unfixstr(str) { return str.replace(/(\r\n|[\r\n])/g,"\&#10;"); };
  85800. })();
  85801. function parsexmlbool(value) {
  85802. switch(value) {
  85803. case 1: case true: case '1': case 'true': case 'TRUE': return true;
  85804. /* case '0': case 'false': case 'FALSE':*/
  85805. default: return false;
  85806. }
  85807. }
  85808. var utf8read = function utf8reada(orig) {
  85809. var out = "", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0;
  85810. while (i < orig.length) {
  85811. c = orig.charCodeAt(i++);
  85812. if (c < 128) { out += String.fromCharCode(c); continue; }
  85813. d = orig.charCodeAt(i++);
  85814. if (c>191 && c<224) { f = ((c & 31) << 6); f |= (d & 63); out += String.fromCharCode(f); continue; }
  85815. e = orig.charCodeAt(i++);
  85816. if (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; }
  85817. f = orig.charCodeAt(i++);
  85818. w = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536;
  85819. out += String.fromCharCode(0xD800 + ((w>>>10)&1023));
  85820. out += String.fromCharCode(0xDC00 + (w&1023));
  85821. }
  85822. return out;
  85823. };
  85824. var utf8write = function(orig) {
  85825. var out = [], i = 0, c = 0, d = 0;
  85826. while(i < orig.length) {
  85827. c = orig.charCodeAt(i++);
  85828. switch(true) {
  85829. case c < 128: out.push(String.fromCharCode(c)); break;
  85830. case c < 2048:
  85831. out.push(String.fromCharCode(192 + (c >> 6)));
  85832. out.push(String.fromCharCode(128 + (c & 63)));
  85833. break;
  85834. case c >= 55296 && c < 57344:
  85835. c -= 55296; d = orig.charCodeAt(i++) - 56320 + (c<<10);
  85836. out.push(String.fromCharCode(240 + ((d >>18) & 7)));
  85837. out.push(String.fromCharCode(144 + ((d >>12) & 63)));
  85838. out.push(String.fromCharCode(128 + ((d >> 6) & 63)));
  85839. out.push(String.fromCharCode(128 + (d & 63)));
  85840. break;
  85841. default:
  85842. out.push(String.fromCharCode(224 + (c >> 12)));
  85843. out.push(String.fromCharCode(128 + ((c >> 6) & 63)));
  85844. out.push(String.fromCharCode(128 + (c & 63)));
  85845. }
  85846. }
  85847. return out.join("");
  85848. };
  85849. if(has_buf) {
  85850. var utf8readb = function utf8readb(data) {
  85851. var out = Buffer.alloc(2*data.length), w, i, j = 1, k = 0, ww=0, c;
  85852. for(i = 0; i < data.length; i+=j) {
  85853. j = 1;
  85854. if((c=data.charCodeAt(i)) < 128) w = c;
  85855. else if(c < 224) { w = (c&31)*64+(data.charCodeAt(i+1)&63); j=2; }
  85856. else if(c < 240) { w=(c&15)*4096+(data.charCodeAt(i+1)&63)*64+(data.charCodeAt(i+2)&63); j=3; }
  85857. else { j = 4;
  85858. w = (c & 7)*262144+(data.charCodeAt(i+1)&63)*4096+(data.charCodeAt(i+2)&63)*64+(data.charCodeAt(i+3)&63);
  85859. w -= 65536; ww = 0xD800 + ((w>>>10)&1023); w = 0xDC00 + (w&1023);
  85860. }
  85861. if(ww !== 0) { out[k++] = ww&255; out[k++] = ww>>>8; ww = 0; }
  85862. out[k++] = w%256; out[k++] = w>>>8;
  85863. }
  85864. return out.slice(0,k).toString('ucs2');
  85865. };
  85866. var corpus = "foo bar baz\u00e2\u0098\u0083\u00f0\u009f\u008d\u00a3";
  85867. if(utf8read(corpus) == utf8readb(corpus)) utf8read = utf8readb;
  85868. var utf8readc = function utf8readc(data) { return Buffer_from(data, 'binary').toString('utf8'); };
  85869. if(utf8read(corpus) == utf8readc(corpus)) utf8read = utf8readc;
  85870. utf8write = function(data) { return Buffer_from(data, 'utf8').toString("binary"); };
  85871. }
  85872. // matches <foo>...</foo> extracts content
  85873. var matchtag = (function() {
  85874. var mtcache = ({});
  85875. return function matchtag(f,g) {
  85876. var t = f+"|"+(g||"");
  85877. if(mtcache[t]) return mtcache[t];
  85878. return (mtcache[t] = new RegExp('<(?:\\w+:)?'+f+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+f+'>',((g||""))));
  85879. };
  85880. })();
  85881. var htmldecode = (function() {
  85882. var entities = [
  85883. ['nbsp', ' '], ['middot', '·'],
  85884. ['quot', '"'], ['apos', "'"], ['gt', '>'], ['lt', '<'], ['amp', '&']
  85885. ].map(function(x) { return [new RegExp('&' + x[0] + ';', "g"), x[1]]; });
  85886. return function htmldecode(str) {
  85887. var o = str
  85888. // Remove new lines and spaces from start of content
  85889. .replace(/^[\t\n\r ]+/, "")
  85890. // Remove new lines and spaces from end of content
  85891. .replace(/[\t\n\r ]+$/,"")
  85892. // Added line which removes any white space characters after and before html tags
  85893. .replace(/>\s+/g,">").replace(/\s+</g,"<")
  85894. // Replace remaining new lines and spaces with space
  85895. .replace(/[\t\n\r ]+/g, " ")
  85896. // Replace <br> tags with new lines
  85897. .replace(/<\s*[bB][rR]\s*\/?>/g,"\n")
  85898. // Strip HTML elements
  85899. .replace(/<[^>]*>/g,"");
  85900. for(var i = 0; i < entities.length; ++i) o = o.replace(entities[i][0], entities[i][1]);
  85901. return o;
  85902. };
  85903. })();
  85904. var vtregex = (function(){ var vt_cache = {};
  85905. return function vt_regex(bt) {
  85906. if(vt_cache[bt] !== undefined) return vt_cache[bt];
  85907. return (vt_cache[bt] = new RegExp("<(?:vt:)?" + bt + ">([\\s\\S]*?)</(?:vt:)?" + bt + ">", 'g') );
  85908. };})();
  85909. var vtvregex = /<\/?(?:vt:)?variant>/g, vtmregex = /<(?:vt:)([^>]*)>([\s\S]*)</;
  85910. function parseVector(data, opts) {
  85911. var h = parsexmltag(data);
  85912. var matches = data.match(vtregex(h.baseType))||[];
  85913. var res = [];
  85914. if(matches.length != h.size) {
  85915. if(opts.WTF) throw new Error("unexpected vector length " + matches.length + " != " + h.size);
  85916. return res;
  85917. }
  85918. matches.forEach(function(x) {
  85919. var v = x.replace(vtvregex,"").match(vtmregex);
  85920. if(v) res.push({v:utf8read(v[2]), t:v[1]});
  85921. });
  85922. return res;
  85923. }
  85924. var wtregex = /(^\s|\s$|\n)/;
  85925. function writetag(f,g) { return '<' + f + (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '</' + f + '>'; }
  85926. function wxt_helper(h) { return keys(h).map(function(k) { return " " + k + '="' + h[k] + '"';}).join(""); }
  85927. function writextag(f,g,h) { return '<' + f + ((h != null) ? wxt_helper(h) : "") + ((g != null) ? (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '</' + f : "/") + '>';}
  85928. function write_w3cdtf(d, t) { try { return d.toISOString().replace(/\.\d*/,""); } catch(e) { if(t) throw e; } return ""; }
  85929. function write_vt(s) {
  85930. switch(typeof s) {
  85931. case 'string': return writextag('vt:lpwstr', s);
  85932. case 'number': return writextag((s|0)==s?'vt:i4':'vt:r8', String(s));
  85933. case 'boolean': return writextag('vt:bool',s?'true':'false');
  85934. }
  85935. if(s instanceof Date) return writextag('vt:filetime', write_w3cdtf(s));
  85936. throw new Error("Unable to serialize " + s);
  85937. }
  85938. var XMLNS = ({
  85939. 'dc': 'http://purl.org/dc/elements/1.1/',
  85940. 'dcterms': 'http://purl.org/dc/terms/',
  85941. 'dcmitype': 'http://purl.org/dc/dcmitype/',
  85942. 'mx': 'http://schemas.microsoft.com/office/mac/excel/2008/main',
  85943. 'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
  85944. 'sjs': 'http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties',
  85945. 'vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',
  85946. 'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
  85947. 'xsd': 'http://www.w3.org/2001/XMLSchema'
  85948. });
  85949. XMLNS.main = [
  85950. 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
  85951. 'http://purl.oclc.org/ooxml/spreadsheetml/main',
  85952. 'http://schemas.microsoft.com/office/excel/2006/main',
  85953. 'http://schemas.microsoft.com/office/excel/2006/2'
  85954. ];
  85955. var XLMLNS = ({
  85956. 'o': 'urn:schemas-microsoft-com:office:office',
  85957. 'x': 'urn:schemas-microsoft-com:office:excel',
  85958. 'ss': 'urn:schemas-microsoft-com:office:spreadsheet',
  85959. 'dt': 'uuid:C2F41010-65B3-11d1-A29F-00AA00C14882',
  85960. 'mv': 'http://macVmlSchemaUri',
  85961. 'v': 'urn:schemas-microsoft-com:vml',
  85962. 'html': 'http://www.w3.org/TR/REC-html40'
  85963. });
  85964. function read_double_le(b, idx) {
  85965. var s = 1 - 2 * (b[idx + 7] >>> 7);
  85966. var e = ((b[idx + 7] & 0x7f) << 4) + ((b[idx + 6] >>> 4) & 0x0f);
  85967. var m = (b[idx+6]&0x0f);
  85968. for(var i = 5; i >= 0; --i) m = m * 256 + b[idx + i];
  85969. if(e == 0x7ff) return m == 0 ? (s * Infinity) : NaN;
  85970. if(e == 0) e = -1022;
  85971. else { e -= 1023; m += Math.pow(2,52); }
  85972. return s * Math.pow(2, e - 52) * m;
  85973. }
  85974. function write_double_le(b, v, idx) {
  85975. var bs = ((((v < 0) || (1/v == -Infinity)) ? 1 : 0) << 7), e = 0, m = 0;
  85976. var av = bs ? (-v) : v;
  85977. if(!isFinite(av)) { e = 0x7ff; m = isNaN(v) ? 0x6969 : 0; }
  85978. else if(av == 0) e = m = 0;
  85979. else {
  85980. e = Math.floor(Math.log(av) / Math.LN2);
  85981. m = av * Math.pow(2, 52 - e);
  85982. if((e <= -1023) && (!isFinite(m) || (m < Math.pow(2,52)))) { e = -1022; }
  85983. else { m -= Math.pow(2,52); e+=1023; }
  85984. }
  85985. for(var i = 0; i <= 5; ++i, m/=256) b[idx + i] = m & 0xff;
  85986. b[idx + 6] = ((e & 0x0f) << 4) | (m & 0xf);
  85987. b[idx + 7] = (e >> 4) | bs;
  85988. }
  85989. var __toBuffer = function(bufs) { var x=[],w=10240; for(var i=0;i<bufs[0].length;++i) if(bufs[0][i]) for(var j=0,L=bufs[0][i].length;j<L;j+=w) x.push.apply(x, bufs[0][i].slice(j,j+w)); return x; };
  85990. var ___toBuffer = __toBuffer;
  85991. var __utf16le = function(b,s,e) { var ss=[]; for(var i=s; i<e; i+=2) ss.push(String.fromCharCode(__readUInt16LE(b,i))); return ss.join("").replace(chr0,''); };
  85992. var ___utf16le = __utf16le;
  85993. var __hexlify = function(b,s,l) { var ss=[]; for(var i=s; i<s+l; ++i) ss.push(("0" + b[i].toString(16)).slice(-2)); return ss.join(""); };
  85994. var ___hexlify = __hexlify;
  85995. var __utf8 = function(b,s,e) { var ss=[]; for(var i=s; i<e; i++) ss.push(String.fromCharCode(__readUInt8(b,i))); return ss.join(""); };
  85996. var ___utf8 = __utf8;
  85997. var __lpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";};
  85998. var ___lpstr = __lpstr;
  85999. var __cpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";};
  86000. var ___cpstr = __cpstr;
  86001. var __lpwstr = function(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";};
  86002. var ___lpwstr = __lpwstr;
  86003. var __lpp4, ___lpp4;
  86004. __lpp4 = ___lpp4 = function lpp4_(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf16le(b, i+4,i+4+len) : "";};
  86005. var __8lpp4 = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len) : "";};
  86006. var ___8lpp4 = __8lpp4;
  86007. var __double, ___double;
  86008. __double = ___double = function(b, idx) { return read_double_le(b, idx);};
  86009. var is_buf = function is_buf_a(a) { return Array.isArray(a); };
  86010. if(has_buf) {
  86011. __utf16le = function(b,s,e) { if(!Buffer.isBuffer(b)) return ___utf16le(b,s,e); return b.toString('utf16le',s,e).replace(chr0,'')/*.replace(chr1,'!')*/; };
  86012. __hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
  86013. __lpstr = function lpstr_b(b, i) { if(!Buffer.isBuffer(b)) return ___lpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : "";};
  86014. __cpstr = function cpstr_b(b, i) { if(!Buffer.isBuffer(b)) return ___cpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : "";};
  86015. __lpwstr = function lpwstr_b(b, i) { if(!Buffer.isBuffer(b)) return ___lpwstr(b, i); var len = 2*b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len-1);};
  86016. __lpp4 = function lpp4_b(b, i) { if(!Buffer.isBuffer(b)) return ___lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len);};
  86017. __8lpp4 = function lpp4_8b(b, i) { if(!Buffer.isBuffer(b)) return ___8lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf8',i+4,i+4+len);};
  86018. __utf8 = function utf8_b(b, s, e) { return (Buffer.isBuffer(b)) ? b.toString('utf8',s,e) : ___utf8(b,s,e); };
  86019. __toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat(bufs[0]) : ___toBuffer(bufs);};
  86020. bconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : [].concat.apply([], bufs); };
  86021. __double = function double_(b, i) { if(Buffer.isBuffer(b)) return b.readDoubleLE(i); return ___double(b,i); };
  86022. is_buf = function is_buf_b(a) { return Buffer.isBuffer(a) || Array.isArray(a); };
  86023. }
  86024. /* from js-xls */
  86025. if(typeof cptable !== 'undefined') {
  86026. __utf16le = function(b,s,e) { return cptable.utils.decode(1200, b.slice(s,e)).replace(chr0, ''); };
  86027. __utf8 = function(b,s,e) { return cptable.utils.decode(65001, b.slice(s,e)); };
  86028. __lpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(current_ansi, b.slice(i+4, i+4+len-1)) : "";};
  86029. __cpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(current_codepage, b.slice(i+4, i+4+len-1)) : "";};
  86030. __lpwstr = function(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(1200, b.slice(i+4,i+4+len-1)) : "";};
  86031. __lpp4 = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(1200, b.slice(i+4,i+4+len)) : "";};
  86032. __8lpp4 = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(65001, b.slice(i+4,i+4+len)) : "";};
  86033. }
  86034. var __readUInt8 = function(b, idx) { return b[idx]; };
  86035. var __readUInt16LE = function(b, idx) { return (b[idx+1]*(1<<8))+b[idx]; };
  86036. var __readInt16LE = function(b, idx) { var u = (b[idx+1]*(1<<8))+b[idx]; return (u < 0x8000) ? u : ((0xffff - u + 1) * -1); };
  86037. var __readUInt32LE = function(b, idx) { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };
  86038. var __readInt32LE = function(b, idx) { return (b[idx+3]<<24)|(b[idx+2]<<16)|(b[idx+1]<<8)|b[idx]; };
  86039. var __readInt32BE = function(b, idx) { return (b[idx]<<24)|(b[idx+1]<<16)|(b[idx+2]<<8)|b[idx+3]; };
  86040. function ReadShift(size, t) {
  86041. var o="", oI, oR, oo=[], w, vv, i, loc;
  86042. switch(t) {
  86043. case 'dbcs':
  86044. loc = this.l;
  86045. if(has_buf && Buffer.isBuffer(this)) o = this.slice(this.l, this.l+2*size).toString("utf16le");
  86046. else for(i = 0; i < size; ++i) { o+=String.fromCharCode(__readUInt16LE(this, loc)); loc+=2; }
  86047. size *= 2;
  86048. break;
  86049. case 'utf8': o = __utf8(this, this.l, this.l + size); break;
  86050. case 'utf16le': size *= 2; o = __utf16le(this, this.l, this.l + size); break;
  86051. case 'wstr':
  86052. if(typeof cptable !== 'undefined') o = cptable.utils.decode(current_codepage, this.slice(this.l, this.l+2*size));
  86053. else return ReadShift.call(this, size, 'dbcs');
  86054. size = 2 * size; break;
  86055. /* [MS-OLEDS] 2.1.4 LengthPrefixedAnsiString */
  86056. case 'lpstr-ansi': o = __lpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break;
  86057. case 'lpstr-cp': o = __cpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break;
  86058. /* [MS-OLEDS] 2.1.5 LengthPrefixedUnicodeString */
  86059. case 'lpwstr': o = __lpwstr(this, this.l); size = 4 + 2 * __readUInt32LE(this, this.l); break;
  86060. /* [MS-OFFCRYPTO] 2.1.2 Length-Prefixed Padded Unicode String (UNICODE-LP-P4) */
  86061. case 'lpp4': size = 4 + __readUInt32LE(this, this.l); o = __lpp4(this, this.l); if(size & 0x02) size += 2; break;
  86062. /* [MS-OFFCRYPTO] 2.1.3 Length-Prefixed UTF-8 String (UTF-8-LP-P4) */
  86063. case '8lpp4': size = 4 + __readUInt32LE(this, this.l); o = __8lpp4(this, this.l); if(size & 0x03) size += 4 - (size & 0x03); break;
  86064. case 'cstr': size = 0; o = "";
  86065. while((w=__readUInt8(this, this.l + size++))!==0) oo.push(_getchar(w));
  86066. o = oo.join(""); break;
  86067. case '_wstr': size = 0; o = "";
  86068. while((w=__readUInt16LE(this,this.l +size))!==0){oo.push(_getchar(w));size+=2;}
  86069. size+=2; o = oo.join(""); break;
  86070. /* sbcs and dbcs support continue records in the SST way TODO codepages */
  86071. case 'dbcs-cont': o = ""; loc = this.l;
  86072. for(i = 0; i < size; ++i) {
  86073. if(this.lens && this.lens.indexOf(loc) !== -1) {
  86074. w = __readUInt8(this, loc);
  86075. this.l = loc + 1;
  86076. vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');
  86077. return oo.join("") + vv;
  86078. }
  86079. oo.push(_getchar(__readUInt16LE(this, loc)));
  86080. loc+=2;
  86081. } o = oo.join(""); size *= 2; break;
  86082. case 'cpstr':
  86083. if(typeof cptable !== 'undefined') {
  86084. o = cptable.utils.decode(current_codepage, this.slice(this.l, this.l + size));
  86085. break;
  86086. }
  86087. /* falls through */
  86088. case 'sbcs-cont': o = ""; loc = this.l;
  86089. for(i = 0; i != size; ++i) {
  86090. if(this.lens && this.lens.indexOf(loc) !== -1) {
  86091. w = __readUInt8(this, loc);
  86092. this.l = loc + 1;
  86093. vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');
  86094. return oo.join("") + vv;
  86095. }
  86096. oo.push(_getchar(__readUInt8(this, loc)));
  86097. loc+=1;
  86098. } o = oo.join(""); break;
  86099. default:
  86100. switch(size) {
  86101. case 1: oI = __readUInt8(this, this.l); this.l++; return oI;
  86102. case 2: oI = (t === 'i' ? __readInt16LE : __readUInt16LE)(this, this.l); this.l += 2; return oI;
  86103. case 4: case -4:
  86104. if(t === 'i' || ((this[this.l+3] & 0x80)===0)) { oI = ((size > 0) ? __readInt32LE : __readInt32BE)(this, this.l); this.l += 4; return oI; }
  86105. else { oR = __readUInt32LE(this, this.l); this.l += 4; } return oR;
  86106. case 8: case -8:
  86107. if(t === 'f') {
  86108. if(size == 8) oR = __double(this, this.l);
  86109. else oR = __double([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]], 0);
  86110. this.l += 8; return oR;
  86111. } else size = 8;
  86112. /* falls through */
  86113. case 16: o = __hexlify(this, this.l, size); break;
  86114. }}
  86115. this.l+=size; return o;
  86116. }
  86117. var __writeUInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); b[idx+2] = ((val >>> 16) & 0xFF); b[idx+3] = ((val >>> 24) & 0xFF); };
  86118. var __writeInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >> 8) & 0xFF); b[idx+2] = ((val >> 16) & 0xFF); b[idx+3] = ((val >> 24) & 0xFF); };
  86119. var __writeUInt16LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); };
  86120. function WriteShift(t, val, f) {
  86121. var size = 0, i = 0;
  86122. if(f === 'dbcs') {
  86123. for(i = 0; i != val.length; ++i) __writeUInt16LE(this, val.charCodeAt(i), this.l + 2 * i);
  86124. size = 2 * val.length;
  86125. } else if(f === 'sbcs') {
  86126. if(typeof cptable !== 'undefined' && current_ansi == 874) {
  86127. /* TODO: use tables directly, don't encode */
  86128. for(i = 0; i != val.length; ++i) {
  86129. var cppayload = cptable.utils.encode(current_ansi, val.charAt(i));
  86130. this[this.l + i] = cppayload[0];
  86131. }
  86132. } else {
  86133. val = val.replace(/[^\x00-\x7F]/g, "_");
  86134. for(i = 0; i != val.length; ++i) this[this.l + i] = (val.charCodeAt(i) & 0xFF);
  86135. }
  86136. size = val.length;
  86137. } else if(f === 'hex') {
  86138. for(; i < t; ++i) {
  86139. this[this.l++] = (parseInt(val.slice(2*i, 2*i+2), 16)||0);
  86140. } return this;
  86141. } else if(f === 'utf16le') {
  86142. var end = Math.min(this.l + t, this.length);
  86143. for(i = 0; i < Math.min(val.length, t); ++i) {
  86144. var cc = val.charCodeAt(i);
  86145. this[this.l++] = (cc & 0xff);
  86146. this[this.l++] = (cc >> 8);
  86147. }
  86148. while(this.l < end) this[this.l++] = 0;
  86149. return this;
  86150. } else switch(t) {
  86151. case 1: size = 1; this[this.l] = val&0xFF; break;
  86152. case 2: size = 2; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; break;
  86153. case 3: size = 3; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; val >>>= 8; this[this.l+2] = val&0xFF; break;
  86154. case 4: size = 4; __writeUInt32LE(this, val, this.l); break;
  86155. case 8: size = 8; if(f === 'f') { write_double_le(this, val, this.l); break; }
  86156. /* falls through */
  86157. case 16: break;
  86158. case -4: size = 4; __writeInt32LE(this, val, this.l); break;
  86159. }
  86160. this.l += size; return this;
  86161. }
  86162. function CheckField(hexstr, fld) {
  86163. var m = __hexlify(this,this.l,hexstr.length>>1);
  86164. if(m !== hexstr) throw new Error(fld + 'Expected ' + hexstr + ' saw ' + m);
  86165. this.l += hexstr.length>>1;
  86166. }
  86167. function prep_blob(blob, pos) {
  86168. blob.l = pos;
  86169. blob.read_shift = ReadShift;
  86170. blob.chk = CheckField;
  86171. blob.write_shift = WriteShift;
  86172. }
  86173. function parsenoop(blob, length) { blob.l += length; }
  86174. function new_buf(sz) {
  86175. var o = new_raw_buf(sz);
  86176. prep_blob(o, 0);
  86177. return o;
  86178. }
  86179. /* [MS-XLSB] 2.1.4 Record */
  86180. function recordhopper(data, cb, opts) {
  86181. if(!data) return;
  86182. var tmpbyte, cntbyte, length;
  86183. prep_blob(data, data.l || 0);
  86184. var L = data.length, RT = 0, tgt = 0;
  86185. while(data.l < L) {
  86186. RT = data.read_shift(1);
  86187. if(RT & 0x80) RT = (RT & 0x7F) + ((data.read_shift(1) & 0x7F)<<7);
  86188. var R = XLSBRecordEnum[RT] || XLSBRecordEnum[0xFFFF];
  86189. tmpbyte = data.read_shift(1);
  86190. length = tmpbyte & 0x7F;
  86191. for(cntbyte = 1; cntbyte <4 && (tmpbyte & 0x80); ++cntbyte) length += ((tmpbyte = data.read_shift(1)) & 0x7F)<<(7*cntbyte);
  86192. tgt = data.l + length;
  86193. var d = (R.f||parsenoop)(data, length, opts);
  86194. data.l = tgt;
  86195. if(cb(d, R.n, RT)) return;
  86196. }
  86197. }
  86198. /* control buffer usage for fixed-length buffers */
  86199. function buf_array() {
  86200. var bufs = [], blksz = has_buf ? 256 : 2048;
  86201. var newblk = function ba_newblk(sz) {
  86202. var o = (new_buf(sz));
  86203. prep_blob(o, 0);
  86204. return o;
  86205. };
  86206. var curbuf = newblk(blksz);
  86207. var endbuf = function ba_endbuf() {
  86208. if(!curbuf) return;
  86209. if(curbuf.length > curbuf.l) { curbuf = curbuf.slice(0, curbuf.l); curbuf.l = curbuf.length; }
  86210. if(curbuf.length > 0) bufs.push(curbuf);
  86211. curbuf = null;
  86212. };
  86213. var next = function ba_next(sz) {
  86214. if(curbuf && (sz < (curbuf.length - curbuf.l))) return curbuf;
  86215. endbuf();
  86216. return (curbuf = newblk(Math.max(sz+1, blksz)));
  86217. };
  86218. var end = function ba_end() {
  86219. endbuf();
  86220. return __toBuffer([bufs]);
  86221. };
  86222. var push = function ba_push(buf) { endbuf(); curbuf = buf; if(curbuf.l == null) curbuf.l = curbuf.length; next(blksz); };
  86223. return ({ next:next, push:push, end:end, _bufs:bufs });
  86224. }
  86225. function write_record(ba, type, payload, length) {
  86226. var t = +XLSBRE[type], l;
  86227. if(isNaN(t)) return; // TODO: throw something here?
  86228. if(!length) length = XLSBRecordEnum[t].p || (payload||[]).length || 0;
  86229. l = 1 + (t >= 0x80 ? 1 : 0) + 1/* + length*/;
  86230. if(length >= 0x80) ++l; if(length >= 0x4000) ++l; if(length >= 0x200000) ++l;
  86231. var o = ba.next(l);
  86232. if(t <= 0x7F) o.write_shift(1, t);
  86233. else {
  86234. o.write_shift(1, (t & 0x7F) + 0x80);
  86235. o.write_shift(1, (t >> 7));
  86236. }
  86237. for(var i = 0; i != 4; ++i) {
  86238. if(length >= 0x80) { o.write_shift(1, (length & 0x7F)+0x80); length >>= 7; }
  86239. else { o.write_shift(1, length); break; }
  86240. }
  86241. if(length > 0 && is_buf(payload)) ba.push(payload);
  86242. }
  86243. /* XLS ranges enforced */
  86244. function shift_cell_xls(cell, tgt, opts) {
  86245. var out = dup(cell);
  86246. if(tgt.s) {
  86247. if(out.cRel) out.c += tgt.s.c;
  86248. if(out.rRel) out.r += tgt.s.r;
  86249. } else {
  86250. if(out.cRel) out.c += tgt.c;
  86251. if(out.rRel) out.r += tgt.r;
  86252. }
  86253. if(!opts || opts.biff < 12) {
  86254. while(out.c >= 0x100) out.c -= 0x100;
  86255. while(out.r >= 0x10000) out.r -= 0x10000;
  86256. }
  86257. return out;
  86258. }
  86259. function shift_range_xls(cell, range, opts) {
  86260. var out = dup(cell);
  86261. out.s = shift_cell_xls(out.s, range.s, opts);
  86262. out.e = shift_cell_xls(out.e, range.s, opts);
  86263. return out;
  86264. }
  86265. function encode_cell_xls(c, biff) {
  86266. if(c.cRel && c.c < 0) { c = dup(c); while(c.c < 0) c.c += (biff > 8) ? 0x4000 : 0x100; }
  86267. if(c.rRel && c.r < 0) { c = dup(c); while(c.r < 0) c.r += (biff > 8) ? 0x100000 : ((biff > 5) ? 0x10000 : 0x4000); }
  86268. var s = encode_cell(c);
  86269. if(!c.cRel && c.cRel != null) s = fix_col(s);
  86270. if(!c.rRel && c.rRel != null) s = fix_row(s);
  86271. return s;
  86272. }
  86273. function encode_range_xls(r, opts) {
  86274. if(r.s.r == 0 && !r.s.rRel) {
  86275. if(r.e.r == (opts.biff >= 12 ? 0xFFFFF : (opts.biff >= 8 ? 0x10000 : 0x4000)) && !r.e.rRel) {
  86276. return (r.s.cRel ? "" : "$") + encode_col(r.s.c) + ":" + (r.e.cRel ? "" : "$") + encode_col(r.e.c);
  86277. }
  86278. }
  86279. if(r.s.c == 0 && !r.s.cRel) {
  86280. if(r.e.c == (opts.biff >= 12 ? 0xFFFF : 0xFF) && !r.e.cRel) {
  86281. return (r.s.rRel ? "" : "$") + encode_row(r.s.r) + ":" + (r.e.rRel ? "" : "$") + encode_row(r.e.r);
  86282. }
  86283. }
  86284. return encode_cell_xls(r.s, opts.biff) + ":" + encode_cell_xls(r.e, opts.biff);
  86285. }
  86286. var OFFCRYPTO = {};
  86287. var make_offcrypto = function(O, _crypto) {
  86288. var crypto;
  86289. if(typeof _crypto !== 'undefined') crypto = _crypto;
  86290. else if(true) {
  86291. try { crypto = __webpack_require__(/*! crypto */ 2); }
  86292. catch(e) { crypto = null; }
  86293. }
  86294. O.rc4 = function(key, data) {
  86295. var S = new Array(256);
  86296. var c = 0, i = 0, j = 0, t = 0;
  86297. for(i = 0; i != 256; ++i) S[i] = i;
  86298. for(i = 0; i != 256; ++i) {
  86299. j = (j + S[i] + (key[i%key.length]).charCodeAt(0))&255;
  86300. t = S[i]; S[i] = S[j]; S[j] = t;
  86301. }
  86302. // $FlowIgnore
  86303. i = j = 0; var out = Buffer(data.length);
  86304. for(c = 0; c != data.length; ++c) {
  86305. i = (i + 1)&255;
  86306. j = (j + S[i])%256;
  86307. t = S[i]; S[i] = S[j]; S[j] = t;
  86308. out[c] = (data[c] ^ S[(S[i]+S[j])&255]);
  86309. }
  86310. return out;
  86311. };
  86312. O.md5 = function(hex) {
  86313. if(!crypto) throw new Error("Unsupported crypto");
  86314. return crypto.createHash('md5').update(hex).digest('hex');
  86315. };
  86316. };
  86317. /*global crypto:true */
  86318. make_offcrypto(OFFCRYPTO, typeof crypto !== "undefined" ? crypto : undefined);
  86319. function decode_row(rowstr) { return parseInt(unfix_row(rowstr),10) - 1; }
  86320. function encode_row(row) { return "" + (row + 1); }
  86321. function fix_row(cstr) { return cstr.replace(/([A-Z]|^)(\d+)$/,"$1$$$2"); }
  86322. function unfix_row(cstr) { return cstr.replace(/\$(\d+)$/,"$1"); }
  86323. function decode_col(colstr) { var c = unfix_col(colstr), d = 0, i = 0; for(; i !== c.length; ++i) d = 26*d + c.charCodeAt(i) - 64; return d - 1; }
  86324. function encode_col(col) { if(col < 0) throw new Error("invalid column " + col); var s=""; for(++col; col; col=Math.floor((col-1)/26)) s = String.fromCharCode(((col-1)%26) + 65) + s; return s; }
  86325. function fix_col(cstr) { return cstr.replace(/^([A-Z])/,"$$$1"); }
  86326. function unfix_col(cstr) { return cstr.replace(/^\$([A-Z])/,"$1"); }
  86327. function split_cell(cstr) { return cstr.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(","); }
  86328. function decode_cell(cstr) { var splt = split_cell(cstr); return { c:decode_col(splt[0]), r:decode_row(splt[1]) }; }
  86329. function encode_cell(cell) { return encode_col(cell.c) + encode_row(cell.r); }
  86330. function decode_range(range) { var x =range.split(":").map(decode_cell); return {s:x[0],e:x[x.length-1]}; }
  86331. function encode_range(cs,ce) {
  86332. if(typeof ce === 'undefined' || typeof ce === 'number') {
  86333. return encode_range(cs.s, cs.e);
  86334. }
  86335. if(typeof cs !== 'string') cs = encode_cell((cs));
  86336. if(typeof ce !== 'string') ce = encode_cell((ce));
  86337. return cs == ce ? cs : cs + ":" + ce;
  86338. }
  86339. function safe_decode_range(range) {
  86340. var o = {s:{c:0,r:0},e:{c:0,r:0}};
  86341. var idx = 0, i = 0, cc = 0;
  86342. var len = range.length;
  86343. for(idx = 0; i < len; ++i) {
  86344. if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;
  86345. idx = 26*idx + cc;
  86346. }
  86347. o.s.c = --idx;
  86348. for(idx = 0; i < len; ++i) {
  86349. if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;
  86350. idx = 10*idx + cc;
  86351. }
  86352. o.s.r = --idx;
  86353. if(i === len || range.charCodeAt(++i) === 58) { o.e.c=o.s.c; o.e.r=o.s.r; return o; }
  86354. for(idx = 0; i != len; ++i) {
  86355. if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;
  86356. idx = 26*idx + cc;
  86357. }
  86358. o.e.c = --idx;
  86359. for(idx = 0; i != len; ++i) {
  86360. if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;
  86361. idx = 10*idx + cc;
  86362. }
  86363. o.e.r = --idx;
  86364. return o;
  86365. }
  86366. function safe_format_cell(cell, v) {
  86367. var q = (cell.t == 'd' && v instanceof Date);
  86368. if(cell.z != null) try { return (cell.w = SSF.format(cell.z, q ? datenum(v) : v)); } catch(e) { }
  86369. try { return (cell.w = SSF.format((cell.XF||{}).numFmtId||(q ? 14 : 0), q ? datenum(v) : v)); } catch(e) { return ''+v; }
  86370. }
  86371. function format_cell(cell, v, o) {
  86372. if(cell == null || cell.t == null || cell.t == 'z') return "";
  86373. if(cell.w !== undefined) return cell.w;
  86374. if(cell.t == 'd' && !cell.z && o && o.dateNF) cell.z = o.dateNF;
  86375. if(v == undefined) return safe_format_cell(cell, cell.v);
  86376. return safe_format_cell(cell, v);
  86377. }
  86378. function sheet_to_workbook(sheet, opts) {
  86379. var n = opts && opts.sheet ? opts.sheet : "Sheet1";
  86380. var sheets = {}; sheets[n] = sheet;
  86381. return { SheetNames: [n], Sheets: sheets };
  86382. }
  86383. function sheet_add_aoa(_ws, data, opts) {
  86384. var o = opts || {};
  86385. var dense = _ws ? Array.isArray(_ws) : o.dense;
  86386. if(DENSE != null && dense == null) dense = DENSE;
  86387. var ws = _ws || (dense ? ([]) : ({}));
  86388. var _R = 0, _C = 0;
  86389. if(ws && o.origin != null) {
  86390. if(typeof o.origin == 'number') _R = o.origin;
  86391. else {
  86392. var _origin = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin;
  86393. _R = _origin.r; _C = _origin.c;
  86394. }
  86395. }
  86396. var range = ({s: {c:10000000, r:10000000}, e: {c:0, r:0}});
  86397. if(ws['!ref']) {
  86398. var _range = safe_decode_range(ws['!ref']);
  86399. range.s.c = _range.s.c;
  86400. range.s.r = _range.s.r;
  86401. range.e.c = Math.max(range.e.c, _range.e.c);
  86402. range.e.r = Math.max(range.e.r, _range.e.r);
  86403. if(_R == -1) range.e.r = _R = _range.e.r + 1;
  86404. }
  86405. for(var R = 0; R != data.length; ++R) {
  86406. if(!data[R]) continue;
  86407. if(!Array.isArray(data[R])) throw new Error("aoa_to_sheet expects an array of arrays");
  86408. for(var C = 0; C != data[R].length; ++C) {
  86409. if(typeof data[R][C] === 'undefined') continue;
  86410. var cell = ({v: data[R][C] });
  86411. var __R = _R + R, __C = _C + C;
  86412. if(range.s.r > __R) range.s.r = __R;
  86413. if(range.s.c > __C) range.s.c = __C;
  86414. if(range.e.r < __R) range.e.r = __R;
  86415. if(range.e.c < __C) range.e.c = __C;
  86416. if(data[R][C] && typeof data[R][C] === 'object' && !Array.isArray(data[R][C]) && !(data[R][C] instanceof Date)) cell = data[R][C];
  86417. else {
  86418. if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; }
  86419. if(cell.v === null) { if(cell.f) cell.t = 'n'; else if(!o.sheetStubs) continue; else cell.t = 'z'; }
  86420. else if(typeof cell.v === 'number') cell.t = 'n';
  86421. else if(typeof cell.v === 'boolean') cell.t = 'b';
  86422. else if(cell.v instanceof Date) {
  86423. cell.z = o.dateNF || SSF._table[14];
  86424. if(o.cellDates) { cell.t = 'd'; cell.w = SSF.format(cell.z, datenum(cell.v)); }
  86425. else { cell.t = 'n'; cell.v = datenum(cell.v); cell.w = SSF.format(cell.z, cell.v); }
  86426. }
  86427. else cell.t = 's';
  86428. }
  86429. if(dense) {
  86430. if(!ws[__R]) ws[__R] = [];
  86431. ws[__R][__C] = cell;
  86432. } else {
  86433. var cell_ref = encode_cell(({c:__C,r:__R}));
  86434. ws[cell_ref] = cell;
  86435. }
  86436. }
  86437. }
  86438. if(range.s.c < 10000000) ws['!ref'] = encode_range(range);
  86439. return ws;
  86440. }
  86441. function aoa_to_sheet(data, opts) { return sheet_add_aoa(null, data, opts); }
  86442. function write_UInt32LE(x, o) {
  86443. if(!o) o = new_buf(4);
  86444. o.write_shift(4, x);
  86445. return o;
  86446. }
  86447. /* [MS-XLSB] 2.5.168 */
  86448. function parse_XLWideString(data) {
  86449. var cchCharacters = data.read_shift(4);
  86450. return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, 'dbcs');
  86451. }
  86452. function write_XLWideString(data, o) {
  86453. var _null = false; if(o == null) { _null = true; o = new_buf(4+2*data.length); }
  86454. o.write_shift(4, data.length);
  86455. if(data.length > 0) o.write_shift(0, data, 'dbcs');
  86456. return _null ? o.slice(0, o.l) : o;
  86457. }
  86458. /* [MS-XLSB] 2.5.143 */
  86459. function parse_StrRun(data) {
  86460. return { ich: data.read_shift(2), ifnt: data.read_shift(2) };
  86461. }
  86462. function write_StrRun(run, o) {
  86463. if(!o) o = new_buf(4);
  86464. o.write_shift(2, run.ich || 0);
  86465. o.write_shift(2, run.ifnt || 0);
  86466. return o;
  86467. }
  86468. /* [MS-XLSB] 2.5.121 */
  86469. function parse_RichStr(data, length) {
  86470. var start = data.l;
  86471. var flags = data.read_shift(1);
  86472. var str = parse_XLWideString(data);
  86473. var rgsStrRun = [];
  86474. var z = ({ t: str, h: str });
  86475. if((flags & 1) !== 0) { /* fRichStr */
  86476. /* TODO: formatted string */
  86477. var dwSizeStrRun = data.read_shift(4);
  86478. for(var i = 0; i != dwSizeStrRun; ++i) rgsStrRun.push(parse_StrRun(data));
  86479. z.r = rgsStrRun;
  86480. }
  86481. else z.r = [{ich:0, ifnt:0}];
  86482. //if((flags & 2) !== 0) { /* fExtStr */
  86483. // /* TODO: phonetic string */
  86484. //}
  86485. data.l = start + length;
  86486. return z;
  86487. }
  86488. function write_RichStr(str, o) {
  86489. /* TODO: formatted string */
  86490. var _null = false; if(o == null) { _null = true; o = new_buf(15+4*str.t.length); }
  86491. o.write_shift(1,0);
  86492. write_XLWideString(str.t, o);
  86493. return _null ? o.slice(0, o.l) : o;
  86494. }
  86495. /* [MS-XLSB] 2.4.328 BrtCommentText (RichStr w/1 run) */
  86496. var parse_BrtCommentText = parse_RichStr;
  86497. function write_BrtCommentText(str, o) {
  86498. /* TODO: formatted string */
  86499. var _null = false; if(o == null) { _null = true; o = new_buf(23+4*str.t.length); }
  86500. o.write_shift(1,1);
  86501. write_XLWideString(str.t, o);
  86502. o.write_shift(4,1);
  86503. write_StrRun({ich:0,ifnt:0}, o);
  86504. return _null ? o.slice(0, o.l) : o;
  86505. }
  86506. /* [MS-XLSB] 2.5.9 */
  86507. function parse_XLSBCell(data) {
  86508. var col = data.read_shift(4);
  86509. var iStyleRef = data.read_shift(2);
  86510. iStyleRef += data.read_shift(1) <<16;
  86511. data.l++; //var fPhShow = data.read_shift(1);
  86512. return { c:col, iStyleRef: iStyleRef };
  86513. }
  86514. function write_XLSBCell(cell, o) {
  86515. if(o == null) o = new_buf(8);
  86516. o.write_shift(-4, cell.c);
  86517. o.write_shift(3, cell.iStyleRef || cell.s);
  86518. o.write_shift(1, 0); /* fPhShow */
  86519. return o;
  86520. }
  86521. /* [MS-XLSB] 2.5.21 */
  86522. var parse_XLSBCodeName = parse_XLWideString;
  86523. var write_XLSBCodeName = write_XLWideString;
  86524. /* [MS-XLSB] 2.5.166 */
  86525. function parse_XLNullableWideString(data) {
  86526. var cchCharacters = data.read_shift(4);
  86527. return cchCharacters === 0 || cchCharacters === 0xFFFFFFFF ? "" : data.read_shift(cchCharacters, 'dbcs');
  86528. }
  86529. function write_XLNullableWideString(data, o) {
  86530. var _null = false; if(o == null) { _null = true; o = new_buf(127); }
  86531. o.write_shift(4, data.length > 0 ? data.length : 0xFFFFFFFF);
  86532. if(data.length > 0) o.write_shift(0, data, 'dbcs');
  86533. return _null ? o.slice(0, o.l) : o;
  86534. }
  86535. /* [MS-XLSB] 2.5.165 */
  86536. var parse_XLNameWideString = parse_XLWideString;
  86537. //var write_XLNameWideString = write_XLWideString;
  86538. /* [MS-XLSB] 2.5.114 */
  86539. var parse_RelID = parse_XLNullableWideString;
  86540. var write_RelID = write_XLNullableWideString;
  86541. /* [MS-XLS] 2.5.217 ; [MS-XLSB] 2.5.122 */
  86542. function parse_RkNumber(data) {
  86543. var b = data.slice(data.l, data.l+4);
  86544. var fX100 = (b[0] & 1), fInt = (b[0] & 2);
  86545. data.l+=4;
  86546. b[0] &= 0xFC; // b[0] &= ~3;
  86547. var RK = fInt === 0 ? __double([0,0,0,0,b[0],b[1],b[2],b[3]],0) : __readInt32LE(b,0)>>2;
  86548. return fX100 ? (RK/100) : RK;
  86549. }
  86550. function write_RkNumber(data, o) {
  86551. if(o == null) o = new_buf(4);
  86552. var fX100 = 0, fInt = 0, d100 = data * 100;
  86553. if((data == (data | 0)) && (data >= -(1<<29)) && (data < (1 << 29))) { fInt = 1; }
  86554. else if((d100 == (d100 | 0)) && (d100 >= -(1<<29)) && (d100 < (1 << 29))) { fInt = 1; fX100 = 1; }
  86555. if(fInt) o.write_shift(-4, ((fX100 ? d100 : data) << 2) + (fX100 + 2));
  86556. else throw new Error("unsupported RkNumber " + data); // TODO
  86557. }
  86558. /* [MS-XLSB] 2.5.117 RfX */
  86559. function parse_RfX(data ) {
  86560. var cell = ({s: {}, e: {}});
  86561. cell.s.r = data.read_shift(4);
  86562. cell.e.r = data.read_shift(4);
  86563. cell.s.c = data.read_shift(4);
  86564. cell.e.c = data.read_shift(4);
  86565. return cell;
  86566. }
  86567. function write_RfX(r, o) {
  86568. if(!o) o = new_buf(16);
  86569. o.write_shift(4, r.s.r);
  86570. o.write_shift(4, r.e.r);
  86571. o.write_shift(4, r.s.c);
  86572. o.write_shift(4, r.e.c);
  86573. return o;
  86574. }
  86575. /* [MS-XLSB] 2.5.153 UncheckedRfX */
  86576. var parse_UncheckedRfX = parse_RfX;
  86577. var write_UncheckedRfX = write_RfX;
  86578. /* [MS-XLS] 2.5.342 ; [MS-XLSB] 2.5.171 */
  86579. /* TODO: error checking, NaN and Infinity values are not valid Xnum */
  86580. function parse_Xnum(data) { return data.read_shift(8, 'f'); }
  86581. function write_Xnum(data, o) { return (o || new_buf(8)).write_shift(8, data, 'f'); }
  86582. /* [MS-XLSB] 2.5.97.2 */
  86583. var BErr = {
  86584. 0x00: "#NULL!",
  86585. 0x07: "#DIV/0!",
  86586. 0x0F: "#VALUE!",
  86587. 0x17: "#REF!",
  86588. 0x1D: "#NAME?",
  86589. 0x24: "#NUM!",
  86590. 0x2A: "#N/A",
  86591. 0x2B: "#GETTING_DATA",
  86592. 0xFF: "#WTF?"
  86593. };
  86594. var RBErr = evert_num(BErr);
  86595. /* [MS-XLSB] 2.4.324 BrtColor */
  86596. function parse_BrtColor(data) {
  86597. var out = {};
  86598. var d = data.read_shift(1);
  86599. //var fValidRGB = d & 1;
  86600. var xColorType = d >>> 1;
  86601. var index = data.read_shift(1);
  86602. var nTS = data.read_shift(2, 'i');
  86603. var bR = data.read_shift(1);
  86604. var bG = data.read_shift(1);
  86605. var bB = data.read_shift(1);
  86606. data.l++; //var bAlpha = data.read_shift(1);
  86607. switch(xColorType) {
  86608. case 0: out.auto = 1; break;
  86609. case 1:
  86610. out.index = index;
  86611. var icv = XLSIcv[index];
  86612. /* automatic pseudo index 81 */
  86613. if(icv) out.rgb = rgb2Hex(icv);
  86614. break;
  86615. case 2:
  86616. /* if(!fValidRGB) throw new Error("invalid"); */
  86617. out.rgb = rgb2Hex([bR, bG, bB]);
  86618. break;
  86619. case 3: out.theme = index; break;
  86620. }
  86621. if(nTS != 0) out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;
  86622. return out;
  86623. }
  86624. function write_BrtColor(color, o) {
  86625. if(!o) o = new_buf(8);
  86626. if(!color||color.auto) { o.write_shift(4, 0); o.write_shift(4, 0); return o; }
  86627. if(color.index != null) {
  86628. o.write_shift(1, 0x02);
  86629. o.write_shift(1, color.index);
  86630. } else if(color.theme != null) {
  86631. o.write_shift(1, 0x06);
  86632. o.write_shift(1, color.theme);
  86633. } else {
  86634. o.write_shift(1, 0x05);
  86635. o.write_shift(1, 0);
  86636. }
  86637. var nTS = color.tint || 0;
  86638. if(nTS > 0) nTS *= 32767;
  86639. else if(nTS < 0) nTS *= 32768;
  86640. o.write_shift(2, nTS);
  86641. if(!color.rgb || color.theme != null) {
  86642. o.write_shift(2, 0);
  86643. o.write_shift(1, 0);
  86644. o.write_shift(1, 0);
  86645. } else {
  86646. var rgb = (color.rgb || 'FFFFFF');
  86647. if(typeof rgb == 'number') rgb = ("000000" + rgb.toString(16)).slice(-6);
  86648. o.write_shift(1, parseInt(rgb.slice(0,2),16));
  86649. o.write_shift(1, parseInt(rgb.slice(2,4),16));
  86650. o.write_shift(1, parseInt(rgb.slice(4,6),16));
  86651. o.write_shift(1, 0xFF);
  86652. }
  86653. return o;
  86654. }
  86655. /* [MS-XLSB] 2.5.52 */
  86656. function parse_FontFlags(data) {
  86657. var d = data.read_shift(1);
  86658. data.l++;
  86659. var out = {
  86660. fBold: d & 0x01,
  86661. fItalic: d & 0x02,
  86662. fUnderline: d & 0x04,
  86663. fStrikeout: d & 0x08,
  86664. fOutline: d & 0x10,
  86665. fShadow: d & 0x20,
  86666. fCondense: d & 0x40,
  86667. fExtend: d & 0x80
  86668. };
  86669. return out;
  86670. }
  86671. function write_FontFlags(font, o) {
  86672. if(!o) o = new_buf(2);
  86673. var grbit =
  86674. (font.italic ? 0x02 : 0) |
  86675. (font.strike ? 0x08 : 0) |
  86676. (font.outline ? 0x10 : 0) |
  86677. (font.shadow ? 0x20 : 0) |
  86678. (font.condense ? 0x40 : 0) |
  86679. (font.extend ? 0x80 : 0);
  86680. o.write_shift(1, grbit);
  86681. o.write_shift(1, 0);
  86682. return o;
  86683. }
  86684. /* [MS-OLEDS] 2.3.1 and 2.3.2 */
  86685. function parse_ClipboardFormatOrString(o, w) {
  86686. // $FlowIgnore
  86687. var ClipFmt = {2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"};
  86688. var m = o.read_shift(4);
  86689. switch(m) {
  86690. case 0x00000000: return "";
  86691. case 0xffffffff: case 0xfffffffe: return ClipFmt[o.read_shift(4)]||"";
  86692. }
  86693. if(m > 0x190) throw new Error("Unsupported Clipboard: " + m.toString(16));
  86694. o.l -= 4;
  86695. return o.read_shift(0, w == 1 ? "lpstr" : "lpwstr");
  86696. }
  86697. function parse_ClipboardFormatOrAnsiString(o) { return parse_ClipboardFormatOrString(o, 1); }
  86698. function parse_ClipboardFormatOrUnicodeString(o) { return parse_ClipboardFormatOrString(o, 2); }
  86699. /* [MS-OLEPS] 2.2 PropertyType */
  86700. //var VT_EMPTY = 0x0000;
  86701. //var VT_NULL = 0x0001;
  86702. var VT_I2 = 0x0002;
  86703. var VT_I4 = 0x0003;
  86704. //var VT_R4 = 0x0004;
  86705. //var VT_R8 = 0x0005;
  86706. //var VT_CY = 0x0006;
  86707. //var VT_DATE = 0x0007;
  86708. //var VT_BSTR = 0x0008;
  86709. //var VT_ERROR = 0x000A;
  86710. var VT_BOOL = 0x000B;
  86711. var VT_VARIANT = 0x000C;
  86712. //var VT_DECIMAL = 0x000E;
  86713. //var VT_I1 = 0x0010;
  86714. //var VT_UI1 = 0x0011;
  86715. //var VT_UI2 = 0x0012;
  86716. var VT_UI4 = 0x0013;
  86717. //var VT_I8 = 0x0014;
  86718. //var VT_UI8 = 0x0015;
  86719. //var VT_INT = 0x0016;
  86720. //var VT_UINT = 0x0017;
  86721. var VT_LPSTR = 0x001E;
  86722. //var VT_LPWSTR = 0x001F;
  86723. var VT_FILETIME = 0x0040;
  86724. var VT_BLOB = 0x0041;
  86725. //var VT_STREAM = 0x0042;
  86726. //var VT_STORAGE = 0x0043;
  86727. //var VT_STREAMED_Object = 0x0044;
  86728. //var VT_STORED_Object = 0x0045;
  86729. //var VT_BLOB_Object = 0x0046;
  86730. var VT_CF = 0x0047;
  86731. //var VT_CLSID = 0x0048;
  86732. //var VT_VERSIONED_STREAM = 0x0049;
  86733. var VT_VECTOR = 0x1000;
  86734. //var VT_ARRAY = 0x2000;
  86735. var VT_STRING = 0x0050; // 2.3.3.1.11 VtString
  86736. var VT_USTR = 0x0051; // 2.3.3.1.12 VtUnalignedString
  86737. var VT_CUSTOM = [VT_STRING, VT_USTR];
  86738. /* [MS-OSHARED] 2.3.3.2.2.1 Document Summary Information PIDDSI */
  86739. var DocSummaryPIDDSI = {
  86740. 0x01: { n: 'CodePage', t: VT_I2 },
  86741. 0x02: { n: 'Category', t: VT_STRING },
  86742. 0x03: { n: 'PresentationFormat', t: VT_STRING },
  86743. 0x04: { n: 'ByteCount', t: VT_I4 },
  86744. 0x05: { n: 'LineCount', t: VT_I4 },
  86745. 0x06: { n: 'ParagraphCount', t: VT_I4 },
  86746. 0x07: { n: 'SlideCount', t: VT_I4 },
  86747. 0x08: { n: 'NoteCount', t: VT_I4 },
  86748. 0x09: { n: 'HiddenCount', t: VT_I4 },
  86749. 0x0a: { n: 'MultimediaClipCount', t: VT_I4 },
  86750. 0x0b: { n: 'ScaleCrop', t: VT_BOOL },
  86751. 0x0c: { n: 'HeadingPairs', t: VT_VECTOR | VT_VARIANT },
  86752. 0x0d: { n: 'TitlesOfParts', t: VT_VECTOR | VT_LPSTR },
  86753. 0x0e: { n: 'Manager', t: VT_STRING },
  86754. 0x0f: { n: 'Company', t: VT_STRING },
  86755. 0x10: { n: 'LinksUpToDate', t: VT_BOOL },
  86756. 0x11: { n: 'CharacterCount', t: VT_I4 },
  86757. 0x13: { n: 'SharedDoc', t: VT_BOOL },
  86758. 0x16: { n: 'HyperlinksChanged', t: VT_BOOL },
  86759. 0x17: { n: 'AppVersion', t: VT_I4, p: 'version' },
  86760. 0x18: { n: 'DigSig', t: VT_BLOB },
  86761. 0x1A: { n: 'ContentType', t: VT_STRING },
  86762. 0x1B: { n: 'ContentStatus', t: VT_STRING },
  86763. 0x1C: { n: 'Language', t: VT_STRING },
  86764. 0x1D: { n: 'Version', t: VT_STRING },
  86765. 0xFF: {}
  86766. };
  86767. /* [MS-OSHARED] 2.3.3.2.1.1 Summary Information Property Set PIDSI */
  86768. var SummaryPIDSI = {
  86769. 0x01: { n: 'CodePage', t: VT_I2 },
  86770. 0x02: { n: 'Title', t: VT_STRING },
  86771. 0x03: { n: 'Subject', t: VT_STRING },
  86772. 0x04: { n: 'Author', t: VT_STRING },
  86773. 0x05: { n: 'Keywords', t: VT_STRING },
  86774. 0x06: { n: 'Comments', t: VT_STRING },
  86775. 0x07: { n: 'Template', t: VT_STRING },
  86776. 0x08: { n: 'LastAuthor', t: VT_STRING },
  86777. 0x09: { n: 'RevNumber', t: VT_STRING },
  86778. 0x0A: { n: 'EditTime', t: VT_FILETIME },
  86779. 0x0B: { n: 'LastPrinted', t: VT_FILETIME },
  86780. 0x0C: { n: 'CreatedDate', t: VT_FILETIME },
  86781. 0x0D: { n: 'ModifiedDate', t: VT_FILETIME },
  86782. 0x0E: { n: 'PageCount', t: VT_I4 },
  86783. 0x0F: { n: 'WordCount', t: VT_I4 },
  86784. 0x10: { n: 'CharCount', t: VT_I4 },
  86785. 0x11: { n: 'Thumbnail', t: VT_CF },
  86786. 0x12: { n: 'Application', t: VT_STRING },
  86787. 0x13: { n: 'DocSecurity', t: VT_I4 },
  86788. 0xFF: {}
  86789. };
  86790. /* [MS-OLEPS] 2.18 */
  86791. var SpecialProperties = {
  86792. 0x80000000: { n: 'Locale', t: VT_UI4 },
  86793. 0x80000003: { n: 'Behavior', t: VT_UI4 },
  86794. 0x72627262: {}
  86795. };
  86796. (function() {
  86797. for(var y in SpecialProperties) if(SpecialProperties.hasOwnProperty(y))
  86798. DocSummaryPIDDSI[y] = SummaryPIDSI[y] = SpecialProperties[y];
  86799. })();
  86800. var DocSummaryRE = evert_key(DocSummaryPIDDSI, "n");
  86801. var SummaryRE = evert_key(SummaryPIDSI, "n");
  86802. /* [MS-XLS] 2.4.63 Country/Region codes */
  86803. var CountryEnum = {
  86804. 0x0001: "US", // United States
  86805. 0x0002: "CA", // Canada
  86806. 0x0003: "", // Latin America (except Brazil)
  86807. 0x0007: "RU", // Russia
  86808. 0x0014: "EG", // Egypt
  86809. 0x001E: "GR", // Greece
  86810. 0x001F: "NL", // Netherlands
  86811. 0x0020: "BE", // Belgium
  86812. 0x0021: "FR", // France
  86813. 0x0022: "ES", // Spain
  86814. 0x0024: "HU", // Hungary
  86815. 0x0027: "IT", // Italy
  86816. 0x0029: "CH", // Switzerland
  86817. 0x002B: "AT", // Austria
  86818. 0x002C: "GB", // United Kingdom
  86819. 0x002D: "DK", // Denmark
  86820. 0x002E: "SE", // Sweden
  86821. 0x002F: "NO", // Norway
  86822. 0x0030: "PL", // Poland
  86823. 0x0031: "DE", // Germany
  86824. 0x0034: "MX", // Mexico
  86825. 0x0037: "BR", // Brazil
  86826. 0x003d: "AU", // Australia
  86827. 0x0040: "NZ", // New Zealand
  86828. 0x0042: "TH", // Thailand
  86829. 0x0051: "JP", // Japan
  86830. 0x0052: "KR", // Korea
  86831. 0x0054: "VN", // Viet Nam
  86832. 0x0056: "CN", // China
  86833. 0x005A: "TR", // Turkey
  86834. 0x0069: "JS", // Ramastan
  86835. 0x00D5: "DZ", // Algeria
  86836. 0x00D8: "MA", // Morocco
  86837. 0x00DA: "LY", // Libya
  86838. 0x015F: "PT", // Portugal
  86839. 0x0162: "IS", // Iceland
  86840. 0x0166: "FI", // Finland
  86841. 0x01A4: "CZ", // Czech Republic
  86842. 0x0376: "TW", // Taiwan
  86843. 0x03C1: "LB", // Lebanon
  86844. 0x03C2: "JO", // Jordan
  86845. 0x03C3: "SY", // Syria
  86846. 0x03C4: "IQ", // Iraq
  86847. 0x03C5: "KW", // Kuwait
  86848. 0x03C6: "SA", // Saudi Arabia
  86849. 0x03CB: "AE", // United Arab Emirates
  86850. 0x03CC: "IL", // Israel
  86851. 0x03CE: "QA", // Qatar
  86852. 0x03D5: "IR", // Iran
  86853. 0xFFFF: "US" // United States
  86854. };
  86855. /* [MS-XLS] 2.5.127 */
  86856. var XLSFillPattern = [
  86857. null,
  86858. 'solid',
  86859. 'mediumGray',
  86860. 'darkGray',
  86861. 'lightGray',
  86862. 'darkHorizontal',
  86863. 'darkVertical',
  86864. 'darkDown',
  86865. 'darkUp',
  86866. 'darkGrid',
  86867. 'darkTrellis',
  86868. 'lightHorizontal',
  86869. 'lightVertical',
  86870. 'lightDown',
  86871. 'lightUp',
  86872. 'lightGrid',
  86873. 'lightTrellis',
  86874. 'gray125',
  86875. 'gray0625'
  86876. ];
  86877. function rgbify(arr) { return arr.map(function(x) { return [(x>>16)&255,(x>>8)&255,x&255]; }); }
  86878. /* [MS-XLS] 2.5.161 */
  86879. /* [MS-XLSB] 2.5.75 Icv */
  86880. var _XLSIcv = rgbify([
  86881. /* Color Constants */
  86882. 0x000000,
  86883. 0xFFFFFF,
  86884. 0xFF0000,
  86885. 0x00FF00,
  86886. 0x0000FF,
  86887. 0xFFFF00,
  86888. 0xFF00FF,
  86889. 0x00FFFF,
  86890. /* Overridable Defaults */
  86891. 0x000000,
  86892. 0xFFFFFF,
  86893. 0xFF0000,
  86894. 0x00FF00,
  86895. 0x0000FF,
  86896. 0xFFFF00,
  86897. 0xFF00FF,
  86898. 0x00FFFF,
  86899. 0x800000,
  86900. 0x008000,
  86901. 0x000080,
  86902. 0x808000,
  86903. 0x800080,
  86904. 0x008080,
  86905. 0xC0C0C0,
  86906. 0x808080,
  86907. 0x9999FF,
  86908. 0x993366,
  86909. 0xFFFFCC,
  86910. 0xCCFFFF,
  86911. 0x660066,
  86912. 0xFF8080,
  86913. 0x0066CC,
  86914. 0xCCCCFF,
  86915. 0x000080,
  86916. 0xFF00FF,
  86917. 0xFFFF00,
  86918. 0x00FFFF,
  86919. 0x800080,
  86920. 0x800000,
  86921. 0x008080,
  86922. 0x0000FF,
  86923. 0x00CCFF,
  86924. 0xCCFFFF,
  86925. 0xCCFFCC,
  86926. 0xFFFF99,
  86927. 0x99CCFF,
  86928. 0xFF99CC,
  86929. 0xCC99FF,
  86930. 0xFFCC99,
  86931. 0x3366FF,
  86932. 0x33CCCC,
  86933. 0x99CC00,
  86934. 0xFFCC00,
  86935. 0xFF9900,
  86936. 0xFF6600,
  86937. 0x666699,
  86938. 0x969696,
  86939. 0x003366,
  86940. 0x339966,
  86941. 0x003300,
  86942. 0x333300,
  86943. 0x993300,
  86944. 0x993366,
  86945. 0x333399,
  86946. 0x333333,
  86947. /* Other entries to appease BIFF8/12 */
  86948. 0xFFFFFF, /* 0x40 icvForeground ?? */
  86949. 0x000000, /* 0x41 icvBackground ?? */
  86950. 0x000000, /* 0x42 icvFrame ?? */
  86951. 0x000000, /* 0x43 icv3D ?? */
  86952. 0x000000, /* 0x44 icv3DText ?? */
  86953. 0x000000, /* 0x45 icv3DHilite ?? */
  86954. 0x000000, /* 0x46 icv3DShadow ?? */
  86955. 0x000000, /* 0x47 icvHilite ?? */
  86956. 0x000000, /* 0x48 icvCtlText ?? */
  86957. 0x000000, /* 0x49 icvCtlScrl ?? */
  86958. 0x000000, /* 0x4A icvCtlInv ?? */
  86959. 0x000000, /* 0x4B icvCtlBody ?? */
  86960. 0x000000, /* 0x4C icvCtlFrame ?? */
  86961. 0x000000, /* 0x4D icvCtlFore ?? */
  86962. 0x000000, /* 0x4E icvCtlBack ?? */
  86963. 0x000000, /* 0x4F icvCtlNeutral */
  86964. 0x000000, /* 0x50 icvInfoBk ?? */
  86965. 0x000000 /* 0x51 icvInfoText ?? */
  86966. ]);
  86967. var XLSIcv = dup(_XLSIcv);
  86968. /* Parts enumerated in OPC spec, MS-XLSB and MS-XLSX */
  86969. /* 12.3 Part Summary <SpreadsheetML> */
  86970. /* 14.2 Part Summary <DrawingML> */
  86971. /* [MS-XLSX] 2.1 Part Enumerations ; [MS-XLSB] 2.1.7 Part Enumeration */
  86972. var ct2type/*{[string]:string}*/ = ({
  86973. /* Workbook */
  86974. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
  86975. /* Worksheet */
  86976. "application/vnd.ms-excel.binIndexWs": "TODO", /* Binary Index */
  86977. /* Macrosheet */
  86978. "application/vnd.ms-excel.intlmacrosheet": "TODO",
  86979. "application/vnd.ms-excel.binIndexMs": "TODO", /* Binary Index */
  86980. /* File Properties */
  86981. "application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
  86982. "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
  86983. "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
  86984. /* Custom Data Properties */
  86985. "application/vnd.openxmlformats-officedocument.customXmlProperties+xml": "TODO",
  86986. "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty": "TODO",
  86987. /* PivotTable */
  86988. "application/vnd.ms-excel.pivotTable": "TODO",
  86989. "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml": "TODO",
  86990. /* Chart Objects */
  86991. "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": "TODO",
  86992. /* Chart Colors */
  86993. "application/vnd.ms-office.chartcolorstyle+xml": "TODO",
  86994. /* Chart Style */
  86995. "application/vnd.ms-office.chartstyle+xml": "TODO",
  86996. /* Chart Advanced */
  86997. "application/vnd.ms-office.chartex+xml": "TODO",
  86998. /* Calculation Chain */
  86999. "application/vnd.ms-excel.calcChain": "calcchains",
  87000. "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml": "calcchains",
  87001. /* Printer Settings */
  87002. "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings": "TODO",
  87003. /* ActiveX */
  87004. "application/vnd.ms-office.activeX": "TODO",
  87005. "application/vnd.ms-office.activeX+xml": "TODO",
  87006. /* Custom Toolbars */
  87007. "application/vnd.ms-excel.attachedToolbars": "TODO",
  87008. /* External Data Connections */
  87009. "application/vnd.ms-excel.connections": "TODO",
  87010. "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": "TODO",
  87011. /* External Links */
  87012. "application/vnd.ms-excel.externalLink": "links",
  87013. "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
  87014. /* Metadata */
  87015. "application/vnd.ms-excel.sheetMetadata": "TODO",
  87016. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "TODO",
  87017. /* PivotCache */
  87018. "application/vnd.ms-excel.pivotCacheDefinition": "TODO",
  87019. "application/vnd.ms-excel.pivotCacheRecords": "TODO",
  87020. "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml": "TODO",
  87021. "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml": "TODO",
  87022. /* Query Table */
  87023. "application/vnd.ms-excel.queryTable": "TODO",
  87024. "application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml": "TODO",
  87025. /* Shared Workbook */
  87026. "application/vnd.ms-excel.userNames": "TODO",
  87027. "application/vnd.ms-excel.revisionHeaders": "TODO",
  87028. "application/vnd.ms-excel.revisionLog": "TODO",
  87029. "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml": "TODO",
  87030. "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml": "TODO",
  87031. "application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml": "TODO",
  87032. /* Single Cell Table */
  87033. "application/vnd.ms-excel.tableSingleCells": "TODO",
  87034. "application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml": "TODO",
  87035. /* Slicer */
  87036. "application/vnd.ms-excel.slicer": "TODO",
  87037. "application/vnd.ms-excel.slicerCache": "TODO",
  87038. "application/vnd.ms-excel.slicer+xml": "TODO",
  87039. "application/vnd.ms-excel.slicerCache+xml": "TODO",
  87040. /* Sort Map */
  87041. "application/vnd.ms-excel.wsSortMap": "TODO",
  87042. /* Table */
  87043. "application/vnd.ms-excel.table": "TODO",
  87044. "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": "TODO",
  87045. /* Themes */
  87046. "application/vnd.openxmlformats-officedocument.theme+xml": "themes",
  87047. /* Theme Override */
  87048. "application/vnd.openxmlformats-officedocument.themeOverride+xml": "TODO",
  87049. /* Timeline */
  87050. "application/vnd.ms-excel.Timeline+xml": "TODO", /* verify */
  87051. "application/vnd.ms-excel.TimelineCache+xml": "TODO", /* verify */
  87052. /* VBA */
  87053. "application/vnd.ms-office.vbaProject": "vba",
  87054. "application/vnd.ms-office.vbaProjectSignature": "vba",
  87055. /* Volatile Dependencies */
  87056. "application/vnd.ms-office.volatileDependencies": "TODO",
  87057. "application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml": "TODO",
  87058. /* Control Properties */
  87059. "application/vnd.ms-excel.controlproperties+xml": "TODO",
  87060. /* Data Model */
  87061. "application/vnd.openxmlformats-officedocument.model+data": "TODO",
  87062. /* Survey */
  87063. "application/vnd.ms-excel.Survey+xml": "TODO",
  87064. /* Drawing */
  87065. "application/vnd.openxmlformats-officedocument.drawing+xml": "drawings",
  87066. "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": "TODO",
  87067. "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml": "TODO",
  87068. "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml": "TODO",
  87069. "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml": "TODO",
  87070. "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml": "TODO",
  87071. /* VML */
  87072. "application/vnd.openxmlformats-officedocument.vmlDrawing": "TODO",
  87073. "application/vnd.openxmlformats-package.relationships+xml": "rels",
  87074. "application/vnd.openxmlformats-officedocument.oleObject": "TODO",
  87075. /* Image */
  87076. "image/png": "TODO",
  87077. "sheet": "js"
  87078. });
  87079. var CT_LIST = (function(){
  87080. var o = {
  87081. workbooks: {
  87082. xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
  87083. xlsm: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
  87084. xlsb: "application/vnd.ms-excel.sheet.binary.macroEnabled.main",
  87085. xlam: "application/vnd.ms-excel.addin.macroEnabled.main+xml",
  87086. xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"
  87087. },
  87088. strs: { /* Shared Strings */
  87089. xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
  87090. xlsb: "application/vnd.ms-excel.sharedStrings"
  87091. },
  87092. comments: { /* Comments */
  87093. xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
  87094. xlsb: "application/vnd.ms-excel.comments"
  87095. },
  87096. sheets: { /* Worksheet */
  87097. xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
  87098. xlsb: "application/vnd.ms-excel.worksheet"
  87099. },
  87100. charts: { /* Chartsheet */
  87101. xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",
  87102. xlsb: "application/vnd.ms-excel.chartsheet"
  87103. },
  87104. dialogs: { /* Dialogsheet */
  87105. xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",
  87106. xlsb: "application/vnd.ms-excel.dialogsheet"
  87107. },
  87108. macros: { /* Macrosheet (Excel 4.0 Macros) */
  87109. xlsx: "application/vnd.ms-excel.macrosheet+xml",
  87110. xlsb: "application/vnd.ms-excel.macrosheet"
  87111. },
  87112. styles: { /* Styles */
  87113. xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
  87114. xlsb: "application/vnd.ms-excel.styles"
  87115. }
  87116. };
  87117. keys(o).forEach(function(k) { ["xlsm", "xlam"].forEach(function(v) { if(!o[k][v]) o[k][v] = o[k].xlsx; }); });
  87118. keys(o).forEach(function(k){ keys(o[k]).forEach(function(v) { ct2type[o[k][v]] = k; }); });
  87119. return o;
  87120. })();
  87121. var type2ct/*{[string]:Array<string>}*/ = evert_arr(ct2type);
  87122. XMLNS.CT = 'http://schemas.openxmlformats.org/package/2006/content-types';
  87123. function new_ct() {
  87124. return ({
  87125. workbooks:[], sheets:[], charts:[], dialogs:[], macros:[],
  87126. rels:[], strs:[], comments:[], links:[],
  87127. coreprops:[], extprops:[], custprops:[], themes:[], styles:[],
  87128. calcchains:[], vba: [], drawings: [],
  87129. TODO:[], xmlns: "" });
  87130. }
  87131. function parse_ct(data) {
  87132. var ct = new_ct();
  87133. if(!data || !data.match) return ct;
  87134. var ctext = {};
  87135. (data.match(tagregex)||[]).forEach(function(x) {
  87136. var y = parsexmltag(x);
  87137. switch(y[0].replace(nsregex,"<")) {
  87138. case '<?xml': break;
  87139. case '<Types': ct.xmlns = y['xmlns' + (y[0].match(/<(\w+):/)||["",""])[1] ]; break;
  87140. case '<Default': ctext[y.Extension] = y.ContentType; break;
  87141. case '<Override':
  87142. if(ct[ct2type[y.ContentType]] !== undefined) ct[ct2type[y.ContentType]].push(y.PartName);
  87143. break;
  87144. }
  87145. });
  87146. if(ct.xmlns !== XMLNS.CT) throw new Error("Unknown Namespace: " + ct.xmlns);
  87147. ct.calcchain = ct.calcchains.length > 0 ? ct.calcchains[0] : "";
  87148. ct.sst = ct.strs.length > 0 ? ct.strs[0] : "";
  87149. ct.style = ct.styles.length > 0 ? ct.styles[0] : "";
  87150. ct.defaults = ctext;
  87151. delete ct.calcchains;
  87152. return ct;
  87153. }
  87154. var CTYPE_XML_ROOT = writextag('Types', null, {
  87155. 'xmlns': XMLNS.CT,
  87156. 'xmlns:xsd': XMLNS.xsd,
  87157. 'xmlns:xsi': XMLNS.xsi
  87158. });
  87159. var CTYPE_DEFAULTS = [
  87160. ['xml', 'application/xml'],
  87161. ['bin', 'application/vnd.ms-excel.sheet.binary.macroEnabled.main'],
  87162. ['vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing'],
  87163. ['data', 'application/vnd.openxmlformats-officedocument.model+data'],
  87164. /* from test files */
  87165. ['bmp', 'image/bmp'],
  87166. ['png', 'image/png'],
  87167. ['gif', 'image/gif'],
  87168. ['emf', 'image/x-emf'],
  87169. ['wmf', 'image/x-wmf'],
  87170. ['jpg', 'image/jpeg'], ['jpeg', 'image/jpeg'],
  87171. ['tif', 'image/tiff'], ['tiff', 'image/tiff'],
  87172. ['pdf', 'application/pdf'],
  87173. ['rels', type2ct.rels[0]]
  87174. ].map(function(x) {
  87175. return writextag('Default', null, {'Extension':x[0], 'ContentType': x[1]});
  87176. });
  87177. function write_ct(ct, opts) {
  87178. var o = [], v;
  87179. o[o.length] = (XML_HEADER);
  87180. o[o.length] = (CTYPE_XML_ROOT);
  87181. o = o.concat(CTYPE_DEFAULTS);
  87182. /* only write first instance */
  87183. var f1 = function(w) {
  87184. if(ct[w] && ct[w].length > 0) {
  87185. v = ct[w][0];
  87186. o[o.length] = (writextag('Override', null, {
  87187. 'PartName': (v[0] == '/' ? "":"/") + v,
  87188. 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
  87189. }));
  87190. }
  87191. };
  87192. /* book type-specific */
  87193. var f2 = function(w) {
  87194. (ct[w]||[]).forEach(function(v) {
  87195. o[o.length] = (writextag('Override', null, {
  87196. 'PartName': (v[0] == '/' ? "":"/") + v,
  87197. 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
  87198. }));
  87199. });
  87200. };
  87201. /* standard type */
  87202. var f3 = function(t) {
  87203. (ct[t]||[]).forEach(function(v) {
  87204. o[o.length] = (writextag('Override', null, {
  87205. 'PartName': (v[0] == '/' ? "":"/") + v,
  87206. 'ContentType': type2ct[t][0]
  87207. }));
  87208. });
  87209. };
  87210. f1('workbooks');
  87211. f2('sheets');
  87212. f2('charts');
  87213. f3('themes');
  87214. ['strs', 'styles'].forEach(f1);
  87215. ['coreprops', 'extprops', 'custprops'].forEach(f3);
  87216. f3('vba');
  87217. f3('comments');
  87218. f3('drawings');
  87219. if(o.length>2){ o[o.length] = ('</Types>'); o[1]=o[1].replace("/>",">"); }
  87220. return o.join("");
  87221. }
  87222. /* 9.3 Relationships */
  87223. var RELS = ({
  87224. WB: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
  87225. SHEET: "http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
  87226. HLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
  87227. VML: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
  87228. XPATH: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",
  87229. XMISS: "http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",
  87230. XLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
  87231. VBA: "http://schemas.microsoft.com/office/2006/relationships/vbaProject"
  87232. });
  87233. /* 9.3.3 Representing Relationships */
  87234. function get_rels_path(file) {
  87235. var n = file.lastIndexOf("/");
  87236. return file.slice(0,n+1) + '_rels/' + file.slice(n+1) + ".rels";
  87237. }
  87238. function parse_rels(data, currentFilePath) {
  87239. var rels = {"!id":{}};
  87240. if (!data) return rels;
  87241. if (currentFilePath.charAt(0) !== '/') {
  87242. currentFilePath = '/'+currentFilePath;
  87243. }
  87244. var hash = {};
  87245. (data.match(tagregex)||[]).forEach(function(x) {
  87246. var y = parsexmltag(x);
  87247. /* 9.3.2.2 OPC_Relationships */
  87248. if (y[0] === '<Relationship') {
  87249. var rel = {}; rel.Type = y.Type; rel.Target = y.Target; rel.Id = y.Id; rel.TargetMode = y.TargetMode;
  87250. var canonictarget = y.TargetMode === 'External' ? y.Target : resolve_path(y.Target, currentFilePath);
  87251. rels[canonictarget] = rel;
  87252. hash[y.Id] = rel;
  87253. }
  87254. });
  87255. rels["!id"] = hash;
  87256. return rels;
  87257. }
  87258. XMLNS.RELS = 'http://schemas.openxmlformats.org/package/2006/relationships';
  87259. var RELS_ROOT = writextag('Relationships', null, {
  87260. //'xmlns:ns0': XMLNS.RELS,
  87261. 'xmlns': XMLNS.RELS
  87262. });
  87263. /* TODO */
  87264. function write_rels(rels) {
  87265. var o = [XML_HEADER, RELS_ROOT];
  87266. keys(rels['!id']).forEach(function(rid) {
  87267. o[o.length] = (writextag('Relationship', null, rels['!id'][rid]));
  87268. });
  87269. if(o.length>2){ o[o.length] = ('</Relationships>'); o[1]=o[1].replace("/>",">"); }
  87270. return o.join("");
  87271. }
  87272. var RELS_EXTERN = [RELS.HLINK, RELS.XPATH, RELS.XMISS];
  87273. function add_rels(rels, rId, f, type, relobj, targetmode) {
  87274. if(!relobj) relobj = {};
  87275. if(!rels['!id']) rels['!id'] = {};
  87276. if(rId < 0) for(rId = 1; rels['!id']['rId' + rId]; ++rId){/* empty */}
  87277. relobj.Id = 'rId' + rId;
  87278. relobj.Type = type;
  87279. relobj.Target = f;
  87280. if(targetmode) relobj.TargetMode = targetmode;
  87281. else if(RELS_EXTERN.indexOf(relobj.Type) > -1) relobj.TargetMode = "External";
  87282. if(rels['!id'][relobj.Id]) throw new Error("Cannot rewrite rId " + rId);
  87283. rels['!id'][relobj.Id] = relobj;
  87284. rels[('/' + relobj.Target).replace("//","/")] = relobj;
  87285. return rId;
  87286. }
  87287. /* Open Document Format for Office Applications (OpenDocument) Version 1.2 */
  87288. /* Part 3 Section 4 Manifest File */
  87289. var CT_ODS = "application/vnd.oasis.opendocument.spreadsheet";
  87290. function parse_manifest(d, opts) {
  87291. var str = xlml_normalize(d);
  87292. var Rn;
  87293. var FEtag;
  87294. while((Rn = xlmlregex.exec(str))) switch(Rn[3]) {
  87295. case 'manifest': break; // 4.2 <manifest:manifest>
  87296. case 'file-entry': // 4.3 <manifest:file-entry>
  87297. FEtag = parsexmltag(Rn[0], false);
  87298. if(FEtag.path == '/' && FEtag.type !== CT_ODS) throw new Error("This OpenDocument is not a spreadsheet");
  87299. break;
  87300. case 'encryption-data': // 4.4 <manifest:encryption-data>
  87301. case 'algorithm': // 4.5 <manifest:algorithm>
  87302. case 'start-key-generation': // 4.6 <manifest:start-key-generation>
  87303. case 'key-derivation': // 4.7 <manifest:key-derivation>
  87304. throw new Error("Unsupported ODS Encryption");
  87305. default: if(opts && opts.WTF) throw Rn;
  87306. }
  87307. }
  87308. function write_manifest(manifest) {
  87309. var o = [XML_HEADER];
  87310. o.push('<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n');
  87311. o.push(' <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n');
  87312. for(var i = 0; i < manifest.length; ++i) o.push(' <manifest:file-entry manifest:full-path="' + manifest[i][0] + '" manifest:media-type="' + manifest[i][1] + '"/>\n');
  87313. o.push('</manifest:manifest>');
  87314. return o.join("");
  87315. }
  87316. /* Part 3 Section 6 Metadata Manifest File */
  87317. function write_rdf_type(file, res, tag) {
  87318. return [
  87319. ' <rdf:Description rdf:about="' + file + '">\n',
  87320. ' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/' + (tag || "odf") + '#' + res + '"/>\n',
  87321. ' </rdf:Description>\n'
  87322. ].join("");
  87323. }
  87324. function write_rdf_has(base, file) {
  87325. return [
  87326. ' <rdf:Description rdf:about="' + base + '">\n',
  87327. ' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="' + file + '"/>\n',
  87328. ' </rdf:Description>\n'
  87329. ].join("");
  87330. }
  87331. function write_rdf(rdf) {
  87332. var o = [XML_HEADER];
  87333. o.push('<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n');
  87334. for(var i = 0; i != rdf.length; ++i) {
  87335. o.push(write_rdf_type(rdf[i][0], rdf[i][1]));
  87336. o.push(write_rdf_has("",rdf[i][0]));
  87337. }
  87338. o.push(write_rdf_type("","Document", "pkg"));
  87339. o.push('</rdf:RDF>');
  87340. return o.join("");
  87341. }
  87342. /* TODO: pull properties */
  87343. var write_meta_ods = (function() {
  87344. var payload = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>Sheet' + 'JS ' + XLSX.version + '</meta:generator></office:meta></office:document-meta>';
  87345. return function wmo() {
  87346. return payload;
  87347. };
  87348. })();
  87349. /* ECMA-376 Part II 11.1 Core Properties Part */
  87350. /* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */
  87351. var CORE_PROPS = [
  87352. ["cp:category", "Category"],
  87353. ["cp:contentStatus", "ContentStatus"],
  87354. ["cp:keywords", "Keywords"],
  87355. ["cp:lastModifiedBy", "LastAuthor"],
  87356. ["cp:lastPrinted", "LastPrinted"],
  87357. ["cp:revision", "RevNumber"],
  87358. ["cp:version", "Version"],
  87359. ["dc:creator", "Author"],
  87360. ["dc:description", "Comments"],
  87361. ["dc:identifier", "Identifier"],
  87362. ["dc:language", "Language"],
  87363. ["dc:subject", "Subject"],
  87364. ["dc:title", "Title"],
  87365. ["dcterms:created", "CreatedDate", 'date'],
  87366. ["dcterms:modified", "ModifiedDate", 'date']
  87367. ];
  87368. XMLNS.CORE_PROPS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
  87369. RELS.CORE_PROPS = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties';
  87370. var CORE_PROPS_REGEX = (function() {
  87371. var r = new Array(CORE_PROPS.length);
  87372. for(var i = 0; i < CORE_PROPS.length; ++i) {
  87373. var f = CORE_PROPS[i];
  87374. var g = "(?:"+ f[0].slice(0,f[0].indexOf(":")) +":)"+ f[0].slice(f[0].indexOf(":")+1);
  87375. r[i] = new RegExp("<" + g + "[^>]*>([\\s\\S]*?)<\/" + g + ">");
  87376. }
  87377. return r;
  87378. })();
  87379. function parse_core_props(data) {
  87380. var p = {};
  87381. data = utf8read(data);
  87382. for(var i = 0; i < CORE_PROPS.length; ++i) {
  87383. var f = CORE_PROPS[i], cur = data.match(CORE_PROPS_REGEX[i]);
  87384. if(cur != null && cur.length > 0) p[f[1]] = cur[1];
  87385. if(f[2] === 'date' && p[f[1]]) p[f[1]] = parseDate(p[f[1]]);
  87386. }
  87387. return p;
  87388. }
  87389. var CORE_PROPS_XML_ROOT = writextag('cp:coreProperties', null, {
  87390. //'xmlns': XMLNS.CORE_PROPS,
  87391. 'xmlns:cp': XMLNS.CORE_PROPS,
  87392. 'xmlns:dc': XMLNS.dc,
  87393. 'xmlns:dcterms': XMLNS.dcterms,
  87394. 'xmlns:dcmitype': XMLNS.dcmitype,
  87395. 'xmlns:xsi': XMLNS.xsi
  87396. });
  87397. function cp_doit(f, g, h, o, p) {
  87398. if(p[f] != null || g == null || g === "") return;
  87399. p[f] = g;
  87400. o[o.length] = (h ? writextag(f,g,h) : writetag(f,g));
  87401. }
  87402. function write_core_props(cp, _opts) {
  87403. var opts = _opts || {};
  87404. var o = [XML_HEADER, CORE_PROPS_XML_ROOT], p = {};
  87405. if(!cp && !opts.Props) return o.join("");
  87406. if(cp) {
  87407. if(cp.CreatedDate != null) cp_doit("dcterms:created", typeof cp.CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p);
  87408. if(cp.ModifiedDate != null) cp_doit("dcterms:modified", typeof cp.ModifiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p);
  87409. }
  87410. for(var i = 0; i != CORE_PROPS.length; ++i) {
  87411. var f = CORE_PROPS[i];
  87412. var v = opts.Props && opts.Props[f[1]] != null ? opts.Props[f[1]] : cp ? cp[f[1]] : null;
  87413. if(v === true) v = "1";
  87414. else if(v === false) v = "0";
  87415. else if(typeof v == "number") v = String(v);
  87416. if(v != null) cp_doit(f[0], v, null, o, p);
  87417. }
  87418. if(o.length>2){ o[o.length] = ('</cp:coreProperties>'); o[1]=o[1].replace("/>",">"); }
  87419. return o.join("");
  87420. }
  87421. /* 15.2.12.3 Extended File Properties Part */
  87422. /* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */
  87423. var EXT_PROPS = [
  87424. ["Application", "Application", "string"],
  87425. ["AppVersion", "AppVersion", "string"],
  87426. ["Company", "Company", "string"],
  87427. ["DocSecurity", "DocSecurity", "string"],
  87428. ["Manager", "Manager", "string"],
  87429. ["HyperlinksChanged", "HyperlinksChanged", "bool"],
  87430. ["SharedDoc", "SharedDoc", "bool"],
  87431. ["LinksUpToDate", "LinksUpToDate", "bool"],
  87432. ["ScaleCrop", "ScaleCrop", "bool"],
  87433. ["HeadingPairs", "HeadingPairs", "raw"],
  87434. ["TitlesOfParts", "TitlesOfParts", "raw"]
  87435. ];
  87436. XMLNS.EXT_PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";
  87437. RELS.EXT_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties';
  87438. var PseudoPropsPairs = [
  87439. "Worksheets", "SheetNames",
  87440. "NamedRanges", "DefinedNames",
  87441. "Chartsheets", "ChartNames"
  87442. ];
  87443. function load_props_pairs(HP, TOP, props, opts) {
  87444. var v = [];
  87445. if(typeof HP == "string") v = parseVector(HP, opts);
  87446. else for(var j = 0; j < HP.length; ++j) v = v.concat(HP[j].map(function(hp) { return {v:hp}; }));
  87447. var parts = (typeof TOP == "string") ? parseVector(TOP, opts).map(function (x) { return x.v; }) : TOP;
  87448. var idx = 0, len = 0;
  87449. if(parts.length > 0) for(var i = 0; i !== v.length; i += 2) {
  87450. len = +(v[i+1].v);
  87451. switch(v[i].v) {
  87452. case "Worksheets":
  87453. case "工作表":
  87454. case "Листы":
  87455. case "أوراق العمل":
  87456. case "ワークシート":
  87457. case "גליונות עבודה":
  87458. case "Arbeitsblätter":
  87459. case "Çalışma Sayfaları":
  87460. case "Feuilles de calcul":
  87461. case "Fogli di lavoro":
  87462. case "Folhas de cálculo":
  87463. case "Planilhas":
  87464. case "Regneark":
  87465. case "Hojas de cálculo":
  87466. case "Werkbladen":
  87467. props.Worksheets = len;
  87468. props.SheetNames = parts.slice(idx, idx + len);
  87469. break;
  87470. case "Named Ranges":
  87471. case "Rangos con nombre":
  87472. case "名前付き一覧":
  87473. case "Benannte Bereiche":
  87474. case "Navngivne områder":
  87475. props.NamedRanges = len;
  87476. props.DefinedNames = parts.slice(idx, idx + len);
  87477. break;
  87478. case "Charts":
  87479. case "Diagramme":
  87480. props.Chartsheets = len;
  87481. props.ChartNames = parts.slice(idx, idx + len);
  87482. break;
  87483. }
  87484. idx += len;
  87485. }
  87486. }
  87487. function parse_ext_props(data, p, opts) {
  87488. var q = {}; if(!p) p = {};
  87489. data = utf8read(data);
  87490. EXT_PROPS.forEach(function(f) {
  87491. switch(f[2]) {
  87492. case "string": p[f[1]] = (data.match(matchtag(f[0]))||[])[1]; break;
  87493. case "bool": p[f[1]] = (data.match(matchtag(f[0]))||[])[1] === "true"; break;
  87494. case "raw":
  87495. var cur = data.match(new RegExp("<" + f[0] + "[^>]*>([\\s\\S]*?)<\/" + f[0] + ">"));
  87496. if(cur && cur.length > 0) q[f[1]] = cur[1];
  87497. break;
  87498. }
  87499. });
  87500. if(q.HeadingPairs && q.TitlesOfParts) load_props_pairs(q.HeadingPairs, q.TitlesOfParts, p, opts);
  87501. return p;
  87502. }
  87503. var EXT_PROPS_XML_ROOT = writextag('Properties', null, {
  87504. 'xmlns': XMLNS.EXT_PROPS,
  87505. 'xmlns:vt': XMLNS.vt
  87506. });
  87507. function write_ext_props(cp) {
  87508. var o = [], W = writextag;
  87509. if(!cp) cp = {};
  87510. cp.Application = "SheetJS";
  87511. o[o.length] = (XML_HEADER);
  87512. o[o.length] = (EXT_PROPS_XML_ROOT);
  87513. EXT_PROPS.forEach(function(f) {
  87514. if(cp[f[1]] === undefined) return;
  87515. var v;
  87516. switch(f[2]) {
  87517. case 'string': v = String(cp[f[1]]); break;
  87518. case 'bool': v = cp[f[1]] ? 'true' : 'false'; break;
  87519. }
  87520. if(v !== undefined) o[o.length] = (W(f[0], v));
  87521. });
  87522. /* TODO: HeadingPairs, TitlesOfParts */
  87523. o[o.length] = (W('HeadingPairs', W('vt:vector', W('vt:variant', '<vt:lpstr>Worksheets</vt:lpstr>')+W('vt:variant', W('vt:i4', String(cp.Worksheets))), {size:2, baseType:"variant"})));
  87524. o[o.length] = (W('TitlesOfParts', W('vt:vector', cp.SheetNames.map(function(s) { return "<vt:lpstr>" + escapexml(s) + "</vt:lpstr>"; }).join(""), {size: cp.Worksheets, baseType:"lpstr"})));
  87525. if(o.length>2){ o[o.length] = ('</Properties>'); o[1]=o[1].replace("/>",">"); }
  87526. return o.join("");
  87527. }
  87528. /* 15.2.12.2 Custom File Properties Part */
  87529. XMLNS.CUST_PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";
  87530. RELS.CUST_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties';
  87531. var custregex = /<[^>]+>[^<]*/g;
  87532. function parse_cust_props(data, opts) {
  87533. var p = {}, name = "";
  87534. var m = data.match(custregex);
  87535. if(m) for(var i = 0; i != m.length; ++i) {
  87536. var x = m[i], y = parsexmltag(x);
  87537. switch(y[0]) {
  87538. case '<?xml': break;
  87539. case '<Properties': break;
  87540. case '<property': name = y.name; break;
  87541. case '</property>': name = null; break;
  87542. default: if (x.indexOf('<vt:') === 0) {
  87543. var toks = x.split('>');
  87544. var type = toks[0].slice(4), text = toks[1];
  87545. /* 22.4.2.32 (CT_Variant). Omit the binary types from 22.4 (Variant Types) */
  87546. switch(type) {
  87547. case 'lpstr': case 'bstr': case 'lpwstr':
  87548. p[name] = unescapexml(text);
  87549. break;
  87550. case 'bool':
  87551. p[name] = parsexmlbool(text);
  87552. break;
  87553. case 'i1': case 'i2': case 'i4': case 'i8': case 'int': case 'uint':
  87554. p[name] = parseInt(text, 10);
  87555. break;
  87556. case 'r4': case 'r8': case 'decimal':
  87557. p[name] = parseFloat(text);
  87558. break;
  87559. case 'filetime': case 'date':
  87560. p[name] = parseDate(text);
  87561. break;
  87562. case 'cy': case 'error':
  87563. p[name] = unescapexml(text);
  87564. break;
  87565. default:
  87566. if(type.slice(-1) == '/') break;
  87567. if(opts.WTF && typeof console !== 'undefined') console.warn('Unexpected', x, type, toks);
  87568. }
  87569. } else if(x.slice(0,2) === "</") {/* empty */
  87570. } else if(opts.WTF) throw new Error(x);
  87571. }
  87572. }
  87573. return p;
  87574. }
  87575. var CUST_PROPS_XML_ROOT = writextag('Properties', null, {
  87576. 'xmlns': XMLNS.CUST_PROPS,
  87577. 'xmlns:vt': XMLNS.vt
  87578. });
  87579. function write_cust_props(cp) {
  87580. var o = [XML_HEADER, CUST_PROPS_XML_ROOT];
  87581. if(!cp) return o.join("");
  87582. var pid = 1;
  87583. keys(cp).forEach(function custprop(k) { ++pid;
  87584. o[o.length] = (writextag('property', write_vt(cp[k]), {
  87585. 'fmtid': '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}',
  87586. 'pid': pid,
  87587. 'name': k
  87588. }));
  87589. });
  87590. if(o.length>2){ o[o.length] = '</Properties>'; o[1]=o[1].replace("/>",">"); }
  87591. return o.join("");
  87592. }
  87593. /* Common Name -> XLML Name */
  87594. var XLMLDocPropsMap = {
  87595. Title: 'Title',
  87596. Subject: 'Subject',
  87597. Author: 'Author',
  87598. Keywords: 'Keywords',
  87599. Comments: 'Description',
  87600. LastAuthor: 'LastAuthor',
  87601. RevNumber: 'Revision',
  87602. Application: 'AppName',
  87603. /* TotalTime: 'TotalTime', */
  87604. LastPrinted: 'LastPrinted',
  87605. CreatedDate: 'Created',
  87606. ModifiedDate: 'LastSaved',
  87607. /* Pages */
  87608. /* Words */
  87609. /* Characters */
  87610. Category: 'Category',
  87611. /* PresentationFormat */
  87612. Manager: 'Manager',
  87613. Company: 'Company',
  87614. /* Guid */
  87615. /* HyperlinkBase */
  87616. /* Bytes */
  87617. /* Lines */
  87618. /* Paragraphs */
  87619. /* CharactersWithSpaces */
  87620. AppVersion: 'Version',
  87621. ContentStatus: 'ContentStatus', /* NOTE: missing from schema */
  87622. Identifier: 'Identifier', /* NOTE: missing from schema */
  87623. Language: 'Language' /* NOTE: missing from schema */
  87624. };
  87625. var evert_XLMLDPM = evert(XLMLDocPropsMap);
  87626. function xlml_set_prop(Props, tag, val) {
  87627. tag = evert_XLMLDPM[tag] || tag;
  87628. Props[tag] = val;
  87629. }
  87630. function xlml_write_docprops(Props, opts) {
  87631. var o = [];
  87632. keys(XLMLDocPropsMap).map(function(m) {
  87633. for(var i = 0; i < CORE_PROPS.length; ++i) if(CORE_PROPS[i][1] == m) return CORE_PROPS[i];
  87634. for(i = 0; i < EXT_PROPS.length; ++i) if(EXT_PROPS[i][1] == m) return EXT_PROPS[i];
  87635. throw m;
  87636. }).forEach(function(p) {
  87637. if(Props[p[1]] == null) return;
  87638. var m = opts && opts.Props && opts.Props[p[1]] != null ? opts.Props[p[1]] : Props[p[1]];
  87639. switch(p[2]) {
  87640. case 'date': m = new Date(m).toISOString().replace(/\.\d*Z/,"Z"); break;
  87641. }
  87642. if(typeof m == 'number') m = String(m);
  87643. else if(m === true || m === false) { m = m ? "1" : "0"; }
  87644. else if(m instanceof Date) m = new Date(m).toISOString().replace(/\.\d*Z/,"");
  87645. o.push(writetag(XLMLDocPropsMap[p[1]] || p[1], m));
  87646. });
  87647. return writextag('DocumentProperties', o.join(""), {xmlns:XLMLNS.o });
  87648. }
  87649. function xlml_write_custprops(Props, Custprops) {
  87650. var BLACKLIST = ["Worksheets","SheetNames"];
  87651. var T = 'CustomDocumentProperties';
  87652. var o = [];
  87653. if(Props) keys(Props).forEach(function(k) {
  87654. if(!Props.hasOwnProperty(k)) return;
  87655. for(var i = 0; i < CORE_PROPS.length; ++i) if(k == CORE_PROPS[i][1]) return;
  87656. for(i = 0; i < EXT_PROPS.length; ++i) if(k == EXT_PROPS[i][1]) return;
  87657. for(i = 0; i < BLACKLIST.length; ++i) if(k == BLACKLIST[i]) return;
  87658. var m = Props[k];
  87659. var t = "string";
  87660. if(typeof m == 'number') { t = "float"; m = String(m); }
  87661. else if(m === true || m === false) { t = "boolean"; m = m ? "1" : "0"; }
  87662. else m = String(m);
  87663. o.push(writextag(escapexmltag(k), m, {"dt:dt":t}));
  87664. });
  87665. if(Custprops) keys(Custprops).forEach(function(k) {
  87666. if(!Custprops.hasOwnProperty(k)) return;
  87667. if(Props && Props.hasOwnProperty(k)) return;
  87668. var m = Custprops[k];
  87669. var t = "string";
  87670. if(typeof m == 'number') { t = "float"; m = String(m); }
  87671. else if(m === true || m === false) { t = "boolean"; m = m ? "1" : "0"; }
  87672. else if(m instanceof Date) { t = "dateTime.tz"; m = m.toISOString(); }
  87673. else m = String(m);
  87674. o.push(writextag(escapexmltag(k), m, {"dt:dt":t}));
  87675. });
  87676. return '<' + T + ' xmlns="' + XLMLNS.o + '">' + o.join("") + '</' + T + '>';
  87677. }
  87678. /* [MS-DTYP] 2.3.3 FILETIME */
  87679. /* [MS-OLEDS] 2.1.3 FILETIME (Packet Version) */
  87680. /* [MS-OLEPS] 2.8 FILETIME (Packet Version) */
  87681. function parse_FILETIME(blob) {
  87682. var dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4);
  87683. return new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\.000/,"");
  87684. }
  87685. function write_FILETIME(time) {
  87686. var date = (typeof time == "string") ? new Date(Date.parse(time)) : time;
  87687. var t = date.getTime() / 1000 + 11644473600;
  87688. var l = t % Math.pow(2,32), h = (t - l) / Math.pow(2,32);
  87689. l *= 1e7; h *= 1e7;
  87690. var w = (l / Math.pow(2,32)) | 0;
  87691. if(w > 0) { l = l % Math.pow(2,32); h += w; }
  87692. var o = new_buf(8); o.write_shift(4, l); o.write_shift(4, h); return o;
  87693. }
  87694. /* [MS-OSHARED] 2.3.3.1.4 Lpstr */
  87695. function parse_lpstr(blob, type, pad) {
  87696. var start = blob.l;
  87697. var str = blob.read_shift(0, 'lpstr-cp');
  87698. if(pad) while((blob.l - start) & 3) ++blob.l;
  87699. return str;
  87700. }
  87701. /* [MS-OSHARED] 2.3.3.1.6 Lpwstr */
  87702. function parse_lpwstr(blob, type, pad) {
  87703. var str = blob.read_shift(0, 'lpwstr');
  87704. if(pad) blob.l += (4 - ((str.length+1) & 3)) & 3;
  87705. return str;
  87706. }
  87707. /* [MS-OSHARED] 2.3.3.1.11 VtString */
  87708. /* [MS-OSHARED] 2.3.3.1.12 VtUnalignedString */
  87709. function parse_VtStringBase(blob, stringType, pad) {
  87710. if(stringType === 0x1F /*VT_LPWSTR*/) return parse_lpwstr(blob);
  87711. return parse_lpstr(blob, stringType, pad);
  87712. }
  87713. function parse_VtString(blob, t, pad) { return parse_VtStringBase(blob, t, pad === false ? 0: 4); }
  87714. function parse_VtUnalignedString(blob, t) { if(!t) throw new Error("VtUnalignedString must have positive length"); return parse_VtStringBase(blob, t, 0); }
  87715. /* [MS-OSHARED] 2.3.3.1.9 VtVecUnalignedLpstrValue */
  87716. function parse_VtVecUnalignedLpstrValue(blob) {
  87717. var length = blob.read_shift(4);
  87718. var ret = [];
  87719. for(var i = 0; i != length; ++i) ret[i] = blob.read_shift(0, 'lpstr-cp').replace(chr0,'');
  87720. return ret;
  87721. }
  87722. /* [MS-OSHARED] 2.3.3.1.10 VtVecUnalignedLpstr */
  87723. function parse_VtVecUnalignedLpstr(blob) {
  87724. return parse_VtVecUnalignedLpstrValue(blob);
  87725. }
  87726. /* [MS-OSHARED] 2.3.3.1.13 VtHeadingPair */
  87727. function parse_VtHeadingPair(blob) {
  87728. var headingString = parse_TypedPropertyValue(blob, VT_USTR);
  87729. var headerParts = parse_TypedPropertyValue(blob, VT_I4);
  87730. return [headingString, headerParts];
  87731. }
  87732. /* [MS-OSHARED] 2.3.3.1.14 VtVecHeadingPairValue */
  87733. function parse_VtVecHeadingPairValue(blob) {
  87734. var cElements = blob.read_shift(4);
  87735. var out = [];
  87736. for(var i = 0; i != cElements / 2; ++i) out.push(parse_VtHeadingPair(blob));
  87737. return out;
  87738. }
  87739. /* [MS-OSHARED] 2.3.3.1.15 VtVecHeadingPair */
  87740. function parse_VtVecHeadingPair(blob) {
  87741. // NOTE: When invoked, wType & padding were already consumed
  87742. return parse_VtVecHeadingPairValue(blob);
  87743. }
  87744. /* [MS-OLEPS] 2.18.1 Dictionary (uses 2.17, 2.16) */
  87745. function parse_dictionary(blob,CodePage) {
  87746. var cnt = blob.read_shift(4);
  87747. var dict = ({});
  87748. for(var j = 0; j != cnt; ++j) {
  87749. var pid = blob.read_shift(4);
  87750. var len = blob.read_shift(4);
  87751. dict[pid] = blob.read_shift(len, (CodePage === 0x4B0 ?'utf16le':'utf8')).replace(chr0,'').replace(chr1,'!');
  87752. if(CodePage === 0x4B0 && (len % 2)) blob.l += 2;
  87753. }
  87754. if(blob.l & 3) blob.l = (blob.l>>2+1)<<2;
  87755. return dict;
  87756. }
  87757. /* [MS-OLEPS] 2.9 BLOB */
  87758. function parse_BLOB(blob) {
  87759. var size = blob.read_shift(4);
  87760. var bytes = blob.slice(blob.l,blob.l+size);
  87761. blob.l += size;
  87762. if((size & 3) > 0) blob.l += (4 - (size & 3)) & 3;
  87763. return bytes;
  87764. }
  87765. /* [MS-OLEPS] 2.11 ClipboardData */
  87766. function parse_ClipboardData(blob) {
  87767. // TODO
  87768. var o = {};
  87769. o.Size = blob.read_shift(4);
  87770. //o.Format = blob.read_shift(4);
  87771. blob.l += o.Size + 3 - (o.Size - 1) % 4;
  87772. return o;
  87773. }
  87774. /* [MS-OLEPS] 2.15 TypedPropertyValue */
  87775. function parse_TypedPropertyValue(blob, type, _opts) {
  87776. var t = blob.read_shift(2), ret, opts = _opts||{};
  87777. blob.l += 2;
  87778. if(type !== VT_VARIANT)
  87779. if(t !== type && VT_CUSTOM.indexOf(type)===-1) throw new Error('Expected type ' + type + ' saw ' + t);
  87780. switch(type === VT_VARIANT ? t : type) {
  87781. case 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;
  87782. case 0x03 /*VT_I4*/: ret = blob.read_shift(4, 'i'); return ret;
  87783. case 0x0B /*VT_BOOL*/: return blob.read_shift(4) !== 0x0;
  87784. case 0x13 /*VT_UI4*/: ret = blob.read_shift(4); return ret;
  87785. case 0x1E /*VT_LPSTR*/: return parse_lpstr(blob, t, 4).replace(chr0,'');
  87786. case 0x1F /*VT_LPWSTR*/: return parse_lpwstr(blob);
  87787. case 0x40 /*VT_FILETIME*/: return parse_FILETIME(blob);
  87788. case 0x41 /*VT_BLOB*/: return parse_BLOB(blob);
  87789. case 0x47 /*VT_CF*/: return parse_ClipboardData(blob);
  87790. case 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw).replace(chr0,'');
  87791. case 0x51 /*VT_USTR*/: return parse_VtUnalignedString(blob, t/*, 4*/).replace(chr0,'');
  87792. case 0x100C /*VT_VECTOR|VT_VARIANT*/: return parse_VtVecHeadingPair(blob);
  87793. case 0x101E /*VT_LPSTR*/: return parse_VtVecUnalignedLpstr(blob);
  87794. default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + t);
  87795. }
  87796. }
  87797. function write_TypedPropertyValue(type, value) {
  87798. var o = new_buf(4), p = new_buf(4);
  87799. o.write_shift(4, type == 0x50 ? 0x1F : type);
  87800. switch(type) {
  87801. case 0x03 /*VT_I4*/: p.write_shift(-4, value); break;
  87802. case 0x05 /*VT_I4*/: p = new_buf(8); p.write_shift(8, value, 'f'); break;
  87803. case 0x0B /*VT_BOOL*/: p.write_shift(4, value ? 0x01 : 0x00); break;
  87804. case 0x40 /*VT_FILETIME*/: p = write_FILETIME(value); break;
  87805. case 0x1F /*VT_LPWSTR*/:
  87806. case 0x50 /*VT_STRING*/:
  87807. p = new_buf(4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
  87808. p.write_shift(4, value.length + 1);
  87809. p.write_shift(0, value, "dbcs");
  87810. while(p.l != p.length) p.write_shift(1, 0);
  87811. break;
  87812. default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + value);
  87813. }
  87814. return bconcat([o, p]);
  87815. }
  87816. /* [MS-OLEPS] 2.20 PropertySet */
  87817. function parse_PropertySet(blob, PIDSI) {
  87818. var start_addr = blob.l;
  87819. var size = blob.read_shift(4);
  87820. var NumProps = blob.read_shift(4);
  87821. var Props = [], i = 0;
  87822. var CodePage = 0;
  87823. var Dictionary = -1, DictObj = ({});
  87824. for(i = 0; i != NumProps; ++i) {
  87825. var PropID = blob.read_shift(4);
  87826. var Offset = blob.read_shift(4);
  87827. Props[i] = [PropID, Offset + start_addr];
  87828. }
  87829. Props.sort(function(x,y) { return x[1] - y[1]; });
  87830. var PropH = {};
  87831. for(i = 0; i != NumProps; ++i) {
  87832. if(blob.l !== Props[i][1]) {
  87833. var fail = true;
  87834. if(i>0 && PIDSI) switch(PIDSI[Props[i-1][0]].t) {
  87835. case 0x02 /*VT_I2*/: if(blob.l+2 === Props[i][1]) { blob.l+=2; fail = false; } break;
  87836. case 0x50 /*VT_STRING*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;
  87837. case 0x100C /*VT_VECTOR|VT_VARIANT*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;
  87838. }
  87839. if((!PIDSI||i==0) && blob.l <= Props[i][1]) { fail=false; blob.l = Props[i][1]; }
  87840. if(fail) throw new Error("Read Error: Expected address " + Props[i][1] + ' at ' + blob.l + ' :' + i);
  87841. }
  87842. if(PIDSI) {
  87843. var piddsi = PIDSI[Props[i][0]];
  87844. PropH[piddsi.n] = parse_TypedPropertyValue(blob, piddsi.t, {raw:true});
  87845. if(piddsi.p === 'version') PropH[piddsi.n] = String(PropH[piddsi.n] >> 16) + "." + ("0000" + String(PropH[piddsi.n] & 0xFFFF)).slice(-4);
  87846. if(piddsi.n == "CodePage") switch(PropH[piddsi.n]) {
  87847. case 0: PropH[piddsi.n] = 1252;
  87848. /* falls through */
  87849. case 874:
  87850. case 932:
  87851. case 936:
  87852. case 949:
  87853. case 950:
  87854. case 1250:
  87855. case 1251:
  87856. case 1253:
  87857. case 1254:
  87858. case 1255:
  87859. case 1256:
  87860. case 1257:
  87861. case 1258:
  87862. case 10000:
  87863. case 1200:
  87864. case 1201:
  87865. case 1252:
  87866. case 65000: case -536:
  87867. case 65001: case -535:
  87868. set_cp(CodePage = (PropH[piddsi.n]>>>0) & 0xFFFF); break;
  87869. default: throw new Error("Unsupported CodePage: " + PropH[piddsi.n]);
  87870. }
  87871. } else {
  87872. if(Props[i][0] === 0x1) {
  87873. CodePage = PropH.CodePage = (parse_TypedPropertyValue(blob, VT_I2));
  87874. set_cp(CodePage);
  87875. if(Dictionary !== -1) {
  87876. var oldpos = blob.l;
  87877. blob.l = Props[Dictionary][1];
  87878. DictObj = parse_dictionary(blob,CodePage);
  87879. blob.l = oldpos;
  87880. }
  87881. } else if(Props[i][0] === 0) {
  87882. if(CodePage === 0) { Dictionary = i; blob.l = Props[i+1][1]; continue; }
  87883. DictObj = parse_dictionary(blob,CodePage);
  87884. } else {
  87885. var name = DictObj[Props[i][0]];
  87886. var val;
  87887. /* [MS-OSHARED] 2.3.3.2.3.1.2 + PROPVARIANT */
  87888. switch(blob[blob.l]) {
  87889. case 0x41 /*VT_BLOB*/: blob.l += 4; val = parse_BLOB(blob); break;
  87890. case 0x1E /*VT_LPSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/\u0000+$/,""); break;
  87891. case 0x1F /*VT_LPWSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/\u0000+$/,""); break;
  87892. case 0x03 /*VT_I4*/: blob.l += 4; val = blob.read_shift(4, 'i'); break;
  87893. case 0x13 /*VT_UI4*/: blob.l += 4; val = blob.read_shift(4); break;
  87894. case 0x05 /*VT_R8*/: blob.l += 4; val = blob.read_shift(8, 'f'); break;
  87895. case 0x0B /*VT_BOOL*/: blob.l += 4; val = parsebool(blob, 4); break;
  87896. case 0x40 /*VT_FILETIME*/: blob.l += 4; val = parseDate(parse_FILETIME(blob)); break;
  87897. default: throw new Error("unparsed value: " + blob[blob.l]);
  87898. }
  87899. PropH[name] = val;
  87900. }
  87901. }
  87902. }
  87903. blob.l = start_addr + size; /* step ahead to skip padding */
  87904. return PropH;
  87905. }
  87906. var XLSPSSkip = [ "CodePage", "Thumbnail", "_PID_LINKBASE", "_PID_HLINKS", "SystemIdentifier", "FMTID" ].concat(PseudoPropsPairs);
  87907. function guess_property_type(val) {
  87908. switch(typeof val) {
  87909. case "boolean": return 0x0B;
  87910. case "number": return ((val|0)==val) ? 0x03 : 0x05;
  87911. case "string": return 0x1F;
  87912. case "object": if(val instanceof Date) return 0x40; break;
  87913. }
  87914. return -1;
  87915. }
  87916. function write_PropertySet(entries, RE, PIDSI) {
  87917. var hdr = new_buf(8), piao = [], prop = [];
  87918. var sz = 8, i = 0;
  87919. var pr = new_buf(8), pio = new_buf(8);
  87920. pr.write_shift(4, 0x0002);
  87921. pr.write_shift(4, 0x04B0);
  87922. pio.write_shift(4, 0x0001);
  87923. prop.push(pr); piao.push(pio);
  87924. sz += 8 + pr.length;
  87925. if(!RE) {
  87926. pio = new_buf(8);
  87927. pio.write_shift(4, 0);
  87928. piao.unshift(pio);
  87929. var bufs = [new_buf(4)];
  87930. bufs[0].write_shift(4, entries.length);
  87931. for(i = 0; i < entries.length; ++i) {
  87932. var value = entries[i][0];
  87933. pr = new_buf(4 + 4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
  87934. pr.write_shift(4, i+2);
  87935. pr.write_shift(4, value.length + 1);
  87936. pr.write_shift(0, value, "dbcs");
  87937. while(pr.l != pr.length) pr.write_shift(1, 0);
  87938. bufs.push(pr);
  87939. }
  87940. pr = bconcat(bufs);
  87941. prop.unshift(pr);
  87942. sz += 8 + pr.length;
  87943. }
  87944. for(i = 0; i < entries.length; ++i) {
  87945. if(RE && !RE[entries[i][0]]) continue;
  87946. if(XLSPSSkip.indexOf(entries[i][0]) > -1) continue;
  87947. if(entries[i][1] == null) continue;
  87948. var val = entries[i][1], idx = 0;
  87949. if(RE) {
  87950. idx = +RE[entries[i][0]];
  87951. var pinfo = (PIDSI)[idx];
  87952. if(pinfo.p == "version" && typeof val == "string") {
  87953. var arr = val.split(".");
  87954. val = ((+arr[0])<<16) + ((+arr[1])||0);
  87955. }
  87956. pr = write_TypedPropertyValue(pinfo.t, val);
  87957. } else {
  87958. var T = guess_property_type(val);
  87959. if(T == -1) { T = 0x1F; val = String(val); }
  87960. pr = write_TypedPropertyValue(T, val);
  87961. }
  87962. prop.push(pr);
  87963. pio = new_buf(8);
  87964. pio.write_shift(4, !RE ? 2+i : idx);
  87965. piao.push(pio);
  87966. sz += 8 + pr.length;
  87967. }
  87968. var w = 8 * (prop.length + 1);
  87969. for(i = 0; i < prop.length; ++i) { piao[i].write_shift(4, w); w += prop[i].length; }
  87970. hdr.write_shift(4, sz);
  87971. hdr.write_shift(4, prop.length);
  87972. return bconcat([hdr].concat(piao).concat(prop));
  87973. }
  87974. /* [MS-OLEPS] 2.21 PropertySetStream */
  87975. function parse_PropertySetStream(file, PIDSI, clsid) {
  87976. var blob = file.content;
  87977. if(!blob) return ({});
  87978. prep_blob(blob, 0);
  87979. var NumSets, FMTID0, FMTID1, Offset0, Offset1 = 0;
  87980. blob.chk('feff', 'Byte Order: ');
  87981. /*var vers = */blob.read_shift(2); // TODO: check version
  87982. var SystemIdentifier = blob.read_shift(4);
  87983. var CLSID = blob.read_shift(16);
  87984. if(CLSID !== CFB.utils.consts.HEADER_CLSID && CLSID !== clsid) throw new Error("Bad PropertySet CLSID " + CLSID);
  87985. NumSets = blob.read_shift(4);
  87986. if(NumSets !== 1 && NumSets !== 2) throw new Error("Unrecognized #Sets: " + NumSets);
  87987. FMTID0 = blob.read_shift(16); Offset0 = blob.read_shift(4);
  87988. if(NumSets === 1 && Offset0 !== blob.l) throw new Error("Length mismatch: " + Offset0 + " !== " + blob.l);
  87989. else if(NumSets === 2) { FMTID1 = blob.read_shift(16); Offset1 = blob.read_shift(4); }
  87990. var PSet0 = parse_PropertySet(blob, PIDSI);
  87991. var rval = ({ SystemIdentifier: SystemIdentifier });
  87992. for(var y in PSet0) rval[y] = PSet0[y];
  87993. //rval.blob = blob;
  87994. rval.FMTID = FMTID0;
  87995. //rval.PSet0 = PSet0;
  87996. if(NumSets === 1) return rval;
  87997. if(Offset1 - blob.l == 2) blob.l += 2;
  87998. if(blob.l !== Offset1) throw new Error("Length mismatch 2: " + blob.l + " !== " + Offset1);
  87999. var PSet1;
  88000. try { PSet1 = parse_PropertySet(blob, null); } catch(e) {/* empty */}
  88001. for(y in PSet1) rval[y] = PSet1[y];
  88002. rval.FMTID = [FMTID0, FMTID1]; // TODO: verify FMTID0/1
  88003. return rval;
  88004. }
  88005. function write_PropertySetStream(entries, clsid, RE, PIDSI, entries2, clsid2) {
  88006. var hdr = new_buf(entries2 ? 68 : 48);
  88007. var bufs = [hdr];
  88008. hdr.write_shift(2, 0xFFFE);
  88009. hdr.write_shift(2, 0x0000); /* TODO: type 1 props */
  88010. hdr.write_shift(4, 0x32363237);
  88011. hdr.write_shift(16, CFB.utils.consts.HEADER_CLSID, "hex");
  88012. hdr.write_shift(4, (entries2 ? 2 : 1));
  88013. hdr.write_shift(16, clsid, "hex");
  88014. hdr.write_shift(4, (entries2 ? 68 : 48));
  88015. var ps0 = write_PropertySet(entries, RE, PIDSI);
  88016. bufs.push(ps0);
  88017. if(entries2) {
  88018. var ps1 = write_PropertySet(entries2, null, null);
  88019. hdr.write_shift(16, clsid2, "hex");
  88020. hdr.write_shift(4, 68 + ps0.length);
  88021. bufs.push(ps1);
  88022. }
  88023. return bconcat(bufs);
  88024. }
  88025. function parsenoop2(blob, length) { blob.read_shift(length); return null; }
  88026. function writezeroes(n, o) { if(!o) o=new_buf(n); for(var j=0; j<n; ++j) o.write_shift(1, 0); return o; }
  88027. function parslurp(blob, length, cb) {
  88028. var arr = [], target = blob.l + length;
  88029. while(blob.l < target) arr.push(cb(blob, target - blob.l));
  88030. if(target !== blob.l) throw new Error("Slurp error");
  88031. return arr;
  88032. }
  88033. function parsebool(blob, length) { return blob.read_shift(length) === 0x1; }
  88034. function writebool(v, o) { if(!o) o=new_buf(2); o.write_shift(2, +!!v); return o; }
  88035. function parseuint16(blob) { return blob.read_shift(2, 'u'); }
  88036. function writeuint16(v, o) { if(!o) o=new_buf(2); o.write_shift(2, v); return o; }
  88037. function parseuint16a(blob, length) { return parslurp(blob,length,parseuint16);}
  88038. /* --- 2.5 Structures --- */
  88039. /* [MS-XLS] 2.5.10 Bes (boolean or error) */
  88040. function parse_Bes(blob) {
  88041. var v = blob.read_shift(1), t = blob.read_shift(1);
  88042. return t === 0x01 ? v : v === 0x01;
  88043. }
  88044. function write_Bes(v, t, o) {
  88045. if(!o) o = new_buf(2);
  88046. o.write_shift(1, +v);
  88047. o.write_shift(1, ((t == 'e') ? 1 : 0));
  88048. return o;
  88049. }
  88050. /* [MS-XLS] 2.5.240 ShortXLUnicodeString */
  88051. function parse_ShortXLUnicodeString(blob, length, opts) {
  88052. var cch = blob.read_shift(opts && opts.biff >= 12 ? 2 : 1);
  88053. var encoding = 'sbcs-cont';
  88054. var cp = current_codepage;
  88055. if(opts && opts.biff >= 8) current_codepage = 1200;
  88056. if(!opts || opts.biff == 8 ) {
  88057. var fHighByte = blob.read_shift(1);
  88058. if(fHighByte) { encoding = 'dbcs-cont'; }
  88059. } else if(opts.biff == 12) {
  88060. encoding = 'wstr';
  88061. }
  88062. if(opts.biff >= 2 && opts.biff <= 5) encoding = 'cpstr';
  88063. var o = cch ? blob.read_shift(cch, encoding) : "";
  88064. current_codepage = cp;
  88065. return o;
  88066. }
  88067. /* 2.5.293 XLUnicodeRichExtendedString */
  88068. function parse_XLUnicodeRichExtendedString(blob) {
  88069. var cp = current_codepage;
  88070. current_codepage = 1200;
  88071. var cch = blob.read_shift(2), flags = blob.read_shift(1);
  88072. var /*fHighByte = flags & 0x1,*/ fExtSt = flags & 0x4, fRichSt = flags & 0x8;
  88073. var width = 1 + (flags & 0x1); // 0x0 -> utf8, 0x1 -> dbcs
  88074. var cRun = 0, cbExtRst;
  88075. var z = {};
  88076. if(fRichSt) cRun = blob.read_shift(2);
  88077. if(fExtSt) cbExtRst = blob.read_shift(4);
  88078. var encoding = width == 2 ? 'dbcs-cont' : 'sbcs-cont';
  88079. var msg = cch === 0 ? "" : blob.read_shift(cch, encoding);
  88080. if(fRichSt) blob.l += 4 * cRun; //TODO: parse this
  88081. if(fExtSt) blob.l += cbExtRst; //TODO: parse this
  88082. z.t = msg;
  88083. if(!fRichSt) { z.raw = "<t>" + z.t + "</t>"; z.r = z.t; }
  88084. current_codepage = cp;
  88085. return z;
  88086. }
  88087. /* 2.5.296 XLUnicodeStringNoCch */
  88088. function parse_XLUnicodeStringNoCch(blob, cch, opts) {
  88089. var retval;
  88090. if(opts) {
  88091. if(opts.biff >= 2 && opts.biff <= 5) return blob.read_shift(cch, 'cpstr');
  88092. if(opts.biff >= 12) return blob.read_shift(cch, 'dbcs-cont');
  88093. }
  88094. var fHighByte = blob.read_shift(1);
  88095. if(fHighByte===0) { retval = blob.read_shift(cch, 'sbcs-cont'); }
  88096. else { retval = blob.read_shift(cch, 'dbcs-cont'); }
  88097. return retval;
  88098. }
  88099. /* 2.5.294 XLUnicodeString */
  88100. function parse_XLUnicodeString(blob, length, opts) {
  88101. var cch = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
  88102. if(cch === 0) { blob.l++; return ""; }
  88103. return parse_XLUnicodeStringNoCch(blob, cch, opts);
  88104. }
  88105. /* BIFF5 override */
  88106. function parse_XLUnicodeString2(blob, length, opts) {
  88107. if(opts.biff > 5) return parse_XLUnicodeString(blob, length, opts);
  88108. var cch = blob.read_shift(1);
  88109. if(cch === 0) { blob.l++; return ""; }
  88110. return blob.read_shift(cch, (opts.biff <= 4 || !blob.lens ) ? 'cpstr' : 'sbcs-cont');
  88111. }
  88112. /* TODO: BIFF5 and lower, codepage awareness */
  88113. function write_XLUnicodeString(str, opts, o) {
  88114. if(!o) o = new_buf(3 + 2 * str.length);
  88115. o.write_shift(2, str.length);
  88116. o.write_shift(1, 1);
  88117. o.write_shift(31, str, 'utf16le');
  88118. return o;
  88119. }
  88120. /* [MS-XLS] 2.5.61 ControlInfo */
  88121. function parse_ControlInfo(blob) {
  88122. var flags = blob.read_shift(1);
  88123. blob.l++;
  88124. var accel = blob.read_shift(2);
  88125. blob.l += 2;
  88126. return [flags, accel];
  88127. }
  88128. /* [MS-OSHARED] 2.3.7.6 URLMoniker TODO: flags */
  88129. function parse_URLMoniker(blob) {
  88130. var len = blob.read_shift(4), start = blob.l;
  88131. var extra = false;
  88132. if(len > 24) {
  88133. /* look ahead */
  88134. blob.l += len - 24;
  88135. if(blob.read_shift(16) === "795881f43b1d7f48af2c825dc4852763") extra = true;
  88136. blob.l = start;
  88137. }
  88138. var url = blob.read_shift((extra?len-24:len)>>1, 'utf16le').replace(chr0,"");
  88139. if(extra) blob.l += 24;
  88140. return url;
  88141. }
  88142. /* [MS-OSHARED] 2.3.7.8 FileMoniker TODO: all fields */
  88143. function parse_FileMoniker(blob) {
  88144. blob.l += 2; //var cAnti = blob.read_shift(2);
  88145. var ansiPath = blob.read_shift(0, 'lpstr-ansi');
  88146. blob.l += 2; //var endServer = blob.read_shift(2);
  88147. if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker");
  88148. var sz = blob.read_shift(4);
  88149. if(sz === 0) return ansiPath.replace(/\\/g,"/");
  88150. var bytes = blob.read_shift(4);
  88151. if(blob.read_shift(2) != 3) throw new Error("Bad FileMoniker");
  88152. var unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,"");
  88153. return unicodePath;
  88154. }
  88155. /* [MS-OSHARED] 2.3.7.2 HyperlinkMoniker TODO: all the monikers */
  88156. function parse_HyperlinkMoniker(blob, length) {
  88157. var clsid = blob.read_shift(16); length -= 16;
  88158. switch(clsid) {
  88159. case "e0c9ea79f9bace118c8200aa004ba90b": return parse_URLMoniker(blob, length);
  88160. case "0303000000000000c000000000000046": return parse_FileMoniker(blob, length);
  88161. default: throw new Error("Unsupported Moniker " + clsid);
  88162. }
  88163. }
  88164. /* [MS-OSHARED] 2.3.7.9 HyperlinkString */
  88165. function parse_HyperlinkString(blob) {
  88166. var len = blob.read_shift(4);
  88167. var o = len > 0 ? blob.read_shift(len, 'utf16le').replace(chr0, "") : "";
  88168. return o;
  88169. }
  88170. /* [MS-OSHARED] 2.3.7.1 Hyperlink Object */
  88171. function parse_Hyperlink(blob, length) {
  88172. var end = blob.l + length;
  88173. var sVer = blob.read_shift(4);
  88174. if(sVer !== 2) throw new Error("Unrecognized streamVersion: " + sVer);
  88175. var flags = blob.read_shift(2);
  88176. blob.l += 2;
  88177. var displayName, targetFrameName, moniker, oleMoniker, Loc="", guid, fileTime;
  88178. if(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l);
  88179. if(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l);
  88180. if((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l);
  88181. if((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l);
  88182. if(flags & 0x0008) Loc = parse_HyperlinkString(blob, end - blob.l);
  88183. if(flags & 0x0020) guid = blob.read_shift(16);
  88184. if(flags & 0x0040) fileTime = parse_FILETIME(blob/*, 8*/);
  88185. blob.l = end;
  88186. var target = targetFrameName||moniker||oleMoniker||"";
  88187. if(target && Loc) target+="#"+Loc;
  88188. if(!target) target = "#" + Loc;
  88189. var out = ({Target:target});
  88190. if(guid) out.guid = guid;
  88191. if(fileTime) out.time = fileTime;
  88192. if(displayName) out.Tooltip = displayName;
  88193. return out;
  88194. }
  88195. function write_Hyperlink(hl) {
  88196. var out = new_buf(512), i = 0;
  88197. var Target = hl.Target;
  88198. var F = Target.indexOf("#") > -1 ? 0x1f : 0x17;
  88199. switch(Target.charAt(0)) { case "#": F=0x1c; break; case ".": F&=~2; break; }
  88200. out.write_shift(4,2); out.write_shift(4, F);
  88201. var data = [8,6815827,6619237,4849780,83]; for(i = 0; i < data.length; ++i) out.write_shift(4, data[i]);
  88202. if(F == 0x1C) {
  88203. Target = Target.slice(1);
  88204. out.write_shift(4, Target.length + 1);
  88205. for(i = 0; i < Target.length; ++i) out.write_shift(2, Target.charCodeAt(i));
  88206. out.write_shift(2, 0);
  88207. } else if(F & 0x02) {
  88208. data = "e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
  88209. for(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16));
  88210. out.write_shift(4, 2*(Target.length + 1));
  88211. for(i = 0; i < Target.length; ++i) out.write_shift(2, Target.charCodeAt(i));
  88212. out.write_shift(2, 0);
  88213. } else {
  88214. data = "03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" ");
  88215. for(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16));
  88216. var P = 0;
  88217. while(Target.slice(P*3,P*3+3)=="../"||Target.slice(P*3,P*3+3)=="..\\") ++P;
  88218. out.write_shift(2, P);
  88219. out.write_shift(4, Target.length + 1);
  88220. for(i = 0; i < Target.length; ++i) out.write_shift(1, Target.charCodeAt(i) & 0xFF);
  88221. out.write_shift(1, 0);
  88222. out.write_shift(2, 0xFFFF);
  88223. out.write_shift(2, 0xDEAD);
  88224. for(i = 0; i < 6; ++i) out.write_shift(4, 0);
  88225. }
  88226. return out.slice(0, out.l);
  88227. }
  88228. /* 2.5.178 LongRGBA */
  88229. function parse_LongRGBA(blob) { var r = blob.read_shift(1), g = blob.read_shift(1), b = blob.read_shift(1), a = blob.read_shift(1); return [r,g,b,a]; }
  88230. /* 2.5.177 LongRGB */
  88231. function parse_LongRGB(blob, length) { var x = parse_LongRGBA(blob, length); x[3] = 0; return x; }
  88232. /* [MS-XLS] 2.5.19 */
  88233. function parse_XLSCell(blob) {
  88234. var rw = blob.read_shift(2); // 0-indexed
  88235. var col = blob.read_shift(2);
  88236. var ixfe = blob.read_shift(2);
  88237. return ({r:rw, c:col, ixfe:ixfe});
  88238. }
  88239. function write_XLSCell(R, C, ixfe, o) {
  88240. if(!o) o = new_buf(6);
  88241. o.write_shift(2, R);
  88242. o.write_shift(2, C);
  88243. o.write_shift(2, ixfe||0);
  88244. return o;
  88245. }
  88246. /* [MS-XLS] 2.5.134 */
  88247. function parse_frtHeader(blob) {
  88248. var rt = blob.read_shift(2);
  88249. var flags = blob.read_shift(2); // TODO: parse these flags
  88250. blob.l += 8;
  88251. return {type: rt, flags: flags};
  88252. }
  88253. function parse_OptXLUnicodeString(blob, length, opts) { return length === 0 ? "" : parse_XLUnicodeString2(blob, length, opts); }
  88254. /* [MS-XLS] 2.5.344 */
  88255. function parse_XTI(blob, length, opts) {
  88256. var w = opts.biff > 8 ? 4 : 2;
  88257. var iSupBook = blob.read_shift(w), itabFirst = blob.read_shift(w,'i'), itabLast = blob.read_shift(w,'i');
  88258. return [iSupBook, itabFirst, itabLast];
  88259. }
  88260. /* [MS-XLS] 2.5.218 */
  88261. function parse_RkRec(blob) {
  88262. var ixfe = blob.read_shift(2);
  88263. var RK = parse_RkNumber(blob);
  88264. return [ixfe, RK];
  88265. }
  88266. /* [MS-XLS] 2.5.1 */
  88267. function parse_AddinUdf(blob, length, opts) {
  88268. blob.l += 4; length -= 4;
  88269. var l = blob.l + length;
  88270. var udfName = parse_ShortXLUnicodeString(blob, length, opts);
  88271. var cb = blob.read_shift(2);
  88272. l -= blob.l;
  88273. if(cb !== l) throw new Error("Malformed AddinUdf: padding = " + l + " != " + cb);
  88274. blob.l += cb;
  88275. return udfName;
  88276. }
  88277. /* [MS-XLS] 2.5.209 TODO: Check sizes */
  88278. function parse_Ref8U(blob) {
  88279. var rwFirst = blob.read_shift(2);
  88280. var rwLast = blob.read_shift(2);
  88281. var colFirst = blob.read_shift(2);
  88282. var colLast = blob.read_shift(2);
  88283. return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
  88284. }
  88285. function write_Ref8U(r, o) {
  88286. if(!o) o = new_buf(8);
  88287. o.write_shift(2, r.s.r);
  88288. o.write_shift(2, r.e.r);
  88289. o.write_shift(2, r.s.c);
  88290. o.write_shift(2, r.e.c);
  88291. return o;
  88292. }
  88293. /* [MS-XLS] 2.5.211 */
  88294. function parse_RefU(blob) {
  88295. var rwFirst = blob.read_shift(2);
  88296. var rwLast = blob.read_shift(2);
  88297. var colFirst = blob.read_shift(1);
  88298. var colLast = blob.read_shift(1);
  88299. return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
  88300. }
  88301. /* [MS-XLS] 2.5.207 */
  88302. var parse_Ref = parse_RefU;
  88303. /* [MS-XLS] 2.5.143 */
  88304. function parse_FtCmo(blob) {
  88305. blob.l += 4;
  88306. var ot = blob.read_shift(2);
  88307. var id = blob.read_shift(2);
  88308. var flags = blob.read_shift(2);
  88309. blob.l+=12;
  88310. return [id, ot, flags];
  88311. }
  88312. /* [MS-XLS] 2.5.149 */
  88313. function parse_FtNts(blob) {
  88314. var out = {};
  88315. blob.l += 4;
  88316. blob.l += 16; // GUID TODO
  88317. out.fSharedNote = blob.read_shift(2);
  88318. blob.l += 4;
  88319. return out;
  88320. }
  88321. /* [MS-XLS] 2.5.142 */
  88322. function parse_FtCf(blob) {
  88323. var out = {};
  88324. blob.l += 4;
  88325. blob.cf = blob.read_shift(2);
  88326. return out;
  88327. }
  88328. /* [MS-XLS] 2.5.140 - 2.5.154 and friends */
  88329. function parse_FtSkip(blob) { blob.l += 2; blob.l += blob.read_shift(2); }
  88330. var FtTab = {
  88331. 0x00: parse_FtSkip, /* FtEnd */
  88332. 0x04: parse_FtSkip, /* FtMacro */
  88333. 0x05: parse_FtSkip, /* FtButton */
  88334. 0x06: parse_FtSkip, /* FtGmo */
  88335. 0x07: parse_FtCf, /* FtCf */
  88336. 0x08: parse_FtSkip, /* FtPioGrbit */
  88337. 0x09: parse_FtSkip, /* FtPictFmla */
  88338. 0x0A: parse_FtSkip, /* FtCbls */
  88339. 0x0B: parse_FtSkip, /* FtRbo */
  88340. 0x0C: parse_FtSkip, /* FtSbs */
  88341. 0x0D: parse_FtNts, /* FtNts */
  88342. 0x0E: parse_FtSkip, /* FtSbsFmla */
  88343. 0x0F: parse_FtSkip, /* FtGboData */
  88344. 0x10: parse_FtSkip, /* FtEdoData */
  88345. 0x11: parse_FtSkip, /* FtRboData */
  88346. 0x12: parse_FtSkip, /* FtCblsData */
  88347. 0x13: parse_FtSkip, /* FtLbsData */
  88348. 0x14: parse_FtSkip, /* FtCblsFmla */
  88349. 0x15: parse_FtCmo
  88350. };
  88351. function parse_FtArray(blob, length) {
  88352. var tgt = blob.l + length;
  88353. var fts = [];
  88354. while(blob.l < tgt) {
  88355. var ft = blob.read_shift(2);
  88356. blob.l-=2;
  88357. try {
  88358. fts.push(FtTab[ft](blob, tgt - blob.l));
  88359. } catch(e) { blob.l = tgt; return fts; }
  88360. }
  88361. if(blob.l != tgt) blob.l = tgt; //throw new Error("bad Object Ft-sequence");
  88362. return fts;
  88363. }
  88364. /* --- 2.4 Records --- */
  88365. /* [MS-XLS] 2.4.21 */
  88366. function parse_BOF(blob, length) {
  88367. var o = {BIFFVer:0, dt:0};
  88368. o.BIFFVer = blob.read_shift(2); length -= 2;
  88369. if(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }
  88370. switch(o.BIFFVer) {
  88371. case 0x0600: /* BIFF8 */
  88372. case 0x0500: /* BIFF5 */
  88373. case 0x0400: /* BIFF4 */
  88374. case 0x0300: /* BIFF3 */
  88375. case 0x0200: /* BIFF2 */
  88376. case 0x0002: case 0x0007: /* BIFF2 */
  88377. break;
  88378. default: if(length > 6) throw new Error("Unexpected BIFF Ver " + o.BIFFVer);
  88379. }
  88380. blob.read_shift(length);
  88381. return o;
  88382. }
  88383. function write_BOF(wb, t, o) {
  88384. var h = 0x0600, w = 16;
  88385. switch(o.bookType) {
  88386. case 'biff8': break;
  88387. case 'biff5': h = 0x0500; w = 8; break;
  88388. case 'biff4': h = 0x0004; w = 6; break;
  88389. case 'biff3': h = 0x0003; w = 6; break;
  88390. case 'biff2': h = 0x0002; w = 4; break;
  88391. case 'xla': break;
  88392. default: throw new Error("unsupported BIFF version");
  88393. }
  88394. var out = new_buf(w);
  88395. out.write_shift(2, h);
  88396. out.write_shift(2, t);
  88397. if(w > 4) out.write_shift(2, 0x7262);
  88398. if(w > 6) out.write_shift(2, 0x07CD);
  88399. if(w > 8) {
  88400. out.write_shift(2, 0xC009);
  88401. out.write_shift(2, 0x0001);
  88402. out.write_shift(2, 0x0706);
  88403. out.write_shift(2, 0x0000);
  88404. }
  88405. return out;
  88406. }
  88407. /* [MS-XLS] 2.4.146 */
  88408. function parse_InterfaceHdr(blob, length) {
  88409. if(length === 0) return 0x04b0;
  88410. if((blob.read_shift(2))!==0x04b0){/* empty */}
  88411. return 0x04b0;
  88412. }
  88413. /* [MS-XLS] 2.4.349 */
  88414. function parse_WriteAccess(blob, length, opts) {
  88415. if(opts.enc) { blob.l += length; return ""; }
  88416. var l = blob.l;
  88417. // TODO: make sure XLUnicodeString doesnt overrun
  88418. var UserName = parse_XLUnicodeString2(blob, 0, opts);
  88419. blob.read_shift(length + l - blob.l);
  88420. return UserName;
  88421. }
  88422. function write_WriteAccess(s, opts) {
  88423. var b8 = !opts || opts.biff == 8;
  88424. var o = new_buf(b8 ? 112 : 54);
  88425. o.write_shift(opts.biff == 8 ? 2 : 1, 7);
  88426. if(b8) o.write_shift(1, 0);
  88427. o.write_shift(4, 0x33336853);
  88428. o.write_shift(4, (0x00534A74 | (b8 ? 0 : 0x20000000)));
  88429. while(o.l < o.length) o.write_shift(1, (b8 ? 0 : 32));
  88430. return o;
  88431. }
  88432. /* [MS-XLS] 2.4.351 */
  88433. function parse_WsBool(blob, length, opts) {
  88434. var flags = opts && opts.biff == 8 || length == 2 ? blob.read_shift(2) : (blob.l += length, 0);
  88435. return { fDialog: flags & 0x10 };
  88436. }
  88437. /* [MS-XLS] 2.4.28 */
  88438. function parse_BoundSheet8(blob, length, opts) {
  88439. var pos = blob.read_shift(4);
  88440. var hidden = blob.read_shift(1) & 0x03;
  88441. var dt = blob.read_shift(1);
  88442. switch(dt) {
  88443. case 0: dt = 'Worksheet'; break;
  88444. case 1: dt = 'Macrosheet'; break;
  88445. case 2: dt = 'Chartsheet'; break;
  88446. case 6: dt = 'VBAModule'; break;
  88447. }
  88448. var name = parse_ShortXLUnicodeString(blob, 0, opts);
  88449. if(name.length === 0) name = "Sheet1";
  88450. return { pos:pos, hs:hidden, dt:dt, name:name };
  88451. }
  88452. function write_BoundSheet8(data, opts) {
  88453. var w = (!opts || opts.biff >= 8 ? 2 : 1);
  88454. var o = new_buf(8 + w * data.name.length);
  88455. o.write_shift(4, data.pos);
  88456. o.write_shift(1, data.hs || 0);
  88457. o.write_shift(1, data.dt);
  88458. o.write_shift(1, data.name.length);
  88459. if(opts.biff >= 8) o.write_shift(1, 1);
  88460. o.write_shift(w * data.name.length, data.name, opts.biff < 8 ? 'sbcs' : 'utf16le');
  88461. var out = o.slice(0, o.l);
  88462. out.l = o.l; return out;
  88463. }
  88464. /* [MS-XLS] 2.4.265 TODO */
  88465. function parse_SST(blob, length) {
  88466. var end = blob.l + length;
  88467. var cnt = blob.read_shift(4);
  88468. var ucnt = blob.read_shift(4);
  88469. var strs = ([]);
  88470. for(var i = 0; i != ucnt && blob.l < end; ++i) {
  88471. strs.push(parse_XLUnicodeRichExtendedString(blob));
  88472. }
  88473. strs.Count = cnt; strs.Unique = ucnt;
  88474. return strs;
  88475. }
  88476. /* [MS-XLS] 2.4.107 */
  88477. function parse_ExtSST(blob, length) {
  88478. var extsst = {};
  88479. extsst.dsst = blob.read_shift(2);
  88480. blob.l += length-2;
  88481. return extsst;
  88482. }
  88483. /* [MS-XLS] 2.4.221 TODO: check BIFF2-4 */
  88484. function parse_Row(blob) {
  88485. var z = ({});
  88486. z.r = blob.read_shift(2);
  88487. z.c = blob.read_shift(2);
  88488. z.cnt = blob.read_shift(2) - z.c;
  88489. var miyRw = blob.read_shift(2);
  88490. blob.l += 4; // reserved(2), unused(2)
  88491. var flags = blob.read_shift(1); // various flags
  88492. blob.l += 3; // reserved(8), ixfe(12), flags(4)
  88493. if(flags & 0x07) z.level = flags & 0x07;
  88494. // collapsed: flags & 0x10
  88495. if(flags & 0x20) z.hidden = true;
  88496. if(flags & 0x40) z.hpt = miyRw / 20;
  88497. return z;
  88498. }
  88499. /* [MS-XLS] 2.4.125 */
  88500. function parse_ForceFullCalculation(blob) {
  88501. var header = parse_frtHeader(blob);
  88502. if(header.type != 0x08A3) throw new Error("Invalid Future Record " + header.type);
  88503. var fullcalc = blob.read_shift(4);
  88504. return fullcalc !== 0x0;
  88505. }
  88506. /* [MS-XLS] 2.4.215 rt */
  88507. function parse_RecalcId(blob) {
  88508. blob.read_shift(2);
  88509. return blob.read_shift(4);
  88510. }
  88511. /* [MS-XLS] 2.4.87 */
  88512. function parse_DefaultRowHeight(blob, length, opts) {
  88513. var f = 0;
  88514. if(!(opts && opts.biff == 2)) {
  88515. f = blob.read_shift(2);
  88516. }
  88517. var miyRw = blob.read_shift(2);
  88518. if((opts && opts.biff == 2)) {
  88519. f = 1 - (miyRw >> 15); miyRw &= 0x7fff;
  88520. }
  88521. var fl = {Unsynced:f&1,DyZero:(f&2)>>1,ExAsc:(f&4)>>2,ExDsc:(f&8)>>3};
  88522. return [fl, miyRw];
  88523. }
  88524. /* [MS-XLS] 2.4.345 TODO */
  88525. function parse_Window1(blob) {
  88526. var xWn = blob.read_shift(2), yWn = blob.read_shift(2), dxWn = blob.read_shift(2), dyWn = blob.read_shift(2);
  88527. var flags = blob.read_shift(2), iTabCur = blob.read_shift(2), iTabFirst = blob.read_shift(2);
  88528. var ctabSel = blob.read_shift(2), wTabRatio = blob.read_shift(2);
  88529. return { Pos: [xWn, yWn], Dim: [dxWn, dyWn], Flags: flags, CurTab: iTabCur,
  88530. FirstTab: iTabFirst, Selected: ctabSel, TabRatio: wTabRatio };
  88531. }
  88532. function write_Window1() {
  88533. var o = new_buf(18);
  88534. o.write_shift(2, 0);
  88535. o.write_shift(2, 0);
  88536. o.write_shift(2, 0x7260);
  88537. o.write_shift(2, 0x44c0);
  88538. o.write_shift(2, 0x38);
  88539. o.write_shift(2, 0);
  88540. o.write_shift(2, 0);
  88541. o.write_shift(2, 1);
  88542. o.write_shift(2, 0x01f4);
  88543. return o;
  88544. }
  88545. /* [MS-XLS] 2.4.346 TODO */
  88546. function parse_Window2(blob, length, opts) {
  88547. if(opts && opts.biff >= 2 && opts.biff < 8) return {};
  88548. var f = blob.read_shift(2);
  88549. return { RTL: f & 0x40 };
  88550. }
  88551. function write_Window2(view) {
  88552. var o = new_buf(18), f = 0x6b6;
  88553. if(view && view.RTL) f |= 0x40;
  88554. o.write_shift(2, f);
  88555. o.write_shift(4, 0);
  88556. o.write_shift(4, 64);
  88557. o.write_shift(4, 0);
  88558. o.write_shift(4, 0);
  88559. return o;
  88560. }
  88561. /* [MS-XLS] 2.4.189 TODO */
  88562. function parse_Pane(/*blob, length, opts*/) {
  88563. }
  88564. /* [MS-XLS] 2.4.122 TODO */
  88565. function parse_Font(blob, length, opts) {
  88566. var o = {
  88567. dyHeight: blob.read_shift(2),
  88568. fl: blob.read_shift(2)
  88569. };
  88570. switch((opts && opts.biff) || 8) {
  88571. case 2: break;
  88572. case 3: case 4: blob.l += 2; break;
  88573. default: blob.l += 10; break;
  88574. }
  88575. o.name = parse_ShortXLUnicodeString(blob, 0, opts);
  88576. return o;
  88577. }
  88578. function write_Font(data, opts) {
  88579. var name = data.name || "Arial";
  88580. var b5 = (opts && (opts.biff == 5)), w = (b5 ? (15 + name.length) : (16 + 2 * name.length));
  88581. var o = new_buf(w);
  88582. o.write_shift(2, (data.sz || 12) * 20);
  88583. o.write_shift(4, 0);
  88584. o.write_shift(2, 400);
  88585. o.write_shift(4, 0);
  88586. o.write_shift(2, 0);
  88587. o.write_shift(1, name.length);
  88588. if(!b5) o.write_shift(1, 1);
  88589. o.write_shift((b5 ? 1 : 2) * name.length, name, (b5 ? "sbcs" : "utf16le"));
  88590. return o;
  88591. }
  88592. /* [MS-XLS] 2.4.149 */
  88593. function parse_LabelSst(blob) {
  88594. var cell = parse_XLSCell(blob);
  88595. cell.isst = blob.read_shift(4);
  88596. return cell;
  88597. }
  88598. /* [MS-XLS] 2.4.148 */
  88599. function parse_Label(blob, length, opts) {
  88600. var target = blob.l + length;
  88601. var cell = parse_XLSCell(blob, 6);
  88602. if(opts.biff == 2) blob.l++;
  88603. var str = parse_XLUnicodeString(blob, target - blob.l, opts);
  88604. cell.val = str;
  88605. return cell;
  88606. }
  88607. function write_Label(R, C, v, os, opts) {
  88608. var b8 = !opts || opts.biff == 8;
  88609. var o = new_buf(6 + 2 + (+b8) + (1 + b8) * v.length);
  88610. write_XLSCell(R, C, os, o);
  88611. o.write_shift(2, v.length);
  88612. if(b8) o.write_shift(1, 1);
  88613. o.write_shift((1 + b8) * v.length, v, b8 ? 'utf16le' : 'sbcs');
  88614. return o;
  88615. }
  88616. /* [MS-XLS] 2.4.126 Number Formats */
  88617. function parse_Format(blob, length, opts) {
  88618. var numFmtId = blob.read_shift(2);
  88619. var fmtstr = parse_XLUnicodeString2(blob, 0, opts);
  88620. return [numFmtId, fmtstr];
  88621. }
  88622. function write_Format(i, f, opts, o) {
  88623. var b5 = (opts && (opts.biff == 5));
  88624. if(!o) o = new_buf(b5 ? (3 + f.length) : (5 + 2 * f.length));
  88625. o.write_shift(2, i);
  88626. o.write_shift((b5 ? 1 : 2), f.length);
  88627. if(!b5) o.write_shift(1, 1);
  88628. o.write_shift((b5 ? 1 : 2) * f.length, f, (b5 ? 'sbcs' : 'utf16le'));
  88629. var out = (o.length > o.l) ? o.slice(0, o.l) : o;
  88630. if(out.l == null) out.l = out.length;
  88631. return out;
  88632. }
  88633. var parse_BIFF2Format = parse_XLUnicodeString2;
  88634. /* [MS-XLS] 2.4.90 */
  88635. function parse_Dimensions(blob, length, opts) {
  88636. var end = blob.l + length;
  88637. var w = opts.biff == 8 || !opts.biff ? 4 : 2;
  88638. var r = blob.read_shift(w), R = blob.read_shift(w);
  88639. var c = blob.read_shift(2), C = blob.read_shift(2);
  88640. blob.l = end;
  88641. return {s: {r:r, c:c}, e: {r:R, c:C}};
  88642. }
  88643. function write_Dimensions(range, opts) {
  88644. var w = opts.biff == 8 || !opts.biff ? 4 : 2;
  88645. var o = new_buf(2*w + 6);
  88646. o.write_shift(w, range.s.r);
  88647. o.write_shift(w, range.e.r + 1);
  88648. o.write_shift(2, range.s.c);
  88649. o.write_shift(2, range.e.c + 1);
  88650. o.write_shift(2, 0);
  88651. return o;
  88652. }
  88653. /* [MS-XLS] 2.4.220 */
  88654. function parse_RK(blob) {
  88655. var rw = blob.read_shift(2), col = blob.read_shift(2);
  88656. var rkrec = parse_RkRec(blob);
  88657. return {r:rw, c:col, ixfe:rkrec[0], rknum:rkrec[1]};
  88658. }
  88659. /* [MS-XLS] 2.4.175 */
  88660. function parse_MulRk(blob, length) {
  88661. var target = blob.l + length - 2;
  88662. var rw = blob.read_shift(2), col = blob.read_shift(2);
  88663. var rkrecs = [];
  88664. while(blob.l < target) rkrecs.push(parse_RkRec(blob));
  88665. if(blob.l !== target) throw new Error("MulRK read error");
  88666. var lastcol = blob.read_shift(2);
  88667. if(rkrecs.length != lastcol - col + 1) throw new Error("MulRK length mismatch");
  88668. return {r:rw, c:col, C:lastcol, rkrec:rkrecs};
  88669. }
  88670. /* [MS-XLS] 2.4.174 */
  88671. function parse_MulBlank(blob, length) {
  88672. var target = blob.l + length - 2;
  88673. var rw = blob.read_shift(2), col = blob.read_shift(2);
  88674. var ixfes = [];
  88675. while(blob.l < target) ixfes.push(blob.read_shift(2));
  88676. if(blob.l !== target) throw new Error("MulBlank read error");
  88677. var lastcol = blob.read_shift(2);
  88678. if(ixfes.length != lastcol - col + 1) throw new Error("MulBlank length mismatch");
  88679. return {r:rw, c:col, C:lastcol, ixfe:ixfes};
  88680. }
  88681. /* [MS-XLS] 2.5.20 2.5.249 TODO: interpret values here */
  88682. function parse_CellStyleXF(blob, length, style, opts) {
  88683. var o = {};
  88684. var a = blob.read_shift(4), b = blob.read_shift(4);
  88685. var c = blob.read_shift(4), d = blob.read_shift(2);
  88686. o.patternType = XLSFillPattern[c >> 26];
  88687. if(!opts.cellStyles) return o;
  88688. o.alc = a & 0x07;
  88689. o.fWrap = (a >> 3) & 0x01;
  88690. o.alcV = (a >> 4) & 0x07;
  88691. o.fJustLast = (a >> 7) & 0x01;
  88692. o.trot = (a >> 8) & 0xFF;
  88693. o.cIndent = (a >> 16) & 0x0F;
  88694. o.fShrinkToFit = (a >> 20) & 0x01;
  88695. o.iReadOrder = (a >> 22) & 0x02;
  88696. o.fAtrNum = (a >> 26) & 0x01;
  88697. o.fAtrFnt = (a >> 27) & 0x01;
  88698. o.fAtrAlc = (a >> 28) & 0x01;
  88699. o.fAtrBdr = (a >> 29) & 0x01;
  88700. o.fAtrPat = (a >> 30) & 0x01;
  88701. o.fAtrProt = (a >> 31) & 0x01;
  88702. o.dgLeft = b & 0x0F;
  88703. o.dgRight = (b >> 4) & 0x0F;
  88704. o.dgTop = (b >> 8) & 0x0F;
  88705. o.dgBottom = (b >> 12) & 0x0F;
  88706. o.icvLeft = (b >> 16) & 0x7F;
  88707. o.icvRight = (b >> 23) & 0x7F;
  88708. o.grbitDiag = (b >> 30) & 0x03;
  88709. o.icvTop = c & 0x7F;
  88710. o.icvBottom = (c >> 7) & 0x7F;
  88711. o.icvDiag = (c >> 14) & 0x7F;
  88712. o.dgDiag = (c >> 21) & 0x0F;
  88713. o.icvFore = d & 0x7F;
  88714. o.icvBack = (d >> 7) & 0x7F;
  88715. o.fsxButton = (d >> 14) & 0x01;
  88716. return o;
  88717. }
  88718. //function parse_CellXF(blob, length, opts) {return parse_CellStyleXF(blob,length,0, opts);}
  88719. //function parse_StyleXF(blob, length, opts) {return parse_CellStyleXF(blob,length,1, opts);}
  88720. /* [MS-XLS] 2.4.353 TODO: actually do this right */
  88721. function parse_XF(blob, length, opts) {
  88722. var o = {};
  88723. o.ifnt = blob.read_shift(2); o.numFmtId = blob.read_shift(2); o.flags = blob.read_shift(2);
  88724. o.fStyle = (o.flags >> 2) & 0x01;
  88725. length -= 6;
  88726. o.data = parse_CellStyleXF(blob, length, o.fStyle, opts);
  88727. return o;
  88728. }
  88729. function write_XF(data, ixfeP, opts, o) {
  88730. var b5 = (opts && (opts.biff == 5));
  88731. if(!o) o = new_buf(b5 ? 16 : 20);
  88732. o.write_shift(2, 0);
  88733. if(data.style) {
  88734. o.write_shift(2, (data.numFmtId||0));
  88735. o.write_shift(2, 0xFFF4);
  88736. } else {
  88737. o.write_shift(2, (data.numFmtId||0));
  88738. o.write_shift(2, (ixfeP<<4));
  88739. }
  88740. o.write_shift(4, 0);
  88741. o.write_shift(4, 0);
  88742. if(!b5) o.write_shift(4, 0);
  88743. o.write_shift(2, 0);
  88744. return o;
  88745. }
  88746. /* [MS-XLS] 2.4.134 */
  88747. function parse_Guts(blob) {
  88748. blob.l += 4;
  88749. var out = [blob.read_shift(2), blob.read_shift(2)];
  88750. if(out[0] !== 0) out[0]--;
  88751. if(out[1] !== 0) out[1]--;
  88752. if(out[0] > 7 || out[1] > 7) throw new Error("Bad Gutters: " + out.join("|"));
  88753. return out;
  88754. }
  88755. function write_Guts(guts) {
  88756. var o = new_buf(8);
  88757. o.write_shift(4, 0);
  88758. o.write_shift(2, guts[0] ? guts[0] + 1 : 0);
  88759. o.write_shift(2, guts[1] ? guts[1] + 1 : 0);
  88760. return o;
  88761. }
  88762. /* [MS-XLS] 2.4.24 */
  88763. function parse_BoolErr(blob, length, opts) {
  88764. var cell = parse_XLSCell(blob, 6);
  88765. if(opts.biff == 2) ++blob.l;
  88766. var val = parse_Bes(blob, 2);
  88767. cell.val = val;
  88768. cell.t = (val === true || val === false) ? 'b' : 'e';
  88769. return cell;
  88770. }
  88771. function write_BoolErr(R, C, v, os, opts, t) {
  88772. var o = new_buf(8);
  88773. write_XLSCell(R, C, os, o);
  88774. write_Bes(v, t, o);
  88775. return o;
  88776. }
  88777. /* [MS-XLS] 2.4.180 Number */
  88778. function parse_Number(blob) {
  88779. var cell = parse_XLSCell(blob, 6);
  88780. var xnum = parse_Xnum(blob, 8);
  88781. cell.val = xnum;
  88782. return cell;
  88783. }
  88784. function write_Number(R, C, v, os) {
  88785. var o = new_buf(14);
  88786. write_XLSCell(R, C, os, o);
  88787. write_Xnum(v, o);
  88788. return o;
  88789. }
  88790. var parse_XLHeaderFooter = parse_OptXLUnicodeString; // TODO: parse 2.4.136
  88791. /* [MS-XLS] 2.4.271 */
  88792. function parse_SupBook(blob, length, opts) {
  88793. var end = blob.l + length;
  88794. var ctab = blob.read_shift(2);
  88795. var cch = blob.read_shift(2);
  88796. opts.sbcch = cch;
  88797. if(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];
  88798. if(cch < 0x01 || cch >0xff) throw new Error("Unexpected SupBook type: "+cch);
  88799. var virtPath = parse_XLUnicodeStringNoCch(blob, cch);
  88800. /* TODO: 2.5.277 Virtual Path */
  88801. var rgst = [];
  88802. while(end > blob.l) rgst.push(parse_XLUnicodeString(blob));
  88803. return [cch, ctab, virtPath, rgst];
  88804. }
  88805. /* [MS-XLS] 2.4.105 TODO */
  88806. function parse_ExternName(blob, length, opts) {
  88807. var flags = blob.read_shift(2);
  88808. var body;
  88809. var o = ({
  88810. fBuiltIn: flags & 0x01,
  88811. fWantAdvise: (flags >>> 1) & 0x01,
  88812. fWantPict: (flags >>> 2) & 0x01,
  88813. fOle: (flags >>> 3) & 0x01,
  88814. fOleLink: (flags >>> 4) & 0x01,
  88815. cf: (flags >>> 5) & 0x3FF,
  88816. fIcon: flags >>> 15 & 0x01
  88817. });
  88818. if(opts.sbcch === 0x3A01) body = parse_AddinUdf(blob, length-2, opts);
  88819. //else throw new Error("unsupported SupBook cch: " + opts.sbcch);
  88820. o.body = body || blob.read_shift(length-2);
  88821. if(typeof body === "string") o.Name = body;
  88822. return o;
  88823. }
  88824. /* [MS-XLS] 2.4.150 TODO */
  88825. var XLSLblBuiltIn = [
  88826. "_xlnm.Consolidate_Area",
  88827. "_xlnm.Auto_Open",
  88828. "_xlnm.Auto_Close",
  88829. "_xlnm.Extract",
  88830. "_xlnm.Database",
  88831. "_xlnm.Criteria",
  88832. "_xlnm.Print_Area",
  88833. "_xlnm.Print_Titles",
  88834. "_xlnm.Recorder",
  88835. "_xlnm.Data_Form",
  88836. "_xlnm.Auto_Activate",
  88837. "_xlnm.Auto_Deactivate",
  88838. "_xlnm.Sheet_Title",
  88839. "_xlnm._FilterDatabase"
  88840. ];
  88841. function parse_Lbl(blob, length, opts) {
  88842. var target = blob.l + length;
  88843. var flags = blob.read_shift(2);
  88844. var chKey = blob.read_shift(1);
  88845. var cch = blob.read_shift(1);
  88846. var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
  88847. var itab = 0;
  88848. if(!opts || opts.biff >= 5) {
  88849. if(opts.biff != 5) blob.l += 2;
  88850. itab = blob.read_shift(2);
  88851. if(opts.biff == 5) blob.l += 2;
  88852. blob.l += 4;
  88853. }
  88854. var name = parse_XLUnicodeStringNoCch(blob, cch, opts);
  88855. if(flags & 0x20) name = XLSLblBuiltIn[name.charCodeAt(0)];
  88856. var npflen = target - blob.l; if(opts && opts.biff == 2) --npflen;
  88857. var rgce = target == blob.l || cce === 0 ? [] : parse_NameParsedFormula(blob, npflen, opts, cce);
  88858. return {
  88859. chKey: chKey,
  88860. Name: name,
  88861. itab: itab,
  88862. rgce: rgce
  88863. };
  88864. }
  88865. /* [MS-XLS] 2.4.106 TODO: verify filename encoding */
  88866. function parse_ExternSheet(blob, length, opts) {
  88867. if(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);
  88868. var o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);
  88869. while(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));
  88870. // [iSupBook, itabFirst, itabLast];
  88871. if(blob.l != target) throw new Error("Bad ExternSheet: " + blob.l + " != " + target);
  88872. return o;
  88873. }
  88874. function parse_BIFF5ExternSheet(blob, length, opts) {
  88875. if(blob[blob.l + 1] == 0x03) blob[blob.l]++;
  88876. var o = parse_ShortXLUnicodeString(blob, length, opts);
  88877. return o.charCodeAt(0) == 0x03 ? o.slice(1) : o;
  88878. }
  88879. /* [MS-XLS] 2.4.176 TODO: check older biff */
  88880. function parse_NameCmt(blob, length, opts) {
  88881. if(opts.biff < 8) { blob.l += length; return; }
  88882. var cchName = blob.read_shift(2);
  88883. var cchComment = blob.read_shift(2);
  88884. var name = parse_XLUnicodeStringNoCch(blob, cchName, opts);
  88885. var comment = parse_XLUnicodeStringNoCch(blob, cchComment, opts);
  88886. return [name, comment];
  88887. }
  88888. /* [MS-XLS] 2.4.260 */
  88889. function parse_ShrFmla(blob, length, opts) {
  88890. var ref = parse_RefU(blob, 6);
  88891. blob.l++;
  88892. var cUse = blob.read_shift(1);
  88893. length -= 8;
  88894. return [parse_SharedParsedFormula(blob, length, opts), cUse, ref];
  88895. }
  88896. /* [MS-XLS] 2.4.4 TODO */
  88897. function parse_Array(blob, length, opts) {
  88898. var ref = parse_Ref(blob, 6);
  88899. /* TODO: fAlwaysCalc */
  88900. switch(opts.biff) {
  88901. case 2: blob.l ++; length -= 7; break;
  88902. case 3: case 4: blob.l += 2; length -= 8; break;
  88903. default: blob.l += 6; length -= 12;
  88904. }
  88905. return [ref, parse_ArrayParsedFormula(blob, length, opts, ref)];
  88906. }
  88907. /* [MS-XLS] 2.4.173 */
  88908. function parse_MTRSettings(blob) {
  88909. var fMTREnabled = blob.read_shift(4) !== 0x00;
  88910. var fUserSetThreadCount = blob.read_shift(4) !== 0x00;
  88911. var cUserThreadCount = blob.read_shift(4);
  88912. return [fMTREnabled, fUserSetThreadCount, cUserThreadCount];
  88913. }
  88914. /* [MS-XLS] 2.5.186 TODO: BIFF5 */
  88915. function parse_NoteSh(blob, length, opts) {
  88916. if(opts.biff < 8) return;
  88917. var row = blob.read_shift(2), col = blob.read_shift(2);
  88918. var flags = blob.read_shift(2), idObj = blob.read_shift(2);
  88919. var stAuthor = parse_XLUnicodeString2(blob, 0, opts);
  88920. if(opts.biff < 8) blob.read_shift(1);
  88921. return [{r:row,c:col}, stAuthor, idObj, flags];
  88922. }
  88923. /* [MS-XLS] 2.4.179 */
  88924. function parse_Note(blob, length, opts) {
  88925. /* TODO: Support revisions */
  88926. return parse_NoteSh(blob, length, opts);
  88927. }
  88928. /* [MS-XLS] 2.4.168 */
  88929. function parse_MergeCells(blob, length) {
  88930. var merges = [];
  88931. var cmcs = blob.read_shift(2);
  88932. while (cmcs--) merges.push(parse_Ref8U(blob,length));
  88933. return merges;
  88934. }
  88935. function write_MergeCells(merges) {
  88936. var o = new_buf(2 + merges.length * 8);
  88937. o.write_shift(2, merges.length);
  88938. for(var i = 0; i < merges.length; ++i) write_Ref8U(merges[i], o);
  88939. return o;
  88940. }
  88941. /* [MS-XLS] 2.4.181 TODO: parse all the things! */
  88942. function parse_Obj(blob, length, opts) {
  88943. if(opts && opts.biff < 8) return parse_BIFF5Obj(blob, length, opts);
  88944. var cmo = parse_FtCmo(blob, 22); // id, ot, flags
  88945. var fts = parse_FtArray(blob, length-22, cmo[1]);
  88946. return { cmo: cmo, ft:fts };
  88947. }
  88948. /* from older spec */
  88949. var parse_BIFF5OT = [];
  88950. parse_BIFF5OT[0x08] = function(blob, length) {
  88951. var tgt = blob.l + length;
  88952. blob.l += 10; // todo
  88953. var cf = blob.read_shift(2);
  88954. blob.l += 4;
  88955. blob.l += 2; //var cbPictFmla = blob.read_shift(2);
  88956. blob.l += 2;
  88957. blob.l += 2; //var grbit = blob.read_shift(2);
  88958. blob.l += 4;
  88959. var cchName = blob.read_shift(1);
  88960. blob.l += cchName; // TODO: stName
  88961. blob.l = tgt; // TODO: fmla
  88962. return { fmt:cf };
  88963. };
  88964. function parse_BIFF5Obj(blob, length, opts) {
  88965. blob.l += 4; //var cnt = blob.read_shift(4);
  88966. var ot = blob.read_shift(2);
  88967. var id = blob.read_shift(2);
  88968. var grbit = blob.read_shift(2);
  88969. blob.l += 2; //var colL = blob.read_shift(2);
  88970. blob.l += 2; //var dxL = blob.read_shift(2);
  88971. blob.l += 2; //var rwT = blob.read_shift(2);
  88972. blob.l += 2; //var dyT = blob.read_shift(2);
  88973. blob.l += 2; //var colR = blob.read_shift(2);
  88974. blob.l += 2; //var dxR = blob.read_shift(2);
  88975. blob.l += 2; //var rwB = blob.read_shift(2);
  88976. blob.l += 2; //var dyB = blob.read_shift(2);
  88977. blob.l += 2; //var cbMacro = blob.read_shift(2);
  88978. blob.l += 6;
  88979. length -= 36;
  88980. var fts = [];
  88981. fts.push((parse_BIFF5OT[ot]||parsenoop)(blob, length, opts));
  88982. return { cmo: [id, ot, grbit], ft:fts };
  88983. }
  88984. /* [MS-XLS] 2.4.329 TODO: parse properly */
  88985. function parse_TxO(blob, length, opts) {
  88986. var s = blob.l;
  88987. var texts = "";
  88988. try {
  88989. blob.l += 4;
  88990. var ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];
  88991. var controlInfo; // eslint-disable-line no-unused-vars
  88992. if([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;
  88993. else controlInfo = parse_ControlInfo(blob, 6, opts);
  88994. var cchText = blob.read_shift(2);
  88995. /*var cbRuns = */blob.read_shift(2);
  88996. /*var ifntEmpty = */parseuint16(blob, 2);
  88997. var len = blob.read_shift(2);
  88998. blob.l += len;
  88999. //var fmla = parse_ObjFmla(blob, s + length - blob.l);
  89000. for(var i = 1; i < blob.lens.length-1; ++i) {
  89001. if(blob.l-s != blob.lens[i]) throw new Error("TxO: bad continue record");
  89002. var hdr = blob[blob.l];
  89003. var t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);
  89004. texts += t;
  89005. if(texts.length >= (hdr ? cchText : 2*cchText)) break;
  89006. }
  89007. if(texts.length !== cchText && texts.length !== cchText*2) {
  89008. throw new Error("cchText: " + cchText + " != " + texts.length);
  89009. }
  89010. blob.l = s + length;
  89011. /* [MS-XLS] 2.5.272 TxORuns */
  89012. // var rgTxoRuns = [];
  89013. // for(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;
  89014. // var cchText2 = blob.read_shift(2);
  89015. // if(cchText2 !== cchText) throw new Error("TxOLastRun mismatch: " + cchText2 + " " + cchText);
  89016. // blob.l += 6;
  89017. // if(s + length != blob.l) throw new Error("TxO " + (s + length) + ", at " + blob.l);
  89018. return { t: texts };
  89019. } catch(e) { blob.l = s + length; return { t: texts }; }
  89020. }
  89021. /* [MS-XLS] 2.4.140 */
  89022. function parse_HLink(blob, length) {
  89023. var ref = parse_Ref8U(blob, 8);
  89024. blob.l += 16; /* CLSID */
  89025. var hlink = parse_Hyperlink(blob, length-24);
  89026. return [ref, hlink];
  89027. }
  89028. function write_HLink(hl) {
  89029. var O = new_buf(24);
  89030. var ref = decode_cell(hl[0]);
  89031. O.write_shift(2, ref.r); O.write_shift(2, ref.r);
  89032. O.write_shift(2, ref.c); O.write_shift(2, ref.c);
  89033. var clsid = "d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
  89034. for(var i = 0; i < 16; ++i) O.write_shift(1, parseInt(clsid[i], 16));
  89035. return bconcat([O, write_Hyperlink(hl[1])]);
  89036. }
  89037. /* [MS-XLS] 2.4.141 */
  89038. function parse_HLinkTooltip(blob, length) {
  89039. blob.read_shift(2);
  89040. var ref = parse_Ref8U(blob, 8);
  89041. var wzTooltip = blob.read_shift((length-10)/2, 'dbcs-cont');
  89042. wzTooltip = wzTooltip.replace(chr0,"");
  89043. return [ref, wzTooltip];
  89044. }
  89045. function write_HLinkTooltip(hl) {
  89046. var TT = hl[1].Tooltip;
  89047. var O = new_buf(10 + 2 * (TT.length + 1));
  89048. O.write_shift(2, 0x0800);
  89049. var ref = decode_cell(hl[0]);
  89050. O.write_shift(2, ref.r); O.write_shift(2, ref.r);
  89051. O.write_shift(2, ref.c); O.write_shift(2, ref.c);
  89052. for(var i = 0; i < TT.length; ++i) O.write_shift(2, TT.charCodeAt(i));
  89053. O.write_shift(2, 0);
  89054. return O;
  89055. }
  89056. /* [MS-XLS] 2.4.63 */
  89057. function parse_Country(blob) {
  89058. var o = [0,0], d;
  89059. d = blob.read_shift(2); o[0] = CountryEnum[d] || d;
  89060. d = blob.read_shift(2); o[1] = CountryEnum[d] || d;
  89061. return o;
  89062. }
  89063. function write_Country(o) {
  89064. if(!o) o = new_buf(4);
  89065. o.write_shift(2, 0x01);
  89066. o.write_shift(2, 0x01);
  89067. return o;
  89068. }
  89069. /* [MS-XLS] 2.4.50 ClrtClient */
  89070. function parse_ClrtClient(blob) {
  89071. var ccv = blob.read_shift(2);
  89072. var o = [];
  89073. while(ccv-->0) o.push(parse_LongRGB(blob, 8));
  89074. return o;
  89075. }
  89076. /* [MS-XLS] 2.4.188 */
  89077. function parse_Palette(blob) {
  89078. var ccv = blob.read_shift(2);
  89079. var o = [];
  89080. while(ccv-->0) o.push(parse_LongRGB(blob, 8));
  89081. return o;
  89082. }
  89083. /* [MS-XLS] 2.4.354 */
  89084. function parse_XFCRC(blob) {
  89085. blob.l += 2;
  89086. var o = {cxfs:0, crc:0};
  89087. o.cxfs = blob.read_shift(2);
  89088. o.crc = blob.read_shift(4);
  89089. return o;
  89090. }
  89091. /* [MS-XLS] 2.4.53 TODO: parse flags */
  89092. /* [MS-XLSB] 2.4.323 TODO: parse flags */
  89093. function parse_ColInfo(blob, length, opts) {
  89094. if(!opts.cellStyles) return parsenoop(blob, length);
  89095. var w = opts && opts.biff >= 12 ? 4 : 2;
  89096. var colFirst = blob.read_shift(w);
  89097. var colLast = blob.read_shift(w);
  89098. var coldx = blob.read_shift(w);
  89099. var ixfe = blob.read_shift(w);
  89100. var flags = blob.read_shift(2);
  89101. if(w == 2) blob.l += 2;
  89102. var o = ({s:colFirst, e:colLast, w:coldx, ixfe:ixfe, flags:flags});
  89103. if(opts.biff >= 5 || !opts.biff) o.level = (flags >> 8) & 0x7;
  89104. return o;
  89105. }
  89106. /* [MS-XLS] 2.4.257 */
  89107. function parse_Setup(blob, length) {
  89108. var o = {};
  89109. if(length < 32) return o;
  89110. blob.l += 16;
  89111. o.header = parse_Xnum(blob, 8);
  89112. o.footer = parse_Xnum(blob, 8);
  89113. blob.l += 2;
  89114. return o;
  89115. }
  89116. /* [MS-XLS] 2.4.261 */
  89117. function parse_ShtProps(blob, length, opts) {
  89118. var def = {area:false};
  89119. if(opts.biff != 5) { blob.l += length; return def; }
  89120. var d = blob.read_shift(1); blob.l += 3;
  89121. if((d & 0x10)) def.area = true;
  89122. return def;
  89123. }
  89124. /* [MS-XLS] 2.4.241 */
  89125. function write_RRTabId(n) {
  89126. var out = new_buf(2 * n);
  89127. for(var i = 0; i < n; ++i) out.write_shift(2, i+1);
  89128. return out;
  89129. }
  89130. var parse_Blank = parse_XLSCell; /* [MS-XLS] 2.4.20 Just the cell */
  89131. var parse_Scl = parseuint16a; /* [MS-XLS] 2.4.247 num, den */
  89132. var parse_String = parse_XLUnicodeString; /* [MS-XLS] 2.4.268 */
  89133. /* --- Specific to versions before BIFF8 --- */
  89134. function parse_ImData(blob) {
  89135. var cf = blob.read_shift(2);
  89136. var env = blob.read_shift(2);
  89137. var lcb = blob.read_shift(4);
  89138. var o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)};
  89139. blob.l += lcb;
  89140. return o;
  89141. }
  89142. /* BIFF2_??? where ??? is the name from [XLS] */
  89143. function parse_BIFF2STR(blob, length, opts) {
  89144. var cell = parse_XLSCell(blob, 6);
  89145. ++blob.l;
  89146. var str = parse_XLUnicodeString2(blob, length-7, opts);
  89147. cell.t = 'str';
  89148. cell.val = str;
  89149. return cell;
  89150. }
  89151. function parse_BIFF2NUM(blob) {
  89152. var cell = parse_XLSCell(blob, 6);
  89153. ++blob.l;
  89154. var num = parse_Xnum(blob, 8);
  89155. cell.t = 'n';
  89156. cell.val = num;
  89157. return cell;
  89158. }
  89159. function write_BIFF2NUM(r, c, val) {
  89160. var out = new_buf(15);
  89161. write_BIFF2Cell(out, r, c);
  89162. out.write_shift(8, val, 'f');
  89163. return out;
  89164. }
  89165. function parse_BIFF2INT(blob) {
  89166. var cell = parse_XLSCell(blob, 6);
  89167. ++blob.l;
  89168. var num = blob.read_shift(2);
  89169. cell.t = 'n';
  89170. cell.val = num;
  89171. return cell;
  89172. }
  89173. function write_BIFF2INT(r, c, val) {
  89174. var out = new_buf(9);
  89175. write_BIFF2Cell(out, r, c);
  89176. out.write_shift(2, val);
  89177. return out;
  89178. }
  89179. function parse_BIFF2STRING(blob) {
  89180. var cch = blob.read_shift(1);
  89181. if(cch === 0) { blob.l++; return ""; }
  89182. return blob.read_shift(cch, 'sbcs-cont');
  89183. }
  89184. /* TODO: convert to BIFF8 font struct */
  89185. function parse_BIFF2FONTXTRA(blob, length) {
  89186. blob.l += 6; // unknown
  89187. blob.l += 2; // font weight "bls"
  89188. blob.l += 1; // charset
  89189. blob.l += 3; // unknown
  89190. blob.l += 1; // font family
  89191. blob.l += length - 13;
  89192. }
  89193. /* TODO: parse rich text runs */
  89194. function parse_RString(blob, length, opts) {
  89195. var end = blob.l + length;
  89196. var cell = parse_XLSCell(blob, 6);
  89197. var cch = blob.read_shift(2);
  89198. var str = parse_XLUnicodeStringNoCch(blob, cch, opts);
  89199. blob.l = end;
  89200. cell.t = 'str';
  89201. cell.val = str;
  89202. return cell;
  89203. }
  89204. /* from js-harb (C) 2014-present SheetJS */
  89205. var DBF = (function() {
  89206. var dbf_codepage_map = {
  89207. /* Code Pages Supported by Visual FoxPro */
  89208. 0x01: 437, 0x02: 850,
  89209. 0x03: 1252, 0x04: 10000,
  89210. 0x64: 852, 0x65: 866,
  89211. 0x66: 865, 0x67: 861,
  89212. 0x68: 895, 0x69: 620,
  89213. 0x6A: 737, 0x6B: 857,
  89214. 0x78: 950, 0x79: 949,
  89215. 0x7A: 936, 0x7B: 932,
  89216. 0x7C: 874, 0x7D: 1255,
  89217. 0x7E: 1256, 0x96: 10007,
  89218. 0x97: 10029, 0x98: 10006,
  89219. 0xC8: 1250, 0xC9: 1251,
  89220. 0xCA: 1254, 0xCB: 1253,
  89221. /* shapefile DBF extension */
  89222. 0x00: 20127, 0x08: 865,
  89223. 0x09: 437, 0x0A: 850,
  89224. 0x0B: 437, 0x0D: 437,
  89225. 0x0E: 850, 0x0F: 437,
  89226. 0x10: 850, 0x11: 437,
  89227. 0x12: 850, 0x13: 932,
  89228. 0x14: 850, 0x15: 437,
  89229. 0x16: 850, 0x17: 865,
  89230. 0x18: 437, 0x19: 437,
  89231. 0x1A: 850, 0x1B: 437,
  89232. 0x1C: 863, 0x1D: 850,
  89233. 0x1F: 852, 0x22: 852,
  89234. 0x23: 852, 0x24: 860,
  89235. 0x25: 850, 0x26: 866,
  89236. 0x37: 850, 0x40: 852,
  89237. 0x4D: 936, 0x4E: 949,
  89238. 0x4F: 950, 0x50: 874,
  89239. 0x57: 1252, 0x58: 1252,
  89240. 0x59: 1252,
  89241. 0xFF: 16969
  89242. };
  89243. var dbf_reverse_map = evert({
  89244. 0x01: 437, 0x02: 850,
  89245. 0x03: 1252, 0x04: 10000,
  89246. 0x64: 852, 0x65: 866,
  89247. 0x66: 865, 0x67: 861,
  89248. 0x68: 895, 0x69: 620,
  89249. 0x6A: 737, 0x6B: 857,
  89250. 0x78: 950, 0x79: 949,
  89251. 0x7A: 936, 0x7B: 932,
  89252. 0x7C: 874, 0x7D: 1255,
  89253. 0x7E: 1256, 0x96: 10007,
  89254. 0x97: 10029, 0x98: 10006,
  89255. 0xC8: 1250, 0xC9: 1251,
  89256. 0xCA: 1254, 0xCB: 1253,
  89257. 0x00: 20127
  89258. });
  89259. /* TODO: find an actual specification */
  89260. function dbf_to_aoa(buf, opts) {
  89261. var out = [];
  89262. /* TODO: browser based */
  89263. var d = (new_raw_buf(1));
  89264. switch(opts.type) {
  89265. case 'base64': d = s2a(Base64.decode(buf)); break;
  89266. case 'binary': d = s2a(buf); break;
  89267. case 'buffer':
  89268. case 'array': d = buf; break;
  89269. }
  89270. prep_blob(d, 0);
  89271. /* header */
  89272. var ft = d.read_shift(1);
  89273. var memo = false;
  89274. var vfp = false, l7 = false;
  89275. switch(ft) {
  89276. case 0x02: case 0x03: break;
  89277. case 0x30: vfp = true; memo = true; break;
  89278. case 0x31: vfp = true; break;
  89279. case 0x83: memo = true; break;
  89280. case 0x8B: memo = true; break;
  89281. case 0x8C: memo = true; l7 = true; break;
  89282. case 0xF5: memo = true; break;
  89283. default: throw new Error("DBF Unsupported Version: " + ft.toString(16));
  89284. }
  89285. var /*filedate = new Date(),*/ nrow = 0, fpos = 0;
  89286. if(ft == 0x02) nrow = d.read_shift(2);
  89287. /*filedate = new Date(d.read_shift(1) + 1900, d.read_shift(1) - 1, d.read_shift(1));*/d.l += 3;
  89288. if(ft != 0x02) nrow = d.read_shift(4);
  89289. if(ft != 0x02) fpos = d.read_shift(2);
  89290. var rlen = d.read_shift(2);
  89291. var /*flags = 0,*/ current_cp = 1252;
  89292. if(ft != 0x02) {
  89293. d.l+=16;
  89294. /*flags = */d.read_shift(1);
  89295. //if(memo && ((flags & 0x02) === 0)) throw new Error("DBF Flags " + flags.toString(16) + " ft " + ft.toString(16));
  89296. /* codepage present in FoxPro */
  89297. if(d[d.l] !== 0) current_cp = dbf_codepage_map[d[d.l]];
  89298. d.l+=1;
  89299. d.l+=2;
  89300. }
  89301. if(l7) d.l += 36;
  89302. var fields = [], field = ({});
  89303. var hend = fpos - 10 - (vfp ? 264 : 0), ww = l7 ? 32 : 11;
  89304. while(ft == 0x02 ? d.l < d.length && d[d.l] != 0x0d: d.l < hend) {
  89305. field = ({});
  89306. field.name = cptable.utils.decode(current_cp, d.slice(d.l, d.l+ww)).replace(/[\u0000\r\n].*$/g,"");
  89307. d.l += ww;
  89308. field.type = String.fromCharCode(d.read_shift(1));
  89309. if(ft != 0x02 && !l7) field.offset = d.read_shift(4);
  89310. field.len = d.read_shift(1);
  89311. if(ft == 0x02) field.offset = d.read_shift(2);
  89312. field.dec = d.read_shift(1);
  89313. if(field.name.length) fields.push(field);
  89314. if(ft != 0x02) d.l += l7 ? 13 : 14;
  89315. switch(field.type) {
  89316. case 'B': // VFP Double
  89317. if((!vfp || field.len != 8) && opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);
  89318. break;
  89319. case 'G': // General
  89320. case 'P': // Picture
  89321. if(opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);
  89322. break;
  89323. case 'C': // character
  89324. case 'D': // date
  89325. case 'F': // floating point
  89326. case 'I': // long
  89327. case 'L': // boolean
  89328. case 'M': // memo
  89329. case 'N': // number
  89330. case 'O': // double
  89331. case 'T': // datetime
  89332. case 'Y': // currency
  89333. case '0': // VFP _NullFlags
  89334. case '@': // timestamp
  89335. case '+': // autoincrement
  89336. break;
  89337. default: throw new Error('Unknown Field Type: ' + field.type);
  89338. }
  89339. }
  89340. if(d[d.l] !== 0x0D) d.l = fpos-1;
  89341. else if(ft == 0x02) d.l = 0x209;
  89342. if(ft != 0x02) {
  89343. if(d.read_shift(1) !== 0x0D) throw new Error("DBF Terminator not found " + d.l + " " + d[d.l]);
  89344. d.l = fpos;
  89345. }
  89346. /* data */
  89347. var R = 0, C = 0;
  89348. out[0] = [];
  89349. for(C = 0; C != fields.length; ++C) out[0][C] = fields[C].name;
  89350. while(nrow-- > 0) {
  89351. if(d[d.l] === 0x2A) { d.l+=rlen; continue; }
  89352. ++d.l;
  89353. out[++R] = []; C = 0;
  89354. for(C = 0; C != fields.length; ++C) {
  89355. var dd = d.slice(d.l, d.l+fields[C].len); d.l+=fields[C].len;
  89356. prep_blob(dd, 0);
  89357. var s = cptable.utils.decode(current_cp, dd);
  89358. switch(fields[C].type) {
  89359. case 'C':
  89360. out[R][C] = cptable.utils.decode(current_cp, dd);
  89361. out[R][C] = out[R][C].trim();
  89362. break;
  89363. case 'D':
  89364. if(s.length === 8) out[R][C] = new Date(+s.slice(0,4), +s.slice(4,6)-1, +s.slice(6,8));
  89365. else out[R][C] = s;
  89366. break;
  89367. case 'F': out[R][C] = parseFloat(s.trim()); break;
  89368. case '+': case 'I': out[R][C] = l7 ? dd.read_shift(-4, 'i') ^ 0x80000000 : dd.read_shift(4, 'i'); break;
  89369. case 'L': switch(s.toUpperCase()) {
  89370. case 'Y': case 'T': out[R][C] = true; break;
  89371. case 'N': case 'F': out[R][C] = false; break;
  89372. case ' ': case '?': out[R][C] = false; break; /* NOTE: technically uninitialized */
  89373. default: throw new Error("DBF Unrecognized L:|" + s + "|");
  89374. } break;
  89375. case 'M': /* TODO: handle memo files */
  89376. if(!memo) throw new Error("DBF Unexpected MEMO for type " + ft.toString(16));
  89377. out[R][C] = "##MEMO##" + (l7 ? parseInt(s.trim(), 10): dd.read_shift(4));
  89378. break;
  89379. case 'N': out[R][C] = +s.replace(/\u0000/g,"").trim(); break;
  89380. case '@': out[R][C] = new Date(dd.read_shift(-8, 'f') - 0x388317533400); break;
  89381. case 'T': out[R][C] = new Date((dd.read_shift(4) - 0x253D8C) * 0x5265C00 + dd.read_shift(4)); break;
  89382. case 'Y': out[R][C] = dd.read_shift(4,'i')/1e4; break;
  89383. case 'O': out[R][C] = -dd.read_shift(-8, 'f'); break;
  89384. case 'B': if(vfp && fields[C].len == 8) { out[R][C] = dd.read_shift(8,'f'); break; }
  89385. /* falls through */
  89386. case 'G': case 'P': dd.l += fields[C].len; break;
  89387. case '0':
  89388. if(fields[C].name === '_NullFlags') break;
  89389. /* falls through */
  89390. default: throw new Error("DBF Unsupported data type " + fields[C].type);
  89391. }
  89392. }
  89393. }
  89394. if(ft != 0x02) if(d.l < d.length && d[d.l++] != 0x1A) throw new Error("DBF EOF Marker missing " + (d.l-1) + " of " + d.length + " " + d[d.l-1].toString(16));
  89395. if(opts && opts.sheetRows) out = out.slice(0, opts.sheetRows);
  89396. return out;
  89397. }
  89398. function dbf_to_sheet(buf, opts) {
  89399. var o = opts || {};
  89400. if(!o.dateNF) o.dateNF = "yyyymmdd";
  89401. return aoa_to_sheet(dbf_to_aoa(buf, o), o);
  89402. }
  89403. function dbf_to_workbook(buf, opts) {
  89404. try { return sheet_to_workbook(dbf_to_sheet(buf, opts), opts); }
  89405. catch(e) { if(opts && opts.WTF) throw e; }
  89406. return ({SheetNames:[],Sheets:{}});
  89407. }
  89408. var _RLEN = { 'B': 8, 'C': 250, 'L': 1, 'D': 8, '?': 0, '': 0 };
  89409. function sheet_to_dbf(ws, opts) {
  89410. var o = opts || {};
  89411. if(+o.codepage >= 0) set_cp(+o.codepage);
  89412. if(o.type == "string") throw new Error("Cannot write DBF to JS string");
  89413. var ba = buf_array();
  89414. var aoa = sheet_to_json(ws, {header:1, raw:true, cellDates:true});
  89415. var headers = aoa[0], data = aoa.slice(1);
  89416. var i = 0, j = 0, hcnt = 0, rlen = 1;
  89417. for(i = 0; i < headers.length; ++i) {
  89418. if(i == null) continue;
  89419. ++hcnt;
  89420. if(typeof headers[i] === 'number') headers[i] = headers[i].toString(10);
  89421. if(typeof headers[i] !== 'string') throw new Error("DBF Invalid column name " + headers[i] + " |" + (typeof headers[i]) + "|");
  89422. if(headers.indexOf(headers[i]) !== i) for(j=0; j<1024;++j)
  89423. if(headers.indexOf(headers[i] + "_" + j) == -1) { headers[i] += "_" + j; break; }
  89424. }
  89425. var range = safe_decode_range(ws['!ref']);
  89426. var coltypes = [];
  89427. for(i = 0; i <= range.e.c - range.s.c; ++i) {
  89428. var col = [];
  89429. for(j=0; j < data.length; ++j) {
  89430. if(data[j][i] != null) col.push(data[j][i]);
  89431. }
  89432. if(col.length == 0 || headers[i] == null) { coltypes[i] = '?'; continue; }
  89433. var guess = '', _guess = '';
  89434. for(j = 0; j < col.length; ++j) {
  89435. switch(typeof col[j]) {
  89436. /* TODO: check if L2 compat is desired */
  89437. case 'number': _guess = 'B'; break;
  89438. case 'string': _guess = 'C'; break;
  89439. case 'boolean': _guess = 'L'; break;
  89440. case 'object': _guess = col[j] instanceof Date ? 'D' : 'C'; break;
  89441. default: _guess = 'C';
  89442. }
  89443. guess = guess && guess != _guess ? 'C' : _guess;
  89444. if(guess == 'C') break;
  89445. }
  89446. rlen += _RLEN[guess] || 0;
  89447. coltypes[i] = guess;
  89448. }
  89449. var h = ba.next(32);
  89450. h.write_shift(4, 0x13021130);
  89451. h.write_shift(4, data.length);
  89452. h.write_shift(2, 296 + 32 * hcnt);
  89453. h.write_shift(2, rlen);
  89454. for(i=0; i < 4; ++i) h.write_shift(4, 0);
  89455. h.write_shift(4, 0x00000000 | ((+dbf_reverse_map[current_ansi] || 0x03)<<8));
  89456. for(i = 0, j = 0; i < headers.length; ++i) {
  89457. if(headers[i] == null) continue;
  89458. var hf = ba.next(32);
  89459. var _f = (headers[i].slice(-10) + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00").slice(0, 11);
  89460. hf.write_shift(1, _f, "sbcs");
  89461. hf.write_shift(1, coltypes[i] == '?' ? 'C' : coltypes[i], "sbcs");
  89462. hf.write_shift(4, j);
  89463. hf.write_shift(1, _RLEN[coltypes[i]] || 0);
  89464. hf.write_shift(1, 0);
  89465. hf.write_shift(1, 0x02);
  89466. hf.write_shift(4, 0);
  89467. hf.write_shift(1, 0);
  89468. hf.write_shift(4, 0);
  89469. hf.write_shift(4, 0);
  89470. j += _RLEN[coltypes[i]] || 0;
  89471. }
  89472. var hb = ba.next(264);
  89473. hb.write_shift(4, 0x0000000D);
  89474. for(i=0; i < 65;++i) hb.write_shift(4, 0x00000000);
  89475. for(i=0; i < data.length; ++i) {
  89476. var rout = ba.next(rlen);
  89477. rout.write_shift(1, 0);
  89478. for(j=0; j<headers.length; ++j) {
  89479. if(headers[j] == null) continue;
  89480. switch(coltypes[j]) {
  89481. case 'L': rout.write_shift(1, data[i][j] == null ? 0x3F : data[i][j] ? 0x54 : 0x46); break;
  89482. case 'B': rout.write_shift(8, data[i][j]||0, 'f'); break;
  89483. case 'D':
  89484. if(!data[i][j]) rout.write_shift(8, "00000000", "sbcs");
  89485. else {
  89486. rout.write_shift(4, ("0000"+data[i][j].getFullYear()).slice(-4), "sbcs");
  89487. rout.write_shift(2, ("00"+(data[i][j].getMonth()+1)).slice(-2), "sbcs");
  89488. rout.write_shift(2, ("00"+data[i][j].getDate()).slice(-2), "sbcs");
  89489. } break;
  89490. case 'C':
  89491. var _s = String(data[i][j]||"");
  89492. rout.write_shift(1, _s, "sbcs");
  89493. for(hcnt=0; hcnt < 250-_s.length; ++hcnt) rout.write_shift(1, 0x20); break;
  89494. }
  89495. }
  89496. // data
  89497. }
  89498. ba.next(1).write_shift(1, 0x1A);
  89499. return ba.end();
  89500. }
  89501. return {
  89502. to_workbook: dbf_to_workbook,
  89503. to_sheet: dbf_to_sheet,
  89504. from_sheet: sheet_to_dbf
  89505. };
  89506. })();
  89507. var SYLK = (function() {
  89508. /* TODO: stress test sequences */
  89509. var sylk_escapes = ({
  89510. AA:'À', BA:'Á', CA:'Â', DA:195, HA:'Ä', JA:197,
  89511. AE:'È', BE:'É', CE:'Ê', HE:'Ë',
  89512. AI:'Ì', BI:'Í', CI:'Î', HI:'Ï',
  89513. AO:'Ò', BO:'Ó', CO:'Ô', DO:213, HO:'Ö',
  89514. AU:'Ù', BU:'Ú', CU:'Û', HU:'Ü',
  89515. Aa:'à', Ba:'á', Ca:'â', Da:227, Ha:'ä', Ja:229,
  89516. Ae:'è', Be:'é', Ce:'ê', He:'ë',
  89517. Ai:'ì', Bi:'í', Ci:'î', Hi:'ï',
  89518. Ao:'ò', Bo:'ó', Co:'ô', Do:245, Ho:'ö',
  89519. Au:'ù', Bu:'ú', Cu:'û', Hu:'ü',
  89520. KC:'Ç', Kc:'ç', q:'æ', z:'œ', a:'Æ', j:'Œ',
  89521. DN:209, Dn:241, Hy:255,
  89522. S:169, c:170, R:174, B:180,
  89523. 0:176, 1:177, 2:178,
  89524. 3:179, 5:181, 6:182,
  89525. 7:183, Q:185, k:186, b:208, i:216, l:222, s:240, y:248,
  89526. "!":161, '"':162, "#":163, "(":164, "%":165, "'":167, "H ":168,
  89527. "+":171, ";":187, "<":188, "=":189, ">":190, "?":191, "{":223
  89528. });
  89529. var sylk_char_regex = new RegExp("\u001BN(" + keys(sylk_escapes).join("|").replace(/\|\|\|/, "|\\||").replace(/([?()+])/g,"\\$1") + "|\\|)", "gm");
  89530. var sylk_char_fn = function(_, $1){ var o = sylk_escapes[$1]; return typeof o == "number" ? _getansi(o) : o; };
  89531. var decode_sylk_char = function($$, $1, $2) { var newcc = (($1.charCodeAt(0) - 0x20)<<4) | ($2.charCodeAt(0) - 0x30); return newcc == 59 ? $$ : _getansi(newcc); };
  89532. sylk_escapes["|"] = 254;
  89533. /* TODO: find an actual specification */
  89534. function sylk_to_aoa(d, opts) {
  89535. switch(opts.type) {
  89536. case 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);
  89537. case 'binary': return sylk_to_aoa_str(d, opts);
  89538. case 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);
  89539. case 'array': return sylk_to_aoa_str(cc2str(d), opts);
  89540. }
  89541. throw new Error("Unrecognized type " + opts.type);
  89542. }
  89543. function sylk_to_aoa_str(str, opts) {
  89544. var records = str.split(/[\n\r]+/), R = -1, C = -1, ri = 0, rj = 0, arr = [];
  89545. var formats = [];
  89546. var next_cell_format = null;
  89547. var sht = {}, rowinfo = [], colinfo = [], cw = [];
  89548. var Mval = 0, j;
  89549. if(+opts.codepage >= 0) set_cp(+opts.codepage);
  89550. for (; ri !== records.length; ++ri) {
  89551. Mval = 0;
  89552. var rstr=records[ri].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g, decode_sylk_char).replace(sylk_char_regex, sylk_char_fn);
  89553. var record=rstr.replace(/;;/g, "\u0000").split(";").map(function(x) { return x.replace(/\u0000/g, ";"); });
  89554. var RT=record[0], val;
  89555. if(rstr.length > 0) switch(RT) {
  89556. case 'ID': break; /* header */
  89557. case 'E': break; /* EOF */
  89558. case 'B': break; /* dimensions */
  89559. case 'O': break; /* options? */
  89560. case 'P':
  89561. if(record[1].charAt(0) == 'P')
  89562. formats.push(rstr.slice(3).replace(/;;/g, ";"));
  89563. break;
  89564. case 'C':
  89565. var C_seen_K = false, C_seen_X = false;
  89566. for(rj=1; rj<record.length; ++rj) switch(record[rj].charAt(0)) {
  89567. case 'X': C = parseInt(record[rj].slice(1))-1; C_seen_X = true; break;
  89568. case 'Y':
  89569. R = parseInt(record[rj].slice(1))-1; if(!C_seen_X) C = 0;
  89570. for(j = arr.length; j <= R; ++j) arr[j] = [];
  89571. break;
  89572. case 'K':
  89573. val = record[rj].slice(1);
  89574. if(val.charAt(0) === '"') val = val.slice(1,val.length - 1);
  89575. else if(val === 'TRUE') val = true;
  89576. else if(val === 'FALSE') val = false;
  89577. else if(!isNaN(fuzzynum(val))) {
  89578. val = fuzzynum(val);
  89579. if(next_cell_format !== null && SSF.is_date(next_cell_format)) val = numdate(val);
  89580. } else if(!isNaN(fuzzydate(val).getDate())) {
  89581. val = parseDate(val);
  89582. }
  89583. if(typeof cptable !== 'undefined' && typeof val == "string" && ((opts||{}).type != "string") && (opts||{}).codepage) val = cptable.utils.decode(opts.codepage, val);
  89584. C_seen_K = true;
  89585. break;
  89586. case 'E':
  89587. var formula = rc_to_a1(record[rj].slice(1), {r:R,c:C});
  89588. arr[R][C] = [arr[R][C], formula];
  89589. break;
  89590. default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
  89591. }
  89592. if(C_seen_K) { arr[R][C] = val; next_cell_format = null; }
  89593. break;
  89594. case 'F':
  89595. var F_seen = 0;
  89596. for(rj=1; rj<record.length; ++rj) switch(record[rj].charAt(0)) {
  89597. case 'X': C = parseInt(record[rj].slice(1))-1; ++F_seen; break;
  89598. case 'Y':
  89599. R = parseInt(record[rj].slice(1))-1; /*C = 0;*/
  89600. for(j = arr.length; j <= R; ++j) arr[j] = [];
  89601. break;
  89602. case 'M': Mval = parseInt(record[rj].slice(1)) / 20; break;
  89603. case 'F': break; /* ??? */
  89604. case 'G': break; /* hide grid */
  89605. case 'P':
  89606. next_cell_format = formats[parseInt(record[rj].slice(1))];
  89607. break;
  89608. case 'S': break; /* cell style */
  89609. case 'D': break; /* column */
  89610. case 'N': break; /* font */
  89611. case 'W':
  89612. cw = record[rj].slice(1).split(" ");
  89613. for(j = parseInt(cw[0], 10); j <= parseInt(cw[1], 10); ++j) {
  89614. Mval = parseInt(cw[2], 10);
  89615. colinfo[j-1] = Mval === 0 ? {hidden:true}: {wch:Mval}; process_col(colinfo[j-1]);
  89616. } break;
  89617. case 'C': /* default column format */
  89618. C = parseInt(record[rj].slice(1))-1;
  89619. if(!colinfo[C]) colinfo[C] = {};
  89620. break;
  89621. case 'R': /* row properties */
  89622. R = parseInt(record[rj].slice(1))-1;
  89623. if(!rowinfo[R]) rowinfo[R] = {};
  89624. if(Mval > 0) { rowinfo[R].hpt = Mval; rowinfo[R].hpx = pt2px(Mval); }
  89625. else if(Mval === 0) rowinfo[R].hidden = true;
  89626. break;
  89627. default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
  89628. }
  89629. if(F_seen < 1) next_cell_format = null; break;
  89630. default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
  89631. }
  89632. }
  89633. if(rowinfo.length > 0) sht['!rows'] = rowinfo;
  89634. if(colinfo.length > 0) sht['!cols'] = colinfo;
  89635. if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
  89636. return [arr, sht];
  89637. }
  89638. function sylk_to_sheet(d, opts) {
  89639. var aoasht = sylk_to_aoa(d, opts);
  89640. var aoa = aoasht[0], ws = aoasht[1];
  89641. var o = aoa_to_sheet(aoa, opts);
  89642. keys(ws).forEach(function(k) { o[k] = ws[k]; });
  89643. return o;
  89644. }
  89645. function sylk_to_workbook(d, opts) { return sheet_to_workbook(sylk_to_sheet(d, opts), opts); }
  89646. function write_ws_cell_sylk(cell, ws, R, C) {
  89647. var o = "C;Y" + (R+1) + ";X" + (C+1) + ";K";
  89648. switch(cell.t) {
  89649. case 'n':
  89650. o += (cell.v||0);
  89651. if(cell.f && !cell.F) o += ";E" + a1_to_rc(cell.f, {r:R, c:C}); break;
  89652. case 'b': o += cell.v ? "TRUE" : "FALSE"; break;
  89653. case 'e': o += cell.w || cell.v; break;
  89654. case 'd': o += '"' + (cell.w || cell.v) + '"'; break;
  89655. case 's': o += '"' + cell.v.replace(/"/g,"") + '"'; break;
  89656. }
  89657. return o;
  89658. }
  89659. function write_ws_cols_sylk(out, cols) {
  89660. cols.forEach(function(col, i) {
  89661. var rec = "F;W" + (i+1) + " " + (i+1) + " ";
  89662. if(col.hidden) rec += "0";
  89663. else {
  89664. if(typeof col.width == 'number') col.wpx = width2px(col.width);
  89665. if(typeof col.wpx == 'number') col.wch = px2char(col.wpx);
  89666. if(typeof col.wch == 'number') rec += Math.round(col.wch);
  89667. }
  89668. if(rec.charAt(rec.length - 1) != " ") out.push(rec);
  89669. });
  89670. }
  89671. function write_ws_rows_sylk(out, rows) {
  89672. rows.forEach(function(row, i) {
  89673. var rec = "F;";
  89674. if(row.hidden) rec += "M0;";
  89675. else if(row.hpt) rec += "M" + 20 * row.hpt + ";";
  89676. else if(row.hpx) rec += "M" + 20 * px2pt(row.hpx) + ";";
  89677. if(rec.length > 2) out.push(rec + "R" + (i+1));
  89678. });
  89679. }
  89680. function sheet_to_sylk(ws, opts) {
  89681. var preamble = ["ID;PWXL;N;E"], o = [];
  89682. var r = safe_decode_range(ws['!ref']), cell;
  89683. var dense = Array.isArray(ws);
  89684. var RS = "\r\n";
  89685. preamble.push("P;PGeneral");
  89686. preamble.push("F;P0;DG0G8;M255");
  89687. if(ws['!cols']) write_ws_cols_sylk(preamble, ws['!cols']);
  89688. if(ws['!rows']) write_ws_rows_sylk(preamble, ws['!rows']);
  89689. preamble.push("B;Y" + (r.e.r - r.s.r + 1) + ";X" + (r.e.c - r.s.c + 1) + ";D" + [r.s.c,r.s.r,r.e.c,r.e.r].join(" "));
  89690. for(var R = r.s.r; R <= r.e.r; ++R) {
  89691. for(var C = r.s.c; C <= r.e.c; ++C) {
  89692. var coord = encode_cell({r:R,c:C});
  89693. cell = dense ? (ws[R]||[])[C]: ws[coord];
  89694. if(!cell || (cell.v == null && (!cell.f || cell.F))) continue;
  89695. o.push(write_ws_cell_sylk(cell, ws, R, C, opts));
  89696. }
  89697. }
  89698. return preamble.join(RS) + RS + o.join(RS) + RS + "E" + RS;
  89699. }
  89700. return {
  89701. to_workbook: sylk_to_workbook,
  89702. to_sheet: sylk_to_sheet,
  89703. from_sheet: sheet_to_sylk
  89704. };
  89705. })();
  89706. var DIF = (function() {
  89707. function dif_to_aoa(d, opts) {
  89708. switch(opts.type) {
  89709. case 'base64': return dif_to_aoa_str(Base64.decode(d), opts);
  89710. case 'binary': return dif_to_aoa_str(d, opts);
  89711. case 'buffer': return dif_to_aoa_str(d.toString('binary'), opts);
  89712. case 'array': return dif_to_aoa_str(cc2str(d), opts);
  89713. }
  89714. throw new Error("Unrecognized type " + opts.type);
  89715. }
  89716. function dif_to_aoa_str(str, opts) {
  89717. var records = str.split('\n'), R = -1, C = -1, ri = 0, arr = [];
  89718. for (; ri !== records.length; ++ri) {
  89719. if (records[ri].trim() === 'BOT') { arr[++R] = []; C = 0; continue; }
  89720. if (R < 0) continue;
  89721. var metadata = records[ri].trim().split(",");
  89722. var type = metadata[0], value = metadata[1];
  89723. ++ri;
  89724. var data = records[ri].trim();
  89725. switch (+type) {
  89726. case -1:
  89727. if (data === 'BOT') { arr[++R] = []; C = 0; continue; }
  89728. else if (data !== 'EOD') throw new Error("Unrecognized DIF special command " + data);
  89729. break;
  89730. case 0:
  89731. if(data === 'TRUE') arr[R][C] = true;
  89732. else if(data === 'FALSE') arr[R][C] = false;
  89733. else if(!isNaN(fuzzynum(value))) arr[R][C] = fuzzynum(value);
  89734. else if(!isNaN(fuzzydate(value).getDate())) arr[R][C] = parseDate(value);
  89735. else arr[R][C] = value;
  89736. ++C; break;
  89737. case 1:
  89738. data = data.slice(1,data.length-1);
  89739. arr[R][C++] = data !== '' ? data : null;
  89740. break;
  89741. }
  89742. if (data === 'EOD') break;
  89743. }
  89744. if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
  89745. return arr;
  89746. }
  89747. function dif_to_sheet(str, opts) { return aoa_to_sheet(dif_to_aoa(str, opts), opts); }
  89748. function dif_to_workbook(str, opts) { return sheet_to_workbook(dif_to_sheet(str, opts), opts); }
  89749. var sheet_to_dif = (function() {
  89750. var push_field = function pf(o, topic, v, n, s) {
  89751. o.push(topic);
  89752. o.push(v + "," + n);
  89753. o.push('"' + s.replace(/"/g,'""') + '"');
  89754. };
  89755. var push_value = function po(o, type, v, s) {
  89756. o.push(type + "," + v);
  89757. o.push(type == 1 ? '"' + s.replace(/"/g,'""') + '"' : s);
  89758. };
  89759. return function sheet_to_dif(ws) {
  89760. var o = [];
  89761. var r = safe_decode_range(ws['!ref']), cell;
  89762. var dense = Array.isArray(ws);
  89763. push_field(o, "TABLE", 0, 1, "sheetjs");
  89764. push_field(o, "VECTORS", 0, r.e.r - r.s.r + 1,"");
  89765. push_field(o, "TUPLES", 0, r.e.c - r.s.c + 1,"");
  89766. push_field(o, "DATA", 0, 0,"");
  89767. for(var R = r.s.r; R <= r.e.r; ++R) {
  89768. push_value(o, -1, 0, "BOT");
  89769. for(var C = r.s.c; C <= r.e.c; ++C) {
  89770. var coord = encode_cell({r:R,c:C});
  89771. cell = dense ? (ws[R]||[])[C] : ws[coord];
  89772. if(!cell) { push_value(o, 1, 0, ""); continue;}
  89773. switch(cell.t) {
  89774. case 'n':
  89775. var val = DIF_XL ? cell.w : cell.v;
  89776. if(!val && cell.v != null) val = cell.v;
  89777. if(val == null) {
  89778. if(DIF_XL && cell.f && !cell.F) push_value(o, 1, 0, "=" + cell.f);
  89779. else push_value(o, 1, 0, "");
  89780. }
  89781. else push_value(o, 0, val, "V");
  89782. break;
  89783. case 'b':
  89784. push_value(o, 0, cell.v ? 1 : 0, cell.v ? "TRUE" : "FALSE");
  89785. break;
  89786. case 's':
  89787. push_value(o, 1, 0, (!DIF_XL || isNaN(cell.v)) ? cell.v : '="' + cell.v + '"');
  89788. break;
  89789. case 'd':
  89790. if(!cell.w) cell.w = SSF.format(cell.z || SSF._table[14], datenum(parseDate(cell.v)));
  89791. if(DIF_XL) push_value(o, 0, cell.w, "V");
  89792. else push_value(o, 1, 0, cell.w);
  89793. break;
  89794. default: push_value(o, 1, 0, "");
  89795. }
  89796. }
  89797. }
  89798. push_value(o, -1, 0, "EOD");
  89799. var RS = "\r\n";
  89800. var oo = o.join(RS);
  89801. //while((oo.length & 0x7F) != 0) oo += "\0";
  89802. return oo;
  89803. };
  89804. })();
  89805. return {
  89806. to_workbook: dif_to_workbook,
  89807. to_sheet: dif_to_sheet,
  89808. from_sheet: sheet_to_dif
  89809. };
  89810. })();
  89811. var ETH = (function() {
  89812. function decode(s) { return s.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n"); }
  89813. function encode(s) { return s.replace(/\\/g, "\\b").replace(/:/g, "\\c").replace(/\n/g,"\\n"); }
  89814. function eth_to_aoa(str, opts) {
  89815. var records = str.split('\n'), R = -1, C = -1, ri = 0, arr = [];
  89816. for (; ri !== records.length; ++ri) {
  89817. var record = records[ri].trim().split(":");
  89818. if(record[0] !== 'cell') continue;
  89819. var addr = decode_cell(record[1]);
  89820. if(arr.length <= addr.r) for(R = arr.length; R <= addr.r; ++R) if(!arr[R]) arr[R] = [];
  89821. R = addr.r; C = addr.c;
  89822. switch(record[2]) {
  89823. case 't': arr[R][C] = decode(record[3]); break;
  89824. case 'v': arr[R][C] = +record[3]; break;
  89825. case 'vtf': var _f = record[record.length - 1];
  89826. /* falls through */
  89827. case 'vtc':
  89828. switch(record[3]) {
  89829. case 'nl': arr[R][C] = +record[4] ? true : false; break;
  89830. default: arr[R][C] = +record[4]; break;
  89831. }
  89832. if(record[2] == 'vtf') arr[R][C] = [arr[R][C], _f];
  89833. }
  89834. }
  89835. if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
  89836. return arr;
  89837. }
  89838. function eth_to_sheet(d, opts) { return aoa_to_sheet(eth_to_aoa(d, opts), opts); }
  89839. function eth_to_workbook(d, opts) { return sheet_to_workbook(eth_to_sheet(d, opts), opts); }
  89840. var header = [
  89841. "socialcalc:version:1.5",
  89842. "MIME-Version: 1.0",
  89843. "Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"
  89844. ].join("\n");
  89845. var sep = [
  89846. "--SocialCalcSpreadsheetControlSave",
  89847. "Content-type: text/plain; charset=UTF-8"
  89848. ].join("\n") + "\n";
  89849. /* TODO: the other parts */
  89850. var meta = [
  89851. "# SocialCalc Spreadsheet Control Save",
  89852. "part:sheet"
  89853. ].join("\n");
  89854. var end = "--SocialCalcSpreadsheetControlSave--";
  89855. function sheet_to_eth_data(ws) {
  89856. if(!ws || !ws['!ref']) return "";
  89857. var o = [], oo = [], cell, coord = "";
  89858. var r = decode_range(ws['!ref']);
  89859. var dense = Array.isArray(ws);
  89860. for(var R = r.s.r; R <= r.e.r; ++R) {
  89861. for(var C = r.s.c; C <= r.e.c; ++C) {
  89862. coord = encode_cell({r:R,c:C});
  89863. cell = dense ? (ws[R]||[])[C] : ws[coord];
  89864. if(!cell || cell.v == null || cell.t === 'z') continue;
  89865. oo = ["cell", coord, 't'];
  89866. switch(cell.t) {
  89867. case 's': case 'str': oo.push(encode(cell.v)); break;
  89868. case 'n':
  89869. if(!cell.f) { oo[2]='v'; oo[3]=cell.v; }
  89870. else { oo[2]='vtf'; oo[3]='n'; oo[4]=cell.v; oo[5]=encode(cell.f); }
  89871. break;
  89872. case 'b':
  89873. oo[2] = 'vt'+(cell.f?'f':'c'); oo[3]='nl'; oo[4]=cell.v?"1":"0";
  89874. oo[5] = encode(cell.f||(cell.v?'TRUE':'FALSE'));
  89875. break;
  89876. case 'd':
  89877. var t = datenum(parseDate(cell.v));
  89878. oo[2] = 'vtc'; oo[3] = 'nd'; oo[4] = ""+t;
  89879. oo[5] = cell.w || SSF.format(cell.z || SSF._table[14], t);
  89880. break;
  89881. case 'e': continue;
  89882. }
  89883. o.push(oo.join(":"));
  89884. }
  89885. }
  89886. o.push("sheet:c:" + (r.e.c-r.s.c+1) + ":r:" + (r.e.r-r.s.r+1) + ":tvf:1");
  89887. o.push("valueformat:1:text-wiki");
  89888. //o.push("copiedfrom:" + ws['!ref']); // clipboard only
  89889. return o.join("\n");
  89890. }
  89891. function sheet_to_eth(ws) {
  89892. return [header, sep, meta, sep, sheet_to_eth_data(ws), end].join("\n");
  89893. // return ["version:1.5", sheet_to_eth_data(ws)].join("\n"); // clipboard form
  89894. }
  89895. return {
  89896. to_workbook: eth_to_workbook,
  89897. to_sheet: eth_to_sheet,
  89898. from_sheet: sheet_to_eth
  89899. };
  89900. })();
  89901. var PRN = (function() {
  89902. function set_text_arr(data, arr, R, C, o) {
  89903. if(o.raw) arr[R][C] = data;
  89904. else if(data === 'TRUE') arr[R][C] = true;
  89905. else if(data === 'FALSE') arr[R][C] = false;
  89906. else if(data === ""){/* empty */}
  89907. else if(!isNaN(fuzzynum(data))) arr[R][C] = fuzzynum(data);
  89908. else if(!isNaN(fuzzydate(data).getDate())) arr[R][C] = parseDate(data);
  89909. else arr[R][C] = data;
  89910. }
  89911. function prn_to_aoa_str(f, opts) {
  89912. var o = opts || {};
  89913. var arr = ([]);
  89914. if(!f || f.length === 0) return arr;
  89915. var lines = f.split(/[\r\n]/);
  89916. var L = lines.length - 1;
  89917. while(L >= 0 && lines[L].length === 0) --L;
  89918. var start = 10, idx = 0;
  89919. var R = 0;
  89920. for(; R <= L; ++R) {
  89921. idx = lines[R].indexOf(" ");
  89922. if(idx == -1) idx = lines[R].length; else idx++;
  89923. start = Math.max(start, idx);
  89924. }
  89925. for(R = 0; R <= L; ++R) {
  89926. arr[R] = [];
  89927. /* TODO: confirm that widths are always 10 */
  89928. var C = 0;
  89929. set_text_arr(lines[R].slice(0, start).trim(), arr, R, C, o);
  89930. for(C = 1; C <= (lines[R].length - start)/10 + 1; ++C)
  89931. set_text_arr(lines[R].slice(start+(C-1)*10,start+C*10).trim(),arr,R,C,o);
  89932. }
  89933. if(o.sheetRows) arr = arr.slice(0, o.sheetRows);
  89934. return arr;
  89935. }
  89936. // List of accepted CSV separators
  89937. var guess_seps = {
  89938. 0x2C: ',',
  89939. 0x09: "\t",
  89940. 0x3B: ';'
  89941. };
  89942. // CSV separator weights to be used in case of equal numbers
  89943. var guess_sep_weights = {
  89944. 0x2C: 3,
  89945. 0x09: 2,
  89946. 0x3B: 1
  89947. };
  89948. function guess_sep(str) {
  89949. var cnt = {}, instr = false, end = 0, cc = 0;
  89950. for(;end < str.length;++end) {
  89951. if((cc=str.charCodeAt(end)) == 0x22) instr = !instr;
  89952. else if(!instr && cc in guess_seps) cnt[cc] = (cnt[cc]||0)+1;
  89953. }
  89954. cc = [];
  89955. for(end in cnt) if ( cnt.hasOwnProperty(end) ) {
  89956. cc.push([ cnt[end], end ]);
  89957. }
  89958. if ( !cc.length ) {
  89959. cnt = guess_sep_weights;
  89960. for(end in cnt) if ( cnt.hasOwnProperty(end) ) {
  89961. cc.push([ cnt[end], end ]);
  89962. }
  89963. }
  89964. cc.sort(function(a, b) { return a[0] - b[0] || guess_sep_weights[a[1]] - guess_sep_weights[b[1]]; });
  89965. return guess_seps[cc.pop()[1]];
  89966. }
  89967. function dsv_to_sheet_str(str, opts) {
  89968. var o = opts || {};
  89969. var sep = "";
  89970. if(DENSE != null && o.dense == null) o.dense = DENSE;
  89971. var ws = o.dense ? ([]) : ({});
  89972. var range = ({s: {c:0, r:0}, e: {c:0, r:0}});
  89973. if(str.slice(0,4) == "sep=" && str.charCodeAt(5) == 10) { sep = str.charAt(4); str = str.slice(6); }
  89974. else sep = guess_sep(str.slice(0,1024));
  89975. var R = 0, C = 0, v = 0;
  89976. var start = 0, end = 0, sepcc = sep.charCodeAt(0), instr = false, cc=0;
  89977. str = str.replace(/\r\n/mg, "\n");
  89978. var _re = o.dateNF != null ? dateNF_regex(o.dateNF) : null;
  89979. function finish_cell() {
  89980. var s = str.slice(start, end);
  89981. var cell = ({});
  89982. if(s.charAt(0) == '"' && s.charAt(s.length - 1) == '"') s = s.slice(1,-1).replace(/""/g,'"');
  89983. if(s.length === 0) cell.t = 'z';
  89984. else if(o.raw) { cell.t = 's'; cell.v = s; }
  89985. else if(s.trim().length === 0) { cell.t = 's'; cell.v = s; }
  89986. else if(s.charCodeAt(0) == 0x3D) {
  89987. if(s.charCodeAt(1) == 0x22 && s.charCodeAt(s.length - 1) == 0x22) { cell.t = 's'; cell.v = s.slice(2,-1).replace(/""/g,'"'); }
  89988. else if(fuzzyfmla(s)) { cell.t = 'n'; cell.f = s.slice(1); }
  89989. else { cell.t = 's'; cell.v = s; } }
  89990. else if(s == "TRUE") { cell.t = 'b'; cell.v = true; }
  89991. else if(s == "FALSE") { cell.t = 'b'; cell.v = false; }
  89992. else if(!isNaN(v = fuzzynum(s))) { cell.t = 'n'; if(o.cellText !== false) cell.w = s; cell.v = v; }
  89993. else if(!isNaN(fuzzydate(s).getDate()) || _re && s.match(_re)) {
  89994. cell.z = o.dateNF || SSF._table[14];
  89995. var k = 0;
  89996. if(_re && s.match(_re)){ s=dateNF_fix(s, o.dateNF, (s.match(_re)||[])); k=1; }
  89997. if(o.cellDates) { cell.t = 'd'; cell.v = parseDate(s, k); }
  89998. else { cell.t = 'n'; cell.v = datenum(parseDate(s, k)); }
  89999. if(o.cellText !== false) cell.w = SSF.format(cell.z, cell.v instanceof Date ? datenum(cell.v):cell.v);
  90000. if(!o.cellNF) delete cell.z;
  90001. } else {
  90002. cell.t = 's';
  90003. cell.v = s;
  90004. }
  90005. if(cell.t == 'z'){}
  90006. else if(o.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = cell; }
  90007. else ws[encode_cell({c:C,r:R})] = cell;
  90008. start = end+1;
  90009. if(range.e.c < C) range.e.c = C;
  90010. if(range.e.r < R) range.e.r = R;
  90011. if(cc == sepcc) ++C; else { C = 0; ++R; if(o.sheetRows && o.sheetRows <= R) return true; }
  90012. }
  90013. outer: for(;end < str.length;++end) switch((cc=str.charCodeAt(end))) {
  90014. case 0x22: instr = !instr; break;
  90015. case sepcc: case 0x0a: case 0x0d: if(!instr && finish_cell()) break outer; break;
  90016. default: break;
  90017. }
  90018. if(end - start > 0) finish_cell();
  90019. ws['!ref'] = encode_range(range);
  90020. return ws;
  90021. }
  90022. function prn_to_sheet_str(str, opts) {
  90023. if(str.slice(0,4) == "sep=") return dsv_to_sheet_str(str, opts);
  90024. if(str.indexOf("\t") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts);
  90025. return aoa_to_sheet(prn_to_aoa_str(str, opts), opts);
  90026. }
  90027. function prn_to_sheet(d, opts) {
  90028. var str = "", bytes = opts.type == 'string' ? [0,0,0,0] : firstbyte(d, opts);
  90029. switch(opts.type) {
  90030. case 'base64': str = Base64.decode(d); break;
  90031. case 'binary': str = d; break;
  90032. case 'buffer':
  90033. if(opts.codepage == 65001) str = d.toString('utf8');
  90034. else if(opts.codepage && typeof cptable !== 'undefined') str = cptable.utils.decode(opts.codepage, d);
  90035. else str = d.toString('binary');
  90036. break;
  90037. case 'array': str = cc2str(d); break;
  90038. case 'string': str = d; break;
  90039. default: throw new Error("Unrecognized type " + opts.type);
  90040. }
  90041. if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str.slice(3));
  90042. else if((opts.type == 'binary') && typeof cptable !== 'undefined' && opts.codepage) str = cptable.utils.decode(opts.codepage, cptable.utils.encode(1252,str));
  90043. if(str.slice(0,19) == "socialcalc:version:") return ETH.to_sheet(opts.type == 'string' ? str : utf8read(str), opts);
  90044. return prn_to_sheet_str(str, opts);
  90045. }
  90046. function prn_to_workbook(d, opts) { return sheet_to_workbook(prn_to_sheet(d, opts), opts); }
  90047. function sheet_to_prn(ws) {
  90048. var o = [];
  90049. var r = safe_decode_range(ws['!ref']), cell;
  90050. var dense = Array.isArray(ws);
  90051. for(var R = r.s.r; R <= r.e.r; ++R) {
  90052. var oo = [];
  90053. for(var C = r.s.c; C <= r.e.c; ++C) {
  90054. var coord = encode_cell({r:R,c:C});
  90055. cell = dense ? (ws[R]||[])[C] : ws[coord];
  90056. if(!cell || cell.v == null) { oo.push(" "); continue; }
  90057. var w = (cell.w || (format_cell(cell), cell.w) || "").slice(0,10);
  90058. while(w.length < 10) w += " ";
  90059. oo.push(w + (C === 0 ? " " : ""));
  90060. }
  90061. o.push(oo.join(""));
  90062. }
  90063. return o.join("\n");
  90064. }
  90065. return {
  90066. to_workbook: prn_to_workbook,
  90067. to_sheet: prn_to_sheet,
  90068. from_sheet: sheet_to_prn
  90069. };
  90070. })();
  90071. /* Excel defaults to SYLK but warns if data is not valid */
  90072. function read_wb_ID(d, opts) {
  90073. var o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true;
  90074. try {
  90075. var out = SYLK.to_workbook(d, o);
  90076. o.WTF = OLD_WTF;
  90077. return out;
  90078. } catch(e) {
  90079. o.WTF = OLD_WTF;
  90080. if(!e.message.match(/SYLK bad record ID/) && OLD_WTF) throw e;
  90081. return PRN.to_workbook(d, opts);
  90082. }
  90083. }
  90084. var WK_ = (function() {
  90085. function lotushopper(data, cb, opts) {
  90086. if(!data) return;
  90087. prep_blob(data, data.l || 0);
  90088. var Enum = opts.Enum || WK1Enum;
  90089. while(data.l < data.length) {
  90090. var RT = data.read_shift(2);
  90091. var R = Enum[RT] || Enum[0xFF];
  90092. var length = data.read_shift(2);
  90093. var tgt = data.l + length;
  90094. var d = (R.f||parsenoop)(data, length, opts);
  90095. data.l = tgt;
  90096. if(cb(d, R.n, RT)) return;
  90097. }
  90098. }
  90099. function lotus_to_workbook(d, opts) {
  90100. switch(opts.type) {
  90101. case 'base64': return lotus_to_workbook_buf(s2a(Base64.decode(d)), opts);
  90102. case 'binary': return lotus_to_workbook_buf(s2a(d), opts);
  90103. case 'buffer':
  90104. case 'array': return lotus_to_workbook_buf(d, opts);
  90105. }
  90106. throw "Unsupported type " + opts.type;
  90107. }
  90108. function lotus_to_workbook_buf(d, opts) {
  90109. if(!d) return d;
  90110. var o = opts || {};
  90111. if(DENSE != null && o.dense == null) o.dense = DENSE;
  90112. var s = ((o.dense ? [] : {})), n = "Sheet1", sidx = 0;
  90113. var sheets = {}, snames = [n];
  90114. var refguess = {s: {r:0, c:0}, e: {r:0, c:0} };
  90115. var sheetRows = o.sheetRows || 0;
  90116. if(d[2] == 0x02) o.Enum = WK1Enum;
  90117. else if(d[2] == 0x1a) o.Enum = WK3Enum;
  90118. else if(d[2] == 0x0e) { o.Enum = WK3Enum; o.qpro = true; d.l = 0; }
  90119. else throw new Error("Unrecognized LOTUS BOF " + d[2]);
  90120. lotushopper(d, function(val, Rn, RT) {
  90121. if(d[2] == 0x02) switch(RT) {
  90122. case 0x00:
  90123. o.vers = val;
  90124. if(val >= 0x1000) o.qpro = true;
  90125. break;
  90126. case 0x06: refguess = val; break; /* RANGE */
  90127. case 0x0F: /* LABEL */
  90128. if(!o.qpro) val[1].v = val[1].v.slice(1);
  90129. /* falls through */
  90130. case 0x0D: /* INTEGER */
  90131. case 0x0E: /* NUMBER */
  90132. case 0x10: /* FORMULA */
  90133. case 0x33: /* STRING */
  90134. /* TODO: actual translation of the format code */
  90135. if(RT == 0x0E && (val[2] & 0x70) == 0x70 && (val[2] & 0x0F) > 1 && (val[2] & 0x0F) < 15) {
  90136. val[1].z = o.dateNF || SSF._table[14];
  90137. if(o.cellDates) { val[1].t = 'd'; val[1].v = numdate(val[1].v); }
  90138. }
  90139. if(o.dense) {
  90140. if(!s[val[0].r]) s[val[0].r] = [];
  90141. s[val[0].r][val[0].c] = val[1];
  90142. } else s[encode_cell(val[0])] = val[1];
  90143. break;
  90144. } else switch(RT) {
  90145. case 0x16: /* LABEL16 */
  90146. val[1].v = val[1].v.slice(1);
  90147. /* falls through */
  90148. case 0x17: /* NUMBER17 */
  90149. case 0x18: /* NUMBER18 */
  90150. case 0x19: /* FORMULA19 */
  90151. case 0x25: /* NUMBER25 */
  90152. case 0x27: /* NUMBER27 */
  90153. case 0x28: /* FORMULA28 */
  90154. if(val[3] > sidx) {
  90155. s["!ref"] = encode_range(refguess);
  90156. sheets[n] = s;
  90157. s = (o.dense ? [] : {});
  90158. refguess = {s: {r:0, c:0}, e: {r:0, c:0} };
  90159. sidx = val[3]; n = "Sheet" + (sidx + 1);
  90160. snames.push(n);
  90161. }
  90162. if(sheetRows > 0 && val[0].r >= sheetRows) break;
  90163. if(o.dense) {
  90164. if(!s[val[0].r]) s[val[0].r] = [];
  90165. s[val[0].r][val[0].c] = val[1];
  90166. } else s[encode_cell(val[0])] = val[1];
  90167. if(refguess.e.c < val[0].c) refguess.e.c = val[0].c;
  90168. if(refguess.e.r < val[0].r) refguess.e.r = val[0].r;
  90169. break;
  90170. default: break;
  90171. }
  90172. }, o);
  90173. s["!ref"] = encode_range(refguess);
  90174. sheets[n] = s;
  90175. return { SheetNames: snames, Sheets:sheets };
  90176. }
  90177. function parse_RANGE(blob) {
  90178. var o = {s:{c:0,r:0},e:{c:0,r:0}};
  90179. o.s.c = blob.read_shift(2);
  90180. o.s.r = blob.read_shift(2);
  90181. o.e.c = blob.read_shift(2);
  90182. o.e.r = blob.read_shift(2);
  90183. if(o.s.c == 0xFFFF) o.s.c = o.e.c = o.s.r = o.e.r = 0;
  90184. return o;
  90185. }
  90186. function parse_cell(blob, length, opts) {
  90187. var o = [{c:0,r:0}, {t:'n',v:0}, 0];
  90188. if(opts.qpro && opts.vers != 0x5120) {
  90189. o[0].c = blob.read_shift(1);
  90190. blob.l++;
  90191. o[0].r = blob.read_shift(2);
  90192. blob.l+=2;
  90193. } else {
  90194. o[2] = blob.read_shift(1);
  90195. o[0].c = blob.read_shift(2); o[0].r = blob.read_shift(2);
  90196. }
  90197. return o;
  90198. }
  90199. function parse_LABEL(blob, length, opts) {
  90200. var tgt = blob.l + length;
  90201. var o = parse_cell(blob, length, opts);
  90202. o[1].t = 's';
  90203. if(opts.vers == 0x5120) {
  90204. blob.l++;
  90205. var len = blob.read_shift(1);
  90206. o[1].v = blob.read_shift(len, 'utf8');
  90207. return o;
  90208. }
  90209. if(opts.qpro) blob.l++;
  90210. o[1].v = blob.read_shift(tgt - blob.l, 'cstr');
  90211. return o;
  90212. }
  90213. function parse_INTEGER(blob, length, opts) {
  90214. var o = parse_cell(blob, length, opts);
  90215. o[1].v = blob.read_shift(2, 'i');
  90216. return o;
  90217. }
  90218. function parse_NUMBER(blob, length, opts) {
  90219. var o = parse_cell(blob, length, opts);
  90220. o[1].v = blob.read_shift(8, 'f');
  90221. return o;
  90222. }
  90223. function parse_FORMULA(blob, length, opts) {
  90224. var tgt = blob.l + length;
  90225. var o = parse_cell(blob, length, opts);
  90226. /* TODO: formula */
  90227. o[1].v = blob.read_shift(8, 'f');
  90228. if(opts.qpro) blob.l = tgt;
  90229. else {
  90230. var flen = blob.read_shift(2);
  90231. blob.l += flen;
  90232. }
  90233. return o;
  90234. }
  90235. function parse_cell_3(blob) {
  90236. var o = [{c:0,r:0}, {t:'n',v:0}, 0];
  90237. o[0].r = blob.read_shift(2); o[3] = blob[blob.l++]; o[0].c = blob[blob.l++];
  90238. return o;
  90239. }
  90240. function parse_LABEL_16(blob, length) {
  90241. var o = parse_cell_3(blob, length);
  90242. o[1].t = 's';
  90243. o[1].v = blob.read_shift(length - 4, 'cstr');
  90244. return o;
  90245. }
  90246. function parse_NUMBER_18(blob, length) {
  90247. var o = parse_cell_3(blob, length);
  90248. o[1].v = blob.read_shift(2);
  90249. var v = o[1].v >> 1;
  90250. /* TODO: figure out all of the corner cases */
  90251. if(o[1].v & 0x1) {
  90252. switch(v & 0x07) {
  90253. case 1: v = (v >> 3) * 500; break;
  90254. case 2: v = (v >> 3) / 20; break;
  90255. case 4: v = (v >> 3) / 2000; break;
  90256. case 6: v = (v >> 3) / 16; break;
  90257. case 7: v = (v >> 3) / 64; break;
  90258. default: throw "unknown NUMBER_18 encoding " + (v & 0x07);
  90259. }
  90260. }
  90261. o[1].v = v;
  90262. return o;
  90263. }
  90264. function parse_NUMBER_17(blob, length) {
  90265. var o = parse_cell_3(blob, length);
  90266. var v1 = blob.read_shift(4);
  90267. var v2 = blob.read_shift(4);
  90268. var e = blob.read_shift(2);
  90269. if(e == 0xFFFF) { o[1].v = 0; return o; }
  90270. var s = e & 0x8000; e = (e&0x7FFF) - 16446;
  90271. o[1].v = (s*2 - 1) * ((e > 0 ? (v2 << e) : (v2 >>> -e)) + (e > -32 ? (v1 << (e + 32)) : (v1 >>> -(e + 32))));
  90272. return o;
  90273. }
  90274. function parse_FORMULA_19(blob, length) {
  90275. var o = parse_NUMBER_17(blob, 14);
  90276. blob.l += length - 14; /* TODO: formula */
  90277. return o;
  90278. }
  90279. function parse_NUMBER_25(blob, length) {
  90280. var o = parse_cell_3(blob, length);
  90281. var v1 = blob.read_shift(4);
  90282. o[1].v = v1 >> 6;
  90283. return o;
  90284. }
  90285. function parse_NUMBER_27(blob, length) {
  90286. var o = parse_cell_3(blob, length);
  90287. var v1 = blob.read_shift(8,'f');
  90288. o[1].v = v1;
  90289. return o;
  90290. }
  90291. function parse_FORMULA_28(blob, length) {
  90292. var o = parse_NUMBER_27(blob, 14);
  90293. blob.l += length - 10; /* TODO: formula */
  90294. return o;
  90295. }
  90296. var WK1Enum = {
  90297. 0x0000: { n:"BOF", f:parseuint16 },
  90298. 0x0001: { n:"EOF" },
  90299. 0x0002: { n:"CALCMODE" },
  90300. 0x0003: { n:"CALCORDER" },
  90301. 0x0004: { n:"SPLIT" },
  90302. 0x0005: { n:"SYNC" },
  90303. 0x0006: { n:"RANGE", f:parse_RANGE },
  90304. 0x0007: { n:"WINDOW1" },
  90305. 0x0008: { n:"COLW1" },
  90306. 0x0009: { n:"WINTWO" },
  90307. 0x000A: { n:"COLW2" },
  90308. 0x000B: { n:"NAME" },
  90309. 0x000C: { n:"BLANK" },
  90310. 0x000D: { n:"INTEGER", f:parse_INTEGER },
  90311. 0x000E: { n:"NUMBER", f:parse_NUMBER },
  90312. 0x000F: { n:"LABEL", f:parse_LABEL },
  90313. 0x0010: { n:"FORMULA", f:parse_FORMULA },
  90314. 0x0018: { n:"TABLE" },
  90315. 0x0019: { n:"ORANGE" },
  90316. 0x001A: { n:"PRANGE" },
  90317. 0x001B: { n:"SRANGE" },
  90318. 0x001C: { n:"FRANGE" },
  90319. 0x001D: { n:"KRANGE1" },
  90320. 0x0020: { n:"HRANGE" },
  90321. 0x0023: { n:"KRANGE2" },
  90322. 0x0024: { n:"PROTEC" },
  90323. 0x0025: { n:"FOOTER" },
  90324. 0x0026: { n:"HEADER" },
  90325. 0x0027: { n:"SETUP" },
  90326. 0x0028: { n:"MARGINS" },
  90327. 0x0029: { n:"LABELFMT" },
  90328. 0x002A: { n:"TITLES" },
  90329. 0x002B: { n:"SHEETJS" },
  90330. 0x002D: { n:"GRAPH" },
  90331. 0x002E: { n:"NGRAPH" },
  90332. 0x002F: { n:"CALCCOUNT" },
  90333. 0x0030: { n:"UNFORMATTED" },
  90334. 0x0031: { n:"CURSORW12" },
  90335. 0x0032: { n:"WINDOW" },
  90336. 0x0033: { n:"STRING", f:parse_LABEL },
  90337. 0x0037: { n:"PASSWORD" },
  90338. 0x0038: { n:"LOCKED" },
  90339. 0x003C: { n:"QUERY" },
  90340. 0x003D: { n:"QUERYNAME" },
  90341. 0x003E: { n:"PRINT" },
  90342. 0x003F: { n:"PRINTNAME" },
  90343. 0x0040: { n:"GRAPH2" },
  90344. 0x0041: { n:"GRAPHNAME" },
  90345. 0x0042: { n:"ZOOM" },
  90346. 0x0043: { n:"SYMSPLIT" },
  90347. 0x0044: { n:"NSROWS" },
  90348. 0x0045: { n:"NSCOLS" },
  90349. 0x0046: { n:"RULER" },
  90350. 0x0047: { n:"NNAME" },
  90351. 0x0048: { n:"ACOMM" },
  90352. 0x0049: { n:"AMACRO" },
  90353. 0x004A: { n:"PARSE" },
  90354. 0x00FF: { n:"", f:parsenoop }
  90355. };
  90356. var WK3Enum = {
  90357. 0x0000: { n:"BOF" },
  90358. 0x0001: { n:"EOF" },
  90359. 0x0003: { n:"??" },
  90360. 0x0004: { n:"??" },
  90361. 0x0005: { n:"??" },
  90362. 0x0006: { n:"??" },
  90363. 0x0007: { n:"??" },
  90364. 0x0009: { n:"??" },
  90365. 0x000a: { n:"??" },
  90366. 0x000b: { n:"??" },
  90367. 0x000c: { n:"??" },
  90368. 0x000e: { n:"??" },
  90369. 0x000f: { n:"??" },
  90370. 0x0010: { n:"??" },
  90371. 0x0011: { n:"??" },
  90372. 0x0012: { n:"??" },
  90373. 0x0013: { n:"??" },
  90374. 0x0015: { n:"??" },
  90375. 0x0016: { n:"LABEL16", f:parse_LABEL_16},
  90376. 0x0017: { n:"NUMBER17", f:parse_NUMBER_17 },
  90377. 0x0018: { n:"NUMBER18", f:parse_NUMBER_18 },
  90378. 0x0019: { n:"FORMULA19", f:parse_FORMULA_19},
  90379. 0x001a: { n:"??" },
  90380. 0x001b: { n:"??" },
  90381. 0x001c: { n:"??" },
  90382. 0x001d: { n:"??" },
  90383. 0x001e: { n:"??" },
  90384. 0x001f: { n:"??" },
  90385. 0x0021: { n:"??" },
  90386. 0x0025: { n:"NUMBER25", f:parse_NUMBER_25 },
  90387. 0x0027: { n:"NUMBER27", f:parse_NUMBER_27 },
  90388. 0x0028: { n:"FORMULA28", f:parse_FORMULA_28 },
  90389. 0x00FF: { n:"", f:parsenoop }
  90390. };
  90391. return {
  90392. to_workbook: lotus_to_workbook
  90393. };
  90394. })();
  90395. /* 18.4.7 rPr CT_RPrElt */
  90396. function parse_rpr(rpr) {
  90397. var font = {}, m = rpr.match(tagregex), i = 0;
  90398. var pass = false;
  90399. if(m) for(;i!=m.length; ++i) {
  90400. var y = parsexmltag(m[i]);
  90401. switch(y[0].replace(/\w*:/g,"")) {
  90402. /* 18.8.12 condense CT_BooleanProperty */
  90403. /* ** not required . */
  90404. case '<condense': break;
  90405. /* 18.8.17 extend CT_BooleanProperty */
  90406. /* ** not required . */
  90407. case '<extend': break;
  90408. /* 18.8.36 shadow CT_BooleanProperty */
  90409. /* ** not required . */
  90410. case '<shadow':
  90411. if(!y.val) break;
  90412. /* falls through */
  90413. case '<shadow>':
  90414. case '<shadow/>': font.shadow = 1; break;
  90415. case '</shadow>': break;
  90416. /* 18.4.1 charset CT_IntProperty TODO */
  90417. case '<charset':
  90418. if(y.val == '1') break;
  90419. font.cp = CS2CP[parseInt(y.val, 10)];
  90420. break;
  90421. /* 18.4.2 outline CT_BooleanProperty TODO */
  90422. case '<outline':
  90423. if(!y.val) break;
  90424. /* falls through */
  90425. case '<outline>':
  90426. case '<outline/>': font.outline = 1; break;
  90427. case '</outline>': break;
  90428. /* 18.4.5 rFont CT_FontName */
  90429. case '<rFont': font.name = y.val; break;
  90430. /* 18.4.11 sz CT_FontSize */
  90431. case '<sz': font.sz = y.val; break;
  90432. /* 18.4.10 strike CT_BooleanProperty */
  90433. case '<strike':
  90434. if(!y.val) break;
  90435. /* falls through */
  90436. case '<strike>':
  90437. case '<strike/>': font.strike = 1; break;
  90438. case '</strike>': break;
  90439. /* 18.4.13 u CT_UnderlineProperty */
  90440. case '<u':
  90441. if(!y.val) break;
  90442. switch(y.val) {
  90443. case 'double': font.uval = "double"; break;
  90444. case 'singleAccounting': font.uval = "single-accounting"; break;
  90445. case 'doubleAccounting': font.uval = "double-accounting"; break;
  90446. }
  90447. /* falls through */
  90448. case '<u>':
  90449. case '<u/>': font.u = 1; break;
  90450. case '</u>': break;
  90451. /* 18.8.2 b */
  90452. case '<b':
  90453. if(y.val == '0') break;
  90454. /* falls through */
  90455. case '<b>':
  90456. case '<b/>': font.b = 1; break;
  90457. case '</b>': break;
  90458. /* 18.8.26 i */
  90459. case '<i':
  90460. if(y.val == '0') break;
  90461. /* falls through */
  90462. case '<i>':
  90463. case '<i/>': font.i = 1; break;
  90464. case '</i>': break;
  90465. /* 18.3.1.15 color CT_Color TODO: tint, theme, auto, indexed */
  90466. case '<color':
  90467. if(y.rgb) font.color = y.rgb.slice(2,8);
  90468. break;
  90469. /* 18.8.18 family ST_FontFamily */
  90470. case '<family': font.family = y.val; break;
  90471. /* 18.4.14 vertAlign CT_VerticalAlignFontProperty TODO */
  90472. case '<vertAlign': font.valign = y.val; break;
  90473. /* 18.8.35 scheme CT_FontScheme TODO */
  90474. case '<scheme': break;
  90475. /* 18.2.10 extLst CT_ExtensionList ? */
  90476. case '<extLst': case '<extLst>': case '</extLst>': break;
  90477. case '<ext': pass = true; break;
  90478. case '</ext>': pass = false; break;
  90479. default:
  90480. if(y[0].charCodeAt(1) !== 47 && !pass) throw new Error('Unrecognized rich format ' + y[0]);
  90481. }
  90482. }
  90483. return font;
  90484. }
  90485. var parse_rs = (function() {
  90486. var tregex = matchtag("t"), rpregex = matchtag("rPr");
  90487. /* 18.4.4 r CT_RElt */
  90488. function parse_r(r) {
  90489. /* 18.4.12 t ST_Xstring */
  90490. var t = r.match(tregex)/*, cp = 65001*/;
  90491. if(!t) return {t:"s", v:""};
  90492. var o = ({t:'s', v:unescapexml(t[1])});
  90493. var rpr = r.match(rpregex);
  90494. if(rpr) o.s = parse_rpr(rpr[1]);
  90495. return o;
  90496. }
  90497. var rregex = /<(?:\w+:)?r>/g, rend = /<\/(?:\w+:)?r>/;
  90498. return function parse_rs(rs) {
  90499. return rs.replace(rregex,"").split(rend).map(parse_r).filter(function(r) { return r.v; });
  90500. };
  90501. })();
  90502. /* Parse a list of <r> tags */
  90503. var rs_to_html = (function parse_rs_factory() {
  90504. var nlregex = /(\r\n|\n)/g;
  90505. function parse_rpr2(font, intro, outro) {
  90506. var style = [];
  90507. if(font.u) style.push("text-decoration: underline;");
  90508. if(font.uval) style.push("text-underline-style:" + font.uval + ";");
  90509. if(font.sz) style.push("font-size:" + font.sz + "pt;");
  90510. if(font.outline) style.push("text-effect: outline;");
  90511. if(font.shadow) style.push("text-shadow: auto;");
  90512. intro.push('<span style="' + style.join("") + '">');
  90513. if(font.b) { intro.push("<b>"); outro.push("</b>"); }
  90514. if(font.i) { intro.push("<i>"); outro.push("</i>"); }
  90515. if(font.strike) { intro.push("<s>"); outro.push("</s>"); }
  90516. var align = font.valign || "";
  90517. if(align == "superscript" || align == "super") align = "sup";
  90518. else if(align == "subscript") align = "sub";
  90519. if(align != "") { intro.push("<" + align + ">"); outro.push("</" + align + ">"); }
  90520. outro.push("</span>");
  90521. return font;
  90522. }
  90523. /* 18.4.4 r CT_RElt */
  90524. function r_to_html(r) {
  90525. var terms = [[],r.v,[]];
  90526. if(!r.v) return "";
  90527. if(r.s) parse_rpr2(r.s, terms[0], terms[2]);
  90528. return terms[0].join("") + terms[1].replace(nlregex,'<br/>') + terms[2].join("");
  90529. }
  90530. return function parse_rs(rs) {
  90531. return rs.map(r_to_html).join("");
  90532. };
  90533. })();
  90534. /* 18.4.8 si CT_Rst */
  90535. var sitregex = /<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g, sirregex = /<(?:\w+:)?r>/;
  90536. var sirphregex = /<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;
  90537. function parse_si(x, opts) {
  90538. var html = opts ? opts.cellHTML : true;
  90539. var z = {};
  90540. if(!x) return null;
  90541. //var y;
  90542. /* 18.4.12 t ST_Xstring (Plaintext String) */
  90543. // TODO: is whitespace actually valid here?
  90544. if(x.match(/^\s*<(?:\w+:)?t[^>]*>/)) {
  90545. z.t = unescapexml(utf8read(x.slice(x.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""));
  90546. z.r = utf8read(x);
  90547. if(html) z.h = escapehtml(z.t);
  90548. }
  90549. /* 18.4.4 r CT_RElt (Rich Text Run) */
  90550. else if((/*y = */x.match(sirregex))) {
  90551. z.r = utf8read(x);
  90552. z.t = unescapexml(utf8read((x.replace(sirphregex, '').match(sitregex)||[]).join("").replace(tagregex,"")));
  90553. if(html) z.h = rs_to_html(parse_rs(z.r));
  90554. }
  90555. /* 18.4.3 phoneticPr CT_PhoneticPr (TODO: needed for Asian support) */
  90556. /* 18.4.6 rPh CT_PhoneticRun (TODO: needed for Asian support) */
  90557. return z;
  90558. }
  90559. /* 18.4 Shared String Table */
  90560. var sstr0 = /<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/;
  90561. var sstr1 = /<(?:\w+:)?(?:si|sstItem)>/g;
  90562. var sstr2 = /<\/(?:\w+:)?(?:si|sstItem)>/;
  90563. function parse_sst_xml(data, opts) {
  90564. var s = ([]), ss = "";
  90565. if(!data) return s;
  90566. /* 18.4.9 sst CT_Sst */
  90567. var sst = data.match(sstr0);
  90568. if(sst) {
  90569. ss = sst[2].replace(sstr1,"").split(sstr2);
  90570. for(var i = 0; i != ss.length; ++i) {
  90571. var o = parse_si(ss[i].trim(), opts);
  90572. if(o != null) s[s.length] = o;
  90573. }
  90574. sst = parsexmltag(sst[1]); s.Count = sst.count; s.Unique = sst.uniqueCount;
  90575. }
  90576. return s;
  90577. }
  90578. RELS.SST = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";
  90579. var straywsregex = /^\s|\s$|[\t\n\r]/;
  90580. function write_sst_xml(sst, opts) {
  90581. if(!opts.bookSST) return "";
  90582. var o = [XML_HEADER];
  90583. o[o.length] = (writextag('sst', null, {
  90584. xmlns: XMLNS.main[0],
  90585. count: sst.Count,
  90586. uniqueCount: sst.Unique
  90587. }));
  90588. for(var i = 0; i != sst.length; ++i) { if(sst[i] == null) continue;
  90589. var s = sst[i];
  90590. var sitag = "<si>";
  90591. if(s.r) sitag += s.r;
  90592. else {
  90593. sitag += "<t";
  90594. if(!s.t) s.t = "";
  90595. if(s.t.match(straywsregex)) sitag += ' xml:space="preserve"';
  90596. sitag += ">" + escapexml(s.t) + "</t>";
  90597. }
  90598. sitag += "</si>";
  90599. o[o.length] = (sitag);
  90600. }
  90601. if(o.length>2){ o[o.length] = ('</sst>'); o[1]=o[1].replace("/>",">"); }
  90602. return o.join("");
  90603. }
  90604. /* [MS-XLSB] 2.4.221 BrtBeginSst */
  90605. function parse_BrtBeginSst(data) {
  90606. return [data.read_shift(4), data.read_shift(4)];
  90607. }
  90608. /* [MS-XLSB] 2.1.7.45 Shared Strings */
  90609. function parse_sst_bin(data, opts) {
  90610. var s = ([]);
  90611. var pass = false;
  90612. recordhopper(data, function hopper_sst(val, R_n, RT) {
  90613. switch(RT) {
  90614. case 0x009F: /* 'BrtBeginSst' */
  90615. s.Count = val[0]; s.Unique = val[1]; break;
  90616. case 0x0013: /* 'BrtSSTItem' */
  90617. s.push(val); break;
  90618. case 0x00A0: /* 'BrtEndSst' */
  90619. return true;
  90620. case 0x0023: /* 'BrtFRTBegin' */
  90621. pass = true; break;
  90622. case 0x0024: /* 'BrtFRTEnd' */
  90623. pass = false; break;
  90624. default:
  90625. if(R_n.indexOf("Begin") > 0){/* empty */}
  90626. else if(R_n.indexOf("End") > 0){/* empty */}
  90627. if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
  90628. }
  90629. });
  90630. return s;
  90631. }
  90632. function write_BrtBeginSst(sst, o) {
  90633. if(!o) o = new_buf(8);
  90634. o.write_shift(4, sst.Count);
  90635. o.write_shift(4, sst.Unique);
  90636. return o;
  90637. }
  90638. var write_BrtSSTItem = write_RichStr;
  90639. function write_sst_bin(sst) {
  90640. var ba = buf_array();
  90641. write_record(ba, "BrtBeginSst", write_BrtBeginSst(sst));
  90642. for(var i = 0; i < sst.length; ++i) write_record(ba, "BrtSSTItem", write_BrtSSTItem(sst[i]));
  90643. /* FRTSST */
  90644. write_record(ba, "BrtEndSst");
  90645. return ba.end();
  90646. }
  90647. function _JS2ANSI(str) {
  90648. if(typeof cptable !== 'undefined') return cptable.utils.encode(current_ansi, str);
  90649. var o = [], oo = str.split("");
  90650. for(var i = 0; i < oo.length; ++i) o[i] = oo[i].charCodeAt(0);
  90651. return o;
  90652. }
  90653. /* [MS-OFFCRYPTO] 2.1.4 Version */
  90654. function parse_CRYPTOVersion(blob, length) {
  90655. var o = {};
  90656. o.Major = blob.read_shift(2);
  90657. o.Minor = blob.read_shift(2);
  90658. if(length >= 4) blob.l += length - 4;
  90659. return o;
  90660. }
  90661. /* [MS-OFFCRYPTO] 2.1.5 DataSpaceVersionInfo */
  90662. function parse_DataSpaceVersionInfo(blob) {
  90663. var o = {};
  90664. o.id = blob.read_shift(0, 'lpp4');
  90665. o.R = parse_CRYPTOVersion(blob, 4);
  90666. o.U = parse_CRYPTOVersion(blob, 4);
  90667. o.W = parse_CRYPTOVersion(blob, 4);
  90668. return o;
  90669. }
  90670. /* [MS-OFFCRYPTO] 2.1.6.1 DataSpaceMapEntry Structure */
  90671. function parse_DataSpaceMapEntry(blob) {
  90672. var len = blob.read_shift(4);
  90673. var end = blob.l + len - 4;
  90674. var o = {};
  90675. var cnt = blob.read_shift(4);
  90676. var comps = [];
  90677. /* [MS-OFFCRYPTO] 2.1.6.2 DataSpaceReferenceComponent Structure */
  90678. while(cnt-- > 0) comps.push({ t: blob.read_shift(4), v: blob.read_shift(0, 'lpp4') });
  90679. o.name = blob.read_shift(0, 'lpp4');
  90680. o.comps = comps;
  90681. if(blob.l != end) throw new Error("Bad DataSpaceMapEntry: " + blob.l + " != " + end);
  90682. return o;
  90683. }
  90684. /* [MS-OFFCRYPTO] 2.1.6 DataSpaceMap */
  90685. function parse_DataSpaceMap(blob) {
  90686. var o = [];
  90687. blob.l += 4; // must be 0x8
  90688. var cnt = blob.read_shift(4);
  90689. while(cnt-- > 0) o.push(parse_DataSpaceMapEntry(blob));
  90690. return o;
  90691. }
  90692. /* [MS-OFFCRYPTO] 2.1.7 DataSpaceDefinition */
  90693. function parse_DataSpaceDefinition(blob) {
  90694. var o = [];
  90695. blob.l += 4; // must be 0x8
  90696. var cnt = blob.read_shift(4);
  90697. while(cnt-- > 0) o.push(blob.read_shift(0, 'lpp4'));
  90698. return o;
  90699. }
  90700. /* [MS-OFFCRYPTO] 2.1.8 DataSpaceDefinition */
  90701. function parse_TransformInfoHeader(blob) {
  90702. var o = {};
  90703. /*var len = */blob.read_shift(4);
  90704. blob.l += 4; // must be 0x1
  90705. o.id = blob.read_shift(0, 'lpp4');
  90706. o.name = blob.read_shift(0, 'lpp4');
  90707. o.R = parse_CRYPTOVersion(blob, 4);
  90708. o.U = parse_CRYPTOVersion(blob, 4);
  90709. o.W = parse_CRYPTOVersion(blob, 4);
  90710. return o;
  90711. }
  90712. function parse_Primary(blob) {
  90713. /* [MS-OFFCRYPTO] 2.2.6 IRMDSTransformInfo */
  90714. var hdr = parse_TransformInfoHeader(blob);
  90715. /* [MS-OFFCRYPTO] 2.1.9 EncryptionTransformInfo */
  90716. hdr.ename = blob.read_shift(0, '8lpp4');
  90717. hdr.blksz = blob.read_shift(4);
  90718. hdr.cmode = blob.read_shift(4);
  90719. if(blob.read_shift(4) != 0x04) throw new Error("Bad !Primary record");
  90720. return hdr;
  90721. }
  90722. /* [MS-OFFCRYPTO] 2.3.2 Encryption Header */
  90723. function parse_EncryptionHeader(blob, length) {
  90724. var tgt = blob.l + length;
  90725. var o = {};
  90726. o.Flags = (blob.read_shift(4) & 0x3F);
  90727. blob.l += 4;
  90728. o.AlgID = blob.read_shift(4);
  90729. var valid = false;
  90730. switch(o.AlgID) {
  90731. case 0x660E: case 0x660F: case 0x6610: valid = (o.Flags == 0x24); break;
  90732. case 0x6801: valid = (o.Flags == 0x04); break;
  90733. case 0: valid = (o.Flags == 0x10 || o.Flags == 0x04 || o.Flags == 0x24); break;
  90734. default: throw 'Unrecognized encryption algorithm: ' + o.AlgID;
  90735. }
  90736. if(!valid) throw new Error("Encryption Flags/AlgID mismatch");
  90737. o.AlgIDHash = blob.read_shift(4);
  90738. o.KeySize = blob.read_shift(4);
  90739. o.ProviderType = blob.read_shift(4);
  90740. blob.l += 8;
  90741. o.CSPName = blob.read_shift((tgt-blob.l)>>1, 'utf16le');
  90742. blob.l = tgt;
  90743. return o;
  90744. }
  90745. /* [MS-OFFCRYPTO] 2.3.3 Encryption Verifier */
  90746. function parse_EncryptionVerifier(blob, length) {
  90747. var o = {}, tgt = blob.l + length;
  90748. blob.l += 4; // SaltSize must be 0x10
  90749. o.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16;
  90750. o.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16;
  90751. /*var sz = */blob.read_shift(4);
  90752. o.VerifierHash = blob.slice(blob.l, tgt); blob.l = tgt;
  90753. return o;
  90754. }
  90755. /* [MS-OFFCRYPTO] 2.3.4.* EncryptionInfo Stream */
  90756. function parse_EncryptionInfo(blob) {
  90757. var vers = parse_CRYPTOVersion(blob);
  90758. switch(vers.Minor) {
  90759. case 0x02: return [vers.Minor, parse_EncInfoStd(blob, vers)];
  90760. case 0x03: return [vers.Minor, parse_EncInfoExt(blob, vers)];
  90761. case 0x04: return [vers.Minor, parse_EncInfoAgl(blob, vers)];
  90762. }
  90763. throw new Error("ECMA-376 Encrypted file unrecognized Version: " + vers.Minor);
  90764. }
  90765. /* [MS-OFFCRYPTO] 2.3.4.5 EncryptionInfo Stream (Standard Encryption) */
  90766. function parse_EncInfoStd(blob) {
  90767. var flags = blob.read_shift(4);
  90768. if((flags & 0x3F) != 0x24) throw new Error("EncryptionInfo mismatch");
  90769. var sz = blob.read_shift(4);
  90770. //var tgt = blob.l + sz;
  90771. var hdr = parse_EncryptionHeader(blob, sz);
  90772. var verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);
  90773. return { t:"Std", h:hdr, v:verifier };
  90774. }
  90775. /* [MS-OFFCRYPTO] 2.3.4.6 EncryptionInfo Stream (Extensible Encryption) */
  90776. function parse_EncInfoExt() { throw new Error("File is password-protected: ECMA-376 Extensible"); }
  90777. /* [MS-OFFCRYPTO] 2.3.4.10 EncryptionInfo Stream (Agile Encryption) */
  90778. function parse_EncInfoAgl(blob) {
  90779. var KeyData = ["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];
  90780. blob.l+=4;
  90781. var xml = blob.read_shift(blob.length - blob.l, 'utf8');
  90782. var o = {};
  90783. xml.replace(tagregex, function xml_agile(x) {
  90784. var y = parsexmltag(x);
  90785. switch(strip_ns(y[0])) {
  90786. case '<?xml': break;
  90787. case '<encryption': case '</encryption>': break;
  90788. case '<keyData': KeyData.forEach(function(k) { o[k] = y[k]; }); break;
  90789. case '<dataIntegrity': o.encryptedHmacKey = y.encryptedHmacKey; o.encryptedHmacValue = y.encryptedHmacValue; break;
  90790. case '<keyEncryptors>': case '<keyEncryptors': o.encs = []; break;
  90791. case '</keyEncryptors>': break;
  90792. case '<keyEncryptor': o.uri = y.uri; break;
  90793. case '</keyEncryptor>': break;
  90794. case '<encryptedKey': o.encs.push(y); break;
  90795. default: throw y[0];
  90796. }
  90797. });
  90798. return o;
  90799. }
  90800. /* [MS-OFFCRYPTO] 2.3.5.1 RC4 CryptoAPI Encryption Header */
  90801. function parse_RC4CryptoHeader(blob, length) {
  90802. var o = {};
  90803. var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;
  90804. if(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);
  90805. if(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);
  90806. o.Flags = blob.read_shift(4); length -= 4;
  90807. var sz = blob.read_shift(4); length -= 4;
  90808. o.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;
  90809. o.EncryptionVerifier = parse_EncryptionVerifier(blob, length);
  90810. return o;
  90811. }
  90812. /* [MS-OFFCRYPTO] 2.3.6.1 RC4 Encryption Header */
  90813. function parse_RC4Header(blob) {
  90814. var o = {};
  90815. var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);
  90816. if(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;
  90817. o.Salt = blob.read_shift(16);
  90818. o.EncryptedVerifier = blob.read_shift(16);
  90819. o.EncryptedVerifierHash = blob.read_shift(16);
  90820. return o;
  90821. }
  90822. /* [MS-OFFCRYPTO] 2.3.7.1 Binary Document Password Verifier Derivation */
  90823. function crypto_CreatePasswordVerifier_Method1(Password) {
  90824. var Verifier = 0x0000, PasswordArray;
  90825. var PasswordDecoded = _JS2ANSI(Password);
  90826. var len = PasswordDecoded.length + 1, i, PasswordByte;
  90827. var Intermediate1, Intermediate2, Intermediate3;
  90828. PasswordArray = new_raw_buf(len);
  90829. PasswordArray[0] = PasswordDecoded.length;
  90830. for(i = 1; i != len; ++i) PasswordArray[i] = PasswordDecoded[i-1];
  90831. for(i = len-1; i >= 0; --i) {
  90832. PasswordByte = PasswordArray[i];
  90833. Intermediate1 = ((Verifier & 0x4000) === 0x0000) ? 0 : 1;
  90834. Intermediate2 = (Verifier << 1) & 0x7FFF;
  90835. Intermediate3 = Intermediate1 | Intermediate2;
  90836. Verifier = Intermediate3 ^ PasswordByte;
  90837. }
  90838. return Verifier ^ 0xCE4B;
  90839. }
  90840. /* [MS-OFFCRYPTO] 2.3.7.2 Binary Document XOR Array Initialization */
  90841. var crypto_CreateXorArray_Method1 = (function() {
  90842. var PadArray = [0xBB, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF, 0xB9, 0x80, 0x00, 0xBE, 0x0F, 0x00, 0xBF, 0x0F, 0x00];
  90843. var InitialCode = [0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE, 0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A, 0x4EC3];
  90844. var XorMatrix = [0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09, 0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF, 0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0, 0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40, 0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5, 0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A, 0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9, 0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0, 0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC, 0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10, 0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168, 0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C, 0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD, 0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC, 0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4];
  90845. var Ror = function(Byte) { return ((Byte/2) | (Byte*128)) & 0xFF; };
  90846. var XorRor = function(byte1, byte2) { return Ror(byte1 ^ byte2); };
  90847. var CreateXorKey_Method1 = function(Password) {
  90848. var XorKey = InitialCode[Password.length - 1];
  90849. var CurrentElement = 0x68;
  90850. for(var i = Password.length-1; i >= 0; --i) {
  90851. var Char = Password[i];
  90852. for(var j = 0; j != 7; ++j) {
  90853. if(Char & 0x40) XorKey ^= XorMatrix[CurrentElement];
  90854. Char *= 2; --CurrentElement;
  90855. }
  90856. }
  90857. return XorKey;
  90858. };
  90859. return function(password) {
  90860. var Password = _JS2ANSI(password);
  90861. var XorKey = CreateXorKey_Method1(Password);
  90862. var Index = Password.length;
  90863. var ObfuscationArray = new_raw_buf(16);
  90864. for(var i = 0; i != 16; ++i) ObfuscationArray[i] = 0x00;
  90865. var Temp, PasswordLastChar, PadIndex;
  90866. if((Index & 1) === 1) {
  90867. Temp = XorKey >> 8;
  90868. ObfuscationArray[Index] = XorRor(PadArray[0], Temp);
  90869. --Index;
  90870. Temp = XorKey & 0xFF;
  90871. PasswordLastChar = Password[Password.length - 1];
  90872. ObfuscationArray[Index] = XorRor(PasswordLastChar, Temp);
  90873. }
  90874. while(Index > 0) {
  90875. --Index;
  90876. Temp = XorKey >> 8;
  90877. ObfuscationArray[Index] = XorRor(Password[Index], Temp);
  90878. --Index;
  90879. Temp = XorKey & 0xFF;
  90880. ObfuscationArray[Index] = XorRor(Password[Index], Temp);
  90881. }
  90882. Index = 15;
  90883. PadIndex = 15 - Password.length;
  90884. while(PadIndex > 0) {
  90885. Temp = XorKey >> 8;
  90886. ObfuscationArray[Index] = XorRor(PadArray[PadIndex], Temp);
  90887. --Index;
  90888. --PadIndex;
  90889. Temp = XorKey & 0xFF;
  90890. ObfuscationArray[Index] = XorRor(Password[Index], Temp);
  90891. --Index;
  90892. --PadIndex;
  90893. }
  90894. return ObfuscationArray;
  90895. };
  90896. })();
  90897. /* [MS-OFFCRYPTO] 2.3.7.3 Binary Document XOR Data Transformation Method 1 */
  90898. var crypto_DecryptData_Method1 = function(password, Data, XorArrayIndex, XorArray, O) {
  90899. /* If XorArray is set, use it; if O is not set, make changes in-place */
  90900. if(!O) O = Data;
  90901. if(!XorArray) XorArray = crypto_CreateXorArray_Method1(password);
  90902. var Index, Value;
  90903. for(Index = 0; Index != Data.length; ++Index) {
  90904. Value = Data[Index];
  90905. Value ^= XorArray[XorArrayIndex];
  90906. Value = ((Value>>5) | (Value<<3)) & 0xFF;
  90907. O[Index] = Value;
  90908. ++XorArrayIndex;
  90909. }
  90910. return [O, XorArrayIndex, XorArray];
  90911. };
  90912. var crypto_MakeXorDecryptor = function(password) {
  90913. var XorArrayIndex = 0, XorArray = crypto_CreateXorArray_Method1(password);
  90914. return function(Data) {
  90915. var O = crypto_DecryptData_Method1("", Data, XorArrayIndex, XorArray);
  90916. XorArrayIndex = O[1];
  90917. return O[0];
  90918. };
  90919. };
  90920. /* 2.5.343 */
  90921. function parse_XORObfuscation(blob, length, opts, out) {
  90922. var o = ({ key: parseuint16(blob), verificationBytes: parseuint16(blob) });
  90923. if(opts.password) o.verifier = crypto_CreatePasswordVerifier_Method1(opts.password);
  90924. out.valid = o.verificationBytes === o.verifier;
  90925. if(out.valid) out.insitu = crypto_MakeXorDecryptor(opts.password);
  90926. return o;
  90927. }
  90928. /* 2.4.117 */
  90929. function parse_FilePassHeader(blob, length, oo) {
  90930. var o = oo || {}; o.Info = blob.read_shift(2); blob.l -= 2;
  90931. if(o.Info === 1) o.Data = parse_RC4Header(blob, length);
  90932. else o.Data = parse_RC4CryptoHeader(blob, length);
  90933. return o;
  90934. }
  90935. function parse_FilePass(blob, length, opts) {
  90936. var o = ({ Type: opts.biff >= 8 ? blob.read_shift(2) : 0 }); /* wEncryptionType */
  90937. if(o.Type) parse_FilePassHeader(blob, length-2, o);
  90938. else parse_XORObfuscation(blob, opts.biff >= 8 ? length : length - 2, opts, o);
  90939. return o;
  90940. }
  90941. var RTF = (function() {
  90942. function rtf_to_sheet(d, opts) {
  90943. switch(opts.type) {
  90944. case 'base64': return rtf_to_sheet_str(Base64.decode(d), opts);
  90945. case 'binary': return rtf_to_sheet_str(d, opts);
  90946. case 'buffer': return rtf_to_sheet_str(d.toString('binary'), opts);
  90947. case 'array': return rtf_to_sheet_str(cc2str(d), opts);
  90948. }
  90949. throw new Error("Unrecognized type " + opts.type);
  90950. }
  90951. function rtf_to_sheet_str(str, opts) {
  90952. var o = opts || {};
  90953. var ws = o.dense ? ([]) : ({});
  90954. var range = ({s: {c:0, r:0}, e: {c:0, r:0}});
  90955. // TODO: parse
  90956. if(!str.match(/\\trowd/)) throw new Error("RTF missing table");
  90957. ws['!ref'] = encode_range(range);
  90958. return ws;
  90959. }
  90960. function rtf_to_workbook(d, opts) { return sheet_to_workbook(rtf_to_sheet(d, opts), opts); }
  90961. /* TODO: this is a stub */
  90962. function sheet_to_rtf(ws) {
  90963. var o = ["{\\rtf1\\ansi"];
  90964. var r = safe_decode_range(ws['!ref']), cell;
  90965. var dense = Array.isArray(ws);
  90966. for(var R = r.s.r; R <= r.e.r; ++R) {
  90967. o.push("\\trowd\\trautofit1");
  90968. for(var C = r.s.c; C <= r.e.c; ++C) o.push("\\cellx" + (C+1));
  90969. o.push("\\pard\\intbl");
  90970. for(C = r.s.c; C <= r.e.c; ++C) {
  90971. var coord = encode_cell({r:R,c:C});
  90972. cell = dense ? (ws[R]||[])[C]: ws[coord];
  90973. if(!cell || cell.v == null && (!cell.f || cell.F)) continue;
  90974. o.push(" " + (cell.w || (format_cell(cell), cell.w)));
  90975. o.push("\\cell");
  90976. }
  90977. o.push("\\pard\\intbl\\row");
  90978. }
  90979. return o.join("") + "}";
  90980. }
  90981. return {
  90982. to_workbook: rtf_to_workbook,
  90983. to_sheet: rtf_to_sheet,
  90984. from_sheet: sheet_to_rtf
  90985. };
  90986. })();
  90987. function hex2RGB(h) {
  90988. var o = h.slice(h[0]==="#"?1:0).slice(0,6);
  90989. return [parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16)];
  90990. }
  90991. function rgb2Hex(rgb) {
  90992. for(var i=0,o=1; i!=3; ++i) o = o*256 + (rgb[i]>255?255:rgb[i]<0?0:rgb[i]);
  90993. return o.toString(16).toUpperCase().slice(1);
  90994. }
  90995. function rgb2HSL(rgb) {
  90996. var R = rgb[0]/255, G = rgb[1]/255, B=rgb[2]/255;
  90997. var M = Math.max(R, G, B), m = Math.min(R, G, B), C = M - m;
  90998. if(C === 0) return [0, 0, R];
  90999. var H6 = 0, S = 0, L2 = (M + m);
  91000. S = C / (L2 > 1 ? 2 - L2 : L2);
  91001. switch(M){
  91002. case R: H6 = ((G - B) / C + 6)%6; break;
  91003. case G: H6 = ((B - R) / C + 2); break;
  91004. case B: H6 = ((R - G) / C + 4); break;
  91005. }
  91006. return [H6 / 6, S, L2 / 2];
  91007. }
  91008. function hsl2RGB(hsl){
  91009. var H = hsl[0], S = hsl[1], L = hsl[2];
  91010. var C = S * 2 * (L < 0.5 ? L : 1 - L), m = L - C/2;
  91011. var rgb = [m,m,m], h6 = 6*H;
  91012. var X;
  91013. if(S !== 0) switch(h6|0) {
  91014. case 0: case 6: X = C * h6; rgb[0] += C; rgb[1] += X; break;
  91015. case 1: X = C * (2 - h6); rgb[0] += X; rgb[1] += C; break;
  91016. case 2: X = C * (h6 - 2); rgb[1] += C; rgb[2] += X; break;
  91017. case 3: X = C * (4 - h6); rgb[1] += X; rgb[2] += C; break;
  91018. case 4: X = C * (h6 - 4); rgb[2] += C; rgb[0] += X; break;
  91019. case 5: X = C * (6 - h6); rgb[2] += X; rgb[0] += C; break;
  91020. }
  91021. for(var i = 0; i != 3; ++i) rgb[i] = Math.round(rgb[i]*255);
  91022. return rgb;
  91023. }
  91024. /* 18.8.3 bgColor tint algorithm */
  91025. function rgb_tint(hex, tint) {
  91026. if(tint === 0) return hex;
  91027. var hsl = rgb2HSL(hex2RGB(hex));
  91028. if (tint < 0) hsl[2] = hsl[2] * (1 + tint);
  91029. else hsl[2] = 1 - (1 - hsl[2]) * (1 - tint);
  91030. return rgb2Hex(hsl2RGB(hsl));
  91031. }
  91032. /* 18.3.1.13 width calculations */
  91033. /* [MS-OI29500] 2.1.595 Column Width & Formatting */
  91034. var DEF_MDW = 6, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW;
  91035. function width2px(width) { return Math.floor(( width + (Math.round(128/MDW))/256 )* MDW ); }
  91036. function px2char(px) { return (Math.floor((px - 5)/MDW * 100 + 0.5))/100; }
  91037. function char2width(chr) { return (Math.round((chr * MDW + 5)/MDW*256))/256; }
  91038. //function px2char_(px) { return (((px - 5)/MDW * 100 + 0.5))/100; }
  91039. //function char2width_(chr) { return (((chr * MDW + 5)/MDW*256))/256; }
  91040. function cycle_width(collw) { return char2width(px2char(width2px(collw))); }
  91041. /* XLSX/XLSB/XLS specify width in units of MDW */
  91042. function find_mdw_colw(collw) {
  91043. var delta = Math.abs(collw - cycle_width(collw)), _MDW = MDW;
  91044. if(delta > 0.005) for(MDW=MIN_MDW; MDW<MAX_MDW; ++MDW) if(Math.abs(collw - cycle_width(collw)) <= delta) { delta = Math.abs(collw - cycle_width(collw)); _MDW = MDW; }
  91045. MDW = _MDW;
  91046. }
  91047. /* XLML specifies width in terms of pixels */
  91048. /*function find_mdw_wpx(wpx) {
  91049. var delta = Infinity, guess = 0, _MDW = MIN_MDW;
  91050. for(MDW=MIN_MDW; MDW<MAX_MDW; ++MDW) {
  91051. guess = char2width_(px2char_(wpx))*256;
  91052. guess = (guess) % 1;
  91053. if(guess > 0.5) guess--;
  91054. if(Math.abs(guess) < delta) { delta = Math.abs(guess); _MDW = MDW; }
  91055. }
  91056. MDW = _MDW;
  91057. }*/
  91058. function process_col(coll) {
  91059. if(coll.width) {
  91060. coll.wpx = width2px(coll.width);
  91061. coll.wch = px2char(coll.wpx);
  91062. coll.MDW = MDW;
  91063. } else if(coll.wpx) {
  91064. coll.wch = px2char(coll.wpx);
  91065. coll.width = char2width(coll.wch);
  91066. coll.MDW = MDW;
  91067. } else if(typeof coll.wch == 'number') {
  91068. coll.width = char2width(coll.wch);
  91069. coll.wpx = width2px(coll.width);
  91070. coll.MDW = MDW;
  91071. }
  91072. if(coll.customWidth) delete coll.customWidth;
  91073. }
  91074. var DEF_PPI = 96, PPI = DEF_PPI;
  91075. function px2pt(px) { return px * 96 / PPI; }
  91076. function pt2px(pt) { return pt * PPI / 96; }
  91077. /* [MS-EXSPXML3] 2.4.54 ST_enmPattern */
  91078. var XLMLPatternTypeMap = {
  91079. "None": "none",
  91080. "Solid": "solid",
  91081. "Gray50": "mediumGray",
  91082. "Gray75": "darkGray",
  91083. "Gray25": "lightGray",
  91084. "HorzStripe": "darkHorizontal",
  91085. "VertStripe": "darkVertical",
  91086. "ReverseDiagStripe": "darkDown",
  91087. "DiagStripe": "darkUp",
  91088. "DiagCross": "darkGrid",
  91089. "ThickDiagCross": "darkTrellis",
  91090. "ThinHorzStripe": "lightHorizontal",
  91091. "ThinVertStripe": "lightVertical",
  91092. "ThinReverseDiagStripe": "lightDown",
  91093. "ThinHorzCross": "lightGrid"
  91094. };
  91095. /* 18.8.5 borders CT_Borders */
  91096. function parse_borders(t, styles, themes, opts) {
  91097. styles.Borders = [];
  91098. var border = {};
  91099. var pass = false;
  91100. (t[0].match(tagregex)||[]).forEach(function(x) {
  91101. var y = parsexmltag(x);
  91102. switch(strip_ns(y[0])) {
  91103. case '<borders': case '<borders>': case '</borders>': break;
  91104. /* 18.8.4 border CT_Border */
  91105. case '<border': case '<border>': case '<border/>':
  91106. border = {};
  91107. if(y.diagonalUp) border.diagonalUp = parsexmlbool(y.diagonalUp);
  91108. if(y.diagonalDown) border.diagonalDown = parsexmlbool(y.diagonalDown);
  91109. styles.Borders.push(border);
  91110. break;
  91111. case '</border>': break;
  91112. /* note: not in spec, appears to be CT_BorderPr */
  91113. case '<left/>': break;
  91114. case '<left': case '<left>': break;
  91115. case '</left>': break;
  91116. /* note: not in spec, appears to be CT_BorderPr */
  91117. case '<right/>': break;
  91118. case '<right': case '<right>': break;
  91119. case '</right>': break;
  91120. /* 18.8.43 top CT_BorderPr */
  91121. case '<top/>': break;
  91122. case '<top': case '<top>': break;
  91123. case '</top>': break;
  91124. /* 18.8.6 bottom CT_BorderPr */
  91125. case '<bottom/>': break;
  91126. case '<bottom': case '<bottom>': break;
  91127. case '</bottom>': break;
  91128. /* 18.8.13 diagonal CT_BorderPr */
  91129. case '<diagonal': case '<diagonal>': case '<diagonal/>': break;
  91130. case '</diagonal>': break;
  91131. /* 18.8.25 horizontal CT_BorderPr */
  91132. case '<horizontal': case '<horizontal>': case '<horizontal/>': break;
  91133. case '</horizontal>': break;
  91134. /* 18.8.44 vertical CT_BorderPr */
  91135. case '<vertical': case '<vertical>': case '<vertical/>': break;
  91136. case '</vertical>': break;
  91137. /* 18.8.37 start CT_BorderPr */
  91138. case '<start': case '<start>': case '<start/>': break;
  91139. case '</start>': break;
  91140. /* 18.8.16 end CT_BorderPr */
  91141. case '<end': case '<end>': case '<end/>': break;
  91142. case '</end>': break;
  91143. /* 18.8.? color CT_Color */
  91144. case '<color': case '<color>':
  91145. break;
  91146. case '<color/>': case '</color>': break;
  91147. /* 18.2.10 extLst CT_ExtensionList ? */
  91148. case '<extLst': case '<extLst>': case '</extLst>': break;
  91149. case '<ext': pass = true; break;
  91150. case '</ext>': pass = false; break;
  91151. default: if(opts && opts.WTF) {
  91152. if(!pass) throw new Error('unrecognized ' + y[0] + ' in borders');
  91153. }
  91154. }
  91155. });
  91156. }
  91157. /* 18.8.21 fills CT_Fills */
  91158. function parse_fills(t, styles, themes, opts) {
  91159. styles.Fills = [];
  91160. var fill = {};
  91161. var pass = false;
  91162. (t[0].match(tagregex)||[]).forEach(function(x) {
  91163. var y = parsexmltag(x);
  91164. switch(strip_ns(y[0])) {
  91165. case '<fills': case '<fills>': case '</fills>': break;
  91166. /* 18.8.20 fill CT_Fill */
  91167. case '<fill>': case '<fill': case '<fill/>':
  91168. fill = {}; styles.Fills.push(fill); break;
  91169. case '</fill>': break;
  91170. /* 18.8.24 gradientFill CT_GradientFill */
  91171. case '<gradientFill>': break;
  91172. case '<gradientFill':
  91173. case '</gradientFill>': styles.Fills.push(fill); fill = {}; break;
  91174. /* 18.8.32 patternFill CT_PatternFill */
  91175. case '<patternFill': case '<patternFill>':
  91176. if(y.patternType) fill.patternType = y.patternType;
  91177. break;
  91178. case '<patternFill/>': case '</patternFill>': break;
  91179. /* 18.8.3 bgColor CT_Color */
  91180. case '<bgColor':
  91181. if(!fill.bgColor) fill.bgColor = {};
  91182. if(y.indexed) fill.bgColor.indexed = parseInt(y.indexed, 10);
  91183. if(y.theme) fill.bgColor.theme = parseInt(y.theme, 10);
  91184. if(y.tint) fill.bgColor.tint = parseFloat(y.tint);
  91185. /* Excel uses ARGB strings */
  91186. if(y.rgb) fill.bgColor.rgb = y.rgb.slice(-6);
  91187. break;
  91188. case '<bgColor/>': case '</bgColor>': break;
  91189. /* 18.8.19 fgColor CT_Color */
  91190. case '<fgColor':
  91191. if(!fill.fgColor) fill.fgColor = {};
  91192. if(y.theme) fill.fgColor.theme = parseInt(y.theme, 10);
  91193. if(y.tint) fill.fgColor.tint = parseFloat(y.tint);
  91194. /* Excel uses ARGB strings */
  91195. if(y.rgb != null) fill.fgColor.rgb = y.rgb.slice(-6);
  91196. break;
  91197. case '<fgColor/>': case '</fgColor>': break;
  91198. /* 18.8.38 stop CT_GradientStop */
  91199. case '<stop': case '<stop/>': break;
  91200. case '</stop>': break;
  91201. /* 18.8.? color CT_Color */
  91202. case '<color': case '<color/>': break;
  91203. case '</color>': break;
  91204. /* 18.2.10 extLst CT_ExtensionList ? */
  91205. case '<extLst': case '<extLst>': case '</extLst>': break;
  91206. case '<ext': pass = true; break;
  91207. case '</ext>': pass = false; break;
  91208. default: if(opts && opts.WTF) {
  91209. if(!pass) throw new Error('unrecognized ' + y[0] + ' in fills');
  91210. }
  91211. }
  91212. });
  91213. }
  91214. /* 18.8.23 fonts CT_Fonts */
  91215. function parse_fonts(t, styles, themes, opts) {
  91216. styles.Fonts = [];
  91217. var font = {};
  91218. var pass = false;
  91219. (t[0].match(tagregex)||[]).forEach(function(x) {
  91220. var y = parsexmltag(x);
  91221. switch(strip_ns(y[0])) {
  91222. case '<fonts': case '<fonts>': case '</fonts>': break;
  91223. /* 18.8.22 font CT_Font */
  91224. case '<font': case '<font>': break;
  91225. case '</font>': case '<font/>':
  91226. styles.Fonts.push(font);
  91227. font = {};
  91228. break;
  91229. /* 18.8.29 name CT_FontName */
  91230. case '<name': if(y.val) font.name = y.val; break;
  91231. case '<name/>': case '</name>': break;
  91232. /* 18.8.2 b CT_BooleanProperty */
  91233. case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
  91234. case '<b/>': font.bold = 1; break;
  91235. /* 18.8.26 i CT_BooleanProperty */
  91236. case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
  91237. case '<i/>': font.italic = 1; break;
  91238. /* 18.4.13 u CT_UnderlineProperty */
  91239. case '<u':
  91240. switch(y.val) {
  91241. case "none": font.underline = 0x00; break;
  91242. case "single": font.underline = 0x01; break;
  91243. case "double": font.underline = 0x02; break;
  91244. case "singleAccounting": font.underline = 0x21; break;
  91245. case "doubleAccounting": font.underline = 0x22; break;
  91246. } break;
  91247. case '<u/>': font.underline = 1; break;
  91248. /* 18.4.10 strike CT_BooleanProperty */
  91249. case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
  91250. case '<strike/>': font.strike = 1; break;
  91251. /* 18.4.2 outline CT_BooleanProperty */
  91252. case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
  91253. case '<outline/>': font.outline = 1; break;
  91254. /* 18.8.36 shadow CT_BooleanProperty */
  91255. case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
  91256. case '<shadow/>': font.shadow = 1; break;
  91257. /* 18.8.12 condense CT_BooleanProperty */
  91258. case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
  91259. case '<condense/>': font.condense = 1; break;
  91260. /* 18.8.17 extend CT_BooleanProperty */
  91261. case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
  91262. case '<extend/>': font.extend = 1; break;
  91263. /* 18.4.11 sz CT_FontSize */
  91264. case '<sz': if(y.val) font.sz = +y.val; break;
  91265. case '<sz/>': case '</sz>': break;
  91266. /* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
  91267. case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
  91268. case '<vertAlign/>': case '</vertAlign>': break;
  91269. /* 18.8.18 family CT_FontFamily */
  91270. case '<family': if(y.val) font.family = parseInt(y.val,10); break;
  91271. case '<family/>': case '</family>': break;
  91272. /* 18.8.35 scheme CT_FontScheme */
  91273. case '<scheme': if(y.val) font.scheme = y.val; break;
  91274. case '<scheme/>': case '</scheme>': break;
  91275. /* 18.4.1 charset CT_IntProperty */
  91276. case '<charset':
  91277. if(y.val == '1') break;
  91278. y.codepage = CS2CP[parseInt(y.val, 10)];
  91279. break;
  91280. /* 18.?.? color CT_Color */
  91281. case '<color':
  91282. if(!font.color) font.color = {};
  91283. if(y.auto) font.color.auto = parsexmlbool(y.auto);
  91284. if(y.rgb) font.color.rgb = y.rgb.slice(-6);
  91285. else if(y.indexed) {
  91286. font.color.index = parseInt(y.indexed, 10);
  91287. var icv = XLSIcv[font.color.index];
  91288. if(font.color.index == 81) icv = XLSIcv[1];
  91289. if(!icv) throw new Error(x);
  91290. font.color.rgb = icv[0].toString(16) + icv[1].toString(16) + icv[2].toString(16);
  91291. } else if(y.theme) {
  91292. font.color.theme = parseInt(y.theme, 10);
  91293. if(y.tint) font.color.tint = parseFloat(y.tint);
  91294. if(y.theme && themes.themeElements && themes.themeElements.clrScheme) {
  91295. font.color.rgb = rgb_tint(themes.themeElements.clrScheme[font.color.theme].rgb, font.color.tint || 0);
  91296. }
  91297. }
  91298. break;
  91299. case '<color/>': case '</color>': break;
  91300. /* note: sometimes mc:AlternateContent appears bare */
  91301. case '<AlternateContent': pass = true; break;
  91302. case '</AlternateContent>': pass = false; break;
  91303. /* 18.2.10 extLst CT_ExtensionList ? */
  91304. case '<extLst': case '<extLst>': case '</extLst>': break;
  91305. case '<ext': pass = true; break;
  91306. case '</ext>': pass = false; break;
  91307. default: if(opts && opts.WTF) {
  91308. if(!pass) throw new Error('unrecognized ' + y[0] + ' in fonts');
  91309. }
  91310. }
  91311. });
  91312. }
  91313. /* 18.8.31 numFmts CT_NumFmts */
  91314. function parse_numFmts(t, styles, opts) {
  91315. styles.NumberFmt = [];
  91316. var k/*Array<number>*/ = (keys(SSF._table));
  91317. for(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = SSF._table[k[i]];
  91318. var m = t[0].match(tagregex);
  91319. if(!m) return;
  91320. for(i=0; i < m.length; ++i) {
  91321. var y = parsexmltag(m[i]);
  91322. switch(strip_ns(y[0])) {
  91323. case '<numFmts': case '</numFmts>': case '<numFmts/>': case '<numFmts>': break;
  91324. case '<numFmt': {
  91325. var f=unescapexml(utf8read(y.formatCode)), j=parseInt(y.numFmtId,10);
  91326. styles.NumberFmt[j] = f;
  91327. if(j>0) {
  91328. if(j > 0x188) {
  91329. for(j = 0x188; j > 0x3c; --j) if(styles.NumberFmt[j] == null) break;
  91330. styles.NumberFmt[j] = f;
  91331. }
  91332. SSF.load(f,j);
  91333. }
  91334. } break;
  91335. case '</numFmt>': break;
  91336. default: if(opts.WTF) throw new Error('unrecognized ' + y[0] + ' in numFmts');
  91337. }
  91338. }
  91339. }
  91340. function write_numFmts(NF) {
  91341. var o = ["<numFmts>"];
  91342. [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
  91343. for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) o[o.length] = (writextag('numFmt',null,{numFmtId:i,formatCode:escapexml(NF[i])}));
  91344. });
  91345. if(o.length === 1) return "";
  91346. o[o.length] = ("</numFmts>");
  91347. o[0] = writextag('numFmts', null, { count:o.length-2 }).replace("/>", ">");
  91348. return o.join("");
  91349. }
  91350. /* 18.8.10 cellXfs CT_CellXfs */
  91351. var cellXF_uint = [ "numFmtId", "fillId", "fontId", "borderId", "xfId" ];
  91352. var cellXF_bool = [ "applyAlignment", "applyBorder", "applyFill", "applyFont", "applyNumberFormat", "applyProtection", "pivotButton", "quotePrefix" ];
  91353. function parse_cellXfs(t, styles, opts) {
  91354. styles.CellXf = [];
  91355. var xf;
  91356. var pass = false;
  91357. (t[0].match(tagregex)||[]).forEach(function(x) {
  91358. var y = parsexmltag(x), i = 0;
  91359. switch(strip_ns(y[0])) {
  91360. case '<cellXfs': case '<cellXfs>': case '<cellXfs/>': case '</cellXfs>': break;
  91361. /* 18.8.45 xf CT_Xf */
  91362. case '<xf': case '<xf/>':
  91363. xf = y;
  91364. delete xf[0];
  91365. for(i = 0; i < cellXF_uint.length; ++i) if(xf[cellXF_uint[i]])
  91366. xf[cellXF_uint[i]] = parseInt(xf[cellXF_uint[i]], 10);
  91367. for(i = 0; i < cellXF_bool.length; ++i) if(xf[cellXF_bool[i]])
  91368. xf[cellXF_bool[i]] = parsexmlbool(xf[cellXF_bool[i]]);
  91369. if(xf.numFmtId > 0x188) {
  91370. for(i = 0x188; i > 0x3c; --i) if(styles.NumberFmt[xf.numFmtId] == styles.NumberFmt[i]) { xf.numFmtId = i; break; }
  91371. }
  91372. styles.CellXf.push(xf); break;
  91373. case '</xf>': break;
  91374. /* 18.8.1 alignment CT_CellAlignment */
  91375. case '<alignment': case '<alignment/>':
  91376. var alignment = {};
  91377. if(y.vertical) alignment.vertical = y.vertical;
  91378. if(y.horizontal) alignment.horizontal = y.horizontal;
  91379. if(y.textRotation != null) alignment.textRotation = y.textRotation;
  91380. if(y.indent) alignment.indent = y.indent;
  91381. if(y.wrapText) alignment.wrapText = parsexmlbool(y.wrapText);
  91382. xf.alignment = alignment;
  91383. break;
  91384. case '</alignment>': break;
  91385. /* 18.8.33 protection CT_CellProtection */
  91386. case '<protection':
  91387. break;
  91388. case '</protection>': case '<protection/>': break;
  91389. /* note: sometimes mc:AlternateContent appears bare */
  91390. case '<AlternateContent': pass = true; break;
  91391. case '</AlternateContent>': pass = false; break;
  91392. /* 18.2.10 extLst CT_ExtensionList ? */
  91393. case '<extLst': case '<extLst>': case '</extLst>': break;
  91394. case '<ext': pass = true; break;
  91395. case '</ext>': pass = false; break;
  91396. default: if(opts && opts.WTF) {
  91397. if(!pass) throw new Error('unrecognized ' + y[0] + ' in cellXfs');
  91398. }
  91399. }
  91400. });
  91401. }
  91402. function write_cellXfs(cellXfs) {
  91403. var o = [];
  91404. o[o.length] = (writextag('cellXfs',null));
  91405. cellXfs.forEach(function(c) {
  91406. o[o.length] = (writextag('xf', null, c));
  91407. });
  91408. o[o.length] = ("</cellXfs>");
  91409. if(o.length === 2) return "";
  91410. o[0] = writextag('cellXfs',null, {count:o.length-2}).replace("/>",">");
  91411. return o.join("");
  91412. }
  91413. /* 18.8 Styles CT_Stylesheet*/
  91414. var parse_sty_xml= (function make_pstyx() {
  91415. var numFmtRegex = /<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/;
  91416. var cellXfRegex = /<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/;
  91417. var fillsRegex = /<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/;
  91418. var fontsRegex = /<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/;
  91419. var bordersRegex = /<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;
  91420. return function parse_sty_xml(data, themes, opts) {
  91421. var styles = {};
  91422. if(!data) return styles;
  91423. data = data.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");
  91424. /* 18.8.39 styleSheet CT_Stylesheet */
  91425. var t;
  91426. /* 18.8.31 numFmts CT_NumFmts ? */
  91427. if((t=data.match(numFmtRegex))) parse_numFmts(t, styles, opts);
  91428. /* 18.8.23 fonts CT_Fonts ? */
  91429. if((t=data.match(fontsRegex))) parse_fonts(t, styles, themes, opts);
  91430. /* 18.8.21 fills CT_Fills ? */
  91431. if((t=data.match(fillsRegex))) parse_fills(t, styles, themes, opts);
  91432. /* 18.8.5 borders CT_Borders ? */
  91433. if((t=data.match(bordersRegex))) parse_borders(t, styles, themes, opts);
  91434. /* 18.8.9 cellStyleXfs CT_CellStyleXfs ? */
  91435. /* 18.8.10 cellXfs CT_CellXfs ? */
  91436. if((t=data.match(cellXfRegex))) parse_cellXfs(t, styles, opts);
  91437. /* 18.8.8 cellStyles CT_CellStyles ? */
  91438. /* 18.8.15 dxfs CT_Dxfs ? */
  91439. /* 18.8.42 tableStyles CT_TableStyles ? */
  91440. /* 18.8.11 colors CT_Colors ? */
  91441. /* 18.2.10 extLst CT_ExtensionList ? */
  91442. return styles;
  91443. };
  91444. })();
  91445. var STYLES_XML_ROOT = writextag('styleSheet', null, {
  91446. 'xmlns': XMLNS.main[0],
  91447. 'xmlns:vt': XMLNS.vt
  91448. });
  91449. RELS.STY = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
  91450. function write_sty_xml(wb, opts) {
  91451. var o = [XML_HEADER, STYLES_XML_ROOT], w;
  91452. if(wb.SSF && (w = write_numFmts(wb.SSF)) != null) o[o.length] = w;
  91453. o[o.length] = ('<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>');
  91454. o[o.length] = ('<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>');
  91455. o[o.length] = ('<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>');
  91456. o[o.length] = ('<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>');
  91457. if((w = write_cellXfs(opts.cellXfs))) o[o.length] = (w);
  91458. o[o.length] = ('<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>');
  91459. o[o.length] = ('<dxfs count="0"/>');
  91460. o[o.length] = ('<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>');
  91461. if(o.length>2){ o[o.length] = ('</styleSheet>'); o[1]=o[1].replace("/>",">"); }
  91462. return o.join("");
  91463. }
  91464. /* [MS-XLSB] 2.4.657 BrtFmt */
  91465. function parse_BrtFmt(data, length) {
  91466. var numFmtId = data.read_shift(2);
  91467. var stFmtCode = parse_XLWideString(data,length-2);
  91468. return [numFmtId, stFmtCode];
  91469. }
  91470. function write_BrtFmt(i, f, o) {
  91471. if(!o) o = new_buf(6 + 4 * f.length);
  91472. o.write_shift(2, i);
  91473. write_XLWideString(f, o);
  91474. var out = (o.length > o.l) ? o.slice(0, o.l) : o;
  91475. if(o.l == null) o.l = o.length;
  91476. return out;
  91477. }
  91478. /* [MS-XLSB] 2.4.659 BrtFont TODO */
  91479. function parse_BrtFont(data, length, opts) {
  91480. var out = ({});
  91481. out.sz = data.read_shift(2) / 20;
  91482. var grbit = parse_FontFlags(data, 2, opts);
  91483. if(grbit.fItalic) out.italic = 1;
  91484. if(grbit.fCondense) out.condense = 1;
  91485. if(grbit.fExtend) out.extend = 1;
  91486. if(grbit.fShadow) out.shadow = 1;
  91487. if(grbit.fOutline) out.outline = 1;
  91488. if(grbit.fStrikeout) out.strike = 1;
  91489. var bls = data.read_shift(2);
  91490. if(bls === 0x02BC) out.bold = 1;
  91491. switch(data.read_shift(2)) {
  91492. /* case 0: out.vertAlign = "baseline"; break; */
  91493. case 1: out.vertAlign = "superscript"; break;
  91494. case 2: out.vertAlign = "subscript"; break;
  91495. }
  91496. var underline = data.read_shift(1);
  91497. if(underline != 0) out.underline = underline;
  91498. var family = data.read_shift(1);
  91499. if(family > 0) out.family = family;
  91500. var bCharSet = data.read_shift(1);
  91501. if(bCharSet > 0) out.charset = bCharSet;
  91502. data.l++;
  91503. out.color = parse_BrtColor(data, 8);
  91504. switch(data.read_shift(1)) {
  91505. /* case 0: out.scheme = "none": break; */
  91506. case 1: out.scheme = "major"; break;
  91507. case 2: out.scheme = "minor"; break;
  91508. }
  91509. out.name = parse_XLWideString(data, length - 21);
  91510. return out;
  91511. }
  91512. function write_BrtFont(font, o) {
  91513. if(!o) o = new_buf(25+4*32);
  91514. o.write_shift(2, font.sz * 20);
  91515. write_FontFlags(font, o);
  91516. o.write_shift(2, font.bold ? 0x02BC : 0x0190);
  91517. var sss = 0;
  91518. if(font.vertAlign == "superscript") sss = 1;
  91519. else if(font.vertAlign == "subscript") sss = 2;
  91520. o.write_shift(2, sss);
  91521. o.write_shift(1, font.underline || 0);
  91522. o.write_shift(1, font.family || 0);
  91523. o.write_shift(1, font.charset || 0);
  91524. o.write_shift(1, 0);
  91525. write_BrtColor(font.color, o);
  91526. var scheme = 0;
  91527. if(font.scheme == "major") scheme = 1;
  91528. if(font.scheme == "minor") scheme = 2;
  91529. o.write_shift(1, scheme);
  91530. write_XLWideString(font.name, o);
  91531. return o.length > o.l ? o.slice(0, o.l) : o;
  91532. }
  91533. /* [MS-XLSB] 2.4.650 BrtFill */
  91534. var XLSBFillPTNames = [
  91535. "none",
  91536. "solid",
  91537. "mediumGray",
  91538. "darkGray",
  91539. "lightGray",
  91540. "darkHorizontal",
  91541. "darkVertical",
  91542. "darkDown",
  91543. "darkUp",
  91544. "darkGrid",
  91545. "darkTrellis",
  91546. "lightHorizontal",
  91547. "lightVertical",
  91548. "lightDown",
  91549. "lightUp",
  91550. "lightGrid",
  91551. "lightTrellis",
  91552. "gray125",
  91553. "gray0625"
  91554. ];
  91555. var rev_XLSBFillPTNames = (evert(XLSBFillPTNames));
  91556. /* TODO: gradient fill representation */
  91557. var parse_BrtFill = parsenoop;
  91558. function write_BrtFill(fill, o) {
  91559. if(!o) o = new_buf(4*3 + 8*7 + 16*1);
  91560. var fls = rev_XLSBFillPTNames[fill.patternType];
  91561. if(fls == null) fls = 0x28;
  91562. o.write_shift(4, fls);
  91563. var j = 0;
  91564. if(fls != 0x28) {
  91565. /* TODO: custom FG Color */
  91566. write_BrtColor({auto:1}, o);
  91567. /* TODO: custom BG Color */
  91568. write_BrtColor({auto:1}, o);
  91569. for(; j < 12; ++j) o.write_shift(4, 0);
  91570. } else {
  91571. for(; j < 4; ++j) o.write_shift(4, 0);
  91572. for(; j < 12; ++j) o.write_shift(4, 0); /* TODO */
  91573. /* iGradientType */
  91574. /* xnumDegree */
  91575. /* xnumFillToLeft */
  91576. /* xnumFillToRight */
  91577. /* xnumFillToTop */
  91578. /* xnumFillToBottom */
  91579. /* cNumStop */
  91580. /* xfillGradientStop */
  91581. }
  91582. return o.length > o.l ? o.slice(0, o.l) : o;
  91583. }
  91584. /* [MS-XLSB] 2.4.824 BrtXF */
  91585. function parse_BrtXF(data, length) {
  91586. var tgt = data.l + length;
  91587. var ixfeParent = data.read_shift(2);
  91588. var ifmt = data.read_shift(2);
  91589. data.l = tgt;
  91590. return {ixfe:ixfeParent, numFmtId:ifmt };
  91591. }
  91592. function write_BrtXF(data, ixfeP, o) {
  91593. if(!o) o = new_buf(16);
  91594. o.write_shift(2, ixfeP||0);
  91595. o.write_shift(2, data.numFmtId||0);
  91596. o.write_shift(2, 0); /* iFont */
  91597. o.write_shift(2, 0); /* iFill */
  91598. o.write_shift(2, 0); /* ixBorder */
  91599. o.write_shift(1, 0); /* trot */
  91600. o.write_shift(1, 0); /* indent */
  91601. var flow = 0;
  91602. o.write_shift(1, flow); /* flags */
  91603. o.write_shift(1, 0); /* flags */
  91604. o.write_shift(1, 0); /* xfGrbitAtr */
  91605. o.write_shift(1, 0);
  91606. return o;
  91607. }
  91608. /* [MS-XLSB] 2.5.4 Blxf TODO */
  91609. function write_Blxf(data, o) {
  91610. if(!o) o = new_buf(10);
  91611. o.write_shift(1, 0); /* dg */
  91612. o.write_shift(1, 0);
  91613. o.write_shift(4, 0); /* color */
  91614. o.write_shift(4, 0); /* color */
  91615. return o;
  91616. }
  91617. /* [MS-XLSB] 2.4.302 BrtBorder TODO */
  91618. var parse_BrtBorder = parsenoop;
  91619. function write_BrtBorder(border, o) {
  91620. if(!o) o = new_buf(51);
  91621. o.write_shift(1, 0); /* diagonal */
  91622. write_Blxf(null, o); /* top */
  91623. write_Blxf(null, o); /* bottom */
  91624. write_Blxf(null, o); /* left */
  91625. write_Blxf(null, o); /* right */
  91626. write_Blxf(null, o); /* diag */
  91627. return o.length > o.l ? o.slice(0, o.l) : o;
  91628. }
  91629. /* [MS-XLSB] 2.4.763 BrtStyle TODO */
  91630. function write_BrtStyle(style, o) {
  91631. if(!o) o = new_buf(12+4*10);
  91632. o.write_shift(4, style.xfId);
  91633. o.write_shift(2, 1);
  91634. o.write_shift(1, +style.builtinId);
  91635. o.write_shift(1, 0); /* iLevel */
  91636. write_XLNullableWideString(style.name || "", o);
  91637. return o.length > o.l ? o.slice(0, o.l) : o;
  91638. }
  91639. /* [MS-XLSB] 2.4.272 BrtBeginTableStyles */
  91640. function write_BrtBeginTableStyles(cnt, defTableStyle, defPivotStyle) {
  91641. var o = new_buf(4+256*2*4);
  91642. o.write_shift(4, cnt);
  91643. write_XLNullableWideString(defTableStyle, o);
  91644. write_XLNullableWideString(defPivotStyle, o);
  91645. return o.length > o.l ? o.slice(0, o.l) : o;
  91646. }
  91647. /* [MS-XLSB] 2.1.7.50 Styles */
  91648. function parse_sty_bin(data, themes, opts) {
  91649. var styles = {};
  91650. styles.NumberFmt = ([]);
  91651. for(var y in SSF._table) styles.NumberFmt[y] = SSF._table[y];
  91652. styles.CellXf = [];
  91653. styles.Fonts = [];
  91654. var state = [];
  91655. var pass = false;
  91656. recordhopper(data, function hopper_sty(val, R_n, RT) {
  91657. switch(RT) {
  91658. case 0x002C: /* 'BrtFmt' */
  91659. styles.NumberFmt[val[0]] = val[1]; SSF.load(val[1], val[0]);
  91660. break;
  91661. case 0x002B: /* 'BrtFont' */
  91662. styles.Fonts.push(val);
  91663. if(val.color.theme != null && themes && themes.themeElements && themes.themeElements.clrScheme) {
  91664. val.color.rgb = rgb_tint(themes.themeElements.clrScheme[val.color.theme].rgb, val.color.tint || 0);
  91665. }
  91666. break;
  91667. case 0x0401: /* 'BrtKnownFonts' */ break;
  91668. case 0x002D: /* 'BrtFill' */
  91669. break;
  91670. case 0x002E: /* 'BrtBorder' */
  91671. break;
  91672. case 0x002F: /* 'BrtXF' */
  91673. if(state[state.length - 1] == "BrtBeginCellXFs") {
  91674. styles.CellXf.push(val);
  91675. }
  91676. break;
  91677. case 0x0030: /* 'BrtStyle' */
  91678. case 0x01FB: /* 'BrtDXF' */
  91679. case 0x023C: /* 'BrtMRUColor' */
  91680. case 0x01DB: /* 'BrtIndexedColor': */
  91681. break;
  91682. case 0x0493: /* 'BrtDXF14' */
  91683. case 0x0836: /* 'BrtDXF15' */
  91684. case 0x046A: /* 'BrtSlicerStyleElement' */
  91685. case 0x0200: /* 'BrtTableStyleElement' */
  91686. case 0x082F: /* 'BrtTimelineStyleElement' */
  91687. case 0x0C00: /* 'BrtUid' */
  91688. break;
  91689. case 0x0023: /* 'BrtFRTBegin' */
  91690. pass = true; break;
  91691. case 0x0024: /* 'BrtFRTEnd' */
  91692. pass = false; break;
  91693. case 0x0025: /* 'BrtACBegin' */
  91694. state.push(R_n); pass = true; break;
  91695. case 0x0026: /* 'BrtACEnd' */
  91696. state.pop(); pass = false; break;
  91697. default:
  91698. if((R_n||"").indexOf("Begin") > 0) state.push(R_n);
  91699. else if((R_n||"").indexOf("End") > 0) state.pop();
  91700. else if(!pass || (opts.WTF && state[state.length-1] != "BrtACBegin")) throw new Error("Unexpected record " + RT + " " + R_n);
  91701. }
  91702. });
  91703. return styles;
  91704. }
  91705. function write_FMTS_bin(ba, NF) {
  91706. if(!NF) return;
  91707. var cnt = 0;
  91708. [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
  91709. for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) ++cnt;
  91710. });
  91711. if(cnt == 0) return;
  91712. write_record(ba, "BrtBeginFmts", write_UInt32LE(cnt));
  91713. [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
  91714. for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_record(ba, "BrtFmt", write_BrtFmt(i, NF[i]));
  91715. });
  91716. write_record(ba, "BrtEndFmts");
  91717. }
  91718. function write_FONTS_bin(ba) {
  91719. var cnt = 1;
  91720. if(cnt == 0) return;
  91721. write_record(ba, "BrtBeginFonts", write_UInt32LE(cnt));
  91722. write_record(ba, "BrtFont", write_BrtFont({
  91723. sz:12,
  91724. color: {theme:1},
  91725. name: "Calibri",
  91726. family: 2,
  91727. scheme: "minor"
  91728. }));
  91729. /* 1*65491BrtFont [ACFONTS] */
  91730. write_record(ba, "BrtEndFonts");
  91731. }
  91732. function write_FILLS_bin(ba) {
  91733. var cnt = 2;
  91734. if(cnt == 0) return;
  91735. write_record(ba, "BrtBeginFills", write_UInt32LE(cnt));
  91736. write_record(ba, "BrtFill", write_BrtFill({patternType:"none"}));
  91737. write_record(ba, "BrtFill", write_BrtFill({patternType:"gray125"}));
  91738. /* 1*65431BrtFill */
  91739. write_record(ba, "BrtEndFills");
  91740. }
  91741. function write_BORDERS_bin(ba) {
  91742. var cnt = 1;
  91743. if(cnt == 0) return;
  91744. write_record(ba, "BrtBeginBorders", write_UInt32LE(cnt));
  91745. write_record(ba, "BrtBorder", write_BrtBorder({}));
  91746. /* 1*65430BrtBorder */
  91747. write_record(ba, "BrtEndBorders");
  91748. }
  91749. function write_CELLSTYLEXFS_bin(ba) {
  91750. var cnt = 1;
  91751. write_record(ba, "BrtBeginCellStyleXFs", write_UInt32LE(cnt));
  91752. write_record(ba, "BrtXF", write_BrtXF({
  91753. numFmtId: 0,
  91754. fontId: 0,
  91755. fillId: 0,
  91756. borderId: 0
  91757. }, 0xFFFF));
  91758. /* 1*65430(BrtXF *FRT) */
  91759. write_record(ba, "BrtEndCellStyleXFs");
  91760. }
  91761. function write_CELLXFS_bin(ba, data) {
  91762. write_record(ba, "BrtBeginCellXFs", write_UInt32LE(data.length));
  91763. data.forEach(function(c) { write_record(ba, "BrtXF", write_BrtXF(c,0)); });
  91764. /* 1*65430(BrtXF *FRT) */
  91765. write_record(ba, "BrtEndCellXFs");
  91766. }
  91767. function write_STYLES_bin(ba) {
  91768. var cnt = 1;
  91769. write_record(ba, "BrtBeginStyles", write_UInt32LE(cnt));
  91770. write_record(ba, "BrtStyle", write_BrtStyle({
  91771. xfId:0,
  91772. builtinId:0,
  91773. name:"Normal"
  91774. }));
  91775. /* 1*65430(BrtStyle *FRT) */
  91776. write_record(ba, "BrtEndStyles");
  91777. }
  91778. function write_DXFS_bin(ba) {
  91779. var cnt = 0;
  91780. write_record(ba, "BrtBeginDXFs", write_UInt32LE(cnt));
  91781. /* *2147483647(BrtDXF *FRT) */
  91782. write_record(ba, "BrtEndDXFs");
  91783. }
  91784. function write_TABLESTYLES_bin(ba) {
  91785. var cnt = 0;
  91786. write_record(ba, "BrtBeginTableStyles", write_BrtBeginTableStyles(cnt, "TableStyleMedium9", "PivotStyleMedium4"));
  91787. /* *TABLESTYLE */
  91788. write_record(ba, "BrtEndTableStyles");
  91789. }
  91790. function write_COLORPALETTE_bin() {
  91791. return;
  91792. /* BrtBeginColorPalette [INDEXEDCOLORS] [MRUCOLORS] BrtEndColorPalette */
  91793. }
  91794. /* [MS-XLSB] 2.1.7.50 Styles */
  91795. function write_sty_bin(wb, opts) {
  91796. var ba = buf_array();
  91797. write_record(ba, "BrtBeginStyleSheet");
  91798. write_FMTS_bin(ba, wb.SSF);
  91799. write_FONTS_bin(ba, wb);
  91800. write_FILLS_bin(ba, wb);
  91801. write_BORDERS_bin(ba, wb);
  91802. write_CELLSTYLEXFS_bin(ba, wb);
  91803. write_CELLXFS_bin(ba, opts.cellXfs);
  91804. write_STYLES_bin(ba, wb);
  91805. write_DXFS_bin(ba, wb);
  91806. write_TABLESTYLES_bin(ba, wb);
  91807. write_COLORPALETTE_bin(ba, wb);
  91808. /* FRTSTYLESHEET*/
  91809. write_record(ba, "BrtEndStyleSheet");
  91810. return ba.end();
  91811. }
  91812. RELS.THEME = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
  91813. /* 20.1.6.2 clrScheme CT_ColorScheme */
  91814. function parse_clrScheme(t, themes, opts) {
  91815. themes.themeElements.clrScheme = [];
  91816. var color = {};
  91817. (t[0].match(tagregex)||[]).forEach(function(x) {
  91818. var y = parsexmltag(x);
  91819. switch(y[0]) {
  91820. /* 20.1.6.2 clrScheme (Color Scheme) CT_ColorScheme */
  91821. case '<a:clrScheme': case '</a:clrScheme>': break;
  91822. /* 20.1.2.3.32 srgbClr CT_SRgbColor */
  91823. case '<a:srgbClr':
  91824. color.rgb = y.val; break;
  91825. /* 20.1.2.3.33 sysClr CT_SystemColor */
  91826. case '<a:sysClr':
  91827. color.rgb = y.lastClr; break;
  91828. /* 20.1.4.1.1 accent1 (Accent 1) */
  91829. /* 20.1.4.1.2 accent2 (Accent 2) */
  91830. /* 20.1.4.1.3 accent3 (Accent 3) */
  91831. /* 20.1.4.1.4 accent4 (Accent 4) */
  91832. /* 20.1.4.1.5 accent5 (Accent 5) */
  91833. /* 20.1.4.1.6 accent6 (Accent 6) */
  91834. /* 20.1.4.1.9 dk1 (Dark 1) */
  91835. /* 20.1.4.1.10 dk2 (Dark 2) */
  91836. /* 20.1.4.1.15 folHlink (Followed Hyperlink) */
  91837. /* 20.1.4.1.19 hlink (Hyperlink) */
  91838. /* 20.1.4.1.22 lt1 (Light 1) */
  91839. /* 20.1.4.1.23 lt2 (Light 2) */
  91840. case '<a:dk1>': case '</a:dk1>':
  91841. case '<a:lt1>': case '</a:lt1>':
  91842. case '<a:dk2>': case '</a:dk2>':
  91843. case '<a:lt2>': case '</a:lt2>':
  91844. case '<a:accent1>': case '</a:accent1>':
  91845. case '<a:accent2>': case '</a:accent2>':
  91846. case '<a:accent3>': case '</a:accent3>':
  91847. case '<a:accent4>': case '</a:accent4>':
  91848. case '<a:accent5>': case '</a:accent5>':
  91849. case '<a:accent6>': case '</a:accent6>':
  91850. case '<a:hlink>': case '</a:hlink>':
  91851. case '<a:folHlink>': case '</a:folHlink>':
  91852. if (y[0].charAt(1) === '/') {
  91853. themes.themeElements.clrScheme.push(color);
  91854. color = {};
  91855. } else {
  91856. color.name = y[0].slice(3, y[0].length - 1);
  91857. }
  91858. break;
  91859. default: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme');
  91860. }
  91861. });
  91862. }
  91863. /* 20.1.4.1.18 fontScheme CT_FontScheme */
  91864. function parse_fontScheme() { }
  91865. /* 20.1.4.1.15 fmtScheme CT_StyleMatrix */
  91866. function parse_fmtScheme() { }
  91867. var clrsregex = /<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/;
  91868. var fntsregex = /<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/;
  91869. var fmtsregex = /<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;
  91870. /* 20.1.6.10 themeElements CT_BaseStyles */
  91871. function parse_themeElements(data, themes, opts) {
  91872. themes.themeElements = {};
  91873. var t;
  91874. [
  91875. /* clrScheme CT_ColorScheme */
  91876. ['clrScheme', clrsregex, parse_clrScheme],
  91877. /* fontScheme CT_FontScheme */
  91878. ['fontScheme', fntsregex, parse_fontScheme],
  91879. /* fmtScheme CT_StyleMatrix */
  91880. ['fmtScheme', fmtsregex, parse_fmtScheme]
  91881. ].forEach(function(m) {
  91882. if(!(t=data.match(m[1]))) throw new Error(m[0] + ' not found in themeElements');
  91883. m[2](t, themes, opts);
  91884. });
  91885. }
  91886. var themeltregex = /<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;
  91887. /* 14.2.7 Theme Part */
  91888. function parse_theme_xml(data, opts) {
  91889. /* 20.1.6.9 theme CT_OfficeStyleSheet */
  91890. if(!data || data.length === 0) return parse_theme_xml(write_theme());
  91891. var t;
  91892. var themes = {};
  91893. /* themeElements CT_BaseStyles */
  91894. if(!(t=data.match(themeltregex))) throw new Error('themeElements not found in theme');
  91895. parse_themeElements(t[0], themes, opts);
  91896. themes.raw = data;
  91897. return themes;
  91898. }
  91899. function write_theme(Themes, opts) {
  91900. if(opts && opts.themeXLSX) return opts.themeXLSX;
  91901. if(Themes && typeof Themes.raw == "string") return Themes.raw;
  91902. var o = [XML_HEADER];
  91903. o[o.length] = '<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">';
  91904. o[o.length] = '<a:themeElements>';
  91905. o[o.length] = '<a:clrScheme name="Office">';
  91906. o[o.length] = '<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>';
  91907. o[o.length] = '<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>';
  91908. o[o.length] = '<a:dk2><a:srgbClr val="1F497D"/></a:dk2>';
  91909. o[o.length] = '<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>';
  91910. o[o.length] = '<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>';
  91911. o[o.length] = '<a:accent2><a:srgbClr val="C0504D"/></a:accent2>';
  91912. o[o.length] = '<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>';
  91913. o[o.length] = '<a:accent4><a:srgbClr val="8064A2"/></a:accent4>';
  91914. o[o.length] = '<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>';
  91915. o[o.length] = '<a:accent6><a:srgbClr val="F79646"/></a:accent6>';
  91916. o[o.length] = '<a:hlink><a:srgbClr val="0000FF"/></a:hlink>';
  91917. o[o.length] = '<a:folHlink><a:srgbClr val="800080"/></a:folHlink>';
  91918. o[o.length] = '</a:clrScheme>';
  91919. o[o.length] = '<a:fontScheme name="Office">';
  91920. o[o.length] = '<a:majorFont>';
  91921. o[o.length] = '<a:latin typeface="Cambria"/>';
  91922. o[o.length] = '<a:ea typeface=""/>';
  91923. o[o.length] = '<a:cs typeface=""/>';
  91924. o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>';
  91925. o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
  91926. o[o.length] = '<a:font script="Hans" typeface="宋体"/>';
  91927. o[o.length] = '<a:font script="Hant" typeface="新細明體"/>';
  91928. o[o.length] = '<a:font script="Arab" typeface="Times New Roman"/>';
  91929. o[o.length] = '<a:font script="Hebr" typeface="Times New Roman"/>';
  91930. o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>';
  91931. o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>';
  91932. o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>';
  91933. o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>';
  91934. o[o.length] = '<a:font script="Khmr" typeface="MoolBoran"/>';
  91935. o[o.length] = '<a:font script="Knda" typeface="Tunga"/>';
  91936. o[o.length] = '<a:font script="Guru" typeface="Raavi"/>';
  91937. o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>';
  91938. o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
  91939. o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
  91940. o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
  91941. o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
  91942. o[o.length] = '<a:font script="Deva" typeface="Mangal"/>';
  91943. o[o.length] = '<a:font script="Telu" typeface="Gautami"/>';
  91944. o[o.length] = '<a:font script="Taml" typeface="Latha"/>';
  91945. o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
  91946. o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>';
  91947. o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>';
  91948. o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
  91949. o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
  91950. o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
  91951. o[o.length] = '<a:font script="Viet" typeface="Times New Roman"/>';
  91952. o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
  91953. o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
  91954. o[o.length] = '</a:majorFont>';
  91955. o[o.length] = '<a:minorFont>';
  91956. o[o.length] = '<a:latin typeface="Calibri"/>';
  91957. o[o.length] = '<a:ea typeface=""/>';
  91958. o[o.length] = '<a:cs typeface=""/>';
  91959. o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>';
  91960. o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
  91961. o[o.length] = '<a:font script="Hans" typeface="宋体"/>';
  91962. o[o.length] = '<a:font script="Hant" typeface="新細明體"/>';
  91963. o[o.length] = '<a:font script="Arab" typeface="Arial"/>';
  91964. o[o.length] = '<a:font script="Hebr" typeface="Arial"/>';
  91965. o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>';
  91966. o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>';
  91967. o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>';
  91968. o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>';
  91969. o[o.length] = '<a:font script="Khmr" typeface="DaunPenh"/>';
  91970. o[o.length] = '<a:font script="Knda" typeface="Tunga"/>';
  91971. o[o.length] = '<a:font script="Guru" typeface="Raavi"/>';
  91972. o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>';
  91973. o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
  91974. o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
  91975. o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
  91976. o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
  91977. o[o.length] = '<a:font script="Deva" typeface="Mangal"/>';
  91978. o[o.length] = '<a:font script="Telu" typeface="Gautami"/>';
  91979. o[o.length] = '<a:font script="Taml" typeface="Latha"/>';
  91980. o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
  91981. o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>';
  91982. o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>';
  91983. o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
  91984. o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
  91985. o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
  91986. o[o.length] = '<a:font script="Viet" typeface="Arial"/>';
  91987. o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
  91988. o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
  91989. o[o.length] = '</a:minorFont>';
  91990. o[o.length] = '</a:fontScheme>';
  91991. o[o.length] = '<a:fmtScheme name="Office">';
  91992. o[o.length] = '<a:fillStyleLst>';
  91993. o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
  91994. o[o.length] = '<a:gradFill rotWithShape="1">';
  91995. o[o.length] = '<a:gsLst>';
  91996. o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
  91997. o[o.length] = '<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
  91998. o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
  91999. o[o.length] = '</a:gsLst>';
  92000. o[o.length] = '<a:lin ang="16200000" scaled="1"/>';
  92001. o[o.length] = '</a:gradFill>';
  92002. o[o.length] = '<a:gradFill rotWithShape="1">';
  92003. o[o.length] = '<a:gsLst>';
  92004. o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>';
  92005. o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
  92006. o[o.length] = '</a:gsLst>';
  92007. o[o.length] = '<a:lin ang="16200000" scaled="0"/>';
  92008. o[o.length] = '</a:gradFill>';
  92009. o[o.length] = '</a:fillStyleLst>';
  92010. o[o.length] = '<a:lnStyleLst>';
  92011. o[o.length] = '<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>';
  92012. o[o.length] = '<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
  92013. o[o.length] = '<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
  92014. o[o.length] = '</a:lnStyleLst>';
  92015. o[o.length] = '<a:effectStyleLst>';
  92016. o[o.length] = '<a:effectStyle>';
  92017. o[o.length] = '<a:effectLst>';
  92018. o[o.length] = '<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>';
  92019. o[o.length] = '</a:effectLst>';
  92020. o[o.length] = '</a:effectStyle>';
  92021. o[o.length] = '<a:effectStyle>';
  92022. o[o.length] = '<a:effectLst>';
  92023. o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
  92024. o[o.length] = '</a:effectLst>';
  92025. o[o.length] = '</a:effectStyle>';
  92026. o[o.length] = '<a:effectStyle>';
  92027. o[o.length] = '<a:effectLst>';
  92028. o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
  92029. o[o.length] = '</a:effectLst>';
  92030. o[o.length] = '<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>';
  92031. o[o.length] = '<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>';
  92032. o[o.length] = '</a:effectStyle>';
  92033. o[o.length] = '</a:effectStyleLst>';
  92034. o[o.length] = '<a:bgFillStyleLst>';
  92035. o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
  92036. o[o.length] = '<a:gradFill rotWithShape="1">';
  92037. o[o.length] = '<a:gsLst>';
  92038. o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
  92039. o[o.length] = '<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
  92040. o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>';
  92041. o[o.length] = '</a:gsLst>';
  92042. o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>';
  92043. o[o.length] = '</a:gradFill>';
  92044. o[o.length] = '<a:gradFill rotWithShape="1">';
  92045. o[o.length] = '<a:gsLst>';
  92046. o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
  92047. o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>';
  92048. o[o.length] = '</a:gsLst>';
  92049. o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>';
  92050. o[o.length] = '</a:gradFill>';
  92051. o[o.length] = '</a:bgFillStyleLst>';
  92052. o[o.length] = '</a:fmtScheme>';
  92053. o[o.length] = '</a:themeElements>';
  92054. o[o.length] = '<a:objectDefaults>';
  92055. o[o.length] = '<a:spDef>';
  92056. o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>';
  92057. o[o.length] = '</a:spDef>';
  92058. o[o.length] = '<a:lnDef>';
  92059. o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>';
  92060. o[o.length] = '</a:lnDef>';
  92061. o[o.length] = '</a:objectDefaults>';
  92062. o[o.length] = '<a:extraClrSchemeLst/>';
  92063. o[o.length] = '</a:theme>';
  92064. return o.join("");
  92065. }
  92066. /* [MS-XLS] 2.4.326 TODO: payload is a zip file */
  92067. function parse_Theme(blob, length, opts) {
  92068. var end = blob.l + length;
  92069. var dwThemeVersion = blob.read_shift(4);
  92070. if(dwThemeVersion === 124226) return;
  92071. if(!opts.cellStyles || !jszip) { blob.l = end; return; }
  92072. var data = blob.slice(blob.l);
  92073. blob.l = end;
  92074. var zip; try { zip = new jszip(data); } catch(e) { return; }
  92075. var themeXML = getzipstr(zip, "theme/theme/theme1.xml", true);
  92076. if(!themeXML) return;
  92077. return parse_theme_xml(themeXML, opts);
  92078. }
  92079. /* 2.5.49 */
  92080. function parse_ColorTheme(blob) { return blob.read_shift(4); }
  92081. /* 2.5.155 */
  92082. function parse_FullColorExt(blob) {
  92083. var o = {};
  92084. o.xclrType = blob.read_shift(2);
  92085. o.nTintShade = blob.read_shift(2);
  92086. switch(o.xclrType) {
  92087. case 0: blob.l += 4; break;
  92088. case 1: o.xclrValue = parse_IcvXF(blob, 4); break;
  92089. case 2: o.xclrValue = parse_LongRGBA(blob, 4); break;
  92090. case 3: o.xclrValue = parse_ColorTheme(blob, 4); break;
  92091. case 4: blob.l += 4; break;
  92092. }
  92093. blob.l += 8;
  92094. return o;
  92095. }
  92096. /* 2.5.164 TODO: read 7 bits*/
  92097. function parse_IcvXF(blob, length) {
  92098. return parsenoop(blob, length);
  92099. }
  92100. /* 2.5.280 */
  92101. function parse_XFExtGradient(blob, length) {
  92102. return parsenoop(blob, length);
  92103. }
  92104. /* [MS-XLS] 2.5.108 */
  92105. function parse_ExtProp(blob) {
  92106. var extType = blob.read_shift(2);
  92107. var cb = blob.read_shift(2) - 4;
  92108. var o = [extType];
  92109. switch(extType) {
  92110. case 0x04: case 0x05: case 0x07: case 0x08:
  92111. case 0x09: case 0x0A: case 0x0B: case 0x0D:
  92112. o[1] = parse_FullColorExt(blob, cb); break;
  92113. case 0x06: o[1] = parse_XFExtGradient(blob, cb); break;
  92114. case 0x0E: case 0x0F: o[1] = blob.read_shift(cb === 1 ? 1 : 2); break;
  92115. default: throw new Error("Unrecognized ExtProp type: " + extType + " " + cb);
  92116. }
  92117. return o;
  92118. }
  92119. /* 2.4.355 */
  92120. function parse_XFExt(blob, length) {
  92121. var end = blob.l + length;
  92122. blob.l += 2;
  92123. var ixfe = blob.read_shift(2);
  92124. blob.l += 2;
  92125. var cexts = blob.read_shift(2);
  92126. var ext = [];
  92127. while(cexts-- > 0) ext.push(parse_ExtProp(blob, end-blob.l));
  92128. return {ixfe:ixfe, ext:ext};
  92129. }
  92130. /* xf is an XF, see parse_XFExt for xfext */
  92131. function update_xfext(xf, xfext) {
  92132. xfext.forEach(function(xfe) {
  92133. switch(xfe[0]) { /* 2.5.108 extPropData */
  92134. case 0x04: break; /* foreground color */
  92135. case 0x05: break; /* background color */
  92136. case 0x06: break; /* gradient fill */
  92137. case 0x07: break; /* top cell border color */
  92138. case 0x08: break; /* bottom cell border color */
  92139. case 0x09: break; /* left cell border color */
  92140. case 0x0a: break; /* right cell border color */
  92141. case 0x0b: break; /* diagonal cell border color */
  92142. case 0x0d: /* text color */
  92143. break;
  92144. case 0x0e: break; /* font scheme */
  92145. case 0x0f: break; /* indentation level */
  92146. }
  92147. });
  92148. }
  92149. /* 18.6 Calculation Chain */
  92150. function parse_cc_xml(data) {
  92151. var d = [];
  92152. if(!data) return d;
  92153. var i = 1;
  92154. (data.match(tagregex)||[]).forEach(function(x) {
  92155. var y = parsexmltag(x);
  92156. switch(y[0]) {
  92157. case '<?xml': break;
  92158. /* 18.6.2 calcChain CT_CalcChain 1 */
  92159. case '<calcChain': case '<calcChain>': case '</calcChain>': break;
  92160. /* 18.6.1 c CT_CalcCell 1 */
  92161. case '<c': delete y[0]; if(y.i) i = y.i; else y.i = i; d.push(y); break;
  92162. }
  92163. });
  92164. return d;
  92165. }
  92166. //function write_cc_xml(data, opts) { }
  92167. /* [MS-XLSB] 2.6.4.1 */
  92168. function parse_BrtCalcChainItem$(data) {
  92169. var out = {};
  92170. out.i = data.read_shift(4);
  92171. var cell = {};
  92172. cell.r = data.read_shift(4);
  92173. cell.c = data.read_shift(4);
  92174. out.r = encode_cell(cell);
  92175. var flags = data.read_shift(1);
  92176. if(flags & 0x2) out.l = '1';
  92177. if(flags & 0x8) out.a = '1';
  92178. return out;
  92179. }
  92180. /* 18.6 Calculation Chain */
  92181. function parse_cc_bin(data, name, opts) {
  92182. var out = [];
  92183. var pass = false;
  92184. recordhopper(data, function hopper_cc(val, R_n, RT) {
  92185. switch(RT) {
  92186. case 0x003F: /* 'BrtCalcChainItem$' */
  92187. out.push(val); break;
  92188. default:
  92189. if((R_n||"").indexOf("Begin") > 0){/* empty */}
  92190. else if((R_n||"").indexOf("End") > 0){/* empty */}
  92191. else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
  92192. }
  92193. });
  92194. return out;
  92195. }
  92196. //function write_cc_bin(data, opts) { }
  92197. /* 18.14 Supplementary Workbook Data */
  92198. function parse_xlink_xml() {
  92199. //var opts = _opts || {};
  92200. //if(opts.WTF) throw "XLSX External Link";
  92201. }
  92202. /* [MS-XLSB] 2.1.7.25 External Link */
  92203. function parse_xlink_bin(data, rel, name, _opts) {
  92204. if(!data) return data;
  92205. var opts = _opts || {};
  92206. var pass = false, end = false;
  92207. recordhopper(data, function xlink_parse(val, R_n, RT) {
  92208. if(end) return;
  92209. switch(RT) {
  92210. case 0x0167: /* 'BrtSupTabs' */
  92211. case 0x016B: /* 'BrtExternTableStart' */
  92212. case 0x016C: /* 'BrtExternTableEnd' */
  92213. case 0x016E: /* 'BrtExternRowHdr' */
  92214. case 0x016F: /* 'BrtExternCellBlank' */
  92215. case 0x0170: /* 'BrtExternCellReal' */
  92216. case 0x0171: /* 'BrtExternCellBool' */
  92217. case 0x0172: /* 'BrtExternCellError' */
  92218. case 0x0173: /* 'BrtExternCellString' */
  92219. case 0x01D8: /* 'BrtExternValueMeta' */
  92220. case 0x0241: /* 'BrtSupNameStart' */
  92221. case 0x0242: /* 'BrtSupNameValueStart' */
  92222. case 0x0243: /* 'BrtSupNameValueEnd' */
  92223. case 0x0244: /* 'BrtSupNameNum' */
  92224. case 0x0245: /* 'BrtSupNameErr' */
  92225. case 0x0246: /* 'BrtSupNameSt' */
  92226. case 0x0247: /* 'BrtSupNameNil' */
  92227. case 0x0248: /* 'BrtSupNameBool' */
  92228. case 0x0249: /* 'BrtSupNameFmla' */
  92229. case 0x024A: /* 'BrtSupNameBits' */
  92230. case 0x024B: /* 'BrtSupNameEnd' */
  92231. break;
  92232. case 0x0023: /* 'BrtFRTBegin' */
  92233. pass = true; break;
  92234. case 0x0024: /* 'BrtFRTEnd' */
  92235. pass = false; break;
  92236. default:
  92237. if((R_n||"").indexOf("Begin") > 0){/* empty */}
  92238. else if((R_n||"").indexOf("End") > 0){/* empty */}
  92239. else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT.toString(16) + " " + R_n);
  92240. }
  92241. }, opts);
  92242. }
  92243. /* 20.5 DrawingML - SpreadsheetML Drawing */
  92244. RELS.IMG = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
  92245. RELS.DRAW = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing";
  92246. /* 20.5.2.35 wsDr CT_Drawing */
  92247. function parse_drawing(data, rels) {
  92248. if(!data) return "??";
  92249. /*
  92250. Chartsheet Drawing:
  92251. - 20.5.2.35 wsDr CT_Drawing
  92252. - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor
  92253. - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame
  92254. - 20.1.2.2.16 graphic CT_GraphicalObject
  92255. - 20.1.2.2.17 graphicData CT_GraphicalObjectData
  92256. - chart reference
  92257. the actual type is based on the URI of the graphicData
  92258. TODO: handle embedded charts and other types of graphics
  92259. */
  92260. var id = (data.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];
  92261. return rels['!id'][id].Target;
  92262. }
  92263. /* L.5.5.2 SpreadsheetML Comments + VML Schema */
  92264. var _shapeid = 1024;
  92265. function write_comments_vml(rId, comments) {
  92266. var csize = [21600, 21600];
  92267. /* L.5.2.1.2 Path Attribute */
  92268. var bbox = ["m0,0l0",csize[1],csize[0],csize[1],csize[0],"0xe"].join(",");
  92269. var o = [
  92270. writextag("xml", null, { 'xmlns:v': XLMLNS.v, 'xmlns:o': XLMLNS.o, 'xmlns:x': XLMLNS.x, 'xmlns:mv': XLMLNS.mv }).replace(/\/>/,">"),
  92271. writextag("o:shapelayout", writextag("o:idmap", null, {'v:ext':"edit", 'data':rId}), {'v:ext':"edit"}),
  92272. writextag("v:shapetype", [
  92273. writextag("v:stroke", null, {joinstyle:"miter"}),
  92274. writextag("v:path", null, {gradientshapeok:"t", 'o:connecttype':"rect"})
  92275. ].join(""), {id:"_x0000_t202", 'o:spt':202, coordsize:csize.join(","),path:bbox})
  92276. ];
  92277. while(_shapeid < rId * 1000) _shapeid += 1000;
  92278. comments.forEach(function(x) {
  92279. var c = decode_cell(x[0]);
  92280. var fillopts = {'color2':"#BEFF82", 'type':"gradient"};
  92281. if(fillopts.type == "gradient") fillopts.angle = "-180";
  92282. var fillparm = fillopts.type == "gradient" ? writextag("o:fill", null, {type:"gradientUnscaled", 'v:ext':"view"}) : null;
  92283. var fillxml = writextag('v:fill', fillparm, fillopts);
  92284. var shadata = ({on:"t", 'obscured':"t"});
  92285. ++_shapeid;
  92286. o = o.concat([
  92287. '<v:shape' + wxt_helper({
  92288. id:'_x0000_s' + _shapeid,
  92289. type:"#_x0000_t202",
  92290. style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10" + (x[1].hidden ? ";visibility:hidden" : "") ,
  92291. fillcolor:"#ECFAD4",
  92292. strokecolor:"#edeaa1"
  92293. }) + '>',
  92294. fillxml,
  92295. writextag("v:shadow", null, shadata),
  92296. writextag("v:path", null, {'o:connecttype':"none"}),
  92297. '<v:textbox><div style="text-align:left"></div></v:textbox>',
  92298. '<x:ClientData ObjectType="Note">',
  92299. '<x:MoveWithCells/>',
  92300. '<x:SizeWithCells/>',
  92301. /* Part 4 19.4.2.3 Anchor (Anchor) */
  92302. writetag('x:Anchor', [c.c+1, 0, c.r+1, 0, c.c+3, 20, c.r+5, 20].join(",")),
  92303. writetag('x:AutoFill', "False"),
  92304. writetag('x:Row', String(c.r)),
  92305. writetag('x:Column', String(c.c)),
  92306. x[1].hidden ? '' : '<x:Visible/>',
  92307. '</x:ClientData>',
  92308. '</v:shape>'
  92309. ]); });
  92310. o.push('</xml>');
  92311. return o.join("");
  92312. }
  92313. RELS.CMNT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
  92314. function sheet_insert_comments(sheet, comments) {
  92315. var dense = Array.isArray(sheet);
  92316. var cell;
  92317. comments.forEach(function(comment) {
  92318. var r = decode_cell(comment.ref);
  92319. if(dense) {
  92320. if(!sheet[r.r]) sheet[r.r] = [];
  92321. cell = sheet[r.r][r.c];
  92322. } else cell = sheet[comment.ref];
  92323. if (!cell) {
  92324. cell = ({t:"z"});
  92325. if(dense) sheet[r.r][r.c] = cell;
  92326. else sheet[comment.ref] = cell;
  92327. var range = safe_decode_range(sheet["!ref"]||"BDWGO1000001:A1");
  92328. if(range.s.r > r.r) range.s.r = r.r;
  92329. if(range.e.r < r.r) range.e.r = r.r;
  92330. if(range.s.c > r.c) range.s.c = r.c;
  92331. if(range.e.c < r.c) range.e.c = r.c;
  92332. var encoded = encode_range(range);
  92333. if (encoded !== sheet["!ref"]) sheet["!ref"] = encoded;
  92334. }
  92335. if (!cell.c) cell.c = [];
  92336. var o = ({a: comment.author, t: comment.t, r: comment.r});
  92337. if(comment.h) o.h = comment.h;
  92338. cell.c.push(o);
  92339. });
  92340. }
  92341. /* 18.7 Comments */
  92342. function parse_comments_xml(data, opts) {
  92343. /* 18.7.6 CT_Comments */
  92344. if(data.match(/<(?:\w+:)?comments *\/>/)) return [];
  92345. var authors = [];
  92346. var commentList = [];
  92347. var authtag = data.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);
  92348. if(authtag && authtag[1]) authtag[1].split(/<\/\w*:?author>/).forEach(function(x) {
  92349. if(x === "" || x.trim() === "") return;
  92350. var a = x.match(/<(?:\w+:)?author[^>]*>(.*)/);
  92351. if(a) authors.push(a[1]);
  92352. });
  92353. var cmnttag = data.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);
  92354. if(cmnttag && cmnttag[1]) cmnttag[1].split(/<\/\w*:?comment>/).forEach(function(x) {
  92355. if(x === "" || x.trim() === "") return;
  92356. var cm = x.match(/<(?:\w+:)?comment[^>]*>/);
  92357. if(!cm) return;
  92358. var y = parsexmltag(cm[0]);
  92359. var comment = ({ author: y.authorId && authors[y.authorId] || "sheetjsghost", ref: y.ref, guid: y.guid });
  92360. var cell = decode_cell(y.ref);
  92361. if(opts.sheetRows && opts.sheetRows <= cell.r) return;
  92362. var textMatch = x.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/);
  92363. var rt = !!textMatch && !!textMatch[1] && parse_si(textMatch[1]) || {r:"",t:"",h:""};
  92364. comment.r = rt.r;
  92365. if(rt.r == "<t></t>") rt.t = rt.h = "";
  92366. comment.t = rt.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
  92367. if(opts.cellHTML) comment.h = rt.h;
  92368. commentList.push(comment);
  92369. });
  92370. return commentList;
  92371. }
  92372. var CMNT_XML_ROOT = writextag('comments', null, { 'xmlns': XMLNS.main[0] });
  92373. function write_comments_xml(data) {
  92374. var o = [XML_HEADER, CMNT_XML_ROOT];
  92375. var iauthor = [];
  92376. o.push("<authors>");
  92377. data.forEach(function(x) { x[1].forEach(function(w) { var a = escapexml(w.a);
  92378. if(iauthor.indexOf(a) > -1) return;
  92379. iauthor.push(a);
  92380. o.push("<author>" + a + "</author>");
  92381. }); });
  92382. o.push("</authors>");
  92383. o.push("<commentList>");
  92384. data.forEach(function(d) {
  92385. d[1].forEach(function(c) {
  92386. /* 18.7.3 CT_Comment */
  92387. o.push('<comment ref="' + d[0] + '" authorId="' + iauthor.indexOf(escapexml(c.a)) + '"><text>');
  92388. o.push(writetag("t", c.t == null ? "" : escapexml(c.t)));
  92389. o.push('</text></comment>');
  92390. });
  92391. });
  92392. o.push("</commentList>");
  92393. if(o.length>2) { o[o.length] = ('</comments>'); o[1]=o[1].replace("/>",">"); }
  92394. return o.join("");
  92395. }
  92396. /* [MS-XLSB] 2.4.28 BrtBeginComment */
  92397. function parse_BrtBeginComment(data) {
  92398. var out = {};
  92399. out.iauthor = data.read_shift(4);
  92400. var rfx = parse_UncheckedRfX(data, 16);
  92401. out.rfx = rfx.s;
  92402. out.ref = encode_cell(rfx.s);
  92403. data.l += 16; /*var guid = parse_GUID(data); */
  92404. return out;
  92405. }
  92406. function write_BrtBeginComment(data, o) {
  92407. if(o == null) o = new_buf(36);
  92408. o.write_shift(4, data[1].iauthor);
  92409. write_UncheckedRfX((data[0]), o);
  92410. o.write_shift(4, 0);
  92411. o.write_shift(4, 0);
  92412. o.write_shift(4, 0);
  92413. o.write_shift(4, 0);
  92414. return o;
  92415. }
  92416. /* [MS-XLSB] 2.4.327 BrtCommentAuthor */
  92417. var parse_BrtCommentAuthor = parse_XLWideString;
  92418. function write_BrtCommentAuthor(data) { return write_XLWideString(data.slice(0, 54)); }
  92419. /* [MS-XLSB] 2.1.7.8 Comments */
  92420. function parse_comments_bin(data, opts) {
  92421. var out = [];
  92422. var authors = [];
  92423. var c = {};
  92424. var pass = false;
  92425. recordhopper(data, function hopper_cmnt(val, R_n, RT) {
  92426. switch(RT) {
  92427. case 0x0278: /* 'BrtCommentAuthor' */
  92428. authors.push(val); break;
  92429. case 0x027B: /* 'BrtBeginComment' */
  92430. c = val; break;
  92431. case 0x027D: /* 'BrtCommentText' */
  92432. c.t = val.t; c.h = val.h; c.r = val.r; break;
  92433. case 0x027C: /* 'BrtEndComment' */
  92434. c.author = authors[c.iauthor];
  92435. delete (c).iauthor;
  92436. if(opts.sheetRows && c.rfx && opts.sheetRows <= c.rfx.r) break;
  92437. if(!c.t) c.t = "";
  92438. delete c.rfx; out.push(c); break;
  92439. case 0x0C00: /* 'BrtUid' */
  92440. break;
  92441. case 0x0023: /* 'BrtFRTBegin' */
  92442. pass = true; break;
  92443. case 0x0024: /* 'BrtFRTEnd' */
  92444. pass = false; break;
  92445. case 0x0025: /* 'BrtACBegin' */ break;
  92446. case 0x0026: /* 'BrtACEnd' */ break;
  92447. default:
  92448. if((R_n||"").indexOf("Begin") > 0){/* empty */}
  92449. else if((R_n||"").indexOf("End") > 0){/* empty */}
  92450. else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
  92451. }
  92452. });
  92453. return out;
  92454. }
  92455. function write_comments_bin(data) {
  92456. var ba = buf_array();
  92457. var iauthor = [];
  92458. write_record(ba, "BrtBeginComments");
  92459. write_record(ba, "BrtBeginCommentAuthors");
  92460. data.forEach(function(comment) {
  92461. comment[1].forEach(function(c) {
  92462. if(iauthor.indexOf(c.a) > -1) return;
  92463. iauthor.push(c.a.slice(0,54));
  92464. write_record(ba, "BrtCommentAuthor", write_BrtCommentAuthor(c.a));
  92465. });
  92466. });
  92467. write_record(ba, "BrtEndCommentAuthors");
  92468. write_record(ba, "BrtBeginCommentList");
  92469. data.forEach(function(comment) {
  92470. comment[1].forEach(function(c) {
  92471. c.iauthor = iauthor.indexOf(c.a);
  92472. var range = {s:decode_cell(comment[0]),e:decode_cell(comment[0])};
  92473. write_record(ba, "BrtBeginComment", write_BrtBeginComment([range, c]));
  92474. if(c.t && c.t.length > 0) write_record(ba, "BrtCommentText", write_BrtCommentText(c));
  92475. write_record(ba, "BrtEndComment");
  92476. delete c.iauthor;
  92477. });
  92478. });
  92479. write_record(ba, "BrtEndCommentList");
  92480. write_record(ba, "BrtEndComments");
  92481. return ba.end();
  92482. }
  92483. var CT_VBA = "application/vnd.ms-office.vbaProject";
  92484. function make_vba_xls(cfb) {
  92485. var newcfb = CFB.utils.cfb_new({root:"R"});
  92486. cfb.FullPaths.forEach(function(p, i) {
  92487. if(p.slice(-1) === "/" || !p.match(/_VBA_PROJECT_CUR/)) return;
  92488. var newpath = p.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/, "");
  92489. CFB.utils.cfb_add(newcfb, newpath, cfb.FileIndex[i].content);
  92490. });
  92491. return CFB.write(newcfb);
  92492. }
  92493. function fill_vba_xls(cfb, vba) {
  92494. vba.FullPaths.forEach(function(p, i) {
  92495. if(i == 0) return;
  92496. var newpath = p.replace(/[^\/]*[\/]/, "/_VBA_PROJECT_CUR/");
  92497. if(newpath.slice(-1) !== "/") CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i].content);
  92498. });
  92499. }
  92500. var VBAFMTS = [ "xlsb", "xlsm", "xlam", "biff8", "xla" ];
  92501. RELS.DS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet";
  92502. RELS.MS = "http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet";
  92503. /* macro and dialog sheet stubs */
  92504. function parse_ds_bin() { return {'!type':'dialog'}; }
  92505. function parse_ds_xml() { return {'!type':'dialog'}; }
  92506. function parse_ms_bin() { return {'!type':'macro'}; }
  92507. function parse_ms_xml() { return {'!type':'macro'}; }
  92508. /* TODO: it will be useful to parse the function str */
  92509. var rc_to_a1 = (function(){
  92510. var rcregex = /(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g;
  92511. var rcbase = ({r:0,c:0});
  92512. function rcfunc($$,$1,$2,$3) {
  92513. var cRel = false, rRel = false;
  92514. if($2.length == 0) rRel = true;
  92515. else if($2.charAt(0) == "[") { rRel = true; $2 = $2.slice(1, -1); }
  92516. if($3.length == 0) cRel = true;
  92517. else if($3.charAt(0) == "[") { cRel = true; $3 = $3.slice(1, -1); }
  92518. var R = $2.length>0?parseInt($2,10)|0:0, C = $3.length>0?parseInt($3,10)|0:0;
  92519. if(cRel) C += rcbase.c; else --C;
  92520. if(rRel) R += rcbase.r; else --R;
  92521. return $1 + (cRel ? "" : "$") + encode_col(C) + (rRel ? "" : "$") + encode_row(R);
  92522. }
  92523. return function rc_to_a1(fstr, base) {
  92524. rcbase = base;
  92525. return fstr.replace(rcregex, rcfunc);
  92526. };
  92527. })();
  92528. var crefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)([1-9]\d{0,5}|10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6])(?![_.\(A-Za-z0-9])/g;
  92529. var a1_to_rc =(function(){
  92530. return function a1_to_rc(fstr, base) {
  92531. return fstr.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
  92532. var c = decode_col($3) - ($2 ? 0 : base.c);
  92533. var r = decode_row($5) - ($4 ? 0 : base.r);
  92534. var R = (r == 0 ? "" : !$4 ? "[" + r + "]" : (r+1));
  92535. var C = (c == 0 ? "" : !$2 ? "[" + c + "]" : (c+1));
  92536. return $1 + "R" + R + "C" + C;
  92537. });
  92538. };
  92539. })();
  92540. /* no defined name can collide with a valid cell address A1:XFD1048576 ... except LOG10! */
  92541. function shift_formula_str(f, delta) {
  92542. return f.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
  92543. return $1+($2=="$" ? $2+$3 : encode_col(decode_col($3)+delta.c))+($4=="$" ? $4+$5 : encode_row(decode_row($5) + delta.r));
  92544. });
  92545. }
  92546. function shift_formula_xlsx(f, range, cell) {
  92547. var r = decode_range(range), s = r.s, c = decode_cell(cell);
  92548. var delta = {r:c.r - s.r, c:c.c - s.c};
  92549. return shift_formula_str(f, delta);
  92550. }
  92551. /* TODO: parse formula */
  92552. function fuzzyfmla(f) {
  92553. if(f.length == 1) return false;
  92554. return true;
  92555. }
  92556. function _xlfn(f) {
  92557. return f.replace(/_xlfn\./g,"");
  92558. }
  92559. function parseread1(blob) { blob.l+=1; return; }
  92560. /* [MS-XLS] 2.5.51 */
  92561. function parse_ColRelU(blob, length) {
  92562. var c = blob.read_shift(length == 1 ? 1 : 2);
  92563. return [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];
  92564. }
  92565. /* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.89 */
  92566. function parse_RgceArea(blob, length, opts) {
  92567. var w = 2;
  92568. if(opts) {
  92569. if(opts.biff >= 2 && opts.biff <= 5) return parse_RgceArea_BIFF2(blob, length, opts);
  92570. else if(opts.biff == 12) w = 4;
  92571. }
  92572. var r=blob.read_shift(w), R=blob.read_shift(w);
  92573. var c=parse_ColRelU(blob, 2);
  92574. var C=parse_ColRelU(blob, 2);
  92575. return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };
  92576. }
  92577. /* BIFF 2-5 encodes flags in the row field */
  92578. function parse_RgceArea_BIFF2(blob) {
  92579. var r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);
  92580. var c=blob.read_shift(1);
  92581. var C=blob.read_shift(1);
  92582. return { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };
  92583. }
  92584. /* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.90 */
  92585. function parse_RgceAreaRel(blob, length, opts) {
  92586. if(opts.biff < 8) return parse_RgceArea_BIFF2(blob, length, opts);
  92587. var r=blob.read_shift(opts.biff == 12 ? 4 : 2), R=blob.read_shift(opts.biff == 12 ? 4 : 2);
  92588. var c=parse_ColRelU(blob, 2);
  92589. var C=parse_ColRelU(blob, 2);
  92590. return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };
  92591. }
  92592. /* [MS-XLS] 2.5.198.109 ; [MS-XLSB] 2.5.97.91 */
  92593. function parse_RgceLoc(blob, length, opts) {
  92594. if(opts && opts.biff >= 2 && opts.biff <= 5) return parse_RgceLoc_BIFF2(blob, length, opts);
  92595. var r = blob.read_shift(opts && opts.biff == 12 ? 4 : 2);
  92596. var c = parse_ColRelU(blob, 2);
  92597. return {r:r, c:c[0], cRel:c[1], rRel:c[2]};
  92598. }
  92599. function parse_RgceLoc_BIFF2(blob) {
  92600. var r = parse_ColRelU(blob, 2);
  92601. var c = blob.read_shift(1);
  92602. return {r:r[0], c:c, cRel:r[1], rRel:r[2]};
  92603. }
  92604. /* [MS-XLS] 2.5.198.107, 2.5.47 */
  92605. function parse_RgceElfLoc(blob) {
  92606. var r = blob.read_shift(2);
  92607. var c = blob.read_shift(2);
  92608. return {r:r, c:c & 0xFF, fQuoted:!!(c & 0x4000), cRel:c>>15, rRel:c>>15 };
  92609. }
  92610. /* [MS-XLS] 2.5.198.111 ; [MS-XLSB] 2.5.97.92 TODO */
  92611. function parse_RgceLocRel(blob, length, opts) {
  92612. var biff = opts && opts.biff ? opts.biff : 8;
  92613. if(biff >= 2 && biff <= 5) return parse_RgceLocRel_BIFF2(blob, length, opts);
  92614. var r = blob.read_shift(biff >= 12 ? 4 : 2);
  92615. var cl = blob.read_shift(2);
  92616. var cRel = (cl & 0x4000) >> 14, rRel = (cl & 0x8000) >> 15;
  92617. cl &= 0x3FFF;
  92618. if(rRel == 1) while(r > 0x7FFFF) r -= 0x100000;
  92619. if(cRel == 1) while(cl > 0x1FFF) cl = cl - 0x4000;
  92620. return {r:r,c:cl,cRel:cRel,rRel:rRel};
  92621. }
  92622. function parse_RgceLocRel_BIFF2(blob) {
  92623. var rl = blob.read_shift(2);
  92624. var c = blob.read_shift(1);
  92625. var rRel = (rl & 0x8000) >> 15, cRel = (rl & 0x4000) >> 14;
  92626. rl &= 0x3FFF;
  92627. if(rRel == 1 && rl >= 0x2000) rl = rl - 0x4000;
  92628. if(cRel == 1 && c >= 0x80) c = c - 0x100;
  92629. return {r:rl,c:c,cRel:cRel,rRel:rRel};
  92630. }
  92631. /* [MS-XLS] 2.5.198.27 ; [MS-XLSB] 2.5.97.18 */
  92632. function parse_PtgArea(blob, length, opts) {
  92633. var type = (blob[blob.l++] & 0x60) >> 5;
  92634. var area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts);
  92635. return [type, area];
  92636. }
  92637. /* [MS-XLS] 2.5.198.28 ; [MS-XLSB] 2.5.97.19 */
  92638. function parse_PtgArea3d(blob, length, opts) {
  92639. var type = (blob[blob.l++] & 0x60) >> 5;
  92640. var ixti = blob.read_shift(2, 'i');
  92641. var w = 8;
  92642. if(opts) switch(opts.biff) {
  92643. case 5: blob.l += 12; w = 6; break;
  92644. case 12: w = 12; break;
  92645. }
  92646. var area = parse_RgceArea(blob, w, opts);
  92647. return [type, ixti, area];
  92648. }
  92649. /* [MS-XLS] 2.5.198.29 ; [MS-XLSB] 2.5.97.20 */
  92650. function parse_PtgAreaErr(blob, length, opts) {
  92651. var type = (blob[blob.l++] & 0x60) >> 5;
  92652. blob.l += opts && (opts.biff > 8) ? 12 : (opts.biff < 8 ? 6 : 8);
  92653. return [type];
  92654. }
  92655. /* [MS-XLS] 2.5.198.30 ; [MS-XLSB] 2.5.97.21 */
  92656. function parse_PtgAreaErr3d(blob, length, opts) {
  92657. var type = (blob[blob.l++] & 0x60) >> 5;
  92658. var ixti = blob.read_shift(2);
  92659. var w = 8;
  92660. if(opts) switch(opts.biff) {
  92661. case 5: blob.l += 12; w = 6; break;
  92662. case 12: w = 12; break;
  92663. }
  92664. blob.l += w;
  92665. return [type, ixti];
  92666. }
  92667. /* [MS-XLS] 2.5.198.31 ; [MS-XLSB] 2.5.97.22 */
  92668. function parse_PtgAreaN(blob, length, opts) {
  92669. var type = (blob[blob.l++] & 0x60) >> 5;
  92670. var area = parse_RgceAreaRel(blob, length - 1, opts);
  92671. return [type, area];
  92672. }
  92673. /* [MS-XLS] 2.5.198.32 ; [MS-XLSB] 2.5.97.23 */
  92674. function parse_PtgArray(blob, length, opts) {
  92675. var type = (blob[blob.l++] & 0x60) >> 5;
  92676. blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;
  92677. return [type];
  92678. }
  92679. /* [MS-XLS] 2.5.198.33 ; [MS-XLSB] 2.5.97.24 */
  92680. function parse_PtgAttrBaxcel(blob) {
  92681. var bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */
  92682. var bitBaxcel = 1;
  92683. blob.l += 4;
  92684. return [bitSemi, bitBaxcel];
  92685. }
  92686. /* [MS-XLS] 2.5.198.34 ; [MS-XLSB] 2.5.97.25 */
  92687. function parse_PtgAttrChoose(blob, length, opts) {
  92688. blob.l +=2;
  92689. var offset = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
  92690. var o = [];
  92691. /* offset is 1 less than the number of elements */
  92692. for(var i = 0; i <= offset; ++i) o.push(blob.read_shift(opts && opts.biff == 2 ? 1 : 2));
  92693. return o;
  92694. }
  92695. /* [MS-XLS] 2.5.198.35 ; [MS-XLSB] 2.5.97.26 */
  92696. function parse_PtgAttrGoto(blob, length, opts) {
  92697. var bitGoto = (blob[blob.l+1] & 0xFF) ? 1 : 0;
  92698. blob.l += 2;
  92699. return [bitGoto, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
  92700. }
  92701. /* [MS-XLS] 2.5.198.36 ; [MS-XLSB] 2.5.97.27 */
  92702. function parse_PtgAttrIf(blob, length, opts) {
  92703. var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;
  92704. blob.l += 2;
  92705. return [bitIf, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
  92706. }
  92707. /* [MS-XLSB] 2.5.97.28 */
  92708. function parse_PtgAttrIfError(blob) {
  92709. var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;
  92710. blob.l += 2;
  92711. return [bitIf, blob.read_shift(2)];
  92712. }
  92713. /* [MS-XLS] 2.5.198.37 ; [MS-XLSB] 2.5.97.29 */
  92714. function parse_PtgAttrSemi(blob, length, opts) {
  92715. var bitSemi = (blob[blob.l+1] & 0xFF) ? 1 : 0;
  92716. blob.l += opts && opts.biff == 2 ? 3 : 4;
  92717. return [bitSemi];
  92718. }
  92719. /* [MS-XLS] 2.5.198.40 ; [MS-XLSB] 2.5.97.32 */
  92720. function parse_PtgAttrSpaceType(blob) {
  92721. var type = blob.read_shift(1), cch = blob.read_shift(1);
  92722. return [type, cch];
  92723. }
  92724. /* [MS-XLS] 2.5.198.38 ; [MS-XLSB] 2.5.97.30 */
  92725. function parse_PtgAttrSpace(blob) {
  92726. blob.read_shift(2);
  92727. return parse_PtgAttrSpaceType(blob, 2);
  92728. }
  92729. /* [MS-XLS] 2.5.198.39 ; [MS-XLSB] 2.5.97.31 */
  92730. function parse_PtgAttrSpaceSemi(blob) {
  92731. blob.read_shift(2);
  92732. return parse_PtgAttrSpaceType(blob, 2);
  92733. }
  92734. /* [MS-XLS] 2.5.198.84 ; [MS-XLSB] 2.5.97.68 TODO */
  92735. function parse_PtgRef(blob, length, opts) {
  92736. //var ptg = blob[blob.l] & 0x1F;
  92737. var type = (blob[blob.l] & 0x60)>>5;
  92738. blob.l += 1;
  92739. var loc = parse_RgceLoc(blob, 0, opts);
  92740. return [type, loc];
  92741. }
  92742. /* [MS-XLS] 2.5.198.88 ; [MS-XLSB] 2.5.97.72 TODO */
  92743. function parse_PtgRefN(blob, length, opts) {
  92744. var type = (blob[blob.l] & 0x60)>>5;
  92745. blob.l += 1;
  92746. var loc = parse_RgceLocRel(blob, 0, opts);
  92747. return [type, loc];
  92748. }
  92749. /* [MS-XLS] 2.5.198.85 ; [MS-XLSB] 2.5.97.69 TODO */
  92750. function parse_PtgRef3d(blob, length, opts) {
  92751. var type = (blob[blob.l] & 0x60)>>5;
  92752. blob.l += 1;
  92753. var ixti = blob.read_shift(2); // XtiIndex
  92754. if(opts && opts.biff == 5) blob.l += 12;
  92755. var loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel
  92756. return [type, ixti, loc];
  92757. }
  92758. /* [MS-XLS] 2.5.198.62 ; [MS-XLSB] 2.5.97.45 TODO */
  92759. function parse_PtgFunc(blob, length, opts) {
  92760. //var ptg = blob[blob.l] & 0x1F;
  92761. var type = (blob[blob.l] & 0x60)>>5;
  92762. blob.l += 1;
  92763. var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);
  92764. return [FtabArgc[iftab], Ftab[iftab], type];
  92765. }
  92766. /* [MS-XLS] 2.5.198.63 ; [MS-XLSB] 2.5.97.46 TODO */
  92767. function parse_PtgFuncVar(blob, length, opts) {
  92768. var type = blob[blob.l++];
  92769. var cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [(type == 0x58 ? -1 : 0), blob.read_shift(1)]: parsetab(blob);
  92770. return [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];
  92771. }
  92772. function parsetab(blob) {
  92773. return [blob[blob.l+1]>>7, blob.read_shift(2) & 0x7FFF];
  92774. }
  92775. /* [MS-XLS] 2.5.198.41 ; [MS-XLSB] 2.5.97.33 */
  92776. function parse_PtgAttrSum(blob, length, opts) {
  92777. blob.l += opts && opts.biff == 2 ? 3 : 4; return;
  92778. }
  92779. /* [MS-XLS] 2.5.198.58 ; [MS-XLSB] 2.5.97.40 */
  92780. function parse_PtgExp(blob, length, opts) {
  92781. blob.l++;
  92782. if(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];
  92783. var row = blob.read_shift(2);
  92784. var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
  92785. return [row, col];
  92786. }
  92787. /* [MS-XLS] 2.5.198.57 ; [MS-XLSB] 2.5.97.39 */
  92788. function parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; }
  92789. /* [MS-XLS] 2.5.198.66 ; [MS-XLSB] 2.5.97.49 */
  92790. function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }
  92791. /* [MS-XLS] 2.5.198.42 ; [MS-XLSB] 2.5.97.34 */
  92792. function parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;}
  92793. /* [MS-XLS] 2.5.198.79 ; [MS-XLSB] 2.5.97.63 */
  92794. function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }
  92795. /* [MS-XLS] 2.5.198.89 ; [MS-XLSB] 2.5.97.74 */
  92796. function parse_PtgStr(blob, length, opts) { blob.l++; return parse_ShortXLUnicodeString(blob, length-1, opts); }
  92797. /* [MS-XLS] 2.5.192.112 + 2.5.192.11{3,4,5,6,7} */
  92798. /* [MS-XLSB] 2.5.97.93 + 2.5.97.9{4,5,6,7} */
  92799. function parse_SerAr(blob, biff) {
  92800. var val = [blob.read_shift(1)];
  92801. if(biff == 12) switch(val[0]) {
  92802. case 0x02: val[0] = 0x04; break; /* SerBool */
  92803. case 0x04: val[0] = 0x10; break; /* SerErr */
  92804. case 0x00: val[0] = 0x01; break; /* SerNum */
  92805. case 0x01: val[0] = 0x02; break; /* SerStr */
  92806. }
  92807. switch(val[0]) {
  92808. case 0x04: /* SerBool -- boolean */
  92809. val[1] = parsebool(blob, 1) ? 'TRUE' : 'FALSE';
  92810. if(biff != 12) blob.l += 7; break;
  92811. case 0x25: /* appears to be an alias */
  92812. case 0x10: /* SerErr -- error */
  92813. val[1] = BErr[blob[blob.l]];
  92814. blob.l += ((biff == 12) ? 4 : 8); break;
  92815. case 0x00: /* SerNil -- honestly, I'm not sure how to reproduce this */
  92816. blob.l += 8; break;
  92817. case 0x01: /* SerNum -- Xnum */
  92818. val[1] = parse_Xnum(blob, 8); break;
  92819. case 0x02: /* SerStr -- XLUnicodeString (<256 chars) */
  92820. val[1] = parse_XLUnicodeString2(blob, 0, {biff:biff > 0 && biff < 8 ? 2 : biff}); break;
  92821. default: throw new Error("Bad SerAr: " + val[0]); /* Unreachable */
  92822. }
  92823. return val;
  92824. }
  92825. /* [MS-XLS] 2.5.198.61 ; [MS-XLSB] 2.5.97.44 */
  92826. function parse_PtgExtraMem(blob, cce, opts) {
  92827. var count = blob.read_shift((opts.biff == 12) ? 4 : 2);
  92828. var out = [];
  92829. for(var i = 0; i != count; ++i) out.push(((opts.biff == 12) ? parse_UncheckedRfX : parse_Ref8U)(blob, 8));
  92830. return out;
  92831. }
  92832. /* [MS-XLS] 2.5.198.59 ; [MS-XLSB] 2.5.97.41 */
  92833. function parse_PtgExtraArray(blob, length, opts) {
  92834. var rows = 0, cols = 0;
  92835. if(opts.biff == 12) {
  92836. rows = blob.read_shift(4); // DRw
  92837. cols = blob.read_shift(4); // DCol
  92838. } else {
  92839. cols = 1 + blob.read_shift(1); //DColByteU
  92840. rows = 1 + blob.read_shift(2); //DRw
  92841. }
  92842. if(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }
  92843. // $FlowIgnore
  92844. for(var i = 0, o = []; i != rows && (o[i] = []); ++i)
  92845. for(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);
  92846. return o;
  92847. }
  92848. /* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 */
  92849. function parse_PtgName(blob, length, opts) {
  92850. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92851. var w = (!opts || (opts.biff >= 8)) ? 4 : 2;
  92852. var nameindex = blob.read_shift(w);
  92853. switch(opts.biff) {
  92854. case 2: blob.l += 5; break;
  92855. case 3: case 4: blob.l += 8; break;
  92856. case 5: blob.l += 12; break;
  92857. }
  92858. return [type, 0, nameindex];
  92859. }
  92860. /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 */
  92861. function parse_PtgNameX(blob, length, opts) {
  92862. if(opts.biff == 5) return parse_PtgNameX_BIFF5(blob, length, opts);
  92863. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92864. var ixti = blob.read_shift(2); // XtiIndex
  92865. var nameindex = blob.read_shift(4);
  92866. return [type, ixti, nameindex];
  92867. }
  92868. function parse_PtgNameX_BIFF5(blob) {
  92869. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92870. var ixti = blob.read_shift(2, 'i'); // XtiIndex
  92871. blob.l += 8;
  92872. var nameindex = blob.read_shift(2);
  92873. blob.l += 12;
  92874. return [type, ixti, nameindex];
  92875. }
  92876. /* [MS-XLS] 2.5.198.70 ; [MS-XLSB] 2.5.97.54 */
  92877. function parse_PtgMemArea(blob, length, opts) {
  92878. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92879. blob.l += (opts && opts.biff == 2 ? 3 : 4);
  92880. var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
  92881. return [type, cce];
  92882. }
  92883. /* [MS-XLS] 2.5.198.72 ; [MS-XLSB] 2.5.97.56 */
  92884. function parse_PtgMemFunc(blob, length, opts) {
  92885. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92886. var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
  92887. return [type, cce];
  92888. }
  92889. /* [MS-XLS] 2.5.198.86 ; [MS-XLSB] 2.5.97.69 */
  92890. function parse_PtgRefErr(blob, length, opts) {
  92891. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92892. blob.l += 4;
  92893. if(opts.biff < 8) blob.l--;
  92894. if(opts.biff == 12) blob.l += 2;
  92895. return [type];
  92896. }
  92897. /* [MS-XLS] 2.5.198.87 ; [MS-XLSB] 2.5.97.71 */
  92898. function parse_PtgRefErr3d(blob, length, opts) {
  92899. var type = (blob[blob.l++] & 0x60) >> 5;
  92900. var ixti = blob.read_shift(2);
  92901. var w = 4;
  92902. if(opts) switch(opts.biff) {
  92903. case 5: w = 15; break;
  92904. case 12: w = 6; break;
  92905. }
  92906. blob.l += w;
  92907. return [type, ixti];
  92908. }
  92909. /* [MS-XLS] 2.5.198.71 ; [MS-XLSB] 2.5.97.55 */
  92910. var parse_PtgMemErr = parsenoop;
  92911. /* [MS-XLS] 2.5.198.73 ; [MS-XLSB] 2.5.97.57 */
  92912. var parse_PtgMemNoMem = parsenoop;
  92913. /* [MS-XLS] 2.5.198.92 */
  92914. var parse_PtgTbl = parsenoop;
  92915. function parse_PtgElfLoc(blob, length, opts) {
  92916. blob.l += 2;
  92917. return [parse_RgceElfLoc(blob, 4, opts)];
  92918. }
  92919. function parse_PtgElfNoop(blob) {
  92920. blob.l += 6;
  92921. return [];
  92922. }
  92923. /* [MS-XLS] 2.5.198.46 */
  92924. var parse_PtgElfCol = parse_PtgElfLoc;
  92925. /* [MS-XLS] 2.5.198.47 */
  92926. var parse_PtgElfColS = parse_PtgElfNoop;
  92927. /* [MS-XLS] 2.5.198.48 */
  92928. var parse_PtgElfColSV = parse_PtgElfNoop;
  92929. /* [MS-XLS] 2.5.198.49 */
  92930. var parse_PtgElfColV = parse_PtgElfLoc;
  92931. /* [MS-XLS] 2.5.198.50 */
  92932. function parse_PtgElfLel(blob) {
  92933. blob.l += 2;
  92934. return [parseuint16(blob), blob.read_shift(2) & 0x01];
  92935. }
  92936. /* [MS-XLS] 2.5.198.51 */
  92937. var parse_PtgElfRadical = parse_PtgElfLoc;
  92938. /* [MS-XLS] 2.5.198.52 */
  92939. var parse_PtgElfRadicalLel = parse_PtgElfLel;
  92940. /* [MS-XLS] 2.5.198.53 */
  92941. var parse_PtgElfRadicalS = parse_PtgElfNoop;
  92942. /* [MS-XLS] 2.5.198.54 */
  92943. var parse_PtgElfRw = parse_PtgElfLoc;
  92944. /* [MS-XLS] 2.5.198.55 */
  92945. var parse_PtgElfRwV = parse_PtgElfLoc;
  92946. /* [MS-XLSB] 2.5.97.52 TODO */
  92947. var PtgListRT = [
  92948. "Data",
  92949. "All",
  92950. "Headers",
  92951. "??",
  92952. "?Data2",
  92953. "??",
  92954. "?DataHeaders",
  92955. "??",
  92956. "Totals",
  92957. "??",
  92958. "??",
  92959. "??",
  92960. "?DataTotals",
  92961. "??",
  92962. "??",
  92963. "??",
  92964. "?Current"
  92965. ];
  92966. function parse_PtgList(blob) {
  92967. blob.l += 2;
  92968. var ixti = blob.read_shift(2);
  92969. var flags = blob.read_shift(2);
  92970. var idx = blob.read_shift(4);
  92971. var c = blob.read_shift(2);
  92972. var C = blob.read_shift(2);
  92973. var rt = PtgListRT[(flags >> 2) & 0x1F];
  92974. return {ixti: ixti, coltype:(flags&0x3), rt:rt, idx:idx, c:c, C:C};
  92975. }
  92976. /* [MS-XLS] 2.5.198.91 ; [MS-XLSB] 2.5.97.76 */
  92977. function parse_PtgSxName(blob) {
  92978. blob.l += 2;
  92979. return [blob.read_shift(4)];
  92980. }
  92981. /* [XLS] old spec */
  92982. function parse_PtgSheet(blob, length, opts) {
  92983. blob.l += 5;
  92984. blob.l += 2;
  92985. blob.l += (opts.biff == 2 ? 1 : 4);
  92986. return ["PTGSHEET"];
  92987. }
  92988. function parse_PtgEndSheet(blob, length, opts) {
  92989. blob.l += (opts.biff == 2 ? 4 : 5);
  92990. return ["PTGENDSHEET"];
  92991. }
  92992. function parse_PtgMemAreaN(blob) {
  92993. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92994. var cce = blob.read_shift(2);
  92995. return [type, cce];
  92996. }
  92997. function parse_PtgMemNoMemN(blob) {
  92998. var type = (blob.read_shift(1) >>> 5) & 0x03;
  92999. var cce = blob.read_shift(2);
  93000. return [type, cce];
  93001. }
  93002. function parse_PtgAttrNoop(blob) {
  93003. blob.l += 4;
  93004. return [0, 0];
  93005. }
  93006. /* [MS-XLS] 2.5.198.25 ; [MS-XLSB] 2.5.97.16 */
  93007. var PtgTypes = {
  93008. 0x01: { n:'PtgExp', f:parse_PtgExp },
  93009. 0x02: { n:'PtgTbl', f:parse_PtgTbl },
  93010. 0x03: { n:'PtgAdd', f:parseread1 },
  93011. 0x04: { n:'PtgSub', f:parseread1 },
  93012. 0x05: { n:'PtgMul', f:parseread1 },
  93013. 0x06: { n:'PtgDiv', f:parseread1 },
  93014. 0x07: { n:'PtgPower', f:parseread1 },
  93015. 0x08: { n:'PtgConcat', f:parseread1 },
  93016. 0x09: { n:'PtgLt', f:parseread1 },
  93017. 0x0A: { n:'PtgLe', f:parseread1 },
  93018. 0x0B: { n:'PtgEq', f:parseread1 },
  93019. 0x0C: { n:'PtgGe', f:parseread1 },
  93020. 0x0D: { n:'PtgGt', f:parseread1 },
  93021. 0x0E: { n:'PtgNe', f:parseread1 },
  93022. 0x0F: { n:'PtgIsect', f:parseread1 },
  93023. 0x10: { n:'PtgUnion', f:parseread1 },
  93024. 0x11: { n:'PtgRange', f:parseread1 },
  93025. 0x12: { n:'PtgUplus', f:parseread1 },
  93026. 0x13: { n:'PtgUminus', f:parseread1 },
  93027. 0x14: { n:'PtgPercent', f:parseread1 },
  93028. 0x15: { n:'PtgParen', f:parseread1 },
  93029. 0x16: { n:'PtgMissArg', f:parseread1 },
  93030. 0x17: { n:'PtgStr', f:parse_PtgStr },
  93031. 0x1A: { n:'PtgSheet', f:parse_PtgSheet },
  93032. 0x1B: { n:'PtgEndSheet', f:parse_PtgEndSheet },
  93033. 0x1C: { n:'PtgErr', f:parse_PtgErr },
  93034. 0x1D: { n:'PtgBool', f:parse_PtgBool },
  93035. 0x1E: { n:'PtgInt', f:parse_PtgInt },
  93036. 0x1F: { n:'PtgNum', f:parse_PtgNum },
  93037. 0x20: { n:'PtgArray', f:parse_PtgArray },
  93038. 0x21: { n:'PtgFunc', f:parse_PtgFunc },
  93039. 0x22: { n:'PtgFuncVar', f:parse_PtgFuncVar },
  93040. 0x23: { n:'PtgName', f:parse_PtgName },
  93041. 0x24: { n:'PtgRef', f:parse_PtgRef },
  93042. 0x25: { n:'PtgArea', f:parse_PtgArea },
  93043. 0x26: { n:'PtgMemArea', f:parse_PtgMemArea },
  93044. 0x27: { n:'PtgMemErr', f:parse_PtgMemErr },
  93045. 0x28: { n:'PtgMemNoMem', f:parse_PtgMemNoMem },
  93046. 0x29: { n:'PtgMemFunc', f:parse_PtgMemFunc },
  93047. 0x2A: { n:'PtgRefErr', f:parse_PtgRefErr },
  93048. 0x2B: { n:'PtgAreaErr', f:parse_PtgAreaErr },
  93049. 0x2C: { n:'PtgRefN', f:parse_PtgRefN },
  93050. 0x2D: { n:'PtgAreaN', f:parse_PtgAreaN },
  93051. 0x2E: { n:'PtgMemAreaN', f:parse_PtgMemAreaN },
  93052. 0x2F: { n:'PtgMemNoMemN', f:parse_PtgMemNoMemN },
  93053. 0x39: { n:'PtgNameX', f:parse_PtgNameX },
  93054. 0x3A: { n:'PtgRef3d', f:parse_PtgRef3d },
  93055. 0x3B: { n:'PtgArea3d', f:parse_PtgArea3d },
  93056. 0x3C: { n:'PtgRefErr3d', f:parse_PtgRefErr3d },
  93057. 0x3D: { n:'PtgAreaErr3d', f:parse_PtgAreaErr3d },
  93058. 0xFF: {}
  93059. };
  93060. /* These are duplicated in the PtgTypes table */
  93061. var PtgDupes = {
  93062. 0x40: 0x20, 0x60: 0x20,
  93063. 0x41: 0x21, 0x61: 0x21,
  93064. 0x42: 0x22, 0x62: 0x22,
  93065. 0x43: 0x23, 0x63: 0x23,
  93066. 0x44: 0x24, 0x64: 0x24,
  93067. 0x45: 0x25, 0x65: 0x25,
  93068. 0x46: 0x26, 0x66: 0x26,
  93069. 0x47: 0x27, 0x67: 0x27,
  93070. 0x48: 0x28, 0x68: 0x28,
  93071. 0x49: 0x29, 0x69: 0x29,
  93072. 0x4A: 0x2A, 0x6A: 0x2A,
  93073. 0x4B: 0x2B, 0x6B: 0x2B,
  93074. 0x4C: 0x2C, 0x6C: 0x2C,
  93075. 0x4D: 0x2D, 0x6D: 0x2D,
  93076. 0x4E: 0x2E, 0x6E: 0x2E,
  93077. 0x4F: 0x2F, 0x6F: 0x2F,
  93078. 0x58: 0x22, 0x78: 0x22,
  93079. 0x59: 0x39, 0x79: 0x39,
  93080. 0x5A: 0x3A, 0x7A: 0x3A,
  93081. 0x5B: 0x3B, 0x7B: 0x3B,
  93082. 0x5C: 0x3C, 0x7C: 0x3C,
  93083. 0x5D: 0x3D, 0x7D: 0x3D
  93084. };
  93085. (function(){for(var y in PtgDupes) PtgTypes[y] = PtgTypes[PtgDupes[y]];})();
  93086. var Ptg18 = {
  93087. 0x01: { n:'PtgElfLel', f:parse_PtgElfLel },
  93088. 0x02: { n:'PtgElfRw', f:parse_PtgElfRw },
  93089. 0x03: { n:'PtgElfCol', f:parse_PtgElfCol },
  93090. 0x06: { n:'PtgElfRwV', f:parse_PtgElfRwV },
  93091. 0x07: { n:'PtgElfColV', f:parse_PtgElfColV },
  93092. 0x0A: { n:'PtgElfRadical', f:parse_PtgElfRadical },
  93093. 0x0B: { n:'PtgElfRadicalS', f:parse_PtgElfRadicalS },
  93094. 0x0D: { n:'PtgElfColS', f:parse_PtgElfColS },
  93095. 0x0F: { n:'PtgElfColSV', f:parse_PtgElfColSV },
  93096. 0x10: { n:'PtgElfRadicalLel', f:parse_PtgElfRadicalLel },
  93097. 0x19: { n:'PtgList', f:parse_PtgList },
  93098. 0x1D: { n:'PtgSxName', f:parse_PtgSxName },
  93099. 0xFF: {}
  93100. };
  93101. var Ptg19 = {
  93102. 0x00: { n:'PtgAttrNoop', f:parse_PtgAttrNoop },
  93103. 0x01: { n:'PtgAttrSemi', f:parse_PtgAttrSemi },
  93104. 0x02: { n:'PtgAttrIf', f:parse_PtgAttrIf },
  93105. 0x04: { n:'PtgAttrChoose', f:parse_PtgAttrChoose },
  93106. 0x08: { n:'PtgAttrGoto', f:parse_PtgAttrGoto },
  93107. 0x10: { n:'PtgAttrSum', f:parse_PtgAttrSum },
  93108. 0x20: { n:'PtgAttrBaxcel', f:parse_PtgAttrBaxcel },
  93109. 0x40: { n:'PtgAttrSpace', f:parse_PtgAttrSpace },
  93110. 0x41: { n:'PtgAttrSpaceSemi', f:parse_PtgAttrSpaceSemi },
  93111. 0x80: { n:'PtgAttrIfError', f:parse_PtgAttrIfError },
  93112. 0xFF: {}
  93113. };
  93114. Ptg19[0x21] = Ptg19[0x20];
  93115. /* [MS-XLS] 2.5.198.103 ; [MS-XLSB] 2.5.97.87 */
  93116. function parse_RgbExtra(blob, length, rgce, opts) {
  93117. if(opts.biff < 8) return parsenoop(blob, length);
  93118. var target = blob.l + length;
  93119. var o = [];
  93120. for(var i = 0; i !== rgce.length; ++i) {
  93121. switch(rgce[i][0]) {
  93122. case 'PtgArray': /* PtgArray -> PtgExtraArray */
  93123. rgce[i][1] = parse_PtgExtraArray(blob, 0, opts);
  93124. o.push(rgce[i][1]);
  93125. break;
  93126. case 'PtgMemArea': /* PtgMemArea -> PtgExtraMem */
  93127. rgce[i][2] = parse_PtgExtraMem(blob, rgce[i][1], opts);
  93128. o.push(rgce[i][2]);
  93129. break;
  93130. case 'PtgExp': /* PtgExp -> PtgExtraCol */
  93131. if(opts && opts.biff == 12) {
  93132. rgce[i][1][1] = blob.read_shift(4);
  93133. o.push(rgce[i][1]);
  93134. } break;
  93135. case 'PtgList': /* TODO: PtgList -> PtgExtraList */
  93136. case 'PtgElfRadicalS': /* TODO: PtgElfRadicalS -> PtgExtraElf */
  93137. case 'PtgElfColS': /* TODO: PtgElfColS -> PtgExtraElf */
  93138. case 'PtgElfColSV': /* TODO: PtgElfColSV -> PtgExtraElf */
  93139. throw "Unsupported " + rgce[i][0];
  93140. default: break;
  93141. }
  93142. }
  93143. length = target - blob.l;
  93144. /* note: this is technically an error but Excel disregards */
  93145. //if(target !== blob.l && blob.l !== target - length) throw new Error(target + " != " + blob.l);
  93146. if(length !== 0) o.push(parsenoop(blob, length));
  93147. return o;
  93148. }
  93149. /* [MS-XLS] 2.5.198.104 ; [MS-XLSB] 2.5.97.88 */
  93150. function parse_Rgce(blob, length, opts) {
  93151. var target = blob.l + length;
  93152. var R, id, ptgs = [];
  93153. while(target != blob.l) {
  93154. length = target - blob.l;
  93155. id = blob[blob.l];
  93156. R = PtgTypes[id];
  93157. if(id === 0x18 || id === 0x19) R = (id === 0x18 ? Ptg18 : Ptg19)[blob[blob.l + 1]];
  93158. if(!R || !R.f) { /*ptgs.push*/(parsenoop(blob, length)); }
  93159. else { ptgs.push([R.n, R.f(blob, length, opts)]); }
  93160. }
  93161. return ptgs;
  93162. }
  93163. function stringify_array(f) {
  93164. var o = [];
  93165. for(var i = 0; i < f.length; ++i) {
  93166. var x = f[i], r = [];
  93167. for(var j = 0; j < x.length; ++j) {
  93168. var y = x[j];
  93169. if(y) switch(y[0]) {
  93170. // TODO: handle embedded quotes
  93171. case 0x02:
  93172. r.push('"' + y[1].replace(/"/g,'""') + '"'); break;
  93173. default: r.push(y[1]);
  93174. } else r.push("");
  93175. }
  93176. o.push(r.join(","));
  93177. }
  93178. return o.join(";");
  93179. }
  93180. /* [MS-XLS] 2.2.2 ; [MS-XLSB] 2.2.2 TODO */
  93181. var PtgBinOp = {
  93182. PtgAdd: "+",
  93183. PtgConcat: "&",
  93184. PtgDiv: "/",
  93185. PtgEq: "=",
  93186. PtgGe: ">=",
  93187. PtgGt: ">",
  93188. PtgLe: "<=",
  93189. PtgLt: "<",
  93190. PtgMul: "*",
  93191. PtgNe: "<>",
  93192. PtgPower: "^",
  93193. PtgSub: "-"
  93194. };
  93195. function formula_quote_sheet_name(sname, opts) {
  93196. if(!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error("empty sheet name");
  93197. if(sname.indexOf(" ") > -1) return "'" + sname + "'";
  93198. return sname;
  93199. }
  93200. function get_ixti_raw(supbooks, ixti, opts) {
  93201. if(!supbooks) return "SH33TJSERR0";
  93202. if(opts.biff > 8 && (!supbooks.XTI || !supbooks.XTI[ixti])) return supbooks.SheetNames[ixti];
  93203. if(!supbooks.XTI) return "SH33TJSERR6";
  93204. var XTI = supbooks.XTI[ixti];
  93205. if(opts.biff < 8) {
  93206. if(ixti > 10000) ixti-= 65536;
  93207. if(ixti < 0) ixti = -ixti;
  93208. return ixti == 0 ? "" : supbooks.XTI[ixti - 1];
  93209. }
  93210. if(!XTI) return "SH33TJSERR1";
  93211. var o = "";
  93212. if(opts.biff > 8) switch(supbooks[XTI[0]][0]) {
  93213. case 0x0165: /* 'BrtSupSelf' */
  93214. o = XTI[1] == -1 ? "#REF" : supbooks.SheetNames[XTI[1]];
  93215. return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]];
  93216. case 0x0166: /* 'BrtSupSame' */
  93217. if(opts.SID != null) return supbooks.SheetNames[opts.SID];
  93218. return "SH33TJSSAME" + supbooks[XTI[0]][0];
  93219. case 0x0163: /* 'BrtSupBookSrc' */
  93220. /* falls through */
  93221. default: return "SH33TJSSRC" + supbooks[XTI[0]][0];
  93222. }
  93223. switch(supbooks[XTI[0]][0][0]) {
  93224. case 0x0401:
  93225. o = XTI[1] == -1 ? "#REF" : (supbooks.SheetNames[XTI[1]] || "SH33TJSERR3");
  93226. return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]];
  93227. case 0x3A01: return supbooks[XTI[0]].slice(1).map(function(name) { return name.Name; }).join(";;"); //return "SH33TJSERR8";
  93228. default:
  93229. if(!supbooks[XTI[0]][0][3]) return "SH33TJSERR2";
  93230. o = XTI[1] == -1 ? "#REF" : (supbooks[XTI[0]][0][3][XTI[1]] || "SH33TJSERR4");
  93231. return XTI[1] == XTI[2] ? o : o + ":" + supbooks[XTI[0]][0][3][XTI[2]];
  93232. }
  93233. }
  93234. function get_ixti(supbooks, ixti, opts) {
  93235. return formula_quote_sheet_name(get_ixti_raw(supbooks, ixti, opts), opts);
  93236. }
  93237. function stringify_formula(formula/*Array<any>*/, range, cell, supbooks, opts) {
  93238. var biff = (opts && opts.biff) || 8;
  93239. var _range = /*range != null ? range :*/ {s:{c:0, r:0},e:{c:0, r:0}};
  93240. var stack = [], e1, e2, c, ixti=0, nameidx=0, r, sname="";
  93241. if(!formula[0] || !formula[0][0]) return "";
  93242. var last_sp = -1, sp = "";
  93243. for(var ff = 0, fflen = formula[0].length; ff < fflen; ++ff) {
  93244. var f = formula[0][ff];
  93245. switch(f[0]) {
  93246. case 'PtgUminus': /* [MS-XLS] 2.5.198.93 */
  93247. stack.push("-" + stack.pop()); break;
  93248. case 'PtgUplus': /* [MS-XLS] 2.5.198.95 */
  93249. stack.push("+" + stack.pop()); break;
  93250. case 'PtgPercent': /* [MS-XLS] 2.5.198.81 */
  93251. stack.push(stack.pop() + "%"); break;
  93252. case 'PtgAdd': /* [MS-XLS] 2.5.198.26 */
  93253. case 'PtgConcat': /* [MS-XLS] 2.5.198.43 */
  93254. case 'PtgDiv': /* [MS-XLS] 2.5.198.45 */
  93255. case 'PtgEq': /* [MS-XLS] 2.5.198.56 */
  93256. case 'PtgGe': /* [MS-XLS] 2.5.198.64 */
  93257. case 'PtgGt': /* [MS-XLS] 2.5.198.65 */
  93258. case 'PtgLe': /* [MS-XLS] 2.5.198.68 */
  93259. case 'PtgLt': /* [MS-XLS] 2.5.198.69 */
  93260. case 'PtgMul': /* [MS-XLS] 2.5.198.75 */
  93261. case 'PtgNe': /* [MS-XLS] 2.5.198.78 */
  93262. case 'PtgPower': /* [MS-XLS] 2.5.198.82 */
  93263. case 'PtgSub': /* [MS-XLS] 2.5.198.90 */
  93264. e1 = stack.pop(); e2 = stack.pop();
  93265. if(last_sp >= 0) {
  93266. switch(formula[0][last_sp][1][0]) {
  93267. case 0:
  93268. // $FlowIgnore
  93269. sp = fill(" ", formula[0][last_sp][1][1]); break;
  93270. case 1:
  93271. // $FlowIgnore
  93272. sp = fill("\r", formula[0][last_sp][1][1]); break;
  93273. default:
  93274. sp = "";
  93275. // $FlowIgnore
  93276. if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
  93277. }
  93278. e2 = e2 + sp;
  93279. last_sp = -1;
  93280. }
  93281. stack.push(e2+PtgBinOp[f[0]]+e1);
  93282. break;
  93283. case 'PtgIsect': /* [MS-XLS] 2.5.198.67 */
  93284. e1 = stack.pop(); e2 = stack.pop();
  93285. stack.push(e2+" "+e1);
  93286. break;
  93287. case 'PtgUnion': /* [MS-XLS] 2.5.198.94 */
  93288. e1 = stack.pop(); e2 = stack.pop();
  93289. stack.push(e2+","+e1);
  93290. break;
  93291. case 'PtgRange': /* [MS-XLS] 2.5.198.83 */
  93292. e1 = stack.pop(); e2 = stack.pop();
  93293. stack.push(e2+":"+e1);
  93294. break;
  93295. case 'PtgAttrChoose': /* [MS-XLS] 2.5.198.34 */
  93296. break;
  93297. case 'PtgAttrGoto': /* [MS-XLS] 2.5.198.35 */
  93298. break;
  93299. case 'PtgAttrIf': /* [MS-XLS] 2.5.198.36 */
  93300. break;
  93301. case 'PtgAttrIfError': /* [MS-XLSB] 2.5.97.28 */
  93302. break;
  93303. case 'PtgRef': /* [MS-XLS] 2.5.198.84 */
  93304. c = shift_cell_xls((f[1][1]), _range, opts);
  93305. stack.push(encode_cell_xls(c, biff));
  93306. break;
  93307. case 'PtgRefN': /* [MS-XLS] 2.5.198.88 */
  93308. c = cell ? shift_cell_xls((f[1][1]), cell, opts) : (f[1][1]);
  93309. stack.push(encode_cell_xls(c, biff));
  93310. break;
  93311. case 'PtgRef3d': /* [MS-XLS] 2.5.198.85 */
  93312. ixti = f[1][1]; c = shift_cell_xls((f[1][2]), _range, opts);
  93313. sname = get_ixti(supbooks, ixti, opts);
  93314. var w = sname; /* IE9 fails on defined names */ // eslint-disable-line no-unused-vars
  93315. stack.push(sname + "!" + encode_cell_xls(c, biff));
  93316. break;
  93317. case 'PtgFunc': /* [MS-XLS] 2.5.198.62 */
  93318. case 'PtgFuncVar': /* [MS-XLS] 2.5.198.63 */
  93319. /* f[1] = [argc, func, type] */
  93320. var argc = (f[1][0]), func = (f[1][1]);
  93321. if(!argc) argc = 0;
  93322. argc &= 0x7F;
  93323. var args = argc == 0 ? [] : stack.slice(-argc);
  93324. stack.length -= argc;
  93325. if(func === 'User') func = args.shift();
  93326. stack.push(func + "(" + args.join(",") + ")");
  93327. break;
  93328. case 'PtgBool': /* [MS-XLS] 2.5.198.42 */
  93329. stack.push(f[1] ? "TRUE" : "FALSE"); break;
  93330. case 'PtgInt': /* [MS-XLS] 2.5.198.66 */
  93331. stack.push(f[1]); break;
  93332. case 'PtgNum': /* [MS-XLS] 2.5.198.79 TODO: precision? */
  93333. stack.push(String(f[1])); break;
  93334. case 'PtgStr': /* [MS-XLS] 2.5.198.89 */
  93335. // $FlowIgnore
  93336. stack.push('"' + f[1].replace(/"/g, '""') + '"'); break;
  93337. case 'PtgErr': /* [MS-XLS] 2.5.198.57 */
  93338. stack.push(f[1]); break;
  93339. case 'PtgAreaN': /* [MS-XLS] 2.5.198.31 TODO */
  93340. r = shift_range_xls(f[1][1], cell ? {s:cell} : _range, opts);
  93341. stack.push(encode_range_xls((r), opts));
  93342. break;
  93343. case 'PtgArea': /* [MS-XLS] 2.5.198.27 TODO: fixed points */
  93344. r = shift_range_xls(f[1][1], _range, opts);
  93345. stack.push(encode_range_xls((r), opts));
  93346. break;
  93347. case 'PtgArea3d': /* [MS-XLS] 2.5.198.28 TODO */
  93348. ixti = f[1][1]; r = f[1][2];
  93349. sname = get_ixti(supbooks, ixti, opts);
  93350. stack.push(sname + "!" + encode_range_xls((r), opts));
  93351. break;
  93352. case 'PtgAttrSum': /* [MS-XLS] 2.5.198.41 */
  93353. stack.push("SUM(" + stack.pop() + ")");
  93354. break;
  93355. case 'PtgAttrBaxcel': /* [MS-XLS] 2.5.198.33 */
  93356. case 'PtgAttrSemi': /* [MS-XLS] 2.5.198.37 */
  93357. break;
  93358. case 'PtgName': /* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 TODO: revisions */
  93359. /* f[1] = type, 0, nameindex */
  93360. nameidx = (f[1][2]);
  93361. var lbl = (supbooks.names||[])[nameidx-1] || (supbooks[0]||[])[nameidx];
  93362. var name = lbl ? lbl.Name : "SH33TJSNAME" + String(nameidx);
  93363. if(name in XLSXFutureFunctions) name = XLSXFutureFunctions[name];
  93364. stack.push(name);
  93365. break;
  93366. case 'PtgNameX': /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 TODO: revisions */
  93367. /* f[1] = type, ixti, nameindex */
  93368. var bookidx = (f[1][1]); nameidx = (f[1][2]); var externbook;
  93369. /* TODO: Properly handle missing values -- this should be using get_ixti_raw primarily */
  93370. if(opts.biff <= 5) {
  93371. if(bookidx < 0) bookidx = -bookidx;
  93372. if(supbooks[bookidx]) externbook = supbooks[bookidx][nameidx];
  93373. } else {
  93374. var o = "";
  93375. if(((supbooks[bookidx]||[])[0]||[])[0] == 0x3A01){/* empty */}
  93376. else if(((supbooks[bookidx]||[])[0]||[])[0] == 0x0401){
  93377. if(supbooks[bookidx][nameidx] && supbooks[bookidx][nameidx].itab > 0) {
  93378. o = supbooks.SheetNames[supbooks[bookidx][nameidx].itab-1] + "!";
  93379. }
  93380. }
  93381. else o = supbooks.SheetNames[nameidx-1]+ "!";
  93382. if(supbooks[bookidx] && supbooks[bookidx][nameidx]) o += supbooks[bookidx][nameidx].Name;
  93383. else if(supbooks[0] && supbooks[0][nameidx]) o += supbooks[0][nameidx].Name;
  93384. else {
  93385. var ixtidata = get_ixti_raw(supbooks, bookidx, opts).split(";;");
  93386. if(ixtidata[nameidx - 1]) o = ixtidata[nameidx - 1]; // TODO: confirm this is correct
  93387. else o += "SH33TJSERRX";
  93388. }
  93389. stack.push(o);
  93390. break;
  93391. }
  93392. if(!externbook) externbook = {Name: "SH33TJSERRY"};
  93393. stack.push(externbook.Name);
  93394. break;
  93395. case 'PtgParen': /* [MS-XLS] 2.5.198.80 */
  93396. var lp = '(', rp = ')';
  93397. if(last_sp >= 0) {
  93398. sp = "";
  93399. switch(formula[0][last_sp][1][0]) {
  93400. // $FlowIgnore
  93401. case 2: lp = fill(" ", formula[0][last_sp][1][1]) + lp; break;
  93402. // $FlowIgnore
  93403. case 3: lp = fill("\r", formula[0][last_sp][1][1]) + lp; break;
  93404. // $FlowIgnore
  93405. case 4: rp = fill(" ", formula[0][last_sp][1][1]) + rp; break;
  93406. // $FlowIgnore
  93407. case 5: rp = fill("\r", formula[0][last_sp][1][1]) + rp; break;
  93408. default:
  93409. // $FlowIgnore
  93410. if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
  93411. }
  93412. last_sp = -1;
  93413. }
  93414. stack.push(lp + stack.pop() + rp); break;
  93415. case 'PtgRefErr': /* [MS-XLS] 2.5.198.86 */
  93416. stack.push('#REF!'); break;
  93417. case 'PtgRefErr3d': /* [MS-XLS] 2.5.198.87 */
  93418. stack.push('#REF!'); break;
  93419. case 'PtgExp': /* [MS-XLS] 2.5.198.58 TODO */
  93420. c = {c:(f[1][1]),r:(f[1][0])};
  93421. var q = ({c: cell.c, r:cell.r});
  93422. if(supbooks.sharedf[encode_cell(c)]) {
  93423. var parsedf = (supbooks.sharedf[encode_cell(c)]);
  93424. stack.push(stringify_formula(parsedf, _range, q, supbooks, opts));
  93425. }
  93426. else {
  93427. var fnd = false;
  93428. for(e1=0;e1!=supbooks.arrayf.length; ++e1) {
  93429. /* TODO: should be something like range_has */
  93430. e2 = supbooks.arrayf[e1];
  93431. if(c.c < e2[0].s.c || c.c > e2[0].e.c) continue;
  93432. if(c.r < e2[0].s.r || c.r > e2[0].e.r) continue;
  93433. stack.push(stringify_formula(e2[1], _range, q, supbooks, opts));
  93434. fnd = true;
  93435. break;
  93436. }
  93437. if(!fnd) stack.push(f[1]);
  93438. }
  93439. break;
  93440. case 'PtgArray': /* [MS-XLS] 2.5.198.32 TODO */
  93441. stack.push("{" + stringify_array(f[1]) + "}");
  93442. break;
  93443. case 'PtgMemArea': /* [MS-XLS] 2.5.198.70 TODO: confirm this is a non-display */
  93444. //stack.push("(" + f[2].map(encode_range).join(",") + ")");
  93445. break;
  93446. case 'PtgAttrSpace': /* [MS-XLS] 2.5.198.38 */
  93447. case 'PtgAttrSpaceSemi': /* [MS-XLS] 2.5.198.39 */
  93448. last_sp = ff;
  93449. break;
  93450. case 'PtgTbl': /* [MS-XLS] 2.5.198.92 TODO */
  93451. break;
  93452. case 'PtgMemErr': /* [MS-XLS] 2.5.198.71 */
  93453. break;
  93454. case 'PtgMissArg': /* [MS-XLS] 2.5.198.74 */
  93455. stack.push("");
  93456. break;
  93457. case 'PtgAreaErr': /* [MS-XLS] 2.5.198.29 */
  93458. stack.push("#REF!"); break;
  93459. case 'PtgAreaErr3d': /* [MS-XLS] 2.5.198.30 */
  93460. stack.push("#REF!"); break;
  93461. case 'PtgList': /* [MS-XLSB] 2.5.97.52 */
  93462. // $FlowIgnore
  93463. stack.push("Table" + f[1].idx + "[#" + f[1].rt + "]");
  93464. break;
  93465. case 'PtgMemAreaN':
  93466. case 'PtgMemNoMemN':
  93467. case 'PtgAttrNoop':
  93468. case 'PtgSheet':
  93469. case 'PtgEndSheet':
  93470. break;
  93471. case 'PtgMemFunc': /* [MS-XLS] 2.5.198.72 TODO */
  93472. break;
  93473. case 'PtgMemNoMem': /* [MS-XLS] 2.5.198.73 TODO */
  93474. break;
  93475. case 'PtgElfCol': /* [MS-XLS] 2.5.198.46 */
  93476. case 'PtgElfColS': /* [MS-XLS] 2.5.198.47 */
  93477. case 'PtgElfColSV': /* [MS-XLS] 2.5.198.48 */
  93478. case 'PtgElfColV': /* [MS-XLS] 2.5.198.49 */
  93479. case 'PtgElfLel': /* [MS-XLS] 2.5.198.50 */
  93480. case 'PtgElfRadical': /* [MS-XLS] 2.5.198.51 */
  93481. case 'PtgElfRadicalLel': /* [MS-XLS] 2.5.198.52 */
  93482. case 'PtgElfRadicalS': /* [MS-XLS] 2.5.198.53 */
  93483. case 'PtgElfRw': /* [MS-XLS] 2.5.198.54 */
  93484. case 'PtgElfRwV': /* [MS-XLS] 2.5.198.55 */
  93485. throw new Error("Unsupported ELFs");
  93486. case 'PtgSxName': /* [MS-XLS] 2.5.198.91 TODO -- find a test case */
  93487. throw new Error('Unrecognized Formula Token: ' + String(f));
  93488. default: throw new Error('Unrecognized Formula Token: ' + String(f));
  93489. }
  93490. var PtgNonDisp = ['PtgAttrSpace', 'PtgAttrSpaceSemi', 'PtgAttrGoto'];
  93491. if(opts.biff != 3) if(last_sp >= 0 && PtgNonDisp.indexOf(formula[0][ff][0]) == -1) {
  93492. f = formula[0][last_sp];
  93493. var _left = true;
  93494. switch(f[1][0]) {
  93495. /* note: some bad XLSB files omit the PtgParen */
  93496. case 4: _left = false;
  93497. /* falls through */
  93498. case 0:
  93499. // $FlowIgnore
  93500. sp = fill(" ", f[1][1]); break;
  93501. case 5: _left = false;
  93502. /* falls through */
  93503. case 1:
  93504. // $FlowIgnore
  93505. sp = fill("\r", f[1][1]); break;
  93506. default:
  93507. sp = "";
  93508. // $FlowIgnore
  93509. if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + f[1][0]);
  93510. }
  93511. stack.push((_left ? sp : "") + stack.pop() + (_left ? "" : sp));
  93512. last_sp = -1;
  93513. }
  93514. }
  93515. if(stack.length > 1 && opts.WTF) throw new Error("bad formula stack");
  93516. return stack[0];
  93517. }
  93518. /* [MS-XLS] 2.5.198.1 TODO */
  93519. function parse_ArrayParsedFormula(blob, length, opts) {
  93520. var target = blob.l + length, len = opts.biff == 2 ? 1 : 2;
  93521. var rgcb, cce = blob.read_shift(len); // length of rgce
  93522. if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
  93523. var rgce = parse_Rgce(blob, cce, opts);
  93524. if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);
  93525. blob.l = target;
  93526. return [rgce, rgcb];
  93527. }
  93528. /* [MS-XLS] 2.5.198.3 TODO */
  93529. function parse_XLSCellParsedFormula(blob, length, opts) {
  93530. var target = blob.l + length, len = opts.biff == 2 ? 1 : 2;
  93531. var rgcb, cce = blob.read_shift(len); // length of rgce
  93532. if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
  93533. var rgce = parse_Rgce(blob, cce, opts);
  93534. if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);
  93535. blob.l = target;
  93536. return [rgce, rgcb];
  93537. }
  93538. /* [MS-XLS] 2.5.198.21 */
  93539. function parse_NameParsedFormula(blob, length, opts, cce) {
  93540. var target = blob.l + length;
  93541. var rgce = parse_Rgce(blob, cce, opts);
  93542. var rgcb;
  93543. if(target !== blob.l) rgcb = parse_RgbExtra(blob, target - blob.l, rgce, opts);
  93544. return [rgce, rgcb];
  93545. }
  93546. /* [MS-XLS] 2.5.198.118 TODO */
  93547. function parse_SharedParsedFormula(blob, length, opts) {
  93548. var target = blob.l + length;
  93549. var rgcb, cce = blob.read_shift(2); // length of rgce
  93550. var rgce = parse_Rgce(blob, cce, opts);
  93551. if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
  93552. if(length !== cce + 2) rgcb = parse_RgbExtra(blob, target - cce - 2, rgce, opts);
  93553. return [rgce, rgcb];
  93554. }
  93555. /* [MS-XLS] 2.5.133 TODO: how to emit empty strings? */
  93556. function parse_FormulaValue(blob) {
  93557. var b;
  93558. if(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];
  93559. switch(blob[blob.l]) {
  93560. case 0x00: blob.l += 8; return ["String", 's'];
  93561. case 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];
  93562. case 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];
  93563. case 0x03: blob.l += 8; return ["",'s'];
  93564. }
  93565. return [];
  93566. }
  93567. function write_FormulaValue(value) {
  93568. if(value == null) {
  93569. // Blank String Value
  93570. var o = new_buf(8);
  93571. o.write_shift(1, 0x03);
  93572. o.write_shift(1, 0);
  93573. o.write_shift(2, 0);
  93574. o.write_shift(2, 0);
  93575. o.write_shift(2, 0xFFFF);
  93576. return o;
  93577. } else if(typeof value == "number") return write_Xnum(value);
  93578. return write_Xnum(0);
  93579. }
  93580. /* [MS-XLS] 2.4.127 TODO */
  93581. function parse_Formula(blob, length, opts) {
  93582. var end = blob.l + length;
  93583. var cell = parse_XLSCell(blob, 6);
  93584. if(opts.biff == 2) ++blob.l;
  93585. var val = parse_FormulaValue(blob,8);
  93586. var flags = blob.read_shift(1);
  93587. if(opts.biff != 2) {
  93588. blob.read_shift(1);
  93589. if(opts.biff >= 5) {
  93590. /*var chn = */blob.read_shift(4);
  93591. }
  93592. }
  93593. var cbf = parse_XLSCellParsedFormula(blob, end - blob.l, opts);
  93594. return {cell:cell, val:val[0], formula:cbf, shared: (flags >> 3) & 1, tt:val[1]};
  93595. }
  93596. function write_Formula(cell, R, C, opts, os) {
  93597. // Cell
  93598. var o1 = write_XLSCell(R, C, os);
  93599. // FormulaValue
  93600. var o2 = write_FormulaValue(cell.v);
  93601. // flags + cache
  93602. var o3 = new_buf(6);
  93603. var flags = 0x01 | 0x20;
  93604. o3.write_shift(2, flags);
  93605. o3.write_shift(4, 0);
  93606. // CellParsedFormula
  93607. var bf = new_buf(cell.bf.length);
  93608. for(var i = 0; i < cell.bf.length; ++i) bf[i] = cell.bf[i];
  93609. var out = bconcat([o1, o2, o3, bf]);
  93610. return out;
  93611. }
  93612. /* XLSB Parsed Formula records have the same shape */
  93613. function parse_XLSBParsedFormula(data, length, opts) {
  93614. var cce = data.read_shift(4);
  93615. var rgce = parse_Rgce(data, cce, opts);
  93616. var cb = data.read_shift(4);
  93617. var rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;
  93618. return [rgce, rgcb];
  93619. }
  93620. /* [MS-XLSB] 2.5.97.1 ArrayParsedFormula */
  93621. var parse_XLSBArrayParsedFormula = parse_XLSBParsedFormula;
  93622. /* [MS-XLSB] 2.5.97.4 CellParsedFormula */
  93623. var parse_XLSBCellParsedFormula = parse_XLSBParsedFormula;
  93624. /* [MS-XLSB] 2.5.97.8 DVParsedFormula */
  93625. //var parse_XLSBDVParsedFormula = parse_XLSBParsedFormula;
  93626. /* [MS-XLSB] 2.5.97.9 FRTParsedFormula */
  93627. //var parse_XLSBFRTParsedFormula = parse_XLSBParsedFormula2;
  93628. /* [MS-XLSB] 2.5.97.12 NameParsedFormula */
  93629. var parse_XLSBNameParsedFormula = parse_XLSBParsedFormula;
  93630. /* [MS-XLSB] 2.5.97.98 SharedParsedFormula */
  93631. var parse_XLSBSharedParsedFormula = parse_XLSBParsedFormula;
  93632. /* [MS-XLS] 2.5.198.4 */
  93633. var Cetab = {
  93634. 0x0000: 'BEEP',
  93635. 0x0001: 'OPEN',
  93636. 0x0002: 'OPEN.LINKS',
  93637. 0x0003: 'CLOSE.ALL',
  93638. 0x0004: 'SAVE',
  93639. 0x0005: 'SAVE.AS',
  93640. 0x0006: 'FILE.DELETE',
  93641. 0x0007: 'PAGE.SETUP',
  93642. 0x0008: 'PRINT',
  93643. 0x0009: 'PRINTER.SETUP',
  93644. 0x000A: 'QUIT',
  93645. 0x000B: 'NEW.WINDOW',
  93646. 0x000C: 'ARRANGE.ALL',
  93647. 0x000D: 'WINDOW.SIZE',
  93648. 0x000E: 'WINDOW.MOVE',
  93649. 0x000F: 'FULL',
  93650. 0x0010: 'CLOSE',
  93651. 0x0011: 'RUN',
  93652. 0x0016: 'SET.PRINT.AREA',
  93653. 0x0017: 'SET.PRINT.TITLES',
  93654. 0x0018: 'SET.PAGE.BREAK',
  93655. 0x0019: 'REMOVE.PAGE.BREAK',
  93656. 0x001A: 'FONT',
  93657. 0x001B: 'DISPLAY',
  93658. 0x001C: 'PROTECT.DOCUMENT',
  93659. 0x001D: 'PRECISION',
  93660. 0x001E: 'A1.R1C1',
  93661. 0x001F: 'CALCULATE.NOW',
  93662. 0x0020: 'CALCULATION',
  93663. 0x0022: 'DATA.FIND',
  93664. 0x0023: 'EXTRACT',
  93665. 0x0024: 'DATA.DELETE',
  93666. 0x0025: 'SET.DATABASE',
  93667. 0x0026: 'SET.CRITERIA',
  93668. 0x0027: 'SORT',
  93669. 0x0028: 'DATA.SERIES',
  93670. 0x0029: 'TABLE',
  93671. 0x002A: 'FORMAT.NUMBER',
  93672. 0x002B: 'ALIGNMENT',
  93673. 0x002C: 'STYLE',
  93674. 0x002D: 'BORDER',
  93675. 0x002E: 'CELL.PROTECTION',
  93676. 0x002F: 'COLUMN.WIDTH',
  93677. 0x0030: 'UNDO',
  93678. 0x0031: 'CUT',
  93679. 0x0032: 'COPY',
  93680. 0x0033: 'PASTE',
  93681. 0x0034: 'CLEAR',
  93682. 0x0035: 'PASTE.SPECIAL',
  93683. 0x0036: 'EDIT.DELETE',
  93684. 0x0037: 'INSERT',
  93685. 0x0038: 'FILL.RIGHT',
  93686. 0x0039: 'FILL.DOWN',
  93687. 0x003D: 'DEFINE.NAME',
  93688. 0x003E: 'CREATE.NAMES',
  93689. 0x003F: 'FORMULA.GOTO',
  93690. 0x0040: 'FORMULA.FIND',
  93691. 0x0041: 'SELECT.LAST.CELL',
  93692. 0x0042: 'SHOW.ACTIVE.CELL',
  93693. 0x0043: 'GALLERY.AREA',
  93694. 0x0044: 'GALLERY.BAR',
  93695. 0x0045: 'GALLERY.COLUMN',
  93696. 0x0046: 'GALLERY.LINE',
  93697. 0x0047: 'GALLERY.PIE',
  93698. 0x0048: 'GALLERY.SCATTER',
  93699. 0x0049: 'COMBINATION',
  93700. 0x004A: 'PREFERRED',
  93701. 0x004B: 'ADD.OVERLAY',
  93702. 0x004C: 'GRIDLINES',
  93703. 0x004D: 'SET.PREFERRED',
  93704. 0x004E: 'AXES',
  93705. 0x004F: 'LEGEND',
  93706. 0x0050: 'ATTACH.TEXT',
  93707. 0x0051: 'ADD.ARROW',
  93708. 0x0052: 'SELECT.CHART',
  93709. 0x0053: 'SELECT.PLOT.AREA',
  93710. 0x0054: 'PATTERNS',
  93711. 0x0055: 'MAIN.CHART',
  93712. 0x0056: 'OVERLAY',
  93713. 0x0057: 'SCALE',
  93714. 0x0058: 'FORMAT.LEGEND',
  93715. 0x0059: 'FORMAT.TEXT',
  93716. 0x005A: 'EDIT.REPEAT',
  93717. 0x005B: 'PARSE',
  93718. 0x005C: 'JUSTIFY',
  93719. 0x005D: 'HIDE',
  93720. 0x005E: 'UNHIDE',
  93721. 0x005F: 'WORKSPACE',
  93722. 0x0060: 'FORMULA',
  93723. 0x0061: 'FORMULA.FILL',
  93724. 0x0062: 'FORMULA.ARRAY',
  93725. 0x0063: 'DATA.FIND.NEXT',
  93726. 0x0064: 'DATA.FIND.PREV',
  93727. 0x0065: 'FORMULA.FIND.NEXT',
  93728. 0x0066: 'FORMULA.FIND.PREV',
  93729. 0x0067: 'ACTIVATE',
  93730. 0x0068: 'ACTIVATE.NEXT',
  93731. 0x0069: 'ACTIVATE.PREV',
  93732. 0x006A: 'UNLOCKED.NEXT',
  93733. 0x006B: 'UNLOCKED.PREV',
  93734. 0x006C: 'COPY.PICTURE',
  93735. 0x006D: 'SELECT',
  93736. 0x006E: 'DELETE.NAME',
  93737. 0x006F: 'DELETE.FORMAT',
  93738. 0x0070: 'VLINE',
  93739. 0x0071: 'HLINE',
  93740. 0x0072: 'VPAGE',
  93741. 0x0073: 'HPAGE',
  93742. 0x0074: 'VSCROLL',
  93743. 0x0075: 'HSCROLL',
  93744. 0x0076: 'ALERT',
  93745. 0x0077: 'NEW',
  93746. 0x0078: 'CANCEL.COPY',
  93747. 0x0079: 'SHOW.CLIPBOARD',
  93748. 0x007A: 'MESSAGE',
  93749. 0x007C: 'PASTE.LINK',
  93750. 0x007D: 'APP.ACTIVATE',
  93751. 0x007E: 'DELETE.ARROW',
  93752. 0x007F: 'ROW.HEIGHT',
  93753. 0x0080: 'FORMAT.MOVE',
  93754. 0x0081: 'FORMAT.SIZE',
  93755. 0x0082: 'FORMULA.REPLACE',
  93756. 0x0083: 'SEND.KEYS',
  93757. 0x0084: 'SELECT.SPECIAL',
  93758. 0x0085: 'APPLY.NAMES',
  93759. 0x0086: 'REPLACE.FONT',
  93760. 0x0087: 'FREEZE.PANES',
  93761. 0x0088: 'SHOW.INFO',
  93762. 0x0089: 'SPLIT',
  93763. 0x008A: 'ON.WINDOW',
  93764. 0x008B: 'ON.DATA',
  93765. 0x008C: 'DISABLE.INPUT',
  93766. 0x008E: 'OUTLINE',
  93767. 0x008F: 'LIST.NAMES',
  93768. 0x0090: 'FILE.CLOSE',
  93769. 0x0091: 'SAVE.WORKBOOK',
  93770. 0x0092: 'DATA.FORM',
  93771. 0x0093: 'COPY.CHART',
  93772. 0x0094: 'ON.TIME',
  93773. 0x0095: 'WAIT',
  93774. 0x0096: 'FORMAT.FONT',
  93775. 0x0097: 'FILL.UP',
  93776. 0x0098: 'FILL.LEFT',
  93777. 0x0099: 'DELETE.OVERLAY',
  93778. 0x009B: 'SHORT.MENUS',
  93779. 0x009F: 'SET.UPDATE.STATUS',
  93780. 0x00A1: 'COLOR.PALETTE',
  93781. 0x00A2: 'DELETE.STYLE',
  93782. 0x00A3: 'WINDOW.RESTORE',
  93783. 0x00A4: 'WINDOW.MAXIMIZE',
  93784. 0x00A6: 'CHANGE.LINK',
  93785. 0x00A7: 'CALCULATE.DOCUMENT',
  93786. 0x00A8: 'ON.KEY',
  93787. 0x00A9: 'APP.RESTORE',
  93788. 0x00AA: 'APP.MOVE',
  93789. 0x00AB: 'APP.SIZE',
  93790. 0x00AC: 'APP.MINIMIZE',
  93791. 0x00AD: 'APP.MAXIMIZE',
  93792. 0x00AE: 'BRING.TO.FRONT',
  93793. 0x00AF: 'SEND.TO.BACK',
  93794. 0x00B9: 'MAIN.CHART.TYPE',
  93795. 0x00BA: 'OVERLAY.CHART.TYPE',
  93796. 0x00BB: 'SELECT.END',
  93797. 0x00BC: 'OPEN.MAIL',
  93798. 0x00BD: 'SEND.MAIL',
  93799. 0x00BE: 'STANDARD.FONT',
  93800. 0x00BF: 'CONSOLIDATE',
  93801. 0x00C0: 'SORT.SPECIAL',
  93802. 0x00C1: 'GALLERY.3D.AREA',
  93803. 0x00C2: 'GALLERY.3D.COLUMN',
  93804. 0x00C3: 'GALLERY.3D.LINE',
  93805. 0x00C4: 'GALLERY.3D.PIE',
  93806. 0x00C5: 'VIEW.3D',
  93807. 0x00C6: 'GOAL.SEEK',
  93808. 0x00C7: 'WORKGROUP',
  93809. 0x00C8: 'FILL.GROUP',
  93810. 0x00C9: 'UPDATE.LINK',
  93811. 0x00CA: 'PROMOTE',
  93812. 0x00CB: 'DEMOTE',
  93813. 0x00CC: 'SHOW.DETAIL',
  93814. 0x00CE: 'UNGROUP',
  93815. 0x00CF: 'OBJECT.PROPERTIES',
  93816. 0x00D0: 'SAVE.NEW.OBJECT',
  93817. 0x00D1: 'SHARE',
  93818. 0x00D2: 'SHARE.NAME',
  93819. 0x00D3: 'DUPLICATE',
  93820. 0x00D4: 'APPLY.STYLE',
  93821. 0x00D5: 'ASSIGN.TO.OBJECT',
  93822. 0x00D6: 'OBJECT.PROTECTION',
  93823. 0x00D7: 'HIDE.OBJECT',
  93824. 0x00D8: 'SET.EXTRACT',
  93825. 0x00D9: 'CREATE.PUBLISHER',
  93826. 0x00DA: 'SUBSCRIBE.TO',
  93827. 0x00DB: 'ATTRIBUTES',
  93828. 0x00DC: 'SHOW.TOOLBAR',
  93829. 0x00DE: 'PRINT.PREVIEW',
  93830. 0x00DF: 'EDIT.COLOR',
  93831. 0x00E0: 'SHOW.LEVELS',
  93832. 0x00E1: 'FORMAT.MAIN',
  93833. 0x00E2: 'FORMAT.OVERLAY',
  93834. 0x00E3: 'ON.RECALC',
  93835. 0x00E4: 'EDIT.SERIES',
  93836. 0x00E5: 'DEFINE.STYLE',
  93837. 0x00F0: 'LINE.PRINT',
  93838. 0x00F3: 'ENTER.DATA',
  93839. 0x00F9: 'GALLERY.RADAR',
  93840. 0x00FA: 'MERGE.STYLES',
  93841. 0x00FB: 'EDITION.OPTIONS',
  93842. 0x00FC: 'PASTE.PICTURE',
  93843. 0x00FD: 'PASTE.PICTURE.LINK',
  93844. 0x00FE: 'SPELLING',
  93845. 0x0100: 'ZOOM',
  93846. 0x0103: 'INSERT.OBJECT',
  93847. 0x0104: 'WINDOW.MINIMIZE',
  93848. 0x0109: 'SOUND.NOTE',
  93849. 0x010A: 'SOUND.PLAY',
  93850. 0x010B: 'FORMAT.SHAPE',
  93851. 0x010C: 'EXTEND.POLYGON',
  93852. 0x010D: 'FORMAT.AUTO',
  93853. 0x0110: 'GALLERY.3D.BAR',
  93854. 0x0111: 'GALLERY.3D.SURFACE',
  93855. 0x0112: 'FILL.AUTO',
  93856. 0x0114: 'CUSTOMIZE.TOOLBAR',
  93857. 0x0115: 'ADD.TOOL',
  93858. 0x0116: 'EDIT.OBJECT',
  93859. 0x0117: 'ON.DOUBLECLICK',
  93860. 0x0118: 'ON.ENTRY',
  93861. 0x0119: 'WORKBOOK.ADD',
  93862. 0x011A: 'WORKBOOK.MOVE',
  93863. 0x011B: 'WORKBOOK.COPY',
  93864. 0x011C: 'WORKBOOK.OPTIONS',
  93865. 0x011D: 'SAVE.WORKSPACE',
  93866. 0x0120: 'CHART.WIZARD',
  93867. 0x0121: 'DELETE.TOOL',
  93868. 0x0122: 'MOVE.TOOL',
  93869. 0x0123: 'WORKBOOK.SELECT',
  93870. 0x0124: 'WORKBOOK.ACTIVATE',
  93871. 0x0125: 'ASSIGN.TO.TOOL',
  93872. 0x0127: 'COPY.TOOL',
  93873. 0x0128: 'RESET.TOOL',
  93874. 0x0129: 'CONSTRAIN.NUMERIC',
  93875. 0x012A: 'PASTE.TOOL',
  93876. 0x012E: 'WORKBOOK.NEW',
  93877. 0x0131: 'SCENARIO.CELLS',
  93878. 0x0132: 'SCENARIO.DELETE',
  93879. 0x0133: 'SCENARIO.ADD',
  93880. 0x0134: 'SCENARIO.EDIT',
  93881. 0x0135: 'SCENARIO.SHOW',
  93882. 0x0136: 'SCENARIO.SHOW.NEXT',
  93883. 0x0137: 'SCENARIO.SUMMARY',
  93884. 0x0138: 'PIVOT.TABLE.WIZARD',
  93885. 0x0139: 'PIVOT.FIELD.PROPERTIES',
  93886. 0x013A: 'PIVOT.FIELD',
  93887. 0x013B: 'PIVOT.ITEM',
  93888. 0x013C: 'PIVOT.ADD.FIELDS',
  93889. 0x013E: 'OPTIONS.CALCULATION',
  93890. 0x013F: 'OPTIONS.EDIT',
  93891. 0x0140: 'OPTIONS.VIEW',
  93892. 0x0141: 'ADDIN.MANAGER',
  93893. 0x0142: 'MENU.EDITOR',
  93894. 0x0143: 'ATTACH.TOOLBARS',
  93895. 0x0144: 'VBAActivate',
  93896. 0x0145: 'OPTIONS.CHART',
  93897. 0x0148: 'VBA.INSERT.FILE',
  93898. 0x014A: 'VBA.PROCEDURE.DEFINITION',
  93899. 0x0150: 'ROUTING.SLIP',
  93900. 0x0152: 'ROUTE.DOCUMENT',
  93901. 0x0153: 'MAIL.LOGON',
  93902. 0x0156: 'INSERT.PICTURE',
  93903. 0x0157: 'EDIT.TOOL',
  93904. 0x0158: 'GALLERY.DOUGHNUT',
  93905. 0x015E: 'CHART.TREND',
  93906. 0x0160: 'PIVOT.ITEM.PROPERTIES',
  93907. 0x0162: 'WORKBOOK.INSERT',
  93908. 0x0163: 'OPTIONS.TRANSITION',
  93909. 0x0164: 'OPTIONS.GENERAL',
  93910. 0x0172: 'FILTER.ADVANCED',
  93911. 0x0175: 'MAIL.ADD.MAILER',
  93912. 0x0176: 'MAIL.DELETE.MAILER',
  93913. 0x0177: 'MAIL.REPLY',
  93914. 0x0178: 'MAIL.REPLY.ALL',
  93915. 0x0179: 'MAIL.FORWARD',
  93916. 0x017A: 'MAIL.NEXT.LETTER',
  93917. 0x017B: 'DATA.LABEL',
  93918. 0x017C: 'INSERT.TITLE',
  93919. 0x017D: 'FONT.PROPERTIES',
  93920. 0x017E: 'MACRO.OPTIONS',
  93921. 0x017F: 'WORKBOOK.HIDE',
  93922. 0x0180: 'WORKBOOK.UNHIDE',
  93923. 0x0181: 'WORKBOOK.DELETE',
  93924. 0x0182: 'WORKBOOK.NAME',
  93925. 0x0184: 'GALLERY.CUSTOM',
  93926. 0x0186: 'ADD.CHART.AUTOFORMAT',
  93927. 0x0187: 'DELETE.CHART.AUTOFORMAT',
  93928. 0x0188: 'CHART.ADD.DATA',
  93929. 0x0189: 'AUTO.OUTLINE',
  93930. 0x018A: 'TAB.ORDER',
  93931. 0x018B: 'SHOW.DIALOG',
  93932. 0x018C: 'SELECT.ALL',
  93933. 0x018D: 'UNGROUP.SHEETS',
  93934. 0x018E: 'SUBTOTAL.CREATE',
  93935. 0x018F: 'SUBTOTAL.REMOVE',
  93936. 0x0190: 'RENAME.OBJECT',
  93937. 0x019C: 'WORKBOOK.SCROLL',
  93938. 0x019D: 'WORKBOOK.NEXT',
  93939. 0x019E: 'WORKBOOK.PREV',
  93940. 0x019F: 'WORKBOOK.TAB.SPLIT',
  93941. 0x01A0: 'FULL.SCREEN',
  93942. 0x01A1: 'WORKBOOK.PROTECT',
  93943. 0x01A4: 'SCROLLBAR.PROPERTIES',
  93944. 0x01A5: 'PIVOT.SHOW.PAGES',
  93945. 0x01A6: 'TEXT.TO.COLUMNS',
  93946. 0x01A7: 'FORMAT.CHARTTYPE',
  93947. 0x01A8: 'LINK.FORMAT',
  93948. 0x01A9: 'TRACER.DISPLAY',
  93949. 0x01AE: 'TRACER.NAVIGATE',
  93950. 0x01AF: 'TRACER.CLEAR',
  93951. 0x01B0: 'TRACER.ERROR',
  93952. 0x01B1: 'PIVOT.FIELD.GROUP',
  93953. 0x01B2: 'PIVOT.FIELD.UNGROUP',
  93954. 0x01B3: 'CHECKBOX.PROPERTIES',
  93955. 0x01B4: 'LABEL.PROPERTIES',
  93956. 0x01B5: 'LISTBOX.PROPERTIES',
  93957. 0x01B6: 'EDITBOX.PROPERTIES',
  93958. 0x01B7: 'PIVOT.REFRESH',
  93959. 0x01B8: 'LINK.COMBO',
  93960. 0x01B9: 'OPEN.TEXT',
  93961. 0x01BA: 'HIDE.DIALOG',
  93962. 0x01BB: 'SET.DIALOG.FOCUS',
  93963. 0x01BC: 'ENABLE.OBJECT',
  93964. 0x01BD: 'PUSHBUTTON.PROPERTIES',
  93965. 0x01BE: 'SET.DIALOG.DEFAULT',
  93966. 0x01BF: 'FILTER',
  93967. 0x01C0: 'FILTER.SHOW.ALL',
  93968. 0x01C1: 'CLEAR.OUTLINE',
  93969. 0x01C2: 'FUNCTION.WIZARD',
  93970. 0x01C3: 'ADD.LIST.ITEM',
  93971. 0x01C4: 'SET.LIST.ITEM',
  93972. 0x01C5: 'REMOVE.LIST.ITEM',
  93973. 0x01C6: 'SELECT.LIST.ITEM',
  93974. 0x01C7: 'SET.CONTROL.VALUE',
  93975. 0x01C8: 'SAVE.COPY.AS',
  93976. 0x01CA: 'OPTIONS.LISTS.ADD',
  93977. 0x01CB: 'OPTIONS.LISTS.DELETE',
  93978. 0x01CC: 'SERIES.AXES',
  93979. 0x01CD: 'SERIES.X',
  93980. 0x01CE: 'SERIES.Y',
  93981. 0x01CF: 'ERRORBAR.X',
  93982. 0x01D0: 'ERRORBAR.Y',
  93983. 0x01D1: 'FORMAT.CHART',
  93984. 0x01D2: 'SERIES.ORDER',
  93985. 0x01D3: 'MAIL.LOGOFF',
  93986. 0x01D4: 'CLEAR.ROUTING.SLIP',
  93987. 0x01D5: 'APP.ACTIVATE.MICROSOFT',
  93988. 0x01D6: 'MAIL.EDIT.MAILER',
  93989. 0x01D7: 'ON.SHEET',
  93990. 0x01D8: 'STANDARD.WIDTH',
  93991. 0x01D9: 'SCENARIO.MERGE',
  93992. 0x01DA: 'SUMMARY.INFO',
  93993. 0x01DB: 'FIND.FILE',
  93994. 0x01DC: 'ACTIVE.CELL.FONT',
  93995. 0x01DD: 'ENABLE.TIPWIZARD',
  93996. 0x01DE: 'VBA.MAKE.ADDIN',
  93997. 0x01E0: 'INSERTDATATABLE',
  93998. 0x01E1: 'WORKGROUP.OPTIONS',
  93999. 0x01E2: 'MAIL.SEND.MAILER',
  94000. 0x01E5: 'AUTOCORRECT',
  94001. 0x01E9: 'POST.DOCUMENT',
  94002. 0x01EB: 'PICKLIST',
  94003. 0x01ED: 'VIEW.SHOW',
  94004. 0x01EE: 'VIEW.DEFINE',
  94005. 0x01EF: 'VIEW.DELETE',
  94006. 0x01FD: 'SHEET.BACKGROUND',
  94007. 0x01FE: 'INSERT.MAP.OBJECT',
  94008. 0x01FF: 'OPTIONS.MENONO',
  94009. 0x0205: 'MSOCHECKS',
  94010. 0x0206: 'NORMAL',
  94011. 0x0207: 'LAYOUT',
  94012. 0x0208: 'RM.PRINT.AREA',
  94013. 0x0209: 'CLEAR.PRINT.AREA',
  94014. 0x020A: 'ADD.PRINT.AREA',
  94015. 0x020B: 'MOVE.BRK',
  94016. 0x0221: 'HIDECURR.NOTE',
  94017. 0x0222: 'HIDEALL.NOTES',
  94018. 0x0223: 'DELETE.NOTE',
  94019. 0x0224: 'TRAVERSE.NOTES',
  94020. 0x0225: 'ACTIVATE.NOTES',
  94021. 0x026C: 'PROTECT.REVISIONS',
  94022. 0x026D: 'UNPROTECT.REVISIONS',
  94023. 0x0287: 'OPTIONS.ME',
  94024. 0x028D: 'WEB.PUBLISH',
  94025. 0x029B: 'NEWWEBQUERY',
  94026. 0x02A1: 'PIVOT.TABLE.CHART',
  94027. 0x02F1: 'OPTIONS.SAVE',
  94028. 0x02F3: 'OPTIONS.SPELL',
  94029. 0x0328: 'HIDEALL.INKANNOTS'
  94030. };
  94031. /* [MS-XLS] 2.5.198.17 */
  94032. /* [MS-XLSB] 2.5.97.10 */
  94033. var Ftab = {
  94034. 0x0000: 'COUNT',
  94035. 0x0001: 'IF',
  94036. 0x0002: 'ISNA',
  94037. 0x0003: 'ISERROR',
  94038. 0x0004: 'SUM',
  94039. 0x0005: 'AVERAGE',
  94040. 0x0006: 'MIN',
  94041. 0x0007: 'MAX',
  94042. 0x0008: 'ROW',
  94043. 0x0009: 'COLUMN',
  94044. 0x000A: 'NA',
  94045. 0x000B: 'NPV',
  94046. 0x000C: 'STDEV',
  94047. 0x000D: 'DOLLAR',
  94048. 0x000E: 'FIXED',
  94049. 0x000F: 'SIN',
  94050. 0x0010: 'COS',
  94051. 0x0011: 'TAN',
  94052. 0x0012: 'ATAN',
  94053. 0x0013: 'PI',
  94054. 0x0014: 'SQRT',
  94055. 0x0015: 'EXP',
  94056. 0x0016: 'LN',
  94057. 0x0017: 'LOG10',
  94058. 0x0018: 'ABS',
  94059. 0x0019: 'INT',
  94060. 0x001A: 'SIGN',
  94061. 0x001B: 'ROUND',
  94062. 0x001C: 'LOOKUP',
  94063. 0x001D: 'INDEX',
  94064. 0x001E: 'REPT',
  94065. 0x001F: 'MID',
  94066. 0x0020: 'LEN',
  94067. 0x0021: 'VALUE',
  94068. 0x0022: 'TRUE',
  94069. 0x0023: 'FALSE',
  94070. 0x0024: 'AND',
  94071. 0x0025: 'OR',
  94072. 0x0026: 'NOT',
  94073. 0x0027: 'MOD',
  94074. 0x0028: 'DCOUNT',
  94075. 0x0029: 'DSUM',
  94076. 0x002A: 'DAVERAGE',
  94077. 0x002B: 'DMIN',
  94078. 0x002C: 'DMAX',
  94079. 0x002D: 'DSTDEV',
  94080. 0x002E: 'VAR',
  94081. 0x002F: 'DVAR',
  94082. 0x0030: 'TEXT',
  94083. 0x0031: 'LINEST',
  94084. 0x0032: 'TREND',
  94085. 0x0033: 'LOGEST',
  94086. 0x0034: 'GROWTH',
  94087. 0x0035: 'GOTO',
  94088. 0x0036: 'HALT',
  94089. 0x0037: 'RETURN',
  94090. 0x0038: 'PV',
  94091. 0x0039: 'FV',
  94092. 0x003A: 'NPER',
  94093. 0x003B: 'PMT',
  94094. 0x003C: 'RATE',
  94095. 0x003D: 'MIRR',
  94096. 0x003E: 'IRR',
  94097. 0x003F: 'RAND',
  94098. 0x0040: 'MATCH',
  94099. 0x0041: 'DATE',
  94100. 0x0042: 'TIME',
  94101. 0x0043: 'DAY',
  94102. 0x0044: 'MONTH',
  94103. 0x0045: 'YEAR',
  94104. 0x0046: 'WEEKDAY',
  94105. 0x0047: 'HOUR',
  94106. 0x0048: 'MINUTE',
  94107. 0x0049: 'SECOND',
  94108. 0x004A: 'NOW',
  94109. 0x004B: 'AREAS',
  94110. 0x004C: 'ROWS',
  94111. 0x004D: 'COLUMNS',
  94112. 0x004E: 'OFFSET',
  94113. 0x004F: 'ABSREF',
  94114. 0x0050: 'RELREF',
  94115. 0x0051: 'ARGUMENT',
  94116. 0x0052: 'SEARCH',
  94117. 0x0053: 'TRANSPOSE',
  94118. 0x0054: 'ERROR',
  94119. 0x0055: 'STEP',
  94120. 0x0056: 'TYPE',
  94121. 0x0057: 'ECHO',
  94122. 0x0058: 'SET.NAME',
  94123. 0x0059: 'CALLER',
  94124. 0x005A: 'DEREF',
  94125. 0x005B: 'WINDOWS',
  94126. 0x005C: 'SERIES',
  94127. 0x005D: 'DOCUMENTS',
  94128. 0x005E: 'ACTIVE.CELL',
  94129. 0x005F: 'SELECTION',
  94130. 0x0060: 'RESULT',
  94131. 0x0061: 'ATAN2',
  94132. 0x0062: 'ASIN',
  94133. 0x0063: 'ACOS',
  94134. 0x0064: 'CHOOSE',
  94135. 0x0065: 'HLOOKUP',
  94136. 0x0066: 'VLOOKUP',
  94137. 0x0067: 'LINKS',
  94138. 0x0068: 'INPUT',
  94139. 0x0069: 'ISREF',
  94140. 0x006A: 'GET.FORMULA',
  94141. 0x006B: 'GET.NAME',
  94142. 0x006C: 'SET.VALUE',
  94143. 0x006D: 'LOG',
  94144. 0x006E: 'EXEC',
  94145. 0x006F: 'CHAR',
  94146. 0x0070: 'LOWER',
  94147. 0x0071: 'UPPER',
  94148. 0x0072: 'PROPER',
  94149. 0x0073: 'LEFT',
  94150. 0x0074: 'RIGHT',
  94151. 0x0075: 'EXACT',
  94152. 0x0076: 'TRIM',
  94153. 0x0077: 'REPLACE',
  94154. 0x0078: 'SUBSTITUTE',
  94155. 0x0079: 'CODE',
  94156. 0x007A: 'NAMES',
  94157. 0x007B: 'DIRECTORY',
  94158. 0x007C: 'FIND',
  94159. 0x007D: 'CELL',
  94160. 0x007E: 'ISERR',
  94161. 0x007F: 'ISTEXT',
  94162. 0x0080: 'ISNUMBER',
  94163. 0x0081: 'ISBLANK',
  94164. 0x0082: 'T',
  94165. 0x0083: 'N',
  94166. 0x0084: 'FOPEN',
  94167. 0x0085: 'FCLOSE',
  94168. 0x0086: 'FSIZE',
  94169. 0x0087: 'FREADLN',
  94170. 0x0088: 'FREAD',
  94171. 0x0089: 'FWRITELN',
  94172. 0x008A: 'FWRITE',
  94173. 0x008B: 'FPOS',
  94174. 0x008C: 'DATEVALUE',
  94175. 0x008D: 'TIMEVALUE',
  94176. 0x008E: 'SLN',
  94177. 0x008F: 'SYD',
  94178. 0x0090: 'DDB',
  94179. 0x0091: 'GET.DEF',
  94180. 0x0092: 'REFTEXT',
  94181. 0x0093: 'TEXTREF',
  94182. 0x0094: 'INDIRECT',
  94183. 0x0095: 'REGISTER',
  94184. 0x0096: 'CALL',
  94185. 0x0097: 'ADD.BAR',
  94186. 0x0098: 'ADD.MENU',
  94187. 0x0099: 'ADD.COMMAND',
  94188. 0x009A: 'ENABLE.COMMAND',
  94189. 0x009B: 'CHECK.COMMAND',
  94190. 0x009C: 'RENAME.COMMAND',
  94191. 0x009D: 'SHOW.BAR',
  94192. 0x009E: 'DELETE.MENU',
  94193. 0x009F: 'DELETE.COMMAND',
  94194. 0x00A0: 'GET.CHART.ITEM',
  94195. 0x00A1: 'DIALOG.BOX',
  94196. 0x00A2: 'CLEAN',
  94197. 0x00A3: 'MDETERM',
  94198. 0x00A4: 'MINVERSE',
  94199. 0x00A5: 'MMULT',
  94200. 0x00A6: 'FILES',
  94201. 0x00A7: 'IPMT',
  94202. 0x00A8: 'PPMT',
  94203. 0x00A9: 'COUNTA',
  94204. 0x00AA: 'CANCEL.KEY',
  94205. 0x00AB: 'FOR',
  94206. 0x00AC: 'WHILE',
  94207. 0x00AD: 'BREAK',
  94208. 0x00AE: 'NEXT',
  94209. 0x00AF: 'INITIATE',
  94210. 0x00B0: 'REQUEST',
  94211. 0x00B1: 'POKE',
  94212. 0x00B2: 'EXECUTE',
  94213. 0x00B3: 'TERMINATE',
  94214. 0x00B4: 'RESTART',
  94215. 0x00B5: 'HELP',
  94216. 0x00B6: 'GET.BAR',
  94217. 0x00B7: 'PRODUCT',
  94218. 0x00B8: 'FACT',
  94219. 0x00B9: 'GET.CELL',
  94220. 0x00BA: 'GET.WORKSPACE',
  94221. 0x00BB: 'GET.WINDOW',
  94222. 0x00BC: 'GET.DOCUMENT',
  94223. 0x00BD: 'DPRODUCT',
  94224. 0x00BE: 'ISNONTEXT',
  94225. 0x00BF: 'GET.NOTE',
  94226. 0x00C0: 'NOTE',
  94227. 0x00C1: 'STDEVP',
  94228. 0x00C2: 'VARP',
  94229. 0x00C3: 'DSTDEVP',
  94230. 0x00C4: 'DVARP',
  94231. 0x00C5: 'TRUNC',
  94232. 0x00C6: 'ISLOGICAL',
  94233. 0x00C7: 'DCOUNTA',
  94234. 0x00C8: 'DELETE.BAR',
  94235. 0x00C9: 'UNREGISTER',
  94236. 0x00CC: 'USDOLLAR',
  94237. 0x00CD: 'FINDB',
  94238. 0x00CE: 'SEARCHB',
  94239. 0x00CF: 'REPLACEB',
  94240. 0x00D0: 'LEFTB',
  94241. 0x00D1: 'RIGHTB',
  94242. 0x00D2: 'MIDB',
  94243. 0x00D3: 'LENB',
  94244. 0x00D4: 'ROUNDUP',
  94245. 0x00D5: 'ROUNDDOWN',
  94246. 0x00D6: 'ASC',
  94247. 0x00D7: 'DBCS',
  94248. 0x00D8: 'RANK',
  94249. 0x00DB: 'ADDRESS',
  94250. 0x00DC: 'DAYS360',
  94251. 0x00DD: 'TODAY',
  94252. 0x00DE: 'VDB',
  94253. 0x00DF: 'ELSE',
  94254. 0x00E0: 'ELSE.IF',
  94255. 0x00E1: 'END.IF',
  94256. 0x00E2: 'FOR.CELL',
  94257. 0x00E3: 'MEDIAN',
  94258. 0x00E4: 'SUMPRODUCT',
  94259. 0x00E5: 'SINH',
  94260. 0x00E6: 'COSH',
  94261. 0x00E7: 'TANH',
  94262. 0x00E8: 'ASINH',
  94263. 0x00E9: 'ACOSH',
  94264. 0x00EA: 'ATANH',
  94265. 0x00EB: 'DGET',
  94266. 0x00EC: 'CREATE.OBJECT',
  94267. 0x00ED: 'VOLATILE',
  94268. 0x00EE: 'LAST.ERROR',
  94269. 0x00EF: 'CUSTOM.UNDO',
  94270. 0x00F0: 'CUSTOM.REPEAT',
  94271. 0x00F1: 'FORMULA.CONVERT',
  94272. 0x00F2: 'GET.LINK.INFO',
  94273. 0x00F3: 'TEXT.BOX',
  94274. 0x00F4: 'INFO',
  94275. 0x00F5: 'GROUP',
  94276. 0x00F6: 'GET.OBJECT',
  94277. 0x00F7: 'DB',
  94278. 0x00F8: 'PAUSE',
  94279. 0x00FB: 'RESUME',
  94280. 0x00FC: 'FREQUENCY',
  94281. 0x00FD: 'ADD.TOOLBAR',
  94282. 0x00FE: 'DELETE.TOOLBAR',
  94283. 0x00FF: 'User',
  94284. 0x0100: 'RESET.TOOLBAR',
  94285. 0x0101: 'EVALUATE',
  94286. 0x0102: 'GET.TOOLBAR',
  94287. 0x0103: 'GET.TOOL',
  94288. 0x0104: 'SPELLING.CHECK',
  94289. 0x0105: 'ERROR.TYPE',
  94290. 0x0106: 'APP.TITLE',
  94291. 0x0107: 'WINDOW.TITLE',
  94292. 0x0108: 'SAVE.TOOLBAR',
  94293. 0x0109: 'ENABLE.TOOL',
  94294. 0x010A: 'PRESS.TOOL',
  94295. 0x010B: 'REGISTER.ID',
  94296. 0x010C: 'GET.WORKBOOK',
  94297. 0x010D: 'AVEDEV',
  94298. 0x010E: 'BETADIST',
  94299. 0x010F: 'GAMMALN',
  94300. 0x0110: 'BETAINV',
  94301. 0x0111: 'BINOMDIST',
  94302. 0x0112: 'CHIDIST',
  94303. 0x0113: 'CHIINV',
  94304. 0x0114: 'COMBIN',
  94305. 0x0115: 'CONFIDENCE',
  94306. 0x0116: 'CRITBINOM',
  94307. 0x0117: 'EVEN',
  94308. 0x0118: 'EXPONDIST',
  94309. 0x0119: 'FDIST',
  94310. 0x011A: 'FINV',
  94311. 0x011B: 'FISHER',
  94312. 0x011C: 'FISHERINV',
  94313. 0x011D: 'FLOOR',
  94314. 0x011E: 'GAMMADIST',
  94315. 0x011F: 'GAMMAINV',
  94316. 0x0120: 'CEILING',
  94317. 0x0121: 'HYPGEOMDIST',
  94318. 0x0122: 'LOGNORMDIST',
  94319. 0x0123: 'LOGINV',
  94320. 0x0124: 'NEGBINOMDIST',
  94321. 0x0125: 'NORMDIST',
  94322. 0x0126: 'NORMSDIST',
  94323. 0x0127: 'NORMINV',
  94324. 0x0128: 'NORMSINV',
  94325. 0x0129: 'STANDARDIZE',
  94326. 0x012A: 'ODD',
  94327. 0x012B: 'PERMUT',
  94328. 0x012C: 'POISSON',
  94329. 0x012D: 'TDIST',
  94330. 0x012E: 'WEIBULL',
  94331. 0x012F: 'SUMXMY2',
  94332. 0x0130: 'SUMX2MY2',
  94333. 0x0131: 'SUMX2PY2',
  94334. 0x0132: 'CHITEST',
  94335. 0x0133: 'CORREL',
  94336. 0x0134: 'COVAR',
  94337. 0x0135: 'FORECAST',
  94338. 0x0136: 'FTEST',
  94339. 0x0137: 'INTERCEPT',
  94340. 0x0138: 'PEARSON',
  94341. 0x0139: 'RSQ',
  94342. 0x013A: 'STEYX',
  94343. 0x013B: 'SLOPE',
  94344. 0x013C: 'TTEST',
  94345. 0x013D: 'PROB',
  94346. 0x013E: 'DEVSQ',
  94347. 0x013F: 'GEOMEAN',
  94348. 0x0140: 'HARMEAN',
  94349. 0x0141: 'SUMSQ',
  94350. 0x0142: 'KURT',
  94351. 0x0143: 'SKEW',
  94352. 0x0144: 'ZTEST',
  94353. 0x0145: 'LARGE',
  94354. 0x0146: 'SMALL',
  94355. 0x0147: 'QUARTILE',
  94356. 0x0148: 'PERCENTILE',
  94357. 0x0149: 'PERCENTRANK',
  94358. 0x014A: 'MODE',
  94359. 0x014B: 'TRIMMEAN',
  94360. 0x014C: 'TINV',
  94361. 0x014E: 'MOVIE.COMMAND',
  94362. 0x014F: 'GET.MOVIE',
  94363. 0x0150: 'CONCATENATE',
  94364. 0x0151: 'POWER',
  94365. 0x0152: 'PIVOT.ADD.DATA',
  94366. 0x0153: 'GET.PIVOT.TABLE',
  94367. 0x0154: 'GET.PIVOT.FIELD',
  94368. 0x0155: 'GET.PIVOT.ITEM',
  94369. 0x0156: 'RADIANS',
  94370. 0x0157: 'DEGREES',
  94371. 0x0158: 'SUBTOTAL',
  94372. 0x0159: 'SUMIF',
  94373. 0x015A: 'COUNTIF',
  94374. 0x015B: 'COUNTBLANK',
  94375. 0x015C: 'SCENARIO.GET',
  94376. 0x015D: 'OPTIONS.LISTS.GET',
  94377. 0x015E: 'ISPMT',
  94378. 0x015F: 'DATEDIF',
  94379. 0x0160: 'DATESTRING',
  94380. 0x0161: 'NUMBERSTRING',
  94381. 0x0162: 'ROMAN',
  94382. 0x0163: 'OPEN.DIALOG',
  94383. 0x0164: 'SAVE.DIALOG',
  94384. 0x0165: 'VIEW.GET',
  94385. 0x0166: 'GETPIVOTDATA',
  94386. 0x0167: 'HYPERLINK',
  94387. 0x0168: 'PHONETIC',
  94388. 0x0169: 'AVERAGEA',
  94389. 0x016A: 'MAXA',
  94390. 0x016B: 'MINA',
  94391. 0x016C: 'STDEVPA',
  94392. 0x016D: 'VARPA',
  94393. 0x016E: 'STDEVA',
  94394. 0x016F: 'VARA',
  94395. 0x0170: 'BAHTTEXT',
  94396. 0x0171: 'THAIDAYOFWEEK',
  94397. 0x0172: 'THAIDIGIT',
  94398. 0x0173: 'THAIMONTHOFYEAR',
  94399. 0x0174: 'THAINUMSOUND',
  94400. 0x0175: 'THAINUMSTRING',
  94401. 0x0176: 'THAISTRINGLENGTH',
  94402. 0x0177: 'ISTHAIDIGIT',
  94403. 0x0178: 'ROUNDBAHTDOWN',
  94404. 0x0179: 'ROUNDBAHTUP',
  94405. 0x017A: 'THAIYEAR',
  94406. 0x017B: 'RTD',
  94407. 0x017C: 'CUBEVALUE',
  94408. 0x017D: 'CUBEMEMBER',
  94409. 0x017E: 'CUBEMEMBERPROPERTY',
  94410. 0x017F: 'CUBERANKEDMEMBER',
  94411. 0x0180: 'HEX2BIN',
  94412. 0x0181: 'HEX2DEC',
  94413. 0x0182: 'HEX2OCT',
  94414. 0x0183: 'DEC2BIN',
  94415. 0x0184: 'DEC2HEX',
  94416. 0x0185: 'DEC2OCT',
  94417. 0x0186: 'OCT2BIN',
  94418. 0x0187: 'OCT2HEX',
  94419. 0x0188: 'OCT2DEC',
  94420. 0x0189: 'BIN2DEC',
  94421. 0x018A: 'BIN2OCT',
  94422. 0x018B: 'BIN2HEX',
  94423. 0x018C: 'IMSUB',
  94424. 0x018D: 'IMDIV',
  94425. 0x018E: 'IMPOWER',
  94426. 0x018F: 'IMABS',
  94427. 0x0190: 'IMSQRT',
  94428. 0x0191: 'IMLN',
  94429. 0x0192: 'IMLOG2',
  94430. 0x0193: 'IMLOG10',
  94431. 0x0194: 'IMSIN',
  94432. 0x0195: 'IMCOS',
  94433. 0x0196: 'IMEXP',
  94434. 0x0197: 'IMARGUMENT',
  94435. 0x0198: 'IMCONJUGATE',
  94436. 0x0199: 'IMAGINARY',
  94437. 0x019A: 'IMREAL',
  94438. 0x019B: 'COMPLEX',
  94439. 0x019C: 'IMSUM',
  94440. 0x019D: 'IMPRODUCT',
  94441. 0x019E: 'SERIESSUM',
  94442. 0x019F: 'FACTDOUBLE',
  94443. 0x01A0: 'SQRTPI',
  94444. 0x01A1: 'QUOTIENT',
  94445. 0x01A2: 'DELTA',
  94446. 0x01A3: 'GESTEP',
  94447. 0x01A4: 'ISEVEN',
  94448. 0x01A5: 'ISODD',
  94449. 0x01A6: 'MROUND',
  94450. 0x01A7: 'ERF',
  94451. 0x01A8: 'ERFC',
  94452. 0x01A9: 'BESSELJ',
  94453. 0x01AA: 'BESSELK',
  94454. 0x01AB: 'BESSELY',
  94455. 0x01AC: 'BESSELI',
  94456. 0x01AD: 'XIRR',
  94457. 0x01AE: 'XNPV',
  94458. 0x01AF: 'PRICEMAT',
  94459. 0x01B0: 'YIELDMAT',
  94460. 0x01B1: 'INTRATE',
  94461. 0x01B2: 'RECEIVED',
  94462. 0x01B3: 'DISC',
  94463. 0x01B4: 'PRICEDISC',
  94464. 0x01B5: 'YIELDDISC',
  94465. 0x01B6: 'TBILLEQ',
  94466. 0x01B7: 'TBILLPRICE',
  94467. 0x01B8: 'TBILLYIELD',
  94468. 0x01B9: 'PRICE',
  94469. 0x01BA: 'YIELD',
  94470. 0x01BB: 'DOLLARDE',
  94471. 0x01BC: 'DOLLARFR',
  94472. 0x01BD: 'NOMINAL',
  94473. 0x01BE: 'EFFECT',
  94474. 0x01BF: 'CUMPRINC',
  94475. 0x01C0: 'CUMIPMT',
  94476. 0x01C1: 'EDATE',
  94477. 0x01C2: 'EOMONTH',
  94478. 0x01C3: 'YEARFRAC',
  94479. 0x01C4: 'COUPDAYBS',
  94480. 0x01C5: 'COUPDAYS',
  94481. 0x01C6: 'COUPDAYSNC',
  94482. 0x01C7: 'COUPNCD',
  94483. 0x01C8: 'COUPNUM',
  94484. 0x01C9: 'COUPPCD',
  94485. 0x01CA: 'DURATION',
  94486. 0x01CB: 'MDURATION',
  94487. 0x01CC: 'ODDLPRICE',
  94488. 0x01CD: 'ODDLYIELD',
  94489. 0x01CE: 'ODDFPRICE',
  94490. 0x01CF: 'ODDFYIELD',
  94491. 0x01D0: 'RANDBETWEEN',
  94492. 0x01D1: 'WEEKNUM',
  94493. 0x01D2: 'AMORDEGRC',
  94494. 0x01D3: 'AMORLINC',
  94495. 0x01D4: 'CONVERT',
  94496. 0x02D4: 'SHEETJS',
  94497. 0x01D5: 'ACCRINT',
  94498. 0x01D6: 'ACCRINTM',
  94499. 0x01D7: 'WORKDAY',
  94500. 0x01D8: 'NETWORKDAYS',
  94501. 0x01D9: 'GCD',
  94502. 0x01DA: 'MULTINOMIAL',
  94503. 0x01DB: 'LCM',
  94504. 0x01DC: 'FVSCHEDULE',
  94505. 0x01DD: 'CUBEKPIMEMBER',
  94506. 0x01DE: 'CUBESET',
  94507. 0x01DF: 'CUBESETCOUNT',
  94508. 0x01E0: 'IFERROR',
  94509. 0x01E1: 'COUNTIFS',
  94510. 0x01E2: 'SUMIFS',
  94511. 0x01E3: 'AVERAGEIF',
  94512. 0x01E4: 'AVERAGEIFS'
  94513. };
  94514. var FtabArgc = {
  94515. 0x0002: 1, /* ISNA */
  94516. 0x0003: 1, /* ISERROR */
  94517. 0x000A: 0, /* NA */
  94518. 0x000F: 1, /* SIN */
  94519. 0x0010: 1, /* COS */
  94520. 0x0011: 1, /* TAN */
  94521. 0x0012: 1, /* ATAN */
  94522. 0x0013: 0, /* PI */
  94523. 0x0014: 1, /* SQRT */
  94524. 0x0015: 1, /* EXP */
  94525. 0x0016: 1, /* LN */
  94526. 0x0017: 1, /* LOG10 */
  94527. 0x0018: 1, /* ABS */
  94528. 0x0019: 1, /* INT */
  94529. 0x001A: 1, /* SIGN */
  94530. 0x001B: 2, /* ROUND */
  94531. 0x001E: 2, /* REPT */
  94532. 0x001F: 3, /* MID */
  94533. 0x0020: 1, /* LEN */
  94534. 0x0021: 1, /* VALUE */
  94535. 0x0022: 0, /* TRUE */
  94536. 0x0023: 0, /* FALSE */
  94537. 0x0026: 1, /* NOT */
  94538. 0x0027: 2, /* MOD */
  94539. 0x0028: 3, /* DCOUNT */
  94540. 0x0029: 3, /* DSUM */
  94541. 0x002A: 3, /* DAVERAGE */
  94542. 0x002B: 3, /* DMIN */
  94543. 0x002C: 3, /* DMAX */
  94544. 0x002D: 3, /* DSTDEV */
  94545. 0x002F: 3, /* DVAR */
  94546. 0x0030: 2, /* TEXT */
  94547. 0x0035: 1, /* GOTO */
  94548. 0x003D: 3, /* MIRR */
  94549. 0x003F: 0, /* RAND */
  94550. 0x0041: 3, /* DATE */
  94551. 0x0042: 3, /* TIME */
  94552. 0x0043: 1, /* DAY */
  94553. 0x0044: 1, /* MONTH */
  94554. 0x0045: 1, /* YEAR */
  94555. 0x0046: 1, /* WEEKDAY */
  94556. 0x0047: 1, /* HOUR */
  94557. 0x0048: 1, /* MINUTE */
  94558. 0x0049: 1, /* SECOND */
  94559. 0x004A: 0, /* NOW */
  94560. 0x004B: 1, /* AREAS */
  94561. 0x004C: 1, /* ROWS */
  94562. 0x004D: 1, /* COLUMNS */
  94563. 0x004F: 2, /* ABSREF */
  94564. 0x0050: 2, /* RELREF */
  94565. 0x0053: 1, /* TRANSPOSE */
  94566. 0x0055: 0, /* STEP */
  94567. 0x0056: 1, /* TYPE */
  94568. 0x0059: 0, /* CALLER */
  94569. 0x005A: 1, /* DEREF */
  94570. 0x005E: 0, /* ACTIVE.CELL */
  94571. 0x005F: 0, /* SELECTION */
  94572. 0x0061: 2, /* ATAN2 */
  94573. 0x0062: 1, /* ASIN */
  94574. 0x0063: 1, /* ACOS */
  94575. 0x0065: 3, /* HLOOKUP */
  94576. 0x0066: 3, /* VLOOKUP */
  94577. 0x0069: 1, /* ISREF */
  94578. 0x006A: 1, /* GET.FORMULA */
  94579. 0x006C: 2, /* SET.VALUE */
  94580. 0x006F: 1, /* CHAR */
  94581. 0x0070: 1, /* LOWER */
  94582. 0x0071: 1, /* UPPER */
  94583. 0x0072: 1, /* PROPER */
  94584. 0x0075: 2, /* EXACT */
  94585. 0x0076: 1, /* TRIM */
  94586. 0x0077: 4, /* REPLACE */
  94587. 0x0079: 1, /* CODE */
  94588. 0x007E: 1, /* ISERR */
  94589. 0x007F: 1, /* ISTEXT */
  94590. 0x0080: 1, /* ISNUMBER */
  94591. 0x0081: 1, /* ISBLANK */
  94592. 0x0082: 1, /* T */
  94593. 0x0083: 1, /* N */
  94594. 0x0085: 1, /* FCLOSE */
  94595. 0x0086: 1, /* FSIZE */
  94596. 0x0087: 1, /* FREADLN */
  94597. 0x0088: 2, /* FREAD */
  94598. 0x0089: 2, /* FWRITELN */
  94599. 0x008A: 2, /* FWRITE */
  94600. 0x008C: 1, /* DATEVALUE */
  94601. 0x008D: 1, /* TIMEVALUE */
  94602. 0x008E: 3, /* SLN */
  94603. 0x008F: 4, /* SYD */
  94604. 0x0090: 4, /* DDB */
  94605. 0x00A1: 1, /* DIALOG.BOX */
  94606. 0x00A2: 1, /* CLEAN */
  94607. 0x00A3: 1, /* MDETERM */
  94608. 0x00A4: 1, /* MINVERSE */
  94609. 0x00A5: 2, /* MMULT */
  94610. 0x00AC: 1, /* WHILE */
  94611. 0x00AF: 2, /* INITIATE */
  94612. 0x00B0: 2, /* REQUEST */
  94613. 0x00B1: 3, /* POKE */
  94614. 0x00B2: 2, /* EXECUTE */
  94615. 0x00B3: 1, /* TERMINATE */
  94616. 0x00B8: 1, /* FACT */
  94617. 0x00BA: 1, /* GET.WORKSPACE */
  94618. 0x00BD: 3, /* DPRODUCT */
  94619. 0x00BE: 1, /* ISNONTEXT */
  94620. 0x00C3: 3, /* DSTDEVP */
  94621. 0x00C4: 3, /* DVARP */
  94622. 0x00C5: 1, /* TRUNC */
  94623. 0x00C6: 1, /* ISLOGICAL */
  94624. 0x00C7: 3, /* DCOUNTA */
  94625. 0x00C9: 1, /* UNREGISTER */
  94626. 0x00CF: 4, /* REPLACEB */
  94627. 0x00D2: 3, /* MIDB */
  94628. 0x00D3: 1, /* LENB */
  94629. 0x00D4: 2, /* ROUNDUP */
  94630. 0x00D5: 2, /* ROUNDDOWN */
  94631. 0x00D6: 1, /* ASC */
  94632. 0x00D7: 1, /* DBCS */
  94633. 0x00E1: 0, /* END.IF */
  94634. 0x00E5: 1, /* SINH */
  94635. 0x00E6: 1, /* COSH */
  94636. 0x00E7: 1, /* TANH */
  94637. 0x00E8: 1, /* ASINH */
  94638. 0x00E9: 1, /* ACOSH */
  94639. 0x00EA: 1, /* ATANH */
  94640. 0x00EB: 3, /* DGET */
  94641. 0x00F4: 1, /* INFO */
  94642. 0x00F7: 4, /* DB */
  94643. 0x00FC: 2, /* FREQUENCY */
  94644. 0x0101: 1, /* EVALUATE */
  94645. 0x0105: 1, /* ERROR.TYPE */
  94646. 0x010F: 1, /* GAMMALN */
  94647. 0x0111: 4, /* BINOMDIST */
  94648. 0x0112: 2, /* CHIDIST */
  94649. 0x0113: 2, /* CHIINV */
  94650. 0x0114: 2, /* COMBIN */
  94651. 0x0115: 3, /* CONFIDENCE */
  94652. 0x0116: 3, /* CRITBINOM */
  94653. 0x0117: 1, /* EVEN */
  94654. 0x0118: 3, /* EXPONDIST */
  94655. 0x0119: 3, /* FDIST */
  94656. 0x011A: 3, /* FINV */
  94657. 0x011B: 1, /* FISHER */
  94658. 0x011C: 1, /* FISHERINV */
  94659. 0x011D: 2, /* FLOOR */
  94660. 0x011E: 4, /* GAMMADIST */
  94661. 0x011F: 3, /* GAMMAINV */
  94662. 0x0120: 2, /* CEILING */
  94663. 0x0121: 4, /* HYPGEOMDIST */
  94664. 0x0122: 3, /* LOGNORMDIST */
  94665. 0x0123: 3, /* LOGINV */
  94666. 0x0124: 3, /* NEGBINOMDIST */
  94667. 0x0125: 4, /* NORMDIST */
  94668. 0x0126: 1, /* NORMSDIST */
  94669. 0x0127: 3, /* NORMINV */
  94670. 0x0128: 1, /* NORMSINV */
  94671. 0x0129: 3, /* STANDARDIZE */
  94672. 0x012A: 1, /* ODD */
  94673. 0x012B: 2, /* PERMUT */
  94674. 0x012C: 3, /* POISSON */
  94675. 0x012D: 3, /* TDIST */
  94676. 0x012E: 4, /* WEIBULL */
  94677. 0x012F: 2, /* SUMXMY2 */
  94678. 0x0130: 2, /* SUMX2MY2 */
  94679. 0x0131: 2, /* SUMX2PY2 */
  94680. 0x0132: 2, /* CHITEST */
  94681. 0x0133: 2, /* CORREL */
  94682. 0x0134: 2, /* COVAR */
  94683. 0x0135: 3, /* FORECAST */
  94684. 0x0136: 2, /* FTEST */
  94685. 0x0137: 2, /* INTERCEPT */
  94686. 0x0138: 2, /* PEARSON */
  94687. 0x0139: 2, /* RSQ */
  94688. 0x013A: 2, /* STEYX */
  94689. 0x013B: 2, /* SLOPE */
  94690. 0x013C: 4, /* TTEST */
  94691. 0x0145: 2, /* LARGE */
  94692. 0x0146: 2, /* SMALL */
  94693. 0x0147: 2, /* QUARTILE */
  94694. 0x0148: 2, /* PERCENTILE */
  94695. 0x014B: 2, /* TRIMMEAN */
  94696. 0x014C: 2, /* TINV */
  94697. 0x0151: 2, /* POWER */
  94698. 0x0156: 1, /* RADIANS */
  94699. 0x0157: 1, /* DEGREES */
  94700. 0x015A: 2, /* COUNTIF */
  94701. 0x015B: 1, /* COUNTBLANK */
  94702. 0x015E: 4, /* ISPMT */
  94703. 0x015F: 3, /* DATEDIF */
  94704. 0x0160: 1, /* DATESTRING */
  94705. 0x0161: 2, /* NUMBERSTRING */
  94706. 0x0168: 1, /* PHONETIC */
  94707. 0x0170: 1, /* BAHTTEXT */
  94708. 0x0171: 1, /* THAIDAYOFWEEK */
  94709. 0x0172: 1, /* THAIDIGIT */
  94710. 0x0173: 1, /* THAIMONTHOFYEAR */
  94711. 0x0174: 1, /* THAINUMSOUND */
  94712. 0x0175: 1, /* THAINUMSTRING */
  94713. 0x0176: 1, /* THAISTRINGLENGTH */
  94714. 0x0177: 1, /* ISTHAIDIGIT */
  94715. 0x0178: 1, /* ROUNDBAHTDOWN */
  94716. 0x0179: 1, /* ROUNDBAHTUP */
  94717. 0x017A: 1, /* THAIYEAR */
  94718. 0x017E: 3, /* CUBEMEMBERPROPERTY */
  94719. 0x0181: 1, /* HEX2DEC */
  94720. 0x0188: 1, /* OCT2DEC */
  94721. 0x0189: 1, /* BIN2DEC */
  94722. 0x018C: 2, /* IMSUB */
  94723. 0x018D: 2, /* IMDIV */
  94724. 0x018E: 2, /* IMPOWER */
  94725. 0x018F: 1, /* IMABS */
  94726. 0x0190: 1, /* IMSQRT */
  94727. 0x0191: 1, /* IMLN */
  94728. 0x0192: 1, /* IMLOG2 */
  94729. 0x0193: 1, /* IMLOG10 */
  94730. 0x0194: 1, /* IMSIN */
  94731. 0x0195: 1, /* IMCOS */
  94732. 0x0196: 1, /* IMEXP */
  94733. 0x0197: 1, /* IMARGUMENT */
  94734. 0x0198: 1, /* IMCONJUGATE */
  94735. 0x0199: 1, /* IMAGINARY */
  94736. 0x019A: 1, /* IMREAL */
  94737. 0x019E: 4, /* SERIESSUM */
  94738. 0x019F: 1, /* FACTDOUBLE */
  94739. 0x01A0: 1, /* SQRTPI */
  94740. 0x01A1: 2, /* QUOTIENT */
  94741. 0x01A4: 1, /* ISEVEN */
  94742. 0x01A5: 1, /* ISODD */
  94743. 0x01A6: 2, /* MROUND */
  94744. 0x01A8: 1, /* ERFC */
  94745. 0x01A9: 2, /* BESSELJ */
  94746. 0x01AA: 2, /* BESSELK */
  94747. 0x01AB: 2, /* BESSELY */
  94748. 0x01AC: 2, /* BESSELI */
  94749. 0x01AE: 3, /* XNPV */
  94750. 0x01B6: 3, /* TBILLEQ */
  94751. 0x01B7: 3, /* TBILLPRICE */
  94752. 0x01B8: 3, /* TBILLYIELD */
  94753. 0x01BB: 2, /* DOLLARDE */
  94754. 0x01BC: 2, /* DOLLARFR */
  94755. 0x01BD: 2, /* NOMINAL */
  94756. 0x01BE: 2, /* EFFECT */
  94757. 0x01BF: 6, /* CUMPRINC */
  94758. 0x01C0: 6, /* CUMIPMT */
  94759. 0x01C1: 2, /* EDATE */
  94760. 0x01C2: 2, /* EOMONTH */
  94761. 0x01D0: 2, /* RANDBETWEEN */
  94762. 0x01D4: 3, /* CONVERT */
  94763. 0x01DC: 2, /* FVSCHEDULE */
  94764. 0x01DF: 1, /* CUBESETCOUNT */
  94765. 0x01E0: 2, /* IFERROR */
  94766. 0xFFFF: 0
  94767. };
  94768. /* [MS-XLSX] 2.2.3 Functions */
  94769. /* [MS-XLSB] 2.5.97.10 Ftab */
  94770. var XLSXFutureFunctions = {
  94771. "_xlfn.ACOT": "ACOT",
  94772. "_xlfn.ACOTH": "ACOTH",
  94773. "_xlfn.AGGREGATE": "AGGREGATE",
  94774. "_xlfn.ARABIC": "ARABIC",
  94775. "_xlfn.AVERAGEIF": "AVERAGEIF",
  94776. "_xlfn.AVERAGEIFS": "AVERAGEIFS",
  94777. "_xlfn.BASE": "BASE",
  94778. "_xlfn.BETA.DIST": "BETA.DIST",
  94779. "_xlfn.BETA.INV": "BETA.INV",
  94780. "_xlfn.BINOM.DIST": "BINOM.DIST",
  94781. "_xlfn.BINOM.DIST.RANGE": "BINOM.DIST.RANGE",
  94782. "_xlfn.BINOM.INV": "BINOM.INV",
  94783. "_xlfn.BITAND": "BITAND",
  94784. "_xlfn.BITLSHIFT": "BITLSHIFT",
  94785. "_xlfn.BITOR": "BITOR",
  94786. "_xlfn.BITRSHIFT": "BITRSHIFT",
  94787. "_xlfn.BITXOR": "BITXOR",
  94788. "_xlfn.CEILING.MATH": "CEILING.MATH",
  94789. "_xlfn.CEILING.PRECISE": "CEILING.PRECISE",
  94790. "_xlfn.CHISQ.DIST": "CHISQ.DIST",
  94791. "_xlfn.CHISQ.DIST.RT": "CHISQ.DIST.RT",
  94792. "_xlfn.CHISQ.INV": "CHISQ.INV",
  94793. "_xlfn.CHISQ.INV.RT": "CHISQ.INV.RT",
  94794. "_xlfn.CHISQ.TEST": "CHISQ.TEST",
  94795. "_xlfn.COMBINA": "COMBINA",
  94796. "_xlfn.CONCAT": "CONCAT",
  94797. "_xlfn.CONFIDENCE.NORM": "CONFIDENCE.NORM",
  94798. "_xlfn.CONFIDENCE.T": "CONFIDENCE.T",
  94799. "_xlfn.COT": "COT",
  94800. "_xlfn.COTH": "COTH",
  94801. "_xlfn.COUNTIFS": "COUNTIFS",
  94802. "_xlfn.COVARIANCE.P": "COVARIANCE.P",
  94803. "_xlfn.COVARIANCE.S": "COVARIANCE.S",
  94804. "_xlfn.CSC": "CSC",
  94805. "_xlfn.CSCH": "CSCH",
  94806. "_xlfn.DAYS": "DAYS",
  94807. "_xlfn.DECIMAL": "DECIMAL",
  94808. "_xlfn.ECMA.CEILING": "ECMA.CEILING",
  94809. "_xlfn.ERF.PRECISE": "ERF.PRECISE",
  94810. "_xlfn.ERFC.PRECISE": "ERFC.PRECISE",
  94811. "_xlfn.EXPON.DIST": "EXPON.DIST",
  94812. "_xlfn.F.DIST": "F.DIST",
  94813. "_xlfn.F.DIST.RT": "F.DIST.RT",
  94814. "_xlfn.F.INV": "F.INV",
  94815. "_xlfn.F.INV.RT": "F.INV.RT",
  94816. "_xlfn.F.TEST": "F.TEST",
  94817. "_xlfn.FILTERXML": "FILTERXML",
  94818. "_xlfn.FLOOR.MATH": "FLOOR.MATH",
  94819. "_xlfn.FLOOR.PRECISE": "FLOOR.PRECISE",
  94820. "_xlfn.FORECAST.ETS": "FORECAST.ETS",
  94821. "_xlfn.FORECAST.ETS.CONFINT": "FORECAST.ETS.CONFINT",
  94822. "_xlfn.FORECAST.ETS.SEASONALITY": "FORECAST.ETS.SEASONALITY",
  94823. "_xlfn.FORECAST.ETS.STAT": "FORECAST.ETS.STAT",
  94824. "_xlfn.FORECAST.LINEAR": "FORECAST.LINEAR",
  94825. "_xlfn.FORMULATEXT": "FORMULATEXT",
  94826. "_xlfn.GAMMA": "GAMMA",
  94827. "_xlfn.GAMMA.DIST": "GAMMA.DIST",
  94828. "_xlfn.GAMMA.INV": "GAMMA.INV",
  94829. "_xlfn.GAMMALN.PRECISE": "GAMMALN.PRECISE",
  94830. "_xlfn.GAUSS": "GAUSS",
  94831. "_xlfn.HYPGEOM.DIST": "HYPGEOM.DIST",
  94832. "_xlfn.IFERROR": "IFERROR",
  94833. "_xlfn.IFNA": "IFNA",
  94834. "_xlfn.IFS": "IFS",
  94835. "_xlfn.IMCOSH": "IMCOSH",
  94836. "_xlfn.IMCOT": "IMCOT",
  94837. "_xlfn.IMCSC": "IMCSC",
  94838. "_xlfn.IMCSCH": "IMCSCH",
  94839. "_xlfn.IMSEC": "IMSEC",
  94840. "_xlfn.IMSECH": "IMSECH",
  94841. "_xlfn.IMSINH": "IMSINH",
  94842. "_xlfn.IMTAN": "IMTAN",
  94843. "_xlfn.ISFORMULA": "ISFORMULA",
  94844. "_xlfn.ISO.CEILING": "ISO.CEILING",
  94845. "_xlfn.ISOWEEKNUM": "ISOWEEKNUM",
  94846. "_xlfn.LOGNORM.DIST": "LOGNORM.DIST",
  94847. "_xlfn.LOGNORM.INV": "LOGNORM.INV",
  94848. "_xlfn.MAXIFS": "MAXIFS",
  94849. "_xlfn.MINIFS": "MINIFS",
  94850. "_xlfn.MODE.MULT": "MODE.MULT",
  94851. "_xlfn.MODE.SNGL": "MODE.SNGL",
  94852. "_xlfn.MUNIT": "MUNIT",
  94853. "_xlfn.NEGBINOM.DIST": "NEGBINOM.DIST",
  94854. "_xlfn.NETWORKDAYS.INTL": "NETWORKDAYS.INTL",
  94855. "_xlfn.NIGBINOM": "NIGBINOM",
  94856. "_xlfn.NORM.DIST": "NORM.DIST",
  94857. "_xlfn.NORM.INV": "NORM.INV",
  94858. "_xlfn.NORM.S.DIST": "NORM.S.DIST",
  94859. "_xlfn.NORM.S.INV": "NORM.S.INV",
  94860. "_xlfn.NUMBERVALUE": "NUMBERVALUE",
  94861. "_xlfn.PDURATION": "PDURATION",
  94862. "_xlfn.PERCENTILE.EXC": "PERCENTILE.EXC",
  94863. "_xlfn.PERCENTILE.INC": "PERCENTILE.INC",
  94864. "_xlfn.PERCENTRANK.EXC": "PERCENTRANK.EXC",
  94865. "_xlfn.PERCENTRANK.INC": "PERCENTRANK.INC",
  94866. "_xlfn.PERMUTATIONA": "PERMUTATIONA",
  94867. "_xlfn.PHI": "PHI",
  94868. "_xlfn.POISSON.DIST": "POISSON.DIST",
  94869. "_xlfn.QUARTILE.EXC": "QUARTILE.EXC",
  94870. "_xlfn.QUARTILE.INC": "QUARTILE.INC",
  94871. "_xlfn.QUERYSTRING": "QUERYSTRING",
  94872. "_xlfn.RANK.AVG": "RANK.AVG",
  94873. "_xlfn.RANK.EQ": "RANK.EQ",
  94874. "_xlfn.RRI": "RRI",
  94875. "_xlfn.SEC": "SEC",
  94876. "_xlfn.SECH": "SECH",
  94877. "_xlfn.SHEET": "SHEET",
  94878. "_xlfn.SHEETS": "SHEETS",
  94879. "_xlfn.SKEW.P": "SKEW.P",
  94880. "_xlfn.STDEV.P": "STDEV.P",
  94881. "_xlfn.STDEV.S": "STDEV.S",
  94882. "_xlfn.SUMIFS": "SUMIFS",
  94883. "_xlfn.SWITCH": "SWITCH",
  94884. "_xlfn.T.DIST": "T.DIST",
  94885. "_xlfn.T.DIST.2T": "T.DIST.2T",
  94886. "_xlfn.T.DIST.RT": "T.DIST.RT",
  94887. "_xlfn.T.INV": "T.INV",
  94888. "_xlfn.T.INV.2T": "T.INV.2T",
  94889. "_xlfn.T.TEST": "T.TEST",
  94890. "_xlfn.TEXTJOIN": "TEXTJOIN",
  94891. "_xlfn.UNICHAR": "UNICHAR",
  94892. "_xlfn.UNICODE": "UNICODE",
  94893. "_xlfn.VAR.P": "VAR.P",
  94894. "_xlfn.VAR.S": "VAR.S",
  94895. "_xlfn.WEBSERVICE": "WEBSERVICE",
  94896. "_xlfn.WEIBULL.DIST": "WEIBULL.DIST",
  94897. "_xlfn.WORKDAY.INTL": "WORKDAY.INTL",
  94898. "_xlfn.XOR": "XOR",
  94899. "_xlfn.Z.TEST": "Z.TEST"
  94900. };
  94901. /* Part 3 TODO: actually parse formulae */
  94902. function ods_to_csf_formula(f) {
  94903. if(f.slice(0,3) == "of:") f = f.slice(3);
  94904. /* 5.2 Basic Expressions */
  94905. if(f.charCodeAt(0) == 61) {
  94906. f = f.slice(1);
  94907. if(f.charCodeAt(0) == 61) f = f.slice(1);
  94908. }
  94909. f = f.replace(/COM\.MICROSOFT\./g, "");
  94910. /* Part 3 Section 5.8 References */
  94911. f = f.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g, function($$, $1) { return $1.replace(/\./g,""); });
  94912. /* TODO: something other than this */
  94913. f = f.replace(/\[.(#[A-Z]*[?!])\]/g, "$1");
  94914. return f.replace(/[;~]/g,",").replace(/\|/g,";");
  94915. }
  94916. function csf_to_ods_formula(f) {
  94917. var o = "of:=" + f.replace(crefregex, "$1[.$2$3$4$5]").replace(/\]:\[/g,":");
  94918. /* TODO: something other than this */
  94919. return o.replace(/;/g, "|").replace(/,/g,";");
  94920. }
  94921. function ods_to_csf_3D(r) {
  94922. var a = r.split(":");
  94923. var s = a[0].split(".")[0];
  94924. return [s, a[0].split(".")[1] + (a.length > 1 ? (":" + (a[1].split(".")[1] || a[1].split(".")[0])) : "")];
  94925. }
  94926. function csf_to_ods_3D(r) {
  94927. return r.replace(/\./,"!");
  94928. }
  94929. var strs = {}; // shared strings
  94930. var _ssfopts = {}; // spreadsheet formatting options
  94931. RELS.WS = [
  94932. "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
  94933. "http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"
  94934. ];
  94935. /*global Map */
  94936. var browser_has_Map = typeof Map !== 'undefined';
  94937. function get_sst_id(sst, str, rev) {
  94938. var i = 0, len = sst.length;
  94939. if(rev) {
  94940. if(browser_has_Map ? rev.has(str) : rev.hasOwnProperty(str)) {
  94941. var revarr = browser_has_Map ? rev.get(str) : rev[str];
  94942. for(; i < revarr.length; ++i) {
  94943. if(sst[revarr[i]].t === str) { sst.Count ++; return revarr[i]; }
  94944. }
  94945. }
  94946. } else for(; i < len; ++i) {
  94947. if(sst[i].t === str) { sst.Count ++; return i; }
  94948. }
  94949. sst[len] = ({t:str}); sst.Count ++; sst.Unique ++;
  94950. if(rev) {
  94951. if(browser_has_Map) {
  94952. if(!rev.has(str)) rev.set(str, []);
  94953. rev.get(str).push(len);
  94954. } else {
  94955. if(!rev.hasOwnProperty(str)) rev[str] = [];
  94956. rev[str].push(len);
  94957. }
  94958. }
  94959. return len;
  94960. }
  94961. function col_obj_w(C, col) {
  94962. var p = ({min:C+1,max:C+1});
  94963. /* wch (chars), wpx (pixels) */
  94964. var wch = -1;
  94965. if(col.MDW) MDW = col.MDW;
  94966. if(col.width != null) p.customWidth = 1;
  94967. else if(col.wpx != null) wch = px2char(col.wpx);
  94968. else if(col.wch != null) wch = col.wch;
  94969. if(wch > -1) { p.width = char2width(wch); p.customWidth = 1; }
  94970. else if(col.width != null) p.width = col.width;
  94971. if(col.hidden) p.hidden = true;
  94972. return p;
  94973. }
  94974. function default_margins(margins, mode) {
  94975. if(!margins) return;
  94976. var defs = [0.7, 0.7, 0.75, 0.75, 0.3, 0.3];
  94977. if(mode == 'xlml') defs = [1, 1, 1, 1, 0.5, 0.5];
  94978. if(margins.left == null) margins.left = defs[0];
  94979. if(margins.right == null) margins.right = defs[1];
  94980. if(margins.top == null) margins.top = defs[2];
  94981. if(margins.bottom == null) margins.bottom = defs[3];
  94982. if(margins.header == null) margins.header = defs[4];
  94983. if(margins.footer == null) margins.footer = defs[5];
  94984. }
  94985. function get_cell_style(styles, cell, opts) {
  94986. var z = opts.revssf[cell.z != null ? cell.z : "General"];
  94987. var i = 0x3c, len = styles.length;
  94988. if(z == null && opts.ssf) {
  94989. for(; i < 0x188; ++i) if(opts.ssf[i] == null) {
  94990. SSF.load(cell.z, i);
  94991. // $FlowIgnore
  94992. opts.ssf[i] = cell.z;
  94993. opts.revssf[cell.z] = z = i;
  94994. break;
  94995. }
  94996. }
  94997. for(i = 0; i != len; ++i) if(styles[i].numFmtId === z) return i;
  94998. styles[len] = {
  94999. numFmtId:z,
  95000. fontId:0,
  95001. fillId:0,
  95002. borderId:0,
  95003. xfId:0,
  95004. applyNumberFormat:1
  95005. };
  95006. return len;
  95007. }
  95008. function safe_format(p, fmtid, fillid, opts, themes, styles) {
  95009. if(p.t === 'z') return;
  95010. if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
  95011. try {
  95012. if(opts.cellNF) p.z = SSF._table[fmtid];
  95013. } catch(e) { if(opts.WTF) throw e; }
  95014. if(!opts || opts.cellText !== false) try {
  95015. if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
  95016. if(p.t === 'e') p.w = p.w || BErr[p.v];
  95017. else if(fmtid === 0) {
  95018. if(p.t === 'n') {
  95019. if((p.v|0) === p.v) p.w = SSF._general_int(p.v);
  95020. else p.w = SSF._general_num(p.v);
  95021. }
  95022. else if(p.t === 'd') {
  95023. var dd = datenum(p.v);
  95024. if((dd|0) === dd) p.w = SSF._general_int(dd);
  95025. else p.w = SSF._general_num(dd);
  95026. }
  95027. else if(p.v === undefined) return "";
  95028. else p.w = SSF._general(p.v,_ssfopts);
  95029. }
  95030. else if(p.t === 'd') p.w = SSF.format(fmtid,datenum(p.v),_ssfopts);
  95031. else p.w = SSF.format(fmtid,p.v,_ssfopts);
  95032. } catch(e) { if(opts.WTF) throw e; }
  95033. if(!opts.cellStyles) return;
  95034. if(fillid != null) try {
  95035. p.s = styles.Fills[fillid];
  95036. if (p.s.fgColor && p.s.fgColor.theme && !p.s.fgColor.rgb) {
  95037. p.s.fgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.fgColor.theme].rgb, p.s.fgColor.tint || 0);
  95038. if(opts.WTF) p.s.fgColor.raw_rgb = themes.themeElements.clrScheme[p.s.fgColor.theme].rgb;
  95039. }
  95040. if (p.s.bgColor && p.s.bgColor.theme) {
  95041. p.s.bgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.bgColor.theme].rgb, p.s.bgColor.tint || 0);
  95042. if(opts.WTF) p.s.bgColor.raw_rgb = themes.themeElements.clrScheme[p.s.bgColor.theme].rgb;
  95043. }
  95044. } catch(e) { if(opts.WTF && styles.Fills) throw e; }
  95045. }
  95046. function check_ws(ws, sname, i) {
  95047. if(ws && ws['!ref']) {
  95048. var range = safe_decode_range(ws['!ref']);
  95049. if(range.e.c < range.s.c || range.e.r < range.s.r) throw new Error("Bad range (" + i + "): " + ws['!ref']);
  95050. }
  95051. }
  95052. function parse_ws_xml_dim(ws, s) {
  95053. var d = safe_decode_range(s);
  95054. if(d.s.r<=d.e.r && d.s.c<=d.e.c && d.s.r>=0 && d.s.c>=0) ws["!ref"] = encode_range(d);
  95055. }
  95056. var mergecregex = /<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g;
  95057. var sheetdataregex = /<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/;
  95058. var hlinkregex = /<(?:\w:)?hyperlink [^>]*>/mg;
  95059. var dimregex = /"(\w*:\w*)"/;
  95060. var colregex = /<(?:\w:)?col\b[^>]*[\/]?>/g;
  95061. var afregex = /<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g;
  95062. var marginregex= /<(?:\w:)?pageMargins[^>]*\/>/g;
  95063. var sheetprregex = /<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/;
  95064. var svsregex = /<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;
  95065. /* 18.3 Worksheets */
  95066. function parse_ws_xml(data, opts, idx, rels, wb, themes, styles) {
  95067. if(!data) return data;
  95068. if(!rels) rels = {'!id':{}};
  95069. if(DENSE != null && opts.dense == null) opts.dense = DENSE;
  95070. /* 18.3.1.99 worksheet CT_Worksheet */
  95071. var s = opts.dense ? ([]) : ({});
  95072. var refguess = ({s: {r:2000000, c:2000000}, e: {r:0, c:0} });
  95073. var data1 = "", data2 = "";
  95074. var mtch = data.match(sheetdataregex);
  95075. if(mtch) {
  95076. data1 = data.slice(0, mtch.index);
  95077. data2 = data.slice(mtch.index + mtch[0].length);
  95078. } else data1 = data2 = data;
  95079. /* 18.3.1.82 sheetPr CT_SheetPr */
  95080. var sheetPr = data1.match(sheetprregex);
  95081. if(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx);
  95082. /* 18.3.1.35 dimension CT_SheetDimension */
  95083. var ridx = (data1.match(/<(?:\w*:)?dimension/)||{index:-1}).index;
  95084. if(ridx > 0) {
  95085. var ref = data1.slice(ridx,ridx+50).match(dimregex);
  95086. if(ref) parse_ws_xml_dim(s, ref[1]);
  95087. }
  95088. /* 18.3.1.88 sheetViews CT_SheetViews */
  95089. var svs = data1.match(svsregex);
  95090. if(svs && svs[1]) parse_ws_xml_sheetviews(svs[1], wb);
  95091. /* 18.3.1.17 cols CT_Cols */
  95092. var columns = [];
  95093. if(opts.cellStyles) {
  95094. /* 18.3.1.13 col CT_Col */
  95095. var cols = data1.match(colregex);
  95096. if(cols) parse_ws_xml_cols(columns, cols);
  95097. }
  95098. /* 18.3.1.80 sheetData CT_SheetData ? */
  95099. if(mtch) parse_ws_xml_data(mtch[1], s, opts, refguess, themes, styles);
  95100. /* 18.3.1.2 autoFilter CT_AutoFilter */
  95101. var afilter = data2.match(afregex);
  95102. if(afilter) s['!autofilter'] = parse_ws_xml_autofilter(afilter[0]);
  95103. /* 18.3.1.55 mergeCells CT_MergeCells */
  95104. var merges = [];
  95105. var _merge = data2.match(mergecregex);
  95106. if(_merge) for(ridx = 0; ridx != _merge.length; ++ridx)
  95107. merges[ridx] = safe_decode_range(_merge[ridx].slice(_merge[ridx].indexOf("\"")+1));
  95108. /* 18.3.1.48 hyperlinks CT_Hyperlinks */
  95109. var hlink = data2.match(hlinkregex);
  95110. if(hlink) parse_ws_xml_hlinks(s, hlink, rels);
  95111. /* 18.3.1.62 pageMargins CT_PageMargins */
  95112. var margins = data2.match(marginregex);
  95113. if(margins) s['!margins'] = parse_ws_xml_margins(parsexmltag(margins[0]));
  95114. if(!s["!ref"] && refguess.e.c >= refguess.s.c && refguess.e.r >= refguess.s.r) s["!ref"] = encode_range(refguess);
  95115. if(opts.sheetRows > 0 && s["!ref"]) {
  95116. var tmpref = safe_decode_range(s["!ref"]);
  95117. if(opts.sheetRows <= +tmpref.e.r) {
  95118. tmpref.e.r = opts.sheetRows - 1;
  95119. if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;
  95120. if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;
  95121. if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;
  95122. if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;
  95123. s["!fullref"] = s["!ref"];
  95124. s["!ref"] = encode_range(tmpref);
  95125. }
  95126. }
  95127. if(columns.length > 0) s["!cols"] = columns;
  95128. if(merges.length > 0) s["!merges"] = merges;
  95129. return s;
  95130. }
  95131. function write_ws_xml_merges(merges) {
  95132. if(merges.length === 0) return "";
  95133. var o = '<mergeCells count="' + merges.length + '">';
  95134. for(var i = 0; i != merges.length; ++i) o += '<mergeCell ref="' + encode_range(merges[i]) + '"/>';
  95135. return o + '</mergeCells>';
  95136. }
  95137. /* 18.3.1.82-3 sheetPr CT_ChartsheetPr / CT_SheetPr */
  95138. function parse_ws_xml_sheetpr(sheetPr, s, wb, idx) {
  95139. var data = parsexmltag(sheetPr);
  95140. if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
  95141. if(data.codeName) wb.Sheets[idx].CodeName = data.codeName;
  95142. }
  95143. function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
  95144. var needed = false;
  95145. var props = {}, payload = null;
  95146. if(opts.bookType !== 'xlsx' && wb.vbaraw) {
  95147. var cname = wb.SheetNames[idx];
  95148. try { if(wb.Workbook) cname = wb.Workbook.Sheets[idx].CodeName || cname; } catch(e) {}
  95149. needed = true;
  95150. props.codeName = escapexml(cname);
  95151. }
  95152. if(!needed && !payload) return;
  95153. o[o.length] = (writextag('sheetPr', payload, props));
  95154. }
  95155. /* 18.3.1.85 sheetProtection CT_SheetProtection */
  95156. var sheetprot_deffalse = ["objects", "scenarios", "selectLockedCells", "selectUnlockedCells"];
  95157. var sheetprot_deftrue = [
  95158. "formatColumns", "formatRows", "formatCells",
  95159. "insertColumns", "insertRows", "insertHyperlinks",
  95160. "deleteColumns", "deleteRows",
  95161. "sort", "autoFilter", "pivotTables"
  95162. ];
  95163. function write_ws_xml_protection(sp) {
  95164. // algorithmName, hashValue, saltValue, spinCountpassword
  95165. var o = ({sheet:1});
  95166. sheetprot_deffalse.forEach(function(n) { if(sp[n] != null && sp[n]) o[n] = "1"; });
  95167. sheetprot_deftrue.forEach(function(n) { if(sp[n] != null && !sp[n]) o[n] = "0"; });
  95168. /* TODO: algorithm */
  95169. if(sp.password) o.password = crypto_CreatePasswordVerifier_Method1(sp.password).toString(16).toUpperCase();
  95170. return writextag('sheetProtection', null, o);
  95171. }
  95172. function parse_ws_xml_hlinks(s, data, rels) {
  95173. var dense = Array.isArray(s);
  95174. for(var i = 0; i != data.length; ++i) {
  95175. var val = parsexmltag(utf8read(data[i]), true);
  95176. if(!val.ref) return;
  95177. var rel = ((rels || {})['!id']||[])[val.id];
  95178. if(rel) {
  95179. val.Target = rel.Target;
  95180. if(val.location) val.Target += "#"+val.location;
  95181. } else {
  95182. val.Target = "#" + val.location;
  95183. rel = {Target: val.Target, TargetMode: 'Internal'};
  95184. }
  95185. val.Rel = rel;
  95186. if(val.tooltip) { val.Tooltip = val.tooltip; delete val.tooltip; }
  95187. var rng = safe_decode_range(val.ref);
  95188. for(var R=rng.s.r;R<=rng.e.r;++R) for(var C=rng.s.c;C<=rng.e.c;++C) {
  95189. var addr = encode_cell({c:C,r:R});
  95190. if(dense) {
  95191. if(!s[R]) s[R] = [];
  95192. if(!s[R][C]) s[R][C] = {t:"z",v:undefined};
  95193. s[R][C].l = val;
  95194. } else {
  95195. if(!s[addr]) s[addr] = {t:"z",v:undefined};
  95196. s[addr].l = val;
  95197. }
  95198. }
  95199. }
  95200. }
  95201. function parse_ws_xml_margins(margin) {
  95202. var o = {};
  95203. ["left", "right", "top", "bottom", "header", "footer"].forEach(function(k) {
  95204. if(margin[k]) o[k] = parseFloat(margin[k]);
  95205. });
  95206. return o;
  95207. }
  95208. function write_ws_xml_margins(margin) {
  95209. default_margins(margin);
  95210. return writextag('pageMargins', null, margin);
  95211. }
  95212. function parse_ws_xml_cols(columns, cols) {
  95213. var seencol = false;
  95214. for(var coli = 0; coli != cols.length; ++coli) {
  95215. var coll = parsexmltag(cols[coli], true);
  95216. if(coll.hidden) coll.hidden = parsexmlbool(coll.hidden);
  95217. var colm=parseInt(coll.min, 10)-1, colM=parseInt(coll.max,10)-1;
  95218. delete coll.min; delete coll.max; coll.width = +coll.width;
  95219. if(!seencol && coll.width) { seencol = true; find_mdw_colw(coll.width); }
  95220. process_col(coll);
  95221. while(colm <= colM) columns[colm++] = dup(coll);
  95222. }
  95223. }
  95224. function write_ws_xml_cols(ws, cols) {
  95225. var o = ["<cols>"], col;
  95226. for(var i = 0; i != cols.length; ++i) {
  95227. if(!(col = cols[i])) continue;
  95228. o[o.length] = (writextag('col', null, col_obj_w(i, col)));
  95229. }
  95230. o[o.length] = "</cols>";
  95231. return o.join("");
  95232. }
  95233. function parse_ws_xml_autofilter(data) {
  95234. var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]};
  95235. return o;
  95236. }
  95237. function write_ws_xml_autofilter(data, ws, wb, idx) {
  95238. var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
  95239. if(!wb.Workbook) wb.Workbook = ({Sheets:[]});
  95240. if(!wb.Workbook.Names) wb.Workbook.Names = [];
  95241. var names = wb.Workbook.Names;
  95242. var range = decode_range(ref);
  95243. if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
  95244. for(var i = 0; i < names.length; ++i) {
  95245. var name = names[i];
  95246. if(name.Name != '_xlnm._FilterDatabase') continue;
  95247. if(name.Sheet != idx) continue;
  95248. name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
  95249. }
  95250. if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
  95251. return writextag("autoFilter", null, {ref:ref});
  95252. }
  95253. /* 18.3.1.88 sheetViews CT_SheetViews */
  95254. /* 18.3.1.87 sheetView CT_SheetView */
  95255. var sviewregex = /<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;
  95256. function parse_ws_xml_sheetviews(data, wb) {
  95257. if(!wb.Views) wb.Views = [{}];
  95258. (data.match(sviewregex)||[]).forEach(function(r, i) {
  95259. var tag = parsexmltag(r);
  95260. // $FlowIgnore
  95261. if(!wb.Views[i]) wb.Views[i] = {};
  95262. // $FlowIgnore
  95263. if(parsexmlbool(tag.rightToLeft)) wb.Views[i].RTL = true;
  95264. });
  95265. }
  95266. function write_ws_xml_sheetviews(ws, opts, idx, wb) {
  95267. var sview = ({workbookViewId:"0"});
  95268. // $FlowIgnore
  95269. if((((wb||{}).Workbook||{}).Views||[])[0]) sview.rightToLeft = wb.Workbook.Views[0].RTL ? "1" : "0";
  95270. return writextag("sheetViews", writextag("sheetView", null, sview), {});
  95271. }
  95272. function write_ws_xml_cell(cell, ref, ws, opts) {
  95273. if(cell.v === undefined && cell.f === undefined || cell.t === 'z') return "";
  95274. var vv = "";
  95275. var oldt = cell.t, oldv = cell.v;
  95276. if(cell.t !== "z") switch(cell.t) {
  95277. case 'b': vv = cell.v ? "1" : "0"; break;
  95278. case 'n': vv = ''+cell.v; break;
  95279. case 'e': vv = BErr[cell.v]; break;
  95280. case 'd':
  95281. if(opts && opts.cellDates) vv = parseDate(cell.v, -1).toISOString();
  95282. else {
  95283. cell = dup(cell);
  95284. cell.t = 'n';
  95285. vv = ''+(cell.v = datenum(parseDate(cell.v)));
  95286. }
  95287. if(typeof cell.z === 'undefined') cell.z = SSF._table[14];
  95288. break;
  95289. default: vv = cell.v; break;
  95290. }
  95291. var v = writetag('v', escapexml(vv)), o = ({r:ref});
  95292. /* TODO: cell style */
  95293. var os = get_cell_style(opts.cellXfs, cell, opts);
  95294. if(os !== 0) o.s = os;
  95295. switch(cell.t) {
  95296. case 'n': break;
  95297. case 'd': o.t = "d"; break;
  95298. case 'b': o.t = "b"; break;
  95299. case 'e': o.t = "e"; break;
  95300. case 'z': break;
  95301. default: if(cell.v == null) { delete cell.t; break; }
  95302. if(opts && opts.bookSST) {
  95303. v = writetag('v', ''+get_sst_id(opts.Strings, cell.v, opts.revStrings));
  95304. o.t = "s"; break;
  95305. }
  95306. o.t = "str"; break;
  95307. }
  95308. if(cell.t != oldt) { cell.t = oldt; cell.v = oldv; }
  95309. if(cell.f) {
  95310. var ff = cell.F && cell.F.slice(0, ref.length) == ref ? {t:"array", ref:cell.F} : null;
  95311. v = writextag('f', escapexml(cell.f), ff) + (cell.v != null ? v : "");
  95312. }
  95313. if(cell.l) ws['!links'].push([ref, cell.l]);
  95314. if(cell.c) ws['!comments'].push([ref, cell.c]);
  95315. return writextag('c', v, o);
  95316. }
  95317. var parse_ws_xml_data = (function() {
  95318. var cellregex = /<(?:\w+:)?c[ >]/, rowregex = /<\/(?:\w+:)?row>/;
  95319. var rregex = /r=["']([^"']*)["']/, isregex = /<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/;
  95320. var refregex = /ref=["']([^"']*)["']/;
  95321. var match_v = matchtag("v"), match_f = matchtag("f");
  95322. return function parse_ws_xml_data(sdata, s, opts, guess, themes, styles) {
  95323. var ri = 0, x = "", cells = [], cref = [], idx=0, i=0, cc=0, d="", p;
  95324. var tag, tagr = 0, tagc = 0;
  95325. var sstr, ftag;
  95326. var fmtid = 0, fillid = 0;
  95327. var do_format = Array.isArray(styles.CellXf), cf;
  95328. var arrayf = [];
  95329. var sharedf = [];
  95330. var dense = Array.isArray(s);
  95331. var rows = [], rowobj = {}, rowrite = false;
  95332. for(var marr = sdata.split(rowregex), mt = 0, marrlen = marr.length; mt != marrlen; ++mt) {
  95333. x = marr[mt].trim();
  95334. var xlen = x.length;
  95335. if(xlen === 0) continue;
  95336. /* 18.3.1.73 row CT_Row */
  95337. for(ri = 0; ri < xlen; ++ri) if(x.charCodeAt(ri) === 62) break; ++ri;
  95338. tag = parsexmltag(x.slice(0,ri), true);
  95339. tagr = tag.r != null ? parseInt(tag.r, 10) : tagr+1; tagc = -1;
  95340. if(opts.sheetRows && opts.sheetRows < tagr) continue;
  95341. if(guess.s.r > tagr - 1) guess.s.r = tagr - 1;
  95342. if(guess.e.r < tagr - 1) guess.e.r = tagr - 1;
  95343. if(opts && opts.cellStyles) {
  95344. rowobj = {}; rowrite = false;
  95345. if(tag.ht) { rowrite = true; rowobj.hpt = parseFloat(tag.ht); rowobj.hpx = pt2px(rowobj.hpt); }
  95346. if(tag.hidden == "1") { rowrite = true; rowobj.hidden = true; }
  95347. if(tag.outlineLevel != null) { rowrite = true; rowobj.level = +tag.outlineLevel; }
  95348. if(rowrite) rows[tagr-1] = rowobj;
  95349. }
  95350. /* 18.3.1.4 c CT_Cell */
  95351. cells = x.slice(ri).split(cellregex);
  95352. for(var rslice = 0; rslice != cells.length; ++rslice) if(cells[rslice].trim().charAt(0) != "<") break;
  95353. cells = cells.slice(rslice);
  95354. for(ri = 0; ri != cells.length; ++ri) {
  95355. x = cells[ri].trim();
  95356. if(x.length === 0) continue;
  95357. cref = x.match(rregex); idx = ri; i=0; cc=0;
  95358. x = "<c " + (x.slice(0,1)=="<"?">":"") + x;
  95359. if(cref != null && cref.length === 2) {
  95360. idx = 0; d=cref[1];
  95361. for(i=0; i != d.length; ++i) {
  95362. if((cc=d.charCodeAt(i)-64) < 1 || cc > 26) break;
  95363. idx = 26*idx + cc;
  95364. }
  95365. --idx;
  95366. tagc = idx;
  95367. } else ++tagc;
  95368. for(i = 0; i != x.length; ++i) if(x.charCodeAt(i) === 62) break; ++i;
  95369. tag = parsexmltag(x.slice(0,i), true);
  95370. if(!tag.r) tag.r = encode_cell({r:tagr-1, c:tagc});
  95371. d = x.slice(i);
  95372. p = ({t:""});
  95373. if((cref=d.match(match_v))!= null && cref[1] !== '') p.v=unescapexml(cref[1]);
  95374. if(opts.cellFormula) {
  95375. if((cref=d.match(match_f))!= null && cref[1] !== '') {
  95376. /* TODO: match against XLSXFutureFunctions */
  95377. p.f=_xlfn(unescapexml(utf8read(cref[1])));
  95378. if(cref[0].indexOf('t="array"') > -1) {
  95379. p.F = (d.match(refregex)||[])[1];
  95380. if(p.F.indexOf(":") > -1) arrayf.push([safe_decode_range(p.F), p.F]);
  95381. } else if(cref[0].indexOf('t="shared"') > -1) {
  95382. // TODO: parse formula
  95383. ftag = parsexmltag(cref[0]);
  95384. sharedf[parseInt(ftag.si, 10)] = [ftag, _xlfn(unescapexml(utf8read(cref[1]))), tag.r];
  95385. }
  95386. } else if((cref=d.match(/<f[^>]*\/>/))) {
  95387. ftag = parsexmltag(cref[0]);
  95388. if(sharedf[ftag.si]) p.f = shift_formula_xlsx(sharedf[ftag.si][1], sharedf[ftag.si][2]/*[0].ref*/, tag.r);
  95389. }
  95390. /* TODO: factor out contains logic */
  95391. var _tag = decode_cell(tag.r);
  95392. for(i = 0; i < arrayf.length; ++i)
  95393. if(_tag.r >= arrayf[i][0].s.r && _tag.r <= arrayf[i][0].e.r)
  95394. if(_tag.c >= arrayf[i][0].s.c && _tag.c <= arrayf[i][0].e.c)
  95395. p.F = arrayf[i][1];
  95396. }
  95397. if(tag.t == null && p.v === undefined) {
  95398. if(p.f || p.F) {
  95399. p.v = 0; p.t = "n";
  95400. } else if(!opts.sheetStubs) continue;
  95401. else p.t = "z";
  95402. }
  95403. else p.t = tag.t || "n";
  95404. if(guess.s.c > tagc) guess.s.c = tagc;
  95405. if(guess.e.c < tagc) guess.e.c = tagc;
  95406. /* 18.18.11 t ST_CellType */
  95407. switch(p.t) {
  95408. case 'n':
  95409. if(p.v == "" || p.v == null) {
  95410. if(!opts.sheetStubs) continue;
  95411. p.t = 'z';
  95412. } else p.v = parseFloat(p.v);
  95413. break;
  95414. case 's':
  95415. if(typeof p.v == 'undefined') {
  95416. if(!opts.sheetStubs) continue;
  95417. p.t = 'z';
  95418. } else {
  95419. sstr = strs[parseInt(p.v, 10)];
  95420. p.v = sstr.t;
  95421. p.r = sstr.r;
  95422. if(opts.cellHTML) p.h = sstr.h;
  95423. }
  95424. break;
  95425. case 'str':
  95426. p.t = "s";
  95427. p.v = (p.v!=null) ? utf8read(p.v) : '';
  95428. if(opts.cellHTML) p.h = escapehtml(p.v);
  95429. break;
  95430. case 'inlineStr':
  95431. cref = d.match(isregex);
  95432. p.t = 's';
  95433. if(cref != null && (sstr = parse_si(cref[1]))) {
  95434. p.v = sstr.t;
  95435. if(opts.cellHTML) p.h = sstr.h;
  95436. } else p.v = "";
  95437. break;
  95438. case 'b': p.v = parsexmlbool(p.v); break;
  95439. case 'd':
  95440. if(opts.cellDates) p.v = parseDate(p.v, 1);
  95441. else { p.v = datenum(parseDate(p.v, 1)); p.t = 'n'; }
  95442. break;
  95443. /* error string in .w, number in .v */
  95444. case 'e':
  95445. if(!opts || opts.cellText !== false) p.w = p.v;
  95446. p.v = RBErr[p.v]; break;
  95447. }
  95448. /* formatting */
  95449. fmtid = fillid = 0;
  95450. cf = null;
  95451. if(do_format && tag.s !== undefined) {
  95452. cf = styles.CellXf[tag.s];
  95453. if(cf != null) {
  95454. if(cf.numFmtId != null) fmtid = cf.numFmtId;
  95455. if(opts.cellStyles) {
  95456. if(cf.fillId != null) fillid = cf.fillId;
  95457. }
  95458. }
  95459. }
  95460. safe_format(p, fmtid, fillid, opts, themes, styles);
  95461. if(opts.cellDates && do_format && p.t == 'n' && SSF.is_date(SSF._table[fmtid])) { p.t = 'd'; p.v = numdate(p.v); }
  95462. if(dense) {
  95463. var _r = decode_cell(tag.r);
  95464. if(!s[_r.r]) s[_r.r] = [];
  95465. s[_r.r][_r.c] = p;
  95466. } else s[tag.r] = p;
  95467. }
  95468. }
  95469. if(rows.length > 0) s['!rows'] = rows;
  95470. }; })();
  95471. function write_ws_xml_data(ws, opts, idx, wb) {
  95472. var o = [], r = [], range = safe_decode_range(ws['!ref']), cell="", ref, rr = "", cols = [], R=0, C=0, rows = ws['!rows'];
  95473. var dense = Array.isArray(ws);
  95474. var params = ({r:rr}), row, height = -1;
  95475. for(C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);
  95476. for(R = range.s.r; R <= range.e.r; ++R) {
  95477. r = [];
  95478. rr = encode_row(R);
  95479. for(C = range.s.c; C <= range.e.c; ++C) {
  95480. ref = cols[C] + rr;
  95481. var _cell = dense ? (ws[R]||[])[C]: ws[ref];
  95482. if(_cell === undefined) continue;
  95483. if((cell = write_ws_xml_cell(_cell, ref, ws, opts, idx, wb)) != null) r.push(cell);
  95484. }
  95485. if(r.length > 0 || (rows && rows[R])) {
  95486. params = ({r:rr});
  95487. if(rows && rows[R]) {
  95488. row = rows[R];
  95489. if(row.hidden) params.hidden = 1;
  95490. height = -1;
  95491. if(row.hpx) height = px2pt(row.hpx);
  95492. else if(row.hpt) height = row.hpt;
  95493. if(height > -1) { params.ht = height; params.customHeight = 1; }
  95494. if(row.level) { params.outlineLevel = row.level; }
  95495. }
  95496. o[o.length] = (writextag('row', r.join(""), params));
  95497. }
  95498. }
  95499. if(rows) for(; R < rows.length; ++R) {
  95500. if(rows && rows[R]) {
  95501. params = ({r:R+1});
  95502. row = rows[R];
  95503. if(row.hidden) params.hidden = 1;
  95504. height = -1;
  95505. if (row.hpx) height = px2pt(row.hpx);
  95506. else if (row.hpt) height = row.hpt;
  95507. if (height > -1) { params.ht = height; params.customHeight = 1; }
  95508. if (row.level) { params.outlineLevel = row.level; }
  95509. o[o.length] = (writextag('row', "", params));
  95510. }
  95511. }
  95512. return o.join("");
  95513. }
  95514. var WS_XML_ROOT = writextag('worksheet', null, {
  95515. 'xmlns': XMLNS.main[0],
  95516. 'xmlns:r': XMLNS.r
  95517. });
  95518. function write_ws_xml(idx, opts, wb, rels) {
  95519. var o = [XML_HEADER, WS_XML_ROOT];
  95520. var s = wb.SheetNames[idx], sidx = 0, rdata = "";
  95521. var ws = wb.Sheets[s];
  95522. if(ws == null) ws = {};
  95523. var ref = ws['!ref'] || 'A1';
  95524. var range = safe_decode_range(ref);
  95525. if(range.e.c > 0x3FFF || range.e.r > 0xFFFFF) {
  95526. if(opts.WTF) throw new Error("Range " + ref + " exceeds format limit A1:XFD1048576");
  95527. range.e.c = Math.min(range.e.c, 0x3FFF);
  95528. range.e.r = Math.min(range.e.c, 0xFFFFF);
  95529. ref = encode_range(range);
  95530. }
  95531. if(!rels) rels = {};
  95532. ws['!comments'] = [];
  95533. var _drawing = [];
  95534. write_ws_xml_sheetpr(ws, wb, idx, opts, o);
  95535. o[o.length] = (writextag('dimension', null, {'ref': ref}));
  95536. o[o.length] = write_ws_xml_sheetviews(ws, opts, idx, wb);
  95537. /* TODO: store in WB, process styles */
  95538. if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {
  95539. defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16',
  95540. baseColWidth:opts.sheetFormat.baseColWidth||'10',
  95541. outlineLevelRow:opts.sheetFormat.outlineLevelRow||'7'
  95542. }));
  95543. if(ws['!cols'] != null && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
  95544. o[sidx = o.length] = '<sheetData/>';
  95545. ws['!links'] = [];
  95546. if(ws['!ref'] != null) {
  95547. rdata = write_ws_xml_data(ws, opts, idx, wb, rels);
  95548. if(rdata.length > 0) o[o.length] = (rdata);
  95549. }
  95550. if(o.length>sidx+1) { o[o.length] = ('</sheetData>'); o[sidx]=o[sidx].replace("/>",">"); }
  95551. /* sheetCalcPr */
  95552. if(ws['!protect'] != null) o[o.length] = write_ws_xml_protection(ws['!protect']);
  95553. /* protectedRanges */
  95554. /* scenarios */
  95555. if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);
  95556. /* sortState */
  95557. /* dataConsolidate */
  95558. /* customSheetViews */
  95559. if(ws['!merges'] != null && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges']));
  95560. /* phoneticPr */
  95561. /* conditionalFormatting */
  95562. /* dataValidations */
  95563. var relc = -1, rel, rId = -1;
  95564. if(ws['!links'].length > 0) {
  95565. o[o.length] = "<hyperlinks>";
  95566. ws['!links'].forEach(function(l) {
  95567. if(!l[1].Target) return;
  95568. rel = ({"ref":l[0]});
  95569. if(l[1].Target.charAt(0) != "#") {
  95570. rId = add_rels(rels, -1, escapexml(l[1].Target).replace(/#.*$/, ""), RELS.HLINK);
  95571. rel["r:id"] = "rId"+rId;
  95572. }
  95573. if((relc = l[1].Target.indexOf("#")) > -1) rel.location = escapexml(l[1].Target.slice(relc+1));
  95574. if(l[1].Tooltip) rel.tooltip = escapexml(l[1].Tooltip);
  95575. o[o.length] = writextag("hyperlink",null,rel);
  95576. });
  95577. o[o.length] = "</hyperlinks>";
  95578. }
  95579. delete ws['!links'];
  95580. /* printOptions */
  95581. if(ws['!margins'] != null) o[o.length] = write_ws_xml_margins(ws['!margins']);
  95582. /* pageSetup */
  95583. /* headerFooter */
  95584. /* rowBreaks */
  95585. /* colBreaks */
  95586. /* customProperties */
  95587. /* cellWatches */
  95588. if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) o[o.length] = writetag("ignoredErrors", writextag("ignoredError", null, {numberStoredAsText:1, sqref:ref}));
  95589. /* smartTags */
  95590. if(_drawing.length > 0) {
  95591. rId = add_rels(rels, -1, "../drawings/drawing" + (idx+1) + ".xml", RELS.DRAW);
  95592. o[o.length] = writextag("drawing", null, {"r:id":"rId" + rId});
  95593. ws['!drawing'] = _drawing;
  95594. }
  95595. if(ws['!comments'].length > 0) {
  95596. rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx+1) + ".vml", RELS.VML);
  95597. o[o.length] = writextag("legacyDrawing", null, {"r:id":"rId" + rId});
  95598. ws['!legacy'] = rId;
  95599. }
  95600. /* legacyDrawingHF */
  95601. /* picture */
  95602. /* oleObjects */
  95603. /* controls */
  95604. /* webPublishItems */
  95605. /* tableParts */
  95606. /* extLst */
  95607. if(o.length>1) { o[o.length] = ('</worksheet>'); o[1]=o[1].replace("/>",">"); }
  95608. return o.join("");
  95609. }
  95610. /* [MS-XLSB] 2.4.726 BrtRowHdr */
  95611. function parse_BrtRowHdr(data, length) {
  95612. var z = ({});
  95613. var tgt = data.l + length;
  95614. z.r = data.read_shift(4);
  95615. data.l += 4; // TODO: ixfe
  95616. var miyRw = data.read_shift(2);
  95617. data.l += 1; // TODO: top/bot padding
  95618. var flags = data.read_shift(1);
  95619. data.l = tgt;
  95620. if(flags & 0x07) z.level = flags & 0x07;
  95621. if(flags & 0x10) z.hidden = true;
  95622. if(flags & 0x20) z.hpt = miyRw / 20;
  95623. return z;
  95624. }
  95625. function write_BrtRowHdr(R, range, ws) {
  95626. var o = new_buf(17+8*16);
  95627. var row = (ws['!rows']||[])[R]||{};
  95628. o.write_shift(4, R);
  95629. o.write_shift(4, 0); /* TODO: ixfe */
  95630. var miyRw = 0x0140;
  95631. if(row.hpx) miyRw = px2pt(row.hpx) * 20;
  95632. else if(row.hpt) miyRw = row.hpt * 20;
  95633. o.write_shift(2, miyRw);
  95634. o.write_shift(1, 0); /* top/bot padding */
  95635. var flags = 0x0;
  95636. if(row.level) flags |= row.level;
  95637. if(row.hidden) flags |= 0x10;
  95638. if(row.hpx || row.hpt) flags |= 0x20;
  95639. o.write_shift(1, flags);
  95640. o.write_shift(1, 0); /* phonetic guide */
  95641. /* [MS-XLSB] 2.5.8 BrtColSpan explains the mechanism */
  95642. var ncolspan = 0, lcs = o.l;
  95643. o.l += 4;
  95644. var caddr = {r:R, c:0};
  95645. for(var i = 0; i < 16; ++i) {
  95646. if((range.s.c > ((i+1) << 10)) || (range.e.c < (i << 10))) continue;
  95647. var first = -1, last = -1;
  95648. for(var j = (i<<10); j < ((i+1)<<10); ++j) {
  95649. caddr.c = j;
  95650. var cell = Array.isArray(ws) ? (ws[caddr.r]||[])[caddr.c] : ws[encode_cell(caddr)];
  95651. if(cell) { if(first < 0) first = j; last = j; }
  95652. }
  95653. if(first < 0) continue;
  95654. ++ncolspan;
  95655. o.write_shift(4, first);
  95656. o.write_shift(4, last);
  95657. }
  95658. var l = o.l;
  95659. o.l = lcs;
  95660. o.write_shift(4, ncolspan);
  95661. o.l = l;
  95662. return o.length > o.l ? o.slice(0, o.l) : o;
  95663. }
  95664. function write_row_header(ba, ws, range, R) {
  95665. var o = write_BrtRowHdr(R, range, ws);
  95666. if((o.length > 17) || (ws['!rows']||[])[R]) write_record(ba, 'BrtRowHdr', o);
  95667. }
  95668. /* [MS-XLSB] 2.4.820 BrtWsDim */
  95669. var parse_BrtWsDim = parse_UncheckedRfX;
  95670. var write_BrtWsDim = write_UncheckedRfX;
  95671. /* [MS-XLSB] 2.4.821 BrtWsFmtInfo */
  95672. function parse_BrtWsFmtInfo() {
  95673. }
  95674. //function write_BrtWsFmtInfo(ws, o) { }
  95675. /* [MS-XLSB] 2.4.823 BrtWsProp */
  95676. function parse_BrtWsProp(data, length) {
  95677. var z = {};
  95678. /* TODO: pull flags */
  95679. data.l += 19;
  95680. z.name = parse_XLSBCodeName(data, length - 19);
  95681. return z;
  95682. }
  95683. function write_BrtWsProp(str, o) {
  95684. if(o == null) o = new_buf(84+4*str.length);
  95685. for(var i = 0; i < 3; ++i) o.write_shift(1,0);
  95686. write_BrtColor({auto:1}, o);
  95687. o.write_shift(-4,-1);
  95688. o.write_shift(-4,-1);
  95689. write_XLSBCodeName(str, o);
  95690. return o.slice(0, o.l);
  95691. }
  95692. /* [MS-XLSB] 2.4.306 BrtCellBlank */
  95693. function parse_BrtCellBlank(data) {
  95694. var cell = parse_XLSBCell(data);
  95695. return [cell];
  95696. }
  95697. function write_BrtCellBlank(cell, ncell, o) {
  95698. if(o == null) o = new_buf(8);
  95699. return write_XLSBCell(ncell, o);
  95700. }
  95701. /* [MS-XLSB] 2.4.307 BrtCellBool */
  95702. function parse_BrtCellBool(data) {
  95703. var cell = parse_XLSBCell(data);
  95704. var fBool = data.read_shift(1);
  95705. return [cell, fBool, 'b'];
  95706. }
  95707. function write_BrtCellBool(cell, ncell, o) {
  95708. if(o == null) o = new_buf(9);
  95709. write_XLSBCell(ncell, o);
  95710. o.write_shift(1, cell.v ? 1 : 0);
  95711. return o;
  95712. }
  95713. /* [MS-XLSB] 2.4.308 BrtCellError */
  95714. function parse_BrtCellError(data) {
  95715. var cell = parse_XLSBCell(data);
  95716. var bError = data.read_shift(1);
  95717. return [cell, bError, 'e'];
  95718. }
  95719. /* [MS-XLSB] 2.4.311 BrtCellIsst */
  95720. function parse_BrtCellIsst(data) {
  95721. var cell = parse_XLSBCell(data);
  95722. var isst = data.read_shift(4);
  95723. return [cell, isst, 's'];
  95724. }
  95725. function write_BrtCellIsst(cell, ncell, o) {
  95726. if(o == null) o = new_buf(12);
  95727. write_XLSBCell(ncell, o);
  95728. o.write_shift(4, ncell.v);
  95729. return o;
  95730. }
  95731. /* [MS-XLSB] 2.4.313 BrtCellReal */
  95732. function parse_BrtCellReal(data) {
  95733. var cell = parse_XLSBCell(data);
  95734. var value = parse_Xnum(data);
  95735. return [cell, value, 'n'];
  95736. }
  95737. function write_BrtCellReal(cell, ncell, o) {
  95738. if(o == null) o = new_buf(16);
  95739. write_XLSBCell(ncell, o);
  95740. write_Xnum(cell.v, o);
  95741. return o;
  95742. }
  95743. /* [MS-XLSB] 2.4.314 BrtCellRk */
  95744. function parse_BrtCellRk(data) {
  95745. var cell = parse_XLSBCell(data);
  95746. var value = parse_RkNumber(data);
  95747. return [cell, value, 'n'];
  95748. }
  95749. function write_BrtCellRk(cell, ncell, o) {
  95750. if(o == null) o = new_buf(12);
  95751. write_XLSBCell(ncell, o);
  95752. write_RkNumber(cell.v, o);
  95753. return o;
  95754. }
  95755. /* [MS-XLSB] 2.4.317 BrtCellSt */
  95756. function parse_BrtCellSt(data) {
  95757. var cell = parse_XLSBCell(data);
  95758. var value = parse_XLWideString(data);
  95759. return [cell, value, 'str'];
  95760. }
  95761. function write_BrtCellSt(cell, ncell, o) {
  95762. if(o == null) o = new_buf(12 + 4 * cell.v.length);
  95763. write_XLSBCell(ncell, o);
  95764. write_XLWideString(cell.v, o);
  95765. return o.length > o.l ? o.slice(0, o.l) : o;
  95766. }
  95767. /* [MS-XLSB] 2.4.653 BrtFmlaBool */
  95768. function parse_BrtFmlaBool(data, length, opts) {
  95769. var end = data.l + length;
  95770. var cell = parse_XLSBCell(data);
  95771. cell.r = opts['!row'];
  95772. var value = data.read_shift(1);
  95773. var o = [cell, value, 'b'];
  95774. if(opts.cellFormula) {
  95775. data.l += 2;
  95776. var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
  95777. o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
  95778. }
  95779. else data.l = end;
  95780. return o;
  95781. }
  95782. /* [MS-XLSB] 2.4.654 BrtFmlaError */
  95783. function parse_BrtFmlaError(data, length, opts) {
  95784. var end = data.l + length;
  95785. var cell = parse_XLSBCell(data);
  95786. cell.r = opts['!row'];
  95787. var value = data.read_shift(1);
  95788. var o = [cell, value, 'e'];
  95789. if(opts.cellFormula) {
  95790. data.l += 2;
  95791. var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
  95792. o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
  95793. }
  95794. else data.l = end;
  95795. return o;
  95796. }
  95797. /* [MS-XLSB] 2.4.655 BrtFmlaNum */
  95798. function parse_BrtFmlaNum(data, length, opts) {
  95799. var end = data.l + length;
  95800. var cell = parse_XLSBCell(data);
  95801. cell.r = opts['!row'];
  95802. var value = parse_Xnum(data);
  95803. var o = [cell, value, 'n'];
  95804. if(opts.cellFormula) {
  95805. data.l += 2;
  95806. var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
  95807. o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
  95808. }
  95809. else data.l = end;
  95810. return o;
  95811. }
  95812. /* [MS-XLSB] 2.4.656 BrtFmlaString */
  95813. function parse_BrtFmlaString(data, length, opts) {
  95814. var end = data.l + length;
  95815. var cell = parse_XLSBCell(data);
  95816. cell.r = opts['!row'];
  95817. var value = parse_XLWideString(data);
  95818. var o = [cell, value, 'str'];
  95819. if(opts.cellFormula) {
  95820. data.l += 2;
  95821. var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
  95822. o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
  95823. }
  95824. else data.l = end;
  95825. return o;
  95826. }
  95827. /* [MS-XLSB] 2.4.682 BrtMergeCell */
  95828. var parse_BrtMergeCell = parse_UncheckedRfX;
  95829. var write_BrtMergeCell = write_UncheckedRfX;
  95830. /* [MS-XLSB] 2.4.107 BrtBeginMergeCells */
  95831. function write_BrtBeginMergeCells(cnt, o) {
  95832. if(o == null) o = new_buf(4);
  95833. o.write_shift(4, cnt);
  95834. return o;
  95835. }
  95836. /* [MS-XLSB] 2.4.662 BrtHLink */
  95837. function parse_BrtHLink(data, length) {
  95838. var end = data.l + length;
  95839. var rfx = parse_UncheckedRfX(data, 16);
  95840. var relId = parse_XLNullableWideString(data);
  95841. var loc = parse_XLWideString(data);
  95842. var tooltip = parse_XLWideString(data);
  95843. var display = parse_XLWideString(data);
  95844. data.l = end;
  95845. var o = ({rfx:rfx, relId:relId, loc:loc, display:display});
  95846. if(tooltip) o.Tooltip = tooltip;
  95847. return o;
  95848. }
  95849. function write_BrtHLink(l, rId) {
  95850. var o = new_buf(50+4*(l[1].Target.length + (l[1].Tooltip || "").length));
  95851. write_UncheckedRfX({s:decode_cell(l[0]), e:decode_cell(l[0])}, o);
  95852. write_RelID("rId" + rId, o);
  95853. var locidx = l[1].Target.indexOf("#");
  95854. var loc = locidx == -1 ? "" : l[1].Target.slice(locidx+1);
  95855. write_XLWideString(loc || "", o);
  95856. write_XLWideString(l[1].Tooltip || "", o);
  95857. write_XLWideString("", o);
  95858. return o.slice(0, o.l);
  95859. }
  95860. /* [MS-XLSB] 2.4.692 BrtPane */
  95861. function parse_BrtPane(/*data, length, opts*/) {
  95862. }
  95863. /* [MS-XLSB] 2.4.6 BrtArrFmla */
  95864. function parse_BrtArrFmla(data, length, opts) {
  95865. var end = data.l + length;
  95866. var rfx = parse_RfX(data, 16);
  95867. var fAlwaysCalc = data.read_shift(1);
  95868. var o = [rfx]; o[2] = fAlwaysCalc;
  95869. if(opts.cellFormula) {
  95870. var formula = parse_XLSBArrayParsedFormula(data, end - data.l, opts);
  95871. o[1] = formula;
  95872. } else data.l = end;
  95873. return o;
  95874. }
  95875. /* [MS-XLSB] 2.4.750 BrtShrFmla */
  95876. function parse_BrtShrFmla(data, length, opts) {
  95877. var end = data.l + length;
  95878. var rfx = parse_UncheckedRfX(data, 16);
  95879. var o = [rfx];
  95880. if(opts.cellFormula) {
  95881. var formula = parse_XLSBSharedParsedFormula(data, end - data.l, opts);
  95882. o[1] = formula;
  95883. data.l = end;
  95884. } else data.l = end;
  95885. return o;
  95886. }
  95887. /* [MS-XLSB] 2.4.323 BrtColInfo */
  95888. /* TODO: once XLS ColInfo is set, combine the functions */
  95889. function write_BrtColInfo(C, col, o) {
  95890. if(o == null) o = new_buf(18);
  95891. var p = col_obj_w(C, col);
  95892. o.write_shift(-4, C);
  95893. o.write_shift(-4, C);
  95894. o.write_shift(4, (p.width || 10) * 256);
  95895. o.write_shift(4, 0/*ixfe*/); // style
  95896. var flags = 0;
  95897. if(col.hidden) flags |= 0x01;
  95898. if(typeof p.width == 'number') flags |= 0x02;
  95899. if(col.level) flags |= (col.level << 8);
  95900. o.write_shift(2, flags); // bit flag
  95901. return o;
  95902. }
  95903. /* [MS-XLSB] 2.4.678 BrtMargins */
  95904. var BrtMarginKeys = ["left","right","top","bottom","header","footer"];
  95905. function parse_BrtMargins(data) {
  95906. var margins = ({});
  95907. BrtMarginKeys.forEach(function(k) { margins[k] = parse_Xnum(data, 8); });
  95908. return margins;
  95909. }
  95910. function write_BrtMargins(margins, o) {
  95911. if(o == null) o = new_buf(6*8);
  95912. default_margins(margins);
  95913. BrtMarginKeys.forEach(function(k) { write_Xnum((margins)[k], o); });
  95914. return o;
  95915. }
  95916. /* [MS-XLSB] 2.4.299 BrtBeginWsView */
  95917. function parse_BrtBeginWsView(data) {
  95918. var f = data.read_shift(2);
  95919. data.l += 28;
  95920. return { RTL: f & 0x20 };
  95921. }
  95922. function write_BrtBeginWsView(ws, Workbook, o) {
  95923. if(o == null) o = new_buf(30);
  95924. var f = 0x39c;
  95925. if((((Workbook||{}).Views||[])[0]||{}).RTL) f |= 0x20;
  95926. o.write_shift(2, f); // bit flag
  95927. o.write_shift(4, 0);
  95928. o.write_shift(4, 0); // view first row
  95929. o.write_shift(4, 0); // view first col
  95930. o.write_shift(1, 0); // gridline color ICV
  95931. o.write_shift(1, 0);
  95932. o.write_shift(2, 0);
  95933. o.write_shift(2, 100); // zoom scale
  95934. o.write_shift(2, 0);
  95935. o.write_shift(2, 0);
  95936. o.write_shift(2, 0);
  95937. o.write_shift(4, 0); // workbook view id
  95938. return o;
  95939. }
  95940. /* [MS-XLSB] 2.4.309 BrtCellIgnoreEC */
  95941. function write_BrtCellIgnoreEC(ref) {
  95942. var o = new_buf(24);
  95943. o.write_shift(4, 4);
  95944. o.write_shift(4, 1);
  95945. write_UncheckedRfX(ref, o);
  95946. return o;
  95947. }
  95948. /* [MS-XLSB] 2.4.748 BrtSheetProtection */
  95949. function write_BrtSheetProtection(sp, o) {
  95950. if(o == null) o = new_buf(16*4+2);
  95951. o.write_shift(2, sp.password ? crypto_CreatePasswordVerifier_Method1(sp.password) : 0);
  95952. o.write_shift(4, 1); // this record should not be written if no protection
  95953. [
  95954. ["objects", false], // fObjects
  95955. ["scenarios", false], // fScenarios
  95956. ["formatCells", true], // fFormatCells
  95957. ["formatColumns", true], // fFormatColumns
  95958. ["formatRows", true], // fFormatRows
  95959. ["insertColumns", true], // fInsertColumns
  95960. ["insertRows", true], // fInsertRows
  95961. ["insertHyperlinks", true], // fInsertHyperlinks
  95962. ["deleteColumns", true], // fDeleteColumns
  95963. ["deleteRows", true], // fDeleteRows
  95964. ["selectLockedCells", false], // fSelLockedCells
  95965. ["sort", true], // fSort
  95966. ["autoFilter", true], // fAutoFilter
  95967. ["pivotTables", true], // fPivotTables
  95968. ["selectUnlockedCells", false] // fSelUnlockedCells
  95969. ].forEach(function(n) {
  95970. if(n[1]) o.write_shift(4, sp[n[0]] != null && !sp[n[0]] ? 1 : 0);
  95971. else o.write_shift(4, sp[n[0]] != null && sp[n[0]] ? 0 : 1);
  95972. });
  95973. return o;
  95974. }
  95975. function parse_BrtDVal(/*data, length, opts*/) {
  95976. }
  95977. function parse_BrtDVal14(/*data, length, opts*/) {
  95978. }
  95979. /* [MS-XLSB] 2.1.7.61 Worksheet */
  95980. function parse_ws_bin(data, _opts, idx, rels, wb, themes, styles) {
  95981. if(!data) return data;
  95982. var opts = _opts || {};
  95983. if(!rels) rels = {'!id':{}};
  95984. if(DENSE != null && opts.dense == null) opts.dense = DENSE;
  95985. var s = (opts.dense ? [] : {});
  95986. var ref;
  95987. var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
  95988. var state = [];
  95989. var pass = false, end = false;
  95990. var row, p, cf, R, C, addr, sstr, rr, cell;
  95991. var merges = [];
  95992. opts.biff = 12;
  95993. opts['!row'] = 0;
  95994. var ai = 0, af = false;
  95995. var arrayf = [];
  95996. var sharedf = {};
  95997. var supbooks = opts.supbooks || wb.supbooks || ([[]]);
  95998. supbooks.sharedf = sharedf;
  95999. supbooks.arrayf = arrayf;
  96000. supbooks.SheetNames = wb.SheetNames || wb.Sheets.map(function(x) { return x.name; });
  96001. if(!opts.supbooks) {
  96002. opts.supbooks = supbooks;
  96003. if(wb.Names) for(var i = 0; i < wb.Names.length; ++i) supbooks[0][i+1] = wb.Names[i];
  96004. }
  96005. var colinfo = [], rowinfo = [];
  96006. var seencol = false;
  96007. recordhopper(data, function ws_parse(val, R_n, RT) {
  96008. if(end) return;
  96009. switch(RT) {
  96010. case 0x0094: /* 'BrtWsDim' */
  96011. ref = val; break;
  96012. case 0x0000: /* 'BrtRowHdr' */
  96013. row = val;
  96014. if(opts.sheetRows && opts.sheetRows <= row.r) end=true;
  96015. rr = encode_row(R = row.r);
  96016. opts['!row'] = row.r;
  96017. if(val.hidden || val.hpt || val.level != null) {
  96018. if(val.hpt) val.hpx = pt2px(val.hpt);
  96019. rowinfo[val.r] = val;
  96020. }
  96021. break;
  96022. case 0x0002: /* 'BrtCellRk' */
  96023. case 0x0003: /* 'BrtCellError' */
  96024. case 0x0004: /* 'BrtCellBool' */
  96025. case 0x0005: /* 'BrtCellReal' */
  96026. case 0x0006: /* 'BrtCellSt' */
  96027. case 0x0007: /* 'BrtCellIsst' */
  96028. case 0x0008: /* 'BrtFmlaString' */
  96029. case 0x0009: /* 'BrtFmlaNum' */
  96030. case 0x000A: /* 'BrtFmlaBool' */
  96031. case 0x000B: /* 'BrtFmlaError' */
  96032. p = ({t:val[2]});
  96033. switch(val[2]) {
  96034. case 'n': p.v = val[1]; break;
  96035. case 's': sstr = strs[val[1]]; p.v = sstr.t; p.r = sstr.r; break;
  96036. case 'b': p.v = val[1] ? true : false; break;
  96037. case 'e': p.v = val[1]; if(opts.cellText !== false) p.w = BErr[p.v]; break;
  96038. case 'str': p.t = 's'; p.v = val[1]; break;
  96039. }
  96040. if((cf = styles.CellXf[val[0].iStyleRef])) safe_format(p,cf.numFmtId,null,opts, themes, styles);
  96041. C = val[0].c;
  96042. if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; }
  96043. else s[encode_col(C) + rr] = p;
  96044. if(opts.cellFormula) {
  96045. af = false;
  96046. for(ai = 0; ai < arrayf.length; ++ai) {
  96047. var aii = arrayf[ai];
  96048. if(row.r >= aii[0].s.r && row.r <= aii[0].e.r)
  96049. if(C >= aii[0].s.c && C <= aii[0].e.c) {
  96050. p.F = encode_range(aii[0]); af = true;
  96051. }
  96052. }
  96053. if(!af && val.length > 3) p.f = val[3];
  96054. }
  96055. if(refguess.s.r > row.r) refguess.s.r = row.r;
  96056. if(refguess.s.c > C) refguess.s.c = C;
  96057. if(refguess.e.r < row.r) refguess.e.r = row.r;
  96058. if(refguess.e.c < C) refguess.e.c = C;
  96059. if(opts.cellDates && cf && p.t == 'n' && SSF.is_date(SSF._table[cf.numFmtId])) {
  96060. var _d = SSF.parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); }
  96061. }
  96062. break;
  96063. case 0x0001: /* 'BrtCellBlank' */
  96064. if(!opts.sheetStubs || pass) break;
  96065. p = ({t:'z',v:undefined});
  96066. C = val[0].c;
  96067. if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; }
  96068. else s[encode_col(C) + rr] = p;
  96069. if(refguess.s.r > row.r) refguess.s.r = row.r;
  96070. if(refguess.s.c > C) refguess.s.c = C;
  96071. if(refguess.e.r < row.r) refguess.e.r = row.r;
  96072. if(refguess.e.c < C) refguess.e.c = C;
  96073. break;
  96074. case 0x00B0: /* 'BrtMergeCell' */
  96075. merges.push(val); break;
  96076. case 0x01EE: /* 'BrtHLink' */
  96077. var rel = rels['!id'][val.relId];
  96078. if(rel) {
  96079. val.Target = rel.Target;
  96080. if(val.loc) val.Target += "#"+val.loc;
  96081. val.Rel = rel;
  96082. } else if(val.relId == '') {
  96083. val.Target = "#" + val.loc;
  96084. }
  96085. for(R=val.rfx.s.r;R<=val.rfx.e.r;++R) for(C=val.rfx.s.c;C<=val.rfx.e.c;++C) {
  96086. if(opts.dense) {
  96087. if(!s[R]) s[R] = [];
  96088. if(!s[R][C]) s[R][C] = {t:'z',v:undefined};
  96089. s[R][C].l = val;
  96090. } else {
  96091. addr = encode_cell({c:C,r:R});
  96092. if(!s[addr]) s[addr] = {t:'z',v:undefined};
  96093. s[addr].l = val;
  96094. }
  96095. }
  96096. break;
  96097. case 0x01AA: /* 'BrtArrFmla' */
  96098. if(!opts.cellFormula) break;
  96099. arrayf.push(val);
  96100. cell = ((opts.dense ? s[R][C] : s[encode_col(C) + rr]));
  96101. cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
  96102. cell.F = encode_range(val[0]);
  96103. break;
  96104. case 0x01AB: /* 'BrtShrFmla' */
  96105. if(!opts.cellFormula) break;
  96106. sharedf[encode_cell(val[0].s)] = val[1];
  96107. cell = (opts.dense ? s[R][C] : s[encode_col(C) + rr]);
  96108. cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
  96109. break;
  96110. /* identical to 'ColInfo' in XLS */
  96111. case 0x003C: /* 'BrtColInfo' */
  96112. if(!opts.cellStyles) break;
  96113. while(val.e >= val.s) {
  96114. colinfo[val.e--] = { width: val.w/256, hidden: !!(val.flags & 0x01), level: val.level };
  96115. if(!seencol) { seencol = true; find_mdw_colw(val.w/256); }
  96116. process_col(colinfo[val.e+1]);
  96117. }
  96118. break;
  96119. case 0x00A1: /* 'BrtBeginAFilter' */
  96120. s['!autofilter'] = { ref:encode_range(val) };
  96121. break;
  96122. case 0x01DC: /* 'BrtMargins' */
  96123. s['!margins'] = val;
  96124. break;
  96125. case 0x0093: /* 'BrtWsProp' */
  96126. if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
  96127. if(val.name) wb.Sheets[idx].CodeName = val.name;
  96128. break;
  96129. case 0x0089: /* 'BrtBeginWsView' */
  96130. if(!wb.Views) wb.Views = [{}];
  96131. if(!wb.Views[0]) wb.Views[0] = {};
  96132. if(val.RTL) wb.Views[0].RTL = true;
  96133. break;
  96134. case 0x01E5: /* 'BrtWsFmtInfo' */
  96135. break;
  96136. case 0x0040: /* 'BrtDVal' */
  96137. case 0x041D: /* 'BrtDVal14' */
  96138. break;
  96139. case 0x0097: /* 'BrtPane' */
  96140. break;
  96141. case 0x00AF: /* 'BrtAFilterDateGroupItem' */
  96142. case 0x0284: /* 'BrtActiveX' */
  96143. case 0x0271: /* 'BrtBigName' */
  96144. case 0x0232: /* 'BrtBkHim' */
  96145. case 0x018C: /* 'BrtBrk' */
  96146. case 0x0458: /* 'BrtCFIcon' */
  96147. case 0x047A: /* 'BrtCFRuleExt' */
  96148. case 0x01D7: /* 'BrtCFVO' */
  96149. case 0x041A: /* 'BrtCFVO14' */
  96150. case 0x0289: /* 'BrtCellIgnoreEC' */
  96151. case 0x0451: /* 'BrtCellIgnoreEC14' */
  96152. case 0x0031: /* 'BrtCellMeta' */
  96153. case 0x024D: /* 'BrtCellSmartTagProperty' */
  96154. case 0x025F: /* 'BrtCellWatch' */
  96155. case 0x0234: /* 'BrtColor' */
  96156. case 0x041F: /* 'BrtColor14' */
  96157. case 0x00A8: /* 'BrtColorFilter' */
  96158. case 0x00AE: /* 'BrtCustomFilter' */
  96159. case 0x049C: /* 'BrtCustomFilter14' */
  96160. case 0x01F3: /* 'BrtDRef' */
  96161. case 0x0226: /* 'BrtDrawing' */
  96162. case 0x00AB: /* 'BrtDynamicFilter' */
  96163. case 0x00A7: /* 'BrtFilter' */
  96164. case 0x0499: /* 'BrtFilter14' */
  96165. case 0x00A9: /* 'BrtIconFilter' */
  96166. case 0x049D: /* 'BrtIconFilter14' */
  96167. case 0x0227: /* 'BrtLegacyDrawing' */
  96168. case 0x0228: /* 'BrtLegacyDrawingHF' */
  96169. case 0x0295: /* 'BrtListPart' */
  96170. case 0x027F: /* 'BrtOleObject' */
  96171. case 0x01DE: /* 'BrtPageSetup' */
  96172. case 0x0219: /* 'BrtPhoneticInfo' */
  96173. case 0x01DD: /* 'BrtPrintOptions' */
  96174. case 0x0218: /* 'BrtRangeProtection' */
  96175. case 0x044F: /* 'BrtRangeProtection14' */
  96176. case 0x02A8: /* 'BrtRangeProtectionIso' */
  96177. case 0x0450: /* 'BrtRangeProtectionIso14' */
  96178. case 0x0400: /* 'BrtRwDescent' */
  96179. case 0x0098: /* 'BrtSel' */
  96180. case 0x0297: /* 'BrtSheetCalcProp' */
  96181. case 0x0217: /* 'BrtSheetProtection' */
  96182. case 0x02A6: /* 'BrtSheetProtectionIso' */
  96183. case 0x01F8: /* 'BrtSlc' */
  96184. case 0x0413: /* 'BrtSparkline' */
  96185. case 0x01AC: /* 'BrtTable' */
  96186. case 0x00AA: /* 'BrtTop10Filter' */
  96187. case 0x0C00: /* 'BrtUid' */
  96188. case 0x0032: /* 'BrtValueMeta' */
  96189. case 0x0816: /* 'BrtWebExtension' */
  96190. case 0x0415: /* 'BrtWsFmtInfoEx14' */
  96191. break;
  96192. case 0x0023: /* 'BrtFRTBegin' */
  96193. pass = true; break;
  96194. case 0x0024: /* 'BrtFRTEnd' */
  96195. pass = false; break;
  96196. case 0x0025: /* 'BrtACBegin' */
  96197. state.push(R_n); pass = true; break;
  96198. case 0x0026: /* 'BrtACEnd' */
  96199. state.pop(); pass = false; break;
  96200. default:
  96201. if((R_n||"").indexOf("Begin") > 0){/* empty */}
  96202. else if((R_n||"").indexOf("End") > 0){/* empty */}
  96203. else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
  96204. }
  96205. }, opts);
  96206. delete opts.supbooks;
  96207. delete opts['!row'];
  96208. if(!s["!ref"] && (refguess.s.r < 2000000 || ref && (ref.e.r > 0 || ref.e.c > 0 || ref.s.r > 0 || ref.s.c > 0))) s["!ref"] = encode_range(ref || refguess);
  96209. if(opts.sheetRows && s["!ref"]) {
  96210. var tmpref = safe_decode_range(s["!ref"]);
  96211. if(opts.sheetRows <= +tmpref.e.r) {
  96212. tmpref.e.r = opts.sheetRows - 1;
  96213. if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;
  96214. if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;
  96215. if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;
  96216. if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;
  96217. s["!fullref"] = s["!ref"];
  96218. s["!ref"] = encode_range(tmpref);
  96219. }
  96220. }
  96221. if(merges.length > 0) s["!merges"] = merges;
  96222. if(colinfo.length > 0) s["!cols"] = colinfo;
  96223. if(rowinfo.length > 0) s["!rows"] = rowinfo;
  96224. return s;
  96225. }
  96226. /* TODO: something useful -- this is a stub */
  96227. function write_ws_bin_cell(ba, cell, R, C, opts, ws) {
  96228. if(cell.v === undefined) return;
  96229. var vv = "";
  96230. switch(cell.t) {
  96231. case 'b': vv = cell.v ? "1" : "0"; break;
  96232. case 'd': // no BrtCellDate :(
  96233. cell = dup(cell);
  96234. cell.z = cell.z || SSF._table[14];
  96235. cell.v = datenum(parseDate(cell.v)); cell.t = 'n';
  96236. break;
  96237. /* falls through */
  96238. case 'n': case 'e': vv = ''+cell.v; break;
  96239. default: vv = cell.v; break;
  96240. }
  96241. var o = ({r:R, c:C});
  96242. /* TODO: cell style */
  96243. o.s = get_cell_style(opts.cellXfs, cell, opts);
  96244. if(cell.l) ws['!links'].push([encode_cell(o), cell.l]);
  96245. if(cell.c) ws['!comments'].push([encode_cell(o), cell.c]);
  96246. switch(cell.t) {
  96247. case 's': case 'str':
  96248. if(opts.bookSST) {
  96249. vv = get_sst_id(opts.Strings, (cell.v), opts.revStrings);
  96250. o.t = "s"; o.v = vv;
  96251. write_record(ba, "BrtCellIsst", write_BrtCellIsst(cell, o));
  96252. } else {
  96253. o.t = "str";
  96254. write_record(ba, "BrtCellSt", write_BrtCellSt(cell, o));
  96255. }
  96256. return;
  96257. case 'n':
  96258. /* TODO: determine threshold for Real vs RK */
  96259. if(cell.v == (cell.v | 0) && cell.v > -1000 && cell.v < 1000) write_record(ba, "BrtCellRk", write_BrtCellRk(cell, o));
  96260. else write_record(ba, "BrtCellReal", write_BrtCellReal(cell, o));
  96261. return;
  96262. case 'b':
  96263. o.t = "b";
  96264. write_record(ba, "BrtCellBool", write_BrtCellBool(cell, o));
  96265. return;
  96266. case 'e': /* TODO: error */ o.t = "e"; break;
  96267. }
  96268. write_record(ba, "BrtCellBlank", write_BrtCellBlank(cell, o));
  96269. }
  96270. function write_CELLTABLE(ba, ws, idx, opts) {
  96271. var range = safe_decode_range(ws['!ref'] || "A1"), ref, rr = "", cols = [];
  96272. write_record(ba, 'BrtBeginSheetData');
  96273. var dense = Array.isArray(ws);
  96274. var cap = range.e.r;
  96275. if(ws['!rows']) cap = Math.max(range.e.r, ws['!rows'].length - 1);
  96276. for(var R = range.s.r; R <= cap; ++R) {
  96277. rr = encode_row(R);
  96278. /* [ACCELLTABLE] */
  96279. /* BrtRowHdr */
  96280. write_row_header(ba, ws, range, R);
  96281. if(R <= range.e.r) for(var C = range.s.c; C <= range.e.c; ++C) {
  96282. /* *16384CELL */
  96283. if(R === range.s.r) cols[C] = encode_col(C);
  96284. ref = cols[C] + rr;
  96285. var cell = dense ? (ws[R]||[])[C] : ws[ref];
  96286. if(!cell) continue;
  96287. /* write cell */
  96288. write_ws_bin_cell(ba, cell, R, C, opts, ws);
  96289. }
  96290. }
  96291. write_record(ba, 'BrtEndSheetData');
  96292. }
  96293. function write_MERGECELLS(ba, ws) {
  96294. if(!ws || !ws['!merges']) return;
  96295. write_record(ba, 'BrtBeginMergeCells', write_BrtBeginMergeCells(ws['!merges'].length));
  96296. ws['!merges'].forEach(function(m) { write_record(ba, 'BrtMergeCell', write_BrtMergeCell(m)); });
  96297. write_record(ba, 'BrtEndMergeCells');
  96298. }
  96299. function write_COLINFOS(ba, ws) {
  96300. if(!ws || !ws['!cols']) return;
  96301. write_record(ba, 'BrtBeginColInfos');
  96302. ws['!cols'].forEach(function(m, i) { if(m) write_record(ba, 'BrtColInfo', write_BrtColInfo(i, m)); });
  96303. write_record(ba, 'BrtEndColInfos');
  96304. }
  96305. function write_IGNOREECS(ba, ws) {
  96306. if(!ws || !ws['!ref']) return;
  96307. write_record(ba, 'BrtBeginCellIgnoreECs');
  96308. write_record(ba, 'BrtCellIgnoreEC', write_BrtCellIgnoreEC(safe_decode_range(ws['!ref'])));
  96309. write_record(ba, 'BrtEndCellIgnoreECs');
  96310. }
  96311. function write_HLINKS(ba, ws, rels) {
  96312. /* *BrtHLink */
  96313. ws['!links'].forEach(function(l) {
  96314. if(!l[1].Target) return;
  96315. var rId = add_rels(rels, -1, l[1].Target.replace(/#.*$/, ""), RELS.HLINK);
  96316. write_record(ba, "BrtHLink", write_BrtHLink(l, rId));
  96317. });
  96318. delete ws['!links'];
  96319. }
  96320. function write_LEGACYDRAWING(ba, ws, idx, rels) {
  96321. /* [BrtLegacyDrawing] */
  96322. if(ws['!comments'].length > 0) {
  96323. var rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx+1) + ".vml", RELS.VML);
  96324. write_record(ba, "BrtLegacyDrawing", write_RelID("rId" + rId));
  96325. ws['!legacy'] = rId;
  96326. }
  96327. }
  96328. function write_AUTOFILTER(ba, ws, wb, idx) {
  96329. if(!ws['!autofilter']) return;
  96330. var data = ws['!autofilter'];
  96331. var ref = typeof data.ref === "string" ? data.ref : encode_range(data.ref);
  96332. /* Update FilterDatabase defined name for the worksheet */
  96333. if(!wb.Workbook) wb.Workbook = ({Sheets:[]});
  96334. if(!wb.Workbook.Names) wb.Workbook.Names = [];
  96335. var names = wb.Workbook.Names;
  96336. var range = decode_range(ref);
  96337. if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
  96338. for(var i = 0; i < names.length; ++i) {
  96339. var name = names[i];
  96340. if(name.Name != '_xlnm._FilterDatabase') continue;
  96341. if(name.Sheet != idx) continue;
  96342. name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
  96343. }
  96344. if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
  96345. write_record(ba, "BrtBeginAFilter", write_UncheckedRfX(safe_decode_range(ref)));
  96346. /* *FILTERCOLUMN */
  96347. /* [SORTSTATE] */
  96348. /* BrtEndAFilter */
  96349. write_record(ba, "BrtEndAFilter");
  96350. }
  96351. function write_WSVIEWS2(ba, ws, Workbook) {
  96352. write_record(ba, "BrtBeginWsViews");
  96353. { /* 1*WSVIEW2 */
  96354. /* [ACUID] */
  96355. write_record(ba, "BrtBeginWsView", write_BrtBeginWsView(ws, Workbook));
  96356. /* [BrtPane] */
  96357. /* *4BrtSel */
  96358. /* *4SXSELECT */
  96359. /* *FRT */
  96360. write_record(ba, "BrtEndWsView");
  96361. }
  96362. /* *FRT */
  96363. write_record(ba, "BrtEndWsViews");
  96364. }
  96365. function write_WSFMTINFO() {
  96366. /* [ACWSFMTINFO] */
  96367. //write_record(ba, "BrtWsFmtInfo", write_BrtWsFmtInfo(ws));
  96368. }
  96369. function write_SHEETPROTECT(ba, ws) {
  96370. if(!ws['!protect']) return;
  96371. /* [BrtSheetProtectionIso] */
  96372. write_record(ba, "BrtSheetProtection", write_BrtSheetProtection(ws['!protect']));
  96373. }
  96374. function write_ws_bin(idx, opts, wb, rels) {
  96375. var ba = buf_array();
  96376. var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
  96377. var c = s; try { if(wb && wb.Workbook) c = wb.Workbook.Sheets[idx].CodeName || c; } catch(e) {}
  96378. var r = safe_decode_range(ws['!ref'] || "A1");
  96379. if(r.e.c > 0x3FFF || r.e.r > 0xFFFFF) {
  96380. if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:XFD1048576");
  96381. r.e.c = Math.min(r.e.c, 0x3FFF);
  96382. r.e.r = Math.min(r.e.c, 0xFFFFF);
  96383. }
  96384. ws['!links'] = [];
  96385. /* passed back to write_zip and removed there */
  96386. ws['!comments'] = [];
  96387. write_record(ba, "BrtBeginSheet");
  96388. if(wb.vbaraw) write_record(ba, "BrtWsProp", write_BrtWsProp(c));
  96389. write_record(ba, "BrtWsDim", write_BrtWsDim(r));
  96390. write_WSVIEWS2(ba, ws, wb.Workbook);
  96391. write_WSFMTINFO(ba, ws);
  96392. write_COLINFOS(ba, ws, idx, opts, wb);
  96393. write_CELLTABLE(ba, ws, idx, opts, wb);
  96394. /* [BrtSheetCalcProp] */
  96395. write_SHEETPROTECT(ba, ws);
  96396. /* *([BrtRangeProtectionIso] BrtRangeProtection) */
  96397. /* [SCENMAN] */
  96398. write_AUTOFILTER(ba, ws, wb, idx);
  96399. /* [SORTSTATE] */
  96400. /* [DCON] */
  96401. /* [USERSHVIEWS] */
  96402. write_MERGECELLS(ba, ws);
  96403. /* [BrtPhoneticInfo] */
  96404. /* *CONDITIONALFORMATTING */
  96405. /* [DVALS] */
  96406. write_HLINKS(ba, ws, rels);
  96407. /* [BrtPrintOptions] */
  96408. if(ws['!margins']) write_record(ba, "BrtMargins", write_BrtMargins(ws['!margins']));
  96409. /* [BrtPageSetup] */
  96410. /* [HEADERFOOTER] */
  96411. /* [RWBRK] */
  96412. /* [COLBRK] */
  96413. /* *BrtBigName */
  96414. /* [CELLWATCHES] */
  96415. if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) write_IGNOREECS(ba, ws);
  96416. /* [SMARTTAGS] */
  96417. /* [BrtDrawing] */
  96418. write_LEGACYDRAWING(ba, ws, idx, rels);
  96419. /* [BrtLegacyDrawingHF] */
  96420. /* [BrtBkHim] */
  96421. /* [OLEOBJECTS] */
  96422. /* [ACTIVEXCONTROLS] */
  96423. /* [WEBPUBITEMS] */
  96424. /* [LISTPARTS] */
  96425. /* FRTWORKSHEET */
  96426. write_record(ba, "BrtEndSheet");
  96427. return ba.end();
  96428. }
  96429. RELS.CHART = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart";
  96430. RELS.CHARTEX = "http://schemas.microsoft.com/office/2014/relationships/chartEx";
  96431. function parse_Cache(data) {
  96432. var col = [];
  96433. var num = data.match(/^<c:numCache>/);
  96434. var f;
  96435. /* 21.2.2.150 pt CT_NumVal */
  96436. (data.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(pt) {
  96437. var q = pt.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);
  96438. if(!q) return;
  96439. col[+q[1]] = num ? +q[2] : q[2];
  96440. });
  96441. /* 21.2.2.71 formatCode CT_Xstring */
  96442. var nf = unescapexml((data.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/) || ["","General"])[1]);
  96443. (data.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(F) { f = F.replace(/<.*?>/g,""); });
  96444. return [col, nf, f];
  96445. }
  96446. /* 21.2 DrawingML - Charts */
  96447. function parse_chart(data, name, opts, rels, wb, csheet) {
  96448. var cs = ((csheet || {"!type":"chart"}));
  96449. if(!data) return csheet;
  96450. /* 21.2.2.27 chart CT_Chart */
  96451. var C = 0, R = 0, col = "A";
  96452. var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
  96453. /* 21.2.2.120 numCache CT_NumData */
  96454. (data.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(nc) {
  96455. var cache = parse_Cache(nc);
  96456. refguess.s.r = refguess.s.c = 0;
  96457. refguess.e.c = C;
  96458. col = encode_col(C);
  96459. cache[0].forEach(function(n,i) {
  96460. cs[col + encode_row(i)] = {t:'n', v:n, z:cache[1] };
  96461. R = i;
  96462. });
  96463. if(refguess.e.r < R) refguess.e.r = R;
  96464. ++C;
  96465. });
  96466. if(C > 0) cs["!ref"] = encode_range(refguess);
  96467. return cs;
  96468. }
  96469. RELS.CS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet";
  96470. var CS_XML_ROOT = writextag('chartsheet', null, {
  96471. 'xmlns': XMLNS.main[0],
  96472. 'xmlns:r': XMLNS.r
  96473. });
  96474. /* 18.3 Worksheets also covers Chartsheets */
  96475. function parse_cs_xml(data, opts, idx, rels, wb) {
  96476. if(!data) return data;
  96477. /* 18.3.1.12 chartsheet CT_ChartSheet */
  96478. if(!rels) rels = {'!id':{}};
  96479. var s = ({'!type':"chart", '!drawel':null, '!rel':""});
  96480. var m;
  96481. /* 18.3.1.83 sheetPr CT_ChartsheetPr */
  96482. var sheetPr = data.match(sheetprregex);
  96483. if(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx);
  96484. /* 18.3.1.36 drawing CT_Drawing */
  96485. if((m = data.match(/drawing r:id="(.*?)"/))) s['!rel'] = m[1];
  96486. if(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']];
  96487. return s;
  96488. }
  96489. function write_cs_xml(idx, opts, wb, rels) {
  96490. var o = [XML_HEADER, CS_XML_ROOT];
  96491. o[o.length] = writextag("drawing", null, {"r:id": "rId1"});
  96492. add_rels(rels, -1, "../drawings/drawing" + (idx+1) + ".xml", RELS.DRAW);
  96493. if(o.length>2) { o[o.length] = ('</chartsheet>'); o[1]=o[1].replace("/>",">"); }
  96494. return o.join("");
  96495. }
  96496. /* [MS-XLSB] 2.4.331 BrtCsProp */
  96497. function parse_BrtCsProp(data, length) {
  96498. data.l += 10;
  96499. var name = parse_XLWideString(data, length - 10);
  96500. return { name: name };
  96501. }
  96502. /* [MS-XLSB] 2.1.7.7 Chart Sheet */
  96503. function parse_cs_bin(data, opts, idx, rels, wb) {
  96504. if(!data) return data;
  96505. if(!rels) rels = {'!id':{}};
  96506. var s = {'!type':"chart", '!drawel':null, '!rel':""};
  96507. var state = [];
  96508. var pass = false;
  96509. recordhopper(data, function cs_parse(val, R_n, RT) {
  96510. switch(RT) {
  96511. case 0x0226: /* 'BrtDrawing' */
  96512. s['!rel'] = val; break;
  96513. case 0x028B: /* 'BrtCsProp' */
  96514. if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
  96515. if(val.name) wb.Sheets[idx].CodeName = val.name;
  96516. break;
  96517. case 0x0232: /* 'BrtBkHim' */
  96518. case 0x028C: /* 'BrtCsPageSetup' */
  96519. case 0x029D: /* 'BrtCsProtection' */
  96520. case 0x02A7: /* 'BrtCsProtectionIso' */
  96521. case 0x0227: /* 'BrtLegacyDrawing' */
  96522. case 0x0228: /* 'BrtLegacyDrawingHF' */
  96523. case 0x01DC: /* 'BrtMargins' */
  96524. case 0x0C00: /* 'BrtUid' */
  96525. break;
  96526. case 0x0023: /* 'BrtFRTBegin' */
  96527. pass = true; break;
  96528. case 0x0024: /* 'BrtFRTEnd' */
  96529. pass = false; break;
  96530. case 0x0025: /* 'BrtACBegin' */
  96531. state.push(R_n); break;
  96532. case 0x0026: /* 'BrtACEnd' */
  96533. state.pop(); break;
  96534. default:
  96535. if((R_n||"").indexOf("Begin") > 0) state.push(R_n);
  96536. else if((R_n||"").indexOf("End") > 0) state.pop();
  96537. else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
  96538. }
  96539. }, opts);
  96540. if(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']];
  96541. return s;
  96542. }
  96543. function write_cs_bin() {
  96544. var ba = buf_array();
  96545. write_record(ba, "BrtBeginSheet");
  96546. /* [BrtCsProp] */
  96547. /* CSVIEWS */
  96548. /* [[BrtCsProtectionIso] BrtCsProtection] */
  96549. /* [USERCSVIEWS] */
  96550. /* [BrtMargins] */
  96551. /* [BrtCsPageSetup] */
  96552. /* [HEADERFOOTER] */
  96553. /* BrtDrawing */
  96554. /* [BrtLegacyDrawing] */
  96555. /* [BrtLegacyDrawingHF] */
  96556. /* [BrtBkHim] */
  96557. /* [WEBPUBITEMS] */
  96558. /* FRTCHARTSHEET */
  96559. write_record(ba, "BrtEndSheet");
  96560. return ba.end();
  96561. }
  96562. /* 18.2.28 (CT_WorkbookProtection) Defaults */
  96563. var WBPropsDef = [
  96564. ['allowRefreshQuery', false, "bool"],
  96565. ['autoCompressPictures', true, "bool"],
  96566. ['backupFile', false, "bool"],
  96567. ['checkCompatibility', false, "bool"],
  96568. ['CodeName', ''],
  96569. ['date1904', false, "bool"],
  96570. ['defaultThemeVersion', 0, "int"],
  96571. ['filterPrivacy', false, "bool"],
  96572. ['hidePivotFieldList', false, "bool"],
  96573. ['promptedSolutions', false, "bool"],
  96574. ['publishItems', false, "bool"],
  96575. ['refreshAllConnections', false, "bool"],
  96576. ['saveExternalLinkValues', true, "bool"],
  96577. ['showBorderUnselectedTables', true, "bool"],
  96578. ['showInkAnnotation', true, "bool"],
  96579. ['showObjects', 'all'],
  96580. ['showPivotChartFilter', false, "bool"],
  96581. ['updateLinks', 'userSet']
  96582. ];
  96583. /* 18.2.30 (CT_BookView) Defaults */
  96584. var WBViewDef = [
  96585. ['activeTab', 0, "int"],
  96586. ['autoFilterDateGrouping', true, "bool"],
  96587. ['firstSheet', 0, "int"],
  96588. ['minimized', false, "bool"],
  96589. ['showHorizontalScroll', true, "bool"],
  96590. ['showSheetTabs', true, "bool"],
  96591. ['showVerticalScroll', true, "bool"],
  96592. ['tabRatio', 600, "int"],
  96593. ['visibility', 'visible']
  96594. //window{Height,Width}, {x,y}Window
  96595. ];
  96596. /* 18.2.19 (CT_Sheet) Defaults */
  96597. var SheetDef = [
  96598. //['state', 'visible']
  96599. ];
  96600. /* 18.2.2 (CT_CalcPr) Defaults */
  96601. var CalcPrDef = [
  96602. ['calcCompleted', 'true'],
  96603. ['calcMode', 'auto'],
  96604. ['calcOnSave', 'true'],
  96605. ['concurrentCalc', 'true'],
  96606. ['fullCalcOnLoad', 'false'],
  96607. ['fullPrecision', 'true'],
  96608. ['iterate', 'false'],
  96609. ['iterateCount', '100'],
  96610. ['iterateDelta', '0.001'],
  96611. ['refMode', 'A1']
  96612. ];
  96613. /* 18.2.3 (CT_CustomWorkbookView) Defaults */
  96614. /*var CustomWBViewDef = [
  96615. ['autoUpdate', 'false'],
  96616. ['changesSavedWin', 'false'],
  96617. ['includeHiddenRowCol', 'true'],
  96618. ['includePrintSettings', 'true'],
  96619. ['maximized', 'false'],
  96620. ['minimized', 'false'],
  96621. ['onlySync', 'false'],
  96622. ['personalView', 'false'],
  96623. ['showComments', 'commIndicator'],
  96624. ['showFormulaBar', 'true'],
  96625. ['showHorizontalScroll', 'true'],
  96626. ['showObjects', 'all'],
  96627. ['showSheetTabs', 'true'],
  96628. ['showStatusbar', 'true'],
  96629. ['showVerticalScroll', 'true'],
  96630. ['tabRatio', '600'],
  96631. ['xWindow', '0'],
  96632. ['yWindow', '0']
  96633. ];*/
  96634. function push_defaults_array(target, defaults) {
  96635. for(var j = 0; j != target.length; ++j) { var w = target[j];
  96636. for(var i=0; i != defaults.length; ++i) { var z = defaults[i];
  96637. if(w[z[0]] == null) w[z[0]] = z[1];
  96638. else switch(z[2]) {
  96639. case "bool": if(typeof w[z[0]] == "string") w[z[0]] = parsexmlbool(w[z[0]]); break;
  96640. case "int": if(typeof w[z[0]] == "string") w[z[0]] = parseInt(w[z[0]], 10); break;
  96641. }
  96642. }
  96643. }
  96644. }
  96645. function push_defaults(target, defaults) {
  96646. for(var i = 0; i != defaults.length; ++i) { var z = defaults[i];
  96647. if(target[z[0]] == null) target[z[0]] = z[1];
  96648. else switch(z[2]) {
  96649. case "bool": if(typeof target[z[0]] == "string") target[z[0]] = parsexmlbool(target[z[0]]); break;
  96650. case "int": if(typeof target[z[0]] == "string") target[z[0]] = parseInt(target[z[0]], 10); break;
  96651. }
  96652. }
  96653. }
  96654. function parse_wb_defaults(wb) {
  96655. push_defaults(wb.WBProps, WBPropsDef);
  96656. push_defaults(wb.CalcPr, CalcPrDef);
  96657. push_defaults_array(wb.WBView, WBViewDef);
  96658. push_defaults_array(wb.Sheets, SheetDef);
  96659. _ssfopts.date1904 = parsexmlbool(wb.WBProps.date1904);
  96660. }
  96661. function safe1904(wb) {
  96662. /* TODO: store date1904 somewhere else */
  96663. if(!wb.Workbook) return "false";
  96664. if(!wb.Workbook.WBProps) return "false";
  96665. return parsexmlbool(wb.Workbook.WBProps.date1904) ? "true" : "false";
  96666. }
  96667. var badchars = "][*?\/\\".split("");
  96668. function check_ws_name(n, safe) {
  96669. if(n.length > 31) { if(safe) return false; throw new Error("Sheet names cannot exceed 31 chars"); }
  96670. var _good = true;
  96671. badchars.forEach(function(c) {
  96672. if(n.indexOf(c) == -1) return;
  96673. if(!safe) throw new Error("Sheet name cannot contain : \\ / ? * [ ]");
  96674. _good = false;
  96675. });
  96676. return _good;
  96677. }
  96678. function check_wb_names(N, S, codes) {
  96679. N.forEach(function(n,i) {
  96680. check_ws_name(n);
  96681. for(var j = 0; j < i; ++j) if(n == N[j]) throw new Error("Duplicate Sheet Name: " + n);
  96682. if(codes) {
  96683. var cn = (S && S[i] && S[i].CodeName) || n;
  96684. if(cn.charCodeAt(0) == 95 && cn.length > 22) throw new Error("Bad Code Name: Worksheet" + cn);
  96685. }
  96686. });
  96687. }
  96688. function check_wb(wb) {
  96689. if(!wb || !wb.SheetNames || !wb.Sheets) throw new Error("Invalid Workbook");
  96690. if(!wb.SheetNames.length) throw new Error("Workbook is empty");
  96691. var Sheets = (wb.Workbook && wb.Workbook.Sheets) || [];
  96692. check_wb_names(wb.SheetNames, Sheets, !!wb.vbaraw);
  96693. for(var i = 0; i < wb.SheetNames.length; ++i) check_ws(wb.Sheets[wb.SheetNames[i]], wb.SheetNames[i], i);
  96694. /* TODO: validate workbook */
  96695. }
  96696. /* 18.2 Workbook */
  96697. var wbnsregex = /<\w+:workbook/;
  96698. function parse_wb_xml(data, opts) {
  96699. if(!data) throw new Error("Could not find file");
  96700. var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, Names:[], xmlns: "" };
  96701. var pass = false, xmlns = "xmlns";
  96702. var dname = {}, dnstart = 0;
  96703. data.replace(tagregex, function xml_wb(x, idx) {
  96704. var y = parsexmltag(x);
  96705. switch(strip_ns(y[0])) {
  96706. case '<?xml': break;
  96707. /* 18.2.27 workbook CT_Workbook 1 */
  96708. case '<workbook':
  96709. if(x.match(wbnsregex)) xmlns = "xmlns" + x.match(/<(\w+):/)[1];
  96710. wb.xmlns = y[xmlns];
  96711. break;
  96712. case '</workbook>': break;
  96713. /* 18.2.13 fileVersion CT_FileVersion ? */
  96714. case '<fileVersion': delete y[0]; wb.AppVersion = y; break;
  96715. case '<fileVersion/>': case '</fileVersion>': break;
  96716. /* 18.2.12 fileSharing CT_FileSharing ? */
  96717. case '<fileSharing':
  96718. break;
  96719. case '<fileSharing/>': break;
  96720. /* 18.2.28 workbookPr CT_WorkbookPr ? */
  96721. case '<workbookPr':
  96722. case '<workbookPr/>':
  96723. WBPropsDef.forEach(function(w) {
  96724. if(y[w[0]] == null) return;
  96725. switch(w[2]) {
  96726. case "bool": wb.WBProps[w[0]] = parsexmlbool(y[w[0]]); break;
  96727. case "int": wb.WBProps[w[0]] = parseInt(y[w[0]], 10); break;
  96728. default: wb.WBProps[w[0]] = y[w[0]];
  96729. }
  96730. });
  96731. if(y.codeName) wb.WBProps.CodeName = y.codeName;
  96732. break;
  96733. case '</workbookPr>': break;
  96734. /* 18.2.29 workbookProtection CT_WorkbookProtection ? */
  96735. case '<workbookProtection':
  96736. break;
  96737. case '<workbookProtection/>': break;
  96738. /* 18.2.1 bookViews CT_BookViews ? */
  96739. case '<bookViews': case '<bookViews>': case '</bookViews>': break;
  96740. /* 18.2.30 workbookView CT_BookView + */
  96741. case '<workbookView': case '<workbookView/>': delete y[0]; wb.WBView.push(y); break;
  96742. case '</workbookView>': break;
  96743. /* 18.2.20 sheets CT_Sheets 1 */
  96744. case '<sheets': case '<sheets>': case '</sheets>': break; // aggregate sheet
  96745. /* 18.2.19 sheet CT_Sheet + */
  96746. case '<sheet':
  96747. switch(y.state) {
  96748. case "hidden": y.Hidden = 1; break;
  96749. case "veryHidden": y.Hidden = 2; break;
  96750. default: y.Hidden = 0;
  96751. }
  96752. delete y.state;
  96753. y.name = unescapexml(utf8read(y.name));
  96754. delete y[0]; wb.Sheets.push(y); break;
  96755. case '</sheet>': break;
  96756. /* 18.2.15 functionGroups CT_FunctionGroups ? */
  96757. case '<functionGroups': case '<functionGroups/>': break;
  96758. /* 18.2.14 functionGroup CT_FunctionGroup + */
  96759. case '<functionGroup': break;
  96760. /* 18.2.9 externalReferences CT_ExternalReferences ? */
  96761. case '<externalReferences': case '</externalReferences>': case '<externalReferences>': break;
  96762. /* 18.2.8 externalReference CT_ExternalReference + */
  96763. case '<externalReference': break;
  96764. /* 18.2.6 definedNames CT_DefinedNames ? */
  96765. case '<definedNames/>': break;
  96766. case '<definedNames>': case '<definedNames': pass=true; break;
  96767. case '</definedNames>': pass=false; break;
  96768. /* 18.2.5 definedName CT_DefinedName + */
  96769. case '<definedName': {
  96770. dname = {};
  96771. dname.Name = utf8read(y.name);
  96772. if(y.comment) dname.Comment = y.comment;
  96773. if(y.localSheetId) dname.Sheet = +y.localSheetId;
  96774. if(parsexmlbool(y.hidden||"0")) dname.Hidden = true;
  96775. dnstart = idx + x.length;
  96776. } break;
  96777. case '</definedName>': {
  96778. dname.Ref = unescapexml(utf8read(data.slice(dnstart, idx)));
  96779. wb.Names.push(dname);
  96780. } break;
  96781. case '<definedName/>': break;
  96782. /* 18.2.2 calcPr CT_CalcPr ? */
  96783. case '<calcPr': delete y[0]; wb.CalcPr = y; break;
  96784. case '<calcPr/>': delete y[0]; wb.CalcPr = y; break;
  96785. case '</calcPr>': break;
  96786. /* 18.2.16 oleSize CT_OleSize ? (ref required) */
  96787. case '<oleSize': break;
  96788. /* 18.2.4 customWorkbookViews CT_CustomWorkbookViews ? */
  96789. case '<customWorkbookViews>': case '</customWorkbookViews>': case '<customWorkbookViews': break;
  96790. /* 18.2.3 customWorkbookView CT_CustomWorkbookView + */
  96791. case '<customWorkbookView': case '</customWorkbookView>': break;
  96792. /* 18.2.18 pivotCaches CT_PivotCaches ? */
  96793. case '<pivotCaches>': case '</pivotCaches>': case '<pivotCaches': break;
  96794. /* 18.2.17 pivotCache CT_PivotCache ? */
  96795. case '<pivotCache': break;
  96796. /* 18.2.21 smartTagPr CT_SmartTagPr ? */
  96797. case '<smartTagPr': case '<smartTagPr/>': break;
  96798. /* 18.2.23 smartTagTypes CT_SmartTagTypes ? */
  96799. case '<smartTagTypes': case '<smartTagTypes>': case '</smartTagTypes>': break;
  96800. /* 18.2.22 smartTagType CT_SmartTagType ? */
  96801. case '<smartTagType': break;
  96802. /* 18.2.24 webPublishing CT_WebPublishing ? */
  96803. case '<webPublishing': case '<webPublishing/>': break;
  96804. /* 18.2.11 fileRecoveryPr CT_FileRecoveryPr ? */
  96805. case '<fileRecoveryPr': case '<fileRecoveryPr/>': break;
  96806. /* 18.2.26 webPublishObjects CT_WebPublishObjects ? */
  96807. case '<webPublishObjects>': case '<webPublishObjects': case '</webPublishObjects>': break;
  96808. /* 18.2.25 webPublishObject CT_WebPublishObject ? */
  96809. case '<webPublishObject': break;
  96810. /* 18.2.10 extLst CT_ExtensionList ? */
  96811. case '<extLst': case '<extLst>': case '</extLst>': case '<extLst/>': break;
  96812. /* 18.2.7 ext CT_Extension + */
  96813. case '<ext': pass=true; break; //TODO: check with versions of excel
  96814. case '</ext>': pass=false; break;
  96815. /* Others */
  96816. case '<ArchID': break;
  96817. case '<AlternateContent':
  96818. case '<AlternateContent>': pass=true; break;
  96819. case '</AlternateContent>': pass=false; break;
  96820. /* TODO */
  96821. case '<revisionPtr': break;
  96822. default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in workbook');
  96823. }
  96824. return x;
  96825. });
  96826. if(XMLNS.main.indexOf(wb.xmlns) === -1) throw new Error("Unknown Namespace: " + wb.xmlns);
  96827. parse_wb_defaults(wb);
  96828. return wb;
  96829. }
  96830. var WB_XML_ROOT = writextag('workbook', null, {
  96831. 'xmlns': XMLNS.main[0],
  96832. //'xmlns:mx': XMLNS.mx,
  96833. //'xmlns:s': XMLNS.main[0],
  96834. 'xmlns:r': XMLNS.r
  96835. });
  96836. function write_wb_xml(wb) {
  96837. var o = [XML_HEADER];
  96838. o[o.length] = WB_XML_ROOT;
  96839. var write_names = (wb.Workbook && (wb.Workbook.Names||[]).length > 0);
  96840. /* fileVersion */
  96841. /* fileSharing */
  96842. var workbookPr = ({codeName:"ThisWorkbook"});
  96843. if(wb.Workbook && wb.Workbook.WBProps) {
  96844. WBPropsDef.forEach(function(x) {
  96845. if((wb.Workbook.WBProps[x[0]]) == null) return;
  96846. if((wb.Workbook.WBProps[x[0]]) == x[1]) return;
  96847. workbookPr[x[0]] = (wb.Workbook.WBProps[x[0]]);
  96848. });
  96849. if(wb.Workbook.WBProps.CodeName) { workbookPr.codeName = wb.Workbook.WBProps.CodeName; delete workbookPr.CodeName; }
  96850. }
  96851. o[o.length] = (writextag('workbookPr', null, workbookPr));
  96852. /* workbookProtection */
  96853. var sheets = wb.Workbook && wb.Workbook.Sheets || [];
  96854. var i = 0;
  96855. /* bookViews */
  96856. o[o.length] = "<sheets>";
  96857. for(i = 0; i != wb.SheetNames.length; ++i) {
  96858. var sht = ({name:escapexml(wb.SheetNames[i].slice(0,31))});
  96859. sht.sheetId = ""+(i+1);
  96860. sht["r:id"] = "rId"+(i+1);
  96861. if(sheets[i]) switch(sheets[i].Hidden) {
  96862. case 1: sht.state = "hidden"; break;
  96863. case 2: sht.state = "veryHidden"; break;
  96864. }
  96865. o[o.length] = (writextag('sheet',null,sht));
  96866. }
  96867. o[o.length] = "</sheets>";
  96868. /* functionGroups */
  96869. /* externalReferences */
  96870. if(write_names) {
  96871. o[o.length] = "<definedNames>";
  96872. if(wb.Workbook && wb.Workbook.Names) wb.Workbook.Names.forEach(function(n) {
  96873. var d = {name:n.Name};
  96874. if(n.Comment) d.comment = n.Comment;
  96875. if(n.Sheet != null) d.localSheetId = ""+n.Sheet;
  96876. if(n.Hidden) d.hidden = "1";
  96877. if(!n.Ref) return;
  96878. o[o.length] = writextag('definedName', String(n.Ref).replace(/</g, "&lt;").replace(/>/g, "&gt;"), d);
  96879. });
  96880. o[o.length] = "</definedNames>";
  96881. }
  96882. /* calcPr */
  96883. /* oleSize */
  96884. /* customWorkbookViews */
  96885. /* pivotCaches */
  96886. /* smartTagPr */
  96887. /* smartTagTypes */
  96888. /* webPublishing */
  96889. /* fileRecoveryPr */
  96890. /* webPublishObjects */
  96891. /* extLst */
  96892. if(o.length>2){ o[o.length] = '</workbook>'; o[1]=o[1].replace("/>",">"); }
  96893. return o.join("");
  96894. }
  96895. /* [MS-XLSB] 2.4.304 BrtBundleSh */
  96896. function parse_BrtBundleSh(data, length) {
  96897. var z = {};
  96898. z.Hidden = data.read_shift(4); //hsState ST_SheetState
  96899. z.iTabID = data.read_shift(4);
  96900. z.strRelID = parse_RelID(data,length-8);
  96901. z.name = parse_XLWideString(data);
  96902. return z;
  96903. }
  96904. function write_BrtBundleSh(data, o) {
  96905. if(!o) o = new_buf(127);
  96906. o.write_shift(4, data.Hidden);
  96907. o.write_shift(4, data.iTabID);
  96908. write_RelID(data.strRelID, o);
  96909. write_XLWideString(data.name.slice(0,31), o);
  96910. return o.length > o.l ? o.slice(0, o.l) : o;
  96911. }
  96912. /* [MS-XLSB] 2.4.815 BrtWbProp */
  96913. function parse_BrtWbProp(data, length) {
  96914. var o = ({});
  96915. var flags = data.read_shift(4);
  96916. o.defaultThemeVersion = data.read_shift(4);
  96917. var strName = (length > 8) ? parse_XLWideString(data) : "";
  96918. if(strName.length > 0) o.CodeName = strName;
  96919. o.autoCompressPictures = !!(flags & 0x10000);
  96920. o.backupFile = !!(flags & 0x40);
  96921. o.checkCompatibility = !!(flags & 0x1000);
  96922. o.date1904 = !!(flags & 0x01);
  96923. o.filterPrivacy = !!(flags & 0x08);
  96924. o.hidePivotFieldList = !!(flags & 0x400);
  96925. o.promptedSolutions = !!(flags & 0x10);
  96926. o.publishItems = !!(flags & 0x800);
  96927. o.refreshAllConnections = !!(flags & 0x40000);
  96928. o.saveExternalLinkValues = !!(flags & 0x80);
  96929. o.showBorderUnselectedTables = !!(flags & 0x04);
  96930. o.showInkAnnotation = !!(flags & 0x20);
  96931. o.showObjects = ["all", "placeholders", "none"][(flags >> 13) & 0x03];
  96932. o.showPivotChartFilter = !!(flags & 0x8000);
  96933. o.updateLinks = ["userSet", "never", "always"][(flags >> 8) & 0x03];
  96934. return o;
  96935. }
  96936. function write_BrtWbProp(data, o) {
  96937. if(!o) o = new_buf(72);
  96938. var flags = 0;
  96939. if(data) {
  96940. /* TODO: mirror parse_BrtWbProp fields */
  96941. if(data.filterPrivacy) flags |= 0x08;
  96942. }
  96943. o.write_shift(4, flags);
  96944. o.write_shift(4, 0);
  96945. write_XLSBCodeName(data && data.CodeName || "ThisWorkbook", o);
  96946. return o.slice(0, o.l);
  96947. }
  96948. function parse_BrtFRTArchID$(data, length) {
  96949. var o = {};
  96950. data.read_shift(4);
  96951. o.ArchID = data.read_shift(4);
  96952. data.l += length - 8;
  96953. return o;
  96954. }
  96955. /* [MS-XLSB] 2.4.687 BrtName */
  96956. function parse_BrtName(data, length, opts) {
  96957. var end = data.l + length;
  96958. data.l += 4; //var flags = data.read_shift(4);
  96959. data.l += 1; //var chKey = data.read_shift(1);
  96960. var itab = data.read_shift(4);
  96961. var name = parse_XLNameWideString(data);
  96962. var formula = parse_XLSBNameParsedFormula(data, 0, opts);
  96963. var comment = parse_XLNullableWideString(data);
  96964. //if(0 /* fProc */) {
  96965. // unusedstring1: XLNullableWideString
  96966. // description: XLNullableWideString
  96967. // helpTopic: XLNullableWideString
  96968. // unusedstring2: XLNullableWideString
  96969. //}
  96970. data.l = end;
  96971. var out = ({Name:name, Ptg:formula});
  96972. if(itab < 0xFFFFFFF) out.Sheet = itab;
  96973. if(comment) out.Comment = comment;
  96974. return out;
  96975. }
  96976. /* [MS-XLSB] 2.1.7.61 Workbook */
  96977. function parse_wb_bin(data, opts) {
  96978. var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
  96979. var state = [];
  96980. var pass = false;
  96981. if(!opts) opts = {};
  96982. opts.biff = 12;
  96983. var Names = [];
  96984. var supbooks = ([[]]);
  96985. supbooks.SheetNames = [];
  96986. supbooks.XTI = [];
  96987. recordhopper(data, function hopper_wb(val, R_n, RT) {
  96988. switch(RT) {
  96989. case 0x009C: /* 'BrtBundleSh' */
  96990. supbooks.SheetNames.push(val.name);
  96991. wb.Sheets.push(val); break;
  96992. case 0x0099: /* 'BrtWbProp' */
  96993. wb.WBProps = val; break;
  96994. case 0x0027: /* 'BrtName' */
  96995. if(val.Sheet != null) opts.SID = val.Sheet;
  96996. val.Ref = stringify_formula(val.Ptg, null, null, supbooks, opts);
  96997. delete opts.SID;
  96998. delete val.Ptg;
  96999. Names.push(val);
  97000. break;
  97001. case 0x040C: /* 'BrtNameExt' */ break;
  97002. case 0x0165: /* 'BrtSupSelf' */
  97003. case 0x0166: /* 'BrtSupSame' */
  97004. case 0x0163: /* 'BrtSupBookSrc' */
  97005. case 0x029B: /* 'BrtSupAddin' */
  97006. if(!supbooks[0].length) supbooks[0] = [RT, val];
  97007. else supbooks.push([RT, val]);
  97008. supbooks[supbooks.length - 1].XTI = [];
  97009. break;
  97010. case 0x016A: /* 'BrtExternSheet' */
  97011. if(supbooks.length === 0) { supbooks[0] = []; supbooks[0].XTI = []; }
  97012. supbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val);
  97013. supbooks.XTI = supbooks.XTI.concat(val);
  97014. break;
  97015. case 0x0169: /* 'BrtPlaceholderName' */
  97016. break;
  97017. /* case 'BrtModelTimeGroupingCalcCol' */
  97018. case 0x0C00: /* 'BrtUid' */
  97019. case 0x0C01: /* 'BrtRevisionPtr' */
  97020. case 0x0817: /* 'BrtAbsPath15' */
  97021. case 0x0216: /* 'BrtBookProtection' */
  97022. case 0x02A5: /* 'BrtBookProtectionIso' */
  97023. case 0x009E: /* 'BrtBookView' */
  97024. case 0x009D: /* 'BrtCalcProp' */
  97025. case 0x0262: /* 'BrtCrashRecErr' */
  97026. case 0x0802: /* 'BrtDecoupledPivotCacheID' */
  97027. case 0x009B: /* 'BrtFileRecover' */
  97028. case 0x0224: /* 'BrtFileSharing' */
  97029. case 0x02A4: /* 'BrtFileSharingIso' */
  97030. case 0x0080: /* 'BrtFileVersion' */
  97031. case 0x0299: /* 'BrtFnGroup' */
  97032. case 0x0850: /* 'BrtModelRelationship' */
  97033. case 0x084D: /* 'BrtModelTable' */
  97034. case 0x0225: /* 'BrtOleSize' */
  97035. case 0x0805: /* 'BrtPivotTableRef' */
  97036. case 0x0254: /* 'BrtSmartTagType' */
  97037. case 0x081C: /* 'BrtTableSlicerCacheID' */
  97038. case 0x081B: /* 'BrtTableSlicerCacheIDs' */
  97039. case 0x0822: /* 'BrtTimelineCachePivotCacheID' */
  97040. case 0x018D: /* 'BrtUserBookView' */
  97041. case 0x009A: /* 'BrtWbFactoid' */
  97042. case 0x045D: /* 'BrtWbProp14' */
  97043. case 0x0229: /* 'BrtWebOpt' */
  97044. case 0x082B: /* 'BrtWorkBookPr15' */
  97045. break;
  97046. case 0x0023: /* 'BrtFRTBegin' */
  97047. state.push(R_n); pass = true; break;
  97048. case 0x0024: /* 'BrtFRTEnd' */
  97049. state.pop(); pass = false; break;
  97050. case 0x0025: /* 'BrtACBegin' */
  97051. state.push(R_n); pass = true; break;
  97052. case 0x0026: /* 'BrtACEnd' */
  97053. state.pop(); pass = false; break;
  97054. case 0x0010: /* 'BrtFRTArchID$' */ break;
  97055. default:
  97056. if((R_n||"").indexOf("Begin") > 0){/* empty */}
  97057. else if((R_n||"").indexOf("End") > 0){/* empty */}
  97058. else if(!pass || (opts.WTF && state[state.length-1] != "BrtACBegin" && state[state.length-1] != "BrtFRTBegin")) throw new Error("Unexpected record " + RT + " " + R_n);
  97059. }
  97060. }, opts);
  97061. parse_wb_defaults(wb);
  97062. // $FlowIgnore
  97063. wb.Names = Names;
  97064. (wb).supbooks = supbooks;
  97065. return wb;
  97066. }
  97067. function write_BUNDLESHS(ba, wb) {
  97068. write_record(ba, "BrtBeginBundleShs");
  97069. for(var idx = 0; idx != wb.SheetNames.length; ++idx) {
  97070. var viz = wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx] && wb.Workbook.Sheets[idx].Hidden || 0;
  97071. var d = { Hidden: viz, iTabID: idx+1, strRelID: 'rId' + (idx+1), name: wb.SheetNames[idx] };
  97072. write_record(ba, "BrtBundleSh", write_BrtBundleSh(d));
  97073. }
  97074. write_record(ba, "BrtEndBundleShs");
  97075. }
  97076. /* [MS-XLSB] 2.4.649 BrtFileVersion */
  97077. function write_BrtFileVersion(data, o) {
  97078. if(!o) o = new_buf(127);
  97079. for(var i = 0; i != 4; ++i) o.write_shift(4, 0);
  97080. write_XLWideString("SheetJS", o);
  97081. write_XLWideString(XLSX.version, o);
  97082. write_XLWideString(XLSX.version, o);
  97083. write_XLWideString("7262", o);
  97084. o.length = o.l;
  97085. return o.length > o.l ? o.slice(0, o.l) : o;
  97086. }
  97087. /* [MS-XLSB] 2.4.301 BrtBookView */
  97088. function write_BrtBookView(idx, o) {
  97089. if(!o) o = new_buf(29);
  97090. o.write_shift(-4, 0);
  97091. o.write_shift(-4, 460);
  97092. o.write_shift(4, 28800);
  97093. o.write_shift(4, 17600);
  97094. o.write_shift(4, 500);
  97095. o.write_shift(4, idx);
  97096. o.write_shift(4, idx);
  97097. var flags = 0x78;
  97098. o.write_shift(1, flags);
  97099. return o.length > o.l ? o.slice(0, o.l) : o;
  97100. }
  97101. function write_BOOKVIEWS(ba, wb) {
  97102. /* required if hidden tab appears before visible tab */
  97103. if(!wb.Workbook || !wb.Workbook.Sheets) return;
  97104. var sheets = wb.Workbook.Sheets;
  97105. var i = 0, vistab = -1, hidden = -1;
  97106. for(; i < sheets.length; ++i) {
  97107. if(!sheets[i] || !sheets[i].Hidden && vistab == -1) vistab = i;
  97108. else if(sheets[i].Hidden == 1 && hidden == -1) hidden = i;
  97109. }
  97110. if(hidden > vistab) return;
  97111. write_record(ba, "BrtBeginBookViews");
  97112. write_record(ba, "BrtBookView", write_BrtBookView(vistab));
  97113. /* 1*(BrtBookView *FRT) */
  97114. write_record(ba, "BrtEndBookViews");
  97115. }
  97116. /* [MS-XLSB] 2.4.305 BrtCalcProp */
  97117. /*function write_BrtCalcProp(data, o) {
  97118. if(!o) o = new_buf(26);
  97119. o.write_shift(4,0); // force recalc
  97120. o.write_shift(4,1);
  97121. o.write_shift(4,0);
  97122. write_Xnum(0, o);
  97123. o.write_shift(-4, 1023);
  97124. o.write_shift(1, 0x33);
  97125. o.write_shift(1, 0x00);
  97126. return o;
  97127. }*/
  97128. /* [MS-XLSB] 2.4.646 BrtFileRecover */
  97129. /*function write_BrtFileRecover(data, o) {
  97130. if(!o) o = new_buf(1);
  97131. o.write_shift(1,0);
  97132. return o;
  97133. }*/
  97134. /* [MS-XLSB] 2.1.7.61 Workbook */
  97135. function write_wb_bin(wb, opts) {
  97136. var ba = buf_array();
  97137. write_record(ba, "BrtBeginBook");
  97138. write_record(ba, "BrtFileVersion", write_BrtFileVersion());
  97139. /* [[BrtFileSharingIso] BrtFileSharing] */
  97140. write_record(ba, "BrtWbProp", write_BrtWbProp(wb.Workbook && wb.Workbook.WBProps || null));
  97141. /* [ACABSPATH] */
  97142. /* [[BrtBookProtectionIso] BrtBookProtection] */
  97143. write_BOOKVIEWS(ba, wb, opts);
  97144. write_BUNDLESHS(ba, wb, opts);
  97145. /* [FNGROUP] */
  97146. /* [EXTERNALS] */
  97147. /* *BrtName */
  97148. /* write_record(ba, "BrtCalcProp", write_BrtCalcProp()); */
  97149. /* [BrtOleSize] */
  97150. /* *(BrtUserBookView *FRT) */
  97151. /* [PIVOTCACHEIDS] */
  97152. /* [BrtWbFactoid] */
  97153. /* [SMARTTAGTYPES] */
  97154. /* [BrtWebOpt] */
  97155. /* write_record(ba, "BrtFileRecover", write_BrtFileRecover()); */
  97156. /* [WEBPUBITEMS] */
  97157. /* [CRERRS] */
  97158. /* FRTWORKBOOK */
  97159. write_record(ba, "BrtEndBook");
  97160. return ba.end();
  97161. }
  97162. function parse_wb(data, name, opts) {
  97163. if(name.slice(-4)===".bin") return parse_wb_bin((data), opts);
  97164. return parse_wb_xml((data), opts);
  97165. }
  97166. function parse_ws(data, name, idx, opts, rels, wb, themes, styles) {
  97167. if(name.slice(-4)===".bin") return parse_ws_bin((data), opts, idx, rels, wb, themes, styles);
  97168. return parse_ws_xml((data), opts, idx, rels, wb, themes, styles);
  97169. }
  97170. function parse_cs(data, name, idx, opts, rels, wb, themes, styles) {
  97171. if(name.slice(-4)===".bin") return parse_cs_bin((data), opts, idx, rels, wb, themes, styles);
  97172. return parse_cs_xml((data), opts, idx, rels, wb, themes, styles);
  97173. }
  97174. function parse_ms(data, name, idx, opts, rels, wb, themes, styles) {
  97175. if(name.slice(-4)===".bin") return parse_ms_bin((data), opts, idx, rels, wb, themes, styles);
  97176. return parse_ms_xml((data), opts, idx, rels, wb, themes, styles);
  97177. }
  97178. function parse_ds(data, name, idx, opts, rels, wb, themes, styles) {
  97179. if(name.slice(-4)===".bin") return parse_ds_bin((data), opts, idx, rels, wb, themes, styles);
  97180. return parse_ds_xml((data), opts, idx, rels, wb, themes, styles);
  97181. }
  97182. function parse_sty(data, name, themes, opts) {
  97183. if(name.slice(-4)===".bin") return parse_sty_bin((data), themes, opts);
  97184. return parse_sty_xml((data), themes, opts);
  97185. }
  97186. function parse_theme(data, name, opts) {
  97187. return parse_theme_xml(data, opts);
  97188. }
  97189. function parse_sst(data, name, opts) {
  97190. if(name.slice(-4)===".bin") return parse_sst_bin((data), opts);
  97191. return parse_sst_xml((data), opts);
  97192. }
  97193. function parse_cmnt(data, name, opts) {
  97194. if(name.slice(-4)===".bin") return parse_comments_bin((data), opts);
  97195. return parse_comments_xml((data), opts);
  97196. }
  97197. function parse_cc(data, name, opts) {
  97198. if(name.slice(-4)===".bin") return parse_cc_bin((data), name, opts);
  97199. return parse_cc_xml((data), name, opts);
  97200. }
  97201. function parse_xlink(data, rel, name, opts) {
  97202. if(name.slice(-4)===".bin") return parse_xlink_bin((data), rel, name, opts);
  97203. return parse_xlink_xml((data), rel, name, opts);
  97204. }
  97205. function write_wb(wb, name, opts) {
  97206. return (name.slice(-4)===".bin" ? write_wb_bin : write_wb_xml)(wb, opts);
  97207. }
  97208. function write_ws(data, name, opts, wb, rels) {
  97209. return (name.slice(-4)===".bin" ? write_ws_bin : write_ws_xml)(data, opts, wb, rels);
  97210. }
  97211. // eslint-disable-next-line no-unused-vars
  97212. function write_cs(data, name, opts, wb, rels) {
  97213. return (name.slice(-4)===".bin" ? write_cs_bin : write_cs_xml)(data, opts, wb, rels);
  97214. }
  97215. function write_sty(data, name, opts) {
  97216. return (name.slice(-4)===".bin" ? write_sty_bin : write_sty_xml)(data, opts);
  97217. }
  97218. function write_sst(data, name, opts) {
  97219. return (name.slice(-4)===".bin" ? write_sst_bin : write_sst_xml)(data, opts);
  97220. }
  97221. function write_cmnt(data, name, opts) {
  97222. return (name.slice(-4)===".bin" ? write_comments_bin : write_comments_xml)(data, opts);
  97223. }
  97224. /*
  97225. function write_cc(data, name:string, opts) {
  97226. return (name.slice(-4)===".bin" ? write_cc_bin : write_cc_xml)(data, opts);
  97227. }
  97228. */
  97229. var attregexg2=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g;
  97230. var attregex2=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;
  97231. function xlml_parsexmltag(tag, skip_root) {
  97232. var words = tag.split(/\s+/);
  97233. var z = ([]); if(!skip_root) z[0] = words[0];
  97234. if(words.length === 1) return z;
  97235. var m = tag.match(attregexg2), y, j, w, i;
  97236. if(m) for(i = 0; i != m.length; ++i) {
  97237. y = m[i].match(attregex2);
  97238. if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1);
  97239. else {
  97240. if(y[1].slice(0,6) === "xmlns:") w = "xmlns"+y[1].slice(6);
  97241. else w = y[1].slice(j+1);
  97242. z[w] = y[2].slice(1,y[2].length-1);
  97243. }
  97244. }
  97245. return z;
  97246. }
  97247. function xlml_parsexmltagobj(tag) {
  97248. var words = tag.split(/\s+/);
  97249. var z = {};
  97250. if(words.length === 1) return z;
  97251. var m = tag.match(attregexg2), y, j, w, i;
  97252. if(m) for(i = 0; i != m.length; ++i) {
  97253. y = m[i].match(attregex2);
  97254. if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1);
  97255. else {
  97256. if(y[1].slice(0,6) === "xmlns:") w = "xmlns"+y[1].slice(6);
  97257. else w = y[1].slice(j+1);
  97258. z[w] = y[2].slice(1,y[2].length-1);
  97259. }
  97260. }
  97261. return z;
  97262. }
  97263. // ----
  97264. function xlml_format(format, value) {
  97265. var fmt = XLMLFormatMap[format] || unescapexml(format);
  97266. if(fmt === "General") return SSF._general(value);
  97267. return SSF.format(fmt, value);
  97268. }
  97269. function xlml_set_custprop(Custprops, key, cp, val) {
  97270. var oval = val;
  97271. switch((cp[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]) {
  97272. case "boolean": oval = parsexmlbool(val); break;
  97273. case "i2": case "int": oval = parseInt(val, 10); break;
  97274. case "r4": case "float": oval = parseFloat(val); break;
  97275. case "date": case "dateTime.tz": oval = parseDate(val); break;
  97276. case "i8": case "string": case "fixed": case "uuid": case "bin.base64": break;
  97277. default: throw new Error("bad custprop:" + cp[0]);
  97278. }
  97279. Custprops[unescapexml(key)] = oval;
  97280. }
  97281. function safe_format_xlml(cell, nf, o) {
  97282. if(cell.t === 'z') return;
  97283. if(!o || o.cellText !== false) try {
  97284. if(cell.t === 'e') { cell.w = cell.w || BErr[cell.v]; }
  97285. else if(nf === "General") {
  97286. if(cell.t === 'n') {
  97287. if((cell.v|0) === cell.v) cell.w = SSF._general_int(cell.v);
  97288. else cell.w = SSF._general_num(cell.v);
  97289. }
  97290. else cell.w = SSF._general(cell.v);
  97291. }
  97292. else cell.w = xlml_format(nf||"General", cell.v);
  97293. } catch(e) { if(o.WTF) throw e; }
  97294. try {
  97295. var z = XLMLFormatMap[nf]||nf||"General";
  97296. if(o.cellNF) cell.z = z;
  97297. if(o.cellDates && cell.t == 'n' && SSF.is_date(z)) {
  97298. var _d = SSF.parse_date_code(cell.v); if(_d) { cell.t = 'd'; cell.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); }
  97299. }
  97300. } catch(e) { if(o.WTF) throw e; }
  97301. }
  97302. function process_style_xlml(styles, stag, opts) {
  97303. if(opts.cellStyles) {
  97304. if(stag.Interior) {
  97305. var I = stag.Interior;
  97306. if(I.Pattern) I.patternType = XLMLPatternTypeMap[I.Pattern] || I.Pattern;
  97307. }
  97308. }
  97309. styles[stag.ID] = stag;
  97310. }
  97311. /* TODO: there must exist some form of OSP-blessed spec */
  97312. function parse_xlml_data(xml, ss, data, cell, base, styles, csty, row, arrayf, o) {
  97313. var nf = "General", sid = cell.StyleID, S = {}; o = o || {};
  97314. var interiors = [];
  97315. var i = 0;
  97316. if(sid === undefined && row) sid = row.StyleID;
  97317. if(sid === undefined && csty) sid = csty.StyleID;
  97318. while(styles[sid] !== undefined) {
  97319. if(styles[sid].nf) nf = styles[sid].nf;
  97320. if(styles[sid].Interior) interiors.push(styles[sid].Interior);
  97321. if(!styles[sid].Parent) break;
  97322. sid = styles[sid].Parent;
  97323. }
  97324. switch(data.Type) {
  97325. case 'Boolean':
  97326. cell.t = 'b';
  97327. cell.v = parsexmlbool(xml);
  97328. break;
  97329. case 'String':
  97330. cell.t = 's'; cell.r = xlml_fixstr(unescapexml(xml));
  97331. cell.v = xml.indexOf("<") > -1 ? unescapexml(ss||xml) : cell.r;
  97332. break;
  97333. case 'DateTime':
  97334. if(xml.slice(-1) != "Z") xml += "Z";
  97335. cell.v = (parseDate(xml) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
  97336. if(cell.v !== cell.v) cell.v = unescapexml(xml);
  97337. else if(cell.v<60) cell.v = cell.v -1;
  97338. if(!nf || nf == "General") nf = "yyyy-mm-dd";
  97339. /* falls through */
  97340. case 'Number':
  97341. if(cell.v === undefined) cell.v=+xml;
  97342. if(!cell.t) cell.t = 'n';
  97343. break;
  97344. case 'Error': cell.t = 'e'; cell.v = RBErr[xml]; if(o.cellText !== false) cell.w = xml; break;
  97345. default: cell.t = 's'; cell.v = xlml_fixstr(ss||xml); break;
  97346. }
  97347. safe_format_xlml(cell, nf, o);
  97348. if(o.cellFormula !== false) {
  97349. if(cell.Formula) {
  97350. var fstr = unescapexml(cell.Formula);
  97351. /* strictly speaking, the leading = is required but some writers omit */
  97352. if(fstr.charCodeAt(0) == 61 /* = */) fstr = fstr.slice(1);
  97353. cell.f = rc_to_a1(fstr, base);
  97354. delete cell.Formula;
  97355. if(cell.ArrayRange == "RC") cell.F = rc_to_a1("RC:RC", base);
  97356. else if(cell.ArrayRange) {
  97357. cell.F = rc_to_a1(cell.ArrayRange, base);
  97358. arrayf.push([safe_decode_range(cell.F), cell.F]);
  97359. }
  97360. } else {
  97361. for(i = 0; i < arrayf.length; ++i)
  97362. if(base.r >= arrayf[i][0].s.r && base.r <= arrayf[i][0].e.r)
  97363. if(base.c >= arrayf[i][0].s.c && base.c <= arrayf[i][0].e.c)
  97364. cell.F = arrayf[i][1];
  97365. }
  97366. }
  97367. if(o.cellStyles) {
  97368. interiors.forEach(function(x) {
  97369. if(!S.patternType && x.patternType) S.patternType = x.patternType;
  97370. });
  97371. cell.s = S;
  97372. }
  97373. if(cell.StyleID !== undefined) cell.ixfe = cell.StyleID;
  97374. }
  97375. function xlml_clean_comment(comment) {
  97376. comment.t = comment.v || "";
  97377. comment.t = comment.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
  97378. comment.v = comment.w = comment.ixfe = undefined;
  97379. }
  97380. function xlml_normalize(d) {
  97381. if(has_buf && Buffer.isBuffer(d)) return d.toString('utf8');
  97382. if(typeof d === 'string') return d;
  97383. /* duktape */
  97384. if(typeof Uint8Array !== 'undefined' && d instanceof Uint8Array) return utf8read(a2s(ab2a(d)));
  97385. throw new Error("Bad input format: expected Buffer or string");
  97386. }
  97387. /* TODO: Everything */
  97388. /* UOS uses CJK in tags */
  97389. var xlmlregex = /<(\/?)([^\s?>!\/:]*:|)([^\s?>:\/]+)[^>]*>/mg;
  97390. //var xlmlregex = /<(\/?)([a-z0-9]*:|)(\w+)[^>]*>/mg;
  97391. function parse_xlml_xml(d, _opts) {
  97392. var opts = _opts || {};
  97393. make_ssf(SSF);
  97394. var str = debom(xlml_normalize(d));
  97395. if(opts.type == 'binary' || opts.type == 'array' || opts.type == 'base64') {
  97396. if(typeof cptable !== 'undefined') str = cptable.utils.decode(65001, char_codes(str));
  97397. else str = utf8read(str);
  97398. }
  97399. var opening = str.slice(0, 1024).toLowerCase(), ishtml = false;
  97400. if(opening.indexOf("<?xml") == -1) ["html", "table", "head", "meta", "script", "style", "div"].forEach(function(tag) { if(opening.indexOf("<" + tag) >= 0) ishtml = true; });
  97401. if(ishtml) return HTML_.to_workbook(str, opts);
  97402. var Rn;
  97403. var state = [], tmp;
  97404. if(DENSE != null && opts.dense == null) opts.dense = DENSE;
  97405. var sheets = {}, sheetnames = [], cursheet = (opts.dense ? [] : {}), sheetname = "";
  97406. var table = {}, cell = ({}), row = {};// eslint-disable-line no-unused-vars
  97407. var dtag = xlml_parsexmltag('<Data ss:Type="String">'), didx = 0;
  97408. var c = 0, r = 0;
  97409. var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
  97410. var styles = {}, stag = {};
  97411. var ss = "", fidx = 0;
  97412. var merges = [];
  97413. var Props = {}, Custprops = {}, pidx = 0, cp = [];
  97414. var comments = [], comment = ({});
  97415. var cstys = [], csty, seencol = false;
  97416. var arrayf = [];
  97417. var rowinfo = [], rowobj = {}, cc = 0, rr = 0;
  97418. var Workbook = ({ Sheets:[], WBProps:{date1904:false} }), wsprops = {};
  97419. xlmlregex.lastIndex = 0;
  97420. str = str.replace(/<!--([\s\S]*?)-->/mg,"");
  97421. while((Rn = xlmlregex.exec(str))) switch(Rn[3]) {
  97422. case 'Data':
  97423. if(state[state.length-1][1]) break;
  97424. if(Rn[1]==='/') parse_xlml_data(str.slice(didx, Rn.index), ss, dtag, state[state.length-1][0]=="Comment"?comment:cell, {c:c,r:r}, styles, cstys[c], row, arrayf, opts);
  97425. else { ss = ""; dtag = xlml_parsexmltag(Rn[0]); didx = Rn.index + Rn[0].length; }
  97426. break;
  97427. case 'Cell':
  97428. if(Rn[1]==='/'){
  97429. if(comments.length > 0) cell.c = comments;
  97430. if((!opts.sheetRows || opts.sheetRows > r) && cell.v !== undefined) {
  97431. if(opts.dense) {
  97432. if(!cursheet[r]) cursheet[r] = [];
  97433. cursheet[r][c] = cell;
  97434. } else cursheet[encode_col(c) + encode_row(r)] = cell;
  97435. }
  97436. if(cell.HRef) {
  97437. cell.l = ({Target:cell.HRef});
  97438. if(cell.HRefScreenTip) cell.l.Tooltip = cell.HRefScreenTip;
  97439. delete cell.HRef; delete cell.HRefScreenTip;
  97440. }
  97441. if(cell.MergeAcross || cell.MergeDown) {
  97442. cc = c + (parseInt(cell.MergeAcross,10)|0);
  97443. rr = r + (parseInt(cell.MergeDown,10)|0);
  97444. merges.push({s:{c:c,r:r},e:{c:cc,r:rr}});
  97445. }
  97446. if(!opts.sheetStubs) { if(cell.MergeAcross) c = cc + 1; else ++c; }
  97447. else if(cell.MergeAcross || cell.MergeDown) {
  97448. for(var cma = c; cma <= cc; ++cma) {
  97449. for(var cmd = r; cmd <= rr; ++cmd) {
  97450. if(cma > c || cmd > r) {
  97451. if(opts.dense) {
  97452. if(!cursheet[cmd]) cursheet[cmd] = [];
  97453. cursheet[cmd][cma] = {t:'z'};
  97454. } else cursheet[encode_col(cma) + encode_row(cmd)] = {t:'z'};
  97455. }
  97456. }
  97457. }
  97458. c = cc + 1;
  97459. }
  97460. else ++c;
  97461. } else {
  97462. cell = xlml_parsexmltagobj(Rn[0]);
  97463. if(cell.Index) c = +cell.Index - 1;
  97464. if(c < refguess.s.c) refguess.s.c = c;
  97465. if(c > refguess.e.c) refguess.e.c = c;
  97466. if(Rn[0].slice(-2) === "/>") ++c;
  97467. comments = [];
  97468. }
  97469. break;
  97470. case 'Row':
  97471. if(Rn[1]==='/' || Rn[0].slice(-2) === "/>") {
  97472. if(r < refguess.s.r) refguess.s.r = r;
  97473. if(r > refguess.e.r) refguess.e.r = r;
  97474. if(Rn[0].slice(-2) === "/>") {
  97475. row = xlml_parsexmltag(Rn[0]);
  97476. if(row.Index) r = +row.Index - 1;
  97477. }
  97478. c = 0; ++r;
  97479. } else {
  97480. row = xlml_parsexmltag(Rn[0]);
  97481. if(row.Index) r = +row.Index - 1;
  97482. rowobj = {};
  97483. if(row.AutoFitHeight == "0" || row.Height) {
  97484. rowobj.hpx = parseInt(row.Height, 10); rowobj.hpt = px2pt(rowobj.hpx);
  97485. rowinfo[r] = rowobj;
  97486. }
  97487. if(row.Hidden == "1") { rowobj.hidden = true; rowinfo[r] = rowobj; }
  97488. }
  97489. break;
  97490. case 'Worksheet': /* TODO: read range from FullRows/FullColumns */
  97491. if(Rn[1]==='/'){
  97492. if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
  97493. sheetnames.push(sheetname);
  97494. if(refguess.s.r <= refguess.e.r && refguess.s.c <= refguess.e.c) {
  97495. cursheet["!ref"] = encode_range(refguess);
  97496. if(opts.sheetRows && opts.sheetRows <= refguess.e.r) {
  97497. cursheet["!fullref"] = cursheet["!ref"];
  97498. refguess.e.r = opts.sheetRows - 1;
  97499. cursheet["!ref"] = encode_range(refguess);
  97500. }
  97501. }
  97502. if(merges.length) cursheet["!merges"] = merges;
  97503. if(cstys.length > 0) cursheet["!cols"] = cstys;
  97504. if(rowinfo.length > 0) cursheet["!rows"] = rowinfo;
  97505. sheets[sheetname] = cursheet;
  97506. } else {
  97507. refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
  97508. r = c = 0;
  97509. state.push([Rn[3], false]);
  97510. tmp = xlml_parsexmltag(Rn[0]);
  97511. sheetname = unescapexml(tmp.Name);
  97512. cursheet = (opts.dense ? [] : {});
  97513. merges = [];
  97514. arrayf = [];
  97515. rowinfo = [];
  97516. wsprops = {name:sheetname, Hidden:0};
  97517. Workbook.Sheets.push(wsprops);
  97518. }
  97519. break;
  97520. case 'Table':
  97521. if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
  97522. else if(Rn[0].slice(-2) == "/>") break;
  97523. else {
  97524. table = xlml_parsexmltag(Rn[0]);
  97525. state.push([Rn[3], false]);
  97526. cstys = []; seencol = false;
  97527. }
  97528. break;
  97529. case 'Style':
  97530. if(Rn[1]==='/') process_style_xlml(styles, stag, opts);
  97531. else stag = xlml_parsexmltag(Rn[0]);
  97532. break;
  97533. case 'NumberFormat':
  97534. stag.nf = unescapexml(xlml_parsexmltag(Rn[0]).Format || "General");
  97535. if(XLMLFormatMap[stag.nf]) stag.nf = XLMLFormatMap[stag.nf];
  97536. for(var ssfidx = 0; ssfidx != 0x188; ++ssfidx) if(SSF._table[ssfidx] == stag.nf) break;
  97537. if(ssfidx == 0x188) for(ssfidx = 0x39; ssfidx != 0x188; ++ssfidx) if(SSF._table[ssfidx] == null) { SSF.load(stag.nf, ssfidx); break; }
  97538. break;
  97539. case 'Column':
  97540. if(state[state.length-1][0] !== 'Table') break;
  97541. csty = xlml_parsexmltag(Rn[0]);
  97542. if(csty.Hidden) { csty.hidden = true; delete csty.Hidden; }
  97543. if(csty.Width) csty.wpx = parseInt(csty.Width, 10);
  97544. if(!seencol && csty.wpx > 10) {
  97545. seencol = true; MDW = DEF_MDW; //find_mdw_wpx(csty.wpx);
  97546. for(var _col = 0; _col < cstys.length; ++_col) if(cstys[_col]) process_col(cstys[_col]);
  97547. }
  97548. if(seencol) process_col(csty);
  97549. cstys[(csty.Index-1||cstys.length)] = csty;
  97550. for(var i = 0; i < +csty.Span; ++i) cstys[cstys.length] = dup(csty);
  97551. break;
  97552. case 'NamedRange':
  97553. if(!Workbook.Names) Workbook.Names = [];
  97554. var _NamedRange = parsexmltag(Rn[0]);
  97555. var _DefinedName = ({
  97556. Name: _NamedRange.Name,
  97557. Ref: rc_to_a1(_NamedRange.RefersTo.slice(1), {r:0, c:0})
  97558. });
  97559. if(Workbook.Sheets.length>0) _DefinedName.Sheet=Workbook.Sheets.length-1;
  97560. Workbook.Names.push(_DefinedName);
  97561. break;
  97562. case 'NamedCell': break;
  97563. case 'B': break;
  97564. case 'I': break;
  97565. case 'U': break;
  97566. case 'S': break;
  97567. case 'Sub': break;
  97568. case 'Sup': break;
  97569. case 'Span': break;
  97570. case 'Alignment':
  97571. break;
  97572. case 'Borders': break;
  97573. case 'Border': break;
  97574. case 'Font':
  97575. if(Rn[0].slice(-2) === "/>") break;
  97576. else if(Rn[1]==="/") ss += str.slice(fidx, Rn.index);
  97577. else fidx = Rn.index + Rn[0].length;
  97578. break;
  97579. case 'Interior':
  97580. if(!opts.cellStyles) break;
  97581. stag.Interior = xlml_parsexmltag(Rn[0]);
  97582. break;
  97583. case 'Protection': break;
  97584. case 'Author':
  97585. case 'Title':
  97586. case 'Description':
  97587. case 'Created':
  97588. case 'Keywords':
  97589. case 'Subject':
  97590. case 'Category':
  97591. case 'Company':
  97592. case 'LastAuthor':
  97593. case 'LastSaved':
  97594. case 'LastPrinted':
  97595. case 'Version':
  97596. case 'Revision':
  97597. case 'TotalTime':
  97598. case 'HyperlinkBase':
  97599. case 'Manager':
  97600. case 'ContentStatus':
  97601. case 'Identifier':
  97602. case 'Language':
  97603. case 'AppName':
  97604. if(Rn[0].slice(-2) === "/>") break;
  97605. else if(Rn[1]==="/") xlml_set_prop(Props, Rn[3], str.slice(pidx, Rn.index));
  97606. else pidx = Rn.index + Rn[0].length;
  97607. break;
  97608. case 'Paragraphs': break;
  97609. case 'Styles':
  97610. case 'Workbook':
  97611. if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
  97612. else state.push([Rn[3], false]);
  97613. break;
  97614. case 'Comment':
  97615. if(Rn[1]==='/'){
  97616. if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
  97617. xlml_clean_comment(comment);
  97618. comments.push(comment);
  97619. } else {
  97620. state.push([Rn[3], false]);
  97621. tmp = xlml_parsexmltag(Rn[0]);
  97622. comment = ({a:tmp.Author});
  97623. }
  97624. break;
  97625. case 'AutoFilter':
  97626. if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
  97627. else if(Rn[0].charAt(Rn[0].length-2) !== '/') {
  97628. var AutoFilter = xlml_parsexmltag(Rn[0]);
  97629. cursheet['!autofilter'] = { ref:rc_to_a1(AutoFilter.Range).replace(/\$/g,"") };
  97630. state.push([Rn[3], true]);
  97631. }
  97632. break;
  97633. case 'Name': break;
  97634. case 'DataValidation':
  97635. if(Rn[1]==='/'){
  97636. if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
  97637. } else {
  97638. if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
  97639. }
  97640. break;
  97641. case 'ComponentOptions':
  97642. case 'DocumentProperties':
  97643. case 'CustomDocumentProperties':
  97644. case 'OfficeDocumentSettings':
  97645. case 'PivotTable':
  97646. case 'PivotCache':
  97647. case 'Names':
  97648. case 'MapInfo':
  97649. case 'PageBreaks':
  97650. case 'QueryTable':
  97651. case 'Sorting':
  97652. case 'Schema':
  97653. case 'data':
  97654. case 'ConditionalFormatting':
  97655. case 'SmartTagType':
  97656. case 'SmartTags':
  97657. case 'ExcelWorkbook':
  97658. case 'WorkbookOptions':
  97659. case 'WorksheetOptions':
  97660. if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
  97661. else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
  97662. break;
  97663. default:
  97664. /* FODS file root is <office:document> */
  97665. if(state.length == 0 && Rn[3] == "document") return parse_fods(str, opts);
  97666. /* UOS file root is <uof:UOF> */
  97667. if(state.length == 0 && Rn[3] == "UOF") return parse_fods(str, opts);
  97668. var seen = true;
  97669. switch(state[state.length-1][0]) {
  97670. /* OfficeDocumentSettings */
  97671. case 'OfficeDocumentSettings': switch(Rn[3]) {
  97672. case 'AllowPNG': break;
  97673. case 'RemovePersonalInformation': break;
  97674. case 'DownloadComponents': break;
  97675. case 'LocationOfComponents': break;
  97676. case 'Colors': break;
  97677. case 'Color': break;
  97678. case 'Index': break;
  97679. case 'RGB': break;
  97680. case 'PixelsPerInch': break; // TODO: set PPI
  97681. case 'TargetScreenSize': break;
  97682. case 'ReadOnlyRecommended': break;
  97683. default: seen = false;
  97684. } break;
  97685. /* ComponentOptions */
  97686. case 'ComponentOptions': switch(Rn[3]) {
  97687. case 'Toolbar': break;
  97688. case 'HideOfficeLogo': break;
  97689. case 'SpreadsheetAutoFit': break;
  97690. case 'Label': break;
  97691. case 'Caption': break;
  97692. case 'MaxHeight': break;
  97693. case 'MaxWidth': break;
  97694. case 'NextSheetNumber': break;
  97695. default: seen = false;
  97696. } break;
  97697. /* ExcelWorkbook */
  97698. case 'ExcelWorkbook': switch(Rn[3]) {
  97699. case 'Date1904':
  97700. Workbook.WBProps.date1904 = true;
  97701. break;
  97702. case 'WindowHeight': break;
  97703. case 'WindowWidth': break;
  97704. case 'WindowTopX': break;
  97705. case 'WindowTopY': break;
  97706. case 'TabRatio': break;
  97707. case 'ProtectStructure': break;
  97708. case 'ProtectWindow': break;
  97709. case 'ProtectWindows': break;
  97710. case 'ActiveSheet': break;
  97711. case 'DisplayInkNotes': break;
  97712. case 'FirstVisibleSheet': break;
  97713. case 'SupBook': break;
  97714. case 'SheetName': break;
  97715. case 'SheetIndex': break;
  97716. case 'SheetIndexFirst': break;
  97717. case 'SheetIndexLast': break;
  97718. case 'Dll': break;
  97719. case 'AcceptLabelsInFormulas': break;
  97720. case 'DoNotSaveLinkValues': break;
  97721. case 'Iteration': break;
  97722. case 'MaxIterations': break;
  97723. case 'MaxChange': break;
  97724. case 'Path': break;
  97725. case 'Xct': break;
  97726. case 'Count': break;
  97727. case 'SelectedSheets': break;
  97728. case 'Calculation': break;
  97729. case 'Uncalced': break;
  97730. case 'StartupPrompt': break;
  97731. case 'Crn': break;
  97732. case 'ExternName': break;
  97733. case 'Formula': break;
  97734. case 'ColFirst': break;
  97735. case 'ColLast': break;
  97736. case 'WantAdvise': break;
  97737. case 'Boolean': break;
  97738. case 'Error': break;
  97739. case 'Text': break;
  97740. case 'OLE': break;
  97741. case 'NoAutoRecover': break;
  97742. case 'PublishObjects': break;
  97743. case 'DoNotCalculateBeforeSave': break;
  97744. case 'Number': break;
  97745. case 'RefModeR1C1': break;
  97746. case 'EmbedSaveSmartTags': break;
  97747. default: seen = false;
  97748. } break;
  97749. /* WorkbookOptions */
  97750. case 'WorkbookOptions': switch(Rn[3]) {
  97751. case 'OWCVersion': break;
  97752. case 'Height': break;
  97753. case 'Width': break;
  97754. default: seen = false;
  97755. } break;
  97756. /* WorksheetOptions */
  97757. case 'WorksheetOptions': switch(Rn[3]) {
  97758. case 'Visible':
  97759. if(Rn[0].slice(-2) === "/>"){/* empty */}
  97760. else if(Rn[1]==="/") switch(str.slice(pidx, Rn.index)) {
  97761. case "SheetHidden": wsprops.Hidden = 1; break;
  97762. case "SheetVeryHidden": wsprops.Hidden = 2; break;
  97763. }
  97764. else pidx = Rn.index + Rn[0].length;
  97765. break;
  97766. case 'Header':
  97767. if(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml');
  97768. cursheet['!margins'].header = parsexmltag(Rn[0]).Margin;
  97769. break;
  97770. case 'Footer':
  97771. if(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml');
  97772. cursheet['!margins'].footer = parsexmltag(Rn[0]).Margin;
  97773. break;
  97774. case 'PageMargins':
  97775. var pagemargins = parsexmltag(Rn[0]);
  97776. if(!cursheet['!margins']) default_margins(cursheet['!margins']={},'xlml');
  97777. if(pagemargins.Top) cursheet['!margins'].top = pagemargins.Top;
  97778. if(pagemargins.Left) cursheet['!margins'].left = pagemargins.Left;
  97779. if(pagemargins.Right) cursheet['!margins'].right = pagemargins.Right;
  97780. if(pagemargins.Bottom) cursheet['!margins'].bottom = pagemargins.Bottom;
  97781. break;
  97782. case 'DisplayRightToLeft':
  97783. if(!Workbook.Views) Workbook.Views = [];
  97784. if(!Workbook.Views[0]) Workbook.Views[0] = {};
  97785. Workbook.Views[0].RTL = true;
  97786. break;
  97787. case 'FreezePanes': break;
  97788. case 'FrozenNoSplit': break;
  97789. case 'SplitHorizontal':
  97790. case 'SplitVertical':
  97791. break;
  97792. case 'DoNotDisplayGridlines':
  97793. break;
  97794. case 'TopRowBottomPane': break;
  97795. case 'LeftColumnRightPane': break;
  97796. case 'Unsynced': break;
  97797. case 'Print': break;
  97798. case 'Panes': break;
  97799. case 'Scale': break;
  97800. case 'Pane': break;
  97801. case 'Number': break;
  97802. case 'Layout': break;
  97803. case 'PageSetup': break;
  97804. case 'Selected': break;
  97805. case 'ProtectObjects': break;
  97806. case 'EnableSelection': break;
  97807. case 'ProtectScenarios': break;
  97808. case 'ValidPrinterInfo': break;
  97809. case 'HorizontalResolution': break;
  97810. case 'VerticalResolution': break;
  97811. case 'NumberofCopies': break;
  97812. case 'ActiveRow': break;
  97813. case 'ActiveCol': break;
  97814. case 'ActivePane': break;
  97815. case 'TopRowVisible': break;
  97816. case 'LeftColumnVisible': break;
  97817. case 'FitToPage': break;
  97818. case 'RangeSelection': break;
  97819. case 'PaperSizeIndex': break;
  97820. case 'PageLayoutZoom': break;
  97821. case 'PageBreakZoom': break;
  97822. case 'FilterOn': break;
  97823. case 'FitWidth': break;
  97824. case 'FitHeight': break;
  97825. case 'CommentsLayout': break;
  97826. case 'Zoom': break;
  97827. case 'LeftToRight': break;
  97828. case 'Gridlines': break;
  97829. case 'AllowSort': break;
  97830. case 'AllowFilter': break;
  97831. case 'AllowInsertRows': break;
  97832. case 'AllowDeleteRows': break;
  97833. case 'AllowInsertCols': break;
  97834. case 'AllowDeleteCols': break;
  97835. case 'AllowInsertHyperlinks': break;
  97836. case 'AllowFormatCells': break;
  97837. case 'AllowSizeCols': break;
  97838. case 'AllowSizeRows': break;
  97839. case 'NoSummaryRowsBelowDetail': break;
  97840. case 'TabColorIndex': break;
  97841. case 'DoNotDisplayHeadings': break;
  97842. case 'ShowPageLayoutZoom': break;
  97843. case 'NoSummaryColumnsRightDetail': break;
  97844. case 'BlackAndWhite': break;
  97845. case 'DoNotDisplayZeros': break;
  97846. case 'DisplayPageBreak': break;
  97847. case 'RowColHeadings': break;
  97848. case 'DoNotDisplayOutline': break;
  97849. case 'NoOrientation': break;
  97850. case 'AllowUsePivotTables': break;
  97851. case 'ZeroHeight': break;
  97852. case 'ViewableRange': break;
  97853. case 'Selection': break;
  97854. case 'ProtectContents': break;
  97855. default: seen = false;
  97856. } break;
  97857. /* PivotTable */
  97858. case 'PivotTable': case 'PivotCache': switch(Rn[3]) {
  97859. case 'ImmediateItemsOnDrop': break;
  97860. case 'ShowPageMultipleItemLabel': break;
  97861. case 'CompactRowIndent': break;
  97862. case 'Location': break;
  97863. case 'PivotField': break;
  97864. case 'Orientation': break;
  97865. case 'LayoutForm': break;
  97866. case 'LayoutSubtotalLocation': break;
  97867. case 'LayoutCompactRow': break;
  97868. case 'Position': break;
  97869. case 'PivotItem': break;
  97870. case 'DataType': break;
  97871. case 'DataField': break;
  97872. case 'SourceName': break;
  97873. case 'ParentField': break;
  97874. case 'PTLineItems': break;
  97875. case 'PTLineItem': break;
  97876. case 'CountOfSameItems': break;
  97877. case 'Item': break;
  97878. case 'ItemType': break;
  97879. case 'PTSource': break;
  97880. case 'CacheIndex': break;
  97881. case 'ConsolidationReference': break;
  97882. case 'FileName': break;
  97883. case 'Reference': break;
  97884. case 'NoColumnGrand': break;
  97885. case 'NoRowGrand': break;
  97886. case 'BlankLineAfterItems': break;
  97887. case 'Hidden': break;
  97888. case 'Subtotal': break;
  97889. case 'BaseField': break;
  97890. case 'MapChildItems': break;
  97891. case 'Function': break;
  97892. case 'RefreshOnFileOpen': break;
  97893. case 'PrintSetTitles': break;
  97894. case 'MergeLabels': break;
  97895. case 'DefaultVersion': break;
  97896. case 'RefreshName': break;
  97897. case 'RefreshDate': break;
  97898. case 'RefreshDateCopy': break;
  97899. case 'VersionLastRefresh': break;
  97900. case 'VersionLastUpdate': break;
  97901. case 'VersionUpdateableMin': break;
  97902. case 'VersionRefreshableMin': break;
  97903. case 'Calculation': break;
  97904. default: seen = false;
  97905. } break;
  97906. /* PageBreaks */
  97907. case 'PageBreaks': switch(Rn[3]) {
  97908. case 'ColBreaks': break;
  97909. case 'ColBreak': break;
  97910. case 'RowBreaks': break;
  97911. case 'RowBreak': break;
  97912. case 'ColStart': break;
  97913. case 'ColEnd': break;
  97914. case 'RowEnd': break;
  97915. default: seen = false;
  97916. } break;
  97917. /* AutoFilter */
  97918. case 'AutoFilter': switch(Rn[3]) {
  97919. case 'AutoFilterColumn': break;
  97920. case 'AutoFilterCondition': break;
  97921. case 'AutoFilterAnd': break;
  97922. case 'AutoFilterOr': break;
  97923. default: seen = false;
  97924. } break;
  97925. /* QueryTable */
  97926. case 'QueryTable': switch(Rn[3]) {
  97927. case 'Id': break;
  97928. case 'AutoFormatFont': break;
  97929. case 'AutoFormatPattern': break;
  97930. case 'QuerySource': break;
  97931. case 'QueryType': break;
  97932. case 'EnableRedirections': break;
  97933. case 'RefreshedInXl9': break;
  97934. case 'URLString': break;
  97935. case 'HTMLTables': break;
  97936. case 'Connection': break;
  97937. case 'CommandText': break;
  97938. case 'RefreshInfo': break;
  97939. case 'NoTitles': break;
  97940. case 'NextId': break;
  97941. case 'ColumnInfo': break;
  97942. case 'OverwriteCells': break;
  97943. case 'DoNotPromptForFile': break;
  97944. case 'TextWizardSettings': break;
  97945. case 'Source': break;
  97946. case 'Number': break;
  97947. case 'Decimal': break;
  97948. case 'ThousandSeparator': break;
  97949. case 'TrailingMinusNumbers': break;
  97950. case 'FormatSettings': break;
  97951. case 'FieldType': break;
  97952. case 'Delimiters': break;
  97953. case 'Tab': break;
  97954. case 'Comma': break;
  97955. case 'AutoFormatName': break;
  97956. case 'VersionLastEdit': break;
  97957. case 'VersionLastRefresh': break;
  97958. default: seen = false;
  97959. } break;
  97960. case 'DataValidation':
  97961. switch(Rn[3]) {
  97962. case 'Range': break;
  97963. case 'Type': break;
  97964. case 'Min': break;
  97965. case 'Max': break;
  97966. case 'Sort': break;
  97967. case 'Descending': break;
  97968. case 'Order': break;
  97969. case 'CaseSensitive': break;
  97970. case 'Value': break;
  97971. case 'ErrorStyle': break;
  97972. case 'ErrorMessage': break;
  97973. case 'ErrorTitle': break;
  97974. case 'InputMessage': break;
  97975. case 'InputTitle': break;
  97976. case 'ComboHide': break;
  97977. case 'InputHide': break;
  97978. case 'Condition': break;
  97979. case 'Qualifier': break;
  97980. case 'UseBlank': break;
  97981. case 'Value1': break;
  97982. case 'Value2': break;
  97983. case 'Format': break;
  97984. case 'CellRangeList': break;
  97985. default: seen = false;
  97986. } break;
  97987. case 'Sorting':
  97988. case 'ConditionalFormatting':
  97989. switch(Rn[3]) {
  97990. case 'Range': break;
  97991. case 'Type': break;
  97992. case 'Min': break;
  97993. case 'Max': break;
  97994. case 'Sort': break;
  97995. case 'Descending': break;
  97996. case 'Order': break;
  97997. case 'CaseSensitive': break;
  97998. case 'Value': break;
  97999. case 'ErrorStyle': break;
  98000. case 'ErrorMessage': break;
  98001. case 'ErrorTitle': break;
  98002. case 'CellRangeList': break;
  98003. case 'InputMessage': break;
  98004. case 'InputTitle': break;
  98005. case 'ComboHide': break;
  98006. case 'InputHide': break;
  98007. case 'Condition': break;
  98008. case 'Qualifier': break;
  98009. case 'UseBlank': break;
  98010. case 'Value1': break;
  98011. case 'Value2': break;
  98012. case 'Format': break;
  98013. default: seen = false;
  98014. } break;
  98015. /* MapInfo (schema) */
  98016. case 'MapInfo': case 'Schema': case 'data': switch(Rn[3]) {
  98017. case 'Map': break;
  98018. case 'Entry': break;
  98019. case 'Range': break;
  98020. case 'XPath': break;
  98021. case 'Field': break;
  98022. case 'XSDType': break;
  98023. case 'FilterOn': break;
  98024. case 'Aggregate': break;
  98025. case 'ElementType': break;
  98026. case 'AttributeType': break;
  98027. /* These are from xsd (XML Schema Definition) */
  98028. case 'schema':
  98029. case 'element':
  98030. case 'complexType':
  98031. case 'datatype':
  98032. case 'all':
  98033. case 'attribute':
  98034. case 'extends': break;
  98035. case 'row': break;
  98036. default: seen = false;
  98037. } break;
  98038. /* SmartTags (can be anything) */
  98039. case 'SmartTags': break;
  98040. default: seen = false; break;
  98041. }
  98042. if(seen) break;
  98043. /* CustomDocumentProperties */
  98044. if(Rn[3].match(/!\[CDATA/)) break;
  98045. if(!state[state.length-1][1]) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
  98046. if(state[state.length-1][0]==='CustomDocumentProperties') {
  98047. if(Rn[0].slice(-2) === "/>") break;
  98048. else if(Rn[1]==="/") xlml_set_custprop(Custprops, Rn[3], cp, str.slice(pidx, Rn.index));
  98049. else { cp = Rn; pidx = Rn.index + Rn[0].length; }
  98050. break;
  98051. }
  98052. if(opts.WTF) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
  98053. }
  98054. var out = ({});
  98055. if(!opts.bookSheets && !opts.bookProps) out.Sheets = sheets;
  98056. out.SheetNames = sheetnames;
  98057. out.Workbook = Workbook;
  98058. out.SSF = SSF.get_table();
  98059. out.Props = Props;
  98060. out.Custprops = Custprops;
  98061. return out;
  98062. }
  98063. function parse_xlml(data, opts) {
  98064. fix_read_opts(opts=opts||{});
  98065. switch(opts.type||"base64") {
  98066. case "base64": return parse_xlml_xml(Base64.decode(data), opts);
  98067. case "binary": case "buffer": case "file": return parse_xlml_xml(data, opts);
  98068. case "array": return parse_xlml_xml(a2s(data), opts);
  98069. }
  98070. }
  98071. /* TODO */
  98072. function write_props_xlml(wb, opts) {
  98073. var o = [];
  98074. /* DocumentProperties */
  98075. if(wb.Props) o.push(xlml_write_docprops(wb.Props, opts));
  98076. /* CustomDocumentProperties */
  98077. if(wb.Custprops) o.push(xlml_write_custprops(wb.Props, wb.Custprops, opts));
  98078. return o.join("");
  98079. }
  98080. /* TODO */
  98081. function write_wb_xlml() {
  98082. /* OfficeDocumentSettings */
  98083. /* ExcelWorkbook */
  98084. return "";
  98085. }
  98086. /* TODO */
  98087. function write_sty_xlml(wb, opts) {
  98088. /* Styles */
  98089. var styles = ['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];
  98090. opts.cellXfs.forEach(function(xf, id) {
  98091. var payload = [];
  98092. payload.push(writextag('NumberFormat', null, {"ss:Format": escapexml(SSF._table[xf.numFmtId])}));
  98093. styles.push(writextag('Style', payload.join(""), {"ss:ID": "s" + (21+id)}));
  98094. });
  98095. return writextag("Styles", styles.join(""));
  98096. }
  98097. function write_name_xlml(n) { return writextag("NamedRange", null, {"ss:Name": n.Name, "ss:RefersTo":"=" + a1_to_rc(n.Ref, {r:0,c:0})}); }
  98098. function write_names_xlml(wb) {
  98099. if(!((wb||{}).Workbook||{}).Names) return "";
  98100. var names = wb.Workbook.Names;
  98101. var out = [];
  98102. for(var i = 0; i < names.length; ++i) {
  98103. var n = names[i];
  98104. if(n.Sheet != null) continue;
  98105. if(n.Name.match(/^_xlfn\./)) continue;
  98106. out.push(write_name_xlml(n));
  98107. }
  98108. return writextag("Names", out.join(""));
  98109. }
  98110. function write_ws_xlml_names(ws, opts, idx, wb) {
  98111. if(!ws) return "";
  98112. if(!((wb||{}).Workbook||{}).Names) return "";
  98113. var names = wb.Workbook.Names;
  98114. var out = [];
  98115. for(var i = 0; i < names.length; ++i) {
  98116. var n = names[i];
  98117. if(n.Sheet != idx) continue;
  98118. /*switch(n.Name) {
  98119. case "_": continue;
  98120. }*/
  98121. if(n.Name.match(/^_xlfn\./)) continue;
  98122. out.push(write_name_xlml(n));
  98123. }
  98124. return out.join("");
  98125. }
  98126. /* WorksheetOptions */
  98127. function write_ws_xlml_wsopts(ws, opts, idx, wb) {
  98128. if(!ws) return "";
  98129. var o = [];
  98130. /* NOTE: spec technically allows any order, but stick with implied order */
  98131. /* FitToPage */
  98132. /* DoNotDisplayColHeaders */
  98133. /* DoNotDisplayRowHeaders */
  98134. /* ViewableRange */
  98135. /* Selection */
  98136. /* GridlineColor */
  98137. /* Name */
  98138. /* ExcelWorksheetType */
  98139. /* IntlMacro */
  98140. /* Unsynced */
  98141. /* Selected */
  98142. /* CodeName */
  98143. if(ws['!margins']) {
  98144. o.push("<PageSetup>");
  98145. if(ws['!margins'].header) o.push(writextag("Header", null, {'x:Margin':ws['!margins'].header}));
  98146. if(ws['!margins'].footer) o.push(writextag("Footer", null, {'x:Margin':ws['!margins'].footer}));
  98147. o.push(writextag("PageMargins", null, {
  98148. 'x:Bottom': ws['!margins'].bottom || "0.75",
  98149. 'x:Left': ws['!margins'].left || "0.7",
  98150. 'x:Right': ws['!margins'].right || "0.7",
  98151. 'x:Top': ws['!margins'].top || "0.75"
  98152. }));
  98153. o.push("</PageSetup>");
  98154. }
  98155. /* PageSetup */
  98156. /* DisplayPageBreak */
  98157. /* TransitionExpressionEvaluation */
  98158. /* TransitionFormulaEntry */
  98159. /* Print */
  98160. /* Zoom */
  98161. /* PageLayoutZoom */
  98162. /* PageBreakZoom */
  98163. /* ShowPageBreakZoom */
  98164. /* DefaultRowHeight */
  98165. /* DefaultColumnWidth */
  98166. /* StandardWidth */
  98167. if(wb && wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx]) {
  98168. /* Visible */
  98169. if(wb.Workbook.Sheets[idx].Hidden) o.push(writextag("Visible", (wb.Workbook.Sheets[idx].Hidden == 1 ? "SheetHidden" : "SheetVeryHidden"), {}));
  98170. else {
  98171. /* Selected */
  98172. for(var i = 0; i < idx; ++i) if(wb.Workbook.Sheets[i] && !wb.Workbook.Sheets[i].Hidden) break;
  98173. if(i == idx) o.push("<Selected/>");
  98174. }
  98175. }
  98176. /* LeftColumnVisible */
  98177. if(((((wb||{}).Workbook||{}).Views||[])[0]||{}).RTL) o.push("<DisplayRightToLeft/>");
  98178. /* GridlineColorIndex */
  98179. /* DisplayFormulas */
  98180. /* DoNotDisplayGridlines */
  98181. /* DoNotDisplayHeadings */
  98182. /* DoNotDisplayOutline */
  98183. /* ApplyAutomaticOutlineStyles */
  98184. /* NoSummaryRowsBelowDetail */
  98185. /* NoSummaryColumnsRightDetail */
  98186. /* DoNotDisplayZeros */
  98187. /* ActiveRow */
  98188. /* ActiveColumn */
  98189. /* FilterOn */
  98190. /* RangeSelection */
  98191. /* TopRowVisible */
  98192. /* TopRowBottomPane */
  98193. /* LeftColumnRightPane */
  98194. /* ActivePane */
  98195. /* SplitHorizontal */
  98196. /* SplitVertical */
  98197. /* FreezePanes */
  98198. /* FrozenNoSplit */
  98199. /* TabColorIndex */
  98200. /* Panes */
  98201. /* NOTE: Password not supported in XLML Format */
  98202. if(ws['!protect']) {
  98203. o.push(writetag("ProtectContents", "True"));
  98204. if(ws['!protect'].objects) o.push(writetag("ProtectObjects", "True"));
  98205. if(ws['!protect'].scenarios) o.push(writetag("ProtectScenarios", "True"));
  98206. if(ws['!protect'].selectLockedCells != null && !ws['!protect'].selectLockedCells) o.push(writetag("EnableSelection", "NoSelection"));
  98207. else if(ws['!protect'].selectUnlockedCells != null && !ws['!protect'].selectUnlockedCells) o.push(writetag("EnableSelection", "UnlockedCells"));
  98208. [
  98209. [ "formatCells", "AllowFormatCells" ],
  98210. [ "formatColumns", "AllowSizeCols" ],
  98211. [ "formatRows", "AllowSizeRows" ],
  98212. [ "insertColumns", "AllowInsertCols" ],
  98213. [ "insertRows", "AllowInsertRows" ],
  98214. [ "insertHyperlinks", "AllowInsertHyperlinks" ],
  98215. [ "deleteColumns", "AllowDeleteCols" ],
  98216. [ "deleteRows", "AllowDeleteRows" ],
  98217. [ "sort", "AllowSort" ],
  98218. [ "autoFilter", "AllowFilter" ],
  98219. [ "pivotTables", "AllowUsePivotTables" ]
  98220. ].forEach(function(x) { if(ws['!protect'][x[0]]) o.push("<"+x[1]+"/>"); });
  98221. }
  98222. if(o.length == 0) return "";
  98223. return writextag("WorksheetOptions", o.join(""), {xmlns:XLMLNS.x});
  98224. }
  98225. function write_ws_xlml_comment(comments) {
  98226. return comments.map(function(c) {
  98227. // TODO: formatted text
  98228. var t = xlml_unfixstr(c.t||"");
  98229. var d =writextag("ss:Data", t, {"xmlns":"http://www.w3.org/TR/REC-html40"});
  98230. return writextag("Comment", d, {"ss:Author":c.a});
  98231. }).join("");
  98232. }
  98233. function write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr){
  98234. if(!cell || (cell.v == undefined && cell.f == undefined)) return "";
  98235. var attr = {};
  98236. if(cell.f) attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell.f, addr));
  98237. if(cell.F && cell.F.slice(0, ref.length) == ref) {
  98238. var end = decode_cell(cell.F.slice(ref.length + 1));
  98239. attr["ss:ArrayRange"] = "RC:R" + (end.r == addr.r ? "" : "[" + (end.r - addr.r) + "]") + "C" + (end.c == addr.c ? "" : "[" + (end.c - addr.c) + "]");
  98240. }
  98241. if(cell.l && cell.l.Target) {
  98242. attr["ss:HRef"] = escapexml(cell.l.Target);
  98243. if(cell.l.Tooltip) attr["x:HRefScreenTip"] = escapexml(cell.l.Tooltip);
  98244. }
  98245. if(ws['!merges']) {
  98246. var marr = ws['!merges'];
  98247. for(var mi = 0; mi != marr.length; ++mi) {
  98248. if(marr[mi].s.c != addr.c || marr[mi].s.r != addr.r) continue;
  98249. if(marr[mi].e.c > marr[mi].s.c) attr['ss:MergeAcross'] = marr[mi].e.c - marr[mi].s.c;
  98250. if(marr[mi].e.r > marr[mi].s.r) attr['ss:MergeDown'] = marr[mi].e.r - marr[mi].s.r;
  98251. }
  98252. }
  98253. var t = "", p = "";
  98254. switch(cell.t) {
  98255. case 'z': if(!opts.sheetStubs) return ""; break;
  98256. case 'n': t = 'Number'; p = String(cell.v); break;
  98257. case 'b': t = 'Boolean'; p = (cell.v ? "1" : "0"); break;
  98258. case 'e': t = 'Error'; p = BErr[cell.v]; break;
  98259. case 'd': t = 'DateTime'; p = new Date(cell.v).toISOString(); if(cell.z == null) cell.z = cell.z || SSF._table[14]; break;
  98260. case 's': t = 'String'; p = escapexlml(cell.v||""); break;
  98261. }
  98262. /* TODO: cell style */
  98263. var os = get_cell_style(opts.cellXfs, cell, opts);
  98264. attr["ss:StyleID"] = "s" + (21+os);
  98265. attr["ss:Index"] = addr.c + 1;
  98266. var _v = (cell.v != null ? p : "");
  98267. var m = cell.t == 'z' ? "" : ('<Data ss:Type="' + t + '">' + _v + '</Data>');
  98268. if((cell.c||[]).length > 0) m += write_ws_xlml_comment(cell.c);
  98269. return writextag("Cell", m, attr);
  98270. }
  98271. function write_ws_xlml_row(R, row) {
  98272. var o = '<Row ss:Index="' + (R+1) + '"';
  98273. if(row) {
  98274. if(row.hpt && !row.hpx) row.hpx = pt2px(row.hpt);
  98275. if(row.hpx) o += ' ss:AutoFitHeight="0" ss:Height="' + row.hpx + '"';
  98276. if(row.hidden) o += ' ss:Hidden="1"';
  98277. }
  98278. return o + '>';
  98279. }
  98280. /* TODO */
  98281. function write_ws_xlml_table(ws, opts, idx, wb) {
  98282. if(!ws['!ref']) return "";
  98283. var range = safe_decode_range(ws['!ref']);
  98284. var marr = ws['!merges'] || [], mi = 0;
  98285. var o = [];
  98286. if(ws['!cols']) ws['!cols'].forEach(function(n, i) {
  98287. process_col(n);
  98288. var w = !!n.width;
  98289. var p = col_obj_w(i, n);
  98290. var k = {"ss:Index":i+1};
  98291. if(w) k['ss:Width'] = width2px(p.width);
  98292. if(n.hidden) k['ss:Hidden']="1";
  98293. o.push(writextag("Column",null,k));
  98294. });
  98295. var dense = Array.isArray(ws);
  98296. for(var R = range.s.r; R <= range.e.r; ++R) {
  98297. var row = [write_ws_xlml_row(R, (ws['!rows']||[])[R])];
  98298. for(var C = range.s.c; C <= range.e.c; ++C) {
  98299. var skip = false;
  98300. for(mi = 0; mi != marr.length; ++mi) {
  98301. if(marr[mi].s.c > C) continue;
  98302. if(marr[mi].s.r > R) continue;
  98303. if(marr[mi].e.c < C) continue;
  98304. if(marr[mi].e.r < R) continue;
  98305. if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true;
  98306. break;
  98307. }
  98308. if(skip) continue;
  98309. var addr = {r:R,c:C};
  98310. var ref = encode_cell(addr), cell = dense ? (ws[R]||[])[C] : ws[ref];
  98311. row.push(write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr));
  98312. }
  98313. row.push("</Row>");
  98314. if(row.length > 2) o.push(row.join(""));
  98315. }
  98316. return o.join("");
  98317. }
  98318. function write_ws_xlml(idx, opts, wb) {
  98319. var o = [];
  98320. var s = wb.SheetNames[idx];
  98321. var ws = wb.Sheets[s];
  98322. var t = ws ? write_ws_xlml_names(ws, opts, idx, wb) : "";
  98323. if(t.length > 0) o.push("<Names>" + t + "</Names>");
  98324. /* Table */
  98325. t = ws ? write_ws_xlml_table(ws, opts, idx, wb) : "";
  98326. if(t.length > 0) o.push("<Table>" + t + "</Table>");
  98327. /* WorksheetOptions */
  98328. o.push(write_ws_xlml_wsopts(ws, opts, idx, wb));
  98329. return o.join("");
  98330. }
  98331. function write_xlml(wb, opts) {
  98332. if(!opts) opts = {};
  98333. if(!wb.SSF) wb.SSF = SSF.get_table();
  98334. if(wb.SSF) {
  98335. make_ssf(SSF); SSF.load_table(wb.SSF);
  98336. // $FlowIgnore
  98337. opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
  98338. opts.ssf = wb.SSF;
  98339. opts.cellXfs = [];
  98340. get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
  98341. }
  98342. var d = [];
  98343. d.push(write_props_xlml(wb, opts));
  98344. d.push(write_wb_xlml(wb, opts));
  98345. d.push("");
  98346. d.push("");
  98347. for(var i = 0; i < wb.SheetNames.length; ++i)
  98348. d.push(writextag("Worksheet", write_ws_xlml(i, opts, wb), {"ss:Name":escapexml(wb.SheetNames[i])}));
  98349. d[2] = write_sty_xlml(wb, opts);
  98350. d[3] = write_names_xlml(wb, opts);
  98351. return XML_HEADER + writextag("Workbook", d.join(""), {
  98352. 'xmlns': XLMLNS.ss,
  98353. 'xmlns:o': XLMLNS.o,
  98354. 'xmlns:x': XLMLNS.x,
  98355. 'xmlns:ss': XLMLNS.ss,
  98356. 'xmlns:dt': XLMLNS.dt,
  98357. 'xmlns:html': XLMLNS.html
  98358. });
  98359. }
  98360. /* [MS-OLEDS] 2.3.8 CompObjStream */
  98361. function parse_compobj(obj) {
  98362. var v = {};
  98363. var o = obj.content;
  98364. /* [MS-OLEDS] 2.3.7 CompObjHeader -- All fields MUST be ignored */
  98365. o.l = 28;
  98366. v.AnsiUserType = o.read_shift(0, "lpstr-ansi");
  98367. v.AnsiClipboardFormat = parse_ClipboardFormatOrAnsiString(o);
  98368. if(o.length - o.l <= 4) return v;
  98369. var m = o.read_shift(4);
  98370. if(m == 0 || m > 40) return v;
  98371. o.l-=4; v.Reserved1 = o.read_shift(0, "lpstr-ansi");
  98372. if(o.length - o.l <= 4) return v;
  98373. m = o.read_shift(4);
  98374. if(m !== 0x71b239f4) return v;
  98375. v.UnicodeClipboardFormat = parse_ClipboardFormatOrUnicodeString(o);
  98376. m = o.read_shift(4);
  98377. if(m == 0 || m > 40) return v;
  98378. o.l-=4; v.Reserved2 = o.read_shift(0, "lpwstr");
  98379. }
  98380. /*
  98381. Continue logic for:
  98382. - 2.4.58 Continue
  98383. - 2.4.59 ContinueBigName
  98384. - 2.4.60 ContinueFrt
  98385. - 2.4.61 ContinueFrt11
  98386. - 2.4.62 ContinueFrt12
  98387. */
  98388. function slurp(R, blob, length, opts) {
  98389. var l = length;
  98390. var bufs = [];
  98391. var d = blob.slice(blob.l,blob.l+l);
  98392. if(opts && opts.enc && opts.enc.insitu) switch(R.n) {
  98393. case 'BOF': case 'FilePass': case 'FileLock': case 'InterfaceHdr': case 'RRDInfo': case 'RRDHead': case 'UsrExcl': break;
  98394. default:
  98395. if(d.length === 0) break;
  98396. opts.enc.insitu(d);
  98397. }
  98398. bufs.push(d);
  98399. blob.l += l;
  98400. var next = (XLSRecordEnum[__readUInt16LE(blob,blob.l)]);
  98401. var start = 0;
  98402. while(next != null && next.n.slice(0,8) === 'Continue') {
  98403. l = __readUInt16LE(blob,blob.l+2);
  98404. start = blob.l + 4;
  98405. if(next.n == 'ContinueFrt') start += 4;
  98406. else if(next.n.slice(0,11) == 'ContinueFrt') start += 12;
  98407. bufs.push(blob.slice(start,blob.l+4+l));
  98408. blob.l += 4+l;
  98409. next = (XLSRecordEnum[__readUInt16LE(blob, blob.l)]);
  98410. }
  98411. var b = (bconcat(bufs));
  98412. prep_blob(b, 0);
  98413. var ll = 0; b.lens = [];
  98414. for(var j = 0; j < bufs.length; ++j) { b.lens.push(ll); ll += bufs[j].length; }
  98415. return R.f(b, b.length, opts);
  98416. }
  98417. function safe_format_xf(p, opts, date1904) {
  98418. if(p.t === 'z') return;
  98419. if(!p.XF) return;
  98420. var fmtid = 0;
  98421. try {
  98422. fmtid = p.z || p.XF.numFmtId || 0;
  98423. if(opts.cellNF) p.z = SSF._table[fmtid];
  98424. } catch(e) { if(opts.WTF) throw e; }
  98425. if(!opts || opts.cellText !== false) try {
  98426. if(p.t === 'e') { p.w = p.w || BErr[p.v]; }
  98427. else if(fmtid === 0 || fmtid == "General") {
  98428. if(p.t === 'n') {
  98429. if((p.v|0) === p.v) p.w = SSF._general_int(p.v);
  98430. else p.w = SSF._general_num(p.v);
  98431. }
  98432. else p.w = SSF._general(p.v);
  98433. }
  98434. else p.w = SSF.format(fmtid,p.v, {date1904:!!date1904});
  98435. } catch(e) { if(opts.WTF) throw e; }
  98436. if(opts.cellDates && fmtid && p.t == 'n' && SSF.is_date(SSF._table[fmtid] || String(fmtid))) {
  98437. var _d = SSF.parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); }
  98438. }
  98439. }
  98440. function make_cell(val, ixfe, t) {
  98441. return ({v:val, ixfe:ixfe, t:t});
  98442. }
  98443. // 2.3.2
  98444. function parse_workbook(blob, options) {
  98445. var wb = ({opts:{}});
  98446. var Sheets = {};
  98447. if(DENSE != null && options.dense == null) options.dense = DENSE;
  98448. var out = ((options.dense ? [] : {}));
  98449. var Directory = {};
  98450. var range = ({});
  98451. var last_formula = null;
  98452. var sst = ([]);
  98453. var cur_sheet = "";
  98454. var Preamble = {};
  98455. var lastcell, last_cell = "", cc, cmnt, rngC, rngR;
  98456. var sharedf = {};
  98457. var arrayf = [];
  98458. var temp_val;
  98459. var country;
  98460. var cell_valid = true;
  98461. var XFs = []; /* XF records */
  98462. var palette = [];
  98463. var Workbook = ({ Sheets:[], WBProps:{date1904:false}, Views:[{}] }), wsprops = {};
  98464. var get_rgb = function getrgb(icv) {
  98465. if(icv < 8) return XLSIcv[icv];
  98466. if(icv < 64) return palette[icv-8] || XLSIcv[icv];
  98467. return XLSIcv[icv];
  98468. };
  98469. var process_cell_style = function pcs(cell, line, options) {
  98470. var xfd = line.XF.data;
  98471. if(!xfd || !xfd.patternType || !options || !options.cellStyles) return;
  98472. line.s = ({});
  98473. line.s.patternType = xfd.patternType;
  98474. var t;
  98475. if((t = rgb2Hex(get_rgb(xfd.icvFore)))) { line.s.fgColor = {rgb:t}; }
  98476. if((t = rgb2Hex(get_rgb(xfd.icvBack)))) { line.s.bgColor = {rgb:t}; }
  98477. };
  98478. var addcell = function addcell(cell, line, options) {
  98479. if(file_depth > 1) return;
  98480. if(options.sheetRows && cell.r >= options.sheetRows) cell_valid = false;
  98481. if(!cell_valid) return;
  98482. if(options.cellStyles && line.XF && line.XF.data) process_cell_style(cell, line, options);
  98483. delete line.ixfe; delete line.XF;
  98484. lastcell = cell;
  98485. last_cell = encode_cell(cell);
  98486. if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};
  98487. if(cell.r < range.s.r) range.s.r = cell.r;
  98488. if(cell.c < range.s.c) range.s.c = cell.c;
  98489. if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
  98490. if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
  98491. if(options.cellFormula && line.f) {
  98492. for(var afi = 0; afi < arrayf.length; ++afi) {
  98493. if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
  98494. if(arrayf[afi][0].e.c < cell.c || arrayf[afi][0].e.r < cell.r) continue;
  98495. line.F = encode_range(arrayf[afi][0]);
  98496. if(arrayf[afi][0].s.c != cell.c || arrayf[afi][0].s.r != cell.r) delete line.f;
  98497. if(line.f) line.f = "" + stringify_formula(arrayf[afi][1], range, cell, supbooks, opts);
  98498. break;
  98499. }
  98500. }
  98501. {
  98502. if(options.dense) {
  98503. if(!out[cell.r]) out[cell.r] = [];
  98504. out[cell.r][cell.c] = line;
  98505. } else out[last_cell] = line;
  98506. }
  98507. };
  98508. var opts = ({
  98509. enc: false, // encrypted
  98510. sbcch: 0, // cch in the preceding SupBook
  98511. snames: [], // sheetnames
  98512. sharedf: sharedf, // shared formulae by address
  98513. arrayf: arrayf, // array formulae array
  98514. rrtabid: [], // RRTabId
  98515. lastuser: "", // Last User from WriteAccess
  98516. biff: 8, // BIFF version
  98517. codepage: 0, // CP from CodePage record
  98518. winlocked: 0, // fLockWn from WinProtect
  98519. cellStyles: !!options && !!options.cellStyles,
  98520. WTF: !!options && !!options.wtf
  98521. });
  98522. if(options.password) opts.password = options.password;
  98523. var themes;
  98524. var merges = [];
  98525. var objects = [];
  98526. var colinfo = [], rowinfo = [];
  98527. // eslint-disable-next-line no-unused-vars
  98528. var defwidth = 0, defheight = 0; // twips / MDW respectively
  98529. var seencol = false;
  98530. var supbooks = ([]); // 1-indexed, will hold extern names
  98531. supbooks.SheetNames = opts.snames;
  98532. supbooks.sharedf = opts.sharedf;
  98533. supbooks.arrayf = opts.arrayf;
  98534. supbooks.names = [];
  98535. supbooks.XTI = [];
  98536. var last_Rn = '';
  98537. var file_depth = 0; /* TODO: make a real stack */
  98538. var BIFF2Fmt = 0, BIFF2FmtTable = [];
  98539. var FilterDatabases = []; /* TODO: sort out supbooks and process elsewhere */
  98540. var last_lbl;
  98541. /* explicit override for some broken writers */
  98542. opts.codepage = 1200;
  98543. set_cp(1200);
  98544. var seen_codepage = false;
  98545. while(blob.l < blob.length - 1) {
  98546. var s = blob.l;
  98547. var RecordType = blob.read_shift(2);
  98548. if(RecordType === 0 && last_Rn === 'EOF') break;
  98549. var length = (blob.l === blob.length ? 0 : blob.read_shift(2));
  98550. var R = XLSRecordEnum[RecordType];
  98551. //console.log(RecordType.toString(16), RecordType, R, blob.l, length, blob.length);
  98552. //if(!R) console.log(blob.slice(blob.l, blob.l + length));
  98553. if(R && R.f) {
  98554. if(options.bookSheets) {
  98555. if(last_Rn === 'BoundSheet8' && R.n !== 'BoundSheet8') break;
  98556. }
  98557. last_Rn = R.n;
  98558. if(R.r === 2 || R.r == 12) {
  98559. var rt = blob.read_shift(2); length -= 2;
  98560. if(!opts.enc && rt !== RecordType && (((rt&0xFF)<<8)|(rt>>8)) !== RecordType) throw new Error("rt mismatch: " + rt + "!=" + RecordType);
  98561. if(R.r == 12){ blob.l += 10; length -= 10; } // skip FRT
  98562. }
  98563. //console.error(R,blob.l,length,blob.length);
  98564. var val = ({});
  98565. if(R.n === 'EOF') val = R.f(blob, length, opts);
  98566. else val = slurp(R, blob, length, opts);
  98567. var Rn = R.n;
  98568. if(file_depth == 0 && Rn != 'BOF') continue;
  98569. /* nested switch statements to workaround V8 128 limit */
  98570. switch(Rn) {
  98571. /* Workbook Options */
  98572. case 'Date1904':
  98573. wb.opts.Date1904 = Workbook.WBProps.date1904 = val; break;
  98574. case 'WriteProtect': wb.opts.WriteProtect = true; break;
  98575. case 'FilePass':
  98576. if(!opts.enc) blob.l = 0;
  98577. opts.enc = val;
  98578. if(!options.password) throw new Error("File is password-protected");
  98579. if(val.valid == null) throw new Error("Encryption scheme unsupported");
  98580. if(!val.valid) throw new Error("Password is incorrect");
  98581. break;
  98582. case 'WriteAccess': opts.lastuser = val; break;
  98583. case 'FileSharing': break; //TODO
  98584. case 'CodePage':
  98585. var cpval = Number(val);
  98586. /* overrides based on test cases */
  98587. switch(cpval) {
  98588. case 0x5212: cpval = 1200; break;
  98589. case 0x8000: cpval = 10000; break;
  98590. case 0x8001: cpval = 1252; break;
  98591. }
  98592. set_cp(opts.codepage = cpval);
  98593. seen_codepage = true;
  98594. break;
  98595. case 'RRTabId': opts.rrtabid = val; break;
  98596. case 'WinProtect': opts.winlocked = val; break;
  98597. case 'Template': break; // TODO
  98598. case 'BookBool': break; // TODO
  98599. case 'UsesELFs': break;
  98600. case 'MTRSettings': break;
  98601. case 'RefreshAll':
  98602. case 'CalcCount':
  98603. case 'CalcDelta':
  98604. case 'CalcIter':
  98605. case 'CalcMode':
  98606. case 'CalcPrecision':
  98607. case 'CalcSaveRecalc':
  98608. wb.opts[Rn] = val; break;
  98609. case 'CalcRefMode': opts.CalcRefMode = val; break; // TODO: implement R1C1
  98610. case 'Uncalced': break;
  98611. case 'ForceFullCalculation': wb.opts.FullCalc = val; break;
  98612. case 'WsBool':
  98613. if(val.fDialog) out["!type"] = "dialog";
  98614. break; // TODO
  98615. case 'XF':
  98616. XFs.push(val); break;
  98617. case 'ExtSST': break; // TODO
  98618. case 'BookExt': break; // TODO
  98619. case 'RichTextStream': break;
  98620. case 'BkHim': break;
  98621. case 'SupBook':
  98622. supbooks.push([val]);
  98623. supbooks[supbooks.length-1].XTI = [];
  98624. break;
  98625. case 'ExternName':
  98626. supbooks[supbooks.length-1].push(val);
  98627. break;
  98628. case 'Index': break; // TODO
  98629. case 'Lbl':
  98630. last_lbl = ({
  98631. Name: val.Name,
  98632. Ref: stringify_formula(val.rgce,range,null,supbooks,opts)
  98633. });
  98634. if(val.itab > 0) last_lbl.Sheet = val.itab - 1;
  98635. supbooks.names.push(last_lbl);
  98636. if(!supbooks[0]) { supbooks[0] = []; supbooks[0].XTI = []; }
  98637. supbooks[supbooks.length-1].push(val);
  98638. if(val.Name == "_xlnm._FilterDatabase" && val.itab > 0)
  98639. if(val.rgce && val.rgce[0] && val.rgce[0][0] && val.rgce[0][0][0] == 'PtgArea3d')
  98640. FilterDatabases[val.itab - 1] = { ref: encode_range(val.rgce[0][0][1][2]) };
  98641. break;
  98642. case 'ExternCount': opts.ExternCount = val; break;
  98643. case 'ExternSheet':
  98644. if(supbooks.length == 0) { supbooks[0] = []; supbooks[0].XTI = []; }
  98645. supbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val); supbooks.XTI = supbooks.XTI.concat(val); break;
  98646. case 'NameCmt':
  98647. /* TODO: search for correct name */
  98648. if(opts.biff < 8) break;
  98649. if(last_lbl != null) last_lbl.Comment = val[1];
  98650. break;
  98651. case 'Protect': out["!protect"] = val; break; /* for sheet or book */
  98652. case 'Password': if(val !== 0 && opts.WTF) console.error("Password verifier: " + val); break;
  98653. case 'Prot4Rev': case 'Prot4RevPass': break; /*TODO: Revision Control*/
  98654. case 'BoundSheet8': {
  98655. Directory[val.pos] = val;
  98656. opts.snames.push(val.name);
  98657. } break;
  98658. case 'EOF': {
  98659. if(--file_depth) break;
  98660. if(range.e) {
  98661. if(range.e.r > 0 && range.e.c > 0) {
  98662. range.e.r--; range.e.c--;
  98663. out["!ref"] = encode_range(range);
  98664. if(options.sheetRows && options.sheetRows <= range.e.r) {
  98665. var tmpri = range.e.r;
  98666. range.e.r = options.sheetRows - 1;
  98667. out["!fullref"] = out["!ref"];
  98668. out["!ref"] = encode_range(range);
  98669. range.e.r = tmpri;
  98670. }
  98671. range.e.r++; range.e.c++;
  98672. }
  98673. if(merges.length > 0) out["!merges"] = merges;
  98674. if(objects.length > 0) out["!objects"] = objects;
  98675. if(colinfo.length > 0) out["!cols"] = colinfo;
  98676. if(rowinfo.length > 0) out["!rows"] = rowinfo;
  98677. Workbook.Sheets.push(wsprops);
  98678. }
  98679. if(cur_sheet === "") Preamble = out; else Sheets[cur_sheet] = out;
  98680. out = ((options.dense ? [] : {}));
  98681. } break;
  98682. case 'BOF': {
  98683. if(opts.biff === 8) opts.biff = {
  98684. 0x0009:2,
  98685. 0x0209:3,
  98686. 0x0409:4
  98687. }[RecordType] || {
  98688. 0x0200:2,
  98689. 0x0300:3,
  98690. 0x0400:4,
  98691. 0x0500:5,
  98692. 0x0600:8,
  98693. 0x0002:2,
  98694. 0x0007:2
  98695. }[val.BIFFVer] || 8;
  98696. if(opts.biff == 8 && val.BIFFVer == 0 && val.dt == 16) opts.biff = 2;
  98697. if(file_depth++) break;
  98698. cell_valid = true;
  98699. out = ((options.dense ? [] : {}));
  98700. if(opts.biff < 8 && !seen_codepage) { seen_codepage = true; set_cp(opts.codepage = options.codepage || 1252); }
  98701. if(opts.biff < 5) {
  98702. if(cur_sheet === "") cur_sheet = "Sheet1";
  98703. range = {s:{r:0,c:0},e:{r:0,c:0}};
  98704. /* fake BoundSheet8 */
  98705. var fakebs8 = {pos: blob.l - length, name:cur_sheet};
  98706. Directory[fakebs8.pos] = fakebs8;
  98707. opts.snames.push(cur_sheet);
  98708. }
  98709. else cur_sheet = (Directory[s] || {name:""}).name;
  98710. if(val.dt == 0x20) out["!type"] = "chart";
  98711. if(val.dt == 0x40) out["!type"] = "macro";
  98712. merges = [];
  98713. objects = [];
  98714. opts.arrayf = arrayf = [];
  98715. colinfo = []; rowinfo = [];
  98716. defwidth = defheight = 0;
  98717. seencol = false;
  98718. wsprops = {Hidden:(Directory[s]||{hs:0}).hs, name:cur_sheet };
  98719. } break;
  98720. case 'Number': case 'BIFF2NUM': case 'BIFF2INT': {
  98721. if(out["!type"] == "chart") if(options.dense ? (out[val.r]||[])[val.c]: out[encode_cell({c:val.c, r:val.r})]) ++val.c;
  98722. temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe]||{}, v:val.val, t:'n'});
  98723. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98724. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98725. addcell({c:val.c, r:val.r}, temp_val, options);
  98726. } break;
  98727. case 'BoolErr': {
  98728. temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.val, t:val.t});
  98729. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98730. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98731. addcell({c:val.c, r:val.r}, temp_val, options);
  98732. } break;
  98733. case 'RK': {
  98734. temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.rknum, t:'n'});
  98735. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98736. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98737. addcell({c:val.c, r:val.r}, temp_val, options);
  98738. } break;
  98739. case 'MulRk': {
  98740. for(var j = val.c; j <= val.C; ++j) {
  98741. var ixfe = val.rkrec[j-val.c][0];
  98742. temp_val= ({ixfe:ixfe, XF:XFs[ixfe], v:val.rkrec[j-val.c][1], t:'n'});
  98743. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98744. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98745. addcell({c:j, r:val.r}, temp_val, options);
  98746. }
  98747. } break;
  98748. case 'Formula': {
  98749. if(val.val == 'String') { last_formula = val; break; }
  98750. temp_val = make_cell(val.val, val.cell.ixfe, val.tt);
  98751. temp_val.XF = XFs[temp_val.ixfe];
  98752. if(options.cellFormula) {
  98753. var _f = val.formula;
  98754. if(_f && _f[0] && _f[0][0] && _f[0][0][0] == 'PtgExp') {
  98755. var _fr = _f[0][0][1][0], _fc = _f[0][0][1][1];
  98756. var _fe = encode_cell({r:_fr, c:_fc});
  98757. if(sharedf[_fe]) temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
  98758. else temp_val.F = ((options.dense ? (out[_fr]||[])[_fc]: out[_fe]) || {}).F;
  98759. } else temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
  98760. }
  98761. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98762. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98763. addcell(val.cell, temp_val, options);
  98764. last_formula = val;
  98765. } break;
  98766. case 'String': {
  98767. if(last_formula) { /* technically always true */
  98768. last_formula.val = val;
  98769. temp_val = make_cell(val, last_formula.cell.ixfe, 's');
  98770. temp_val.XF = XFs[temp_val.ixfe];
  98771. if(options.cellFormula) {
  98772. temp_val.f = ""+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts);
  98773. }
  98774. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98775. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98776. addcell(last_formula.cell, temp_val, options);
  98777. last_formula = null;
  98778. } else throw new Error("String record expects Formula");
  98779. } break;
  98780. case 'Array': {
  98781. arrayf.push(val);
  98782. var _arraystart = encode_cell(val[0].s);
  98783. cc = options.dense ? (out[val[0].s.r]||[])[val[0].s.c] : out[_arraystart];
  98784. if(options.cellFormula && cc) {
  98785. if(!last_formula) break; /* technically unreachable */
  98786. if(!_arraystart || !cc) break;
  98787. cc.f = ""+stringify_formula(val[1], range, val[0], supbooks, opts);
  98788. cc.F = encode_range(val[0]);
  98789. }
  98790. } break;
  98791. case 'ShrFmla': {
  98792. if(!cell_valid) break;
  98793. if(!options.cellFormula) break;
  98794. if(last_cell) {
  98795. /* TODO: capture range */
  98796. if(!last_formula) break; /* technically unreachable */
  98797. sharedf[encode_cell(last_formula.cell)]= val[0];
  98798. cc = options.dense ? (out[last_formula.cell.r]||[])[last_formula.cell.c] : out[encode_cell(last_formula.cell)];
  98799. (cc||{}).f = ""+stringify_formula(val[0], range, lastcell, supbooks, opts);
  98800. }
  98801. } break;
  98802. case 'LabelSst':
  98803. temp_val=make_cell(sst[val.isst].t, val.ixfe, 's');
  98804. if(sst[val.isst].h) temp_val.h = sst[val.isst].h;
  98805. temp_val.XF = XFs[temp_val.ixfe];
  98806. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98807. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98808. addcell({c:val.c, r:val.r}, temp_val, options);
  98809. break;
  98810. case 'Blank': if(options.sheetStubs) {
  98811. temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], t:'z'});
  98812. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98813. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98814. addcell({c:val.c, r:val.r}, temp_val, options);
  98815. } break;
  98816. case 'MulBlank': if(options.sheetStubs) {
  98817. for(var _j = val.c; _j <= val.C; ++_j) {
  98818. var _ixfe = val.ixfe[_j-val.c];
  98819. temp_val= ({ixfe:_ixfe, XF:XFs[_ixfe], t:'z'});
  98820. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98821. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98822. addcell({c:_j, r:val.r}, temp_val, options);
  98823. }
  98824. } break;
  98825. case 'RString':
  98826. case 'Label': case 'BIFF2STR':
  98827. temp_val=make_cell(val.val, val.ixfe, 's');
  98828. temp_val.XF = XFs[temp_val.ixfe];
  98829. if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
  98830. safe_format_xf(temp_val, options, wb.opts.Date1904);
  98831. addcell({c:val.c, r:val.r}, temp_val, options);
  98832. break;
  98833. case 'Dimensions': {
  98834. if(file_depth === 1) range = val; /* TODO: stack */
  98835. } break;
  98836. case 'SST': {
  98837. sst = val;
  98838. } break;
  98839. case 'Format': { /* val = [id, fmt] */
  98840. if(opts.biff == 4) {
  98841. BIFF2FmtTable[BIFF2Fmt++] = val[1];
  98842. for(var b4idx = 0; b4idx < BIFF2Fmt + 163; ++b4idx) if(SSF._table[b4idx] == val[1]) break;
  98843. if(b4idx >= 163) SSF.load(val[1], BIFF2Fmt + 163);
  98844. }
  98845. else SSF.load(val[1], val[0]);
  98846. } break;
  98847. case 'BIFF2FORMAT': {
  98848. BIFF2FmtTable[BIFF2Fmt++] = val;
  98849. for(var b2idx = 0; b2idx < BIFF2Fmt + 163; ++b2idx) if(SSF._table[b2idx] == val) break;
  98850. if(b2idx >= 163) SSF.load(val, BIFF2Fmt + 163);
  98851. } break;
  98852. case 'MergeCells': merges = merges.concat(val); break;
  98853. case 'Obj': objects[val.cmo[0]] = opts.lastobj = val; break;
  98854. case 'TxO': opts.lastobj.TxO = val; break;
  98855. case 'ImData': opts.lastobj.ImData = val; break;
  98856. case 'HLink': {
  98857. for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)
  98858. for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) {
  98859. cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})];
  98860. if(cc) cc.l = val[1];
  98861. }
  98862. } break;
  98863. case 'HLinkTooltip': {
  98864. for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)
  98865. for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) {
  98866. cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})];
  98867. if(cc && cc.l) cc.l.Tooltip = val[1];
  98868. }
  98869. } break;
  98870. /* Comments */
  98871. case 'Note': {
  98872. if(opts.biff <= 5 && opts.biff >= 2) break; /* TODO: BIFF5 */
  98873. cc = options.dense ? (out[val[0].r]||[])[val[0].c] : out[encode_cell(val[0])];
  98874. var noteobj = objects[val[2]];
  98875. if(!cc) {
  98876. if(options.dense) {
  98877. if(!out[val[0].r]) out[val[0].r] = [];
  98878. cc = out[val[0].r][val[0].c] = ({t:"z"});
  98879. } else {
  98880. cc = out[encode_cell(val[0])] = ({t:"z"});
  98881. }
  98882. range.e.r = Math.max(range.e.r, val[0].r);
  98883. range.s.r = Math.min(range.s.r, val[0].r);
  98884. range.e.c = Math.max(range.e.c, val[0].c);
  98885. range.s.c = Math.min(range.s.c, val[0].c);
  98886. }
  98887. if(!cc.c) cc.c = [];
  98888. cmnt = {a:val[1],t:noteobj.TxO.t};
  98889. cc.c.push(cmnt);
  98890. } break;
  98891. default: switch(R.n) { /* nested */
  98892. case 'ClrtClient': break;
  98893. case 'XFExt': update_xfext(XFs[val.ixfe], val.ext); break;
  98894. case 'DefColWidth': defwidth = val; break;
  98895. case 'DefaultRowHeight': defheight = val[1]; break; // TODO: flags
  98896. case 'ColInfo': {
  98897. if(!opts.cellStyles) break;
  98898. while(val.e >= val.s) {
  98899. colinfo[val.e--] = { width: val.w/256 };
  98900. if(!seencol) { seencol = true; find_mdw_colw(val.w/256); }
  98901. process_col(colinfo[val.e+1]);
  98902. }
  98903. } break;
  98904. case 'Row': {
  98905. var rowobj = {};
  98906. if(val.level != null) { rowinfo[val.r] = rowobj; rowobj.level = val.level; }
  98907. if(val.hidden) { rowinfo[val.r] = rowobj; rowobj.hidden = true; }
  98908. if(val.hpt) {
  98909. rowinfo[val.r] = rowobj;
  98910. rowobj.hpt = val.hpt; rowobj.hpx = pt2px(val.hpt);
  98911. }
  98912. } break;
  98913. case 'LeftMargin':
  98914. case 'RightMargin':
  98915. case 'TopMargin':
  98916. case 'BottomMargin':
  98917. if(!out['!margins']) default_margins(out['!margins'] = {});
  98918. out['!margins'][Rn.slice(0,-6).toLowerCase()] = val;
  98919. break;
  98920. case 'Setup': // TODO
  98921. if(!out['!margins']) default_margins(out['!margins'] = {});
  98922. out['!margins'].header = val.header;
  98923. out['!margins'].footer = val.footer;
  98924. break;
  98925. case 'Window2': // TODO
  98926. // $FlowIgnore
  98927. if(val.RTL) Workbook.Views[0].RTL = true;
  98928. break;
  98929. case 'Header': break; // TODO
  98930. case 'Footer': break; // TODO
  98931. case 'HCenter': break; // TODO
  98932. case 'VCenter': break; // TODO
  98933. case 'Pls': break; // TODO
  98934. case 'GCW': break;
  98935. case 'LHRecord': break;
  98936. case 'DBCell': break; // TODO
  98937. case 'EntExU2': break; // TODO
  98938. case 'SxView': break; // TODO
  98939. case 'Sxvd': break; // TODO
  98940. case 'SXVI': break; // TODO
  98941. case 'SXVDEx': break; // TODO
  98942. case 'SxIvd': break; // TODO
  98943. case 'SXString': break; // TODO
  98944. case 'Sync': break;
  98945. case 'Addin': break;
  98946. case 'SXDI': break; // TODO
  98947. case 'SXLI': break; // TODO
  98948. case 'SXEx': break; // TODO
  98949. case 'QsiSXTag': break; // TODO
  98950. case 'Selection': break;
  98951. case 'Feat': break;
  98952. case 'FeatHdr': case 'FeatHdr11': break;
  98953. case 'Feature11': case 'Feature12': case 'List12': break;
  98954. case 'Country': country = val; break;
  98955. case 'RecalcId': break;
  98956. case 'DxGCol': break; // TODO: htmlify
  98957. case 'Fbi': case 'Fbi2': case 'GelFrame': break;
  98958. case 'Font': break; // TODO
  98959. case 'XFCRC': break; // TODO
  98960. case 'Style': break; // TODO
  98961. case 'StyleExt': break; // TODO
  98962. case 'Palette': palette = val; break;
  98963. case 'Theme': themes = val; break;
  98964. /* Protection */
  98965. case 'ScenarioProtect': break;
  98966. case 'ObjProtect': break;
  98967. /* Conditional Formatting */
  98968. case 'CondFmt12': break;
  98969. /* Table */
  98970. case 'Table': break; // TODO
  98971. case 'TableStyles': break; // TODO
  98972. case 'TableStyle': break; // TODO
  98973. case 'TableStyleElement': break; // TODO
  98974. /* PivotTable */
  98975. case 'SXStreamID': break; // TODO
  98976. case 'SXVS': break; // TODO
  98977. case 'DConRef': break; // TODO
  98978. case 'SXAddl': break; // TODO
  98979. case 'DConBin': break; // TODO
  98980. case 'DConName': break; // TODO
  98981. case 'SXPI': break; // TODO
  98982. case 'SxFormat': break; // TODO
  98983. case 'SxSelect': break; // TODO
  98984. case 'SxRule': break; // TODO
  98985. case 'SxFilt': break; // TODO
  98986. case 'SxItm': break; // TODO
  98987. case 'SxDXF': break; // TODO
  98988. /* Scenario Manager */
  98989. case 'ScenMan': break;
  98990. /* Data Consolidation */
  98991. case 'DCon': break;
  98992. /* Watched Cell */
  98993. case 'CellWatch': break;
  98994. /* Print Settings */
  98995. case 'PrintRowCol': break;
  98996. case 'PrintGrid': break;
  98997. case 'PrintSize': break;
  98998. case 'XCT': break;
  98999. case 'CRN': break;
  99000. case 'Scl': {
  99001. //console.log("Zoom Level:", val[0]/val[1],val);
  99002. } break;
  99003. case 'SheetExt': {
  99004. /* empty */
  99005. } break;
  99006. case 'SheetExtOptional': {
  99007. /* empty */
  99008. } break;
  99009. /* VBA */
  99010. case 'ObNoMacros': {
  99011. /* empty */
  99012. } break;
  99013. case 'ObProj': {
  99014. /* empty */
  99015. } break;
  99016. case 'CodeName': {
  99017. if(!cur_sheet) Workbook.WBProps.CodeName = val || "ThisWorkbook";
  99018. else wsprops.CodeName = val || wsprops.name;
  99019. } break;
  99020. case 'GUIDTypeLib': {
  99021. /* empty */
  99022. } break;
  99023. case 'WOpt': break; // TODO: WTF?
  99024. case 'PhoneticInfo': break;
  99025. case 'OleObjectSize': break;
  99026. /* Differential Formatting */
  99027. case 'DXF': case 'DXFN': case 'DXFN12': case 'DXFN12List': case 'DXFN12NoCB': break;
  99028. /* Data Validation */
  99029. case 'Dv': case 'DVal': break;
  99030. /* Data Series */
  99031. case 'BRAI': case 'Series': case 'SeriesText': break;
  99032. /* Data Connection */
  99033. case 'DConn': break;
  99034. case 'DbOrParamQry': break;
  99035. case 'DBQueryExt': break;
  99036. case 'OleDbConn': break;
  99037. case 'ExtString': break;
  99038. /* Formatting */
  99039. case 'IFmtRecord': break;
  99040. case 'CondFmt': case 'CF': case 'CF12': case 'CFEx': break;
  99041. /* Explicitly Ignored */
  99042. case 'Excel9File': break;
  99043. case 'Units': break;
  99044. case 'InterfaceHdr': case 'Mms': case 'InterfaceEnd': case 'DSF': break;
  99045. case 'BuiltInFnGroupCount': /* 2.4.30 0x0E or 0x10 but excel 2011 generates 0x11? */ break;
  99046. /* View Stuff */
  99047. case 'Window1': case 'HideObj': case 'GridSet': case 'Guts':
  99048. case 'UserBView': case 'UserSViewBegin': case 'UserSViewEnd': break;
  99049. case 'Pane': break;
  99050. default: switch(R.n) { /* nested */
  99051. /* Chart */
  99052. case 'Dat':
  99053. case 'Begin': case 'End':
  99054. case 'StartBlock': case 'EndBlock':
  99055. case 'Frame': case 'Area':
  99056. case 'Axis': case 'AxisLine': case 'Tick': break;
  99057. case 'AxesUsed':
  99058. case 'CrtLayout12': case 'CrtLayout12A': case 'CrtLink': case 'CrtLine': case 'CrtMlFrt': case 'CrtMlFrtContinue': break;
  99059. case 'LineFormat': case 'AreaFormat':
  99060. case 'Chart': case 'Chart3d': case 'Chart3DBarShape': case 'ChartFormat': case 'ChartFrtInfo': break;
  99061. case 'PlotArea': case 'PlotGrowth': break;
  99062. case 'SeriesList': case 'SerParent': case 'SerAuxTrend': break;
  99063. case 'DataFormat': case 'SerToCrt': case 'FontX': break;
  99064. case 'CatSerRange': case 'AxcExt': case 'SerFmt': break;
  99065. case 'ShtProps': break;
  99066. case 'DefaultText': case 'Text': case 'CatLab': break;
  99067. case 'DataLabExtContents': break;
  99068. case 'Legend': case 'LegendException': break;
  99069. case 'Pie': case 'Scatter': break;
  99070. case 'PieFormat': case 'MarkerFormat': break;
  99071. case 'StartObject': case 'EndObject': break;
  99072. case 'AlRuns': case 'ObjectLink': break;
  99073. case 'SIIndex': break;
  99074. case 'AttachedLabel': case 'YMult': break;
  99075. /* Chart Group */
  99076. case 'Line': case 'Bar': break;
  99077. case 'Surf': break;
  99078. /* Axis Group */
  99079. case 'AxisParent': break;
  99080. case 'Pos': break;
  99081. case 'ValueRange': break;
  99082. /* Pivot Chart */
  99083. case 'SXViewEx9': break; // TODO
  99084. case 'SXViewLink': break;
  99085. case 'PivotChartBits': break;
  99086. case 'SBaseRef': break;
  99087. case 'TextPropsStream': break;
  99088. /* Chart Misc */
  99089. case 'LnExt': break;
  99090. case 'MkrExt': break;
  99091. case 'CrtCoopt': break;
  99092. /* Query Table */
  99093. case 'Qsi': case 'Qsif': case 'Qsir': case 'QsiSXTag': break;
  99094. case 'TxtQry': break;
  99095. /* Filter */
  99096. case 'FilterMode': break;
  99097. case 'AutoFilter': case 'AutoFilterInfo': break;
  99098. case 'AutoFilter12': break;
  99099. case 'DropDownObjIds': break;
  99100. case 'Sort': break;
  99101. case 'SortData': break;
  99102. /* Drawing */
  99103. case 'ShapePropsStream': break;
  99104. case 'MsoDrawing': case 'MsoDrawingGroup': case 'MsoDrawingSelection': break;
  99105. /* Pub Stuff */
  99106. case 'WebPub': case 'AutoWebPub': break;
  99107. /* Print Stuff */
  99108. case 'HeaderFooter': case 'HFPicture': case 'PLV':
  99109. case 'HorizontalPageBreaks': case 'VerticalPageBreaks': break;
  99110. /* Behavioral */
  99111. case 'Backup': case 'CompressPictures': case 'Compat12': break;
  99112. /* Should not Happen */
  99113. case 'Continue': case 'ContinueFrt12': break;
  99114. /* Future Records */
  99115. case 'FrtFontList': case 'FrtWrapper': break;
  99116. default: switch(R.n) { /* nested */
  99117. /* BIFF5 records */
  99118. case 'TabIdConf': case 'Radar': case 'RadarArea': case 'DropBar': case 'Intl': case 'CoordList': case 'SerAuxErrBar': break;
  99119. /* BIFF2-4 records */
  99120. case 'BIFF2FONTCLR': case 'BIFF2FMTCNT': case 'BIFF2FONTXTRA': break;
  99121. case 'BIFF2XF': case 'BIFF3XF': case 'BIFF4XF': break;
  99122. case 'BIFF4FMTCNT': case 'BIFF2ROW': case 'BIFF2WINDOW2': break;
  99123. /* Miscellaneous */
  99124. case 'SCENARIO': case 'DConBin': case 'PicF': case 'DataLabExt':
  99125. case 'Lel': case 'BopPop': case 'BopPopCustom': case 'RealTimeData':
  99126. case 'Name': break;
  99127. case 'LHNGraph': case 'FnGroupName': case 'AddMenu': case 'LPr': break;
  99128. case 'ListObj': case 'ListField': break;
  99129. case 'RRSort': break;
  99130. case 'BigName': break;
  99131. case 'ToolbarHdr': case 'ToolbarEnd': break;
  99132. case 'DDEObjName': break;
  99133. case 'FRTArchId$': break;
  99134. default: if(options.WTF) throw 'Unrecognized Record ' + R.n;
  99135. }}}}
  99136. } else blob.l += length;
  99137. }
  99138. wb.SheetNames=keys(Directory).sort(function(a,b) { return Number(a) - Number(b); }).map(function(x){return Directory[x].name;});
  99139. if(!options.bookSheets) wb.Sheets=Sheets;
  99140. if(wb.Sheets) FilterDatabases.forEach(function(r,i) { wb.Sheets[wb.SheetNames[i]]['!autofilter'] = r; });
  99141. wb.Preamble=Preamble;
  99142. wb.Strings = sst;
  99143. wb.SSF = SSF.get_table();
  99144. if(opts.enc) wb.Encryption = opts.enc;
  99145. if(themes) wb.Themes = themes;
  99146. wb.Metadata = {};
  99147. if(country !== undefined) wb.Metadata.Country = country;
  99148. if(supbooks.names.length > 0) Workbook.Names = supbooks.names;
  99149. wb.Workbook = Workbook;
  99150. return wb;
  99151. }
  99152. /* TODO: split props*/
  99153. var PSCLSID = {
  99154. SI: "e0859ff2f94f6810ab9108002b27b3d9",
  99155. DSI: "02d5cdd59c2e1b10939708002b2cf9ae",
  99156. UDI: "05d5cdd59c2e1b10939708002b2cf9ae"
  99157. };
  99158. function parse_xls_props(cfb, props, o) {
  99159. /* [MS-OSHARED] 2.3.3.2.2 Document Summary Information Property Set */
  99160. var DSI = CFB.find(cfb, '!DocumentSummaryInformation');
  99161. if(DSI && DSI.size > 0) try {
  99162. var DocSummary = parse_PropertySetStream(DSI, DocSummaryPIDDSI, PSCLSID.DSI);
  99163. for(var d in DocSummary) props[d] = DocSummary[d];
  99164. } catch(e) {if(o.WTF) throw e;/* empty */}
  99165. /* [MS-OSHARED] 2.3.3.2.1 Summary Information Property Set*/
  99166. var SI = CFB.find(cfb, '!SummaryInformation');
  99167. if(SI && SI.size > 0) try {
  99168. var Summary = parse_PropertySetStream(SI, SummaryPIDSI, PSCLSID.SI);
  99169. for(var s in Summary) if(props[s] == null) props[s] = Summary[s];
  99170. } catch(e) {if(o.WTF) throw e;/* empty */}
  99171. if(props.HeadingPairs && props.TitlesOfParts) {
  99172. load_props_pairs(props.HeadingPairs, props.TitlesOfParts, props, o);
  99173. delete props.HeadingPairs; delete props.TitlesOfParts;
  99174. }
  99175. }
  99176. function write_xls_props(wb, cfb) {
  99177. var DSEntries = [], SEntries = [], CEntries = [];
  99178. var i = 0, Keys;
  99179. if(wb.Props) {
  99180. Keys = keys(wb.Props);
  99181. // $FlowIgnore
  99182. for(i = 0; i < Keys.length; ++i) (DocSummaryRE.hasOwnProperty(Keys[i]) ? DSEntries : SummaryRE.hasOwnProperty(Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Props[Keys[i]]]);
  99183. }
  99184. if(wb.Custprops) {
  99185. Keys = keys(wb.Custprops);
  99186. // $FlowIgnore
  99187. for(i = 0; i < Keys.length; ++i) if(!(wb.Props||{}).hasOwnProperty(Keys[i])) (DocSummaryRE.hasOwnProperty(Keys[i]) ? DSEntries : SummaryRE.hasOwnProperty(Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Custprops[Keys[i]]]);
  99188. }
  99189. var CEntries2 = [];
  99190. for(i = 0; i < CEntries.length; ++i) {
  99191. if(XLSPSSkip.indexOf(CEntries[i][0]) > -1) continue;
  99192. if(CEntries[i][1] == null) continue;
  99193. CEntries2.push(CEntries[i]);
  99194. }
  99195. if(SEntries.length) CFB.utils.cfb_add(cfb, "/\u0005SummaryInformation", write_PropertySetStream(SEntries, PSCLSID.SI, SummaryRE, SummaryPIDSI));
  99196. if(DSEntries.length || CEntries2.length) CFB.utils.cfb_add(cfb, "/\u0005DocumentSummaryInformation", write_PropertySetStream(DSEntries, PSCLSID.DSI, DocSummaryRE, DocSummaryPIDDSI, CEntries2.length ? CEntries2 : null, PSCLSID.UDI));
  99197. }
  99198. function parse_xlscfb(cfb, options) {
  99199. if(!options) options = {};
  99200. fix_read_opts(options);
  99201. reset_cp();
  99202. if(options.codepage) set_ansi(options.codepage);
  99203. var CompObj, WB;
  99204. if(cfb.FullPaths) {
  99205. if(CFB.find(cfb, '/encryption')) throw new Error("File is password-protected");
  99206. CompObj = CFB.find(cfb, '!CompObj');
  99207. WB = CFB.find(cfb, '/Workbook') || CFB.find(cfb, '/Book');
  99208. } else {
  99209. switch(options.type) {
  99210. case 'base64': cfb = s2a(Base64.decode(cfb)); break;
  99211. case 'binary': cfb = s2a(cfb); break;
  99212. case 'buffer': break;
  99213. case 'array': if(!Array.isArray(cfb)) cfb = Array.prototype.slice.call(cfb); break;
  99214. }
  99215. prep_blob(cfb, 0);
  99216. WB = ({content: cfb});
  99217. }
  99218. var WorkbookP;
  99219. var _data;
  99220. if(CompObj) parse_compobj(CompObj);
  99221. if(options.bookProps && !options.bookSheets) WorkbookP = ({});
  99222. else {
  99223. var T = has_buf ? 'buffer' : 'array';
  99224. if(WB && WB.content) WorkbookP = parse_workbook(WB.content, options);
  99225. /* Quattro Pro 7-8 */
  99226. else if((_data=CFB.find(cfb, 'PerfectOffice_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));
  99227. /* Quattro Pro 9 */
  99228. else if((_data=CFB.find(cfb, 'NativeContent_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));
  99229. else throw new Error("Cannot find Workbook stream");
  99230. if(options.bookVBA && cfb.FullPaths && CFB.find(cfb, '/_VBA_PROJECT_CUR/VBA/dir')) WorkbookP.vbaraw = make_vba_xls(cfb);
  99231. }
  99232. var props = {};
  99233. if(cfb.FullPaths) parse_xls_props(cfb, props, options);
  99234. WorkbookP.Props = WorkbookP.Custprops = props; /* TODO: split up properties */
  99235. if(options.bookFiles) WorkbookP.cfb = cfb;
  99236. /*WorkbookP.CompObjP = CompObjP; // TODO: storage? */
  99237. return WorkbookP;
  99238. }
  99239. function write_xlscfb(wb, opts) {
  99240. var o = opts || {};
  99241. var cfb = CFB.utils.cfb_new({root:"R"});
  99242. var wbpath = "/Workbook";
  99243. switch(o.bookType || "xls") {
  99244. case "xls": o.bookType = "biff8";
  99245. /* falls through */
  99246. case "xla": if(!o.bookType) o.bookType = "xla";
  99247. /* falls through */
  99248. case "biff8": wbpath = "/Workbook"; o.biff = 8; break;
  99249. case "biff5": wbpath = "/Book"; o.biff = 5; break;
  99250. default: throw new Error("invalid type " + o.bookType + " for XLS CFB");
  99251. }
  99252. CFB.utils.cfb_add(cfb, wbpath, write_biff_buf(wb, o));
  99253. if(o.biff == 8 && (wb.Props || wb.Custprops)) write_xls_props(wb, cfb);
  99254. // TODO: SI, DSI, CO
  99255. if(o.biff == 8 && wb.vbaraw) fill_vba_xls(cfb, CFB.read(wb.vbaraw, {type: typeof wb.vbaraw == "string" ? "binary" : "buffer"}));
  99256. return cfb;
  99257. }
  99258. /* [MS-XLSB] 2.3 Record Enumeration */
  99259. var XLSBRecordEnum = {
  99260. 0x0000: { n:"BrtRowHdr", f:parse_BrtRowHdr },
  99261. 0x0001: { n:"BrtCellBlank", f:parse_BrtCellBlank },
  99262. 0x0002: { n:"BrtCellRk", f:parse_BrtCellRk },
  99263. 0x0003: { n:"BrtCellError", f:parse_BrtCellError },
  99264. 0x0004: { n:"BrtCellBool", f:parse_BrtCellBool },
  99265. 0x0005: { n:"BrtCellReal", f:parse_BrtCellReal },
  99266. 0x0006: { n:"BrtCellSt", f:parse_BrtCellSt },
  99267. 0x0007: { n:"BrtCellIsst", f:parse_BrtCellIsst },
  99268. 0x0008: { n:"BrtFmlaString", f:parse_BrtFmlaString },
  99269. 0x0009: { n:"BrtFmlaNum", f:parse_BrtFmlaNum },
  99270. 0x000A: { n:"BrtFmlaBool", f:parse_BrtFmlaBool },
  99271. 0x000B: { n:"BrtFmlaError", f:parse_BrtFmlaError },
  99272. 0x0010: { n:"BrtFRTArchID$", f:parse_BrtFRTArchID$ },
  99273. 0x0013: { n:"BrtSSTItem", f:parse_RichStr },
  99274. 0x0014: { n:"BrtPCDIMissing" },
  99275. 0x0015: { n:"BrtPCDINumber" },
  99276. 0x0016: { n:"BrtPCDIBoolean" },
  99277. 0x0017: { n:"BrtPCDIError" },
  99278. 0x0018: { n:"BrtPCDIString" },
  99279. 0x0019: { n:"BrtPCDIDatetime" },
  99280. 0x001A: { n:"BrtPCDIIndex" },
  99281. 0x001B: { n:"BrtPCDIAMissing" },
  99282. 0x001C: { n:"BrtPCDIANumber" },
  99283. 0x001D: { n:"BrtPCDIABoolean" },
  99284. 0x001E: { n:"BrtPCDIAError" },
  99285. 0x001F: { n:"BrtPCDIAString" },
  99286. 0x0020: { n:"BrtPCDIADatetime" },
  99287. 0x0021: { n:"BrtPCRRecord" },
  99288. 0x0022: { n:"BrtPCRRecordDt" },
  99289. 0x0023: { n:"BrtFRTBegin" },
  99290. 0x0024: { n:"BrtFRTEnd" },
  99291. 0x0025: { n:"BrtACBegin" },
  99292. 0x0026: { n:"BrtACEnd" },
  99293. 0x0027: { n:"BrtName", f:parse_BrtName },
  99294. 0x0028: { n:"BrtIndexRowBlock" },
  99295. 0x002A: { n:"BrtIndexBlock" },
  99296. 0x002B: { n:"BrtFont", f:parse_BrtFont },
  99297. 0x002C: { n:"BrtFmt", f:parse_BrtFmt },
  99298. 0x002D: { n:"BrtFill", f:parse_BrtFill },
  99299. 0x002E: { n:"BrtBorder", f:parse_BrtBorder },
  99300. 0x002F: { n:"BrtXF", f:parse_BrtXF },
  99301. 0x0030: { n:"BrtStyle" },
  99302. 0x0031: { n:"BrtCellMeta" },
  99303. 0x0032: { n:"BrtValueMeta" },
  99304. 0x0033: { n:"BrtMdb" },
  99305. 0x0034: { n:"BrtBeginFmd" },
  99306. 0x0035: { n:"BrtEndFmd" },
  99307. 0x0036: { n:"BrtBeginMdx" },
  99308. 0x0037: { n:"BrtEndMdx" },
  99309. 0x0038: { n:"BrtBeginMdxTuple" },
  99310. 0x0039: { n:"BrtEndMdxTuple" },
  99311. 0x003A: { n:"BrtMdxMbrIstr" },
  99312. 0x003B: { n:"BrtStr" },
  99313. 0x003C: { n:"BrtColInfo", f:parse_ColInfo },
  99314. 0x003E: { n:"BrtCellRString" },
  99315. 0x003F: { n:"BrtCalcChainItem$", f:parse_BrtCalcChainItem$ },
  99316. 0x0040: { n:"BrtDVal", f:parse_BrtDVal },
  99317. 0x0041: { n:"BrtSxvcellNum" },
  99318. 0x0042: { n:"BrtSxvcellStr" },
  99319. 0x0043: { n:"BrtSxvcellBool" },
  99320. 0x0044: { n:"BrtSxvcellErr" },
  99321. 0x0045: { n:"BrtSxvcellDate" },
  99322. 0x0046: { n:"BrtSxvcellNil" },
  99323. 0x0080: { n:"BrtFileVersion" },
  99324. 0x0081: { n:"BrtBeginSheet" },
  99325. 0x0082: { n:"BrtEndSheet" },
  99326. 0x0083: { n:"BrtBeginBook", f:parsenoop, p:0 },
  99327. 0x0084: { n:"BrtEndBook" },
  99328. 0x0085: { n:"BrtBeginWsViews" },
  99329. 0x0086: { n:"BrtEndWsViews" },
  99330. 0x0087: { n:"BrtBeginBookViews" },
  99331. 0x0088: { n:"BrtEndBookViews" },
  99332. 0x0089: { n:"BrtBeginWsView", f:parse_BrtBeginWsView },
  99333. 0x008A: { n:"BrtEndWsView" },
  99334. 0x008B: { n:"BrtBeginCsViews" },
  99335. 0x008C: { n:"BrtEndCsViews" },
  99336. 0x008D: { n:"BrtBeginCsView" },
  99337. 0x008E: { n:"BrtEndCsView" },
  99338. 0x008F: { n:"BrtBeginBundleShs" },
  99339. 0x0090: { n:"BrtEndBundleShs" },
  99340. 0x0091: { n:"BrtBeginSheetData" },
  99341. 0x0092: { n:"BrtEndSheetData" },
  99342. 0x0093: { n:"BrtWsProp", f:parse_BrtWsProp },
  99343. 0x0094: { n:"BrtWsDim", f:parse_BrtWsDim, p:16 },
  99344. 0x0097: { n:"BrtPane", f:parse_BrtPane },
  99345. 0x0098: { n:"BrtSel" },
  99346. 0x0099: { n:"BrtWbProp", f:parse_BrtWbProp },
  99347. 0x009A: { n:"BrtWbFactoid" },
  99348. 0x009B: { n:"BrtFileRecover" },
  99349. 0x009C: { n:"BrtBundleSh", f:parse_BrtBundleSh },
  99350. 0x009D: { n:"BrtCalcProp" },
  99351. 0x009E: { n:"BrtBookView" },
  99352. 0x009F: { n:"BrtBeginSst", f:parse_BrtBeginSst },
  99353. 0x00A0: { n:"BrtEndSst" },
  99354. 0x00A1: { n:"BrtBeginAFilter", f:parse_UncheckedRfX },
  99355. 0x00A2: { n:"BrtEndAFilter" },
  99356. 0x00A3: { n:"BrtBeginFilterColumn" },
  99357. 0x00A4: { n:"BrtEndFilterColumn" },
  99358. 0x00A5: { n:"BrtBeginFilters" },
  99359. 0x00A6: { n:"BrtEndFilters" },
  99360. 0x00A7: { n:"BrtFilter" },
  99361. 0x00A8: { n:"BrtColorFilter" },
  99362. 0x00A9: { n:"BrtIconFilter" },
  99363. 0x00AA: { n:"BrtTop10Filter" },
  99364. 0x00AB: { n:"BrtDynamicFilter" },
  99365. 0x00AC: { n:"BrtBeginCustomFilters" },
  99366. 0x00AD: { n:"BrtEndCustomFilters" },
  99367. 0x00AE: { n:"BrtCustomFilter" },
  99368. 0x00AF: { n:"BrtAFilterDateGroupItem" },
  99369. 0x00B0: { n:"BrtMergeCell", f:parse_BrtMergeCell },
  99370. 0x00B1: { n:"BrtBeginMergeCells" },
  99371. 0x00B2: { n:"BrtEndMergeCells" },
  99372. 0x00B3: { n:"BrtBeginPivotCacheDef" },
  99373. 0x00B4: { n:"BrtEndPivotCacheDef" },
  99374. 0x00B5: { n:"BrtBeginPCDFields" },
  99375. 0x00B6: { n:"BrtEndPCDFields" },
  99376. 0x00B7: { n:"BrtBeginPCDField" },
  99377. 0x00B8: { n:"BrtEndPCDField" },
  99378. 0x00B9: { n:"BrtBeginPCDSource" },
  99379. 0x00BA: { n:"BrtEndPCDSource" },
  99380. 0x00BB: { n:"BrtBeginPCDSRange" },
  99381. 0x00BC: { n:"BrtEndPCDSRange" },
  99382. 0x00BD: { n:"BrtBeginPCDFAtbl" },
  99383. 0x00BE: { n:"BrtEndPCDFAtbl" },
  99384. 0x00BF: { n:"BrtBeginPCDIRun" },
  99385. 0x00C0: { n:"BrtEndPCDIRun" },
  99386. 0x00C1: { n:"BrtBeginPivotCacheRecords" },
  99387. 0x00C2: { n:"BrtEndPivotCacheRecords" },
  99388. 0x00C3: { n:"BrtBeginPCDHierarchies" },
  99389. 0x00C4: { n:"BrtEndPCDHierarchies" },
  99390. 0x00C5: { n:"BrtBeginPCDHierarchy" },
  99391. 0x00C6: { n:"BrtEndPCDHierarchy" },
  99392. 0x00C7: { n:"BrtBeginPCDHFieldsUsage" },
  99393. 0x00C8: { n:"BrtEndPCDHFieldsUsage" },
  99394. 0x00C9: { n:"BrtBeginExtConnection" },
  99395. 0x00CA: { n:"BrtEndExtConnection" },
  99396. 0x00CB: { n:"BrtBeginECDbProps" },
  99397. 0x00CC: { n:"BrtEndECDbProps" },
  99398. 0x00CD: { n:"BrtBeginECOlapProps" },
  99399. 0x00CE: { n:"BrtEndECOlapProps" },
  99400. 0x00CF: { n:"BrtBeginPCDSConsol" },
  99401. 0x00D0: { n:"BrtEndPCDSConsol" },
  99402. 0x00D1: { n:"BrtBeginPCDSCPages" },
  99403. 0x00D2: { n:"BrtEndPCDSCPages" },
  99404. 0x00D3: { n:"BrtBeginPCDSCPage" },
  99405. 0x00D4: { n:"BrtEndPCDSCPage" },
  99406. 0x00D5: { n:"BrtBeginPCDSCPItem" },
  99407. 0x00D6: { n:"BrtEndPCDSCPItem" },
  99408. 0x00D7: { n:"BrtBeginPCDSCSets" },
  99409. 0x00D8: { n:"BrtEndPCDSCSets" },
  99410. 0x00D9: { n:"BrtBeginPCDSCSet" },
  99411. 0x00DA: { n:"BrtEndPCDSCSet" },
  99412. 0x00DB: { n:"BrtBeginPCDFGroup" },
  99413. 0x00DC: { n:"BrtEndPCDFGroup" },
  99414. 0x00DD: { n:"BrtBeginPCDFGItems" },
  99415. 0x00DE: { n:"BrtEndPCDFGItems" },
  99416. 0x00DF: { n:"BrtBeginPCDFGRange" },
  99417. 0x00E0: { n:"BrtEndPCDFGRange" },
  99418. 0x00E1: { n:"BrtBeginPCDFGDiscrete" },
  99419. 0x00E2: { n:"BrtEndPCDFGDiscrete" },
  99420. 0x00E3: { n:"BrtBeginPCDSDTupleCache" },
  99421. 0x00E4: { n:"BrtEndPCDSDTupleCache" },
  99422. 0x00E5: { n:"BrtBeginPCDSDTCEntries" },
  99423. 0x00E6: { n:"BrtEndPCDSDTCEntries" },
  99424. 0x00E7: { n:"BrtBeginPCDSDTCEMembers" },
  99425. 0x00E8: { n:"BrtEndPCDSDTCEMembers" },
  99426. 0x00E9: { n:"BrtBeginPCDSDTCEMember" },
  99427. 0x00EA: { n:"BrtEndPCDSDTCEMember" },
  99428. 0x00EB: { n:"BrtBeginPCDSDTCQueries" },
  99429. 0x00EC: { n:"BrtEndPCDSDTCQueries" },
  99430. 0x00ED: { n:"BrtBeginPCDSDTCQuery" },
  99431. 0x00EE: { n:"BrtEndPCDSDTCQuery" },
  99432. 0x00EF: { n:"BrtBeginPCDSDTCSets" },
  99433. 0x00F0: { n:"BrtEndPCDSDTCSets" },
  99434. 0x00F1: { n:"BrtBeginPCDSDTCSet" },
  99435. 0x00F2: { n:"BrtEndPCDSDTCSet" },
  99436. 0x00F3: { n:"BrtBeginPCDCalcItems" },
  99437. 0x00F4: { n:"BrtEndPCDCalcItems" },
  99438. 0x00F5: { n:"BrtBeginPCDCalcItem" },
  99439. 0x00F6: { n:"BrtEndPCDCalcItem" },
  99440. 0x00F7: { n:"BrtBeginPRule" },
  99441. 0x00F8: { n:"BrtEndPRule" },
  99442. 0x00F9: { n:"BrtBeginPRFilters" },
  99443. 0x00FA: { n:"BrtEndPRFilters" },
  99444. 0x00FB: { n:"BrtBeginPRFilter" },
  99445. 0x00FC: { n:"BrtEndPRFilter" },
  99446. 0x00FD: { n:"BrtBeginPNames" },
  99447. 0x00FE: { n:"BrtEndPNames" },
  99448. 0x00FF: { n:"BrtBeginPName" },
  99449. 0x0100: { n:"BrtEndPName" },
  99450. 0x0101: { n:"BrtBeginPNPairs" },
  99451. 0x0102: { n:"BrtEndPNPairs" },
  99452. 0x0103: { n:"BrtBeginPNPair" },
  99453. 0x0104: { n:"BrtEndPNPair" },
  99454. 0x0105: { n:"BrtBeginECWebProps" },
  99455. 0x0106: { n:"BrtEndECWebProps" },
  99456. 0x0107: { n:"BrtBeginEcWpTables" },
  99457. 0x0108: { n:"BrtEndECWPTables" },
  99458. 0x0109: { n:"BrtBeginECParams" },
  99459. 0x010A: { n:"BrtEndECParams" },
  99460. 0x010B: { n:"BrtBeginECParam" },
  99461. 0x010C: { n:"BrtEndECParam" },
  99462. 0x010D: { n:"BrtBeginPCDKPIs" },
  99463. 0x010E: { n:"BrtEndPCDKPIs" },
  99464. 0x010F: { n:"BrtBeginPCDKPI" },
  99465. 0x0110: { n:"BrtEndPCDKPI" },
  99466. 0x0111: { n:"BrtBeginDims" },
  99467. 0x0112: { n:"BrtEndDims" },
  99468. 0x0113: { n:"BrtBeginDim" },
  99469. 0x0114: { n:"BrtEndDim" },
  99470. 0x0115: { n:"BrtIndexPartEnd" },
  99471. 0x0116: { n:"BrtBeginStyleSheet" },
  99472. 0x0117: { n:"BrtEndStyleSheet" },
  99473. 0x0118: { n:"BrtBeginSXView" },
  99474. 0x0119: { n:"BrtEndSXVI" },
  99475. 0x011A: { n:"BrtBeginSXVI" },
  99476. 0x011B: { n:"BrtBeginSXVIs" },
  99477. 0x011C: { n:"BrtEndSXVIs" },
  99478. 0x011D: { n:"BrtBeginSXVD" },
  99479. 0x011E: { n:"BrtEndSXVD" },
  99480. 0x011F: { n:"BrtBeginSXVDs" },
  99481. 0x0120: { n:"BrtEndSXVDs" },
  99482. 0x0121: { n:"BrtBeginSXPI" },
  99483. 0x0122: { n:"BrtEndSXPI" },
  99484. 0x0123: { n:"BrtBeginSXPIs" },
  99485. 0x0124: { n:"BrtEndSXPIs" },
  99486. 0x0125: { n:"BrtBeginSXDI" },
  99487. 0x0126: { n:"BrtEndSXDI" },
  99488. 0x0127: { n:"BrtBeginSXDIs" },
  99489. 0x0128: { n:"BrtEndSXDIs" },
  99490. 0x0129: { n:"BrtBeginSXLI" },
  99491. 0x012A: { n:"BrtEndSXLI" },
  99492. 0x012B: { n:"BrtBeginSXLIRws" },
  99493. 0x012C: { n:"BrtEndSXLIRws" },
  99494. 0x012D: { n:"BrtBeginSXLICols" },
  99495. 0x012E: { n:"BrtEndSXLICols" },
  99496. 0x012F: { n:"BrtBeginSXFormat" },
  99497. 0x0130: { n:"BrtEndSXFormat" },
  99498. 0x0131: { n:"BrtBeginSXFormats" },
  99499. 0x0132: { n:"BrtEndSxFormats" },
  99500. 0x0133: { n:"BrtBeginSxSelect" },
  99501. 0x0134: { n:"BrtEndSxSelect" },
  99502. 0x0135: { n:"BrtBeginISXVDRws" },
  99503. 0x0136: { n:"BrtEndISXVDRws" },
  99504. 0x0137: { n:"BrtBeginISXVDCols" },
  99505. 0x0138: { n:"BrtEndISXVDCols" },
  99506. 0x0139: { n:"BrtEndSXLocation" },
  99507. 0x013A: { n:"BrtBeginSXLocation" },
  99508. 0x013B: { n:"BrtEndSXView" },
  99509. 0x013C: { n:"BrtBeginSXTHs" },
  99510. 0x013D: { n:"BrtEndSXTHs" },
  99511. 0x013E: { n:"BrtBeginSXTH" },
  99512. 0x013F: { n:"BrtEndSXTH" },
  99513. 0x0140: { n:"BrtBeginISXTHRws" },
  99514. 0x0141: { n:"BrtEndISXTHRws" },
  99515. 0x0142: { n:"BrtBeginISXTHCols" },
  99516. 0x0143: { n:"BrtEndISXTHCols" },
  99517. 0x0144: { n:"BrtBeginSXTDMPS" },
  99518. 0x0145: { n:"BrtEndSXTDMPs" },
  99519. 0x0146: { n:"BrtBeginSXTDMP" },
  99520. 0x0147: { n:"BrtEndSXTDMP" },
  99521. 0x0148: { n:"BrtBeginSXTHItems" },
  99522. 0x0149: { n:"BrtEndSXTHItems" },
  99523. 0x014A: { n:"BrtBeginSXTHItem" },
  99524. 0x014B: { n:"BrtEndSXTHItem" },
  99525. 0x014C: { n:"BrtBeginMetadata" },
  99526. 0x014D: { n:"BrtEndMetadata" },
  99527. 0x014E: { n:"BrtBeginEsmdtinfo" },
  99528. 0x014F: { n:"BrtMdtinfo" },
  99529. 0x0150: { n:"BrtEndEsmdtinfo" },
  99530. 0x0151: { n:"BrtBeginEsmdb" },
  99531. 0x0152: { n:"BrtEndEsmdb" },
  99532. 0x0153: { n:"BrtBeginEsfmd" },
  99533. 0x0154: { n:"BrtEndEsfmd" },
  99534. 0x0155: { n:"BrtBeginSingleCells" },
  99535. 0x0156: { n:"BrtEndSingleCells" },
  99536. 0x0157: { n:"BrtBeginList" },
  99537. 0x0158: { n:"BrtEndList" },
  99538. 0x0159: { n:"BrtBeginListCols" },
  99539. 0x015A: { n:"BrtEndListCols" },
  99540. 0x015B: { n:"BrtBeginListCol" },
  99541. 0x015C: { n:"BrtEndListCol" },
  99542. 0x015D: { n:"BrtBeginListXmlCPr" },
  99543. 0x015E: { n:"BrtEndListXmlCPr" },
  99544. 0x015F: { n:"BrtListCCFmla" },
  99545. 0x0160: { n:"BrtListTrFmla" },
  99546. 0x0161: { n:"BrtBeginExternals" },
  99547. 0x0162: { n:"BrtEndExternals" },
  99548. 0x0163: { n:"BrtSupBookSrc", f:parse_RelID},
  99549. 0x0165: { n:"BrtSupSelf" },
  99550. 0x0166: { n:"BrtSupSame" },
  99551. 0x0167: { n:"BrtSupTabs" },
  99552. 0x0168: { n:"BrtBeginSupBook" },
  99553. 0x0169: { n:"BrtPlaceholderName" },
  99554. 0x016A: { n:"BrtExternSheet", f:parse_ExternSheet },
  99555. 0x016B: { n:"BrtExternTableStart" },
  99556. 0x016C: { n:"BrtExternTableEnd" },
  99557. 0x016E: { n:"BrtExternRowHdr" },
  99558. 0x016F: { n:"BrtExternCellBlank" },
  99559. 0x0170: { n:"BrtExternCellReal" },
  99560. 0x0171: { n:"BrtExternCellBool" },
  99561. 0x0172: { n:"BrtExternCellError" },
  99562. 0x0173: { n:"BrtExternCellString" },
  99563. 0x0174: { n:"BrtBeginEsmdx" },
  99564. 0x0175: { n:"BrtEndEsmdx" },
  99565. 0x0176: { n:"BrtBeginMdxSet" },
  99566. 0x0177: { n:"BrtEndMdxSet" },
  99567. 0x0178: { n:"BrtBeginMdxMbrProp" },
  99568. 0x0179: { n:"BrtEndMdxMbrProp" },
  99569. 0x017A: { n:"BrtBeginMdxKPI" },
  99570. 0x017B: { n:"BrtEndMdxKPI" },
  99571. 0x017C: { n:"BrtBeginEsstr" },
  99572. 0x017D: { n:"BrtEndEsstr" },
  99573. 0x017E: { n:"BrtBeginPRFItem" },
  99574. 0x017F: { n:"BrtEndPRFItem" },
  99575. 0x0180: { n:"BrtBeginPivotCacheIDs" },
  99576. 0x0181: { n:"BrtEndPivotCacheIDs" },
  99577. 0x0182: { n:"BrtBeginPivotCacheID" },
  99578. 0x0183: { n:"BrtEndPivotCacheID" },
  99579. 0x0184: { n:"BrtBeginISXVIs" },
  99580. 0x0185: { n:"BrtEndISXVIs" },
  99581. 0x0186: { n:"BrtBeginColInfos" },
  99582. 0x0187: { n:"BrtEndColInfos" },
  99583. 0x0188: { n:"BrtBeginRwBrk" },
  99584. 0x0189: { n:"BrtEndRwBrk" },
  99585. 0x018A: { n:"BrtBeginColBrk" },
  99586. 0x018B: { n:"BrtEndColBrk" },
  99587. 0x018C: { n:"BrtBrk" },
  99588. 0x018D: { n:"BrtUserBookView" },
  99589. 0x018E: { n:"BrtInfo" },
  99590. 0x018F: { n:"BrtCUsr" },
  99591. 0x0190: { n:"BrtUsr" },
  99592. 0x0191: { n:"BrtBeginUsers" },
  99593. 0x0193: { n:"BrtEOF" },
  99594. 0x0194: { n:"BrtUCR" },
  99595. 0x0195: { n:"BrtRRInsDel" },
  99596. 0x0196: { n:"BrtRREndInsDel" },
  99597. 0x0197: { n:"BrtRRMove" },
  99598. 0x0198: { n:"BrtRREndMove" },
  99599. 0x0199: { n:"BrtRRChgCell" },
  99600. 0x019A: { n:"BrtRREndChgCell" },
  99601. 0x019B: { n:"BrtRRHeader" },
  99602. 0x019C: { n:"BrtRRUserView" },
  99603. 0x019D: { n:"BrtRRRenSheet" },
  99604. 0x019E: { n:"BrtRRInsertSh" },
  99605. 0x019F: { n:"BrtRRDefName" },
  99606. 0x01A0: { n:"BrtRRNote" },
  99607. 0x01A1: { n:"BrtRRConflict" },
  99608. 0x01A2: { n:"BrtRRTQSIF" },
  99609. 0x01A3: { n:"BrtRRFormat" },
  99610. 0x01A4: { n:"BrtRREndFormat" },
  99611. 0x01A5: { n:"BrtRRAutoFmt" },
  99612. 0x01A6: { n:"BrtBeginUserShViews" },
  99613. 0x01A7: { n:"BrtBeginUserShView" },
  99614. 0x01A8: { n:"BrtEndUserShView" },
  99615. 0x01A9: { n:"BrtEndUserShViews" },
  99616. 0x01AA: { n:"BrtArrFmla", f:parse_BrtArrFmla },
  99617. 0x01AB: { n:"BrtShrFmla", f:parse_BrtShrFmla },
  99618. 0x01AC: { n:"BrtTable" },
  99619. 0x01AD: { n:"BrtBeginExtConnections" },
  99620. 0x01AE: { n:"BrtEndExtConnections" },
  99621. 0x01AF: { n:"BrtBeginPCDCalcMems" },
  99622. 0x01B0: { n:"BrtEndPCDCalcMems" },
  99623. 0x01B1: { n:"BrtBeginPCDCalcMem" },
  99624. 0x01B2: { n:"BrtEndPCDCalcMem" },
  99625. 0x01B3: { n:"BrtBeginPCDHGLevels" },
  99626. 0x01B4: { n:"BrtEndPCDHGLevels" },
  99627. 0x01B5: { n:"BrtBeginPCDHGLevel" },
  99628. 0x01B6: { n:"BrtEndPCDHGLevel" },
  99629. 0x01B7: { n:"BrtBeginPCDHGLGroups" },
  99630. 0x01B8: { n:"BrtEndPCDHGLGroups" },
  99631. 0x01B9: { n:"BrtBeginPCDHGLGroup" },
  99632. 0x01BA: { n:"BrtEndPCDHGLGroup" },
  99633. 0x01BB: { n:"BrtBeginPCDHGLGMembers" },
  99634. 0x01BC: { n:"BrtEndPCDHGLGMembers" },
  99635. 0x01BD: { n:"BrtBeginPCDHGLGMember" },
  99636. 0x01BE: { n:"BrtEndPCDHGLGMember" },
  99637. 0x01BF: { n:"BrtBeginQSI" },
  99638. 0x01C0: { n:"BrtEndQSI" },
  99639. 0x01C1: { n:"BrtBeginQSIR" },
  99640. 0x01C2: { n:"BrtEndQSIR" },
  99641. 0x01C3: { n:"BrtBeginDeletedNames" },
  99642. 0x01C4: { n:"BrtEndDeletedNames" },
  99643. 0x01C5: { n:"BrtBeginDeletedName" },
  99644. 0x01C6: { n:"BrtEndDeletedName" },
  99645. 0x01C7: { n:"BrtBeginQSIFs" },
  99646. 0x01C8: { n:"BrtEndQSIFs" },
  99647. 0x01C9: { n:"BrtBeginQSIF" },
  99648. 0x01CA: { n:"BrtEndQSIF" },
  99649. 0x01CB: { n:"BrtBeginAutoSortScope" },
  99650. 0x01CC: { n:"BrtEndAutoSortScope" },
  99651. 0x01CD: { n:"BrtBeginConditionalFormatting" },
  99652. 0x01CE: { n:"BrtEndConditionalFormatting" },
  99653. 0x01CF: { n:"BrtBeginCFRule" },
  99654. 0x01D0: { n:"BrtEndCFRule" },
  99655. 0x01D1: { n:"BrtBeginIconSet" },
  99656. 0x01D2: { n:"BrtEndIconSet" },
  99657. 0x01D3: { n:"BrtBeginDatabar" },
  99658. 0x01D4: { n:"BrtEndDatabar" },
  99659. 0x01D5: { n:"BrtBeginColorScale" },
  99660. 0x01D6: { n:"BrtEndColorScale" },
  99661. 0x01D7: { n:"BrtCFVO" },
  99662. 0x01D8: { n:"BrtExternValueMeta" },
  99663. 0x01D9: { n:"BrtBeginColorPalette" },
  99664. 0x01DA: { n:"BrtEndColorPalette" },
  99665. 0x01DB: { n:"BrtIndexedColor" },
  99666. 0x01DC: { n:"BrtMargins", f:parse_BrtMargins },
  99667. 0x01DD: { n:"BrtPrintOptions" },
  99668. 0x01DE: { n:"BrtPageSetup" },
  99669. 0x01DF: { n:"BrtBeginHeaderFooter" },
  99670. 0x01E0: { n:"BrtEndHeaderFooter" },
  99671. 0x01E1: { n:"BrtBeginSXCrtFormat" },
  99672. 0x01E2: { n:"BrtEndSXCrtFormat" },
  99673. 0x01E3: { n:"BrtBeginSXCrtFormats" },
  99674. 0x01E4: { n:"BrtEndSXCrtFormats" },
  99675. 0x01E5: { n:"BrtWsFmtInfo", f:parse_BrtWsFmtInfo },
  99676. 0x01E6: { n:"BrtBeginMgs" },
  99677. 0x01E7: { n:"BrtEndMGs" },
  99678. 0x01E8: { n:"BrtBeginMGMaps" },
  99679. 0x01E9: { n:"BrtEndMGMaps" },
  99680. 0x01EA: { n:"BrtBeginMG" },
  99681. 0x01EB: { n:"BrtEndMG" },
  99682. 0x01EC: { n:"BrtBeginMap" },
  99683. 0x01ED: { n:"BrtEndMap" },
  99684. 0x01EE: { n:"BrtHLink", f:parse_BrtHLink },
  99685. 0x01EF: { n:"BrtBeginDCon" },
  99686. 0x01F0: { n:"BrtEndDCon" },
  99687. 0x01F1: { n:"BrtBeginDRefs" },
  99688. 0x01F2: { n:"BrtEndDRefs" },
  99689. 0x01F3: { n:"BrtDRef" },
  99690. 0x01F4: { n:"BrtBeginScenMan" },
  99691. 0x01F5: { n:"BrtEndScenMan" },
  99692. 0x01F6: { n:"BrtBeginSct" },
  99693. 0x01F7: { n:"BrtEndSct" },
  99694. 0x01F8: { n:"BrtSlc" },
  99695. 0x01F9: { n:"BrtBeginDXFs" },
  99696. 0x01FA: { n:"BrtEndDXFs" },
  99697. 0x01FB: { n:"BrtDXF" },
  99698. 0x01FC: { n:"BrtBeginTableStyles" },
  99699. 0x01FD: { n:"BrtEndTableStyles" },
  99700. 0x01FE: { n:"BrtBeginTableStyle" },
  99701. 0x01FF: { n:"BrtEndTableStyle" },
  99702. 0x0200: { n:"BrtTableStyleElement" },
  99703. 0x0201: { n:"BrtTableStyleClient" },
  99704. 0x0202: { n:"BrtBeginVolDeps" },
  99705. 0x0203: { n:"BrtEndVolDeps" },
  99706. 0x0204: { n:"BrtBeginVolType" },
  99707. 0x0205: { n:"BrtEndVolType" },
  99708. 0x0206: { n:"BrtBeginVolMain" },
  99709. 0x0207: { n:"BrtEndVolMain" },
  99710. 0x0208: { n:"BrtBeginVolTopic" },
  99711. 0x0209: { n:"BrtEndVolTopic" },
  99712. 0x020A: { n:"BrtVolSubtopic" },
  99713. 0x020B: { n:"BrtVolRef" },
  99714. 0x020C: { n:"BrtVolNum" },
  99715. 0x020D: { n:"BrtVolErr" },
  99716. 0x020E: { n:"BrtVolStr" },
  99717. 0x020F: { n:"BrtVolBool" },
  99718. 0x0210: { n:"BrtBeginCalcChain$" },
  99719. 0x0211: { n:"BrtEndCalcChain$" },
  99720. 0x0212: { n:"BrtBeginSortState" },
  99721. 0x0213: { n:"BrtEndSortState" },
  99722. 0x0214: { n:"BrtBeginSortCond" },
  99723. 0x0215: { n:"BrtEndSortCond" },
  99724. 0x0216: { n:"BrtBookProtection" },
  99725. 0x0217: { n:"BrtSheetProtection" },
  99726. 0x0218: { n:"BrtRangeProtection" },
  99727. 0x0219: { n:"BrtPhoneticInfo" },
  99728. 0x021A: { n:"BrtBeginECTxtWiz" },
  99729. 0x021B: { n:"BrtEndECTxtWiz" },
  99730. 0x021C: { n:"BrtBeginECTWFldInfoLst" },
  99731. 0x021D: { n:"BrtEndECTWFldInfoLst" },
  99732. 0x021E: { n:"BrtBeginECTwFldInfo" },
  99733. 0x0224: { n:"BrtFileSharing" },
  99734. 0x0225: { n:"BrtOleSize" },
  99735. 0x0226: { n:"BrtDrawing", f:parse_RelID },
  99736. 0x0227: { n:"BrtLegacyDrawing" },
  99737. 0x0228: { n:"BrtLegacyDrawingHF" },
  99738. 0x0229: { n:"BrtWebOpt" },
  99739. 0x022A: { n:"BrtBeginWebPubItems" },
  99740. 0x022B: { n:"BrtEndWebPubItems" },
  99741. 0x022C: { n:"BrtBeginWebPubItem" },
  99742. 0x022D: { n:"BrtEndWebPubItem" },
  99743. 0x022E: { n:"BrtBeginSXCondFmt" },
  99744. 0x022F: { n:"BrtEndSXCondFmt" },
  99745. 0x0230: { n:"BrtBeginSXCondFmts" },
  99746. 0x0231: { n:"BrtEndSXCondFmts" },
  99747. 0x0232: { n:"BrtBkHim" },
  99748. 0x0234: { n:"BrtColor" },
  99749. 0x0235: { n:"BrtBeginIndexedColors" },
  99750. 0x0236: { n:"BrtEndIndexedColors" },
  99751. 0x0239: { n:"BrtBeginMRUColors" },
  99752. 0x023A: { n:"BrtEndMRUColors" },
  99753. 0x023C: { n:"BrtMRUColor" },
  99754. 0x023D: { n:"BrtBeginDVals" },
  99755. 0x023E: { n:"BrtEndDVals" },
  99756. 0x0241: { n:"BrtSupNameStart" },
  99757. 0x0242: { n:"BrtSupNameValueStart" },
  99758. 0x0243: { n:"BrtSupNameValueEnd" },
  99759. 0x0244: { n:"BrtSupNameNum" },
  99760. 0x0245: { n:"BrtSupNameErr" },
  99761. 0x0246: { n:"BrtSupNameSt" },
  99762. 0x0247: { n:"BrtSupNameNil" },
  99763. 0x0248: { n:"BrtSupNameBool" },
  99764. 0x0249: { n:"BrtSupNameFmla" },
  99765. 0x024A: { n:"BrtSupNameBits" },
  99766. 0x024B: { n:"BrtSupNameEnd" },
  99767. 0x024C: { n:"BrtEndSupBook" },
  99768. 0x024D: { n:"BrtCellSmartTagProperty" },
  99769. 0x024E: { n:"BrtBeginCellSmartTag" },
  99770. 0x024F: { n:"BrtEndCellSmartTag" },
  99771. 0x0250: { n:"BrtBeginCellSmartTags" },
  99772. 0x0251: { n:"BrtEndCellSmartTags" },
  99773. 0x0252: { n:"BrtBeginSmartTags" },
  99774. 0x0253: { n:"BrtEndSmartTags" },
  99775. 0x0254: { n:"BrtSmartTagType" },
  99776. 0x0255: { n:"BrtBeginSmartTagTypes" },
  99777. 0x0256: { n:"BrtEndSmartTagTypes" },
  99778. 0x0257: { n:"BrtBeginSXFilters" },
  99779. 0x0258: { n:"BrtEndSXFilters" },
  99780. 0x0259: { n:"BrtBeginSXFILTER" },
  99781. 0x025A: { n:"BrtEndSXFilter" },
  99782. 0x025B: { n:"BrtBeginFills" },
  99783. 0x025C: { n:"BrtEndFills" },
  99784. 0x025D: { n:"BrtBeginCellWatches" },
  99785. 0x025E: { n:"BrtEndCellWatches" },
  99786. 0x025F: { n:"BrtCellWatch" },
  99787. 0x0260: { n:"BrtBeginCRErrs" },
  99788. 0x0261: { n:"BrtEndCRErrs" },
  99789. 0x0262: { n:"BrtCrashRecErr" },
  99790. 0x0263: { n:"BrtBeginFonts" },
  99791. 0x0264: { n:"BrtEndFonts" },
  99792. 0x0265: { n:"BrtBeginBorders" },
  99793. 0x0266: { n:"BrtEndBorders" },
  99794. 0x0267: { n:"BrtBeginFmts" },
  99795. 0x0268: { n:"BrtEndFmts" },
  99796. 0x0269: { n:"BrtBeginCellXFs" },
  99797. 0x026A: { n:"BrtEndCellXFs" },
  99798. 0x026B: { n:"BrtBeginStyles" },
  99799. 0x026C: { n:"BrtEndStyles" },
  99800. 0x0271: { n:"BrtBigName" },
  99801. 0x0272: { n:"BrtBeginCellStyleXFs" },
  99802. 0x0273: { n:"BrtEndCellStyleXFs" },
  99803. 0x0274: { n:"BrtBeginComments" },
  99804. 0x0275: { n:"BrtEndComments" },
  99805. 0x0276: { n:"BrtBeginCommentAuthors" },
  99806. 0x0277: { n:"BrtEndCommentAuthors" },
  99807. 0x0278: { n:"BrtCommentAuthor", f:parse_BrtCommentAuthor },
  99808. 0x0279: { n:"BrtBeginCommentList" },
  99809. 0x027A: { n:"BrtEndCommentList" },
  99810. 0x027B: { n:"BrtBeginComment", f:parse_BrtBeginComment},
  99811. 0x027C: { n:"BrtEndComment" },
  99812. 0x027D: { n:"BrtCommentText", f:parse_BrtCommentText },
  99813. 0x027E: { n:"BrtBeginOleObjects" },
  99814. 0x027F: { n:"BrtOleObject" },
  99815. 0x0280: { n:"BrtEndOleObjects" },
  99816. 0x0281: { n:"BrtBeginSxrules" },
  99817. 0x0282: { n:"BrtEndSxRules" },
  99818. 0x0283: { n:"BrtBeginActiveXControls" },
  99819. 0x0284: { n:"BrtActiveX" },
  99820. 0x0285: { n:"BrtEndActiveXControls" },
  99821. 0x0286: { n:"BrtBeginPCDSDTCEMembersSortBy" },
  99822. 0x0288: { n:"BrtBeginCellIgnoreECs" },
  99823. 0x0289: { n:"BrtCellIgnoreEC" },
  99824. 0x028A: { n:"BrtEndCellIgnoreECs" },
  99825. 0x028B: { n:"BrtCsProp", f:parse_BrtCsProp },
  99826. 0x028C: { n:"BrtCsPageSetup" },
  99827. 0x028D: { n:"BrtBeginUserCsViews" },
  99828. 0x028E: { n:"BrtEndUserCsViews" },
  99829. 0x028F: { n:"BrtBeginUserCsView" },
  99830. 0x0290: { n:"BrtEndUserCsView" },
  99831. 0x0291: { n:"BrtBeginPcdSFCIEntries" },
  99832. 0x0292: { n:"BrtEndPCDSFCIEntries" },
  99833. 0x0293: { n:"BrtPCDSFCIEntry" },
  99834. 0x0294: { n:"BrtBeginListParts" },
  99835. 0x0295: { n:"BrtListPart" },
  99836. 0x0296: { n:"BrtEndListParts" },
  99837. 0x0297: { n:"BrtSheetCalcProp" },
  99838. 0x0298: { n:"BrtBeginFnGroup" },
  99839. 0x0299: { n:"BrtFnGroup" },
  99840. 0x029A: { n:"BrtEndFnGroup" },
  99841. 0x029B: { n:"BrtSupAddin" },
  99842. 0x029C: { n:"BrtSXTDMPOrder" },
  99843. 0x029D: { n:"BrtCsProtection" },
  99844. 0x029F: { n:"BrtBeginWsSortMap" },
  99845. 0x02A0: { n:"BrtEndWsSortMap" },
  99846. 0x02A1: { n:"BrtBeginRRSort" },
  99847. 0x02A2: { n:"BrtEndRRSort" },
  99848. 0x02A3: { n:"BrtRRSortItem" },
  99849. 0x02A4: { n:"BrtFileSharingIso" },
  99850. 0x02A5: { n:"BrtBookProtectionIso" },
  99851. 0x02A6: { n:"BrtSheetProtectionIso" },
  99852. 0x02A7: { n:"BrtCsProtectionIso" },
  99853. 0x02A8: { n:"BrtRangeProtectionIso" },
  99854. 0x02A9: { n:"BrtDValList" },
  99855. 0x0400: { n:"BrtRwDescent" },
  99856. 0x0401: { n:"BrtKnownFonts" },
  99857. 0x0402: { n:"BrtBeginSXTupleSet" },
  99858. 0x0403: { n:"BrtEndSXTupleSet" },
  99859. 0x0404: { n:"BrtBeginSXTupleSetHeader" },
  99860. 0x0405: { n:"BrtEndSXTupleSetHeader" },
  99861. 0x0406: { n:"BrtSXTupleSetHeaderItem" },
  99862. 0x0407: { n:"BrtBeginSXTupleSetData" },
  99863. 0x0408: { n:"BrtEndSXTupleSetData" },
  99864. 0x0409: { n:"BrtBeginSXTupleSetRow" },
  99865. 0x040A: { n:"BrtEndSXTupleSetRow" },
  99866. 0x040B: { n:"BrtSXTupleSetRowItem" },
  99867. 0x040C: { n:"BrtNameExt" },
  99868. 0x040D: { n:"BrtPCDH14" },
  99869. 0x040E: { n:"BrtBeginPCDCalcMem14" },
  99870. 0x040F: { n:"BrtEndPCDCalcMem14" },
  99871. 0x0410: { n:"BrtSXTH14" },
  99872. 0x0411: { n:"BrtBeginSparklineGroup" },
  99873. 0x0412: { n:"BrtEndSparklineGroup" },
  99874. 0x0413: { n:"BrtSparkline" },
  99875. 0x0414: { n:"BrtSXDI14" },
  99876. 0x0415: { n:"BrtWsFmtInfoEx14" },
  99877. 0x0416: { n:"BrtBeginConditionalFormatting14" },
  99878. 0x0417: { n:"BrtEndConditionalFormatting14" },
  99879. 0x0418: { n:"BrtBeginCFRule14" },
  99880. 0x0419: { n:"BrtEndCFRule14" },
  99881. 0x041A: { n:"BrtCFVO14" },
  99882. 0x041B: { n:"BrtBeginDatabar14" },
  99883. 0x041C: { n:"BrtBeginIconSet14" },
  99884. 0x041D: { n:"BrtDVal14", f: parse_BrtDVal14 },
  99885. 0x041E: { n:"BrtBeginDVals14" },
  99886. 0x041F: { n:"BrtColor14" },
  99887. 0x0420: { n:"BrtBeginSparklines" },
  99888. 0x0421: { n:"BrtEndSparklines" },
  99889. 0x0422: { n:"BrtBeginSparklineGroups" },
  99890. 0x0423: { n:"BrtEndSparklineGroups" },
  99891. 0x0425: { n:"BrtSXVD14" },
  99892. 0x0426: { n:"BrtBeginSXView14" },
  99893. 0x0427: { n:"BrtEndSXView14" },
  99894. 0x0428: { n:"BrtBeginSXView16" },
  99895. 0x0429: { n:"BrtEndSXView16" },
  99896. 0x042A: { n:"BrtBeginPCD14" },
  99897. 0x042B: { n:"BrtEndPCD14" },
  99898. 0x042C: { n:"BrtBeginExtConn14" },
  99899. 0x042D: { n:"BrtEndExtConn14" },
  99900. 0x042E: { n:"BrtBeginSlicerCacheIDs" },
  99901. 0x042F: { n:"BrtEndSlicerCacheIDs" },
  99902. 0x0430: { n:"BrtBeginSlicerCacheID" },
  99903. 0x0431: { n:"BrtEndSlicerCacheID" },
  99904. 0x0433: { n:"BrtBeginSlicerCache" },
  99905. 0x0434: { n:"BrtEndSlicerCache" },
  99906. 0x0435: { n:"BrtBeginSlicerCacheDef" },
  99907. 0x0436: { n:"BrtEndSlicerCacheDef" },
  99908. 0x0437: { n:"BrtBeginSlicersEx" },
  99909. 0x0438: { n:"BrtEndSlicersEx" },
  99910. 0x0439: { n:"BrtBeginSlicerEx" },
  99911. 0x043A: { n:"BrtEndSlicerEx" },
  99912. 0x043B: { n:"BrtBeginSlicer" },
  99913. 0x043C: { n:"BrtEndSlicer" },
  99914. 0x043D: { n:"BrtSlicerCachePivotTables" },
  99915. 0x043E: { n:"BrtBeginSlicerCacheOlapImpl" },
  99916. 0x043F: { n:"BrtEndSlicerCacheOlapImpl" },
  99917. 0x0440: { n:"BrtBeginSlicerCacheLevelsData" },
  99918. 0x0441: { n:"BrtEndSlicerCacheLevelsData" },
  99919. 0x0442: { n:"BrtBeginSlicerCacheLevelData" },
  99920. 0x0443: { n:"BrtEndSlicerCacheLevelData" },
  99921. 0x0444: { n:"BrtBeginSlicerCacheSiRanges" },
  99922. 0x0445: { n:"BrtEndSlicerCacheSiRanges" },
  99923. 0x0446: { n:"BrtBeginSlicerCacheSiRange" },
  99924. 0x0447: { n:"BrtEndSlicerCacheSiRange" },
  99925. 0x0448: { n:"BrtSlicerCacheOlapItem" },
  99926. 0x0449: { n:"BrtBeginSlicerCacheSelections" },
  99927. 0x044A: { n:"BrtSlicerCacheSelection" },
  99928. 0x044B: { n:"BrtEndSlicerCacheSelections" },
  99929. 0x044C: { n:"BrtBeginSlicerCacheNative" },
  99930. 0x044D: { n:"BrtEndSlicerCacheNative" },
  99931. 0x044E: { n:"BrtSlicerCacheNativeItem" },
  99932. 0x044F: { n:"BrtRangeProtection14" },
  99933. 0x0450: { n:"BrtRangeProtectionIso14" },
  99934. 0x0451: { n:"BrtCellIgnoreEC14" },
  99935. 0x0457: { n:"BrtList14" },
  99936. 0x0458: { n:"BrtCFIcon" },
  99937. 0x0459: { n:"BrtBeginSlicerCachesPivotCacheIDs" },
  99938. 0x045A: { n:"BrtEndSlicerCachesPivotCacheIDs" },
  99939. 0x045B: { n:"BrtBeginSlicers" },
  99940. 0x045C: { n:"BrtEndSlicers" },
  99941. 0x045D: { n:"BrtWbProp14" },
  99942. 0x045E: { n:"BrtBeginSXEdit" },
  99943. 0x045F: { n:"BrtEndSXEdit" },
  99944. 0x0460: { n:"BrtBeginSXEdits" },
  99945. 0x0461: { n:"BrtEndSXEdits" },
  99946. 0x0462: { n:"BrtBeginSXChange" },
  99947. 0x0463: { n:"BrtEndSXChange" },
  99948. 0x0464: { n:"BrtBeginSXChanges" },
  99949. 0x0465: { n:"BrtEndSXChanges" },
  99950. 0x0466: { n:"BrtSXTupleItems" },
  99951. 0x0468: { n:"BrtBeginSlicerStyle" },
  99952. 0x0469: { n:"BrtEndSlicerStyle" },
  99953. 0x046A: { n:"BrtSlicerStyleElement" },
  99954. 0x046B: { n:"BrtBeginStyleSheetExt14" },
  99955. 0x046C: { n:"BrtEndStyleSheetExt14" },
  99956. 0x046D: { n:"BrtBeginSlicerCachesPivotCacheID" },
  99957. 0x046E: { n:"BrtEndSlicerCachesPivotCacheID" },
  99958. 0x046F: { n:"BrtBeginConditionalFormattings" },
  99959. 0x0470: { n:"BrtEndConditionalFormattings" },
  99960. 0x0471: { n:"BrtBeginPCDCalcMemExt" },
  99961. 0x0472: { n:"BrtEndPCDCalcMemExt" },
  99962. 0x0473: { n:"BrtBeginPCDCalcMemsExt" },
  99963. 0x0474: { n:"BrtEndPCDCalcMemsExt" },
  99964. 0x0475: { n:"BrtPCDField14" },
  99965. 0x0476: { n:"BrtBeginSlicerStyles" },
  99966. 0x0477: { n:"BrtEndSlicerStyles" },
  99967. 0x0478: { n:"BrtBeginSlicerStyleElements" },
  99968. 0x0479: { n:"BrtEndSlicerStyleElements" },
  99969. 0x047A: { n:"BrtCFRuleExt" },
  99970. 0x047B: { n:"BrtBeginSXCondFmt14" },
  99971. 0x047C: { n:"BrtEndSXCondFmt14" },
  99972. 0x047D: { n:"BrtBeginSXCondFmts14" },
  99973. 0x047E: { n:"BrtEndSXCondFmts14" },
  99974. 0x0480: { n:"BrtBeginSortCond14" },
  99975. 0x0481: { n:"BrtEndSortCond14" },
  99976. 0x0482: { n:"BrtEndDVals14" },
  99977. 0x0483: { n:"BrtEndIconSet14" },
  99978. 0x0484: { n:"BrtEndDatabar14" },
  99979. 0x0485: { n:"BrtBeginColorScale14" },
  99980. 0x0486: { n:"BrtEndColorScale14" },
  99981. 0x0487: { n:"BrtBeginSxrules14" },
  99982. 0x0488: { n:"BrtEndSxrules14" },
  99983. 0x0489: { n:"BrtBeginPRule14" },
  99984. 0x048A: { n:"BrtEndPRule14" },
  99985. 0x048B: { n:"BrtBeginPRFilters14" },
  99986. 0x048C: { n:"BrtEndPRFilters14" },
  99987. 0x048D: { n:"BrtBeginPRFilter14" },
  99988. 0x048E: { n:"BrtEndPRFilter14" },
  99989. 0x048F: { n:"BrtBeginPRFItem14" },
  99990. 0x0490: { n:"BrtEndPRFItem14" },
  99991. 0x0491: { n:"BrtBeginCellIgnoreECs14" },
  99992. 0x0492: { n:"BrtEndCellIgnoreECs14" },
  99993. 0x0493: { n:"BrtDxf14" },
  99994. 0x0494: { n:"BrtBeginDxF14s" },
  99995. 0x0495: { n:"BrtEndDxf14s" },
  99996. 0x0499: { n:"BrtFilter14" },
  99997. 0x049A: { n:"BrtBeginCustomFilters14" },
  99998. 0x049C: { n:"BrtCustomFilter14" },
  99999. 0x049D: { n:"BrtIconFilter14" },
  100000. 0x049E: { n:"BrtPivotCacheConnectionName" },
  100001. 0x0800: { n:"BrtBeginDecoupledPivotCacheIDs" },
  100002. 0x0801: { n:"BrtEndDecoupledPivotCacheIDs" },
  100003. 0x0802: { n:"BrtDecoupledPivotCacheID" },
  100004. 0x0803: { n:"BrtBeginPivotTableRefs" },
  100005. 0x0804: { n:"BrtEndPivotTableRefs" },
  100006. 0x0805: { n:"BrtPivotTableRef" },
  100007. 0x0806: { n:"BrtSlicerCacheBookPivotTables" },
  100008. 0x0807: { n:"BrtBeginSxvcells" },
  100009. 0x0808: { n:"BrtEndSxvcells" },
  100010. 0x0809: { n:"BrtBeginSxRow" },
  100011. 0x080A: { n:"BrtEndSxRow" },
  100012. 0x080C: { n:"BrtPcdCalcMem15" },
  100013. 0x0813: { n:"BrtQsi15" },
  100014. 0x0814: { n:"BrtBeginWebExtensions" },
  100015. 0x0815: { n:"BrtEndWebExtensions" },
  100016. 0x0816: { n:"BrtWebExtension" },
  100017. 0x0817: { n:"BrtAbsPath15" },
  100018. 0x0818: { n:"BrtBeginPivotTableUISettings" },
  100019. 0x0819: { n:"BrtEndPivotTableUISettings" },
  100020. 0x081B: { n:"BrtTableSlicerCacheIDs" },
  100021. 0x081C: { n:"BrtTableSlicerCacheID" },
  100022. 0x081D: { n:"BrtBeginTableSlicerCache" },
  100023. 0x081E: { n:"BrtEndTableSlicerCache" },
  100024. 0x081F: { n:"BrtSxFilter15" },
  100025. 0x0820: { n:"BrtBeginTimelineCachePivotCacheIDs" },
  100026. 0x0821: { n:"BrtEndTimelineCachePivotCacheIDs" },
  100027. 0x0822: { n:"BrtTimelineCachePivotCacheID" },
  100028. 0x0823: { n:"BrtBeginTimelineCacheIDs" },
  100029. 0x0824: { n:"BrtEndTimelineCacheIDs" },
  100030. 0x0825: { n:"BrtBeginTimelineCacheID" },
  100031. 0x0826: { n:"BrtEndTimelineCacheID" },
  100032. 0x0827: { n:"BrtBeginTimelinesEx" },
  100033. 0x0828: { n:"BrtEndTimelinesEx" },
  100034. 0x0829: { n:"BrtBeginTimelineEx" },
  100035. 0x082A: { n:"BrtEndTimelineEx" },
  100036. 0x082B: { n:"BrtWorkBookPr15" },
  100037. 0x082C: { n:"BrtPCDH15" },
  100038. 0x082D: { n:"BrtBeginTimelineStyle" },
  100039. 0x082E: { n:"BrtEndTimelineStyle" },
  100040. 0x082F: { n:"BrtTimelineStyleElement" },
  100041. 0x0830: { n:"BrtBeginTimelineStylesheetExt15" },
  100042. 0x0831: { n:"BrtEndTimelineStylesheetExt15" },
  100043. 0x0832: { n:"BrtBeginTimelineStyles" },
  100044. 0x0833: { n:"BrtEndTimelineStyles" },
  100045. 0x0834: { n:"BrtBeginTimelineStyleElements" },
  100046. 0x0835: { n:"BrtEndTimelineStyleElements" },
  100047. 0x0836: { n:"BrtDxf15" },
  100048. 0x0837: { n:"BrtBeginDxfs15" },
  100049. 0x0838: { n:"brtEndDxfs15" },
  100050. 0x0839: { n:"BrtSlicerCacheHideItemsWithNoData" },
  100051. 0x083A: { n:"BrtBeginItemUniqueNames" },
  100052. 0x083B: { n:"BrtEndItemUniqueNames" },
  100053. 0x083C: { n:"BrtItemUniqueName" },
  100054. 0x083D: { n:"BrtBeginExtConn15" },
  100055. 0x083E: { n:"BrtEndExtConn15" },
  100056. 0x083F: { n:"BrtBeginOledbPr15" },
  100057. 0x0840: { n:"BrtEndOledbPr15" },
  100058. 0x0841: { n:"BrtBeginDataFeedPr15" },
  100059. 0x0842: { n:"BrtEndDataFeedPr15" },
  100060. 0x0843: { n:"BrtTextPr15" },
  100061. 0x0844: { n:"BrtRangePr15" },
  100062. 0x0845: { n:"BrtDbCommand15" },
  100063. 0x0846: { n:"BrtBeginDbTables15" },
  100064. 0x0847: { n:"BrtEndDbTables15" },
  100065. 0x0848: { n:"BrtDbTable15" },
  100066. 0x0849: { n:"BrtBeginDataModel" },
  100067. 0x084A: { n:"BrtEndDataModel" },
  100068. 0x084B: { n:"BrtBeginModelTables" },
  100069. 0x084C: { n:"BrtEndModelTables" },
  100070. 0x084D: { n:"BrtModelTable" },
  100071. 0x084E: { n:"BrtBeginModelRelationships" },
  100072. 0x084F: { n:"BrtEndModelRelationships" },
  100073. 0x0850: { n:"BrtModelRelationship" },
  100074. 0x0851: { n:"BrtBeginECTxtWiz15" },
  100075. 0x0852: { n:"BrtEndECTxtWiz15" },
  100076. 0x0853: { n:"BrtBeginECTWFldInfoLst15" },
  100077. 0x0854: { n:"BrtEndECTWFldInfoLst15" },
  100078. 0x0855: { n:"BrtBeginECTWFldInfo15" },
  100079. 0x0856: { n:"BrtFieldListActiveItem" },
  100080. 0x0857: { n:"BrtPivotCacheIdVersion" },
  100081. 0x0858: { n:"BrtSXDI15" },
  100082. 0x0859: { n:"BrtBeginModelTimeGroupings" },
  100083. 0x085A: { n:"BrtEndModelTimeGroupings" },
  100084. 0x085B: { n:"BrtBeginModelTimeGrouping" },
  100085. 0x085C: { n:"BrtEndModelTimeGrouping" },
  100086. 0x085D: { n:"BrtModelTimeGroupingCalcCol" },
  100087. 0x0C00: { n:"BrtUid" },
  100088. 0x0C01: { n:"BrtRevisionPtr" },
  100089. 0x13e7: { n:"BrtBeginCalcFeatures" },
  100090. 0x13e8: { n:"BrtEndCalcFeatures" },
  100091. 0x13e9: { n:"BrtCalcFeature" },
  100092. 0xFFFF: { n:"" }
  100093. };
  100094. var XLSBRE = evert_key(XLSBRecordEnum, 'n');
  100095. /* [MS-XLS] 2.3 Record Enumeration */
  100096. var XLSRecordEnum = {
  100097. 0x0003: { n:"BIFF2NUM", f:parse_BIFF2NUM },
  100098. 0x0004: { n:"BIFF2STR", f:parse_BIFF2STR },
  100099. 0x0006: { n:"Formula", f:parse_Formula },
  100100. 0x0009: { n:'BOF', f:parse_BOF },
  100101. 0x000a: { n:'EOF', f:parsenoop2 },
  100102. 0x000c: { n:"CalcCount", f:parseuint16 },
  100103. 0x000d: { n:"CalcMode", f:parseuint16 },
  100104. 0x000e: { n:"CalcPrecision", f:parsebool },
  100105. 0x000f: { n:"CalcRefMode", f:parsebool },
  100106. 0x0010: { n:"CalcDelta", f:parse_Xnum },
  100107. 0x0011: { n:"CalcIter", f:parsebool },
  100108. 0x0012: { n:"Protect", f:parsebool },
  100109. 0x0013: { n:"Password", f:parseuint16 },
  100110. 0x0014: { n:"Header", f:parse_XLHeaderFooter },
  100111. 0x0015: { n:"Footer", f:parse_XLHeaderFooter },
  100112. 0x0017: { n:"ExternSheet", f:parse_ExternSheet },
  100113. 0x0018: { n:"Lbl", f:parse_Lbl },
  100114. 0x0019: { n:"WinProtect", f:parsebool },
  100115. 0x001a: { n:"VerticalPageBreaks" },
  100116. 0x001b: { n:"HorizontalPageBreaks" },
  100117. 0x001c: { n:"Note", f:parse_Note },
  100118. 0x001d: { n:"Selection" },
  100119. 0x0022: { n:"Date1904", f:parsebool },
  100120. 0x0023: { n:"ExternName", f:parse_ExternName },
  100121. 0x0026: { n:"LeftMargin", f:parse_Xnum },
  100122. 0x0027: { n:"RightMargin", f:parse_Xnum },
  100123. 0x0028: { n:"TopMargin", f:parse_Xnum },
  100124. 0x0029: { n:"BottomMargin", f:parse_Xnum },
  100125. 0x002a: { n:"PrintRowCol", f:parsebool },
  100126. 0x002b: { n:"PrintGrid", f:parsebool },
  100127. 0x002f: { n:"FilePass", f:parse_FilePass },
  100128. 0x0031: { n:"Font", f:parse_Font },
  100129. 0x0033: { n:"PrintSize", f:parseuint16 },
  100130. 0x003c: { n:"Continue" },
  100131. 0x003d: { n:"Window1", f:parse_Window1 },
  100132. 0x0040: { n:"Backup", f:parsebool },
  100133. 0x0041: { n:"Pane", f:parse_Pane },
  100134. 0x0042: { n:'CodePage', f:parseuint16 },
  100135. 0x004d: { n:"Pls" },
  100136. 0x0050: { n:"DCon" },
  100137. 0x0051: { n:"DConRef" },
  100138. 0x0052: { n:"DConName" },
  100139. 0x0055: { n:"DefColWidth", f:parseuint16 },
  100140. 0x0059: { n:"XCT" },
  100141. 0x005a: { n:"CRN" },
  100142. 0x005b: { n:"FileSharing" },
  100143. 0x005c: { n:'WriteAccess', f:parse_WriteAccess },
  100144. 0x005d: { n:"Obj", f:parse_Obj },
  100145. 0x005e: { n:"Uncalced" },
  100146. 0x005f: { n:"CalcSaveRecalc", f:parsebool },
  100147. 0x0060: { n:"Template" },
  100148. 0x0061: { n:"Intl" },
  100149. 0x0063: { n:"ObjProtect", f:parsebool },
  100150. 0x007d: { n:"ColInfo", f:parse_ColInfo },
  100151. 0x0080: { n:"Guts", f:parse_Guts },
  100152. 0x0081: { n:"WsBool", f:parse_WsBool },
  100153. 0x0082: { n:"GridSet", f:parseuint16 },
  100154. 0x0083: { n:"HCenter", f:parsebool },
  100155. 0x0084: { n:"VCenter", f:parsebool },
  100156. 0x0085: { n:'BoundSheet8', f:parse_BoundSheet8 },
  100157. 0x0086: { n:"WriteProtect" },
  100158. 0x008c: { n:"Country", f:parse_Country },
  100159. 0x008d: { n:"HideObj", f:parseuint16 },
  100160. 0x0090: { n:"Sort" },
  100161. 0x0092: { n:"Palette", f:parse_Palette },
  100162. 0x0097: { n:"Sync" },
  100163. 0x0098: { n:"LPr" },
  100164. 0x0099: { n:"DxGCol" },
  100165. 0x009a: { n:"FnGroupName" },
  100166. 0x009b: { n:"FilterMode" },
  100167. 0x009c: { n:"BuiltInFnGroupCount", f:parseuint16 },
  100168. 0x009d: { n:"AutoFilterInfo" },
  100169. 0x009e: { n:"AutoFilter" },
  100170. 0x00a0: { n:"Scl", f:parse_Scl },
  100171. 0x00a1: { n:"Setup", f:parse_Setup },
  100172. 0x00ae: { n:"ScenMan" },
  100173. 0x00af: { n:"SCENARIO" },
  100174. 0x00b0: { n:"SxView" },
  100175. 0x00b1: { n:"Sxvd" },
  100176. 0x00b2: { n:"SXVI" },
  100177. 0x00b4: { n:"SxIvd" },
  100178. 0x00b5: { n:"SXLI" },
  100179. 0x00b6: { n:"SXPI" },
  100180. 0x00b8: { n:"DocRoute" },
  100181. 0x00b9: { n:"RecipName" },
  100182. 0x00bd: { n:"MulRk", f:parse_MulRk },
  100183. 0x00be: { n:"MulBlank", f:parse_MulBlank },
  100184. 0x00c1: { n:'Mms', f:parsenoop2 },
  100185. 0x00c5: { n:"SXDI" },
  100186. 0x00c6: { n:"SXDB" },
  100187. 0x00c7: { n:"SXFDB" },
  100188. 0x00c8: { n:"SXDBB" },
  100189. 0x00c9: { n:"SXNum" },
  100190. 0x00ca: { n:"SxBool", f:parsebool },
  100191. 0x00cb: { n:"SxErr" },
  100192. 0x00cc: { n:"SXInt" },
  100193. 0x00cd: { n:"SXString" },
  100194. 0x00ce: { n:"SXDtr" },
  100195. 0x00cf: { n:"SxNil" },
  100196. 0x00d0: { n:"SXTbl" },
  100197. 0x00d1: { n:"SXTBRGIITM" },
  100198. 0x00d2: { n:"SxTbpg" },
  100199. 0x00d3: { n:"ObProj" },
  100200. 0x00d5: { n:"SXStreamID" },
  100201. 0x00d7: { n:"DBCell" },
  100202. 0x00d8: { n:"SXRng" },
  100203. 0x00d9: { n:"SxIsxoper" },
  100204. 0x00da: { n:"BookBool", f:parseuint16 },
  100205. 0x00dc: { n:"DbOrParamQry" },
  100206. 0x00dd: { n:"ScenarioProtect", f:parsebool },
  100207. 0x00de: { n:"OleObjectSize" },
  100208. 0x00e0: { n:"XF", f:parse_XF },
  100209. 0x00e1: { n:'InterfaceHdr', f:parse_InterfaceHdr },
  100210. 0x00e2: { n:'InterfaceEnd', f:parsenoop2 },
  100211. 0x00e3: { n:"SXVS" },
  100212. 0x00e5: { n:"MergeCells", f:parse_MergeCells },
  100213. 0x00e9: { n:"BkHim" },
  100214. 0x00eb: { n:"MsoDrawingGroup" },
  100215. 0x00ec: { n:"MsoDrawing" },
  100216. 0x00ed: { n:"MsoDrawingSelection" },
  100217. 0x00ef: { n:"PhoneticInfo" },
  100218. 0x00f0: { n:"SxRule" },
  100219. 0x00f1: { n:"SXEx" },
  100220. 0x00f2: { n:"SxFilt" },
  100221. 0x00f4: { n:"SxDXF" },
  100222. 0x00f5: { n:"SxItm" },
  100223. 0x00f6: { n:"SxName" },
  100224. 0x00f7: { n:"SxSelect" },
  100225. 0x00f8: { n:"SXPair" },
  100226. 0x00f9: { n:"SxFmla" },
  100227. 0x00fb: { n:"SxFormat" },
  100228. 0x00fc: { n:"SST", f:parse_SST },
  100229. 0x00fd: { n:"LabelSst", f:parse_LabelSst },
  100230. 0x00ff: { n:"ExtSST", f:parse_ExtSST },
  100231. 0x0100: { n:"SXVDEx" },
  100232. 0x0103: { n:"SXFormula" },
  100233. 0x0122: { n:"SXDBEx" },
  100234. 0x0137: { n:"RRDInsDel" },
  100235. 0x0138: { n:"RRDHead" },
  100236. 0x013b: { n:"RRDChgCell" },
  100237. 0x013d: { n:"RRTabId", f:parseuint16a },
  100238. 0x013e: { n:"RRDRenSheet" },
  100239. 0x013f: { n:"RRSort" },
  100240. 0x0140: { n:"RRDMove" },
  100241. 0x014a: { n:"RRFormat" },
  100242. 0x014b: { n:"RRAutoFmt" },
  100243. 0x014d: { n:"RRInsertSh" },
  100244. 0x014e: { n:"RRDMoveBegin" },
  100245. 0x014f: { n:"RRDMoveEnd" },
  100246. 0x0150: { n:"RRDInsDelBegin" },
  100247. 0x0151: { n:"RRDInsDelEnd" },
  100248. 0x0152: { n:"RRDConflict" },
  100249. 0x0153: { n:"RRDDefName" },
  100250. 0x0154: { n:"RRDRstEtxp" },
  100251. 0x015f: { n:"LRng" },
  100252. 0x0160: { n:"UsesELFs", f:parsebool },
  100253. 0x0161: { n:"DSF", f:parsenoop2 },
  100254. 0x0191: { n:"CUsr" },
  100255. 0x0192: { n:"CbUsr" },
  100256. 0x0193: { n:"UsrInfo" },
  100257. 0x0194: { n:"UsrExcl" },
  100258. 0x0195: { n:"FileLock" },
  100259. 0x0196: { n:"RRDInfo" },
  100260. 0x0197: { n:"BCUsrs" },
  100261. 0x0198: { n:"UsrChk" },
  100262. 0x01a9: { n:"UserBView" },
  100263. 0x01aa: { n:"UserSViewBegin" },
  100264. 0x01ab: { n:"UserSViewEnd" },
  100265. 0x01ac: { n:"RRDUserView" },
  100266. 0x01ad: { n:"Qsi" },
  100267. 0x01ae: { n:"SupBook", f:parse_SupBook },
  100268. 0x01af: { n:"Prot4Rev", f:parsebool },
  100269. 0x01b0: { n:"CondFmt" },
  100270. 0x01b1: { n:"CF" },
  100271. 0x01b2: { n:"DVal" },
  100272. 0x01b5: { n:"DConBin" },
  100273. 0x01b6: { n:"TxO", f:parse_TxO },
  100274. 0x01b7: { n:"RefreshAll", f:parsebool },
  100275. 0x01b8: { n:"HLink", f:parse_HLink },
  100276. 0x01b9: { n:"Lel" },
  100277. 0x01ba: { n:"CodeName", f:parse_XLUnicodeString },
  100278. 0x01bb: { n:"SXFDBType" },
  100279. 0x01bc: { n:"Prot4RevPass", f:parseuint16 },
  100280. 0x01bd: { n:"ObNoMacros" },
  100281. 0x01be: { n:"Dv" },
  100282. 0x01c0: { n:"Excel9File", f:parsenoop2 },
  100283. 0x01c1: { n:"RecalcId", f:parse_RecalcId, r:2},
  100284. 0x01c2: { n:"EntExU2", f:parsenoop2 },
  100285. 0x0200: { n:"Dimensions", f:parse_Dimensions },
  100286. 0x0201: { n:"Blank", f:parse_Blank },
  100287. 0x0203: { n:"Number", f:parse_Number },
  100288. 0x0204: { n:"Label", f:parse_Label },
  100289. 0x0205: { n:"BoolErr", f:parse_BoolErr },
  100290. 0x0206: { n:"Formula", f:parse_Formula },
  100291. 0x0207: { n:"String", f:parse_String },
  100292. 0x0208: { n:'Row', f:parse_Row },
  100293. 0x020b: { n:"Index" },
  100294. 0x0221: { n:"Array", f:parse_Array },
  100295. 0x0225: { n:"DefaultRowHeight", f:parse_DefaultRowHeight },
  100296. 0x0236: { n:"Table" },
  100297. 0x023e: { n:"Window2", f:parse_Window2 },
  100298. 0x027e: { n:"RK", f:parse_RK },
  100299. 0x0293: { n:"Style" },
  100300. 0x0406: { n:"Formula", f:parse_Formula },
  100301. 0x0418: { n:"BigName" },
  100302. 0x041e: { n:"Format", f:parse_Format },
  100303. 0x043c: { n:"ContinueBigName" },
  100304. 0x04bc: { n:"ShrFmla", f:parse_ShrFmla },
  100305. 0x0800: { n:"HLinkTooltip", f:parse_HLinkTooltip },
  100306. 0x0801: { n:"WebPub" },
  100307. 0x0802: { n:"QsiSXTag" },
  100308. 0x0803: { n:"DBQueryExt" },
  100309. 0x0804: { n:"ExtString" },
  100310. 0x0805: { n:"TxtQry" },
  100311. 0x0806: { n:"Qsir" },
  100312. 0x0807: { n:"Qsif" },
  100313. 0x0808: { n:"RRDTQSIF" },
  100314. 0x0809: { n:'BOF', f:parse_BOF },
  100315. 0x080a: { n:"OleDbConn" },
  100316. 0x080b: { n:"WOpt" },
  100317. 0x080c: { n:"SXViewEx" },
  100318. 0x080d: { n:"SXTH" },
  100319. 0x080e: { n:"SXPIEx" },
  100320. 0x080f: { n:"SXVDTEx" },
  100321. 0x0810: { n:"SXViewEx9" },
  100322. 0x0812: { n:"ContinueFrt" },
  100323. 0x0813: { n:"RealTimeData" },
  100324. 0x0850: { n:"ChartFrtInfo" },
  100325. 0x0851: { n:"FrtWrapper" },
  100326. 0x0852: { n:"StartBlock" },
  100327. 0x0853: { n:"EndBlock" },
  100328. 0x0854: { n:"StartObject" },
  100329. 0x0855: { n:"EndObject" },
  100330. 0x0856: { n:"CatLab" },
  100331. 0x0857: { n:"YMult" },
  100332. 0x0858: { n:"SXViewLink" },
  100333. 0x0859: { n:"PivotChartBits" },
  100334. 0x085a: { n:"FrtFontList" },
  100335. 0x0862: { n:"SheetExt" },
  100336. 0x0863: { n:"BookExt", r:12},
  100337. 0x0864: { n:"SXAddl" },
  100338. 0x0865: { n:"CrErr" },
  100339. 0x0866: { n:"HFPicture" },
  100340. 0x0867: { n:'FeatHdr', f:parsenoop2 },
  100341. 0x0868: { n:"Feat" },
  100342. 0x086a: { n:"DataLabExt" },
  100343. 0x086b: { n:"DataLabExtContents" },
  100344. 0x086c: { n:"CellWatch" },
  100345. 0x0871: { n:"FeatHdr11" },
  100346. 0x0872: { n:"Feature11" },
  100347. 0x0874: { n:"DropDownObjIds" },
  100348. 0x0875: { n:"ContinueFrt11" },
  100349. 0x0876: { n:"DConn" },
  100350. 0x0877: { n:"List12" },
  100351. 0x0878: { n:"Feature12" },
  100352. 0x0879: { n:"CondFmt12" },
  100353. 0x087a: { n:"CF12" },
  100354. 0x087b: { n:"CFEx" },
  100355. 0x087c: { n:"XFCRC", f:parse_XFCRC, r:12 },
  100356. 0x087d: { n:"XFExt", f:parse_XFExt, r:12 },
  100357. 0x087e: { n:"AutoFilter12" },
  100358. 0x087f: { n:"ContinueFrt12" },
  100359. 0x0884: { n:"MDTInfo" },
  100360. 0x0885: { n:"MDXStr" },
  100361. 0x0886: { n:"MDXTuple" },
  100362. 0x0887: { n:"MDXSet" },
  100363. 0x0888: { n:"MDXProp" },
  100364. 0x0889: { n:"MDXKPI" },
  100365. 0x088a: { n:"MDB" },
  100366. 0x088b: { n:"PLV" },
  100367. 0x088c: { n:"Compat12", f:parsebool, r:12 },
  100368. 0x088d: { n:"DXF" },
  100369. 0x088e: { n:"TableStyles", r:12 },
  100370. 0x088f: { n:"TableStyle" },
  100371. 0x0890: { n:"TableStyleElement" },
  100372. 0x0892: { n:"StyleExt" },
  100373. 0x0893: { n:"NamePublish" },
  100374. 0x0894: { n:"NameCmt", f:parse_NameCmt, r:12 },
  100375. 0x0895: { n:"SortData" },
  100376. 0x0896: { n:"Theme", f:parse_Theme, r:12 },
  100377. 0x0897: { n:"GUIDTypeLib" },
  100378. 0x0898: { n:"FnGrp12" },
  100379. 0x0899: { n:"NameFnGrp12" },
  100380. 0x089a: { n:"MTRSettings", f:parse_MTRSettings, r:12 },
  100381. 0x089b: { n:"CompressPictures", f:parsenoop2 },
  100382. 0x089c: { n:"HeaderFooter" },
  100383. 0x089d: { n:"CrtLayout12" },
  100384. 0x089e: { n:"CrtMlFrt" },
  100385. 0x089f: { n:"CrtMlFrtContinue" },
  100386. 0x08a3: { n:"ForceFullCalculation", f:parse_ForceFullCalculation },
  100387. 0x08a4: { n:"ShapePropsStream" },
  100388. 0x08a5: { n:"TextPropsStream" },
  100389. 0x08a6: { n:"RichTextStream" },
  100390. 0x08a7: { n:"CrtLayout12A" },
  100391. 0x1001: { n:"Units" },
  100392. 0x1002: { n:"Chart" },
  100393. 0x1003: { n:"Series" },
  100394. 0x1006: { n:"DataFormat" },
  100395. 0x1007: { n:"LineFormat" },
  100396. 0x1009: { n:"MarkerFormat" },
  100397. 0x100a: { n:"AreaFormat" },
  100398. 0x100b: { n:"PieFormat" },
  100399. 0x100c: { n:"AttachedLabel" },
  100400. 0x100d: { n:"SeriesText" },
  100401. 0x1014: { n:"ChartFormat" },
  100402. 0x1015: { n:"Legend" },
  100403. 0x1016: { n:"SeriesList" },
  100404. 0x1017: { n:"Bar" },
  100405. 0x1018: { n:"Line" },
  100406. 0x1019: { n:"Pie" },
  100407. 0x101a: { n:"Area" },
  100408. 0x101b: { n:"Scatter" },
  100409. 0x101c: { n:"CrtLine" },
  100410. 0x101d: { n:"Axis" },
  100411. 0x101e: { n:"Tick" },
  100412. 0x101f: { n:"ValueRange" },
  100413. 0x1020: { n:"CatSerRange" },
  100414. 0x1021: { n:"AxisLine" },
  100415. 0x1022: { n:"CrtLink" },
  100416. 0x1024: { n:"DefaultText" },
  100417. 0x1025: { n:"Text" },
  100418. 0x1026: { n:"FontX", f:parseuint16 },
  100419. 0x1027: { n:"ObjectLink" },
  100420. 0x1032: { n:"Frame" },
  100421. 0x1033: { n:"Begin" },
  100422. 0x1034: { n:"End" },
  100423. 0x1035: { n:"PlotArea" },
  100424. 0x103a: { n:"Chart3d" },
  100425. 0x103c: { n:"PicF" },
  100426. 0x103d: { n:"DropBar" },
  100427. 0x103e: { n:"Radar" },
  100428. 0x103f: { n:"Surf" },
  100429. 0x1040: { n:"RadarArea" },
  100430. 0x1041: { n:"AxisParent" },
  100431. 0x1043: { n:"LegendException" },
  100432. 0x1044: { n:"ShtProps", f:parse_ShtProps },
  100433. 0x1045: { n:"SerToCrt" },
  100434. 0x1046: { n:"AxesUsed" },
  100435. 0x1048: { n:"SBaseRef" },
  100436. 0x104a: { n:"SerParent" },
  100437. 0x104b: { n:"SerAuxTrend" },
  100438. 0x104e: { n:"IFmtRecord" },
  100439. 0x104f: { n:"Pos" },
  100440. 0x1050: { n:"AlRuns" },
  100441. 0x1051: { n:"BRAI" },
  100442. 0x105b: { n:"SerAuxErrBar" },
  100443. 0x105c: { n:"ClrtClient", f:parse_ClrtClient },
  100444. 0x105d: { n:"SerFmt" },
  100445. 0x105f: { n:"Chart3DBarShape" },
  100446. 0x1060: { n:"Fbi" },
  100447. 0x1061: { n:"BopPop" },
  100448. 0x1062: { n:"AxcExt" },
  100449. 0x1063: { n:"Dat" },
  100450. 0x1064: { n:"PlotGrowth" },
  100451. 0x1065: { n:"SIIndex" },
  100452. 0x1066: { n:"GelFrame" },
  100453. 0x1067: { n:"BopPopCustom" },
  100454. 0x1068: { n:"Fbi2" },
  100455. 0x0000: { n:"Dimensions", f:parse_Dimensions },
  100456. 0x0002: { n:"BIFF2INT", f:parse_BIFF2INT },
  100457. 0x0005: { n:"BoolErr", f:parse_BoolErr },
  100458. 0x0007: { n:"String", f:parse_BIFF2STRING },
  100459. 0x0008: { n:"BIFF2ROW" },
  100460. 0x000b: { n:"Index" },
  100461. 0x0016: { n:"ExternCount", f:parseuint16 },
  100462. 0x001e: { n:"BIFF2FORMAT", f:parse_BIFF2Format },
  100463. 0x001f: { n:"BIFF2FMTCNT" }, /* 16-bit cnt of BIFF2FORMAT records */
  100464. 0x0020: { n:"BIFF2COLINFO" },
  100465. 0x0021: { n:"Array", f:parse_Array },
  100466. 0x0025: { n:"DefaultRowHeight", f:parse_DefaultRowHeight },
  100467. 0x0032: { n:"BIFF2FONTXTRA", f:parse_BIFF2FONTXTRA },
  100468. 0x0034: { n:"DDEObjName" },
  100469. 0x003e: { n:"BIFF2WINDOW2" },
  100470. 0x0043: { n:"BIFF2XF" },
  100471. 0x0045: { n:"BIFF2FONTCLR" },
  100472. 0x0056: { n:"BIFF4FMTCNT" }, /* 16-bit cnt, similar to BIFF2 */
  100473. 0x007e: { n:"RK" }, /* Not necessarily same as 0x027e */
  100474. 0x007f: { n:"ImData", f:parse_ImData },
  100475. 0x0087: { n:"Addin" },
  100476. 0x0088: { n:"Edg" },
  100477. 0x0089: { n:"Pub" },
  100478. 0x0091: { n:"Sub" },
  100479. 0x0094: { n:"LHRecord" },
  100480. 0x0095: { n:"LHNGraph" },
  100481. 0x0096: { n:"Sound" },
  100482. 0x00a9: { n:"CoordList" },
  100483. 0x00ab: { n:"GCW" },
  100484. 0x00bc: { n:"ShrFmla" }, /* Not necessarily same as 0x04bc */
  100485. 0x00bf: { n:"ToolbarHdr" },
  100486. 0x00c0: { n:"ToolbarEnd" },
  100487. 0x00c2: { n:"AddMenu" },
  100488. 0x00c3: { n:"DelMenu" },
  100489. 0x00d6: { n:"RString", f:parse_RString },
  100490. 0x00df: { n:"UDDesc" },
  100491. 0x00ea: { n:"TabIdConf" },
  100492. 0x0162: { n:"XL5Modify" },
  100493. 0x01a5: { n:"FileSharing2" },
  100494. 0x0209: { n:'BOF', f:parse_BOF },
  100495. 0x0218: { n:"Lbl", f:parse_Lbl },
  100496. 0x0223: { n:"ExternName", f:parse_ExternName },
  100497. 0x0231: { n:"Font" },
  100498. 0x0243: { n:"BIFF3XF" },
  100499. 0x0409: { n:'BOF', f:parse_BOF },
  100500. 0x0443: { n:"BIFF4XF" },
  100501. 0x086d: { n:"FeatInfo" },
  100502. 0x0873: { n:"FeatInfo11" },
  100503. 0x0881: { n:"SXAddl12" },
  100504. 0x08c0: { n:"AutoWebPub" },
  100505. 0x08c1: { n:"ListObj" },
  100506. 0x08c2: { n:"ListField" },
  100507. 0x08c3: { n:"ListDV" },
  100508. 0x08c4: { n:"ListCondFmt" },
  100509. 0x08c5: { n:"ListCF" },
  100510. 0x08c6: { n:"FMQry" },
  100511. 0x08c7: { n:"FMSQry" },
  100512. 0x08c8: { n:"PLV" },
  100513. 0x08c9: { n:"LnExt" },
  100514. 0x08ca: { n:"MkrExt" },
  100515. 0x08cb: { n:"CrtCoopt" },
  100516. 0x08d6: { n:"FRTArchId$", r:12 },
  100517. 0x7262: {}
  100518. };
  100519. var XLSRE = evert_key(XLSRecordEnum, 'n');
  100520. function write_biff_rec(ba, type, payload, length) {
  100521. var t = +type || +XLSRE[type];
  100522. if(isNaN(t)) return;
  100523. var len = length || (payload||[]).length || 0;
  100524. var o = ba.next(4);
  100525. o.write_shift(2, t);
  100526. o.write_shift(2, len);
  100527. if(len > 0 && is_buf(payload)) ba.push(payload);
  100528. }
  100529. function write_BIFF2Cell(out, r, c) {
  100530. if(!out) out = new_buf(7);
  100531. out.write_shift(2, r);
  100532. out.write_shift(2, c);
  100533. out.write_shift(2, 0);
  100534. out.write_shift(1, 0);
  100535. return out;
  100536. }
  100537. function write_BIFF2BERR(r, c, val, t) {
  100538. var out = new_buf(9);
  100539. write_BIFF2Cell(out, r, c);
  100540. if(t == 'e') { out.write_shift(1, val); out.write_shift(1, 1); }
  100541. else { out.write_shift(1, val?1:0); out.write_shift(1, 0); }
  100542. return out;
  100543. }
  100544. /* TODO: codepage, large strings */
  100545. function write_BIFF2LABEL(r, c, val) {
  100546. var out = new_buf(8 + 2*val.length);
  100547. write_BIFF2Cell(out, r, c);
  100548. out.write_shift(1, val.length);
  100549. out.write_shift(val.length, val, 'sbcs');
  100550. return out.l < out.length ? out.slice(0, out.l) : out;
  100551. }
  100552. function write_ws_biff2_cell(ba, cell, R, C) {
  100553. if(cell.v != null) switch(cell.t) {
  100554. case 'd': case 'n':
  100555. var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v;
  100556. if((v == (v|0)) && (v >= 0) && (v < 65536))
  100557. write_biff_rec(ba, 0x0002, write_BIFF2INT(R, C, v));
  100558. else
  100559. write_biff_rec(ba, 0x0003, write_BIFF2NUM(R,C, v));
  100560. return;
  100561. case 'b': case 'e': write_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, cell.v, cell.t)); return;
  100562. /* TODO: codepage, sst */
  100563. case 's': case 'str':
  100564. write_biff_rec(ba, 0x0004, write_BIFF2LABEL(R, C, cell.v));
  100565. return;
  100566. }
  100567. write_biff_rec(ba, 0x0001, write_BIFF2Cell(null, R, C));
  100568. }
  100569. function write_ws_biff2(ba, ws, idx, opts) {
  100570. var dense = Array.isArray(ws);
  100571. var range = safe_decode_range(ws['!ref'] || "A1"), ref, rr = "", cols = [];
  100572. if(range.e.c > 0xFF || range.e.r > 0x3FFF) {
  100573. if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
  100574. range.e.c = Math.min(range.e.c, 0xFF);
  100575. range.e.r = Math.min(range.e.c, 0x3FFF);
  100576. ref = encode_range(range);
  100577. }
  100578. for(var R = range.s.r; R <= range.e.r; ++R) {
  100579. rr = encode_row(R);
  100580. for(var C = range.s.c; C <= range.e.c; ++C) {
  100581. if(R === range.s.r) cols[C] = encode_col(C);
  100582. ref = cols[C] + rr;
  100583. var cell = dense ? (ws[R]||[])[C] : ws[ref];
  100584. if(!cell) continue;
  100585. /* write cell */
  100586. write_ws_biff2_cell(ba, cell, R, C, opts);
  100587. }
  100588. }
  100589. }
  100590. /* Based on test files */
  100591. function write_biff2_buf(wb, opts) {
  100592. var o = opts || {};
  100593. if(DENSE != null && o.dense == null) o.dense = DENSE;
  100594. var ba = buf_array();
  100595. var idx = 0;
  100596. for(var i=0;i<wb.SheetNames.length;++i) if(wb.SheetNames[i] == o.sheet) idx=i;
  100597. if(idx == 0 && !!o.sheet && wb.SheetNames[0] != o.sheet) throw new Error("Sheet not found: " + o.sheet);
  100598. write_biff_rec(ba, 0x0009, write_BOF(wb, 0x10, o));
  100599. /* ... */
  100600. write_ws_biff2(ba, wb.Sheets[wb.SheetNames[idx]], idx, o, wb);
  100601. /* ... */
  100602. write_biff_rec(ba, 0x000A);
  100603. return ba.end();
  100604. }
  100605. function write_FONTS_biff8(ba, data, opts) {
  100606. write_biff_rec(ba, "Font", write_Font({
  100607. sz:12,
  100608. color: {theme:1},
  100609. name: "Arial",
  100610. family: 2,
  100611. scheme: "minor"
  100612. }, opts));
  100613. }
  100614. function write_FMTS_biff8(ba, NF, opts) {
  100615. if(!NF) return;
  100616. [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
  100617. for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_biff_rec(ba, "Format", write_Format(i, NF[i], opts));
  100618. });
  100619. }
  100620. function write_FEAT(ba, ws) {
  100621. /* [MS-XLS] 2.4.112 */
  100622. var o = new_buf(19);
  100623. o.write_shift(4, 0x867); o.write_shift(4, 0); o.write_shift(4, 0);
  100624. o.write_shift(2, 3); o.write_shift(1, 1); o.write_shift(4, 0);
  100625. write_biff_rec(ba, "FeatHdr", o);
  100626. /* [MS-XLS] 2.4.111 */
  100627. o = new_buf(39);
  100628. o.write_shift(4, 0x868); o.write_shift(4, 0); o.write_shift(4, 0);
  100629. o.write_shift(2, 3); o.write_shift(1, 0); o.write_shift(4, 0);
  100630. o.write_shift(2, 1); o.write_shift(4, 4); o.write_shift(2, 0);
  100631. write_Ref8U(safe_decode_range(ws['!ref']||"A1"), o);
  100632. o.write_shift(4, 4);
  100633. write_biff_rec(ba, "Feat", o);
  100634. }
  100635. function write_CELLXFS_biff8(ba, opts) {
  100636. for(var i = 0; i < 16; ++i) write_biff_rec(ba, "XF", write_XF({numFmtId:0, style:true}, 0, opts));
  100637. opts.cellXfs.forEach(function(c) {
  100638. write_biff_rec(ba, "XF", write_XF(c, 0, opts));
  100639. });
  100640. }
  100641. function write_ws_biff8_hlinks(ba, ws) {
  100642. for(var R=0; R<ws['!links'].length; ++R) {
  100643. var HL = ws['!links'][R];
  100644. write_biff_rec(ba, "HLink", write_HLink(HL));
  100645. if(HL[1].Tooltip) write_biff_rec(ba, "HLinkTooltip", write_HLinkTooltip(HL));
  100646. }
  100647. delete ws['!links'];
  100648. }
  100649. function write_ws_biff8_cell(ba, cell, R, C, opts) {
  100650. var os = 16 + get_cell_style(opts.cellXfs, cell, opts);
  100651. if(cell.v == null && !cell.bf) {
  100652. write_biff_rec(ba, "Blank", write_XLSCell(R, C, os));
  100653. return;
  100654. }
  100655. if(cell.bf) write_biff_rec(ba, "Formula", write_Formula(cell, R, C, opts, os));
  100656. else switch(cell.t) {
  100657. case 'd': case 'n':
  100658. var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v;
  100659. /* TODO: emit RK as appropriate */
  100660. write_biff_rec(ba, "Number", write_Number(R, C, v, os, opts));
  100661. break;
  100662. case 'b': case 'e':
  100663. write_biff_rec(ba, 0x0205, write_BoolErr(R, C, cell.v, os, opts, cell.t));
  100664. break;
  100665. /* TODO: codepage, sst */
  100666. case 's': case 'str':
  100667. write_biff_rec(ba, "Label", write_Label(R, C, cell.v, os, opts));
  100668. break;
  100669. default:
  100670. write_biff_rec(ba, "Blank", write_XLSCell(R, C, os));
  100671. }
  100672. }
  100673. /* [MS-XLS] 2.1.7.20.5 */
  100674. function write_ws_biff8(idx, opts, wb) {
  100675. var ba = buf_array();
  100676. var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
  100677. var _WB = ((wb||{}).Workbook||{});
  100678. var _sheet = ((_WB.Sheets||[])[idx]||{});
  100679. var dense = Array.isArray(ws);
  100680. var b8 = opts.biff == 8;
  100681. var ref, rr = "", cols = [];
  100682. var range = safe_decode_range(ws['!ref'] || "A1");
  100683. var MAX_ROWS = b8 ? 65536 : 16384;
  100684. if(range.e.c > 0xFF || range.e.r >= MAX_ROWS) {
  100685. if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
  100686. range.e.c = Math.min(range.e.c, 0xFF);
  100687. range.e.r = Math.min(range.e.c, MAX_ROWS-1);
  100688. }
  100689. write_biff_rec(ba, 0x0809, write_BOF(wb, 0x10, opts));
  100690. /* [Uncalced] Index */
  100691. write_biff_rec(ba, "CalcMode", writeuint16(1));
  100692. write_biff_rec(ba, "CalcCount", writeuint16(100));
  100693. write_biff_rec(ba, "CalcRefMode", writebool(true));
  100694. write_biff_rec(ba, "CalcIter", writebool(false));
  100695. write_biff_rec(ba, "CalcDelta", write_Xnum(0.001));
  100696. write_biff_rec(ba, "CalcSaveRecalc", writebool(true));
  100697. write_biff_rec(ba, "PrintRowCol", writebool(false));
  100698. write_biff_rec(ba, "PrintGrid", writebool(false));
  100699. write_biff_rec(ba, "GridSet", writeuint16(1));
  100700. write_biff_rec(ba, "Guts", write_Guts([0,0]));
  100701. /* DefaultRowHeight WsBool [Sync] [LPr] [HorizontalPageBreaks] [VerticalPageBreaks] */
  100702. /* Header (string) */
  100703. /* Footer (string) */
  100704. write_biff_rec(ba, "HCenter", writebool(false));
  100705. write_biff_rec(ba, "VCenter", writebool(false));
  100706. /* ... */
  100707. write_biff_rec(ba, 0x200, write_Dimensions(range, opts));
  100708. /* ... */
  100709. if(b8) ws['!links'] = [];
  100710. for(var R = range.s.r; R <= range.e.r; ++R) {
  100711. rr = encode_row(R);
  100712. for(var C = range.s.c; C <= range.e.c; ++C) {
  100713. if(R === range.s.r) cols[C] = encode_col(C);
  100714. ref = cols[C] + rr;
  100715. var cell = dense ? (ws[R]||[])[C] : ws[ref];
  100716. if(!cell) continue;
  100717. /* write cell */
  100718. write_ws_biff8_cell(ba, cell, R, C, opts);
  100719. if(b8 && cell.l) ws['!links'].push([ref, cell.l]);
  100720. }
  100721. }
  100722. var cname = _sheet.CodeName || _sheet.name || s;
  100723. /* ... */
  100724. if(b8 && _WB.Views) write_biff_rec(ba, "Window2", write_Window2(_WB.Views[0]));
  100725. /* ... */
  100726. if(b8 && (ws['!merges']||[]).length) write_biff_rec(ba, "MergeCells", write_MergeCells(ws['!merges']));
  100727. /* [LRng] *QUERYTABLE [PHONETICINFO] CONDFMTS */
  100728. if(b8) write_ws_biff8_hlinks(ba, ws);
  100729. /* [DVAL] */
  100730. write_biff_rec(ba, "CodeName", write_XLUnicodeString(cname, opts));
  100731. /* *WebPub *CellWatch [SheetExt] */
  100732. if(b8) write_FEAT(ba, ws);
  100733. /* *FEAT11 *RECORD12 */
  100734. write_biff_rec(ba, "EOF");
  100735. return ba.end();
  100736. }
  100737. /* [MS-XLS] 2.1.7.20.3 */
  100738. function write_biff8_global(wb, bufs, opts) {
  100739. var A = buf_array();
  100740. var _WB = ((wb||{}).Workbook||{});
  100741. var _sheets = (_WB.Sheets||[]);
  100742. var _wb = _WB.WBProps||{};
  100743. var b8 = opts.biff == 8, b5 = opts.biff == 5;
  100744. write_biff_rec(A, 0x0809, write_BOF(wb, 0x05, opts));
  100745. if(opts.bookType == "xla") write_biff_rec(A, "Addin");
  100746. write_biff_rec(A, "InterfaceHdr", b8 ? writeuint16(0x04b0) : null);
  100747. write_biff_rec(A, "Mms", writezeroes(2));
  100748. if(b5) write_biff_rec(A, "ToolbarHdr");
  100749. if(b5) write_biff_rec(A, "ToolbarEnd");
  100750. write_biff_rec(A, "InterfaceEnd");
  100751. write_biff_rec(A, "WriteAccess", write_WriteAccess("SheetJS", opts));
  100752. /* [FileSharing] */
  100753. write_biff_rec(A, "CodePage", writeuint16(b8 ? 0x04b0 : 0x04E4));
  100754. /* *2047 Lel */
  100755. if(b8) write_biff_rec(A, "DSF", writeuint16(0));
  100756. if(b8) write_biff_rec(A, "Excel9File");
  100757. write_biff_rec(A, "RRTabId", write_RRTabId(wb.SheetNames.length));
  100758. if(b8 && wb.vbaraw) write_biff_rec(A, "ObProj");
  100759. /* [ObNoMacros] */
  100760. if(b8 && wb.vbaraw) {
  100761. var cname = _wb.CodeName || "ThisWorkbook";
  100762. write_biff_rec(A, "CodeName", write_XLUnicodeString(cname, opts));
  100763. }
  100764. write_biff_rec(A, "BuiltInFnGroupCount", writeuint16(0x11));
  100765. /* *FnGroupName *FnGrp12 */
  100766. /* *Lbl */
  100767. /* [OleObjectSize] */
  100768. write_biff_rec(A, "WinProtect", writebool(false));
  100769. write_biff_rec(A, "Protect", writebool(false));
  100770. write_biff_rec(A, "Password", writeuint16(0));
  100771. if(b8) write_biff_rec(A, "Prot4Rev", writebool(false));
  100772. if(b8) write_biff_rec(A, "Prot4RevPass", writeuint16(0));
  100773. write_biff_rec(A, "Window1", write_Window1(opts));
  100774. write_biff_rec(A, "Backup", writebool(false));
  100775. write_biff_rec(A, "HideObj", writeuint16(0));
  100776. write_biff_rec(A, "Date1904", writebool(safe1904(wb)=="true"));
  100777. write_biff_rec(A, "CalcPrecision", writebool(true));
  100778. if(b8) write_biff_rec(A, "RefreshAll", writebool(false));
  100779. write_biff_rec(A, "BookBool", writeuint16(0));
  100780. /* ... */
  100781. write_FONTS_biff8(A, wb, opts);
  100782. write_FMTS_biff8(A, wb.SSF, opts);
  100783. write_CELLXFS_biff8(A, opts);
  100784. /* ... */
  100785. if(b8) write_biff_rec(A, "UsesELFs", writebool(false));
  100786. var a = A.end();
  100787. var C = buf_array();
  100788. /* METADATA [MTRSettings] [ForceFullCalculation] */
  100789. if(b8) write_biff_rec(C, "Country", write_Country());
  100790. /* *SUPBOOK *LBL *RTD [RecalcId] *HFPicture *MSODRAWINGGROUP */
  100791. /* BIFF8: [SST *Continue] ExtSST */
  100792. /* *WebPub [WOpt] [CrErr] [BookExt] *FeatHdr *DConn [THEME] [CompressPictures] [Compat12] [GUIDTypeLib] */
  100793. write_biff_rec(C, "EOF");
  100794. var c = C.end();
  100795. var B = buf_array();
  100796. var blen = 0, j = 0;
  100797. for(j = 0; j < wb.SheetNames.length; ++j) blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j].length;
  100798. var start = a.length + blen + c.length;
  100799. for(j = 0; j < wb.SheetNames.length; ++j) {
  100800. var _sheet = _sheets[j] || ({});
  100801. write_biff_rec(B, "BoundSheet8", write_BoundSheet8({pos:start, hs:_sheet.Hidden||0, dt:0, name:wb.SheetNames[j]}, opts));
  100802. start += bufs[j].length;
  100803. }
  100804. /* 1*BoundSheet8 */
  100805. var b = B.end();
  100806. if(blen != b.length) throw new Error("BS8 " + blen + " != " + b.length);
  100807. var out = [];
  100808. if(a.length) out.push(a);
  100809. if(b.length) out.push(b);
  100810. if(c.length) out.push(c);
  100811. return __toBuffer([out]);
  100812. }
  100813. /* [MS-XLS] 2.1.7.20 Workbook Stream */
  100814. function write_biff8_buf(wb, opts) {
  100815. var o = opts || {};
  100816. var bufs = [];
  100817. if(wb && !wb.SSF) {
  100818. wb.SSF = SSF.get_table();
  100819. }
  100820. if(wb && wb.SSF) {
  100821. make_ssf(SSF); SSF.load_table(wb.SSF);
  100822. // $FlowIgnore
  100823. o.revssf = evert_num(wb.SSF); o.revssf[wb.SSF[65535]] = 0;
  100824. o.ssf = wb.SSF;
  100825. }
  100826. o.Strings = []; o.Strings.Count = 0; o.Strings.Unique = 0;
  100827. fix_write_opts(o);
  100828. o.cellXfs = [];
  100829. get_cell_style(o.cellXfs, {}, {revssf:{"General":0}});
  100830. if(!wb.Props) wb.Props = {};
  100831. for(var i = 0; i < wb.SheetNames.length; ++i) bufs[bufs.length] = write_ws_biff8(i, o, wb);
  100832. bufs.unshift(write_biff8_global(wb, bufs, o));
  100833. return __toBuffer([bufs]);
  100834. }
  100835. function write_biff_buf(wb, opts) {
  100836. var o = opts || {};
  100837. switch(o.biff || 2) {
  100838. case 8: case 5: return write_biff8_buf(wb, opts);
  100839. case 4: case 3: case 2: return write_biff2_buf(wb, opts);
  100840. }
  100841. throw new Error("invalid type " + o.bookType + " for BIFF");
  100842. }
  100843. /* note: browser DOM element cannot see mso- style attrs, must parse */
  100844. var HTML_ = (function() {
  100845. function html_to_sheet(str, _opts) {
  100846. var opts = _opts || {};
  100847. if(DENSE != null && opts.dense == null) opts.dense = DENSE;
  100848. var ws = opts.dense ? ([]) : ({});
  100849. str = str.replace(/<!--.*?-->/g, "");
  100850. var mtch = str.match(/<table/i);
  100851. if(!mtch) throw new Error("Invalid HTML: could not find <table>");
  100852. var mtch2 = str.match(/<\/table/i);
  100853. var i = mtch.index, j = mtch2 && mtch2.index || str.length;
  100854. var rows = split_regex(str.slice(i, j), /(:?<tr[^>]*>)/i, "<tr>");
  100855. var R = -1, C = 0, RS = 0, CS = 0;
  100856. var range = {s:{r:10000000, c:10000000},e:{r:0,c:0}};
  100857. var merges = [];
  100858. for(i = 0; i < rows.length; ++i) {
  100859. var row = rows[i].trim();
  100860. var hd = row.slice(0,3).toLowerCase();
  100861. if(hd == "<tr") { ++R; if(opts.sheetRows && opts.sheetRows <= R) { --R; break; } C = 0; continue; }
  100862. if(hd != "<td" && hd != "<th") continue;
  100863. var cells = row.split(/<\/t[dh]>/i);
  100864. for(j = 0; j < cells.length; ++j) {
  100865. var cell = cells[j].trim();
  100866. if(!cell.match(/<t[dh]/i)) continue;
  100867. var m = cell, cc = 0;
  100868. /* TODO: parse styles etc */
  100869. while(m.charAt(0) == "<" && (cc = m.indexOf(">")) > -1) m = m.slice(cc+1);
  100870. for(var midx = 0; midx < merges.length; ++midx) {
  100871. var _merge = merges[midx];
  100872. if(_merge.s.c == C && _merge.s.r < R && R <= _merge.e.r) { C = _merge.e.c + 1; midx = -1; }
  100873. }
  100874. var tag = parsexmltag(cell.slice(0, cell.indexOf(">")));
  100875. CS = tag.colspan ? +tag.colspan : 1;
  100876. if((RS = +tag.rowspan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
  100877. var _t = tag.t || "";
  100878. /* TODO: generate stub cells */
  100879. if(!m.length) { C += CS; continue; }
  100880. m = htmldecode(m);
  100881. if(range.s.r > R) range.s.r = R; if(range.e.r < R) range.e.r = R;
  100882. if(range.s.c > C) range.s.c = C; if(range.e.c < C) range.e.c = C;
  100883. if(!m.length) continue;
  100884. var o = {t:'s', v:m};
  100885. if(opts.raw || !m.trim().length || _t == 's'){}
  100886. else if(m === 'TRUE') o = {t:'b', v:true};
  100887. else if(m === 'FALSE') o = {t:'b', v:false};
  100888. else if(!isNaN(fuzzynum(m))) o = {t:'n', v:fuzzynum(m)};
  100889. else if(!isNaN(fuzzydate(m).getDate())) {
  100890. o = ({t:'d', v:parseDate(m)});
  100891. if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)});
  100892. o.z = opts.dateNF || SSF._table[14];
  100893. }
  100894. if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = o; }
  100895. else ws[encode_cell({r:R, c:C})] = o;
  100896. C += CS;
  100897. }
  100898. }
  100899. ws['!ref'] = encode_range(range);
  100900. if(merges.length) ws["!merges"] = merges;
  100901. return ws;
  100902. }
  100903. function html_to_book(str, opts) {
  100904. return sheet_to_workbook(html_to_sheet(str, opts), opts);
  100905. }
  100906. function make_html_row(ws, r, R, o) {
  100907. var M = (ws['!merges'] ||[]);
  100908. var oo = [];
  100909. for(var C = r.s.c; C <= r.e.c; ++C) {
  100910. var RS = 0, CS = 0;
  100911. for(var j = 0; j < M.length; ++j) {
  100912. if(M[j].s.r > R || M[j].s.c > C) continue;
  100913. if(M[j].e.r < R || M[j].e.c < C) continue;
  100914. if(M[j].s.r < R || M[j].s.c < C) { RS = -1; break; }
  100915. RS = M[j].e.r - M[j].s.r + 1; CS = M[j].e.c - M[j].s.c + 1; break;
  100916. }
  100917. if(RS < 0) continue;
  100918. var coord = encode_cell({r:R,c:C});
  100919. var cell = o.dense ? (ws[R]||[])[C] : ws[coord];
  100920. /* TODO: html entities */
  100921. var w = (cell && cell.v != null) && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.w) || "")) || "";
  100922. var sp = ({});
  100923. if(RS > 1) sp.rowspan = RS;
  100924. if(CS > 1) sp.colspan = CS;
  100925. sp.t = cell && cell.t || 'z';
  100926. if(o.editable) w = '<span contenteditable="true">' + w + '</span>';
  100927. sp.id = (o.id || "sjs") + "-" + coord;
  100928. oo.push(writextag('td', w, sp));
  100929. }
  100930. var preamble = "<tr>";
  100931. return preamble + oo.join("") + "</tr>";
  100932. }
  100933. function make_html_preamble(ws, R, o) {
  100934. var out = [];
  100935. return out.join("") + '<table' + (o && o.id ? ' id="' + o.id + '"' : "") + '>';
  100936. }
  100937. var _BEGIN = '<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>';
  100938. var _END = '</body></html>';
  100939. function sheet_to_html(ws, opts/*, wb:?Workbook*/) {
  100940. var o = opts || {};
  100941. var header = o.header != null ? o.header : _BEGIN;
  100942. var footer = o.footer != null ? o.footer : _END;
  100943. var out = [header];
  100944. var r = decode_range(ws['!ref']);
  100945. o.dense = Array.isArray(ws);
  100946. out.push(make_html_preamble(ws, r, o));
  100947. for(var R = r.s.r; R <= r.e.r; ++R) out.push(make_html_row(ws, r, R, o));
  100948. out.push("</table>" + footer);
  100949. return out.join("");
  100950. }
  100951. return {
  100952. to_workbook: html_to_book,
  100953. to_sheet: html_to_sheet,
  100954. _row: make_html_row,
  100955. BEGIN: _BEGIN,
  100956. END: _END,
  100957. _preamble: make_html_preamble,
  100958. from_sheet: sheet_to_html
  100959. };
  100960. })();
  100961. function parse_dom_table(table, _opts) {
  100962. var opts = _opts || {};
  100963. if(DENSE != null) opts.dense = DENSE;
  100964. var ws = opts.dense ? ([]) : ({});
  100965. var rows = table.getElementsByTagName('tr');
  100966. var sheetRows = opts.sheetRows || 10000000;
  100967. var range = {s:{r:0,c:0},e:{r:0,c:0}};
  100968. var merges = [], midx = 0;
  100969. var rowinfo = [];
  100970. var _R = 0, R = 0, _C = 0, C = 0, RS = 0, CS = 0;
  100971. for(; _R < rows.length && R < sheetRows; ++_R) {
  100972. var row = rows[_R];
  100973. if (is_dom_element_hidden(row)) {
  100974. if (opts.display) continue;
  100975. rowinfo[R] = {hidden: true};
  100976. }
  100977. var elts = (row.children);
  100978. for(_C = C = 0; _C < elts.length; ++_C) {
  100979. var elt = elts[_C];
  100980. if (opts.display && is_dom_element_hidden(elt)) continue;
  100981. var v = htmldecode(elt.innerHTML);
  100982. for(midx = 0; midx < merges.length; ++midx) {
  100983. var m = merges[midx];
  100984. if(m.s.c == C && m.s.r <= R && R <= m.e.r) { C = m.e.c+1; midx = -1; }
  100985. }
  100986. /* TODO: figure out how to extract nonstandard mso- style */
  100987. CS = +elt.getAttribute("colspan") || 1;
  100988. if((RS = +elt.getAttribute("rowspan"))>0 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
  100989. var o = {t:'s', v:v};
  100990. var _t = elt.getAttribute("t") || "";
  100991. if(v != null) {
  100992. if(v.length == 0) o.t = _t || 'z';
  100993. else if(opts.raw || v.trim().length == 0 || _t == "s"){}
  100994. else if(v === 'TRUE') o = {t:'b', v:true};
  100995. else if(v === 'FALSE') o = {t:'b', v:false};
  100996. else if(!isNaN(fuzzynum(v))) o = {t:'n', v:fuzzynum(v)};
  100997. else if(!isNaN(fuzzydate(v).getDate())) {
  100998. o = ({t:'d', v:parseDate(v)});
  100999. if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)});
  101000. o.z = opts.dateNF || SSF._table[14];
  101001. }
  101002. }
  101003. if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = o; }
  101004. else ws[encode_cell({c:C, r:R})] = o;
  101005. if(range.e.c < C) range.e.c = C;
  101006. C += CS;
  101007. }
  101008. ++R;
  101009. }
  101010. if(merges.length) ws['!merges'] = merges;
  101011. if(rowinfo.length) ws['!rows'] = rowinfo;
  101012. range.e.r = R - 1;
  101013. ws['!ref'] = encode_range(range);
  101014. if(R >= sheetRows) ws['!fullref'] = encode_range((range.e.r = rows.length-_R+R-1,range)); // We can count the real number of rows to parse but we don't to improve the performance
  101015. return ws;
  101016. }
  101017. function table_to_book(table, opts) {
  101018. return sheet_to_workbook(parse_dom_table(table, opts), opts);
  101019. }
  101020. function is_dom_element_hidden(element) {
  101021. var display = '';
  101022. var get_computed_style = get_get_computed_style_function(element);
  101023. if(get_computed_style) display = get_computed_style(element).getPropertyValue('display');
  101024. if(!display) display = element.style.display; // Fallback for cases when getComputedStyle is not available (e.g. an old browser or some Node.js environments) or doesn't work (e.g. if the element is not inserted to a document)
  101025. return display === 'none';
  101026. }
  101027. /* global getComputedStyle */
  101028. function get_get_computed_style_function(element) {
  101029. // The proper getComputedStyle implementation is the one defined in the element window
  101030. if(element.ownerDocument.defaultView && typeof element.ownerDocument.defaultView.getComputedStyle === 'function') return element.ownerDocument.defaultView.getComputedStyle;
  101031. // If it is not available, try to get one from the global namespace
  101032. if(typeof getComputedStyle === 'function') return getComputedStyle;
  101033. return null;
  101034. }
  101035. /* OpenDocument */
  101036. var parse_content_xml = (function() {
  101037. var parse_text_p = function(text) {
  101038. /* 6.1.2 White Space Characters */
  101039. var fixed = text
  101040. .replace(/[\t\r\n]/g, " ").trim().replace(/ +/g, " ")
  101041. .replace(/<text:s\/>/g," ")
  101042. .replace(/<text:s text:c="(\d+)"\/>/g, function($$,$1) { return Array(parseInt($1,10)+1).join(" "); })
  101043. .replace(/<text:tab[^>]*\/>/g,"\t")
  101044. .replace(/<text:line-break\/>/g,"\n");
  101045. var v = unescapexml(fixed.replace(/<[^>]*>/g,""));
  101046. return [v];
  101047. };
  101048. var number_formats = {
  101049. /* ods name: [short ssf fmt, long ssf fmt] */
  101050. day: ["d", "dd"],
  101051. month: ["m", "mm"],
  101052. year: ["y", "yy"],
  101053. hours: ["h", "hh"],
  101054. minutes: ["m", "mm"],
  101055. seconds: ["s", "ss"],
  101056. "am-pm": ["A/P", "AM/PM"],
  101057. "day-of-week": ["ddd", "dddd"],
  101058. era: ["e", "ee"],
  101059. /* there is no native representation of LO "Q" format */
  101060. quarter: ["\\Qm", "m\\\"th quarter\""]
  101061. };
  101062. return function pcx(d, _opts) {
  101063. var opts = _opts || {};
  101064. if(DENSE != null && opts.dense == null) opts.dense = DENSE;
  101065. var str = xlml_normalize(d);
  101066. var state = [], tmp;
  101067. var tag;
  101068. var NFtag = {name:""}, NF = "", pidx = 0;
  101069. var sheetag;
  101070. var rowtag;
  101071. var Sheets = {}, SheetNames = [];
  101072. var ws = opts.dense ? ([]) : ({});
  101073. var Rn, q;
  101074. var ctag = ({value:""});
  101075. var textp = "", textpidx = 0, textptag;
  101076. var textR = [];
  101077. var R = -1, C = -1, range = {s: {r:1000000,c:10000000}, e: {r:0, c:0}};
  101078. var row_ol = 0;
  101079. var number_format_map = {};
  101080. var merges = [], mrange = {}, mR = 0, mC = 0;
  101081. var rowinfo = [], rowpeat = 1, colpeat = 1;
  101082. var arrayf = [];
  101083. var WB = {Names:[]};
  101084. var atag = ({});
  101085. var _Ref = ["", ""];
  101086. var comments = [], comment = ({});
  101087. var creator = "", creatoridx = 0;
  101088. var isstub = false, intable = false;
  101089. var i = 0;
  101090. xlmlregex.lastIndex = 0;
  101091. str = str.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");
  101092. while((Rn = xlmlregex.exec(str))) switch((Rn[3]=Rn[3].replace(/_.*$/,""))) {
  101093. case 'table': case '工作表': // 9.1.2 <table:table>
  101094. if(Rn[1]==='/') {
  101095. if(range.e.c >= range.s.c && range.e.r >= range.s.r) ws['!ref'] = encode_range(range);
  101096. if(opts.sheetRows > 0 && opts.sheetRows <= range.e.r) {
  101097. ws['!fullref'] = ws['!ref'];
  101098. range.e.r = opts.sheetRows - 1;
  101099. ws['!ref'] = encode_range(range);
  101100. }
  101101. if(merges.length) ws['!merges'] = merges;
  101102. if(rowinfo.length) ws["!rows"] = rowinfo;
  101103. sheetag.name = sheetag['名称'] || sheetag.name;
  101104. if(typeof JSON !== 'undefined') JSON.stringify(sheetag);
  101105. SheetNames.push(sheetag.name);
  101106. Sheets[sheetag.name] = ws;
  101107. intable = false;
  101108. }
  101109. else if(Rn[0].charAt(Rn[0].length-2) !== '/') {
  101110. sheetag = parsexmltag(Rn[0], false);
  101111. R = C = -1;
  101112. range.s.r = range.s.c = 10000000; range.e.r = range.e.c = 0;
  101113. ws = opts.dense ? ([]) : ({}); merges = [];
  101114. rowinfo = [];
  101115. intable = true;
  101116. }
  101117. break;
  101118. case 'table-row-group': // 9.1.9 <table:table-row-group>
  101119. if(Rn[1] === "/") --row_ol; else ++row_ol;
  101120. break;
  101121. case 'table-row': case '行': // 9.1.3 <table:table-row>
  101122. if(Rn[1] === '/') { R+=rowpeat; rowpeat = 1; break; }
  101123. rowtag = parsexmltag(Rn[0], false);
  101124. if(rowtag['行号']) R = rowtag['行号'] - 1; else if(R == -1) R = 0;
  101125. rowpeat = +rowtag['number-rows-repeated'] || 1;
  101126. /* TODO: remove magic */
  101127. if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
  101128. C = -1; break;
  101129. case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
  101130. if(Rn[1] !== '/') ++C;
  101131. if(opts.sheetStubs) {
  101132. if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = {t:'z'}; }
  101133. else ws[encode_cell({r:R,c:C})] = {t:'z'};
  101134. }
  101135. textp = ""; textR = [];
  101136. break; /* stub */
  101137. case 'table-cell': case '数据':
  101138. if(Rn[0].charAt(Rn[0].length-2) === '/') {
  101139. ++C;
  101140. ctag = parsexmltag(Rn[0], false);
  101141. colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
  101142. q = ({t:'z', v:null});
  101143. if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
  101144. if((ctag['数据类型'] || ctag['value-type']) == "string") {
  101145. q.t = "s"; q.v = unescapexml(ctag['string-value'] || "");
  101146. if(opts.dense) {
  101147. if(!ws[R]) ws[R] = [];
  101148. ws[R][C] = q;
  101149. } else {
  101150. ws[encode_cell({r:R,c:C})] = q;
  101151. }
  101152. }
  101153. C+= colpeat-1;
  101154. } else if(Rn[1]!=='/') {
  101155. ++C;
  101156. colpeat = 1;
  101157. var rptR = rowpeat ? R + rowpeat - 1 : R;
  101158. if(C > range.e.c) range.e.c = C;
  101159. if(C < range.s.c) range.s.c = C;
  101160. if(R < range.s.r) range.s.r = R;
  101161. if(rptR > range.e.r) range.e.r = rptR;
  101162. ctag = parsexmltag(Rn[0], false);
  101163. comments = []; comment = ({});
  101164. q = ({t:ctag['数据类型'] || ctag['value-type'], v:null});
  101165. if(opts.cellFormula) {
  101166. if(ctag.formula) ctag.formula = unescapexml(ctag.formula);
  101167. if(ctag['number-matrix-columns-spanned'] && ctag['number-matrix-rows-spanned']) {
  101168. mR = parseInt(ctag['number-matrix-rows-spanned'],10) || 0;
  101169. mC = parseInt(ctag['number-matrix-columns-spanned'],10) || 0;
  101170. mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
  101171. q.F = encode_range(mrange);
  101172. arrayf.push([mrange, q.F]);
  101173. }
  101174. if(ctag.formula) q.f = ods_to_csf_formula(ctag.formula);
  101175. else for(i = 0; i < arrayf.length; ++i)
  101176. if(R >= arrayf[i][0].s.r && R <= arrayf[i][0].e.r)
  101177. if(C >= arrayf[i][0].s.c && C <= arrayf[i][0].e.c)
  101178. q.F = arrayf[i][1];
  101179. }
  101180. if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
  101181. mR = parseInt(ctag['number-rows-spanned'],10) || 0;
  101182. mC = parseInt(ctag['number-columns-spanned'],10) || 0;
  101183. mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
  101184. merges.push(mrange);
  101185. }
  101186. /* 19.675.2 table:number-columns-repeated */
  101187. if(ctag['number-columns-repeated']) colpeat = parseInt(ctag['number-columns-repeated'], 10);
  101188. /* 19.385 office:value-type */
  101189. switch(q.t) {
  101190. case 'boolean': q.t = 'b'; q.v = parsexmlbool(ctag['boolean-value']); break;
  101191. case 'float': q.t = 'n'; q.v = parseFloat(ctag.value); break;
  101192. case 'percentage': q.t = 'n'; q.v = parseFloat(ctag.value); break;
  101193. case 'currency': q.t = 'n'; q.v = parseFloat(ctag.value); break;
  101194. case 'date': q.t = 'd'; q.v = parseDate(ctag['date-value']);
  101195. if(!opts.cellDates) { q.t = 'n'; q.v = datenum(q.v); }
  101196. q.z = 'm/d/yy'; break;
  101197. case 'time': q.t = 'n'; q.v = parse_isodur(ctag['time-value'])/86400; break;
  101198. case 'number': q.t = 'n'; q.v = parseFloat(ctag['数据数值']); break;
  101199. default:
  101200. if(q.t === 'string' || q.t === 'text' || !q.t) {
  101201. q.t = 's';
  101202. if(ctag['string-value'] != null) { textp = unescapexml(ctag['string-value']); textR = []; }
  101203. } else throw new Error('Unsupported value type ' + q.t);
  101204. }
  101205. } else {
  101206. isstub = false;
  101207. if(q.t === 's') {
  101208. q.v = textp || '';
  101209. if(textR.length) q.R = textR;
  101210. isstub = textpidx == 0;
  101211. }
  101212. if(atag.Target) q.l = atag;
  101213. if(comments.length > 0) { q.c = comments; comments = []; }
  101214. if(textp && opts.cellText !== false) q.w = textp;
  101215. if(!isstub || opts.sheetStubs) {
  101216. if(!(opts.sheetRows && opts.sheetRows <= R)) {
  101217. for(var rpt = 0; rpt < rowpeat; ++rpt) {
  101218. colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
  101219. if(opts.dense) {
  101220. if(!ws[R + rpt]) ws[R + rpt] = [];
  101221. ws[R + rpt][C] = rpt == 0 ? q : dup(q);
  101222. while(--colpeat > 0) ws[R + rpt][C + colpeat] = dup(q);
  101223. } else {
  101224. ws[encode_cell({r:R + rpt,c:C})] = q;
  101225. while(--colpeat > 0) ws[encode_cell({r:R + rpt,c:C + colpeat})] = dup(q);
  101226. }
  101227. if(range.e.c <= C) range.e.c = C;
  101228. }
  101229. }
  101230. }
  101231. colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
  101232. C += colpeat-1; colpeat = 0;
  101233. q = {};
  101234. textp = ""; textR = [];
  101235. }
  101236. atag = ({});
  101237. break; // 9.1.4 <table:table-cell>
  101238. /* pure state */
  101239. case 'document': // TODO: <office:document> is the root for FODS
  101240. case 'document-content': case '电子表格文档': // 3.1.3.2 <office:document-content>
  101241. case 'spreadsheet': case '主体': // 3.7 <office:spreadsheet>
  101242. case 'scripts': // 3.12 <office:scripts>
  101243. case 'styles': // TODO <office:styles>
  101244. case 'font-face-decls': // 3.14 <office:font-face-decls>
  101245. if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
  101246. else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
  101247. break;
  101248. case 'annotation': // 14.1 <office:annotation>
  101249. if(Rn[1]==='/'){
  101250. if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;
  101251. comment.t = textp;
  101252. if(textR.length) comment.R = textR;
  101253. comment.a = creator;
  101254. comments.push(comment);
  101255. }
  101256. else if(Rn[0].charAt(Rn[0].length-2) !== '/') {state.push([Rn[3], false]);}
  101257. creator = ""; creatoridx = 0;
  101258. textp = ""; textpidx = 0; textR = [];
  101259. break;
  101260. case 'creator': // 4.3.2.7 <dc:creator>
  101261. if(Rn[1]==='/') { creator = str.slice(creatoridx,Rn.index); }
  101262. else creatoridx = Rn.index + Rn[0].length;
  101263. break;
  101264. /* ignore state */
  101265. case 'meta': case '元数据': // TODO: <office:meta> <uof:元数据> FODS/UOF
  101266. case 'settings': // TODO: <office:settings>
  101267. case 'config-item-set': // TODO: <office:config-item-set>
  101268. case 'config-item-map-indexed': // TODO: <office:config-item-map-indexed>
  101269. case 'config-item-map-entry': // TODO: <office:config-item-map-entry>
  101270. case 'config-item-map-named': // TODO: <office:config-item-map-entry>
  101271. case 'shapes': // 9.2.8 <table:shapes>
  101272. case 'frame': // 10.4.2 <draw:frame>
  101273. case 'text-box': // 10.4.3 <draw:text-box>
  101274. case 'image': // 10.4.4 <draw:image>
  101275. case 'data-pilot-tables': // 9.6.2 <table:data-pilot-tables>
  101276. case 'list-style': // 16.30 <text:list-style>
  101277. case 'form': // 13.13 <form:form>
  101278. case 'dde-links': // 9.8 <table:dde-links>
  101279. case 'event-listeners': // TODO
  101280. case 'chart': // TODO
  101281. if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
  101282. else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], false]);
  101283. textp = ""; textpidx = 0; textR = [];
  101284. break;
  101285. case 'scientific-number': // TODO: <number:scientific-number>
  101286. break;
  101287. case 'currency-symbol': // TODO: <number:currency-symbol>
  101288. break;
  101289. case 'currency-style': // TODO: <number:currency-style>
  101290. break;
  101291. case 'number-style': // 16.27.2 <number:number-style>
  101292. case 'percentage-style': // 16.27.9 <number:percentage-style>
  101293. case 'date-style': // 16.27.10 <number:date-style>
  101294. case 'time-style': // 16.27.18 <number:time-style>
  101295. if(Rn[1]==='/'){
  101296. number_format_map[NFtag.name] = NF;
  101297. if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;
  101298. } else if(Rn[0].charAt(Rn[0].length-2) !== '/') {
  101299. NF = "";
  101300. NFtag = parsexmltag(Rn[0], false);
  101301. state.push([Rn[3], true]);
  101302. } break;
  101303. case 'script': break; // 3.13 <office:script>
  101304. case 'libraries': break; // TODO: <ooo:libraries>
  101305. case 'automatic-styles': break; // 3.15.3 <office:automatic-styles>
  101306. case 'master-styles': break; // TODO: <office:master-styles>
  101307. case 'default-style': // TODO: <style:default-style>
  101308. case 'page-layout': break; // TODO: <style:page-layout>
  101309. case 'style': // 16.2 <style:style>
  101310. break;
  101311. case 'map': break; // 16.3 <style:map>
  101312. case 'font-face': break; // 16.21 <style:font-face>
  101313. case 'paragraph-properties': break; // 17.6 <style:paragraph-properties>
  101314. case 'table-properties': break; // 17.15 <style:table-properties>
  101315. case 'table-column-properties': break; // 17.16 <style:table-column-properties>
  101316. case 'table-row-properties': break; // 17.17 <style:table-row-properties>
  101317. case 'table-cell-properties': break; // 17.18 <style:table-cell-properties>
  101318. case 'number': // 16.27.3 <number:number>
  101319. switch(state[state.length-1][0]) {
  101320. case 'time-style':
  101321. case 'date-style':
  101322. tag = parsexmltag(Rn[0], false);
  101323. NF += number_formats[Rn[3]][tag.style==='long'?1:0]; break;
  101324. } break;
  101325. case 'fraction': break; // TODO 16.27.6 <number:fraction>
  101326. case 'day': // 16.27.11 <number:day>
  101327. case 'month': // 16.27.12 <number:month>
  101328. case 'year': // 16.27.13 <number:year>
  101329. case 'era': // 16.27.14 <number:era>
  101330. case 'day-of-week': // 16.27.15 <number:day-of-week>
  101331. case 'week-of-year': // 16.27.16 <number:week-of-year>
  101332. case 'quarter': // 16.27.17 <number:quarter>
  101333. case 'hours': // 16.27.19 <number:hours>
  101334. case 'minutes': // 16.27.20 <number:minutes>
  101335. case 'seconds': // 16.27.21 <number:seconds>
  101336. case 'am-pm': // 16.27.22 <number:am-pm>
  101337. switch(state[state.length-1][0]) {
  101338. case 'time-style':
  101339. case 'date-style':
  101340. tag = parsexmltag(Rn[0], false);
  101341. NF += number_formats[Rn[3]][tag.style==='long'?1:0]; break;
  101342. } break;
  101343. case 'boolean-style': break; // 16.27.23 <number:boolean-style>
  101344. case 'boolean': break; // 16.27.24 <number:boolean>
  101345. case 'text-style': break; // 16.27.25 <number:text-style>
  101346. case 'text': // 16.27.26 <number:text>
  101347. if(Rn[0].slice(-2) === "/>") break;
  101348. else if(Rn[1]==="/") switch(state[state.length-1][0]) {
  101349. case 'number-style':
  101350. case 'date-style':
  101351. case 'time-style':
  101352. NF += str.slice(pidx, Rn.index);
  101353. break;
  101354. }
  101355. else pidx = Rn.index + Rn[0].length;
  101356. break;
  101357. case 'named-range': // 9.4.12 <table:named-range>
  101358. tag = parsexmltag(Rn[0], false);
  101359. _Ref = ods_to_csf_3D(tag['cell-range-address']);
  101360. var nrange = ({Name:tag.name, Ref:_Ref[0] + '!' + _Ref[1]});
  101361. if(intable) nrange.Sheet = SheetNames.length;
  101362. WB.Names.push(nrange);
  101363. break;
  101364. case 'text-content': break; // 16.27.27 <number:text-content>
  101365. case 'text-properties': break; // 16.27.27 <style:text-properties>
  101366. case 'embedded-text': break; // 16.27.4 <number:embedded-text>
  101367. case 'body': case '电子表格': break; // 3.3 16.9.6 19.726.3
  101368. case 'forms': break; // 12.25.2 13.2
  101369. case 'table-column': break; // 9.1.6 <table:table-column>
  101370. case 'table-header-rows': break; // 9.1.7 <table:table-header-rows>
  101371. case 'table-rows': break; // 9.1.12 <table:table-rows>
  101372. /* TODO: outline levels */
  101373. case 'table-column-group': break; // 9.1.10 <table:table-column-group>
  101374. case 'table-header-columns': break; // 9.1.11 <table:table-header-columns>
  101375. case 'table-columns': break; // 9.1.12 <table:table-columns>
  101376. case 'null-date': break; // 9.4.2 <table:null-date> TODO: date1904
  101377. case 'graphic-properties': break; // 17.21 <style:graphic-properties>
  101378. case 'calculation-settings': break; // 9.4.1 <table:calculation-settings>
  101379. case 'named-expressions': break; // 9.4.11 <table:named-expressions>
  101380. case 'label-range': break; // 9.4.9 <table:label-range>
  101381. case 'label-ranges': break; // 9.4.10 <table:label-ranges>
  101382. case 'named-expression': break; // 9.4.13 <table:named-expression>
  101383. case 'sort': break; // 9.4.19 <table:sort>
  101384. case 'sort-by': break; // 9.4.20 <table:sort-by>
  101385. case 'sort-groups': break; // 9.4.22 <table:sort-groups>
  101386. case 'tab': break; // 6.1.4 <text:tab>
  101387. case 'line-break': break; // 6.1.5 <text:line-break>
  101388. case 'span': break; // 6.1.7 <text:span>
  101389. case 'p': case '文本串': // 5.1.3 <text:p>
  101390. if(Rn[1]==='/' && (!ctag || !ctag['string-value'])) {
  101391. var ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag);
  101392. textp = (textp.length > 0 ? textp + "\n" : "") + ptp[0];
  101393. } else { textptag = parsexmltag(Rn[0], false); textpidx = Rn.index + Rn[0].length; }
  101394. break; // <text:p>
  101395. case 's': break; // <text:s>
  101396. case 'database-range': // 9.4.15 <table:database-range>
  101397. if(Rn[1]==='/') break;
  101398. try {
  101399. _Ref = ods_to_csf_3D(parsexmltag(Rn[0])['target-range-address']);
  101400. Sheets[_Ref[0]]['!autofilter'] = { ref:_Ref[1] };
  101401. } catch(e) {/* empty */}
  101402. break;
  101403. case 'date': break; // <*:date>
  101404. case 'object': break; // 10.4.6.2 <draw:object>
  101405. case 'title': case '标题': break; // <*:title> OR <uof:标题>
  101406. case 'desc': break; // <*:desc>
  101407. case 'binary-data': break; // 10.4.5 TODO: b64 blob
  101408. /* 9.2 Advanced Tables */
  101409. case 'table-source': break; // 9.2.6
  101410. case 'scenario': break; // 9.2.6
  101411. case 'iteration': break; // 9.4.3 <table:iteration>
  101412. case 'content-validations': break; // 9.4.4 <table:
  101413. case 'content-validation': break; // 9.4.5 <table:
  101414. case 'help-message': break; // 9.4.6 <table:
  101415. case 'error-message': break; // 9.4.7 <table:
  101416. case 'database-ranges': break; // 9.4.14 <table:database-ranges>
  101417. case 'filter': break; // 9.5.2 <table:filter>
  101418. case 'filter-and': break; // 9.5.3 <table:filter-and>
  101419. case 'filter-or': break; // 9.5.4 <table:filter-or>
  101420. case 'filter-condition': break; // 9.5.5 <table:filter-condition>
  101421. case 'list-level-style-bullet': break; // 16.31 <text:
  101422. case 'list-level-style-number': break; // 16.32 <text:
  101423. case 'list-level-properties': break; // 17.19 <style:
  101424. /* 7.3 Document Fields */
  101425. case 'sender-firstname': // 7.3.6.2
  101426. case 'sender-lastname': // 7.3.6.3
  101427. case 'sender-initials': // 7.3.6.4
  101428. case 'sender-title': // 7.3.6.5
  101429. case 'sender-position': // 7.3.6.6
  101430. case 'sender-email': // 7.3.6.7
  101431. case 'sender-phone-private': // 7.3.6.8
  101432. case 'sender-fax': // 7.3.6.9
  101433. case 'sender-company': // 7.3.6.10
  101434. case 'sender-phone-work': // 7.3.6.11
  101435. case 'sender-street': // 7.3.6.12
  101436. case 'sender-city': // 7.3.6.13
  101437. case 'sender-postal-code': // 7.3.6.14
  101438. case 'sender-country': // 7.3.6.15
  101439. case 'sender-state-or-province': // 7.3.6.16
  101440. case 'author-name': // 7.3.7.1
  101441. case 'author-initials': // 7.3.7.2
  101442. case 'chapter': // 7.3.8
  101443. case 'file-name': // 7.3.9
  101444. case 'template-name': // 7.3.9
  101445. case 'sheet-name': // 7.3.9
  101446. break;
  101447. case 'event-listener':
  101448. break;
  101449. /* TODO: FODS Properties */
  101450. case 'initial-creator':
  101451. case 'creation-date':
  101452. case 'print-date':
  101453. case 'generator':
  101454. case 'document-statistic':
  101455. case 'user-defined':
  101456. case 'editing-duration':
  101457. case 'editing-cycles':
  101458. break;
  101459. /* TODO: FODS Config */
  101460. case 'config-item':
  101461. break;
  101462. /* TODO: style tokens */
  101463. case 'page-number': break; // TODO <text:page-number>
  101464. case 'page-count': break; // TODO <text:page-count>
  101465. case 'time': break; // TODO <text:time>
  101466. /* 9.3 Advanced Table Cells */
  101467. case 'cell-range-source': break; // 9.3.1 <table:
  101468. case 'detective': break; // 9.3.2 <table:
  101469. case 'operation': break; // 9.3.3 <table:
  101470. case 'highlighted-range': break; // 9.3.4 <table:
  101471. /* 9.6 Data Pilot Tables <table: */
  101472. case 'data-pilot-table': // 9.6.3
  101473. case 'source-cell-range': // 9.6.5
  101474. case 'source-service': // 9.6.6
  101475. case 'data-pilot-field': // 9.6.7
  101476. case 'data-pilot-level': // 9.6.8
  101477. case 'data-pilot-subtotals': // 9.6.9
  101478. case 'data-pilot-subtotal': // 9.6.10
  101479. case 'data-pilot-members': // 9.6.11
  101480. case 'data-pilot-member': // 9.6.12
  101481. case 'data-pilot-display-info': // 9.6.13
  101482. case 'data-pilot-sort-info': // 9.6.14
  101483. case 'data-pilot-layout-info': // 9.6.15
  101484. case 'data-pilot-field-reference': // 9.6.16
  101485. case 'data-pilot-groups': // 9.6.17
  101486. case 'data-pilot-group': // 9.6.18
  101487. case 'data-pilot-group-member': // 9.6.19
  101488. break;
  101489. /* 10.3 Drawing Shapes */
  101490. case 'rect': // 10.3.2
  101491. break;
  101492. /* 14.6 DDE Connections */
  101493. case 'dde-connection-decls': // 14.6.2 <text:
  101494. case 'dde-connection-decl': // 14.6.3 <text:
  101495. case 'dde-link': // 14.6.4 <table:
  101496. case 'dde-source': // 14.6.5 <office:
  101497. break;
  101498. case 'properties': break; // 13.7 <form:properties>
  101499. case 'property': break; // 13.8 <form:property>
  101500. case 'a': // 6.1.8 hyperlink
  101501. if(Rn[1]!== '/') {
  101502. atag = parsexmltag(Rn[0], false);
  101503. if(!atag.href) break;
  101504. atag.Target = atag.href; delete atag.href;
  101505. if(atag.Target.charAt(0) == "#" && atag.Target.indexOf(".") > -1) {
  101506. _Ref = ods_to_csf_3D(atag.Target.slice(1));
  101507. atag.Target = "#" + _Ref[0] + "!" + _Ref[1];
  101508. }
  101509. }
  101510. break;
  101511. /* non-standard */
  101512. case 'table-protection': break;
  101513. case 'data-pilot-grand-total': break; // <table:
  101514. case 'office-document-common-attrs': break; // bare
  101515. default: switch(Rn[2]) {
  101516. case 'dc:': // TODO: properties
  101517. case 'calcext:': // ignore undocumented extensions
  101518. case 'loext:': // ignore undocumented extensions
  101519. case 'ooo:': // ignore undocumented extensions
  101520. case 'chartooo:': // ignore undocumented extensions
  101521. case 'draw:': // TODO: drawing
  101522. case 'style:': // TODO: styles
  101523. case 'chart:': // TODO: charts
  101524. case 'form:': // TODO: forms
  101525. case 'uof:': // TODO: uof
  101526. case '表:': // TODO: uof
  101527. case '字:': // TODO: uof
  101528. break;
  101529. default: if(opts.WTF) throw new Error(Rn);
  101530. }
  101531. }
  101532. var out = ({
  101533. Sheets: Sheets,
  101534. SheetNames: SheetNames,
  101535. Workbook: WB
  101536. });
  101537. if(opts.bookSheets) delete out.Sheets;
  101538. return out;
  101539. };
  101540. })();
  101541. function parse_ods(zip, opts) {
  101542. opts = opts || ({});
  101543. var ods = !!safegetzipfile(zip, 'objectdata');
  101544. if(ods) parse_manifest(getzipdata(zip, 'META-INF/manifest.xml'), opts);
  101545. var content = getzipstr(zip, 'content.xml');
  101546. if(!content) throw new Error("Missing content.xml in " + (ods ? "ODS" : "UOF")+ " file");
  101547. var wb = parse_content_xml(ods ? content : utf8read(content), opts);
  101548. if(safegetzipfile(zip, 'meta.xml')) wb.Props = parse_core_props(getzipdata(zip, 'meta.xml'));
  101549. return wb;
  101550. }
  101551. function parse_fods(data, opts) {
  101552. return parse_content_xml(data, opts);
  101553. }
  101554. /* OpenDocument */
  101555. var write_styles_ods = (function() {
  101556. var payload = '<office:document-styles ' + wxt_helper({
  101557. 'xmlns:office': "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
  101558. 'xmlns:table': "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
  101559. 'xmlns:style': "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
  101560. 'xmlns:text': "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
  101561. 'xmlns:draw': "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
  101562. 'xmlns:fo': "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
  101563. 'xmlns:xlink': "http://www.w3.org/1999/xlink",
  101564. 'xmlns:dc': "http://purl.org/dc/elements/1.1/",
  101565. 'xmlns:number': "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
  101566. 'xmlns:svg': "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
  101567. 'xmlns:of': "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
  101568. 'office:version': "1.2"
  101569. }) + '></office:document-styles>';
  101570. return function wso() {
  101571. return XML_HEADER + payload;
  101572. };
  101573. })();
  101574. var write_content_ods = (function() {
  101575. /* 6.1.2 White Space Characters */
  101576. var write_text_p = function(text) {
  101577. return escapexml(text)
  101578. .replace(/ +/g, function($$){return '<text:s text:c="'+$$.length+'"/>';})
  101579. .replace(/\t/g, "<text:tab/>")
  101580. .replace(/\n/g, "<text:line-break/>")
  101581. .replace(/^ /, "<text:s/>").replace(/ $/, "<text:s/>");
  101582. };
  101583. var null_cell_xml = ' <table:table-cell />\n';
  101584. var covered_cell_xml = ' <table:covered-table-cell/>\n';
  101585. var write_ws = function(ws, wb, i) {
  101586. /* Section 9 Tables */
  101587. var o = [];
  101588. o.push(' <table:table table:name="' + escapexml(wb.SheetNames[i]) + '">\n');
  101589. var R=0,C=0, range = decode_range(ws['!ref']);
  101590. var marr = ws['!merges'] || [], mi = 0;
  101591. var dense = Array.isArray(ws);
  101592. for(R = 0; R < range.s.r; ++R) o.push(' <table:table-row></table:table-row>\n');
  101593. for(; R <= range.e.r; ++R) {
  101594. o.push(' <table:table-row>\n');
  101595. for(C=0; C < range.s.c; ++C) o.push(null_cell_xml);
  101596. for(; C <= range.e.c; ++C) {
  101597. var skip = false, ct = {}, textp = "";
  101598. for(mi = 0; mi != marr.length; ++mi) {
  101599. if(marr[mi].s.c > C) continue;
  101600. if(marr[mi].s.r > R) continue;
  101601. if(marr[mi].e.c < C) continue;
  101602. if(marr[mi].e.r < R) continue;
  101603. if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true;
  101604. ct['table:number-columns-spanned'] = (marr[mi].e.c - marr[mi].s.c + 1);
  101605. ct['table:number-rows-spanned'] = (marr[mi].e.r - marr[mi].s.r + 1);
  101606. break;
  101607. }
  101608. if(skip) { o.push(covered_cell_xml); continue; }
  101609. var ref = encode_cell({r:R, c:C}), cell = dense ? (ws[R]||[])[C]: ws[ref];
  101610. if(cell && cell.f) {
  101611. ct['table:formula'] = escapexml(csf_to_ods_formula(cell.f));
  101612. if(cell.F) {
  101613. if(cell.F.slice(0, ref.length) == ref) {
  101614. var _Fref = decode_range(cell.F);
  101615. ct['table:number-matrix-columns-spanned'] = (_Fref.e.c - _Fref.s.c + 1);
  101616. ct['table:number-matrix-rows-spanned'] = (_Fref.e.r - _Fref.s.r + 1);
  101617. }
  101618. }
  101619. }
  101620. if(!cell) { o.push(null_cell_xml); continue; }
  101621. switch(cell.t) {
  101622. case 'b':
  101623. textp = (cell.v ? 'TRUE' : 'FALSE');
  101624. ct['office:value-type'] = "boolean";
  101625. ct['office:boolean-value'] = (cell.v ? 'true' : 'false');
  101626. break;
  101627. case 'n':
  101628. textp = (cell.w||String(cell.v||0));
  101629. ct['office:value-type'] = "float";
  101630. ct['office:value'] = (cell.v||0);
  101631. break;
  101632. case 's': case 'str':
  101633. textp = cell.v;
  101634. ct['office:value-type'] = "string";
  101635. break;
  101636. case 'd':
  101637. textp = (cell.w||(parseDate(cell.v).toISOString()));
  101638. ct['office:value-type'] = "date";
  101639. ct['office:date-value'] = (parseDate(cell.v).toISOString());
  101640. ct['table:style-name'] = "ce1";
  101641. break;
  101642. //case 'e':
  101643. default: o.push(null_cell_xml); continue;
  101644. }
  101645. var text_p = write_text_p(textp);
  101646. if(cell.l && cell.l.Target) {
  101647. var _tgt = cell.l.Target; _tgt = _tgt.charAt(0) == "#" ? "#" + csf_to_ods_3D(_tgt.slice(1)) : _tgt;
  101648. text_p = writextag('text:a', text_p, {'xlink:href': _tgt});
  101649. }
  101650. o.push(' ' + writextag('table:table-cell', writextag('text:p', text_p, {}), ct) + '\n');
  101651. }
  101652. o.push(' </table:table-row>\n');
  101653. }
  101654. o.push(' </table:table>\n');
  101655. return o.join("");
  101656. };
  101657. var write_automatic_styles_ods = function(o) {
  101658. o.push(' <office:automatic-styles>\n');
  101659. o.push(' <number:date-style style:name="N37" number:automatic-order="true">\n');
  101660. o.push(' <number:month number:style="long"/>\n');
  101661. o.push(' <number:text>/</number:text>\n');
  101662. o.push(' <number:day number:style="long"/>\n');
  101663. o.push(' <number:text>/</number:text>\n');
  101664. o.push(' <number:year/>\n');
  101665. o.push(' </number:date-style>\n');
  101666. o.push(' <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>\n');
  101667. o.push(' </office:automatic-styles>\n');
  101668. };
  101669. return function wcx(wb, opts) {
  101670. var o = [XML_HEADER];
  101671. /* 3.1.3.2 */
  101672. var attr = wxt_helper({
  101673. 'xmlns:office': "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
  101674. 'xmlns:table': "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
  101675. 'xmlns:style': "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
  101676. 'xmlns:text': "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
  101677. 'xmlns:draw': "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
  101678. 'xmlns:fo': "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
  101679. 'xmlns:xlink': "http://www.w3.org/1999/xlink",
  101680. 'xmlns:dc': "http://purl.org/dc/elements/1.1/",
  101681. 'xmlns:meta': "urn:oasis:names:tc:opendocument:xmlns:meta:1.0",
  101682. 'xmlns:number': "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
  101683. 'xmlns:presentation': "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
  101684. 'xmlns:svg': "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
  101685. 'xmlns:chart': "urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
  101686. 'xmlns:dr3d': "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",
  101687. 'xmlns:math': "http://www.w3.org/1998/Math/MathML",
  101688. 'xmlns:form': "urn:oasis:names:tc:opendocument:xmlns:form:1.0",
  101689. 'xmlns:script': "urn:oasis:names:tc:opendocument:xmlns:script:1.0",
  101690. 'xmlns:ooo': "http://openoffice.org/2004/office",
  101691. 'xmlns:ooow': "http://openoffice.org/2004/writer",
  101692. 'xmlns:oooc': "http://openoffice.org/2004/calc",
  101693. 'xmlns:dom': "http://www.w3.org/2001/xml-events",
  101694. 'xmlns:xforms': "http://www.w3.org/2002/xforms",
  101695. 'xmlns:xsd': "http://www.w3.org/2001/XMLSchema",
  101696. 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance",
  101697. 'xmlns:sheet': "urn:oasis:names:tc:opendocument:sh33tjs:1.0",
  101698. 'xmlns:rpt': "http://openoffice.org/2005/report",
  101699. 'xmlns:of': "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
  101700. 'xmlns:xhtml': "http://www.w3.org/1999/xhtml",
  101701. 'xmlns:grddl': "http://www.w3.org/2003/g/data-view#",
  101702. 'xmlns:tableooo': "http://openoffice.org/2009/table",
  101703. 'xmlns:drawooo': "http://openoffice.org/2010/draw",
  101704. 'xmlns:calcext': "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0",
  101705. 'xmlns:loext': "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0",
  101706. 'xmlns:field': "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0",
  101707. 'xmlns:formx': "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0",
  101708. 'xmlns:css3t': "http://www.w3.org/TR/css3-text/",
  101709. 'office:version': "1.2"
  101710. });
  101711. var fods = wxt_helper({
  101712. 'xmlns:config': "urn:oasis:names:tc:opendocument:xmlns:config:1.0",
  101713. 'office:mimetype': "application/vnd.oasis.opendocument.spreadsheet"
  101714. });
  101715. if(opts.bookType == "fods") o.push('<office:document' + attr + fods + '>\n');
  101716. else o.push('<office:document-content' + attr + '>\n');
  101717. write_automatic_styles_ods(o);
  101718. o.push(' <office:body>\n');
  101719. o.push(' <office:spreadsheet>\n');
  101720. for(var i = 0; i != wb.SheetNames.length; ++i) o.push(write_ws(wb.Sheets[wb.SheetNames[i]], wb, i, opts));
  101721. o.push(' </office:spreadsheet>\n');
  101722. o.push(' </office:body>\n');
  101723. if(opts.bookType == "fods") o.push('</office:document>');
  101724. else o.push('</office:document-content>');
  101725. return o.join("");
  101726. };
  101727. })();
  101728. function write_ods(wb, opts) {
  101729. if(opts.bookType == "fods") return write_content_ods(wb, opts);
  101730. var zip = zip_new();
  101731. var f = "";
  101732. var manifest = [];
  101733. var rdf = [];
  101734. /* Part 3 Section 3.3 MIME Media Type */
  101735. f = "mimetype";
  101736. zip_add_file(zip, f, "application/vnd.oasis.opendocument.spreadsheet");
  101737. /* Part 1 Section 2.2 Documents */
  101738. f = "content.xml";
  101739. zip_add_file(zip, f, write_content_ods(wb, opts));
  101740. manifest.push([f, "text/xml"]);
  101741. rdf.push([f, "ContentFile"]);
  101742. /* TODO: these are hard-coded styles to satiate excel */
  101743. f = "styles.xml";
  101744. zip_add_file(zip, f, write_styles_ods(wb, opts));
  101745. manifest.push([f, "text/xml"]);
  101746. rdf.push([f, "StylesFile"]);
  101747. /* TODO: this is hard-coded to satiate excel */
  101748. f = "meta.xml";
  101749. zip_add_file(zip, f, write_meta_ods());
  101750. manifest.push([f, "text/xml"]);
  101751. rdf.push([f, "MetadataFile"]);
  101752. /* Part 3 Section 6 Metadata Manifest File */
  101753. f = "manifest.rdf";
  101754. zip_add_file(zip, f, write_rdf(rdf/*, opts*/));
  101755. manifest.push([f, "application/rdf+xml"]);
  101756. /* Part 3 Section 4 Manifest File */
  101757. f = "META-INF/manifest.xml";
  101758. zip_add_file(zip, f, write_manifest(manifest/*, opts*/));
  101759. return zip;
  101760. }
  101761. function write_sheet_index(wb, sheet) {
  101762. if(!sheet) return 0;
  101763. var idx = wb.SheetNames.indexOf(sheet);
  101764. if(idx == -1) throw new Error("Sheet not found: " + sheet);
  101765. return idx;
  101766. }
  101767. function write_obj_str(factory) {
  101768. return function write_str(wb, o) {
  101769. var idx = write_sheet_index(wb, o.sheet);
  101770. return factory.from_sheet(wb.Sheets[wb.SheetNames[idx]], o, wb);
  101771. };
  101772. }
  101773. var write_htm_str = write_obj_str(HTML_);
  101774. var write_csv_str = write_obj_str({from_sheet:sheet_to_csv});
  101775. var write_slk_str = write_obj_str(typeof SYLK !== "undefined" ? SYLK : {});
  101776. var write_dif_str = write_obj_str(typeof DIF !== "undefined" ? DIF : {});
  101777. var write_prn_str = write_obj_str(typeof PRN !== "undefined" ? PRN : {});
  101778. var write_rtf_str = write_obj_str(typeof RTF !== "undefined" ? RTF : {});
  101779. var write_txt_str = write_obj_str({from_sheet:sheet_to_txt});
  101780. var write_dbf_buf = write_obj_str(typeof DBF !== "undefined" ? DBF : {});
  101781. var write_eth_str = write_obj_str(typeof ETH !== "undefined" ? ETH : {});
  101782. function fix_opts_func(defaults) {
  101783. return function fix_opts(opts) {
  101784. for(var i = 0; i != defaults.length; ++i) {
  101785. var d = defaults[i];
  101786. if(opts[d[0]] === undefined) opts[d[0]] = d[1];
  101787. if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]);
  101788. }
  101789. };
  101790. }
  101791. var fix_read_opts = fix_opts_func([
  101792. ['cellNF', false], /* emit cell number format string as .z */
  101793. ['cellHTML', true], /* emit html string as .h */
  101794. ['cellFormula', true], /* emit formulae as .f */
  101795. ['cellStyles', false], /* emits style/theme as .s */
  101796. ['cellText', true], /* emit formatted text as .w */
  101797. ['cellDates', false], /* emit date cells with type `d` */
  101798. ['sheetStubs', false], /* emit empty cells */
  101799. ['sheetRows', 0, 'n'], /* read n rows (0 = read all rows) */
  101800. ['bookDeps', false], /* parse calculation chains */
  101801. ['bookSheets', false], /* only try to get sheet names (no Sheets) */
  101802. ['bookProps', false], /* only try to get properties (no Sheets) */
  101803. ['bookFiles', false], /* include raw file structure (keys, files, cfb) */
  101804. ['bookVBA', false], /* include vba raw data (vbaraw) */
  101805. ['password',''], /* password */
  101806. ['WTF', false] /* WTF mode (throws errors) */
  101807. ]);
  101808. var fix_write_opts = fix_opts_func([
  101809. ['cellDates', false], /* write date cells with type `d` */
  101810. ['bookSST', false], /* Generate Shared String Table */
  101811. ['bookType', 'xlsx'], /* Type of workbook (xlsx/m/b) */
  101812. ['compression', false], /* Use file compression */
  101813. ['WTF', false] /* WTF mode (throws errors) */
  101814. ]);
  101815. function get_sheet_type(n) {
  101816. if(RELS.WS.indexOf(n) > -1) return "sheet";
  101817. if(RELS.CS && n == RELS.CS) return "chart";
  101818. if(RELS.DS && n == RELS.DS) return "dialog";
  101819. if(RELS.MS && n == RELS.MS) return "macro";
  101820. return (n && n.length) ? n : "sheet";
  101821. }
  101822. function safe_parse_wbrels(wbrels, sheets) {
  101823. if(!wbrels) return 0;
  101824. try {
  101825. wbrels = sheets.map(function pwbr(w) { if(!w.id) w.id = w.strRelID; return [w.name, wbrels['!id'][w.id].Target, get_sheet_type(wbrels['!id'][w.id].Type)]; });
  101826. } catch(e) { return null; }
  101827. return !wbrels || wbrels.length === 0 ? null : wbrels;
  101828. }
  101829. function safe_parse_sheet(zip, path, relsPath, sheet, idx, sheetRels, sheets, stype, opts, wb, themes, styles) {
  101830. try {
  101831. sheetRels[sheet]=parse_rels(getzipstr(zip, relsPath, true), path);
  101832. var data = getzipdata(zip, path);
  101833. var _ws;
  101834. switch(stype) {
  101835. case 'sheet': _ws = parse_ws(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
  101836. case 'chart': _ws = parse_cs(data, path, idx, opts, sheetRels[sheet], wb, themes, styles);
  101837. if(!_ws || !_ws['!drawel']) break;
  101838. var dfile = resolve_path(_ws['!drawel'].Target, path);
  101839. var drelsp = get_rels_path(dfile);
  101840. var draw = parse_drawing(getzipstr(zip, dfile, true), parse_rels(getzipstr(zip, drelsp, true), dfile));
  101841. var chartp = resolve_path(draw, dfile);
  101842. var crelsp = get_rels_path(chartp);
  101843. _ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, true), chartp), wb, _ws);
  101844. break;
  101845. case 'macro': _ws = parse_ms(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
  101846. case 'dialog': _ws = parse_ds(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
  101847. default: throw new Error("Unrecognized sheet type " + stype);
  101848. }
  101849. sheets[sheet] = _ws;
  101850. /* scan rels for comments */
  101851. var comments = [];
  101852. if(sheetRels && sheetRels[sheet]) keys(sheetRels[sheet]).forEach(function(n) {
  101853. if(sheetRels[sheet][n].Type == RELS.CMNT) {
  101854. var dfile = resolve_path(sheetRels[sheet][n].Target, path);
  101855. comments = parse_cmnt(getzipdata(zip, dfile, true), dfile, opts);
  101856. if(!comments || !comments.length) return;
  101857. sheet_insert_comments(_ws, comments);
  101858. }
  101859. });
  101860. } catch(e) { if(opts.WTF) throw e; }
  101861. }
  101862. function strip_front_slash(x) { return x.charAt(0) == '/' ? x.slice(1) : x; }
  101863. function parse_zip(zip, opts) {
  101864. make_ssf(SSF);
  101865. opts = opts || {};
  101866. fix_read_opts(opts);
  101867. /* OpenDocument Part 3 Section 2.2.1 OpenDocument Package */
  101868. if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts);
  101869. /* UOC */
  101870. if(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts);
  101871. /* Numbers */
  101872. if(safegetzipfile(zip, 'Index/Document.iwa')) throw new Error('Unsupported NUMBERS file');
  101873. var entries = zipentries(zip);
  101874. var dir = parse_ct((getzipstr(zip, '[Content_Types].xml')));
  101875. var xlsb = false;
  101876. var sheets, binname;
  101877. if(dir.workbooks.length === 0) {
  101878. binname = "xl/workbook.xml";
  101879. if(getzipdata(zip,binname, true)) dir.workbooks.push(binname);
  101880. }
  101881. if(dir.workbooks.length === 0) {
  101882. binname = "xl/workbook.bin";
  101883. if(!getzipdata(zip,binname,true)) throw new Error("Could not find workbook");
  101884. dir.workbooks.push(binname);
  101885. xlsb = true;
  101886. }
  101887. if(dir.workbooks[0].slice(-3) == "bin") xlsb = true;
  101888. var themes = ({});
  101889. var styles = ({});
  101890. if(!opts.bookSheets && !opts.bookProps) {
  101891. strs = [];
  101892. if(dir.sst) try { strs=parse_sst(getzipdata(zip, strip_front_slash(dir.sst)), dir.sst, opts); } catch(e) { if(opts.WTF) throw e; }
  101893. if(opts.cellStyles && dir.themes.length) themes = parse_theme(getzipstr(zip, dir.themes[0].replace(/^\//,''), true)||"",dir.themes[0], opts);
  101894. if(dir.style) styles = parse_sty(getzipdata(zip, strip_front_slash(dir.style)), dir.style, themes, opts);
  101895. }
  101896. /*var externbooks = */dir.links.map(function(link) {
  101897. try {
  101898. var rels = parse_rels(getzipstr(zip, get_rels_path(strip_front_slash(link))), link);
  101899. return parse_xlink(getzipdata(zip, strip_front_slash(link)), rels, link, opts);
  101900. } catch(e) {}
  101901. });
  101902. var wb = parse_wb(getzipdata(zip, strip_front_slash(dir.workbooks[0])), dir.workbooks[0], opts);
  101903. var props = {}, propdata = "";
  101904. if(dir.coreprops.length) {
  101905. propdata = getzipdata(zip, strip_front_slash(dir.coreprops[0]), true);
  101906. if(propdata) props = parse_core_props(propdata);
  101907. if(dir.extprops.length !== 0) {
  101908. propdata = getzipdata(zip, strip_front_slash(dir.extprops[0]), true);
  101909. if(propdata) parse_ext_props(propdata, props, opts);
  101910. }
  101911. }
  101912. var custprops = {};
  101913. if(!opts.bookSheets || opts.bookProps) {
  101914. if (dir.custprops.length !== 0) {
  101915. propdata = getzipstr(zip, strip_front_slash(dir.custprops[0]), true);
  101916. if(propdata) custprops = parse_cust_props(propdata, opts);
  101917. }
  101918. }
  101919. var out = ({});
  101920. if(opts.bookSheets || opts.bookProps) {
  101921. if(wb.Sheets) sheets = wb.Sheets.map(function pluck(x){ return x.name; });
  101922. else if(props.Worksheets && props.SheetNames.length > 0) sheets=props.SheetNames;
  101923. if(opts.bookProps) { out.Props = props; out.Custprops = custprops; }
  101924. if(opts.bookSheets && typeof sheets !== 'undefined') out.SheetNames = sheets;
  101925. if(opts.bookSheets ? out.SheetNames : opts.bookProps) return out;
  101926. }
  101927. sheets = {};
  101928. var deps = {};
  101929. if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain)),dir.calcchain,opts);
  101930. var i=0;
  101931. var sheetRels = ({});
  101932. var path, relsPath;
  101933. {
  101934. var wbsheets = wb.Sheets;
  101935. props.Worksheets = wbsheets.length;
  101936. props.SheetNames = [];
  101937. for(var j = 0; j != wbsheets.length; ++j) {
  101938. props.SheetNames[j] = wbsheets[j].name;
  101939. }
  101940. }
  101941. var wbext = xlsb ? "bin" : "xml";
  101942. var wbrelsi = dir.workbooks[0].lastIndexOf("/");
  101943. var wbrelsfile = (dir.workbooks[0].slice(0, wbrelsi+1) + "_rels/" + dir.workbooks[0].slice(wbrelsi+1) + ".rels").replace(/^\//,"");
  101944. if(!safegetzipfile(zip, wbrelsfile)) wbrelsfile = 'xl/_rels/workbook.' + wbext + '.rels';
  101945. var wbrels = parse_rels(getzipstr(zip, wbrelsfile, true), wbrelsfile);
  101946. if(wbrels) wbrels = safe_parse_wbrels(wbrels, wb.Sheets);
  101947. /* Numbers iOS hack */
  101948. var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
  101949. for(i = 0; i != props.Worksheets; ++i) {
  101950. var stype = "sheet";
  101951. if(wbrels && wbrels[i]) {
  101952. path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
  101953. if(!safegetzipfile(zip, path)) path = wbrels[i][1];
  101954. if(!safegetzipfile(zip, path)) path = wbrelsfile.replace(/_rels\/.*$/,"") + wbrels[i][1];
  101955. stype = wbrels[i][2];
  101956. } else {
  101957. path = 'xl/worksheets/sheet'+(i+1-nmode)+"." + wbext;
  101958. path = path.replace(/sheet0\./,"sheet.");
  101959. }
  101960. relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
  101961. safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
  101962. }
  101963. out = ({
  101964. Directory: dir,
  101965. Workbook: wb,
  101966. Props: props,
  101967. Custprops: custprops,
  101968. Deps: deps,
  101969. Sheets: sheets,
  101970. SheetNames: props.SheetNames,
  101971. Strings: strs,
  101972. Styles: styles,
  101973. Themes: themes,
  101974. SSF: SSF.get_table()
  101975. });
  101976. if(opts.bookFiles) {
  101977. out.keys = entries;
  101978. out.files = zip.files;
  101979. }
  101980. if(opts.bookVBA) {
  101981. if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
  101982. else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
  101983. }
  101984. return out;
  101985. }
  101986. /* [MS-OFFCRYPTO] 2.1.1 */
  101987. function parse_xlsxcfb(cfb, _opts) {
  101988. var opts = _opts || {};
  101989. var f = 'Workbook', data = CFB.find(cfb, f);
  101990. try {
  101991. f = '/!DataSpaces/Version';
  101992. data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
  101993. /*var version = */parse_DataSpaceVersionInfo(data.content);
  101994. /* 2.3.4.1 */
  101995. f = '/!DataSpaces/DataSpaceMap';
  101996. data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
  101997. var dsm = parse_DataSpaceMap(data.content);
  101998. if(dsm.length !== 1 || dsm[0].comps.length !== 1 || dsm[0].comps[0].t !== 0 || dsm[0].name !== "StrongEncryptionDataSpace" || dsm[0].comps[0].v !== "EncryptedPackage")
  101999. throw new Error("ECMA-376 Encrypted file bad " + f);
  102000. /* 2.3.4.2 */
  102001. f = '/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace';
  102002. data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
  102003. var seds = parse_DataSpaceDefinition(data.content);
  102004. if(seds.length != 1 || seds[0] != "StrongEncryptionTransform")
  102005. throw new Error("ECMA-376 Encrypted file bad " + f);
  102006. /* 2.3.4.3 */
  102007. f = '/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary';
  102008. data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
  102009. /*var hdr = */parse_Primary(data.content);
  102010. } catch(e) {}
  102011. f = '/EncryptionInfo';
  102012. data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
  102013. var einfo = parse_EncryptionInfo(data.content);
  102014. /* 2.3.4.4 */
  102015. f = '/EncryptedPackage';
  102016. data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
  102017. /*global decrypt_agile */
  102018. if(einfo[0] == 0x04 && typeof decrypt_agile !== 'undefined') return decrypt_agile(einfo[1], data.content, opts.password || "", opts);
  102019. /*global decrypt_std76 */
  102020. if(einfo[0] == 0x02 && typeof decrypt_std76 !== 'undefined') return decrypt_std76(einfo[1], data.content, opts.password || "", opts);
  102021. throw new Error("File is password-protected");
  102022. }
  102023. function write_zip(wb, opts) {
  102024. _shapeid = 1024;
  102025. if(opts.bookType == "ods") return write_ods(wb, opts);
  102026. if(wb && !wb.SSF) {
  102027. wb.SSF = SSF.get_table();
  102028. }
  102029. if(wb && wb.SSF) {
  102030. make_ssf(SSF); SSF.load_table(wb.SSF);
  102031. // $FlowIgnore
  102032. opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
  102033. opts.ssf = wb.SSF;
  102034. }
  102035. opts.rels = {}; opts.wbrels = {};
  102036. opts.Strings = []; opts.Strings.Count = 0; opts.Strings.Unique = 0;
  102037. if(browser_has_Map) opts.revStrings = new Map();
  102038. else { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; }
  102039. var wbext = opts.bookType == "xlsb" ? "bin" : "xml";
  102040. var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;
  102041. var ct = new_ct();
  102042. fix_write_opts(opts = opts || {});
  102043. var zip = zip_new();
  102044. var f = "", rId = 0;
  102045. opts.cellXfs = [];
  102046. get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
  102047. if(!wb.Props) wb.Props = {};
  102048. f = "docProps/core.xml";
  102049. zip_add_file(zip, f, write_core_props(wb.Props, opts));
  102050. ct.coreprops.push(f);
  102051. add_rels(opts.rels, 2, f, RELS.CORE_PROPS);
  102052. f = "docProps/app.xml";
  102053. if(wb.Props && wb.Props.SheetNames){/* empty */}
  102054. else if(!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames;
  102055. else {
  102056. var _sn = [];
  102057. for(var _i = 0; _i < wb.SheetNames.length; ++_i)
  102058. if((wb.Workbook.Sheets[_i]||{}).Hidden != 2) _sn.push(wb.SheetNames[_i]);
  102059. wb.Props.SheetNames = _sn;
  102060. }
  102061. wb.Props.Worksheets = wb.Props.SheetNames.length;
  102062. zip_add_file(zip, f, write_ext_props(wb.Props, opts));
  102063. ct.extprops.push(f);
  102064. add_rels(opts.rels, 3, f, RELS.EXT_PROPS);
  102065. if(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) {
  102066. f = "docProps/custom.xml";
  102067. zip_add_file(zip, f, write_cust_props(wb.Custprops, opts));
  102068. ct.custprops.push(f);
  102069. add_rels(opts.rels, 4, f, RELS.CUST_PROPS);
  102070. }
  102071. for(rId=1;rId <= wb.SheetNames.length; ++rId) {
  102072. var wsrels = {'!id':{}};
  102073. var ws = wb.Sheets[wb.SheetNames[rId-1]];
  102074. var _type = (ws || {})["!type"] || "sheet";
  102075. switch(_type) {
  102076. case "chart":
  102077. /* falls through */
  102078. default:
  102079. f = "xl/worksheets/sheet" + rId + "." + wbext;
  102080. zip_add_file(zip, f, write_ws(rId-1, f, opts, wb, wsrels));
  102081. ct.sheets.push(f);
  102082. add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
  102083. }
  102084. if(ws) {
  102085. var comments = ws['!comments'];
  102086. var need_vml = false;
  102087. if(comments && comments.length > 0) {
  102088. var cf = "xl/comments" + rId + "." + wbext;
  102089. zip_add_file(zip, cf, write_cmnt(comments, cf, opts));
  102090. ct.comments.push(cf);
  102091. add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT);
  102092. need_vml = true;
  102093. }
  102094. if(ws['!legacy']) {
  102095. if(need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + (rId) + ".vml", write_comments_vml(rId, ws['!comments']));
  102096. }
  102097. delete ws['!comments'];
  102098. delete ws['!legacy'];
  102099. }
  102100. if(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels));
  102101. }
  102102. if(opts.Strings != null && opts.Strings.length > 0) {
  102103. f = "xl/sharedStrings." + wbext;
  102104. zip_add_file(zip, f, write_sst(opts.Strings, f, opts));
  102105. ct.strs.push(f);
  102106. add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
  102107. }
  102108. f = "xl/workbook." + wbext;
  102109. zip_add_file(zip, f, write_wb(wb, f, opts));
  102110. ct.workbooks.push(f);
  102111. add_rels(opts.rels, 1, f, RELS.WB);
  102112. /* TODO: something more intelligent with themes */
  102113. f = "xl/theme/theme1.xml";
  102114. zip_add_file(zip, f, write_theme(wb.Themes, opts));
  102115. ct.themes.push(f);
  102116. add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
  102117. /* TODO: something more intelligent with styles */
  102118. f = "xl/styles." + wbext;
  102119. zip_add_file(zip, f, write_sty(wb, f, opts));
  102120. ct.styles.push(f);
  102121. add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
  102122. if(wb.vbaraw && vbafmt) {
  102123. f = "xl/vbaProject.bin";
  102124. zip_add_file(zip, f, wb.vbaraw);
  102125. ct.vba.push(f);
  102126. add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
  102127. }
  102128. zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
  102129. zip_add_file(zip, '_rels/.rels', write_rels(opts.rels));
  102130. zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
  102131. delete opts.revssf; delete opts.ssf;
  102132. return zip;
  102133. }
  102134. function firstbyte(f,o) {
  102135. var x = "";
  102136. switch((o||{}).type || "base64") {
  102137. case 'buffer': return [f[0], f[1], f[2], f[3]];
  102138. case 'base64': x = Base64.decode(f.slice(0,24)); break;
  102139. case 'binary': x = f; break;
  102140. case 'array': return [f[0], f[1], f[2], f[3]];
  102141. default: throw new Error("Unrecognized type " + (o && o.type || "undefined"));
  102142. }
  102143. return [x.charCodeAt(0), x.charCodeAt(1), x.charCodeAt(2), x.charCodeAt(3)];
  102144. }
  102145. function read_cfb(cfb, opts) {
  102146. if(CFB.find(cfb, "EncryptedPackage")) return parse_xlsxcfb(cfb, opts);
  102147. return parse_xlscfb(cfb, opts);
  102148. }
  102149. function read_zip(data, opts) {
  102150. var zip, d = data;
  102151. var o = opts||{};
  102152. if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64";
  102153. zip = zip_read(d, o);
  102154. return parse_zip(zip, o);
  102155. }
  102156. function read_plaintext(data, o) {
  102157. var i = 0;
  102158. main: while(i < data.length) switch(data.charCodeAt(i)) {
  102159. case 0x0A: case 0x0D: case 0x20: ++i; break;
  102160. case 0x3C: return parse_xlml(data.slice(i),o);
  102161. default: break main;
  102162. }
  102163. return PRN.to_workbook(data, o);
  102164. }
  102165. function read_plaintext_raw(data, o) {
  102166. var str = "", bytes = firstbyte(data, o);
  102167. switch(o.type) {
  102168. case 'base64': str = Base64.decode(data); break;
  102169. case 'binary': str = data; break;
  102170. case 'buffer': str = data.toString('binary'); break;
  102171. case 'array': str = cc2str(data); break;
  102172. default: throw new Error("Unrecognized type " + o.type);
  102173. }
  102174. if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str);
  102175. return read_plaintext(str, o);
  102176. }
  102177. function read_utf16(data, o) {
  102178. var d = data;
  102179. if(o.type == 'base64') d = Base64.decode(d);
  102180. d = cptable.utils.decode(1200, d.slice(2), 'str');
  102181. o.type = "binary";
  102182. return read_plaintext(d, o);
  102183. }
  102184. function bstrify(data) {
  102185. return !data.match(/[^\x00-\x7F]/) ? data : utf8write(data);
  102186. }
  102187. function read_prn(data, d, o, str) {
  102188. if(str) { o.type = "string"; return PRN.to_workbook(data, o); }
  102189. return PRN.to_workbook(d, o);
  102190. }
  102191. function readSync(data, opts) {
  102192. reset_cp();
  102193. if(typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) return readSync(new Uint8Array(data), opts);
  102194. var d = data, n = [0,0,0,0], str = false;
  102195. var o = opts||{};
  102196. if(o.cellStyles) { o.cellNF = true; }
  102197. _ssfopts = {};
  102198. if(o.dateNF) _ssfopts.dateNF = o.dateNF;
  102199. if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64";
  102200. if(o.type == "file") { o.type = has_buf ? "buffer" : "binary"; d = read_binary(data); }
  102201. if(o.type == "string") { str = true; o.type = "binary"; o.codepage = 65001; d = bstrify(data); }
  102202. if(o.type == 'array' && typeof Uint8Array !== 'undefined' && data instanceof Uint8Array && typeof ArrayBuffer !== 'undefined') {
  102203. // $FlowIgnore
  102204. var ab=new ArrayBuffer(3), vu=new Uint8Array(ab); vu.foo="bar";
  102205. // $FlowIgnore
  102206. if(!vu.foo) {o=dup(o); o.type='array'; return readSync(ab2a(d), o);}
  102207. }
  102208. switch((n = firstbyte(d, o))[0]) {
  102209. case 0xD0: return read_cfb(CFB.read(d, o), o);
  102210. case 0x09: if(n[1] <= 0x04) return parse_xlscfb(d, o); break;
  102211. case 0x3C: return parse_xlml(d, o);
  102212. case 0x49: if(n[1] === 0x44) return read_wb_ID(d, o); break;
  102213. case 0x54: if(n[1] === 0x41 && n[2] === 0x42 && n[3] === 0x4C) return DIF.to_workbook(d, o); break;
  102214. case 0x50: return (n[1] === 0x4B && n[2] < 0x09 && n[3] < 0x09) ? read_zip(d, o) : read_prn(data, d, o, str);
  102215. case 0xEF: return n[3] === 0x3C ? parse_xlml(d, o) : read_prn(data, d, o, str);
  102216. case 0xFF: if(n[1] === 0xFE) { return read_utf16(d, o); } break;
  102217. case 0x00: if(n[1] === 0x00 && n[2] >= 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o); break;
  102218. case 0x03: case 0x83: case 0x8B: case 0x8C: return DBF.to_workbook(d, o);
  102219. case 0x7B: if(n[1] === 0x5C && n[2] === 0x72 && n[3] === 0x74) return RTF.to_workbook(d, o); break;
  102220. case 0x0A: case 0x0D: case 0x20: return read_plaintext_raw(d, o);
  102221. }
  102222. if(n[2] <= 12 && n[3] <= 31) return DBF.to_workbook(d, o);
  102223. return read_prn(data, d, o, str);
  102224. }
  102225. function readFileSync(filename, opts) {
  102226. var o = opts||{}; o.type = 'file';
  102227. return readSync(filename, o);
  102228. }
  102229. function write_cfb_ctr(cfb, o) {
  102230. switch(o.type) {
  102231. case "base64": case "binary": break;
  102232. case "buffer": case "array": o.type = ""; break;
  102233. case "file": return write_dl(o.file, CFB.write(cfb, {type:has_buf ? 'buffer' : ""}));
  102234. case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files");
  102235. default: throw new Error("Unrecognized type " + o.type);
  102236. }
  102237. return CFB.write(cfb, o);
  102238. }
  102239. /*global encrypt_agile */
  102240. function write_zip_type(wb, opts) {
  102241. var o = opts||{};
  102242. var z = write_zip(wb, o);
  102243. var oopts = {};
  102244. if(o.compression) oopts.compression = 'DEFLATE';
  102245. if(o.password) oopts.type = has_buf ? "nodebuffer" : "string";
  102246. else switch(o.type) {
  102247. case "base64": oopts.type = "base64"; break;
  102248. case "binary": oopts.type = "string"; break;
  102249. case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files");
  102250. case "buffer":
  102251. case "file": oopts.type = has_buf ? "nodebuffer" : "string"; break;
  102252. default: throw new Error("Unrecognized type " + o.type);
  102253. }
  102254. var out = z.FullPaths ? CFB.write(z, {fileType:"zip", type: {"nodebuffer": "buffer", "string": "binary"}[oopts.type] || oopts.type}) : z.generate(oopts);
  102255. if(o.password && typeof encrypt_agile !== 'undefined') return write_cfb_ctr(encrypt_agile(out, o.password), o);
  102256. if(o.type === "file") return write_dl(o.file, out);
  102257. return o.type == "string" ? utf8read(out) : out;
  102258. }
  102259. function write_cfb_type(wb, opts) {
  102260. var o = opts||{};
  102261. var cfb = write_xlscfb(wb, o);
  102262. return write_cfb_ctr(cfb, o);
  102263. }
  102264. function write_string_type(out, opts, bom) {
  102265. if(!bom) bom = "";
  102266. var o = bom + out;
  102267. switch(opts.type) {
  102268. case "base64": return Base64.encode(utf8write(o));
  102269. case "binary": return utf8write(o);
  102270. case "string": return out;
  102271. case "file": return write_dl(opts.file, o, 'utf8');
  102272. case "buffer": {
  102273. if(has_buf) return Buffer_from(o, 'utf8');
  102274. else return write_string_type(o, {type:'binary'}).split("").map(function(c) { return c.charCodeAt(0); });
  102275. }
  102276. }
  102277. throw new Error("Unrecognized type " + opts.type);
  102278. }
  102279. function write_stxt_type(out, opts) {
  102280. switch(opts.type) {
  102281. case "base64": return Base64.encode(out);
  102282. case "binary": return out;
  102283. case "string": return out; /* override in sheet_to_txt */
  102284. case "file": return write_dl(opts.file, out, 'binary');
  102285. case "buffer": {
  102286. if(has_buf) return Buffer_from(out, 'binary');
  102287. else return out.split("").map(function(c) { return c.charCodeAt(0); });
  102288. }
  102289. }
  102290. throw new Error("Unrecognized type " + opts.type);
  102291. }
  102292. /* TODO: test consistency */
  102293. function write_binary_type(out, opts) {
  102294. switch(opts.type) {
  102295. case "string":
  102296. case "base64":
  102297. case "binary":
  102298. var bstr = "";
  102299. // $FlowIgnore
  102300. for(var i = 0; i < out.length; ++i) bstr += String.fromCharCode(out[i]);
  102301. return opts.type == 'base64' ? Base64.encode(bstr) : opts.type == 'string' ? utf8read(bstr) : bstr;
  102302. case "file": return write_dl(opts.file, out);
  102303. case "buffer": return out;
  102304. default: throw new Error("Unrecognized type " + opts.type);
  102305. }
  102306. }
  102307. function writeSync(wb, opts) {
  102308. reset_cp();
  102309. check_wb(wb);
  102310. var o = opts||{};
  102311. if(o.cellStyles) { o.cellNF = true; }
  102312. if(o.type == "array") { o.type = "binary"; var out = (writeSync(wb, o)); o.type = "array"; return s2ab(out); }
  102313. switch(o.bookType || 'xlsb') {
  102314. case 'xml':
  102315. case 'xlml': return write_string_type(write_xlml(wb, o), o);
  102316. case 'slk':
  102317. case 'sylk': return write_string_type(write_slk_str(wb, o), o);
  102318. case 'htm':
  102319. case 'html': return write_string_type(write_htm_str(wb, o), o);
  102320. case 'txt': return write_stxt_type(write_txt_str(wb, o), o);
  102321. case 'csv': return write_string_type(write_csv_str(wb, o), o, "\ufeff");
  102322. case 'dif': return write_string_type(write_dif_str(wb, o), o);
  102323. case 'dbf': return write_binary_type(write_dbf_buf(wb, o), o);
  102324. case 'prn': return write_string_type(write_prn_str(wb, o), o);
  102325. case 'rtf': return write_string_type(write_rtf_str(wb, o), o);
  102326. case 'eth': return write_string_type(write_eth_str(wb, o), o);
  102327. case 'fods': return write_string_type(write_ods(wb, o), o);
  102328. case 'biff2': if(!o.biff) o.biff = 2; /* falls through */
  102329. case 'biff3': if(!o.biff) o.biff = 3; /* falls through */
  102330. case 'biff4': if(!o.biff) o.biff = 4; return write_binary_type(write_biff_buf(wb, o), o);
  102331. case 'biff5': if(!o.biff) o.biff = 5; /* falls through */
  102332. case 'biff8':
  102333. case 'xla':
  102334. case 'xls': if(!o.biff) o.biff = 8; return write_cfb_type(wb, o);
  102335. case 'xlsx':
  102336. case 'xlsm':
  102337. case 'xlam':
  102338. case 'xlsb':
  102339. case 'ods': return write_zip_type(wb, o);
  102340. default: throw new Error ("Unrecognized bookType |" + o.bookType + "|");
  102341. }
  102342. }
  102343. function resolve_book_type(o) {
  102344. if(o.bookType) return;
  102345. var _BT = {
  102346. "xls": "biff8",
  102347. "htm": "html",
  102348. "slk": "sylk",
  102349. "socialcalc": "eth",
  102350. "Sh33tJS": "WTF"
  102351. };
  102352. var ext = o.file.slice(o.file.lastIndexOf(".")).toLowerCase();
  102353. if(ext.match(/^\.[a-z]+$/)) o.bookType = ext.slice(1);
  102354. o.bookType = _BT[o.bookType] || o.bookType;
  102355. }
  102356. function writeFileSync(wb, filename, opts) {
  102357. var o = opts||{}; o.type = 'file';
  102358. o.file = filename;
  102359. resolve_book_type(o);
  102360. return writeSync(wb, o);
  102361. }
  102362. function writeFileAsync(filename, wb, opts, cb) {
  102363. var o = opts||{}; o.type = 'file';
  102364. o.file = filename;
  102365. resolve_book_type(o);
  102366. o.type = 'buffer';
  102367. var _cb = cb; if(!(_cb instanceof Function)) _cb = (opts);
  102368. return _fs.writeFile(filename, writeSync(wb, o), _cb);
  102369. }
  102370. function make_json_row(sheet, r, R, cols, header, hdr, dense, o) {
  102371. var rr = encode_row(R);
  102372. var defval = o.defval, raw = o.raw || !o.hasOwnProperty("raw");
  102373. var isempty = true;
  102374. var row = (header === 1) ? [] : {};
  102375. if(header !== 1) {
  102376. if(Object.defineProperty) try { Object.defineProperty(row, '__rowNum__', {value:R, enumerable:false}); } catch(e) { row.__rowNum__ = R; }
  102377. else row.__rowNum__ = R;
  102378. }
  102379. if(!dense || sheet[R]) for (var C = r.s.c; C <= r.e.c; ++C) {
  102380. var val = dense ? sheet[R][C] : sheet[cols[C] + rr];
  102381. if(val === undefined || val.t === undefined) {
  102382. if(defval === undefined) continue;
  102383. if(hdr[C] != null) { row[hdr[C]] = defval; }
  102384. continue;
  102385. }
  102386. var v = val.v;
  102387. switch(val.t){
  102388. case 'z': if(v == null) break; continue;
  102389. case 'e': v = void 0; break;
  102390. case 's': case 'd': case 'b': case 'n': break;
  102391. default: throw new Error('unrecognized type ' + val.t);
  102392. }
  102393. if(hdr[C] != null) {
  102394. if(v == null) {
  102395. if(defval !== undefined) row[hdr[C]] = defval;
  102396. else if(raw && v === null) row[hdr[C]] = null;
  102397. else continue;
  102398. } else {
  102399. row[hdr[C]] = raw ? v : format_cell(val,v,o);
  102400. }
  102401. if(v != null) isempty = false;
  102402. }
  102403. }
  102404. return { row: row, isempty: isempty };
  102405. }
  102406. function sheet_to_json(sheet, opts) {
  102407. if(sheet == null || sheet["!ref"] == null) return [];
  102408. var val = {t:'n',v:0}, header = 0, offset = 1, hdr = [], v=0, vv="";
  102409. var r = {s:{r:0,c:0},e:{r:0,c:0}};
  102410. var o = opts || {};
  102411. var range = o.range != null ? o.range : sheet["!ref"];
  102412. if(o.header === 1) header = 1;
  102413. else if(o.header === "A") header = 2;
  102414. else if(Array.isArray(o.header)) header = 3;
  102415. else if(o.header == null) header = 0;
  102416. switch(typeof range) {
  102417. case 'string': r = safe_decode_range(range); break;
  102418. case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break;
  102419. default: r = range;
  102420. }
  102421. if(header > 0) offset = 0;
  102422. var rr = encode_row(r.s.r);
  102423. var cols = [];
  102424. var out = [];
  102425. var outi = 0, counter = 0;
  102426. var dense = Array.isArray(sheet);
  102427. var R = r.s.r, C = 0, CC = 0;
  102428. if(dense && !sheet[R]) sheet[R] = [];
  102429. for(C = r.s.c; C <= r.e.c; ++C) {
  102430. cols[C] = encode_col(C);
  102431. val = dense ? sheet[R][C] : sheet[cols[C] + rr];
  102432. switch(header) {
  102433. case 1: hdr[C] = C - r.s.c; break;
  102434. case 2: hdr[C] = cols[C]; break;
  102435. case 3: hdr[C] = o.header[C - r.s.c]; break;
  102436. default:
  102437. if(val == null) val = {w: "__EMPTY", t: "s"};
  102438. vv = v = format_cell(val, null, o);
  102439. counter = 0;
  102440. for(CC = 0; CC < hdr.length; ++CC) if(hdr[CC] == vv) vv = v + "_" + (++counter);
  102441. hdr[C] = vv;
  102442. }
  102443. }
  102444. for (R = r.s.r + offset; R <= r.e.r; ++R) {
  102445. var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
  102446. if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) out[outi++] = row.row;
  102447. }
  102448. out.length = outi;
  102449. return out;
  102450. }
  102451. var qreg = /"/g;
  102452. function make_csv_row(sheet, r, R, cols, fs, rs, FS, o) {
  102453. var isempty = true;
  102454. var row = [], txt = "", rr = encode_row(R);
  102455. for(var C = r.s.c; C <= r.e.c; ++C) {
  102456. if (!cols[C]) continue;
  102457. var val = o.dense ? (sheet[R]||[])[C]: sheet[cols[C] + rr];
  102458. if(val == null) txt = "";
  102459. else if(val.v != null) {
  102460. isempty = false;
  102461. txt = ''+format_cell(val, null, o);
  102462. for(var i = 0, cc = 0; i !== txt.length; ++i) if((cc = txt.charCodeAt(i)) === fs || cc === rs || cc === 34) {txt = "\"" + txt.replace(qreg, '""') + "\""; break; }
  102463. if(txt == "ID") txt = '"ID"';
  102464. } else if(val.f != null && !val.F) {
  102465. isempty = false;
  102466. txt = '=' + val.f; if(txt.indexOf(",") >= 0) txt = '"' + txt.replace(qreg, '""') + '"';
  102467. } else txt = "";
  102468. /* NOTE: Excel CSV does not support array formulae */
  102469. row.push(txt);
  102470. }
  102471. if(o.blankrows === false && isempty) return null;
  102472. return row.join(FS);
  102473. }
  102474. function sheet_to_csv(sheet, opts) {
  102475. var out = [];
  102476. var o = opts == null ? {} : opts;
  102477. if(sheet == null || sheet["!ref"] == null) return "";
  102478. var r = safe_decode_range(sheet["!ref"]);
  102479. var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0);
  102480. var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0);
  102481. var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$");
  102482. var row = "", cols = [];
  102483. o.dense = Array.isArray(sheet);
  102484. var colinfo = o.skipHidden && sheet["!cols"] || [];
  102485. var rowinfo = o.skipHidden && sheet["!rows"] || [];
  102486. for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C);
  102487. for(var R = r.s.r; R <= r.e.r; ++R) {
  102488. if ((rowinfo[R]||{}).hidden) continue;
  102489. row = make_csv_row(sheet, r, R, cols, fs, rs, FS, o);
  102490. if(row == null) { continue; }
  102491. if(o.strip) row = row.replace(endregex,"");
  102492. out.push(row + RS);
  102493. }
  102494. delete o.dense;
  102495. return out.join("");
  102496. }
  102497. function sheet_to_txt(sheet, opts) {
  102498. if(!opts) opts = {}; opts.FS = "\t"; opts.RS = "\n";
  102499. var s = sheet_to_csv(sheet, opts);
  102500. if(typeof cptable == 'undefined' || opts.type == 'string') return s;
  102501. var o = cptable.utils.encode(1200, s, 'str');
  102502. return String.fromCharCode(255) + String.fromCharCode(254) + o;
  102503. }
  102504. function sheet_to_formulae(sheet) {
  102505. var y = "", x, val="";
  102506. if(sheet == null || sheet["!ref"] == null) return [];
  102507. var r = safe_decode_range(sheet['!ref']), rr = "", cols = [], C;
  102508. var cmds = [];
  102509. var dense = Array.isArray(sheet);
  102510. for(C = r.s.c; C <= r.e.c; ++C) cols[C] = encode_col(C);
  102511. for(var R = r.s.r; R <= r.e.r; ++R) {
  102512. rr = encode_row(R);
  102513. for(C = r.s.c; C <= r.e.c; ++C) {
  102514. y = cols[C] + rr;
  102515. x = dense ? (sheet[R]||[])[C] : sheet[y];
  102516. val = "";
  102517. if(x === undefined) continue;
  102518. else if(x.F != null) {
  102519. y = x.F;
  102520. if(!x.f) continue;
  102521. val = x.f;
  102522. if(y.indexOf(":") == -1) y = y + ":" + y;
  102523. }
  102524. if(x.f != null) val = x.f;
  102525. else if(x.t == 'z') continue;
  102526. else if(x.t == 'n' && x.v != null) val = "" + x.v;
  102527. else if(x.t == 'b') val = x.v ? "TRUE" : "FALSE";
  102528. else if(x.w !== undefined) val = "'" + x.w;
  102529. else if(x.v === undefined) continue;
  102530. else if(x.t == 's') val = "'" + x.v;
  102531. else val = ""+x.v;
  102532. cmds[cmds.length] = y + "=" + val;
  102533. }
  102534. }
  102535. return cmds;
  102536. }
  102537. function sheet_add_json(_ws, js, opts) {
  102538. var o = opts || {};
  102539. var offset = +!o.skipHeader;
  102540. var ws = _ws || ({});
  102541. var _R = 0, _C = 0;
  102542. if(ws && o.origin != null) {
  102543. if(typeof o.origin == 'number') _R = o.origin;
  102544. else {
  102545. var _origin = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin;
  102546. _R = _origin.r; _C = _origin.c;
  102547. }
  102548. }
  102549. var cell;
  102550. var range = ({s: {c:0, r:0}, e: {c:_C, r:_R + js.length - 1 + offset}});
  102551. if(ws['!ref']) {
  102552. var _range = safe_decode_range(ws['!ref']);
  102553. range.e.c = Math.max(range.e.c, _range.e.c);
  102554. range.e.r = Math.max(range.e.r, _range.e.r);
  102555. if(_R == -1) { _R = range.e.r + 1; range.e.r = _R + js.length - 1 + offset; }
  102556. }
  102557. var hdr = o.header || [], C = 0;
  102558. js.forEach(function (JS, R) {
  102559. keys(JS).forEach(function(k) {
  102560. if((C=hdr.indexOf(k)) == -1) hdr[C=hdr.length] = k;
  102561. var v = JS[k];
  102562. var t = 'z';
  102563. var z = "";
  102564. var ref = encode_cell({c:_C + C,r:_R + R + offset});
  102565. cell = utils.sheet_get_cell(ws, ref);
  102566. if(v && typeof v === 'object' && !(v instanceof Date)){
  102567. ws[ref] = v;
  102568. } else {
  102569. if(typeof v == 'number') t = 'n';
  102570. else if(typeof v == 'boolean') t = 'b';
  102571. else if(typeof v == 'string') t = 's';
  102572. else if(v instanceof Date) {
  102573. t = 'd';
  102574. if(!o.cellDates) { t = 'n'; v = datenum(v); }
  102575. z = (o.dateNF || SSF._table[14]);
  102576. }
  102577. if(!cell) ws[ref] = cell = ({t:t, v:v});
  102578. else {
  102579. cell.t = t; cell.v = v;
  102580. delete cell.w; delete cell.R;
  102581. if(z) cell.z = z;
  102582. }
  102583. if(z) cell.z = z;
  102584. }
  102585. });
  102586. });
  102587. range.e.c = Math.max(range.e.c, _C + hdr.length - 1);
  102588. var __R = encode_row(_R);
  102589. if(offset) for(C = 0; C < hdr.length; ++C) ws[encode_col(C + _C) + __R] = {t:'s', v:hdr[C]};
  102590. ws['!ref'] = encode_range(range);
  102591. return ws;
  102592. }
  102593. function json_to_sheet(js, opts) { return sheet_add_json(null, js, opts); }
  102594. var utils = {
  102595. encode_col: encode_col,
  102596. encode_row: encode_row,
  102597. encode_cell: encode_cell,
  102598. encode_range: encode_range,
  102599. decode_col: decode_col,
  102600. decode_row: decode_row,
  102601. split_cell: split_cell,
  102602. decode_cell: decode_cell,
  102603. decode_range: decode_range,
  102604. format_cell: format_cell,
  102605. get_formulae: sheet_to_formulae,
  102606. make_csv: sheet_to_csv,
  102607. make_json: sheet_to_json,
  102608. make_formulae: sheet_to_formulae,
  102609. sheet_add_aoa: sheet_add_aoa,
  102610. sheet_add_json: sheet_add_json,
  102611. aoa_to_sheet: aoa_to_sheet,
  102612. json_to_sheet: json_to_sheet,
  102613. table_to_sheet: parse_dom_table,
  102614. table_to_book: table_to_book,
  102615. sheet_to_csv: sheet_to_csv,
  102616. sheet_to_txt: sheet_to_txt,
  102617. sheet_to_json: sheet_to_json,
  102618. sheet_to_html: HTML_.from_sheet,
  102619. sheet_to_formulae: sheet_to_formulae,
  102620. sheet_to_row_object_array: sheet_to_json
  102621. };
  102622. (function(utils) {
  102623. utils.consts = utils.consts || {};
  102624. function add_consts(R/*Array<any>*/) { R.forEach(function(a){ utils.consts[a[0]] = a[1]; }); }
  102625. function get_default(x, y, z) { return x[y] != null ? x[y] : (x[y] = z); }
  102626. /* get cell, creating a stub if necessary */
  102627. function ws_get_cell_stub(ws, R, C) {
  102628. /* A1 cell address */
  102629. if(typeof R == "string") {
  102630. /* dense */
  102631. if(Array.isArray(ws)) {
  102632. var RC = decode_cell(R);
  102633. if(!ws[RC.r]) ws[RC.r] = [];
  102634. return ws[RC.r][RC.c] || (ws[RC.r][RC.c] = {t:'z'});
  102635. }
  102636. return ws[R] || (ws[R] = {t:'z'});
  102637. }
  102638. /* cell address object */
  102639. if(typeof R != "number") return ws_get_cell_stub(ws, encode_cell(R));
  102640. /* R and C are 0-based indices */
  102641. return ws_get_cell_stub(ws, encode_cell({r:R,c:C||0}));
  102642. }
  102643. utils.sheet_get_cell = ws_get_cell_stub;
  102644. /* find sheet index for given name / validate index */
  102645. function wb_sheet_idx(wb, sh) {
  102646. if(typeof sh == "number") {
  102647. if(sh >= 0 && wb.SheetNames.length > sh) return sh;
  102648. throw new Error("Cannot find sheet # " + sh);
  102649. } else if(typeof sh == "string") {
  102650. var idx = wb.SheetNames.indexOf(sh);
  102651. if(idx > -1) return idx;
  102652. throw new Error("Cannot find sheet name |" + sh + "|");
  102653. } else throw new Error("Cannot find sheet |" + sh + "|");
  102654. }
  102655. /* simple blank workbook object */
  102656. utils.book_new = function() {
  102657. return { SheetNames: [], Sheets: {} };
  102658. };
  102659. /* add a worksheet to the end of a given workbook */
  102660. utils.book_append_sheet = function(wb, ws, name) {
  102661. if(!name) for(var i = 1; i <= 0xFFFF; ++i) if(wb.SheetNames.indexOf(name = "Sheet" + i) == -1) break;
  102662. if(!name) throw new Error("Too many worksheets");
  102663. check_ws_name(name);
  102664. if(wb.SheetNames.indexOf(name) >= 0) throw new Error("Worksheet with name |" + name + "| already exists!");
  102665. wb.SheetNames.push(name);
  102666. wb.Sheets[name] = ws;
  102667. };
  102668. /* set sheet visibility (visible/hidden/very hidden) */
  102669. utils.book_set_sheet_visibility = function(wb, sh, vis) {
  102670. get_default(wb,"Workbook",{});
  102671. get_default(wb.Workbook,"Sheets",[]);
  102672. var idx = wb_sheet_idx(wb, sh);
  102673. // $FlowIgnore
  102674. get_default(wb.Workbook.Sheets,idx, {});
  102675. switch(vis) {
  102676. case 0: case 1: case 2: break;
  102677. default: throw new Error("Bad sheet visibility setting " + vis);
  102678. }
  102679. // $FlowIgnore
  102680. wb.Workbook.Sheets[idx].Hidden = vis;
  102681. };
  102682. add_consts([
  102683. ["SHEET_VISIBLE", 0],
  102684. ["SHEET_HIDDEN", 1],
  102685. ["SHEET_VERY_HIDDEN", 2]
  102686. ]);
  102687. /* set number format */
  102688. utils.cell_set_number_format = function(cell, fmt) {
  102689. cell.z = fmt;
  102690. return cell;
  102691. };
  102692. /* set cell hyperlink */
  102693. utils.cell_set_hyperlink = function(cell, target, tooltip) {
  102694. if(!target) {
  102695. delete cell.l;
  102696. } else {
  102697. cell.l = ({ Target: target });
  102698. if(tooltip) cell.l.Tooltip = tooltip;
  102699. }
  102700. return cell;
  102701. };
  102702. utils.cell_set_internal_link = function(cell, range, tooltip) { return utils.cell_set_hyperlink(cell, "#" + range, tooltip); };
  102703. /* add to cell comments */
  102704. utils.cell_add_comment = function(cell, text, author) {
  102705. if(!cell.c) cell.c = [];
  102706. cell.c.push({t:text, a:author||"SheetJS"});
  102707. };
  102708. /* set array formula and flush related cells */
  102709. utils.sheet_set_array_formula = function(ws, range, formula) {
  102710. var rng = typeof range != "string" ? range : safe_decode_range(range);
  102711. var rngstr = typeof range == "string" ? range : encode_range(range);
  102712. for(var R = rng.s.r; R <= rng.e.r; ++R) for(var C = rng.s.c; C <= rng.e.c; ++C) {
  102713. var cell = ws_get_cell_stub(ws, R, C);
  102714. cell.t = 'n';
  102715. cell.F = rngstr;
  102716. delete cell.v;
  102717. if(R == rng.s.r && C == rng.s.c) cell.f = formula;
  102718. }
  102719. return ws;
  102720. };
  102721. return utils;
  102722. })(utils);
  102723. if(has_buf && "function" != 'undefined') (function() {
  102724. var Readable = __webpack_require__(/*! stream */ 3).Readable;
  102725. var write_csv_stream = function(sheet, opts) {
  102726. var stream = Readable();
  102727. var o = opts == null ? {} : opts;
  102728. if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; }
  102729. var r = safe_decode_range(sheet["!ref"]);
  102730. var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0);
  102731. var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0);
  102732. var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$");
  102733. var row = "", cols = [];
  102734. o.dense = Array.isArray(sheet);
  102735. var colinfo = o.skipHidden && sheet["!cols"] || [];
  102736. var rowinfo = o.skipHidden && sheet["!rows"] || [];
  102737. for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C);
  102738. var R = r.s.r;
  102739. var BOM = false;
  102740. stream._read = function() {
  102741. if(!BOM) { BOM = true; return stream.push("\uFEFF"); }
  102742. while(R <= r.e.r) {
  102743. ++R;
  102744. if ((rowinfo[R-1]||{}).hidden) continue;
  102745. row = make_csv_row(sheet, r, R-1, cols, fs, rs, FS, o);
  102746. if(row != null) {
  102747. if(o.strip) row = row.replace(endregex,"");
  102748. stream.push(row + RS);
  102749. break;
  102750. }
  102751. }
  102752. if(R > r.e.r) return stream.push(null);
  102753. };
  102754. return stream;
  102755. };
  102756. var write_html_stream = function(ws, opts) {
  102757. var stream = Readable();
  102758. var o = opts || {};
  102759. var header = o.header != null ? o.header : HTML_.BEGIN;
  102760. var footer = o.footer != null ? o.footer : HTML_.END;
  102761. stream.push(header);
  102762. var r = decode_range(ws['!ref']);
  102763. o.dense = Array.isArray(ws);
  102764. stream.push(HTML_._preamble(ws, r, o));
  102765. var R = r.s.r;
  102766. var end = false;
  102767. stream._read = function() {
  102768. if(R > r.e.r) {
  102769. if(!end) { end = true; stream.push("</table>" + footer); }
  102770. return stream.push(null);
  102771. }
  102772. while(R <= r.e.r) {
  102773. stream.push(HTML_._row(ws, r, R, o));
  102774. ++R;
  102775. break;
  102776. }
  102777. };
  102778. return stream;
  102779. };
  102780. var write_json_stream = function(sheet, opts) {
  102781. var stream = Readable({objectMode:true});
  102782. if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; }
  102783. var val = {t:'n',v:0}, header = 0, offset = 1, hdr = [], v=0, vv="";
  102784. var r = {s:{r:0,c:0},e:{r:0,c:0}};
  102785. var o = opts || {};
  102786. var range = o.range != null ? o.range : sheet["!ref"];
  102787. if(o.header === 1) header = 1;
  102788. else if(o.header === "A") header = 2;
  102789. else if(Array.isArray(o.header)) header = 3;
  102790. switch(typeof range) {
  102791. case 'string': r = safe_decode_range(range); break;
  102792. case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break;
  102793. default: r = range;
  102794. }
  102795. if(header > 0) offset = 0;
  102796. var rr = encode_row(r.s.r);
  102797. var cols = [];
  102798. var counter = 0;
  102799. var dense = Array.isArray(sheet);
  102800. var R = r.s.r, C = 0, CC = 0;
  102801. if(dense && !sheet[R]) sheet[R] = [];
  102802. for(C = r.s.c; C <= r.e.c; ++C) {
  102803. cols[C] = encode_col(C);
  102804. val = dense ? sheet[R][C] : sheet[cols[C] + rr];
  102805. switch(header) {
  102806. case 1: hdr[C] = C - r.s.c; break;
  102807. case 2: hdr[C] = cols[C]; break;
  102808. case 3: hdr[C] = o.header[C - r.s.c]; break;
  102809. default:
  102810. if(val == null) val = {w: "__EMPTY", t: "s"};
  102811. vv = v = format_cell(val, null, o);
  102812. counter = 0;
  102813. for(CC = 0; CC < hdr.length; ++CC) if(hdr[CC] == vv) vv = v + "_" + (++counter);
  102814. hdr[C] = vv;
  102815. }
  102816. }
  102817. R = r.s.r + offset;
  102818. stream._read = function() {
  102819. if(R > r.e.r) return stream.push(null);
  102820. while(R <= r.e.r) {
  102821. //if ((rowinfo[R-1]||{}).hidden) continue;
  102822. var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
  102823. ++R;
  102824. if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {
  102825. stream.push(row.row);
  102826. break;
  102827. }
  102828. }
  102829. };
  102830. return stream;
  102831. };
  102832. XLSX.stream = {
  102833. to_json: write_json_stream,
  102834. to_html: write_html_stream,
  102835. to_csv: write_csv_stream
  102836. };
  102837. })();
  102838. if(typeof parse_xlscfb !== "undefined") XLSX.parse_xlscfb = parse_xlscfb;
  102839. XLSX.parse_zip = parse_zip;
  102840. XLSX.read = readSync; //xlsread
  102841. XLSX.readFile = readFileSync; //readFile
  102842. XLSX.readFileSync = readFileSync;
  102843. XLSX.write = writeSync;
  102844. XLSX.writeFile = writeFileSync;
  102845. XLSX.writeFileSync = writeFileSync;
  102846. XLSX.writeFileAsync = writeFileAsync;
  102847. XLSX.utils = utils;
  102848. XLSX.SSF = SSF;
  102849. if(typeof CFB !== "undefined") XLSX.CFB = CFB;
  102850. }
  102851. /*global define */
  102852. if(true) make_xlsx_lib(exports);
  102853. else {}
  102854. /*exported XLS, ODS */
  102855. var XLS = XLSX, ODS = XLSX;
  102856. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  102857. /***/ }),
  102858. /***/ "./resources/js/app.js":
  102859. /*!*****************************!*\
  102860. !*** ./resources/js/app.js ***!
  102861. \*****************************/
  102862. /*! no static exports found */
  102863. /***/ (function(module, exports, __webpack_require__) {
  102864. /**
  102865. * First we will load all of this project's JavaScript dependencies which
  102866. * includes React and other helpers. It's a great starting point while
  102867. * building robust, powerful web applications using React + Laravel.
  102868. */
  102869. __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");
  102870. /**
  102871. * Next, we will create a fresh React component instance and attach it to
  102872. * the page. Then, you may begin adding components to this application
  102873. * or customize the JavaScript scaffolding to fit your unique needs.
  102874. */
  102875. __webpack_require__(/*! ./components/compound/NewCompoundDataTable */ "./resources/js/components/compound/NewCompoundDataTable.js");
  102876. __webpack_require__(/*! ./components/compound/VerifiedCompoundDatatable */ "./resources/js/components/compound/VerifiedCompoundDatatable.js");
  102877. __webpack_require__(/*! ./components/compound/NoticeCompoundDatatable */ "./resources/js/components/compound/NoticeCompoundDatatable.js");
  102878. __webpack_require__(/*! ./components/compound/ConfiscatedCompoundDatatable */ "./resources/js/components/compound/ConfiscatedCompoundDatatable.js");
  102879. __webpack_require__(/*! ./components/compound/CompletedDatatable */ "./resources/js/components/compound/CompletedDatatable.js");
  102880. __webpack_require__(/*! ./components/compound/ReportCompound */ "./resources/js/components/compound/ReportCompound.js");
  102881. /***/ }),
  102882. /***/ "./resources/js/bootstrap.js":
  102883. /*!***********************************!*\
  102884. !*** ./resources/js/bootstrap.js ***!
  102885. \***********************************/
  102886. /*! no static exports found */
  102887. /***/ (function(module, exports, __webpack_require__) {
  102888. window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  102889. /**
  102890. * We'll load jQuery and the Bootstrap jQuery plugin which provides support
  102891. * for JavaScript based Bootstrap features such as modals and tabs. This
  102892. * code may be modified to fit the specific needs of your application.
  102893. */
  102894. try {
  102895. window.Popper = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"];
  102896. window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  102897. __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js");
  102898. } catch (e) {}
  102899. /**
  102900. * We'll load the axios HTTP library which allows us to easily issue requests
  102901. * to our Laravel back-end. This library automatically handles sending the
  102902. * CSRF token as a header based on the value of the "XSRF" token cookie.
  102903. */
  102904. window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  102905. window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  102906. /**
  102907. * Next we will register the CSRF Token as a common header with Axios so that
  102908. * all outgoing HTTP requests automatically have it attached. This is just
  102909. * a simple convenience so we don't have to attach every token manually.
  102910. */
  102911. var token = document.head.querySelector('meta[name="csrf-token"]');
  102912. if (token) {
  102913. window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
  102914. } else {
  102915. console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
  102916. }
  102917. /**
  102918. * Echo exposes an expressive API for subscribing to channels and listening
  102919. * for events that are broadcast by Laravel. Echo and event broadcasting
  102920. * allows your team to easily build robust real-time web applications.
  102921. */
  102922. // import Echo from 'laravel-echo'
  102923. // window.Pusher = require('pusher-js');
  102924. // window.Echo = new Echo({
  102925. // broadcaster: 'pusher',
  102926. // key: process.env.MIX_PUSHER_APP_KEY,
  102927. // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
  102928. // encrypted: true
  102929. // });
  102930. /***/ }),
  102931. /***/ "./resources/js/components/DatatableParkir.js":
  102932. /*!****************************************************!*\
  102933. !*** ./resources/js/components/DatatableParkir.js ***!
  102934. \****************************************************/
  102935. /*! exports provided: default */
  102936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102937. "use strict";
  102938. __webpack_require__.r(__webpack_exports__);
  102939. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DatatableParkir; });
  102940. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  102941. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  102942. /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/index.js");
  102943. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  102944. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  102945. /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  102946. /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
  102947. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  102948. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  102949. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  102950. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  102951. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  102952. 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); } }
  102953. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  102954. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  102955. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  102956. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  102957. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  102958. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  102959. var DatatableParkir =
  102960. /*#__PURE__*/
  102961. function (_Component) {
  102962. _inherits(DatatableParkir, _Component);
  102963. function DatatableParkir(props) {
  102964. var _this;
  102965. _classCallCheck(this, DatatableParkir);
  102966. _this = _possibleConstructorReturn(this, _getPrototypeOf(DatatableParkir).call(this, props));
  102967. _this.state = {
  102968. data: props.data,
  102969. currentUrl: props.url,
  102970. showModal: false,
  102971. processing: false,
  102972. responseMessage: '',
  102973. form: {
  102974. current_id: props.current_id,
  102975. id: '',
  102976. status: 'Belum Bayar',
  102977. remark: '',
  102978. amount: ''
  102979. }
  102980. };
  102981. _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
  102982. _this.onChangeStatus = _this.onChangeStatus.bind(_assertThisInitialized(_this));
  102983. _this.onChangeRemark = _this.onChangeRemark.bind(_assertThisInitialized(_this));
  102984. _this.onChangeAmount = _this.onChangeAmount.bind(_assertThisInitialized(_this));
  102985. _this.closeModal = _this.closeModal.bind(_assertThisInitialized(_this));
  102986. return _this;
  102987. }
  102988. _createClass(DatatableParkir, [{
  102989. key: "onChangeStatus",
  102990. value: function onChangeStatus(e) {
  102991. var value = e.target.value;
  102992. this.setState(function (prevState) {
  102993. return {
  102994. form: _objectSpread({}, prevState.form, {
  102995. status: value
  102996. })
  102997. };
  102998. });
  102999. }
  103000. }, {
  103001. key: "onChangeRemark",
  103002. value: function onChangeRemark(e) {
  103003. var value = e.target.value;
  103004. this.setState(function (prevState) {
  103005. return {
  103006. form: _objectSpread({}, prevState.form, {
  103007. remark: value
  103008. })
  103009. };
  103010. });
  103011. }
  103012. }, {
  103013. key: "onChangeAmount",
  103014. value: function onChangeAmount(e) {
  103015. var value = e.target.value;
  103016. this.setState(function (prevState) {
  103017. return {
  103018. form: _objectSpread({}, prevState.form, {
  103019. amount: value
  103020. })
  103021. };
  103022. });
  103023. }
  103024. }, {
  103025. key: "onUpdateStatus",
  103026. value: function onUpdateStatus(e) {
  103027. this.setState(function (prevState) {
  103028. return {
  103029. form: _objectSpread({}, prevState.form, {
  103030. id: e
  103031. })
  103032. };
  103033. });
  103034. this.setState({
  103035. showModal: true
  103036. });
  103037. }
  103038. }, {
  103039. key: "closeModal",
  103040. value: function closeModal() {
  103041. this.setState({
  103042. showModal: false
  103043. });
  103044. }
  103045. }, {
  103046. key: "onSubmit",
  103047. value: function onSubmit(e) {
  103048. var _this2 = this;
  103049. e.preventDefault();
  103050. var input = prompt("Adakah anda pasti kemaskini status kompaun ini? \nTaip 'yes' untuk teruskan", "");
  103051. if (input == "yes") {
  103052. this.setState({
  103053. processing: true
  103054. });
  103055. var formData = this.state.form;
  103056. axios__WEBPACK_IMPORTED_MODULE_3___default.a.post("/api/update/compound/via-dashboard", formData).then(function (response) {
  103057. if (response.data.success) {
  103058. fetch(_this2.state.currentUrl).then(function (response) {
  103059. response.json().then(function (res) {
  103060. _this2.setState({
  103061. processing: false
  103062. });
  103063. _this2.setState({
  103064. data: res.data,
  103065. showModal: false
  103066. });
  103067. });
  103068. });
  103069. _this2.setState({
  103070. responseMessage: response.data.message
  103071. });
  103072. alert(response.data.message);
  103073. } else {
  103074. alert(response.data.message);
  103075. _this2.setState({
  103076. showModal: false,
  103077. processing: false,
  103078. responseMessage: response.data.message
  103079. });
  103080. }
  103081. })["catch"](function (error) {
  103082. console.log(error);
  103083. });
  103084. } else {
  103085. alert('Kemaskini status dibatalkan');
  103086. this.setState({
  103087. showModal: false
  103088. });
  103089. }
  103090. }
  103091. }, {
  103092. key: "render",
  103093. value: function render() {
  103094. var _this3 = this;
  103095. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103096. className: "data_table_main dt-responsive table-responsive"
  103097. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("table", {
  103098. id: "compoundParkir",
  103099. className: "table table-sm table-striped table-bordered nowrap dataTable",
  103100. width: "100%"
  103101. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("thead", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No Plat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  103102. width: "110"
  103103. }, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tbody", null, this.state.data.length > 0 ? this.state.data.map(function (item, i) {
  103104. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", {
  103105. key: i
  103106. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.DT_RowIndex), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.index !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("small", {
  103107. className: "label label-success"
  103108. }, item.index), "\xA0", item.kpd) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.kpd)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jenis), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.tarikh_masa), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, "Seksyen ", item.kesalahan.sketr, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), " ", item.kesalahan.nama), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlah_kemaskini_kompaun !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_kemaskini_kompaun) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_asal_kompaun)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.no_plate), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.enforcer.no_badan, ", ", item.enforcer.full_name), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.catatan_dari_admin !== null ? item.status !== "Belum Bayar" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103109. style: {
  103110. "marginTop": "8px"
  103111. }
  103112. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Bayaran: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), "RM ", item.amount_payment), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103113. style: {
  103114. "marginTop": "8px"
  103115. }
  103116. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103117. style: {
  103118. "marginTop": "8px"
  103119. }
  103120. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemaskini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103121. style: {
  103122. "marginTop": "8px"
  103123. }
  103124. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103125. style: {
  103126. "marginTop": "8px"
  103127. }
  103128. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemasikini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
  103129. style: {
  103130. "textAlign": "center"
  103131. }
  103132. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  103133. href: "/main/compound/" + item.kpd + "/index",
  103134. className: "btn btn-info btn-sm waves-effect waves-light"
  103135. }, "TERUSKAN"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  103136. "data-toggle": "modal",
  103137. "data-target": "#ajaxModel",
  103138. onClick: _this3.onUpdateStatus.bind(_this3, item._id),
  103139. className: "btn btn-primary btn-sm waves-effect waves-light"
  103140. }, "KEMASKINI STATUS")));
  103141. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
  103142. colSpan: "10",
  103143. style: {
  103144. "textAlign": "center"
  103145. }
  103146. }, "Tiada Data Ditemui"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tfoot", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No Plat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  103147. width: "110"
  103148. }, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"], {
  103149. size: "lg",
  103150. show: this.state.showModal,
  103151. onHide: this.closeModal
  103152. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
  103153. className: "form-horizontal",
  103154. onSubmit: this.onSubmit
  103155. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Header, {
  103156. closeButton: true
  103157. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Title, null, "Kemaskini Status Kompaun")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Body, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103158. className: "modal-body"
  103159. }, !this.state.processing ? '' : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103160. className: "sweet-loading",
  103161. style: {
  103162. 'textAlign': 'center'
  103163. }
  103164. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  103165. style: {
  103166. 'border-color': 'red'
  103167. },
  103168. sizeUnit: "px",
  103169. size: 50,
  103170. color: '#123abc',
  103171. loading: this.state.processing
  103172. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  103173. type: "hidden",
  103174. name: "compound_id",
  103175. id: "compound_id",
  103176. value: this.state.form.id
  103177. }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103178. className: "form-group"
  103179. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103180. className: "col-sm-6 control-label"
  103181. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Status")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103182. className: "col-sm-12"
  103183. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  103184. className: "form-control",
  103185. required: true,
  103186. value: this.state.form.status,
  103187. onChange: this.onChangeStatus
  103188. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  103189. key: "Belum Bayar",
  103190. value: "Belum Bayar"
  103191. }, "Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  103192. key: "Berbayar",
  103193. value: "Berbayar"
  103194. }, "Berbayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  103195. key: "Batal",
  103196. value: "Batal"
  103197. }, "Batal")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103198. className: "form-group"
  103199. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103200. className: "col-sm-6 control-label"
  103201. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Catatan ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103202. className: "col-sm-12"
  103203. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("textarea", {
  103204. className: "form-control",
  103205. value: this.state.form.remark,
  103206. onChange: this.onChangeRemark
  103207. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103208. className: "form-group"
  103209. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103210. className: "col-sm-6 control-label"
  103211. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jumlah Dibayar ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103212. className: "col-sm-12"
  103213. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  103214. type: "number",
  103215. steps: "0.00",
  103216. className: "form-control",
  103217. placeholder: "0.0",
  103218. value: this.state.form.amount,
  103219. onChange: this.onChangeAmount,
  103220. required: true
  103221. }))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Footer, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  103222. type: "button",
  103223. className: "btn btn-sm btn-default waves-effect",
  103224. onClick: this.closeModal
  103225. }, "Close"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  103226. type: "submit",
  103227. className: "btn btn-sm btn-primary waves-effect waves-light"
  103228. }, "KEMASKINI")))));
  103229. }
  103230. }]);
  103231. return DatatableParkir;
  103232. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  103233. /***/ }),
  103234. /***/ "./resources/js/components/DatatablePelbagai.js":
  103235. /*!******************************************************!*\
  103236. !*** ./resources/js/components/DatatablePelbagai.js ***!
  103237. \******************************************************/
  103238. /*! exports provided: default */
  103239. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103240. "use strict";
  103241. __webpack_require__.r(__webpack_exports__);
  103242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DatatablePelbagai; });
  103243. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  103244. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  103245. /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/index.js");
  103246. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  103247. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  103248. /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  103249. /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
  103250. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  103251. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  103252. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  103253. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  103254. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103255. 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); } }
  103256. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  103257. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  103258. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  103259. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103260. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  103261. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  103262. var DatatablePelbagai =
  103263. /*#__PURE__*/
  103264. function (_Component) {
  103265. _inherits(DatatablePelbagai, _Component);
  103266. function DatatablePelbagai(props) {
  103267. var _this;
  103268. _classCallCheck(this, DatatablePelbagai);
  103269. _this = _possibleConstructorReturn(this, _getPrototypeOf(DatatablePelbagai).call(this, props));
  103270. _this.state = {
  103271. data: props.data,
  103272. currentUrl: props.url,
  103273. showModal: false,
  103274. processing: false,
  103275. responseMessage: '',
  103276. form: {
  103277. current_id: props.current_id,
  103278. id: '',
  103279. status: 'Belum Bayar',
  103280. remark: '',
  103281. amount: ''
  103282. }
  103283. };
  103284. _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
  103285. _this.onChangeStatus = _this.onChangeStatus.bind(_assertThisInitialized(_this));
  103286. _this.onChangeRemark = _this.onChangeRemark.bind(_assertThisInitialized(_this));
  103287. _this.onChangeAmount = _this.onChangeAmount.bind(_assertThisInitialized(_this));
  103288. _this.closeModal = _this.closeModal.bind(_assertThisInitialized(_this));
  103289. return _this;
  103290. }
  103291. _createClass(DatatablePelbagai, [{
  103292. key: "onChangeStatus",
  103293. value: function onChangeStatus(e) {
  103294. var value = e.target.value;
  103295. this.setState(function (prevState) {
  103296. return {
  103297. form: _objectSpread({}, prevState.form, {
  103298. status: value
  103299. })
  103300. };
  103301. });
  103302. }
  103303. }, {
  103304. key: "onChangeRemark",
  103305. value: function onChangeRemark(e) {
  103306. var value = e.target.value;
  103307. this.setState(function (prevState) {
  103308. return {
  103309. form: _objectSpread({}, prevState.form, {
  103310. remark: value
  103311. })
  103312. };
  103313. });
  103314. }
  103315. }, {
  103316. key: "onChangeAmount",
  103317. value: function onChangeAmount(e) {
  103318. var value = e.target.value;
  103319. this.setState(function (prevState) {
  103320. return {
  103321. form: _objectSpread({}, prevState.form, {
  103322. amount: value
  103323. })
  103324. };
  103325. });
  103326. }
  103327. }, {
  103328. key: "onUpdateStatus",
  103329. value: function onUpdateStatus(e) {
  103330. this.setState(function (prevState) {
  103331. return {
  103332. form: _objectSpread({}, prevState.form, {
  103333. id: e
  103334. })
  103335. };
  103336. });
  103337. this.setState({
  103338. showModal: true
  103339. });
  103340. }
  103341. }, {
  103342. key: "closeModal",
  103343. value: function closeModal() {
  103344. this.setState({
  103345. showModal: false
  103346. });
  103347. }
  103348. }, {
  103349. key: "onSubmit",
  103350. value: function onSubmit(e) {
  103351. var _this2 = this;
  103352. e.preventDefault();
  103353. var input = prompt("Adakah anda pasti kemaskini status kompaun ini? \nTaip 'yes' untuk teruskan", "");
  103354. if (input == "yes") {
  103355. this.setState({
  103356. processing: true
  103357. });
  103358. var formData = this.state.form;
  103359. axios__WEBPACK_IMPORTED_MODULE_3___default.a.post("/api/update/compound/via-dashboard", formData).then(function (response) {
  103360. if (response.data.success) {
  103361. fetch(_this2.state.currentUrl).then(function (response) {
  103362. response.json().then(function (res) {
  103363. _this2.setState({
  103364. processing: false
  103365. });
  103366. _this2.setState({
  103367. data: res.data,
  103368. showModal: false
  103369. });
  103370. });
  103371. });
  103372. _this2.setState({
  103373. responseMessage: response.data.message
  103374. });
  103375. alert(response.data.message);
  103376. } else {
  103377. alert(response.data.message);
  103378. _this2.setState({
  103379. showModal: false,
  103380. processing: false,
  103381. responseMessage: response.data.message
  103382. });
  103383. }
  103384. })["catch"](function (error) {
  103385. console.log(error);
  103386. });
  103387. } else {
  103388. alert('Kemaskini status dibatalkan');
  103389. this.setState({
  103390. showModal: false
  103391. });
  103392. }
  103393. }
  103394. }, {
  103395. key: "render",
  103396. value: function render() {
  103397. var _this3 = this;
  103398. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103399. className: "data_table_main dt-responsive table-responsive"
  103400. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("table", {
  103401. id: "compoundPelbagai",
  103402. className: "table table-sm table-striped table-bordered nowrap",
  103403. width: "100%"
  103404. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("thead", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  103405. width: "110"
  103406. }, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Nric"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No.Syarikat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tbody", null, this.state.data.length > 0 ? this.state.data.map(function (item, i) {
  103407. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", {
  103408. key: i
  103409. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.DT_RowIndex), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.index !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("small", {
  103410. className: "label label-success"
  103411. }, item.index), "\xA0", item.kpd) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.kpd)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jenis), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.tarikh_masa), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, "Seksyen ", item.kesalahan.sketr, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), " ", item.kesalahan.nama), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlah_kemaskini_kompaun !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_kemaskini_kompaun) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_asal_kompaun)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.nric), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.no_daftar_syarikat), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.enforcer.no_badan, ", ", item.enforcer.full_name), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.catatan_dari_admin !== null ? item.status !== "Belum Bayar" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103412. style: {
  103413. "marginTop": "8px"
  103414. }
  103415. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Bayaran: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), "RM ", item.amount_payment), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103416. style: {
  103417. "marginTop": "8px"
  103418. }
  103419. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103420. style: {
  103421. "marginTop": "8px"
  103422. }
  103423. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemaskini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103424. style: {
  103425. "marginTop": "8px"
  103426. }
  103427. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103428. style: {
  103429. "marginTop": "8px"
  103430. }
  103431. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemasikini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
  103432. style: {
  103433. "textAlign": "center"
  103434. }
  103435. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  103436. href: "/main/compound/" + item.kpd + "/index",
  103437. className: "btn btn-info btn-sm waves-effect waves-light"
  103438. }, "TERUSKAN"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  103439. "data-toggle": "modal",
  103440. "data-target": "#ajaxModel",
  103441. onClick: _this3.onUpdateStatus.bind(_this3, item._id),
  103442. className: "btn btn-primary btn-sm waves-effect waves-light"
  103443. }, "KEMASKINI STATUS")));
  103444. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
  103445. colSpan: "11",
  103446. style: {
  103447. "textAlign": "center"
  103448. }
  103449. }, "Tiada Data Ditemui"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tfoot", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  103450. width: "110"
  103451. }, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Nric"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No.Syarikat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"], {
  103452. size: "lg",
  103453. show: this.state.showModal,
  103454. onHide: this.closeModal
  103455. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
  103456. className: "form-horizontal",
  103457. onSubmit: this.onSubmit
  103458. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Header, {
  103459. closeButton: true
  103460. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Title, null, "Kemaskini Status Kompaun")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Body, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103461. className: "modal-body"
  103462. }, !this.state.processing ? '' : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103463. className: "sweet-loading",
  103464. style: {
  103465. 'textAlign': 'center'
  103466. }
  103467. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  103468. style: {
  103469. 'border-color': 'red'
  103470. },
  103471. sizeUnit: "px",
  103472. size: 50,
  103473. color: '#123abc',
  103474. loading: this.state.processing
  103475. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  103476. type: "hidden",
  103477. name: "compound_id",
  103478. id: "compound_id",
  103479. value: this.state.form.id
  103480. }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103481. className: "form-group"
  103482. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103483. className: "col-sm-6 control-label"
  103484. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Status")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103485. className: "col-sm-12"
  103486. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  103487. className: "form-control",
  103488. required: true,
  103489. value: this.state.form.status,
  103490. onChange: this.onChangeStatus
  103491. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  103492. key: "Belum Bayar",
  103493. value: "Belum Bayar"
  103494. }, "Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  103495. key: "Berbayar",
  103496. value: "Berbayar"
  103497. }, "Berbayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  103498. key: "Batal",
  103499. value: "Batal"
  103500. }, "Batal")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103501. className: "form-group"
  103502. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103503. className: "col-sm-6 control-label"
  103504. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Catatan ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103505. className: "col-sm-12"
  103506. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("textarea", {
  103507. className: "form-control",
  103508. value: this.state.form.remark,
  103509. onChange: this.onChangeRemark
  103510. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103511. className: "form-group"
  103512. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103513. className: "col-sm-6 control-label"
  103514. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jumlah Dibayar ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103515. className: "col-sm-12"
  103516. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  103517. type: "number",
  103518. steps: "0.00",
  103519. className: "form-control",
  103520. placeholder: "0.0",
  103521. value: this.state.form.amount,
  103522. onChange: this.onChangeAmount,
  103523. required: true
  103524. }))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Footer, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  103525. type: "button",
  103526. className: "btn btn-sm btn-default waves-effect",
  103527. onClick: this.closeModal
  103528. }, "Close"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  103529. type: "submit",
  103530. className: "btn btn-sm btn-primary waves-effect waves-light"
  103531. }, "KEMASKINI")))));
  103532. }
  103533. }]);
  103534. return DatatablePelbagai;
  103535. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  103536. /***/ }),
  103537. /***/ "./resources/js/components/ExportCSV.js":
  103538. /*!**********************************************!*\
  103539. !*** ./resources/js/components/ExportCSV.js ***!
  103540. \**********************************************/
  103541. /*! exports provided: ExportCSV */
  103542. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103543. "use strict";
  103544. __webpack_require__.r(__webpack_exports__);
  103545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExportCSV", function() { return ExportCSV; });
  103546. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  103547. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  103548. /* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! file-saver */ "./node_modules/file-saver/dist/FileSaver.min.js");
  103549. /* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(file_saver__WEBPACK_IMPORTED_MODULE_1__);
  103550. /* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! xlsx */ "./node_modules/xlsx/xlsx.js");
  103551. /* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(xlsx__WEBPACK_IMPORTED_MODULE_2__);
  103552. var ExportCSV = function ExportCSV(_ref) {
  103553. var csvData = _ref.csvData,
  103554. fileName = _ref.fileName,
  103555. type = _ref.type;
  103556. var fileType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
  103557. var fileExtension = '.xlsx';
  103558. var exportToCSV = function exportToCSV(csvData, fileName, type) {
  103559. var finalData = [];
  103560. if (type == 'Parkir') {
  103561. csvData.map(function (item, i) {
  103562. finalData.push({
  103563. No: i,
  103564. Kpd: item.kpd,
  103565. Jenis: item.jenis,
  103566. Tarikh_Masa: item.tarikh_masa,
  103567. Kesalahan: 'Seksyen' + item.kesalahan.sketr + ' ' + item.kesalahan.nama,
  103568. Kadar_Kompaun: item.jumlah_kemaskini_kompaun !== "" ? item.jumlah_kemaskini_kompaun : item.jumlah_asal_kompaun,
  103569. No_Plat: item.no_plate,
  103570. Penguatkuasa: item.enforcer.no_badan + ', ' + item.enforcer.full_name,
  103571. Status: item.status
  103572. });
  103573. });
  103574. } else if (type == 'Pelbagai') {
  103575. csvData.map(function (item, i) {
  103576. finalData.push({
  103577. No: i,
  103578. Kpd: item.kpd,
  103579. Jenis: item.jenis,
  103580. Tarikh_Masa: item.tarikh_masa,
  103581. Kesalahan: 'Seksyen' + item.kesalahan.sketr + ' ' + item.kesalahan.nama,
  103582. Kadar_Kompaun: item.jumlah_kemaskini_kompaun !== "" ? item.jumlah_kemaskini_kompaun : item.jumlah_asal_kompaun,
  103583. Nric: item.nric,
  103584. No_Daftar_syarikat: item.no_daftar_syarikat,
  103585. Penguatkuasa: item.enforcer.no_badan + ', ' + item.enforcer.full_name,
  103586. Status: item.status
  103587. });
  103588. });
  103589. }
  103590. var ws = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(finalData);
  103591. var wb = {
  103592. Sheets: {
  103593. 'data': ws
  103594. },
  103595. SheetNames: ['data']
  103596. };
  103597. var excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](wb, {
  103598. bookType: 'xlsx',
  103599. type: 'array'
  103600. });
  103601. var data = new Blob([excelBuffer], {
  103602. type: fileType
  103603. });
  103604. file_saver__WEBPACK_IMPORTED_MODULE_1__["saveAs"](data, fileName + fileExtension);
  103605. };
  103606. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  103607. onClick: function onClick(e) {
  103608. return exportToCSV(csvData, fileName, type);
  103609. },
  103610. className: "btn btn-success btn-sm waves-effect waves-light f-right"
  103611. }, "Eksport ke CSV");
  103612. };
  103613. /***/ }),
  103614. /***/ "./resources/js/components/compound/CompletedDatatable.js":
  103615. /*!****************************************************************!*\
  103616. !*** ./resources/js/components/compound/CompletedDatatable.js ***!
  103617. \****************************************************************/
  103618. /*! exports provided: default */
  103619. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103620. "use strict";
  103621. __webpack_require__.r(__webpack_exports__);
  103622. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CompletedDatatable; });
  103623. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  103624. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  103625. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  103626. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  103627. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  103628. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  103629. /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
  103630. /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
  103631. /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
  103632. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  103633. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  103634. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  103635. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  103636. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103637. 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); } }
  103638. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  103639. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  103640. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  103641. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103642. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  103643. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  103644. var CompletedDatatable =
  103645. /*#__PURE__*/
  103646. function (_Component) {
  103647. _inherits(CompletedDatatable, _Component);
  103648. function CompletedDatatable(props) {
  103649. var _this;
  103650. _classCallCheck(this, CompletedDatatable);
  103651. _this = _possibleConstructorReturn(this, _getPrototypeOf(CompletedDatatable).call(this, props));
  103652. _this.state = {
  103653. current_id: _this.props.current_id,
  103654. dataCompound: [],
  103655. loading: 'null',
  103656. current_url: 'null',
  103657. total: {
  103658. baru: _this.props.baru,
  103659. invest: _this.props.invest,
  103660. notice: _this.props.notice,
  103661. inven: _this.props.inven,
  103662. collap: _this.props.collap,
  103663. comp: _this.props.comp
  103664. },
  103665. check: {
  103666. kpd: true,
  103667. date: true,
  103668. faulty: true,
  103669. enforcer: true,
  103670. platno: false,
  103671. companyno: false,
  103672. nric: false
  103673. },
  103674. form: {
  103675. modul: _this.props.modul,
  103676. status: _this.props.status,
  103677. type: 'Parkir',
  103678. kpd: '',
  103679. start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  103680. end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  103681. faulty: 'All',
  103682. enforcer: 'All',
  103683. plate_no: '',
  103684. company_no: '',
  103685. nric: ''
  103686. },
  103687. list_enforcer: JSON.parse(_this.props.enforcer),
  103688. list_faulty: JSON.parse(_this.props.faulty)
  103689. };
  103690. _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
  103691. _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
  103692. _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
  103693. _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
  103694. _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
  103695. _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
  103696. _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
  103697. _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
  103698. _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
  103699. _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
  103700. _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
  103701. _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
  103702. _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
  103703. _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
  103704. _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
  103705. return _this;
  103706. }
  103707. _createClass(CompletedDatatable, [{
  103708. key: "onCheckKpd",
  103709. value: function onCheckKpd(e) {
  103710. var _this2 = this;
  103711. this.setState(function (prevState) {
  103712. return {
  103713. check: _objectSpread({}, prevState.check, {
  103714. kpd: !_this2.state.check.kpd
  103715. })
  103716. };
  103717. });
  103718. }
  103719. }, {
  103720. key: "onCheckDate",
  103721. value: function onCheckDate(e) {
  103722. var _this3 = this;
  103723. this.setState(function (prevState) {
  103724. return {
  103725. check: _objectSpread({}, prevState.check, {
  103726. date: !_this3.state.check.date
  103727. })
  103728. };
  103729. });
  103730. }
  103731. }, {
  103732. key: "onCheckPlateNo",
  103733. value: function onCheckPlateNo(e) {
  103734. var _this4 = this;
  103735. this.setState(function (prevState) {
  103736. return {
  103737. check: _objectSpread({}, prevState.check, {
  103738. platno: !_this4.state.check.platno
  103739. })
  103740. };
  103741. });
  103742. }
  103743. }, {
  103744. key: "onCheckCompanyNo",
  103745. value: function onCheckCompanyNo(e) {
  103746. var _this5 = this;
  103747. this.setState(function (prevState) {
  103748. return {
  103749. check: _objectSpread({}, prevState.check, {
  103750. companyno: !_this5.state.check.companyno
  103751. })
  103752. };
  103753. });
  103754. }
  103755. }, {
  103756. key: "onCheckNric",
  103757. value: function onCheckNric(e) {
  103758. var _this6 = this;
  103759. this.setState(function (prevState) {
  103760. return {
  103761. check: _objectSpread({}, prevState.check, {
  103762. nric: !_this6.state.check.nric
  103763. })
  103764. };
  103765. });
  103766. }
  103767. }, {
  103768. key: "onChangeKpd",
  103769. value: function onChangeKpd(e) {
  103770. var value = e.target.value;
  103771. this.setState(function (prevState) {
  103772. return {
  103773. form: _objectSpread({}, prevState.form, {
  103774. kpd: value
  103775. })
  103776. };
  103777. });
  103778. }
  103779. }, {
  103780. key: "onChangeType",
  103781. value: function onChangeType(e) {
  103782. var value = e.target.value;
  103783. this.setState(function (prevState) {
  103784. return {
  103785. form: _objectSpread({}, prevState.form, {
  103786. type: value
  103787. }),
  103788. loading: 'null',
  103789. dataCompound: []
  103790. };
  103791. });
  103792. }
  103793. }, {
  103794. key: "onChangeStart",
  103795. value: function onChangeStart(e) {
  103796. var value = e.target.value;
  103797. this.setState(function (prevState) {
  103798. return {
  103799. form: _objectSpread({}, prevState.form, {
  103800. start_date: value
  103801. })
  103802. };
  103803. });
  103804. }
  103805. }, {
  103806. key: "onChangeEnd",
  103807. value: function onChangeEnd(e) {
  103808. var value = e.target.value;
  103809. this.setState(function (prevState) {
  103810. return {
  103811. form: _objectSpread({}, prevState.form, {
  103812. end_date: value
  103813. })
  103814. };
  103815. });
  103816. }
  103817. }, {
  103818. key: "onChangeFaulty",
  103819. value: function onChangeFaulty(e) {
  103820. var value = e.target.value;
  103821. this.setState(function (prevState) {
  103822. return {
  103823. form: _objectSpread({}, prevState.form, {
  103824. faulty: value
  103825. })
  103826. };
  103827. });
  103828. }
  103829. }, {
  103830. key: "onChangeEnforcer",
  103831. value: function onChangeEnforcer(e) {
  103832. var value = e.target.value;
  103833. this.setState(function (prevState) {
  103834. return {
  103835. form: _objectSpread({}, prevState.form, {
  103836. enforcer: value
  103837. })
  103838. };
  103839. });
  103840. }
  103841. }, {
  103842. key: "onChangePlateNo",
  103843. value: function onChangePlateNo(e) {
  103844. var value = e.target.value;
  103845. this.setState(function (prevState) {
  103846. return {
  103847. form: _objectSpread({}, prevState.form, {
  103848. plate_no: value
  103849. })
  103850. };
  103851. });
  103852. }
  103853. }, {
  103854. key: "onChangeCompanyNo",
  103855. value: function onChangeCompanyNo(e) {
  103856. var value = e.target.value;
  103857. this.setState(function (prevState) {
  103858. return {
  103859. form: _objectSpread({}, prevState.form, {
  103860. company_no: value
  103861. })
  103862. };
  103863. });
  103864. }
  103865. }, {
  103866. key: "onChangeNric",
  103867. value: function onChangeNric(e) {
  103868. var value = e.target.value;
  103869. this.setState(function (prevState) {
  103870. return {
  103871. form: _objectSpread({}, prevState.form, {
  103872. nric: value
  103873. })
  103874. };
  103875. });
  103876. }
  103877. }, {
  103878. key: "onSubmit",
  103879. value: function onSubmit(e) {
  103880. var _this7 = this;
  103881. e.preventDefault();
  103882. this.setState({
  103883. loading: true
  103884. });
  103885. var formData = {
  103886. type: this.state.form.type,
  103887. enforcer: this.state.form.enforcer,
  103888. faulty: this.state.form.faulty,
  103889. modul: this.state.form.modul,
  103890. status: this.state.form.status
  103891. };
  103892. if (this.state.check.date) {
  103893. formData = _objectSpread({}, formData, {
  103894. start_date: this.state.form.start_date,
  103895. end_date: this.state.form.end_date
  103896. });
  103897. } else {
  103898. formData = _objectSpread({}, formData, {
  103899. start_date: '',
  103900. end_date: ''
  103901. });
  103902. }
  103903. if (this.state.check.kpd) {
  103904. formData = _objectSpread({}, formData, {
  103905. kpd: this.state.form.kpd
  103906. });
  103907. } else if (this.state.check.platno) {
  103908. formData = _objectSpread({}, formData, {
  103909. plate_no: this.state.form.plate_no
  103910. });
  103911. } else if (this.state.check.companyno) {
  103912. formData = _objectSpread({}, formData, {
  103913. company_no: this.state.form.company_no
  103914. });
  103915. } else if (this.state.check.nric) {
  103916. formData = _objectSpread({}, formData, {
  103917. nric: this.state.form.nric
  103918. });
  103919. }
  103920. var queryString = Object.keys(formData).map(function (key) {
  103921. return key + '=' + formData[key];
  103922. }).join('&');
  103923. fetch('/api/list/compound?' + queryString).then(function (response) {
  103924. response.json().then(function (res) {
  103925. _this7.setState({
  103926. dataCompound: res.data,
  103927. loading: false,
  103928. current_url: '/api/list/compound?' + queryString
  103929. });
  103930. });
  103931. });
  103932. }
  103933. }, {
  103934. key: "render",
  103935. value: function render() {
  103936. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103937. className: "row"
  103938. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103939. className: "col-xl-2 col-md-12"
  103940. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103941. className: "panel panel-default"
  103942. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103943. className: "panel-heading"
  103944. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
  103945. className: "panel-title"
  103946. }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103947. className: "panel-body"
  103948. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  103949. href: "/main/compound"
  103950. }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103951. className: "badge badge-inverse-danger"
  103952. }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  103953. href: "/main/compound/investigation"
  103954. }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103955. className: "badge badge-success"
  103956. }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  103957. href: "/main/compound/notice"
  103958. }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103959. className: "badge badge-success"
  103960. }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  103961. href: "/main/compound/confiscated"
  103962. }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103963. className: "badge badge-success"
  103964. }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  103965. href: "/main/compound/completed",
  103966. className: "active"
  103967. }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103968. className: "badge badge-success"
  103969. }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103970. className: "col-xl-10 col-md-12"
  103971. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103972. className: "row"
  103973. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103974. className: "col-md-12"
  103975. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103976. className: "card"
  103977. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103978. className: "card-block"
  103979. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
  103980. className: "main cussPayment",
  103981. onSubmit: this.onSubmit
  103982. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103983. className: "row clearfix"
  103984. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103985. className: "col-lg-3"
  103986. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  103987. type: "checkbox",
  103988. onClick: this.onCheckKpd,
  103989. defaultChecked: true
  103990. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  103991. className: "input-group input-group-sm"
  103992. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
  103993. className: "input-group-prepend"
  103994. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  103995. className: "input-group-text"
  103996. }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  103997. type: "text",
  103998. className: "form-control form-control-sm",
  103999. placeholder: "SCM4744",
  104000. value: this.state.form.kpd,
  104001. onChange: this.onChangeKpd,
  104002. required: this.state.check.kpd
  104003. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104004. className: "col-lg-3"
  104005. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  104006. className: "form-control form-control-sm",
  104007. value: this.state.form.type,
  104008. onChange: this.onChangeType,
  104009. required: true
  104010. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104011. className: "row clearfix",
  104012. style: {
  104013. marginBottom: "1.25em"
  104014. }
  104015. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104016. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  104017. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104018. type: "checkbox",
  104019. onClick: this.onCheckDate,
  104020. defaultChecked: true
  104021. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104022. className: "col-lg-3"
  104023. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104024. type: "date",
  104025. className: " form-control form-control-sm",
  104026. value: this.state.form.start_date,
  104027. onChange: this.onChangeStart,
  104028. required: this.state.check.date
  104029. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104030. className: "col-lg-3"
  104031. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104032. type: "date",
  104033. className: "form-control form-control-sm",
  104034. value: this.state.form.end_date,
  104035. onChange: this.onChangeEnd
  104036. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104037. className: "row clearfix",
  104038. style: {
  104039. marginBottom: "1.25em"
  104040. }
  104041. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104042. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  104043. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104044. className: "col-lg-9 .offset-xl-3"
  104045. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  104046. className: "form-control form-control-sm",
  104047. defaultValue: "All",
  104048. onChange: this.onChangeFaulty,
  104049. required: this.state.check.faulty
  104050. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104051. value: "All"
  104052. }, "All"), this.state.list_faulty.map(function (act, i) {
  104053. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
  104054. label: act.nama,
  104055. key: i
  104056. }, act.faulty.map(function (faulty, j) {
  104057. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104058. key: j,
  104059. value: faulty._id
  104060. }, "Seksyen ", faulty.sketr);
  104061. }));
  104062. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104063. className: "row clearfix",
  104064. style: {
  104065. marginBottom: "1.25em"
  104066. }
  104067. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104068. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  104069. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104070. className: "col-lg-6 .offset-xl-6"
  104071. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  104072. className: "form-control form-control-sm",
  104073. defaultValue: "All",
  104074. onChange: this.onChangeEnforcer,
  104075. required: this.state.check.enforcer
  104076. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104077. value: "All"
  104078. }, "All"), this.state.list_enforcer.map(function (staff, i) {
  104079. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104080. key: i,
  104081. value: staff._id
  104082. }, staff.no_badan, ", ", staff.full_name);
  104083. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104084. className: "row clearfix",
  104085. style: {
  104086. marginBottom: "1.25em"
  104087. }
  104088. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104089. className: "col-lg-3"
  104090. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104091. type: "checkbox",
  104092. onClick: this.onCheckPlateNo,
  104093. defaultChecked: false
  104094. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104095. type: "text",
  104096. className: "form-control form-control-sm",
  104097. placeholder: "no plat",
  104098. value: this.state.form.plate_no,
  104099. onChange: this.onChangePlateNo,
  104100. required: this.state.check.platno
  104101. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104102. className: "col-lg-3"
  104103. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104104. type: "checkbox",
  104105. onClick: this.onCheckCompanyNo,
  104106. defaultChecked: false
  104107. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104108. type: "text",
  104109. className: "form-control form-control-sm",
  104110. placeholder: "no syarikat",
  104111. value: this.state.form.company_no,
  104112. onChange: this.onChangeCompanyNo,
  104113. required: this.state.check.companyno
  104114. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104115. className: "col-lg-3"
  104116. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104117. type: "checkbox",
  104118. onClick: this.onCheckNric,
  104119. defaultChecked: false
  104120. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104121. type: "text",
  104122. className: "form-control form-control-sm",
  104123. placeholder: "nric",
  104124. value: this.state.form.nric,
  104125. onChange: this.onChangeNric,
  104126. required: this.state.check.nric
  104127. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104128. className: "form-group"
  104129. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  104130. type: "submit",
  104131. id: "tapis",
  104132. className: "btn btn-info btn-sm waves-effect waves-light"
  104133. }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104134. className: "col-md-12"
  104135. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104136. className: "card"
  104137. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104138. className: "card-header"
  104139. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
  104140. csvData: this.state.dataCompound,
  104141. fileName: "Report_saman_1",
  104142. type: this.state.form.type
  104143. }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104144. className: "card-block contact-details"
  104145. }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
  104146. data: this.state.dataCompound,
  104147. url: this.state.current_url,
  104148. current_id: this.state.current_id
  104149. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
  104150. data: this.state.dataCompound,
  104151. url: this.state.current_url,
  104152. current_id: this.state.current_id
  104153. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104154. className: "sweet-loading",
  104155. style: {
  104156. 'textAlign': 'center'
  104157. }
  104158. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  104159. style: {
  104160. 'border-color': 'red'
  104161. },
  104162. sizeUnit: "px",
  104163. size: 50,
  104164. color: '#123abc',
  104165. loading: this.state.loading
  104166. })) : ''))));
  104167. }
  104168. }]);
  104169. return CompletedDatatable;
  104170. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  104171. if (document.getElementById('completedcompound')) {
  104172. var component = document.getElementById('completedcompound');
  104173. var props = Object.assign({}, component.dataset);
  104174. react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(CompletedDatatable, props), component);
  104175. }
  104176. /***/ }),
  104177. /***/ "./resources/js/components/compound/ConfiscatedCompoundDatatable.js":
  104178. /*!**************************************************************************!*\
  104179. !*** ./resources/js/components/compound/ConfiscatedCompoundDatatable.js ***!
  104180. \**************************************************************************/
  104181. /*! exports provided: default */
  104182. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104183. "use strict";
  104184. __webpack_require__.r(__webpack_exports__);
  104185. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ConfiscatedCompoundDatatable; });
  104186. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  104187. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  104188. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  104189. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  104190. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  104191. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  104192. /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
  104193. /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
  104194. /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
  104195. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  104196. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  104197. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  104198. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  104199. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104200. 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); } }
  104201. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  104202. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  104203. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  104204. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104205. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  104206. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  104207. var ConfiscatedCompoundDatatable =
  104208. /*#__PURE__*/
  104209. function (_Component) {
  104210. _inherits(ConfiscatedCompoundDatatable, _Component);
  104211. function ConfiscatedCompoundDatatable(props) {
  104212. var _this;
  104213. _classCallCheck(this, ConfiscatedCompoundDatatable);
  104214. _this = _possibleConstructorReturn(this, _getPrototypeOf(ConfiscatedCompoundDatatable).call(this, props));
  104215. _this.state = {
  104216. current_id: _this.props.current_id,
  104217. dataCompound: [],
  104218. loading: 'null',
  104219. current_url: 'null',
  104220. total: {
  104221. baru: _this.props.baru,
  104222. invest: _this.props.invest,
  104223. notice: _this.props.notice,
  104224. inven: _this.props.inven,
  104225. collap: _this.props.collap,
  104226. comp: _this.props.comp
  104227. },
  104228. check: {
  104229. kpd: true,
  104230. date: true,
  104231. faulty: true,
  104232. enforcer: true,
  104233. platno: false,
  104234. companyno: false,
  104235. nric: false
  104236. },
  104237. form: {
  104238. modul: _this.props.modul,
  104239. status: _this.props.status,
  104240. type: 'Parkir',
  104241. kpd: '',
  104242. start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  104243. end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  104244. faulty: 'All',
  104245. enforcer: 'All',
  104246. plate_no: '',
  104247. company_no: '',
  104248. nric: ''
  104249. },
  104250. list_enforcer: JSON.parse(_this.props.enforcer),
  104251. list_faulty: JSON.parse(_this.props.faulty)
  104252. };
  104253. _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
  104254. _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
  104255. _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
  104256. _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
  104257. _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
  104258. _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
  104259. _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
  104260. _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
  104261. _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
  104262. _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
  104263. _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
  104264. _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
  104265. _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
  104266. _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
  104267. _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
  104268. return _this;
  104269. }
  104270. _createClass(ConfiscatedCompoundDatatable, [{
  104271. key: "onCheckKpd",
  104272. value: function onCheckKpd(e) {
  104273. var _this2 = this;
  104274. this.setState(function (prevState) {
  104275. return {
  104276. check: _objectSpread({}, prevState.check, {
  104277. kpd: !_this2.state.check.kpd
  104278. })
  104279. };
  104280. });
  104281. }
  104282. }, {
  104283. key: "onCheckDate",
  104284. value: function onCheckDate(e) {
  104285. var _this3 = this;
  104286. this.setState(function (prevState) {
  104287. return {
  104288. check: _objectSpread({}, prevState.check, {
  104289. date: !_this3.state.check.date
  104290. })
  104291. };
  104292. });
  104293. }
  104294. }, {
  104295. key: "onCheckPlateNo",
  104296. value: function onCheckPlateNo(e) {
  104297. var _this4 = this;
  104298. this.setState(function (prevState) {
  104299. return {
  104300. check: _objectSpread({}, prevState.check, {
  104301. platno: !_this4.state.check.platno
  104302. })
  104303. };
  104304. });
  104305. }
  104306. }, {
  104307. key: "onCheckCompanyNo",
  104308. value: function onCheckCompanyNo(e) {
  104309. var _this5 = this;
  104310. this.setState(function (prevState) {
  104311. return {
  104312. check: _objectSpread({}, prevState.check, {
  104313. companyno: !_this5.state.check.companyno
  104314. })
  104315. };
  104316. });
  104317. }
  104318. }, {
  104319. key: "onCheckNric",
  104320. value: function onCheckNric(e) {
  104321. var _this6 = this;
  104322. this.setState(function (prevState) {
  104323. return {
  104324. check: _objectSpread({}, prevState.check, {
  104325. nric: !_this6.state.check.nric
  104326. })
  104327. };
  104328. });
  104329. }
  104330. }, {
  104331. key: "onChangeKpd",
  104332. value: function onChangeKpd(e) {
  104333. var value = e.target.value;
  104334. this.setState(function (prevState) {
  104335. return {
  104336. form: _objectSpread({}, prevState.form, {
  104337. kpd: value
  104338. })
  104339. };
  104340. });
  104341. }
  104342. }, {
  104343. key: "onChangeType",
  104344. value: function onChangeType(e) {
  104345. var value = e.target.value;
  104346. this.setState(function (prevState) {
  104347. return {
  104348. form: _objectSpread({}, prevState.form, {
  104349. type: value
  104350. }),
  104351. loading: 'null',
  104352. dataCompound: []
  104353. };
  104354. });
  104355. }
  104356. }, {
  104357. key: "onChangeStart",
  104358. value: function onChangeStart(e) {
  104359. var value = e.target.value;
  104360. this.setState(function (prevState) {
  104361. return {
  104362. form: _objectSpread({}, prevState.form, {
  104363. start_date: value
  104364. })
  104365. };
  104366. });
  104367. }
  104368. }, {
  104369. key: "onChangeEnd",
  104370. value: function onChangeEnd(e) {
  104371. var value = e.target.value;
  104372. this.setState(function (prevState) {
  104373. return {
  104374. form: _objectSpread({}, prevState.form, {
  104375. end_date: value
  104376. })
  104377. };
  104378. });
  104379. }
  104380. }, {
  104381. key: "onChangeFaulty",
  104382. value: function onChangeFaulty(e) {
  104383. var value = e.target.value;
  104384. this.setState(function (prevState) {
  104385. return {
  104386. form: _objectSpread({}, prevState.form, {
  104387. faulty: value
  104388. })
  104389. };
  104390. });
  104391. }
  104392. }, {
  104393. key: "onChangeEnforcer",
  104394. value: function onChangeEnforcer(e) {
  104395. var value = e.target.value;
  104396. this.setState(function (prevState) {
  104397. return {
  104398. form: _objectSpread({}, prevState.form, {
  104399. enforcer: value
  104400. })
  104401. };
  104402. });
  104403. }
  104404. }, {
  104405. key: "onChangePlateNo",
  104406. value: function onChangePlateNo(e) {
  104407. var value = e.target.value;
  104408. this.setState(function (prevState) {
  104409. return {
  104410. form: _objectSpread({}, prevState.form, {
  104411. plate_no: value
  104412. })
  104413. };
  104414. });
  104415. }
  104416. }, {
  104417. key: "onChangeCompanyNo",
  104418. value: function onChangeCompanyNo(e) {
  104419. var value = e.target.value;
  104420. this.setState(function (prevState) {
  104421. return {
  104422. form: _objectSpread({}, prevState.form, {
  104423. company_no: value
  104424. })
  104425. };
  104426. });
  104427. }
  104428. }, {
  104429. key: "onChangeNric",
  104430. value: function onChangeNric(e) {
  104431. var value = e.target.value;
  104432. this.setState(function (prevState) {
  104433. return {
  104434. form: _objectSpread({}, prevState.form, {
  104435. nric: value
  104436. })
  104437. };
  104438. });
  104439. }
  104440. }, {
  104441. key: "onSubmit",
  104442. value: function onSubmit(e) {
  104443. var _this7 = this;
  104444. e.preventDefault();
  104445. this.setState({
  104446. loading: true
  104447. });
  104448. var formData = {
  104449. type: this.state.form.type,
  104450. enforcer: this.state.form.enforcer,
  104451. faulty: this.state.form.faulty,
  104452. modul: this.state.form.modul,
  104453. status: this.state.form.status
  104454. };
  104455. if (this.state.check.date) {
  104456. formData = _objectSpread({}, formData, {
  104457. start_date: this.state.form.start_date,
  104458. end_date: this.state.form.end_date
  104459. });
  104460. } else {
  104461. formData = _objectSpread({}, formData, {
  104462. start_date: '',
  104463. end_date: ''
  104464. });
  104465. }
  104466. if (this.state.check.kpd) {
  104467. formData = _objectSpread({}, formData, {
  104468. kpd: this.state.form.kpd
  104469. });
  104470. } else if (this.state.check.platno) {
  104471. formData = _objectSpread({}, formData, {
  104472. plate_no: this.state.form.plate_no
  104473. });
  104474. } else if (this.state.check.companyno) {
  104475. formData = _objectSpread({}, formData, {
  104476. company_no: this.state.form.company_no
  104477. });
  104478. } else if (this.state.check.nric) {
  104479. formData = _objectSpread({}, formData, {
  104480. nric: this.state.form.nric
  104481. });
  104482. }
  104483. var queryString = Object.keys(formData).map(function (key) {
  104484. return key + '=' + formData[key];
  104485. }).join('&');
  104486. fetch('/api/list/compound?' + queryString).then(function (response) {
  104487. response.json().then(function (res) {
  104488. _this7.setState({
  104489. dataCompound: res.data,
  104490. loading: false,
  104491. current_url: '/api/list/compound?' + queryString
  104492. });
  104493. });
  104494. });
  104495. }
  104496. }, {
  104497. key: "render",
  104498. value: function render() {
  104499. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104500. className: "row"
  104501. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104502. className: "col-xl-2 col-md-12"
  104503. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104504. className: "panel panel-default"
  104505. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104506. className: "panel-heading"
  104507. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
  104508. className: "panel-title"
  104509. }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104510. className: "panel-body"
  104511. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  104512. href: "/main/compound"
  104513. }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  104514. className: "badge badge-inverse-danger"
  104515. }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  104516. href: "/main/compound/investigation"
  104517. }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  104518. className: "badge badge-success"
  104519. }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  104520. href: "/main/compound/notice"
  104521. }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  104522. className: "badge badge-success"
  104523. }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  104524. href: "/main/compound/confiscated",
  104525. className: "active"
  104526. }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  104527. className: "badge badge-success"
  104528. }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  104529. href: "/main/compound/completed"
  104530. }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  104531. className: "badge badge-success"
  104532. }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104533. className: "col-xl-10 col-md-12"
  104534. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104535. className: "row"
  104536. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104537. className: "col-md-12"
  104538. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104539. className: "card"
  104540. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104541. className: "card-block"
  104542. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
  104543. className: "main cussPayment",
  104544. onSubmit: this.onSubmit
  104545. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104546. className: "row clearfix"
  104547. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104548. className: "col-lg-3"
  104549. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104550. type: "checkbox",
  104551. onClick: this.onCheckKpd,
  104552. defaultChecked: true
  104553. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104554. className: "input-group input-group-sm"
  104555. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
  104556. className: "input-group-prepend"
  104557. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  104558. className: "input-group-text"
  104559. }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104560. type: "text",
  104561. className: "form-control form-control-sm",
  104562. placeholder: "SCM4744",
  104563. value: this.state.form.kpd,
  104564. onChange: this.onChangeKpd,
  104565. required: this.state.check.kpd
  104566. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104567. className: "col-lg-3"
  104568. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  104569. className: "form-control form-control-sm",
  104570. value: this.state.form.type,
  104571. onChange: this.onChangeType,
  104572. required: true
  104573. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104574. className: "row clearfix",
  104575. style: {
  104576. marginBottom: "1.25em"
  104577. }
  104578. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104579. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  104580. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104581. type: "checkbox",
  104582. onClick: this.onCheckDate,
  104583. defaultChecked: true
  104584. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104585. className: "col-lg-3"
  104586. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104587. type: "date",
  104588. className: " form-control form-control-sm",
  104589. value: this.state.form.start_date,
  104590. onChange: this.onChangeStart,
  104591. required: this.state.check.date
  104592. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104593. className: "col-lg-3"
  104594. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104595. type: "date",
  104596. className: "form-control form-control-sm",
  104597. value: this.state.form.end_date,
  104598. onChange: this.onChangeEnd
  104599. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104600. className: "row clearfix",
  104601. style: {
  104602. marginBottom: "1.25em"
  104603. }
  104604. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104605. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  104606. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104607. className: "col-lg-9 .offset-xl-3"
  104608. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  104609. className: "form-control form-control-sm",
  104610. defaultValue: "All",
  104611. onChange: this.onChangeFaulty,
  104612. required: this.state.check.faulty
  104613. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104614. value: "All"
  104615. }, "All"), this.state.list_faulty.map(function (act, i) {
  104616. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
  104617. label: act.nama,
  104618. key: i
  104619. }, act.faulty.map(function (faulty, j) {
  104620. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104621. key: j,
  104622. value: faulty._id
  104623. }, "Seksyen ", faulty.sketr);
  104624. }));
  104625. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104626. className: "row clearfix",
  104627. style: {
  104628. marginBottom: "1.25em"
  104629. }
  104630. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104631. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  104632. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104633. className: "col-lg-6 .offset-xl-6"
  104634. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  104635. className: "form-control form-control-sm",
  104636. defaultValue: "All",
  104637. onChange: this.onChangeEnforcer,
  104638. required: this.state.check.enforcer
  104639. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104640. value: "All"
  104641. }, "All"), this.state.list_enforcer.map(function (staff, i) {
  104642. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  104643. key: i,
  104644. value: staff._id
  104645. }, staff.no_badan, ", ", staff.full_name);
  104646. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104647. className: "row clearfix",
  104648. style: {
  104649. marginBottom: "1.25em"
  104650. }
  104651. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104652. className: "col-lg-3"
  104653. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104654. type: "checkbox",
  104655. onClick: this.onCheckPlateNo,
  104656. defaultChecked: false
  104657. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104658. type: "text",
  104659. className: "form-control form-control-sm",
  104660. placeholder: "no plat",
  104661. value: this.state.form.plate_no,
  104662. onChange: this.onChangePlateNo,
  104663. required: this.state.check.platno
  104664. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104665. className: "col-lg-3"
  104666. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104667. type: "checkbox",
  104668. onClick: this.onCheckCompanyNo,
  104669. defaultChecked: false
  104670. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104671. type: "text",
  104672. className: "form-control form-control-sm",
  104673. placeholder: "no syarikat",
  104674. value: this.state.form.company_no,
  104675. onChange: this.onChangeCompanyNo,
  104676. required: this.state.check.companyno
  104677. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104678. className: "col-lg-3"
  104679. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104680. type: "checkbox",
  104681. onClick: this.onCheckNric,
  104682. defaultChecked: false
  104683. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  104684. type: "text",
  104685. className: "form-control form-control-sm",
  104686. placeholder: "nric",
  104687. value: this.state.form.nric,
  104688. onChange: this.onChangeNric,
  104689. required: this.state.check.nric
  104690. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104691. className: "form-group"
  104692. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  104693. type: "submit",
  104694. id: "tapis",
  104695. className: "btn btn-info btn-sm waves-effect waves-light"
  104696. }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104697. className: "col-md-12"
  104698. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104699. className: "card"
  104700. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104701. className: "card-header"
  104702. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
  104703. csvData: this.state.dataCompound,
  104704. fileName: "Report_saman_1",
  104705. type: this.state.form.type
  104706. }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104707. className: "card-block contact-details"
  104708. }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
  104709. data: this.state.dataCompound,
  104710. url: this.state.current_url,
  104711. current_id: this.state.current_id
  104712. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
  104713. data: this.state.dataCompound,
  104714. url: this.state.current_url,
  104715. current_id: this.state.current_id
  104716. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  104717. className: "sweet-loading",
  104718. style: {
  104719. 'textAlign': 'center'
  104720. }
  104721. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  104722. style: {
  104723. 'border-color': 'red'
  104724. },
  104725. sizeUnit: "px",
  104726. size: 50,
  104727. color: '#123abc',
  104728. loading: this.state.loading
  104729. })) : ''))));
  104730. }
  104731. }]);
  104732. return ConfiscatedCompoundDatatable;
  104733. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  104734. if (document.getElementById('confiscatedcompound')) {
  104735. var component = document.getElementById('confiscatedcompound');
  104736. var props = Object.assign({}, component.dataset);
  104737. react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ConfiscatedCompoundDatatable, props), component);
  104738. }
  104739. /***/ }),
  104740. /***/ "./resources/js/components/compound/NewCompoundDataTable.js":
  104741. /*!******************************************************************!*\
  104742. !*** ./resources/js/components/compound/NewCompoundDataTable.js ***!
  104743. \******************************************************************/
  104744. /*! exports provided: default */
  104745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104746. "use strict";
  104747. __webpack_require__.r(__webpack_exports__);
  104748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NewCompoundDataTable; });
  104749. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  104750. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  104751. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  104752. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  104753. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  104754. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  104755. /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
  104756. /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
  104757. /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
  104758. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  104759. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  104760. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  104761. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  104762. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104763. 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); } }
  104764. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  104765. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  104766. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  104767. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  104768. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  104769. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  104770. var NewCompoundDataTable =
  104771. /*#__PURE__*/
  104772. function (_Component) {
  104773. _inherits(NewCompoundDataTable, _Component);
  104774. function NewCompoundDataTable(props) {
  104775. var _this;
  104776. _classCallCheck(this, NewCompoundDataTable);
  104777. _this = _possibleConstructorReturn(this, _getPrototypeOf(NewCompoundDataTable).call(this, props));
  104778. _this.state = {
  104779. current_id: _this.props.current_id,
  104780. dataCompound: [],
  104781. loading: 'null',
  104782. current_url: 'null',
  104783. total: {
  104784. baru: _this.props.baru,
  104785. invest: _this.props.invest,
  104786. notice: _this.props.notice,
  104787. inven: _this.props.inven,
  104788. collap: _this.props.collap,
  104789. comp: _this.props.comp
  104790. },
  104791. check: {
  104792. kpd: true,
  104793. date: true,
  104794. faulty: true,
  104795. enforcer: true,
  104796. platno: false,
  104797. companyno: false,
  104798. nric: false
  104799. },
  104800. form: {
  104801. modul: _this.props.modul,
  104802. status: _this.props.status,
  104803. type: 'Parkir',
  104804. kpd: '',
  104805. start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  104806. end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  104807. faulty: 'All',
  104808. enforcer: 'All',
  104809. plate_no: '',
  104810. company_no: '',
  104811. nric: ''
  104812. },
  104813. list_enforcer: JSON.parse(_this.props.enforcer),
  104814. list_faulty: JSON.parse(_this.props.faulty)
  104815. };
  104816. _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
  104817. _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
  104818. _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
  104819. _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
  104820. _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
  104821. _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
  104822. _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
  104823. _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
  104824. _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
  104825. _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
  104826. _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
  104827. _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
  104828. _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
  104829. _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
  104830. _this.onChangeStatus = _this.onChangeStatus.bind(_assertThisInitialized(_this));
  104831. _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
  104832. return _this;
  104833. }
  104834. _createClass(NewCompoundDataTable, [{
  104835. key: "onCheckKpd",
  104836. value: function onCheckKpd(e) {
  104837. var _this2 = this;
  104838. this.setState(function (prevState) {
  104839. return {
  104840. check: _objectSpread({}, prevState.check, {
  104841. kpd: !_this2.state.check.kpd
  104842. })
  104843. };
  104844. });
  104845. }
  104846. }, {
  104847. key: "onCheckDate",
  104848. value: function onCheckDate(e) {
  104849. var _this3 = this;
  104850. this.setState(function (prevState) {
  104851. return {
  104852. check: _objectSpread({}, prevState.check, {
  104853. date: !_this3.state.check.date
  104854. })
  104855. };
  104856. });
  104857. }
  104858. }, {
  104859. key: "onCheckPlateNo",
  104860. value: function onCheckPlateNo(e) {
  104861. var _this4 = this;
  104862. this.setState(function (prevState) {
  104863. return {
  104864. check: _objectSpread({}, prevState.check, {
  104865. platno: !_this4.state.check.platno
  104866. })
  104867. };
  104868. });
  104869. }
  104870. }, {
  104871. key: "onCheckCompanyNo",
  104872. value: function onCheckCompanyNo(e) {
  104873. var _this5 = this;
  104874. this.setState(function (prevState) {
  104875. return {
  104876. check: _objectSpread({}, prevState.check, {
  104877. companyno: !_this5.state.check.companyno
  104878. })
  104879. };
  104880. });
  104881. }
  104882. }, {
  104883. key: "onCheckNric",
  104884. value: function onCheckNric(e) {
  104885. var _this6 = this;
  104886. this.setState(function (prevState) {
  104887. return {
  104888. check: _objectSpread({}, prevState.check, {
  104889. nric: !_this6.state.check.nric
  104890. })
  104891. };
  104892. });
  104893. }
  104894. }, {
  104895. key: "onChangeKpd",
  104896. value: function onChangeKpd(e) {
  104897. var value = e.target.value;
  104898. this.setState(function (prevState) {
  104899. return {
  104900. form: _objectSpread({}, prevState.form, {
  104901. kpd: value
  104902. })
  104903. };
  104904. });
  104905. }
  104906. }, {
  104907. key: "onChangeType",
  104908. value: function onChangeType(e) {
  104909. var value = e.target.value;
  104910. this.setState(function (prevState) {
  104911. return {
  104912. form: _objectSpread({}, prevState.form, {
  104913. type: value
  104914. }),
  104915. loading: 'null',
  104916. dataCompound: []
  104917. };
  104918. });
  104919. }
  104920. }, {
  104921. key: "onChangeStart",
  104922. value: function onChangeStart(e) {
  104923. var value = e.target.value;
  104924. this.setState(function (prevState) {
  104925. return {
  104926. form: _objectSpread({}, prevState.form, {
  104927. start_date: value
  104928. })
  104929. };
  104930. });
  104931. }
  104932. }, {
  104933. key: "onChangeEnd",
  104934. value: function onChangeEnd(e) {
  104935. var value = e.target.value;
  104936. this.setState(function (prevState) {
  104937. return {
  104938. form: _objectSpread({}, prevState.form, {
  104939. end_date: value
  104940. })
  104941. };
  104942. });
  104943. }
  104944. }, {
  104945. key: "onChangeFaulty",
  104946. value: function onChangeFaulty(e) {
  104947. var value = e.target.value;
  104948. this.setState(function (prevState) {
  104949. return {
  104950. form: _objectSpread({}, prevState.form, {
  104951. faulty: value
  104952. })
  104953. };
  104954. });
  104955. }
  104956. }, {
  104957. key: "onChangeEnforcer",
  104958. value: function onChangeEnforcer(e) {
  104959. var value = e.target.value;
  104960. this.setState(function (prevState) {
  104961. return {
  104962. form: _objectSpread({}, prevState.form, {
  104963. enforcer: value
  104964. })
  104965. };
  104966. });
  104967. }
  104968. }, {
  104969. key: "onChangePlateNo",
  104970. value: function onChangePlateNo(e) {
  104971. var value = e.target.value;
  104972. this.setState(function (prevState) {
  104973. return {
  104974. form: _objectSpread({}, prevState.form, {
  104975. plate_no: value
  104976. })
  104977. };
  104978. });
  104979. }
  104980. }, {
  104981. key: "onChangeCompanyNo",
  104982. value: function onChangeCompanyNo(e) {
  104983. var value = e.target.value;
  104984. this.setState(function (prevState) {
  104985. return {
  104986. form: _objectSpread({}, prevState.form, {
  104987. company_no: value
  104988. })
  104989. };
  104990. });
  104991. }
  104992. }, {
  104993. key: "onChangeNric",
  104994. value: function onChangeNric(e) {
  104995. var value = e.target.value;
  104996. this.setState(function (prevState) {
  104997. return {
  104998. form: _objectSpread({}, prevState.form, {
  104999. nric: value
  105000. })
  105001. };
  105002. });
  105003. }
  105004. }, {
  105005. key: "onChangeStatus",
  105006. value: function onChangeStatus(e) {
  105007. var value = e.target.value;
  105008. this.setState(function (prevState) {
  105009. return {
  105010. form: _objectSpread({}, prevState.form, {
  105011. status: value
  105012. })
  105013. };
  105014. });
  105015. }
  105016. }, {
  105017. key: "onSubmit",
  105018. value: function onSubmit(e) {
  105019. var _this7 = this;
  105020. e.preventDefault();
  105021. this.setState({
  105022. loading: true
  105023. });
  105024. var formData = {
  105025. type: this.state.form.type,
  105026. enforcer: this.state.form.enforcer,
  105027. faulty: this.state.form.faulty,
  105028. modul: this.state.form.modul,
  105029. status: this.state.form.status
  105030. };
  105031. if (this.state.check.date) {
  105032. formData = _objectSpread({}, formData, {
  105033. start_date: this.state.form.start_date,
  105034. end_date: this.state.form.end_date
  105035. });
  105036. } else {
  105037. formData = _objectSpread({}, formData, {
  105038. start_date: '',
  105039. end_date: ''
  105040. });
  105041. }
  105042. if (this.state.check.kpd) {
  105043. formData = _objectSpread({}, formData, {
  105044. kpd: this.state.form.kpd
  105045. });
  105046. } else if (this.state.check.platno) {
  105047. formData = _objectSpread({}, formData, {
  105048. plate_no: this.state.form.plate_no
  105049. });
  105050. } else if (this.state.check.companyno) {
  105051. formData = _objectSpread({}, formData, {
  105052. company_no: this.state.form.company_no
  105053. });
  105054. } else if (this.state.check.nric) {
  105055. formData = _objectSpread({}, formData, {
  105056. nric: this.state.form.nric
  105057. });
  105058. }
  105059. var queryString = Object.keys(formData).map(function (key) {
  105060. return key + '=' + formData[key];
  105061. }).join('&');
  105062. fetch('/api/list/compound?' + queryString).then(function (response) {
  105063. response.json().then(function (res) {
  105064. _this7.setState({
  105065. dataCompound: res.data,
  105066. loading: false,
  105067. current_url: '/api/list/compound?' + queryString
  105068. });
  105069. });
  105070. });
  105071. }
  105072. }, {
  105073. key: "render",
  105074. value: function render() {
  105075. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105076. className: "row"
  105077. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105078. className: "col-xl-2 col-md-12"
  105079. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105080. className: "panel panel-default"
  105081. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105082. className: "panel-heading"
  105083. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
  105084. className: "panel-title"
  105085. }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105086. className: "panel-body"
  105087. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105088. href: "/main/compound",
  105089. className: "active"
  105090. }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105091. className: "badge badge-inverse-danger"
  105092. }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105093. href: "/main/compound/investigation"
  105094. }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105095. className: "badge badge-success"
  105096. }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105097. href: "/main/compound/notice"
  105098. }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105099. className: "badge badge-success"
  105100. }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105101. href: "/main/compound/confiscated"
  105102. }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105103. className: "badge badge-success"
  105104. }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105105. href: "/main/compound/completed"
  105106. }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105107. className: "badge badge-success"
  105108. }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105109. className: "col-xl-10 col-md-12"
  105110. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105111. className: "row"
  105112. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105113. className: "col-md-12"
  105114. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105115. className: "card"
  105116. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105117. className: "card-block"
  105118. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
  105119. className: "main cussPayment",
  105120. onSubmit: this.onSubmit
  105121. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105122. className: "row clearfix"
  105123. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105124. className: "col-lg-3"
  105125. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105126. type: "checkbox",
  105127. onClick: this.onCheckKpd,
  105128. defaultChecked: true
  105129. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105130. className: "input-group input-group-sm"
  105131. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
  105132. className: "input-group-prepend"
  105133. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105134. className: "input-group-text"
  105135. }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105136. type: "text",
  105137. className: "form-control form-control-sm",
  105138. placeholder: "SCM4744",
  105139. value: this.state.form.kpd,
  105140. onChange: this.onChangeKpd,
  105141. required: this.state.check.kpd
  105142. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105143. className: "col-lg-3"
  105144. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  105145. className: "form-control form-control-sm",
  105146. value: this.state.form.type,
  105147. onChange: this.onChangeType,
  105148. required: true
  105149. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105150. className: "row clearfix",
  105151. style: {
  105152. marginBottom: "1.25em"
  105153. }
  105154. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105155. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  105156. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105157. type: "checkbox",
  105158. onClick: this.onCheckDate,
  105159. defaultChecked: true
  105160. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105161. className: "col-lg-3"
  105162. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105163. type: "date",
  105164. className: " form-control form-control-sm",
  105165. value: this.state.form.start_date,
  105166. onChange: this.onChangeStart,
  105167. required: this.state.check.date
  105168. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105169. className: "col-lg-3"
  105170. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105171. type: "date",
  105172. className: "form-control form-control-sm",
  105173. value: this.state.form.end_date,
  105174. onChange: this.onChangeEnd
  105175. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105176. className: "row clearfix",
  105177. style: {
  105178. marginBottom: "1.25em"
  105179. }
  105180. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105181. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  105182. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105183. className: "col-lg-9 .offset-xl-3"
  105184. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  105185. className: "form-control form-control-sm",
  105186. defaultValue: "All",
  105187. onChange: this.onChangeFaulty,
  105188. required: this.state.check.faulty
  105189. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105190. value: "All"
  105191. }, "All"), this.state.list_faulty.map(function (act, i) {
  105192. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
  105193. label: act.nama,
  105194. key: i
  105195. }, act.faulty.map(function (faulty, j) {
  105196. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105197. key: j,
  105198. value: faulty._id
  105199. }, "Seksyen ", faulty.sketr);
  105200. }));
  105201. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105202. className: "row clearfix",
  105203. style: {
  105204. marginBottom: "1.25em"
  105205. }
  105206. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105207. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  105208. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105209. className: "col-lg-6 .offset-xl-6"
  105210. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  105211. className: "form-control form-control-sm",
  105212. defaultValue: "All",
  105213. onChange: this.onChangeEnforcer,
  105214. required: this.state.check.enforcer
  105215. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105216. value: "All"
  105217. }, "All"), this.state.list_enforcer.map(function (staff, i) {
  105218. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105219. key: i,
  105220. value: staff._id
  105221. }, staff.no_badan, ", ", staff.full_name);
  105222. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105223. className: "row clearfix",
  105224. style: {
  105225. marginBottom: "1.25em"
  105226. }
  105227. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105228. className: "col-lg-3"
  105229. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105230. type: "checkbox",
  105231. onClick: this.onCheckPlateNo,
  105232. defaultChecked: false
  105233. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105234. type: "text",
  105235. className: "form-control form-control-sm",
  105236. placeholder: "no plat",
  105237. value: this.state.form.plate_no,
  105238. onChange: this.onChangePlateNo,
  105239. required: this.state.check.platno
  105240. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105241. className: "col-lg-3"
  105242. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105243. type: "checkbox",
  105244. onClick: this.onCheckCompanyNo,
  105245. defaultChecked: false
  105246. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105247. type: "text",
  105248. className: "form-control form-control-sm",
  105249. placeholder: "no syarikat",
  105250. value: this.state.form.company_no,
  105251. onChange: this.onChangeCompanyNo,
  105252. required: this.state.check.companyno
  105253. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105254. className: "col-lg-3"
  105255. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105256. type: "checkbox",
  105257. onClick: this.onCheckNric,
  105258. defaultChecked: false
  105259. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105260. type: "text",
  105261. className: "form-control form-control-sm",
  105262. placeholder: "nric",
  105263. value: this.state.form.nric,
  105264. onChange: this.onChangeNric,
  105265. required: this.state.check.nric
  105266. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105267. className: "row clearfix",
  105268. style: {
  105269. marginBottom: "1.25em"
  105270. }
  105271. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105272. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  105273. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Status"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105274. className: "col-lg-3 .offset-xl-9"
  105275. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  105276. className: "form-control form-control-sm",
  105277. defaultValue: "All",
  105278. onChange: this.onChangeStatus,
  105279. required: true
  105280. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105281. value: "All"
  105282. }, "All"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105283. value: "Belum Bayar"
  105284. }, "Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105285. value: "Batal"
  105286. }, "Batal")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105287. className: "form-group"
  105288. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  105289. type: "submit",
  105290. id: "tapis",
  105291. className: "btn btn-info btn-sm waves-effect waves-light"
  105292. }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105293. className: "col-md-12"
  105294. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105295. className: "card"
  105296. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105297. className: "card-header"
  105298. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
  105299. csvData: this.state.dataCompound,
  105300. fileName: "Report_saman_1",
  105301. type: this.state.form.type
  105302. }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105303. className: "card-block contact-details"
  105304. }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
  105305. data: this.state.dataCompound,
  105306. url: this.state.current_url,
  105307. current_id: this.state.current_id
  105308. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
  105309. data: this.state.dataCompound,
  105310. url: this.state.current_url,
  105311. current_id: this.state.current_id
  105312. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105313. className: "sweet-loading",
  105314. style: {
  105315. 'textAlign': 'center'
  105316. }
  105317. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  105318. style: {
  105319. 'border-color': 'red'
  105320. },
  105321. sizeUnit: "px",
  105322. size: 50,
  105323. color: '#123abc',
  105324. loading: this.state.loading
  105325. })) : ''))));
  105326. }
  105327. }]);
  105328. return NewCompoundDataTable;
  105329. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  105330. if (document.getElementById('newcompound')) {
  105331. var component = document.getElementById('newcompound');
  105332. var props = Object.assign({}, component.dataset);
  105333. react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(NewCompoundDataTable, props), component);
  105334. }
  105335. /***/ }),
  105336. /***/ "./resources/js/components/compound/NoticeCompoundDatatable.js":
  105337. /*!*********************************************************************!*\
  105338. !*** ./resources/js/components/compound/NoticeCompoundDatatable.js ***!
  105339. \*********************************************************************/
  105340. /*! exports provided: default */
  105341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105342. "use strict";
  105343. __webpack_require__.r(__webpack_exports__);
  105344. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NoticeCompoundDatatable; });
  105345. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  105346. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  105347. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  105348. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  105349. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  105350. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  105351. /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
  105352. /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
  105353. /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
  105354. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  105355. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  105356. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  105357. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  105358. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  105359. 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); } }
  105360. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  105361. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  105362. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  105363. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  105364. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  105365. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  105366. var NoticeCompoundDatatable =
  105367. /*#__PURE__*/
  105368. function (_Component) {
  105369. _inherits(NoticeCompoundDatatable, _Component);
  105370. function NoticeCompoundDatatable(props) {
  105371. var _this;
  105372. _classCallCheck(this, NoticeCompoundDatatable);
  105373. _this = _possibleConstructorReturn(this, _getPrototypeOf(NoticeCompoundDatatable).call(this, props));
  105374. _this.state = {
  105375. current_id: _this.props.current_id,
  105376. dataCompound: [],
  105377. loading: 'null',
  105378. current_url: 'null',
  105379. total: {
  105380. baru: _this.props.baru,
  105381. invest: _this.props.invest,
  105382. notice: _this.props.notice,
  105383. inven: _this.props.inven,
  105384. collap: _this.props.collap,
  105385. comp: _this.props.comp
  105386. },
  105387. check: {
  105388. kpd: true,
  105389. date: true,
  105390. faulty: true,
  105391. enforcer: true,
  105392. platno: false,
  105393. companyno: false,
  105394. nric: false
  105395. },
  105396. form: {
  105397. modul: _this.props.modul,
  105398. status: _this.props.status,
  105399. type: 'Parkir',
  105400. kpd: '',
  105401. start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  105402. end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  105403. faulty: 'All',
  105404. enforcer: 'All',
  105405. plate_no: '',
  105406. company_no: '',
  105407. nric: ''
  105408. },
  105409. list_enforcer: JSON.parse(_this.props.enforcer),
  105410. list_faulty: JSON.parse(_this.props.faulty)
  105411. };
  105412. _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
  105413. _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
  105414. _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
  105415. _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
  105416. _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
  105417. _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
  105418. _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
  105419. _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
  105420. _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
  105421. _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
  105422. _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
  105423. _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
  105424. _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
  105425. _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
  105426. _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
  105427. return _this;
  105428. }
  105429. _createClass(NoticeCompoundDatatable, [{
  105430. key: "onCheckKpd",
  105431. value: function onCheckKpd(e) {
  105432. var _this2 = this;
  105433. this.setState(function (prevState) {
  105434. return {
  105435. check: _objectSpread({}, prevState.check, {
  105436. kpd: !_this2.state.check.kpd
  105437. })
  105438. };
  105439. });
  105440. }
  105441. }, {
  105442. key: "onCheckDate",
  105443. value: function onCheckDate(e) {
  105444. var _this3 = this;
  105445. this.setState(function (prevState) {
  105446. return {
  105447. check: _objectSpread({}, prevState.check, {
  105448. date: !_this3.state.check.date
  105449. })
  105450. };
  105451. });
  105452. }
  105453. }, {
  105454. key: "onCheckPlateNo",
  105455. value: function onCheckPlateNo(e) {
  105456. var _this4 = this;
  105457. this.setState(function (prevState) {
  105458. return {
  105459. check: _objectSpread({}, prevState.check, {
  105460. platno: !_this4.state.check.platno
  105461. })
  105462. };
  105463. });
  105464. }
  105465. }, {
  105466. key: "onCheckCompanyNo",
  105467. value: function onCheckCompanyNo(e) {
  105468. var _this5 = this;
  105469. this.setState(function (prevState) {
  105470. return {
  105471. check: _objectSpread({}, prevState.check, {
  105472. companyno: !_this5.state.check.companyno
  105473. })
  105474. };
  105475. });
  105476. }
  105477. }, {
  105478. key: "onCheckNric",
  105479. value: function onCheckNric(e) {
  105480. var _this6 = this;
  105481. this.setState(function (prevState) {
  105482. return {
  105483. check: _objectSpread({}, prevState.check, {
  105484. nric: !_this6.state.check.nric
  105485. })
  105486. };
  105487. });
  105488. }
  105489. }, {
  105490. key: "onChangeKpd",
  105491. value: function onChangeKpd(e) {
  105492. var value = e.target.value;
  105493. this.setState(function (prevState) {
  105494. return {
  105495. form: _objectSpread({}, prevState.form, {
  105496. kpd: value
  105497. })
  105498. };
  105499. });
  105500. }
  105501. }, {
  105502. key: "onChangeType",
  105503. value: function onChangeType(e) {
  105504. var value = e.target.value;
  105505. this.setState(function (prevState) {
  105506. return {
  105507. form: _objectSpread({}, prevState.form, {
  105508. type: value
  105509. }),
  105510. loading: 'null',
  105511. dataCompound: []
  105512. };
  105513. });
  105514. }
  105515. }, {
  105516. key: "onChangeStart",
  105517. value: function onChangeStart(e) {
  105518. var value = e.target.value;
  105519. this.setState(function (prevState) {
  105520. return {
  105521. form: _objectSpread({}, prevState.form, {
  105522. start_date: value
  105523. })
  105524. };
  105525. });
  105526. }
  105527. }, {
  105528. key: "onChangeEnd",
  105529. value: function onChangeEnd(e) {
  105530. var value = e.target.value;
  105531. this.setState(function (prevState) {
  105532. return {
  105533. form: _objectSpread({}, prevState.form, {
  105534. end_date: value
  105535. })
  105536. };
  105537. });
  105538. }
  105539. }, {
  105540. key: "onChangeFaulty",
  105541. value: function onChangeFaulty(e) {
  105542. var value = e.target.value;
  105543. this.setState(function (prevState) {
  105544. return {
  105545. form: _objectSpread({}, prevState.form, {
  105546. faulty: value
  105547. })
  105548. };
  105549. });
  105550. }
  105551. }, {
  105552. key: "onChangeEnforcer",
  105553. value: function onChangeEnforcer(e) {
  105554. var value = e.target.value;
  105555. this.setState(function (prevState) {
  105556. return {
  105557. form: _objectSpread({}, prevState.form, {
  105558. enforcer: value
  105559. })
  105560. };
  105561. });
  105562. }
  105563. }, {
  105564. key: "onChangePlateNo",
  105565. value: function onChangePlateNo(e) {
  105566. var value = e.target.value;
  105567. this.setState(function (prevState) {
  105568. return {
  105569. form: _objectSpread({}, prevState.form, {
  105570. plate_no: value
  105571. })
  105572. };
  105573. });
  105574. }
  105575. }, {
  105576. key: "onChangeCompanyNo",
  105577. value: function onChangeCompanyNo(e) {
  105578. var value = e.target.value;
  105579. this.setState(function (prevState) {
  105580. return {
  105581. form: _objectSpread({}, prevState.form, {
  105582. company_no: value
  105583. })
  105584. };
  105585. });
  105586. }
  105587. }, {
  105588. key: "onChangeNric",
  105589. value: function onChangeNric(e) {
  105590. var value = e.target.value;
  105591. this.setState(function (prevState) {
  105592. return {
  105593. form: _objectSpread({}, prevState.form, {
  105594. nric: value
  105595. })
  105596. };
  105597. });
  105598. }
  105599. }, {
  105600. key: "onSubmit",
  105601. value: function onSubmit(e) {
  105602. var _this7 = this;
  105603. e.preventDefault();
  105604. this.setState({
  105605. loading: true
  105606. });
  105607. var formData = {
  105608. type: this.state.form.type,
  105609. enforcer: this.state.form.enforcer,
  105610. faulty: this.state.form.faulty,
  105611. modul: this.state.form.modul,
  105612. status: this.state.form.status
  105613. };
  105614. if (this.state.check.date) {
  105615. formData = _objectSpread({}, formData, {
  105616. start_date: this.state.form.start_date,
  105617. end_date: this.state.form.end_date
  105618. });
  105619. } else {
  105620. formData = _objectSpread({}, formData, {
  105621. start_date: '',
  105622. end_date: ''
  105623. });
  105624. }
  105625. if (this.state.check.kpd) {
  105626. formData = _objectSpread({}, formData, {
  105627. kpd: this.state.form.kpd
  105628. });
  105629. } else if (this.state.check.platno) {
  105630. formData = _objectSpread({}, formData, {
  105631. plate_no: this.state.form.plate_no
  105632. });
  105633. } else if (this.state.check.companyno) {
  105634. formData = _objectSpread({}, formData, {
  105635. company_no: this.state.form.company_no
  105636. });
  105637. } else if (this.state.check.nric) {
  105638. formData = _objectSpread({}, formData, {
  105639. nric: this.state.form.nric
  105640. });
  105641. }
  105642. var queryString = Object.keys(formData).map(function (key) {
  105643. return key + '=' + formData[key];
  105644. }).join('&');
  105645. fetch('/api/list/compound?' + queryString).then(function (response) {
  105646. response.json().then(function (res) {
  105647. _this7.setState({
  105648. dataCompound: res.data,
  105649. loading: false,
  105650. current_url: '/api/list/compound?' + queryString
  105651. });
  105652. });
  105653. });
  105654. }
  105655. }, {
  105656. key: "render",
  105657. value: function render() {
  105658. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105659. className: "row"
  105660. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105661. className: "col-xl-2 col-md-12"
  105662. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105663. className: "panel panel-default"
  105664. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105665. className: "panel-heading"
  105666. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
  105667. className: "panel-title"
  105668. }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105669. className: "panel-body"
  105670. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105671. href: "/main/compound"
  105672. }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105673. className: "badge badge-inverse-danger"
  105674. }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105675. href: "/main/compound/investigation"
  105676. }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105677. className: "badge badge-success"
  105678. }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105679. href: "/main/compound/notice",
  105680. className: "active"
  105681. }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105682. className: "badge badge-success"
  105683. }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105684. href: "/main/compound/confiscated"
  105685. }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105686. className: "badge badge-success"
  105687. }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  105688. href: "/main/compound/completed"
  105689. }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105690. className: "badge badge-success"
  105691. }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105692. className: "col-xl-10 col-md-12"
  105693. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105694. className: "row"
  105695. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105696. className: "col-md-12"
  105697. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105698. className: "card"
  105699. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105700. className: "card-block"
  105701. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
  105702. className: "main cussPayment",
  105703. onSubmit: this.onSubmit
  105704. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105705. className: "row clearfix"
  105706. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105707. className: "col-lg-3"
  105708. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105709. type: "checkbox",
  105710. onClick: this.onCheckKpd,
  105711. defaultChecked: true
  105712. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105713. className: "input-group input-group-sm"
  105714. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
  105715. className: "input-group-prepend"
  105716. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  105717. className: "input-group-text"
  105718. }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105719. type: "text",
  105720. className: "form-control form-control-sm",
  105721. placeholder: "SCM4744",
  105722. value: this.state.form.kpd,
  105723. onChange: this.onChangeKpd,
  105724. required: this.state.check.kpd
  105725. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105726. className: "col-lg-3"
  105727. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  105728. className: "form-control form-control-sm",
  105729. value: this.state.form.type,
  105730. onChange: this.onChangeType,
  105731. required: true
  105732. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105733. className: "row clearfix",
  105734. style: {
  105735. marginBottom: "1.25em"
  105736. }
  105737. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105738. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  105739. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105740. type: "checkbox",
  105741. onClick: this.onCheckDate,
  105742. defaultChecked: true
  105743. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105744. className: "col-lg-3"
  105745. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105746. type: "date",
  105747. className: " form-control form-control-sm",
  105748. value: this.state.form.start_date,
  105749. onChange: this.onChangeStart,
  105750. required: this.state.check.date
  105751. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105752. className: "col-lg-3"
  105753. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105754. type: "date",
  105755. className: "form-control form-control-sm",
  105756. value: this.state.form.end_date,
  105757. onChange: this.onChangeEnd
  105758. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105759. className: "row clearfix",
  105760. style: {
  105761. marginBottom: "1.25em"
  105762. }
  105763. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105764. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  105765. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105766. className: "col-lg-9 .offset-xl-3"
  105767. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  105768. className: "form-control form-control-sm",
  105769. defaultValue: "All",
  105770. onChange: this.onChangeFaulty,
  105771. required: this.state.check.faulty
  105772. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105773. value: "All"
  105774. }, "All"), this.state.list_faulty.map(function (act, i) {
  105775. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
  105776. label: act.nama,
  105777. key: i
  105778. }, act.faulty.map(function (faulty, j) {
  105779. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105780. key: j,
  105781. value: faulty._id
  105782. }, "Seksyen ", faulty.sketr);
  105783. }));
  105784. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105785. className: "row clearfix",
  105786. style: {
  105787. marginBottom: "1.25em"
  105788. }
  105789. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105790. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  105791. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105792. className: "col-lg-6 .offset-xl-6"
  105793. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  105794. className: "form-control form-control-sm",
  105795. defaultValue: "All",
  105796. onChange: this.onChangeEnforcer,
  105797. required: this.state.check.enforcer
  105798. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105799. value: "All"
  105800. }, "All"), this.state.list_enforcer.map(function (staff, i) {
  105801. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  105802. key: i,
  105803. value: staff._id
  105804. }, staff.no_badan, ", ", staff.full_name);
  105805. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105806. className: "row clearfix",
  105807. style: {
  105808. marginBottom: "1.25em"
  105809. }
  105810. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105811. className: "col-lg-3"
  105812. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105813. type: "checkbox",
  105814. onClick: this.onCheckPlateNo,
  105815. defaultChecked: false
  105816. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105817. type: "text",
  105818. className: "form-control form-control-sm",
  105819. placeholder: "no plat",
  105820. value: this.state.form.plate_no,
  105821. onChange: this.onChangePlateNo,
  105822. required: this.state.check.platno
  105823. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105824. className: "col-lg-3"
  105825. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105826. type: "checkbox",
  105827. onClick: this.onCheckCompanyNo,
  105828. defaultChecked: false
  105829. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105830. type: "text",
  105831. className: "form-control form-control-sm",
  105832. placeholder: "no syarikat",
  105833. value: this.state.form.company_no,
  105834. onChange: this.onChangeCompanyNo,
  105835. required: this.state.check.companyno
  105836. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105837. className: "col-lg-3"
  105838. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105839. type: "checkbox",
  105840. onClick: this.onCheckNric,
  105841. defaultChecked: false
  105842. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  105843. type: "text",
  105844. className: "form-control form-control-sm",
  105845. placeholder: "nric",
  105846. value: this.state.form.nric,
  105847. onChange: this.onChangeNric,
  105848. required: this.state.check.nric
  105849. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105850. className: "form-group"
  105851. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  105852. type: "submit",
  105853. id: "tapis",
  105854. className: "btn btn-info btn-sm waves-effect waves-light"
  105855. }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105856. className: "col-md-12"
  105857. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105858. className: "card"
  105859. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105860. className: "card-header"
  105861. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
  105862. csvData: this.state.dataCompound,
  105863. fileName: "Report_saman_1",
  105864. type: this.state.form.type
  105865. }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105866. className: "card-block contact-details"
  105867. }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
  105868. data: this.state.dataCompound,
  105869. url: this.state.current_url,
  105870. current_id: this.state.current_id
  105871. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
  105872. data: this.state.dataCompound,
  105873. url: this.state.current_url,
  105874. current_id: this.state.current_id
  105875. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105876. className: "sweet-loading",
  105877. style: {
  105878. 'textAlign': 'center'
  105879. }
  105880. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  105881. style: {
  105882. 'border-color': 'red'
  105883. },
  105884. sizeUnit: "px",
  105885. size: 50,
  105886. color: '#123abc',
  105887. loading: this.state.loading
  105888. })) : ''))));
  105889. }
  105890. }]);
  105891. return NoticeCompoundDatatable;
  105892. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  105893. if (document.getElementById('noticecompound')) {
  105894. var component = document.getElementById('noticecompound');
  105895. var props = Object.assign({}, component.dataset);
  105896. react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(NoticeCompoundDatatable, props), component);
  105897. }
  105898. /***/ }),
  105899. /***/ "./resources/js/components/compound/ReportCompound.js":
  105900. /*!************************************************************!*\
  105901. !*** ./resources/js/components/compound/ReportCompound.js ***!
  105902. \************************************************************/
  105903. /*! exports provided: default */
  105904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105905. "use strict";
  105906. __webpack_require__.r(__webpack_exports__);
  105907. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ReportCompound; });
  105908. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  105909. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  105910. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  105911. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  105912. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  105913. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  105914. /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
  105915. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  105916. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  105917. 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); } }
  105918. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  105919. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  105920. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  105921. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  105922. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  105923. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  105924. var ReportCompound =
  105925. /*#__PURE__*/
  105926. function (_Component) {
  105927. _inherits(ReportCompound, _Component);
  105928. function ReportCompound(props) {
  105929. var _this;
  105930. _classCallCheck(this, ReportCompound);
  105931. _this = _possibleConstructorReturn(this, _getPrototypeOf(ReportCompound).call(this, props));
  105932. _this.state = {
  105933. current_id: _this.props.current_id,
  105934. dataReport: [],
  105935. loading: true
  105936. };
  105937. return _this;
  105938. }
  105939. _createClass(ReportCompound, [{
  105940. key: "componentDidMount",
  105941. value: function componentDidMount() {
  105942. var _this2 = this;
  105943. fetch('/api/report/compound/list/null/null').then(function (response) {
  105944. response.json().then(function (res) {
  105945. _this2.setState({
  105946. dataReport: res.data,
  105947. loading: false
  105948. });
  105949. var script = document.createElement("script");
  105950. script.src = "/js/dashboard/datatable.js";
  105951. script.async = true;
  105952. document.body.appendChild(script);
  105953. });
  105954. });
  105955. }
  105956. }, {
  105957. key: "render",
  105958. value: function render() {
  105959. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105960. className: "row"
  105961. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105962. className: "col-xl-12 col-md-12"
  105963. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105964. className: "card"
  105965. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105966. className: "card-header"
  105967. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Laporan Pengeluaran Kompaun Mengikut Kesalahan")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105968. className: "card-block"
  105969. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  105970. className: "data_table_main dt-responsive table-responsive"
  105971. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("table", {
  105972. id: "report",
  105973. className: "table table-sm table-striped table-bordered nowrap datatable",
  105974. style: {
  105975. "width": "100%"
  105976. }
  105977. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("thead", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105978. width: "20"
  105979. }, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105980. width: "80"
  105981. }, "Jumlah Kompaun Keluar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105982. width: "80"
  105983. }, "Amaun Kompaun (Rm)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105984. width: "80"
  105985. }, "Jumlah Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105986. width: "80"
  105987. }, "Amaun Bayar (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105988. width: "80"
  105989. }, "Jumlah Kompaun Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105990. width: "80"
  105991. }, "Amount Tungakkan (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105992. width: "80"
  105993. }, "Kompaun Batal"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105994. width: "80"
  105995. }, "Amaun Batal (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105996. width: "80"
  105997. }, "Kompaun Kurang"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  105998. width: "80"
  105999. }, "Amaun Kurang (RM)"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tbody", null, !this.state.loading ? this.state.dataReport.map(function (item, i) {
  106000. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", {
  106001. key: i
  106002. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.index), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.kesalahan), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlahK), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunK), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlahB), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunB), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.belumB), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunT), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.kBatal), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunBatal), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.kompaunKurang), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunKurang));
  106003. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
  106004. colSpan: "12"
  106005. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106006. className: "sweet-loading",
  106007. style: {
  106008. 'textAlign': 'center'
  106009. }
  106010. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  106011. style: {
  106012. 'border-color': 'red'
  106013. },
  106014. sizeUnit: "px",
  106015. size: 50,
  106016. color: '#123abc',
  106017. loading: this.state.loading
  106018. }))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tfoot", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106019. width: "20"
  106020. }, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106021. width: "80"
  106022. }, "Jumlah Kompaun Keluar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106023. width: "80"
  106024. }, "Amaun Kompaun (Rm)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106025. width: "80"
  106026. }, "Jumlah Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106027. width: "80"
  106028. }, "Amaun Bayar (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106029. width: "80"
  106030. }, "Jumlah Kompaun Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106031. width: "80"
  106032. }, "Amount Tungakkan (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106033. width: "80"
  106034. }, "Kompaun Batal"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106035. width: "80"
  106036. }, "Amaun Batal (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106037. width: "80"
  106038. }, "Kompaun Kurang"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
  106039. width: "80"
  106040. }, "Amaun Kurang (RM)")))))))));
  106041. }
  106042. }]);
  106043. return ReportCompound;
  106044. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  106045. if (document.getElementById('reportcompound')) {
  106046. var component = document.getElementById('reportcompound');
  106047. var props = Object.assign({}, component.dataset);
  106048. react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ReportCompound, props), component);
  106049. }
  106050. /***/ }),
  106051. /***/ "./resources/js/components/compound/VerifiedCompoundDatatable.js":
  106052. /*!***********************************************************************!*\
  106053. !*** ./resources/js/components/compound/VerifiedCompoundDatatable.js ***!
  106054. \***********************************************************************/
  106055. /*! exports provided: default */
  106056. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106057. "use strict";
  106058. __webpack_require__.r(__webpack_exports__);
  106059. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return VerifiedCompoundDatatable; });
  106060. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  106061. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  106062. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  106063. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  106064. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
  106065. /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
  106066. /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
  106067. /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
  106068. /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
  106069. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  106070. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  106071. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  106072. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  106073. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  106074. 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); } }
  106075. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  106076. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  106077. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  106078. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  106079. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  106080. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  106081. var VerifiedCompoundDatatable =
  106082. /*#__PURE__*/
  106083. function (_Component) {
  106084. _inherits(VerifiedCompoundDatatable, _Component);
  106085. function VerifiedCompoundDatatable(props) {
  106086. var _this;
  106087. _classCallCheck(this, VerifiedCompoundDatatable);
  106088. _this = _possibleConstructorReturn(this, _getPrototypeOf(VerifiedCompoundDatatable).call(this, props));
  106089. _this.state = {
  106090. current_id: _this.props.current_id,
  106091. dataCompound: [],
  106092. loading: 'null',
  106093. current_url: 'null',
  106094. total: {
  106095. baru: _this.props.baru,
  106096. invest: _this.props.invest,
  106097. notice: _this.props.notice,
  106098. inven: _this.props.inven,
  106099. collap: _this.props.collap,
  106100. comp: _this.props.comp
  106101. },
  106102. check: {
  106103. kpd: true,
  106104. date: true,
  106105. faulty: true,
  106106. enforcer: true,
  106107. platno: false,
  106108. companyno: false,
  106109. nric: false
  106110. },
  106111. form: {
  106112. modul: _this.props.modul,
  106113. status: _this.props.status,
  106114. type: 'Parkir',
  106115. kpd: '',
  106116. start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  106117. end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  106118. faulty: 'All',
  106119. enforcer: 'All',
  106120. plate_no: '',
  106121. company_no: '',
  106122. nric: ''
  106123. },
  106124. list_enforcer: JSON.parse(_this.props.enforcer),
  106125. list_faulty: JSON.parse(_this.props.faulty)
  106126. };
  106127. _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
  106128. _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
  106129. _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
  106130. _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
  106131. _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
  106132. _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
  106133. _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
  106134. _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
  106135. _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
  106136. _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
  106137. _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
  106138. _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
  106139. _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
  106140. _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
  106141. _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
  106142. return _this;
  106143. }
  106144. _createClass(VerifiedCompoundDatatable, [{
  106145. key: "onCheckKpd",
  106146. value: function onCheckKpd(e) {
  106147. var _this2 = this;
  106148. this.setState(function (prevState) {
  106149. return {
  106150. check: _objectSpread({}, prevState.check, {
  106151. kpd: !_this2.state.check.kpd
  106152. })
  106153. };
  106154. });
  106155. }
  106156. }, {
  106157. key: "onCheckDate",
  106158. value: function onCheckDate(e) {
  106159. var _this3 = this;
  106160. this.setState(function (prevState) {
  106161. return {
  106162. check: _objectSpread({}, prevState.check, {
  106163. date: !_this3.state.check.date
  106164. })
  106165. };
  106166. });
  106167. }
  106168. }, {
  106169. key: "onCheckPlateNo",
  106170. value: function onCheckPlateNo(e) {
  106171. var _this4 = this;
  106172. this.setState(function (prevState) {
  106173. return {
  106174. check: _objectSpread({}, prevState.check, {
  106175. platno: !_this4.state.check.platno
  106176. })
  106177. };
  106178. });
  106179. }
  106180. }, {
  106181. key: "onCheckCompanyNo",
  106182. value: function onCheckCompanyNo(e) {
  106183. var _this5 = this;
  106184. this.setState(function (prevState) {
  106185. return {
  106186. check: _objectSpread({}, prevState.check, {
  106187. companyno: !_this5.state.check.companyno
  106188. })
  106189. };
  106190. });
  106191. }
  106192. }, {
  106193. key: "onCheckNric",
  106194. value: function onCheckNric(e) {
  106195. var _this6 = this;
  106196. this.setState(function (prevState) {
  106197. return {
  106198. check: _objectSpread({}, prevState.check, {
  106199. nric: !_this6.state.check.nric
  106200. })
  106201. };
  106202. });
  106203. }
  106204. }, {
  106205. key: "onChangeKpd",
  106206. value: function onChangeKpd(e) {
  106207. var value = e.target.value;
  106208. this.setState(function (prevState) {
  106209. return {
  106210. form: _objectSpread({}, prevState.form, {
  106211. kpd: value
  106212. })
  106213. };
  106214. });
  106215. }
  106216. }, {
  106217. key: "onChangeType",
  106218. value: function onChangeType(e) {
  106219. var value = e.target.value;
  106220. this.setState(function (prevState) {
  106221. return {
  106222. form: _objectSpread({}, prevState.form, {
  106223. type: value
  106224. }),
  106225. loading: 'null',
  106226. dataCompound: []
  106227. };
  106228. });
  106229. }
  106230. }, {
  106231. key: "onChangeStart",
  106232. value: function onChangeStart(e) {
  106233. var value = e.target.value;
  106234. this.setState(function (prevState) {
  106235. return {
  106236. form: _objectSpread({}, prevState.form, {
  106237. start_date: value
  106238. })
  106239. };
  106240. });
  106241. }
  106242. }, {
  106243. key: "onChangeEnd",
  106244. value: function onChangeEnd(e) {
  106245. var value = e.target.value;
  106246. this.setState(function (prevState) {
  106247. return {
  106248. form: _objectSpread({}, prevState.form, {
  106249. end_date: value
  106250. })
  106251. };
  106252. });
  106253. }
  106254. }, {
  106255. key: "onChangeFaulty",
  106256. value: function onChangeFaulty(e) {
  106257. var value = e.target.value;
  106258. this.setState(function (prevState) {
  106259. return {
  106260. form: _objectSpread({}, prevState.form, {
  106261. faulty: value
  106262. })
  106263. };
  106264. });
  106265. }
  106266. }, {
  106267. key: "onChangeEnforcer",
  106268. value: function onChangeEnforcer(e) {
  106269. var value = e.target.value;
  106270. this.setState(function (prevState) {
  106271. return {
  106272. form: _objectSpread({}, prevState.form, {
  106273. enforcer: value
  106274. })
  106275. };
  106276. });
  106277. }
  106278. }, {
  106279. key: "onChangePlateNo",
  106280. value: function onChangePlateNo(e) {
  106281. var value = e.target.value;
  106282. this.setState(function (prevState) {
  106283. return {
  106284. form: _objectSpread({}, prevState.form, {
  106285. plate_no: value
  106286. })
  106287. };
  106288. });
  106289. }
  106290. }, {
  106291. key: "onChangeCompanyNo",
  106292. value: function onChangeCompanyNo(e) {
  106293. var value = e.target.value;
  106294. this.setState(function (prevState) {
  106295. return {
  106296. form: _objectSpread({}, prevState.form, {
  106297. company_no: value
  106298. })
  106299. };
  106300. });
  106301. }
  106302. }, {
  106303. key: "onChangeNric",
  106304. value: function onChangeNric(e) {
  106305. var value = e.target.value;
  106306. this.setState(function (prevState) {
  106307. return {
  106308. form: _objectSpread({}, prevState.form, {
  106309. nric: value
  106310. })
  106311. };
  106312. });
  106313. }
  106314. }, {
  106315. key: "onSubmit",
  106316. value: function onSubmit(e) {
  106317. var _this7 = this;
  106318. e.preventDefault();
  106319. this.setState({
  106320. loading: true
  106321. });
  106322. var formData = {
  106323. type: this.state.form.type,
  106324. enforcer: this.state.form.enforcer,
  106325. faulty: this.state.form.faulty,
  106326. modul: this.state.form.modul,
  106327. status: this.state.form.status
  106328. };
  106329. if (this.state.check.date) {
  106330. formData = _objectSpread({}, formData, {
  106331. start_date: this.state.form.start_date,
  106332. end_date: this.state.form.end_date
  106333. });
  106334. } else {
  106335. formData = _objectSpread({}, formData, {
  106336. start_date: '',
  106337. end_date: ''
  106338. });
  106339. }
  106340. if (this.state.check.kpd) {
  106341. formData = _objectSpread({}, formData, {
  106342. kpd: this.state.form.kpd
  106343. });
  106344. } else if (this.state.check.platno) {
  106345. formData = _objectSpread({}, formData, {
  106346. plate_no: this.state.form.plate_no
  106347. });
  106348. } else if (this.state.check.companyno) {
  106349. formData = _objectSpread({}, formData, {
  106350. company_no: this.state.form.company_no
  106351. });
  106352. } else if (this.state.check.nric) {
  106353. formData = _objectSpread({}, formData, {
  106354. nric: this.state.form.nric
  106355. });
  106356. }
  106357. var queryString = Object.keys(formData).map(function (key) {
  106358. return key + '=' + formData[key];
  106359. }).join('&');
  106360. fetch('/api/list/compound?' + queryString).then(function (response) {
  106361. response.json().then(function (res) {
  106362. _this7.setState({
  106363. dataCompound: res.data,
  106364. loading: false,
  106365. current_url: '/api/list/compound?' + queryString
  106366. });
  106367. });
  106368. });
  106369. }
  106370. }, {
  106371. key: "render",
  106372. value: function render() {
  106373. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106374. className: "row"
  106375. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106376. className: "col-xl-2 col-md-12"
  106377. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106378. className: "panel panel-default"
  106379. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106380. className: "panel-heading"
  106381. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
  106382. className: "panel-title"
  106383. }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106384. className: "panel-body"
  106385. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  106386. href: "/main/compound"
  106387. }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  106388. className: "badge badge-inverse-danger"
  106389. }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  106390. href: "/main/compound/investigation",
  106391. className: "active"
  106392. }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  106393. className: "badge badge-success"
  106394. }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  106395. href: "/main/compound/notice"
  106396. }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  106397. className: "badge badge-success"
  106398. }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  106399. href: "/main/compound/confiscated"
  106400. }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  106401. className: "badge badge-success"
  106402. }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
  106403. href: "/main/compound/completed"
  106404. }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  106405. className: "badge badge-success"
  106406. }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106407. className: "col-xl-10 col-md-12"
  106408. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106409. className: "row"
  106410. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106411. className: "col-md-12"
  106412. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106413. className: "card"
  106414. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106415. className: "card-block"
  106416. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
  106417. className: "main cussPayment",
  106418. onSubmit: this.onSubmit
  106419. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106420. className: "row clearfix"
  106421. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106422. className: "col-lg-3"
  106423. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106424. type: "checkbox",
  106425. onClick: this.onCheckKpd,
  106426. defaultChecked: true
  106427. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106428. className: "input-group input-group-sm"
  106429. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
  106430. className: "input-group-prepend"
  106431. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
  106432. className: "input-group-text"
  106433. }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106434. type: "text",
  106435. className: "form-control form-control-sm",
  106436. placeholder: "SCM4744",
  106437. value: this.state.form.kpd,
  106438. onChange: this.onChangeKpd,
  106439. required: this.state.check.kpd
  106440. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106441. className: "col-lg-3"
  106442. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  106443. className: "form-control form-control-sm",
  106444. value: this.state.form.type,
  106445. onChange: this.onChangeType,
  106446. required: true
  106447. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106448. className: "row clearfix",
  106449. style: {
  106450. marginBottom: "1.25em"
  106451. }
  106452. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106453. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  106454. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106455. type: "checkbox",
  106456. onClick: this.onCheckDate,
  106457. defaultChecked: true
  106458. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106459. className: "col-lg-3"
  106460. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106461. type: "date",
  106462. className: " form-control form-control-sm",
  106463. value: this.state.form.start_date,
  106464. onChange: this.onChangeStart,
  106465. required: this.state.check.date
  106466. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106467. className: "col-lg-3"
  106468. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106469. type: "date",
  106470. className: "form-control form-control-sm",
  106471. value: this.state.form.end_date,
  106472. onChange: this.onChangeEnd
  106473. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106474. className: "row clearfix",
  106475. style: {
  106476. marginBottom: "1.25em"
  106477. }
  106478. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106479. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  106480. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106481. className: "col-lg-9 .offset-xl-3"
  106482. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  106483. className: "form-control form-control-sm",
  106484. defaultValue: "All",
  106485. onChange: this.onChangeFaulty,
  106486. required: this.state.check.faulty
  106487. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  106488. value: "All"
  106489. }, "All"), this.state.list_faulty.map(function (act, i) {
  106490. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
  106491. label: act.nama,
  106492. key: i
  106493. }, act.faulty.map(function (faulty, j) {
  106494. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  106495. key: j,
  106496. value: faulty._id
  106497. }, "Seksyen ", faulty.sketr);
  106498. }));
  106499. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106500. className: "row clearfix",
  106501. style: {
  106502. marginBottom: "1.25em"
  106503. }
  106504. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106505. className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
  106506. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106507. className: "col-lg-6 .offset-xl-6"
  106508. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
  106509. className: "form-control form-control-sm",
  106510. defaultValue: "All",
  106511. onChange: this.onChangeEnforcer,
  106512. required: this.state.check.enforcer
  106513. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  106514. value: "All"
  106515. }, "All"), this.state.list_enforcer.map(function (staff, i) {
  106516. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
  106517. key: i,
  106518. value: staff._id
  106519. }, staff.no_badan, ", ", staff.full_name);
  106520. })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106521. className: "row clearfix",
  106522. style: {
  106523. marginBottom: "1.25em"
  106524. }
  106525. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106526. className: "col-lg-3"
  106527. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106528. type: "checkbox",
  106529. onClick: this.onCheckPlateNo,
  106530. defaultChecked: false
  106531. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106532. type: "text",
  106533. className: "form-control form-control-sm",
  106534. placeholder: "no plat",
  106535. value: this.state.form.plate_no,
  106536. onChange: this.onChangePlateNo,
  106537. required: this.state.check.platno
  106538. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106539. className: "col-lg-3"
  106540. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106541. type: "checkbox",
  106542. onClick: this.onCheckCompanyNo,
  106543. defaultChecked: false
  106544. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106545. type: "text",
  106546. className: "form-control form-control-sm",
  106547. placeholder: "no syarikat",
  106548. value: this.state.form.company_no,
  106549. onChange: this.onChangeCompanyNo,
  106550. required: this.state.check.companyno
  106551. })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106552. className: "col-lg-3"
  106553. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106554. type: "checkbox",
  106555. onClick: this.onCheckNric,
  106556. defaultChecked: false
  106557. }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
  106558. type: "text",
  106559. className: "form-control form-control-sm",
  106560. placeholder: "nric",
  106561. value: this.state.form.nric,
  106562. onChange: this.onChangeNric,
  106563. required: this.state.check.nric
  106564. }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106565. className: "form-group"
  106566. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
  106567. type: "submit",
  106568. id: "tapis",
  106569. className: "btn btn-info btn-sm waves-effect waves-light"
  106570. }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106571. className: "col-md-12"
  106572. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106573. className: "card"
  106574. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106575. className: "card-header"
  106576. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
  106577. csvData: this.state.dataCompound,
  106578. fileName: "Report_saman_1",
  106579. type: this.state.form.type
  106580. }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106581. className: "card-block contact-details"
  106582. }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
  106583. data: this.state.dataCompound,
  106584. url: this.state.current_url,
  106585. current_id: this.state.current_id
  106586. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
  106587. data: this.state.dataCompound,
  106588. url: this.state.current_url,
  106589. current_id: this.state.current_id
  106590. }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  106591. className: "sweet-loading",
  106592. style: {
  106593. 'textAlign': 'center'
  106594. }
  106595. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
  106596. style: {
  106597. 'border-color': 'red'
  106598. },
  106599. sizeUnit: "px",
  106600. size: 50,
  106601. color: '#123abc',
  106602. loading: this.state.loading
  106603. })) : ''))));
  106604. }
  106605. }]);
  106606. return VerifiedCompoundDatatable;
  106607. }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
  106608. if (document.getElementById('verifiedcompound')) {
  106609. var component = document.getElementById('verifiedcompound');
  106610. var props = Object.assign({}, component.dataset);
  106611. react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(VerifiedCompoundDatatable, props), component);
  106612. }
  106613. /***/ }),
  106614. /***/ "./resources/sass/app.scss":
  106615. /*!*********************************!*\
  106616. !*** ./resources/sass/app.scss ***!
  106617. \*********************************/
  106618. /*! no static exports found */
  106619. /***/ (function(module, exports) {
  106620. // removed by extract-text-webpack-plugin
  106621. /***/ }),
  106622. /***/ 0:
  106623. /*!*************************************************************!*\
  106624. !*** multi ./resources/js/app.js ./resources/sass/app.scss ***!
  106625. \*************************************************************/
  106626. /*! no static exports found */
  106627. /***/ (function(module, exports, __webpack_require__) {
  106628. __webpack_require__(/*! /var/www/html/mdch.sipadu/resources/js/app.js */"./resources/js/app.js");
  106629. module.exports = __webpack_require__(/*! /var/www/html/mdch.sipadu/resources/sass/app.scss */"./resources/sass/app.scss");
  106630. /***/ }),
  106631. /***/ 1:
  106632. /*!********************!*\
  106633. !*** fs (ignored) ***!
  106634. \********************/
  106635. /*! no static exports found */
  106636. /***/ (function(module, exports) {
  106637. /* (ignored) */
  106638. /***/ }),
  106639. /***/ 2:
  106640. /*!************************!*\
  106641. !*** crypto (ignored) ***!
  106642. \************************/
  106643. /*! no static exports found */
  106644. /***/ (function(module, exports) {
  106645. /* (ignored) */
  106646. /***/ }),
  106647. /***/ 3:
  106648. /*!************************!*\
  106649. !*** stream (ignored) ***!
  106650. \************************/
  106651. /*! no static exports found */
  106652. /***/ (function(module, exports) {
  106653. /* (ignored) */
  106654. /***/ })
  106655. /******/ });