Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bson.js 528KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else {
  7. var a = factory();
  8. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  9. }
  10. })(this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/ // The require function
  15. /******/ function __webpack_require__(moduleId) {
  16. /******/ // Check if module is in cache
  17. /******/ if(installedModules[moduleId])
  18. /******/ return installedModules[moduleId].exports;
  19. /******/ // Create a new module (and put it into the cache)
  20. /******/ var module = installedModules[moduleId] = {
  21. /******/ exports: {},
  22. /******/ id: moduleId,
  23. /******/ loaded: false
  24. /******/ };
  25. /******/ // Execute the module function
  26. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  27. /******/ // Flag the module as loaded
  28. /******/ module.loaded = true;
  29. /******/ // Return the exports of the module
  30. /******/ return module.exports;
  31. /******/ }
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/ // __webpack_public_path__
  37. /******/ __webpack_require__.p = "/";
  38. /******/ // Load entry module and return exports
  39. /******/ return __webpack_require__(0);
  40. /******/ })
  41. /************************************************************************/
  42. /******/ ([
  43. /* 0 */
  44. /***/ (function(module, exports, __webpack_require__) {
  45. __webpack_require__(1);
  46. module.exports = __webpack_require__(327);
  47. /***/ }),
  48. /* 1 */
  49. /***/ (function(module, exports, __webpack_require__) {
  50. /* WEBPACK VAR INJECTION */(function(global) {"use strict";
  51. __webpack_require__(2);
  52. __webpack_require__(323);
  53. __webpack_require__(324);
  54. if (global._babelPolyfill) {
  55. throw new Error("only one instance of babel-polyfill is allowed");
  56. }
  57. global._babelPolyfill = true;
  58. var DEFINE_PROPERTY = "defineProperty";
  59. function define(O, key, value) {
  60. O[key] || Object[DEFINE_PROPERTY](O, key, {
  61. writable: true,
  62. configurable: true,
  63. value: value
  64. });
  65. }
  66. define(String.prototype, "padLeft", "".padStart);
  67. define(String.prototype, "padRight", "".padEnd);
  68. "pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
  69. [][key] && define(Array, key, Function.call.bind([][key]));
  70. });
  71. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  72. /***/ }),
  73. /* 2 */
  74. /***/ (function(module, exports, __webpack_require__) {
  75. __webpack_require__(3);
  76. __webpack_require__(51);
  77. __webpack_require__(52);
  78. __webpack_require__(53);
  79. __webpack_require__(54);
  80. __webpack_require__(56);
  81. __webpack_require__(59);
  82. __webpack_require__(60);
  83. __webpack_require__(61);
  84. __webpack_require__(62);
  85. __webpack_require__(63);
  86. __webpack_require__(64);
  87. __webpack_require__(65);
  88. __webpack_require__(66);
  89. __webpack_require__(67);
  90. __webpack_require__(69);
  91. __webpack_require__(71);
  92. __webpack_require__(73);
  93. __webpack_require__(75);
  94. __webpack_require__(78);
  95. __webpack_require__(79);
  96. __webpack_require__(80);
  97. __webpack_require__(84);
  98. __webpack_require__(86);
  99. __webpack_require__(88);
  100. __webpack_require__(91);
  101. __webpack_require__(92);
  102. __webpack_require__(93);
  103. __webpack_require__(94);
  104. __webpack_require__(96);
  105. __webpack_require__(97);
  106. __webpack_require__(98);
  107. __webpack_require__(99);
  108. __webpack_require__(100);
  109. __webpack_require__(101);
  110. __webpack_require__(102);
  111. __webpack_require__(104);
  112. __webpack_require__(105);
  113. __webpack_require__(106);
  114. __webpack_require__(108);
  115. __webpack_require__(109);
  116. __webpack_require__(110);
  117. __webpack_require__(112);
  118. __webpack_require__(114);
  119. __webpack_require__(115);
  120. __webpack_require__(116);
  121. __webpack_require__(117);
  122. __webpack_require__(118);
  123. __webpack_require__(119);
  124. __webpack_require__(120);
  125. __webpack_require__(121);
  126. __webpack_require__(122);
  127. __webpack_require__(123);
  128. __webpack_require__(124);
  129. __webpack_require__(125);
  130. __webpack_require__(126);
  131. __webpack_require__(131);
  132. __webpack_require__(132);
  133. __webpack_require__(136);
  134. __webpack_require__(137);
  135. __webpack_require__(138);
  136. __webpack_require__(139);
  137. __webpack_require__(141);
  138. __webpack_require__(142);
  139. __webpack_require__(143);
  140. __webpack_require__(144);
  141. __webpack_require__(145);
  142. __webpack_require__(146);
  143. __webpack_require__(147);
  144. __webpack_require__(148);
  145. __webpack_require__(149);
  146. __webpack_require__(150);
  147. __webpack_require__(151);
  148. __webpack_require__(152);
  149. __webpack_require__(153);
  150. __webpack_require__(154);
  151. __webpack_require__(155);
  152. __webpack_require__(157);
  153. __webpack_require__(158);
  154. __webpack_require__(160);
  155. __webpack_require__(161);
  156. __webpack_require__(167);
  157. __webpack_require__(168);
  158. __webpack_require__(170);
  159. __webpack_require__(171);
  160. __webpack_require__(172);
  161. __webpack_require__(176);
  162. __webpack_require__(177);
  163. __webpack_require__(178);
  164. __webpack_require__(179);
  165. __webpack_require__(180);
  166. __webpack_require__(182);
  167. __webpack_require__(183);
  168. __webpack_require__(184);
  169. __webpack_require__(185);
  170. __webpack_require__(188);
  171. __webpack_require__(190);
  172. __webpack_require__(191);
  173. __webpack_require__(192);
  174. __webpack_require__(194);
  175. __webpack_require__(196);
  176. __webpack_require__(198);
  177. __webpack_require__(199);
  178. __webpack_require__(200);
  179. __webpack_require__(202);
  180. __webpack_require__(203);
  181. __webpack_require__(204);
  182. __webpack_require__(205);
  183. __webpack_require__(216);
  184. __webpack_require__(220);
  185. __webpack_require__(221);
  186. __webpack_require__(223);
  187. __webpack_require__(224);
  188. __webpack_require__(228);
  189. __webpack_require__(229);
  190. __webpack_require__(231);
  191. __webpack_require__(232);
  192. __webpack_require__(233);
  193. __webpack_require__(234);
  194. __webpack_require__(235);
  195. __webpack_require__(236);
  196. __webpack_require__(237);
  197. __webpack_require__(238);
  198. __webpack_require__(239);
  199. __webpack_require__(240);
  200. __webpack_require__(241);
  201. __webpack_require__(242);
  202. __webpack_require__(243);
  203. __webpack_require__(244);
  204. __webpack_require__(245);
  205. __webpack_require__(246);
  206. __webpack_require__(247);
  207. __webpack_require__(248);
  208. __webpack_require__(249);
  209. __webpack_require__(251);
  210. __webpack_require__(252);
  211. __webpack_require__(253);
  212. __webpack_require__(254);
  213. __webpack_require__(255);
  214. __webpack_require__(257);
  215. __webpack_require__(258);
  216. __webpack_require__(259);
  217. __webpack_require__(261);
  218. __webpack_require__(262);
  219. __webpack_require__(263);
  220. __webpack_require__(264);
  221. __webpack_require__(265);
  222. __webpack_require__(266);
  223. __webpack_require__(267);
  224. __webpack_require__(268);
  225. __webpack_require__(270);
  226. __webpack_require__(271);
  227. __webpack_require__(273);
  228. __webpack_require__(274);
  229. __webpack_require__(275);
  230. __webpack_require__(276);
  231. __webpack_require__(279);
  232. __webpack_require__(280);
  233. __webpack_require__(282);
  234. __webpack_require__(283);
  235. __webpack_require__(284);
  236. __webpack_require__(285);
  237. __webpack_require__(287);
  238. __webpack_require__(288);
  239. __webpack_require__(289);
  240. __webpack_require__(290);
  241. __webpack_require__(291);
  242. __webpack_require__(292);
  243. __webpack_require__(293);
  244. __webpack_require__(294);
  245. __webpack_require__(295);
  246. __webpack_require__(296);
  247. __webpack_require__(298);
  248. __webpack_require__(299);
  249. __webpack_require__(300);
  250. __webpack_require__(301);
  251. __webpack_require__(302);
  252. __webpack_require__(303);
  253. __webpack_require__(304);
  254. __webpack_require__(305);
  255. __webpack_require__(306);
  256. __webpack_require__(307);
  257. __webpack_require__(308);
  258. __webpack_require__(310);
  259. __webpack_require__(311);
  260. __webpack_require__(312);
  261. __webpack_require__(313);
  262. __webpack_require__(314);
  263. __webpack_require__(315);
  264. __webpack_require__(316);
  265. __webpack_require__(317);
  266. __webpack_require__(318);
  267. __webpack_require__(319);
  268. __webpack_require__(320);
  269. __webpack_require__(321);
  270. __webpack_require__(322);
  271. module.exports = __webpack_require__(9);
  272. /***/ }),
  273. /* 3 */
  274. /***/ (function(module, exports, __webpack_require__) {
  275. 'use strict';
  276. // ECMAScript 6 symbols shim
  277. var global = __webpack_require__(4);
  278. var has = __webpack_require__(5);
  279. var DESCRIPTORS = __webpack_require__(6);
  280. var $export = __webpack_require__(8);
  281. var redefine = __webpack_require__(18);
  282. var META = __webpack_require__(22).KEY;
  283. var $fails = __webpack_require__(7);
  284. var shared = __webpack_require__(23);
  285. var setToStringTag = __webpack_require__(25);
  286. var uid = __webpack_require__(19);
  287. var wks = __webpack_require__(26);
  288. var wksExt = __webpack_require__(27);
  289. var wksDefine = __webpack_require__(28);
  290. var enumKeys = __webpack_require__(29);
  291. var isArray = __webpack_require__(44);
  292. var anObject = __webpack_require__(12);
  293. var isObject = __webpack_require__(13);
  294. var toIObject = __webpack_require__(32);
  295. var toPrimitive = __webpack_require__(16);
  296. var createDesc = __webpack_require__(17);
  297. var _create = __webpack_require__(45);
  298. var gOPNExt = __webpack_require__(48);
  299. var $GOPD = __webpack_require__(50);
  300. var $DP = __webpack_require__(11);
  301. var $keys = __webpack_require__(30);
  302. var gOPD = $GOPD.f;
  303. var dP = $DP.f;
  304. var gOPN = gOPNExt.f;
  305. var $Symbol = global.Symbol;
  306. var $JSON = global.JSON;
  307. var _stringify = $JSON && $JSON.stringify;
  308. var PROTOTYPE = 'prototype';
  309. var HIDDEN = wks('_hidden');
  310. var TO_PRIMITIVE = wks('toPrimitive');
  311. var isEnum = {}.propertyIsEnumerable;
  312. var SymbolRegistry = shared('symbol-registry');
  313. var AllSymbols = shared('symbols');
  314. var OPSymbols = shared('op-symbols');
  315. var ObjectProto = Object[PROTOTYPE];
  316. var USE_NATIVE = typeof $Symbol == 'function';
  317. var QObject = global.QObject;
  318. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  319. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  320. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  321. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  322. return _create(dP({}, 'a', {
  323. get: function () { return dP(this, 'a', { value: 7 }).a; }
  324. })).a != 7;
  325. }) ? function (it, key, D) {
  326. var protoDesc = gOPD(ObjectProto, key);
  327. if (protoDesc) delete ObjectProto[key];
  328. dP(it, key, D);
  329. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  330. } : dP;
  331. var wrap = function (tag) {
  332. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  333. sym._k = tag;
  334. return sym;
  335. };
  336. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  337. return typeof it == 'symbol';
  338. } : function (it) {
  339. return it instanceof $Symbol;
  340. };
  341. var $defineProperty = function defineProperty(it, key, D) {
  342. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  343. anObject(it);
  344. key = toPrimitive(key, true);
  345. anObject(D);
  346. if (has(AllSymbols, key)) {
  347. if (!D.enumerable) {
  348. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  349. it[HIDDEN][key] = true;
  350. } else {
  351. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  352. D = _create(D, { enumerable: createDesc(0, false) });
  353. } return setSymbolDesc(it, key, D);
  354. } return dP(it, key, D);
  355. };
  356. var $defineProperties = function defineProperties(it, P) {
  357. anObject(it);
  358. var keys = enumKeys(P = toIObject(P));
  359. var i = 0;
  360. var l = keys.length;
  361. var key;
  362. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  363. return it;
  364. };
  365. var $create = function create(it, P) {
  366. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  367. };
  368. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  369. var E = isEnum.call(this, key = toPrimitive(key, true));
  370. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  371. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  372. };
  373. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  374. it = toIObject(it);
  375. key = toPrimitive(key, true);
  376. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  377. var D = gOPD(it, key);
  378. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  379. return D;
  380. };
  381. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  382. var names = gOPN(toIObject(it));
  383. var result = [];
  384. var i = 0;
  385. var key;
  386. while (names.length > i) {
  387. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  388. } return result;
  389. };
  390. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  391. var IS_OP = it === ObjectProto;
  392. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  393. var result = [];
  394. var i = 0;
  395. var key;
  396. while (names.length > i) {
  397. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  398. } return result;
  399. };
  400. // 19.4.1.1 Symbol([description])
  401. if (!USE_NATIVE) {
  402. $Symbol = function Symbol() {
  403. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  404. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  405. var $set = function (value) {
  406. if (this === ObjectProto) $set.call(OPSymbols, value);
  407. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  408. setSymbolDesc(this, tag, createDesc(1, value));
  409. };
  410. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  411. return wrap(tag);
  412. };
  413. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  414. return this._k;
  415. });
  416. $GOPD.f = $getOwnPropertyDescriptor;
  417. $DP.f = $defineProperty;
  418. __webpack_require__(49).f = gOPNExt.f = $getOwnPropertyNames;
  419. __webpack_require__(43).f = $propertyIsEnumerable;
  420. __webpack_require__(42).f = $getOwnPropertySymbols;
  421. if (DESCRIPTORS && !__webpack_require__(24)) {
  422. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  423. }
  424. wksExt.f = function (name) {
  425. return wrap(wks(name));
  426. };
  427. }
  428. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  429. for (var es6Symbols = (
  430. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  431. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  432. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  433. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  434. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  435. // 19.4.2.1 Symbol.for(key)
  436. 'for': function (key) {
  437. return has(SymbolRegistry, key += '')
  438. ? SymbolRegistry[key]
  439. : SymbolRegistry[key] = $Symbol(key);
  440. },
  441. // 19.4.2.5 Symbol.keyFor(sym)
  442. keyFor: function keyFor(sym) {
  443. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  444. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  445. },
  446. useSetter: function () { setter = true; },
  447. useSimple: function () { setter = false; }
  448. });
  449. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  450. // 19.1.2.2 Object.create(O [, Properties])
  451. create: $create,
  452. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  453. defineProperty: $defineProperty,
  454. // 19.1.2.3 Object.defineProperties(O, Properties)
  455. defineProperties: $defineProperties,
  456. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  457. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  458. // 19.1.2.7 Object.getOwnPropertyNames(O)
  459. getOwnPropertyNames: $getOwnPropertyNames,
  460. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  461. getOwnPropertySymbols: $getOwnPropertySymbols
  462. });
  463. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  464. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  465. var S = $Symbol();
  466. // MS Edge converts symbol values to JSON as {}
  467. // WebKit converts symbol values to JSON as null
  468. // V8 throws on boxed symbols
  469. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  470. })), 'JSON', {
  471. stringify: function stringify(it) {
  472. var args = [it];
  473. var i = 1;
  474. var replacer, $replacer;
  475. while (arguments.length > i) args.push(arguments[i++]);
  476. $replacer = replacer = args[1];
  477. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  478. if (!isArray(replacer)) replacer = function (key, value) {
  479. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  480. if (!isSymbol(value)) return value;
  481. };
  482. args[1] = replacer;
  483. return _stringify.apply($JSON, args);
  484. }
  485. });
  486. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  487. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  488. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  489. setToStringTag($Symbol, 'Symbol');
  490. // 20.2.1.9 Math[@@toStringTag]
  491. setToStringTag(Math, 'Math', true);
  492. // 24.3.3 JSON[@@toStringTag]
  493. setToStringTag(global.JSON, 'JSON', true);
  494. /***/ }),
  495. /* 4 */
  496. /***/ (function(module, exports) {
  497. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  498. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  499. ? window : typeof self != 'undefined' && self.Math == Math ? self
  500. // eslint-disable-next-line no-new-func
  501. : Function('return this')();
  502. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  503. /***/ }),
  504. /* 5 */
  505. /***/ (function(module, exports) {
  506. var hasOwnProperty = {}.hasOwnProperty;
  507. module.exports = function (it, key) {
  508. return hasOwnProperty.call(it, key);
  509. };
  510. /***/ }),
  511. /* 6 */
  512. /***/ (function(module, exports, __webpack_require__) {
  513. // Thank's IE8 for his funny defineProperty
  514. module.exports = !__webpack_require__(7)(function () {
  515. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  516. });
  517. /***/ }),
  518. /* 7 */
  519. /***/ (function(module, exports) {
  520. module.exports = function (exec) {
  521. try {
  522. return !!exec();
  523. } catch (e) {
  524. return true;
  525. }
  526. };
  527. /***/ }),
  528. /* 8 */
  529. /***/ (function(module, exports, __webpack_require__) {
  530. var global = __webpack_require__(4);
  531. var core = __webpack_require__(9);
  532. var hide = __webpack_require__(10);
  533. var redefine = __webpack_require__(18);
  534. var ctx = __webpack_require__(20);
  535. var PROTOTYPE = 'prototype';
  536. var $export = function (type, name, source) {
  537. var IS_FORCED = type & $export.F;
  538. var IS_GLOBAL = type & $export.G;
  539. var IS_STATIC = type & $export.S;
  540. var IS_PROTO = type & $export.P;
  541. var IS_BIND = type & $export.B;
  542. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  543. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  544. var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
  545. var key, own, out, exp;
  546. if (IS_GLOBAL) source = name;
  547. for (key in source) {
  548. // contains in native
  549. own = !IS_FORCED && target && target[key] !== undefined;
  550. // export native or passed
  551. out = (own ? target : source)[key];
  552. // bind timers to global for call from export context
  553. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  554. // extend global
  555. if (target) redefine(target, key, out, type & $export.U);
  556. // export
  557. if (exports[key] != out) hide(exports, key, exp);
  558. if (IS_PROTO && expProto[key] != out) expProto[key] = out;
  559. }
  560. };
  561. global.core = core;
  562. // type bitmap
  563. $export.F = 1; // forced
  564. $export.G = 2; // global
  565. $export.S = 4; // static
  566. $export.P = 8; // proto
  567. $export.B = 16; // bind
  568. $export.W = 32; // wrap
  569. $export.U = 64; // safe
  570. $export.R = 128; // real proto method for `library`
  571. module.exports = $export;
  572. /***/ }),
  573. /* 9 */
  574. /***/ (function(module, exports) {
  575. var core = module.exports = { version: '2.5.7' };
  576. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  577. /***/ }),
  578. /* 10 */
  579. /***/ (function(module, exports, __webpack_require__) {
  580. var dP = __webpack_require__(11);
  581. var createDesc = __webpack_require__(17);
  582. module.exports = __webpack_require__(6) ? function (object, key, value) {
  583. return dP.f(object, key, createDesc(1, value));
  584. } : function (object, key, value) {
  585. object[key] = value;
  586. return object;
  587. };
  588. /***/ }),
  589. /* 11 */
  590. /***/ (function(module, exports, __webpack_require__) {
  591. var anObject = __webpack_require__(12);
  592. var IE8_DOM_DEFINE = __webpack_require__(14);
  593. var toPrimitive = __webpack_require__(16);
  594. var dP = Object.defineProperty;
  595. exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  596. anObject(O);
  597. P = toPrimitive(P, true);
  598. anObject(Attributes);
  599. if (IE8_DOM_DEFINE) try {
  600. return dP(O, P, Attributes);
  601. } catch (e) { /* empty */ }
  602. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  603. if ('value' in Attributes) O[P] = Attributes.value;
  604. return O;
  605. };
  606. /***/ }),
  607. /* 12 */
  608. /***/ (function(module, exports, __webpack_require__) {
  609. var isObject = __webpack_require__(13);
  610. module.exports = function (it) {
  611. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  612. return it;
  613. };
  614. /***/ }),
  615. /* 13 */
  616. /***/ (function(module, exports) {
  617. module.exports = function (it) {
  618. return typeof it === 'object' ? it !== null : typeof it === 'function';
  619. };
  620. /***/ }),
  621. /* 14 */
  622. /***/ (function(module, exports, __webpack_require__) {
  623. module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () {
  624. return Object.defineProperty(__webpack_require__(15)('div'), 'a', { get: function () { return 7; } }).a != 7;
  625. });
  626. /***/ }),
  627. /* 15 */
  628. /***/ (function(module, exports, __webpack_require__) {
  629. var isObject = __webpack_require__(13);
  630. var document = __webpack_require__(4).document;
  631. // typeof document.createElement is 'object' in old IE
  632. var is = isObject(document) && isObject(document.createElement);
  633. module.exports = function (it) {
  634. return is ? document.createElement(it) : {};
  635. };
  636. /***/ }),
  637. /* 16 */
  638. /***/ (function(module, exports, __webpack_require__) {
  639. // 7.1.1 ToPrimitive(input [, PreferredType])
  640. var isObject = __webpack_require__(13);
  641. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  642. // and the second argument - flag - preferred type is a string
  643. module.exports = function (it, S) {
  644. if (!isObject(it)) return it;
  645. var fn, val;
  646. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  647. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  648. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  649. throw TypeError("Can't convert object to primitive value");
  650. };
  651. /***/ }),
  652. /* 17 */
  653. /***/ (function(module, exports) {
  654. module.exports = function (bitmap, value) {
  655. return {
  656. enumerable: !(bitmap & 1),
  657. configurable: !(bitmap & 2),
  658. writable: !(bitmap & 4),
  659. value: value
  660. };
  661. };
  662. /***/ }),
  663. /* 18 */
  664. /***/ (function(module, exports, __webpack_require__) {
  665. var global = __webpack_require__(4);
  666. var hide = __webpack_require__(10);
  667. var has = __webpack_require__(5);
  668. var SRC = __webpack_require__(19)('src');
  669. var TO_STRING = 'toString';
  670. var $toString = Function[TO_STRING];
  671. var TPL = ('' + $toString).split(TO_STRING);
  672. __webpack_require__(9).inspectSource = function (it) {
  673. return $toString.call(it);
  674. };
  675. (module.exports = function (O, key, val, safe) {
  676. var isFunction = typeof val == 'function';
  677. if (isFunction) has(val, 'name') || hide(val, 'name', key);
  678. if (O[key] === val) return;
  679. if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  680. if (O === global) {
  681. O[key] = val;
  682. } else if (!safe) {
  683. delete O[key];
  684. hide(O, key, val);
  685. } else if (O[key]) {
  686. O[key] = val;
  687. } else {
  688. hide(O, key, val);
  689. }
  690. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  691. })(Function.prototype, TO_STRING, function toString() {
  692. return typeof this == 'function' && this[SRC] || $toString.call(this);
  693. });
  694. /***/ }),
  695. /* 19 */
  696. /***/ (function(module, exports) {
  697. var id = 0;
  698. var px = Math.random();
  699. module.exports = function (key) {
  700. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  701. };
  702. /***/ }),
  703. /* 20 */
  704. /***/ (function(module, exports, __webpack_require__) {
  705. // optional / simple context binding
  706. var aFunction = __webpack_require__(21);
  707. module.exports = function (fn, that, length) {
  708. aFunction(fn);
  709. if (that === undefined) return fn;
  710. switch (length) {
  711. case 1: return function (a) {
  712. return fn.call(that, a);
  713. };
  714. case 2: return function (a, b) {
  715. return fn.call(that, a, b);
  716. };
  717. case 3: return function (a, b, c) {
  718. return fn.call(that, a, b, c);
  719. };
  720. }
  721. return function (/* ...args */) {
  722. return fn.apply(that, arguments);
  723. };
  724. };
  725. /***/ }),
  726. /* 21 */
  727. /***/ (function(module, exports) {
  728. module.exports = function (it) {
  729. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  730. return it;
  731. };
  732. /***/ }),
  733. /* 22 */
  734. /***/ (function(module, exports, __webpack_require__) {
  735. var META = __webpack_require__(19)('meta');
  736. var isObject = __webpack_require__(13);
  737. var has = __webpack_require__(5);
  738. var setDesc = __webpack_require__(11).f;
  739. var id = 0;
  740. var isExtensible = Object.isExtensible || function () {
  741. return true;
  742. };
  743. var FREEZE = !__webpack_require__(7)(function () {
  744. return isExtensible(Object.preventExtensions({}));
  745. });
  746. var setMeta = function (it) {
  747. setDesc(it, META, { value: {
  748. i: 'O' + ++id, // object ID
  749. w: {} // weak collections IDs
  750. } });
  751. };
  752. var fastKey = function (it, create) {
  753. // return primitive with prefix
  754. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  755. if (!has(it, META)) {
  756. // can't set metadata to uncaught frozen object
  757. if (!isExtensible(it)) return 'F';
  758. // not necessary to add metadata
  759. if (!create) return 'E';
  760. // add missing metadata
  761. setMeta(it);
  762. // return object ID
  763. } return it[META].i;
  764. };
  765. var getWeak = function (it, create) {
  766. if (!has(it, META)) {
  767. // can't set metadata to uncaught frozen object
  768. if (!isExtensible(it)) return true;
  769. // not necessary to add metadata
  770. if (!create) return false;
  771. // add missing metadata
  772. setMeta(it);
  773. // return hash weak collections IDs
  774. } return it[META].w;
  775. };
  776. // add metadata on freeze-family methods calling
  777. var onFreeze = function (it) {
  778. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  779. return it;
  780. };
  781. var meta = module.exports = {
  782. KEY: META,
  783. NEED: false,
  784. fastKey: fastKey,
  785. getWeak: getWeak,
  786. onFreeze: onFreeze
  787. };
  788. /***/ }),
  789. /* 23 */
  790. /***/ (function(module, exports, __webpack_require__) {
  791. var core = __webpack_require__(9);
  792. var global = __webpack_require__(4);
  793. var SHARED = '__core-js_shared__';
  794. var store = global[SHARED] || (global[SHARED] = {});
  795. (module.exports = function (key, value) {
  796. return store[key] || (store[key] = value !== undefined ? value : {});
  797. })('versions', []).push({
  798. version: core.version,
  799. mode: __webpack_require__(24) ? 'pure' : 'global',
  800. copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
  801. });
  802. /***/ }),
  803. /* 24 */
  804. /***/ (function(module, exports) {
  805. module.exports = false;
  806. /***/ }),
  807. /* 25 */
  808. /***/ (function(module, exports, __webpack_require__) {
  809. var def = __webpack_require__(11).f;
  810. var has = __webpack_require__(5);
  811. var TAG = __webpack_require__(26)('toStringTag');
  812. module.exports = function (it, tag, stat) {
  813. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  814. };
  815. /***/ }),
  816. /* 26 */
  817. /***/ (function(module, exports, __webpack_require__) {
  818. var store = __webpack_require__(23)('wks');
  819. var uid = __webpack_require__(19);
  820. var Symbol = __webpack_require__(4).Symbol;
  821. var USE_SYMBOL = typeof Symbol == 'function';
  822. var $exports = module.exports = function (name) {
  823. return store[name] || (store[name] =
  824. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  825. };
  826. $exports.store = store;
  827. /***/ }),
  828. /* 27 */
  829. /***/ (function(module, exports, __webpack_require__) {
  830. exports.f = __webpack_require__(26);
  831. /***/ }),
  832. /* 28 */
  833. /***/ (function(module, exports, __webpack_require__) {
  834. var global = __webpack_require__(4);
  835. var core = __webpack_require__(9);
  836. var LIBRARY = __webpack_require__(24);
  837. var wksExt = __webpack_require__(27);
  838. var defineProperty = __webpack_require__(11).f;
  839. module.exports = function (name) {
  840. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  841. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  842. };
  843. /***/ }),
  844. /* 29 */
  845. /***/ (function(module, exports, __webpack_require__) {
  846. // all enumerable object keys, includes symbols
  847. var getKeys = __webpack_require__(30);
  848. var gOPS = __webpack_require__(42);
  849. var pIE = __webpack_require__(43);
  850. module.exports = function (it) {
  851. var result = getKeys(it);
  852. var getSymbols = gOPS.f;
  853. if (getSymbols) {
  854. var symbols = getSymbols(it);
  855. var isEnum = pIE.f;
  856. var i = 0;
  857. var key;
  858. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  859. } return result;
  860. };
  861. /***/ }),
  862. /* 30 */
  863. /***/ (function(module, exports, __webpack_require__) {
  864. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  865. var $keys = __webpack_require__(31);
  866. var enumBugKeys = __webpack_require__(41);
  867. module.exports = Object.keys || function keys(O) {
  868. return $keys(O, enumBugKeys);
  869. };
  870. /***/ }),
  871. /* 31 */
  872. /***/ (function(module, exports, __webpack_require__) {
  873. var has = __webpack_require__(5);
  874. var toIObject = __webpack_require__(32);
  875. var arrayIndexOf = __webpack_require__(36)(false);
  876. var IE_PROTO = __webpack_require__(40)('IE_PROTO');
  877. module.exports = function (object, names) {
  878. var O = toIObject(object);
  879. var i = 0;
  880. var result = [];
  881. var key;
  882. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  883. // Don't enum bug & hidden keys
  884. while (names.length > i) if (has(O, key = names[i++])) {
  885. ~arrayIndexOf(result, key) || result.push(key);
  886. }
  887. return result;
  888. };
  889. /***/ }),
  890. /* 32 */
  891. /***/ (function(module, exports, __webpack_require__) {
  892. // to indexed object, toObject with fallback for non-array-like ES3 strings
  893. var IObject = __webpack_require__(33);
  894. var defined = __webpack_require__(35);
  895. module.exports = function (it) {
  896. return IObject(defined(it));
  897. };
  898. /***/ }),
  899. /* 33 */
  900. /***/ (function(module, exports, __webpack_require__) {
  901. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  902. var cof = __webpack_require__(34);
  903. // eslint-disable-next-line no-prototype-builtins
  904. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  905. return cof(it) == 'String' ? it.split('') : Object(it);
  906. };
  907. /***/ }),
  908. /* 34 */
  909. /***/ (function(module, exports) {
  910. var toString = {}.toString;
  911. module.exports = function (it) {
  912. return toString.call(it).slice(8, -1);
  913. };
  914. /***/ }),
  915. /* 35 */
  916. /***/ (function(module, exports) {
  917. // 7.2.1 RequireObjectCoercible(argument)
  918. module.exports = function (it) {
  919. if (it == undefined) throw TypeError("Can't call method on " + it);
  920. return it;
  921. };
  922. /***/ }),
  923. /* 36 */
  924. /***/ (function(module, exports, __webpack_require__) {
  925. // false -> Array#indexOf
  926. // true -> Array#includes
  927. var toIObject = __webpack_require__(32);
  928. var toLength = __webpack_require__(37);
  929. var toAbsoluteIndex = __webpack_require__(39);
  930. module.exports = function (IS_INCLUDES) {
  931. return function ($this, el, fromIndex) {
  932. var O = toIObject($this);
  933. var length = toLength(O.length);
  934. var index = toAbsoluteIndex(fromIndex, length);
  935. var value;
  936. // Array#includes uses SameValueZero equality algorithm
  937. // eslint-disable-next-line no-self-compare
  938. if (IS_INCLUDES && el != el) while (length > index) {
  939. value = O[index++];
  940. // eslint-disable-next-line no-self-compare
  941. if (value != value) return true;
  942. // Array#indexOf ignores holes, Array#includes - not
  943. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  944. if (O[index] === el) return IS_INCLUDES || index || 0;
  945. } return !IS_INCLUDES && -1;
  946. };
  947. };
  948. /***/ }),
  949. /* 37 */
  950. /***/ (function(module, exports, __webpack_require__) {
  951. // 7.1.15 ToLength
  952. var toInteger = __webpack_require__(38);
  953. var min = Math.min;
  954. module.exports = function (it) {
  955. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  956. };
  957. /***/ }),
  958. /* 38 */
  959. /***/ (function(module, exports) {
  960. // 7.1.4 ToInteger
  961. var ceil = Math.ceil;
  962. var floor = Math.floor;
  963. module.exports = function (it) {
  964. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  965. };
  966. /***/ }),
  967. /* 39 */
  968. /***/ (function(module, exports, __webpack_require__) {
  969. var toInteger = __webpack_require__(38);
  970. var max = Math.max;
  971. var min = Math.min;
  972. module.exports = function (index, length) {
  973. index = toInteger(index);
  974. return index < 0 ? max(index + length, 0) : min(index, length);
  975. };
  976. /***/ }),
  977. /* 40 */
  978. /***/ (function(module, exports, __webpack_require__) {
  979. var shared = __webpack_require__(23)('keys');
  980. var uid = __webpack_require__(19);
  981. module.exports = function (key) {
  982. return shared[key] || (shared[key] = uid(key));
  983. };
  984. /***/ }),
  985. /* 41 */
  986. /***/ (function(module, exports) {
  987. // IE 8- don't enum bug keys
  988. module.exports = (
  989. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  990. ).split(',');
  991. /***/ }),
  992. /* 42 */
  993. /***/ (function(module, exports) {
  994. exports.f = Object.getOwnPropertySymbols;
  995. /***/ }),
  996. /* 43 */
  997. /***/ (function(module, exports) {
  998. exports.f = {}.propertyIsEnumerable;
  999. /***/ }),
  1000. /* 44 */
  1001. /***/ (function(module, exports, __webpack_require__) {
  1002. // 7.2.2 IsArray(argument)
  1003. var cof = __webpack_require__(34);
  1004. module.exports = Array.isArray || function isArray(arg) {
  1005. return cof(arg) == 'Array';
  1006. };
  1007. /***/ }),
  1008. /* 45 */
  1009. /***/ (function(module, exports, __webpack_require__) {
  1010. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  1011. var anObject = __webpack_require__(12);
  1012. var dPs = __webpack_require__(46);
  1013. var enumBugKeys = __webpack_require__(41);
  1014. var IE_PROTO = __webpack_require__(40)('IE_PROTO');
  1015. var Empty = function () { /* empty */ };
  1016. var PROTOTYPE = 'prototype';
  1017. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1018. var createDict = function () {
  1019. // Thrash, waste and sodomy: IE GC bug
  1020. var iframe = __webpack_require__(15)('iframe');
  1021. var i = enumBugKeys.length;
  1022. var lt = '<';
  1023. var gt = '>';
  1024. var iframeDocument;
  1025. iframe.style.display = 'none';
  1026. __webpack_require__(47).appendChild(iframe);
  1027. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  1028. // createDict = iframe.contentWindow.Object;
  1029. // html.removeChild(iframe);
  1030. iframeDocument = iframe.contentWindow.document;
  1031. iframeDocument.open();
  1032. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  1033. iframeDocument.close();
  1034. createDict = iframeDocument.F;
  1035. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  1036. return createDict();
  1037. };
  1038. module.exports = Object.create || function create(O, Properties) {
  1039. var result;
  1040. if (O !== null) {
  1041. Empty[PROTOTYPE] = anObject(O);
  1042. result = new Empty();
  1043. Empty[PROTOTYPE] = null;
  1044. // add "__proto__" for Object.getPrototypeOf polyfill
  1045. result[IE_PROTO] = O;
  1046. } else result = createDict();
  1047. return Properties === undefined ? result : dPs(result, Properties);
  1048. };
  1049. /***/ }),
  1050. /* 46 */
  1051. /***/ (function(module, exports, __webpack_require__) {
  1052. var dP = __webpack_require__(11);
  1053. var anObject = __webpack_require__(12);
  1054. var getKeys = __webpack_require__(30);
  1055. module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) {
  1056. anObject(O);
  1057. var keys = getKeys(Properties);
  1058. var length = keys.length;
  1059. var i = 0;
  1060. var P;
  1061. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  1062. return O;
  1063. };
  1064. /***/ }),
  1065. /* 47 */
  1066. /***/ (function(module, exports, __webpack_require__) {
  1067. var document = __webpack_require__(4).document;
  1068. module.exports = document && document.documentElement;
  1069. /***/ }),
  1070. /* 48 */
  1071. /***/ (function(module, exports, __webpack_require__) {
  1072. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  1073. var toIObject = __webpack_require__(32);
  1074. var gOPN = __webpack_require__(49).f;
  1075. var toString = {}.toString;
  1076. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  1077. ? Object.getOwnPropertyNames(window) : [];
  1078. var getWindowNames = function (it) {
  1079. try {
  1080. return gOPN(it);
  1081. } catch (e) {
  1082. return windowNames.slice();
  1083. }
  1084. };
  1085. module.exports.f = function getOwnPropertyNames(it) {
  1086. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  1087. };
  1088. /***/ }),
  1089. /* 49 */
  1090. /***/ (function(module, exports, __webpack_require__) {
  1091. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  1092. var $keys = __webpack_require__(31);
  1093. var hiddenKeys = __webpack_require__(41).concat('length', 'prototype');
  1094. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1095. return $keys(O, hiddenKeys);
  1096. };
  1097. /***/ }),
  1098. /* 50 */
  1099. /***/ (function(module, exports, __webpack_require__) {
  1100. var pIE = __webpack_require__(43);
  1101. var createDesc = __webpack_require__(17);
  1102. var toIObject = __webpack_require__(32);
  1103. var toPrimitive = __webpack_require__(16);
  1104. var has = __webpack_require__(5);
  1105. var IE8_DOM_DEFINE = __webpack_require__(14);
  1106. var gOPD = Object.getOwnPropertyDescriptor;
  1107. exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  1108. O = toIObject(O);
  1109. P = toPrimitive(P, true);
  1110. if (IE8_DOM_DEFINE) try {
  1111. return gOPD(O, P);
  1112. } catch (e) { /* empty */ }
  1113. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  1114. };
  1115. /***/ }),
  1116. /* 51 */
  1117. /***/ (function(module, exports, __webpack_require__) {
  1118. var $export = __webpack_require__(8);
  1119. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  1120. $export($export.S, 'Object', { create: __webpack_require__(45) });
  1121. /***/ }),
  1122. /* 52 */
  1123. /***/ (function(module, exports, __webpack_require__) {
  1124. var $export = __webpack_require__(8);
  1125. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  1126. $export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(11).f });
  1127. /***/ }),
  1128. /* 53 */
  1129. /***/ (function(module, exports, __webpack_require__) {
  1130. var $export = __webpack_require__(8);
  1131. // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
  1132. $export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(46) });
  1133. /***/ }),
  1134. /* 54 */
  1135. /***/ (function(module, exports, __webpack_require__) {
  1136. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  1137. var toIObject = __webpack_require__(32);
  1138. var $getOwnPropertyDescriptor = __webpack_require__(50).f;
  1139. __webpack_require__(55)('getOwnPropertyDescriptor', function () {
  1140. return function getOwnPropertyDescriptor(it, key) {
  1141. return $getOwnPropertyDescriptor(toIObject(it), key);
  1142. };
  1143. });
  1144. /***/ }),
  1145. /* 55 */
  1146. /***/ (function(module, exports, __webpack_require__) {
  1147. // most Object methods by ES6 should accept primitives
  1148. var $export = __webpack_require__(8);
  1149. var core = __webpack_require__(9);
  1150. var fails = __webpack_require__(7);
  1151. module.exports = function (KEY, exec) {
  1152. var fn = (core.Object || {})[KEY] || Object[KEY];
  1153. var exp = {};
  1154. exp[KEY] = exec(fn);
  1155. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  1156. };
  1157. /***/ }),
  1158. /* 56 */
  1159. /***/ (function(module, exports, __webpack_require__) {
  1160. // 19.1.2.9 Object.getPrototypeOf(O)
  1161. var toObject = __webpack_require__(57);
  1162. var $getPrototypeOf = __webpack_require__(58);
  1163. __webpack_require__(55)('getPrototypeOf', function () {
  1164. return function getPrototypeOf(it) {
  1165. return $getPrototypeOf(toObject(it));
  1166. };
  1167. });
  1168. /***/ }),
  1169. /* 57 */
  1170. /***/ (function(module, exports, __webpack_require__) {
  1171. // 7.1.13 ToObject(argument)
  1172. var defined = __webpack_require__(35);
  1173. module.exports = function (it) {
  1174. return Object(defined(it));
  1175. };
  1176. /***/ }),
  1177. /* 58 */
  1178. /***/ (function(module, exports, __webpack_require__) {
  1179. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  1180. var has = __webpack_require__(5);
  1181. var toObject = __webpack_require__(57);
  1182. var IE_PROTO = __webpack_require__(40)('IE_PROTO');
  1183. var ObjectProto = Object.prototype;
  1184. module.exports = Object.getPrototypeOf || function (O) {
  1185. O = toObject(O);
  1186. if (has(O, IE_PROTO)) return O[IE_PROTO];
  1187. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  1188. return O.constructor.prototype;
  1189. } return O instanceof Object ? ObjectProto : null;
  1190. };
  1191. /***/ }),
  1192. /* 59 */
  1193. /***/ (function(module, exports, __webpack_require__) {
  1194. // 19.1.2.14 Object.keys(O)
  1195. var toObject = __webpack_require__(57);
  1196. var $keys = __webpack_require__(30);
  1197. __webpack_require__(55)('keys', function () {
  1198. return function keys(it) {
  1199. return $keys(toObject(it));
  1200. };
  1201. });
  1202. /***/ }),
  1203. /* 60 */
  1204. /***/ (function(module, exports, __webpack_require__) {
  1205. // 19.1.2.7 Object.getOwnPropertyNames(O)
  1206. __webpack_require__(55)('getOwnPropertyNames', function () {
  1207. return __webpack_require__(48).f;
  1208. });
  1209. /***/ }),
  1210. /* 61 */
  1211. /***/ (function(module, exports, __webpack_require__) {
  1212. // 19.1.2.5 Object.freeze(O)
  1213. var isObject = __webpack_require__(13);
  1214. var meta = __webpack_require__(22).onFreeze;
  1215. __webpack_require__(55)('freeze', function ($freeze) {
  1216. return function freeze(it) {
  1217. return $freeze && isObject(it) ? $freeze(meta(it)) : it;
  1218. };
  1219. });
  1220. /***/ }),
  1221. /* 62 */
  1222. /***/ (function(module, exports, __webpack_require__) {
  1223. // 19.1.2.17 Object.seal(O)
  1224. var isObject = __webpack_require__(13);
  1225. var meta = __webpack_require__(22).onFreeze;
  1226. __webpack_require__(55)('seal', function ($seal) {
  1227. return function seal(it) {
  1228. return $seal && isObject(it) ? $seal(meta(it)) : it;
  1229. };
  1230. });
  1231. /***/ }),
  1232. /* 63 */
  1233. /***/ (function(module, exports, __webpack_require__) {
  1234. // 19.1.2.15 Object.preventExtensions(O)
  1235. var isObject = __webpack_require__(13);
  1236. var meta = __webpack_require__(22).onFreeze;
  1237. __webpack_require__(55)('preventExtensions', function ($preventExtensions) {
  1238. return function preventExtensions(it) {
  1239. return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
  1240. };
  1241. });
  1242. /***/ }),
  1243. /* 64 */
  1244. /***/ (function(module, exports, __webpack_require__) {
  1245. // 19.1.2.12 Object.isFrozen(O)
  1246. var isObject = __webpack_require__(13);
  1247. __webpack_require__(55)('isFrozen', function ($isFrozen) {
  1248. return function isFrozen(it) {
  1249. return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
  1250. };
  1251. });
  1252. /***/ }),
  1253. /* 65 */
  1254. /***/ (function(module, exports, __webpack_require__) {
  1255. // 19.1.2.13 Object.isSealed(O)
  1256. var isObject = __webpack_require__(13);
  1257. __webpack_require__(55)('isSealed', function ($isSealed) {
  1258. return function isSealed(it) {
  1259. return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
  1260. };
  1261. });
  1262. /***/ }),
  1263. /* 66 */
  1264. /***/ (function(module, exports, __webpack_require__) {
  1265. // 19.1.2.11 Object.isExtensible(O)
  1266. var isObject = __webpack_require__(13);
  1267. __webpack_require__(55)('isExtensible', function ($isExtensible) {
  1268. return function isExtensible(it) {
  1269. return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
  1270. };
  1271. });
  1272. /***/ }),
  1273. /* 67 */
  1274. /***/ (function(module, exports, __webpack_require__) {
  1275. // 19.1.3.1 Object.assign(target, source)
  1276. var $export = __webpack_require__(8);
  1277. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(68) });
  1278. /***/ }),
  1279. /* 68 */
  1280. /***/ (function(module, exports, __webpack_require__) {
  1281. 'use strict';
  1282. // 19.1.2.1 Object.assign(target, source, ...)
  1283. var getKeys = __webpack_require__(30);
  1284. var gOPS = __webpack_require__(42);
  1285. var pIE = __webpack_require__(43);
  1286. var toObject = __webpack_require__(57);
  1287. var IObject = __webpack_require__(33);
  1288. var $assign = Object.assign;
  1289. // should work with symbols and should have deterministic property order (V8 bug)
  1290. module.exports = !$assign || __webpack_require__(7)(function () {
  1291. var A = {};
  1292. var B = {};
  1293. // eslint-disable-next-line no-undef
  1294. var S = Symbol();
  1295. var K = 'abcdefghijklmnopqrst';
  1296. A[S] = 7;
  1297. K.split('').forEach(function (k) { B[k] = k; });
  1298. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  1299. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  1300. var T = toObject(target);
  1301. var aLen = arguments.length;
  1302. var index = 1;
  1303. var getSymbols = gOPS.f;
  1304. var isEnum = pIE.f;
  1305. while (aLen > index) {
  1306. var S = IObject(arguments[index++]);
  1307. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  1308. var length = keys.length;
  1309. var j = 0;
  1310. var key;
  1311. while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
  1312. } return T;
  1313. } : $assign;
  1314. /***/ }),
  1315. /* 69 */
  1316. /***/ (function(module, exports, __webpack_require__) {
  1317. // 19.1.3.10 Object.is(value1, value2)
  1318. var $export = __webpack_require__(8);
  1319. $export($export.S, 'Object', { is: __webpack_require__(70) });
  1320. /***/ }),
  1321. /* 70 */
  1322. /***/ (function(module, exports) {
  1323. // 7.2.9 SameValue(x, y)
  1324. module.exports = Object.is || function is(x, y) {
  1325. // eslint-disable-next-line no-self-compare
  1326. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1327. };
  1328. /***/ }),
  1329. /* 71 */
  1330. /***/ (function(module, exports, __webpack_require__) {
  1331. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  1332. var $export = __webpack_require__(8);
  1333. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(72).set });
  1334. /***/ }),
  1335. /* 72 */
  1336. /***/ (function(module, exports, __webpack_require__) {
  1337. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1338. /* eslint-disable no-proto */
  1339. var isObject = __webpack_require__(13);
  1340. var anObject = __webpack_require__(12);
  1341. var check = function (O, proto) {
  1342. anObject(O);
  1343. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  1344. };
  1345. module.exports = {
  1346. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  1347. function (test, buggy, set) {
  1348. try {
  1349. set = __webpack_require__(20)(Function.call, __webpack_require__(50).f(Object.prototype, '__proto__').set, 2);
  1350. set(test, []);
  1351. buggy = !(test instanceof Array);
  1352. } catch (e) { buggy = true; }
  1353. return function setPrototypeOf(O, proto) {
  1354. check(O, proto);
  1355. if (buggy) O.__proto__ = proto;
  1356. else set(O, proto);
  1357. return O;
  1358. };
  1359. }({}, false) : undefined),
  1360. check: check
  1361. };
  1362. /***/ }),
  1363. /* 73 */
  1364. /***/ (function(module, exports, __webpack_require__) {
  1365. 'use strict';
  1366. // 19.1.3.6 Object.prototype.toString()
  1367. var classof = __webpack_require__(74);
  1368. var test = {};
  1369. test[__webpack_require__(26)('toStringTag')] = 'z';
  1370. if (test + '' != '[object z]') {
  1371. __webpack_require__(18)(Object.prototype, 'toString', function toString() {
  1372. return '[object ' + classof(this) + ']';
  1373. }, true);
  1374. }
  1375. /***/ }),
  1376. /* 74 */
  1377. /***/ (function(module, exports, __webpack_require__) {
  1378. // getting tag from 19.1.3.6 Object.prototype.toString()
  1379. var cof = __webpack_require__(34);
  1380. var TAG = __webpack_require__(26)('toStringTag');
  1381. // ES3 wrong here
  1382. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  1383. // fallback for IE11 Script Access Denied error
  1384. var tryGet = function (it, key) {
  1385. try {
  1386. return it[key];
  1387. } catch (e) { /* empty */ }
  1388. };
  1389. module.exports = function (it) {
  1390. var O, T, B;
  1391. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1392. // @@toStringTag case
  1393. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  1394. // builtinTag case
  1395. : ARG ? cof(O)
  1396. // ES3 arguments fallback
  1397. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  1398. };
  1399. /***/ }),
  1400. /* 75 */
  1401. /***/ (function(module, exports, __webpack_require__) {
  1402. // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
  1403. var $export = __webpack_require__(8);
  1404. $export($export.P, 'Function', { bind: __webpack_require__(76) });
  1405. /***/ }),
  1406. /* 76 */
  1407. /***/ (function(module, exports, __webpack_require__) {
  1408. 'use strict';
  1409. var aFunction = __webpack_require__(21);
  1410. var isObject = __webpack_require__(13);
  1411. var invoke = __webpack_require__(77);
  1412. var arraySlice = [].slice;
  1413. var factories = {};
  1414. var construct = function (F, len, args) {
  1415. if (!(len in factories)) {
  1416. for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
  1417. // eslint-disable-next-line no-new-func
  1418. factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
  1419. } return factories[len](F, args);
  1420. };
  1421. module.exports = Function.bind || function bind(that /* , ...args */) {
  1422. var fn = aFunction(this);
  1423. var partArgs = arraySlice.call(arguments, 1);
  1424. var bound = function (/* args... */) {
  1425. var args = partArgs.concat(arraySlice.call(arguments));
  1426. return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
  1427. };
  1428. if (isObject(fn.prototype)) bound.prototype = fn.prototype;
  1429. return bound;
  1430. };
  1431. /***/ }),
  1432. /* 77 */
  1433. /***/ (function(module, exports) {
  1434. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  1435. module.exports = function (fn, args, that) {
  1436. var un = that === undefined;
  1437. switch (args.length) {
  1438. case 0: return un ? fn()
  1439. : fn.call(that);
  1440. case 1: return un ? fn(args[0])
  1441. : fn.call(that, args[0]);
  1442. case 2: return un ? fn(args[0], args[1])
  1443. : fn.call(that, args[0], args[1]);
  1444. case 3: return un ? fn(args[0], args[1], args[2])
  1445. : fn.call(that, args[0], args[1], args[2]);
  1446. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  1447. : fn.call(that, args[0], args[1], args[2], args[3]);
  1448. } return fn.apply(that, args);
  1449. };
  1450. /***/ }),
  1451. /* 78 */
  1452. /***/ (function(module, exports, __webpack_require__) {
  1453. var dP = __webpack_require__(11).f;
  1454. var FProto = Function.prototype;
  1455. var nameRE = /^\s*function ([^ (]*)/;
  1456. var NAME = 'name';
  1457. // 19.2.4.2 name
  1458. NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, {
  1459. configurable: true,
  1460. get: function () {
  1461. try {
  1462. return ('' + this).match(nameRE)[1];
  1463. } catch (e) {
  1464. return '';
  1465. }
  1466. }
  1467. });
  1468. /***/ }),
  1469. /* 79 */
  1470. /***/ (function(module, exports, __webpack_require__) {
  1471. 'use strict';
  1472. var isObject = __webpack_require__(13);
  1473. var getPrototypeOf = __webpack_require__(58);
  1474. var HAS_INSTANCE = __webpack_require__(26)('hasInstance');
  1475. var FunctionProto = Function.prototype;
  1476. // 19.2.3.6 Function.prototype[@@hasInstance](V)
  1477. if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(11).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
  1478. if (typeof this != 'function' || !isObject(O)) return false;
  1479. if (!isObject(this.prototype)) return O instanceof this;
  1480. // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
  1481. while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
  1482. return false;
  1483. } });
  1484. /***/ }),
  1485. /* 80 */
  1486. /***/ (function(module, exports, __webpack_require__) {
  1487. var $export = __webpack_require__(8);
  1488. var $parseInt = __webpack_require__(81);
  1489. // 18.2.5 parseInt(string, radix)
  1490. $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
  1491. /***/ }),
  1492. /* 81 */
  1493. /***/ (function(module, exports, __webpack_require__) {
  1494. var $parseInt = __webpack_require__(4).parseInt;
  1495. var $trim = __webpack_require__(82).trim;
  1496. var ws = __webpack_require__(83);
  1497. var hex = /^[-+]?0[xX]/;
  1498. module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
  1499. var string = $trim(String(str), 3);
  1500. return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  1501. } : $parseInt;
  1502. /***/ }),
  1503. /* 82 */
  1504. /***/ (function(module, exports, __webpack_require__) {
  1505. var $export = __webpack_require__(8);
  1506. var defined = __webpack_require__(35);
  1507. var fails = __webpack_require__(7);
  1508. var spaces = __webpack_require__(83);
  1509. var space = '[' + spaces + ']';
  1510. var non = '\u200b\u0085';
  1511. var ltrim = RegExp('^' + space + space + '*');
  1512. var rtrim = RegExp(space + space + '*$');
  1513. var exporter = function (KEY, exec, ALIAS) {
  1514. var exp = {};
  1515. var FORCE = fails(function () {
  1516. return !!spaces[KEY]() || non[KEY]() != non;
  1517. });
  1518. var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  1519. if (ALIAS) exp[ALIAS] = fn;
  1520. $export($export.P + $export.F * FORCE, 'String', exp);
  1521. };
  1522. // 1 -> String#trimLeft
  1523. // 2 -> String#trimRight
  1524. // 3 -> String#trim
  1525. var trim = exporter.trim = function (string, TYPE) {
  1526. string = String(defined(string));
  1527. if (TYPE & 1) string = string.replace(ltrim, '');
  1528. if (TYPE & 2) string = string.replace(rtrim, '');
  1529. return string;
  1530. };
  1531. module.exports = exporter;
  1532. /***/ }),
  1533. /* 83 */
  1534. /***/ (function(module, exports) {
  1535. module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
  1536. '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1537. /***/ }),
  1538. /* 84 */
  1539. /***/ (function(module, exports, __webpack_require__) {
  1540. var $export = __webpack_require__(8);
  1541. var $parseFloat = __webpack_require__(85);
  1542. // 18.2.4 parseFloat(string)
  1543. $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
  1544. /***/ }),
  1545. /* 85 */
  1546. /***/ (function(module, exports, __webpack_require__) {
  1547. var $parseFloat = __webpack_require__(4).parseFloat;
  1548. var $trim = __webpack_require__(82).trim;
  1549. module.exports = 1 / $parseFloat(__webpack_require__(83) + '-0') !== -Infinity ? function parseFloat(str) {
  1550. var string = $trim(String(str), 3);
  1551. var result = $parseFloat(string);
  1552. return result === 0 && string.charAt(0) == '-' ? -0 : result;
  1553. } : $parseFloat;
  1554. /***/ }),
  1555. /* 86 */
  1556. /***/ (function(module, exports, __webpack_require__) {
  1557. 'use strict';
  1558. var global = __webpack_require__(4);
  1559. var has = __webpack_require__(5);
  1560. var cof = __webpack_require__(34);
  1561. var inheritIfRequired = __webpack_require__(87);
  1562. var toPrimitive = __webpack_require__(16);
  1563. var fails = __webpack_require__(7);
  1564. var gOPN = __webpack_require__(49).f;
  1565. var gOPD = __webpack_require__(50).f;
  1566. var dP = __webpack_require__(11).f;
  1567. var $trim = __webpack_require__(82).trim;
  1568. var NUMBER = 'Number';
  1569. var $Number = global[NUMBER];
  1570. var Base = $Number;
  1571. var proto = $Number.prototype;
  1572. // Opera ~12 has broken Object#toString
  1573. var BROKEN_COF = cof(__webpack_require__(45)(proto)) == NUMBER;
  1574. var TRIM = 'trim' in String.prototype;
  1575. // 7.1.3 ToNumber(argument)
  1576. var toNumber = function (argument) {
  1577. var it = toPrimitive(argument, false);
  1578. if (typeof it == 'string' && it.length > 2) {
  1579. it = TRIM ? it.trim() : $trim(it, 3);
  1580. var first = it.charCodeAt(0);
  1581. var third, radix, maxCode;
  1582. if (first === 43 || first === 45) {
  1583. third = it.charCodeAt(2);
  1584. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  1585. } else if (first === 48) {
  1586. switch (it.charCodeAt(1)) {
  1587. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
  1588. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
  1589. default: return +it;
  1590. }
  1591. for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
  1592. code = digits.charCodeAt(i);
  1593. // parseInt parses a string to a first unavailable symbol
  1594. // but ToNumber should return NaN if a string contains unavailable symbols
  1595. if (code < 48 || code > maxCode) return NaN;
  1596. } return parseInt(digits, radix);
  1597. }
  1598. } return +it;
  1599. };
  1600. if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
  1601. $Number = function Number(value) {
  1602. var it = arguments.length < 1 ? 0 : value;
  1603. var that = this;
  1604. return that instanceof $Number
  1605. // check on 1..constructor(foo) case
  1606. && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
  1607. ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
  1608. };
  1609. for (var keys = __webpack_require__(6) ? gOPN(Base) : (
  1610. // ES3:
  1611. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  1612. // ES6 (in case, if modules with ES6 Number statics required before):
  1613. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  1614. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  1615. ).split(','), j = 0, key; keys.length > j; j++) {
  1616. if (has(Base, key = keys[j]) && !has($Number, key)) {
  1617. dP($Number, key, gOPD(Base, key));
  1618. }
  1619. }
  1620. $Number.prototype = proto;
  1621. proto.constructor = $Number;
  1622. __webpack_require__(18)(global, NUMBER, $Number);
  1623. }
  1624. /***/ }),
  1625. /* 87 */
  1626. /***/ (function(module, exports, __webpack_require__) {
  1627. var isObject = __webpack_require__(13);
  1628. var setPrototypeOf = __webpack_require__(72).set;
  1629. module.exports = function (that, target, C) {
  1630. var S = target.constructor;
  1631. var P;
  1632. if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
  1633. setPrototypeOf(that, P);
  1634. } return that;
  1635. };
  1636. /***/ }),
  1637. /* 88 */
  1638. /***/ (function(module, exports, __webpack_require__) {
  1639. 'use strict';
  1640. var $export = __webpack_require__(8);
  1641. var toInteger = __webpack_require__(38);
  1642. var aNumberValue = __webpack_require__(89);
  1643. var repeat = __webpack_require__(90);
  1644. var $toFixed = 1.0.toFixed;
  1645. var floor = Math.floor;
  1646. var data = [0, 0, 0, 0, 0, 0];
  1647. var ERROR = 'Number.toFixed: incorrect invocation!';
  1648. var ZERO = '0';
  1649. var multiply = function (n, c) {
  1650. var i = -1;
  1651. var c2 = c;
  1652. while (++i < 6) {
  1653. c2 += n * data[i];
  1654. data[i] = c2 % 1e7;
  1655. c2 = floor(c2 / 1e7);
  1656. }
  1657. };
  1658. var divide = function (n) {
  1659. var i = 6;
  1660. var c = 0;
  1661. while (--i >= 0) {
  1662. c += data[i];
  1663. data[i] = floor(c / n);
  1664. c = (c % n) * 1e7;
  1665. }
  1666. };
  1667. var numToString = function () {
  1668. var i = 6;
  1669. var s = '';
  1670. while (--i >= 0) {
  1671. if (s !== '' || i === 0 || data[i] !== 0) {
  1672. var t = String(data[i]);
  1673. s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
  1674. }
  1675. } return s;
  1676. };
  1677. var pow = function (x, n, acc) {
  1678. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  1679. };
  1680. var log = function (x) {
  1681. var n = 0;
  1682. var x2 = x;
  1683. while (x2 >= 4096) {
  1684. n += 12;
  1685. x2 /= 4096;
  1686. }
  1687. while (x2 >= 2) {
  1688. n += 1;
  1689. x2 /= 2;
  1690. } return n;
  1691. };
  1692. $export($export.P + $export.F * (!!$toFixed && (
  1693. 0.00008.toFixed(3) !== '0.000' ||
  1694. 0.9.toFixed(0) !== '1' ||
  1695. 1.255.toFixed(2) !== '1.25' ||
  1696. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  1697. ) || !__webpack_require__(7)(function () {
  1698. // V8 ~ Android 4.3-
  1699. $toFixed.call({});
  1700. })), 'Number', {
  1701. toFixed: function toFixed(fractionDigits) {
  1702. var x = aNumberValue(this, ERROR);
  1703. var f = toInteger(fractionDigits);
  1704. var s = '';
  1705. var m = ZERO;
  1706. var e, z, j, k;
  1707. if (f < 0 || f > 20) throw RangeError(ERROR);
  1708. // eslint-disable-next-line no-self-compare
  1709. if (x != x) return 'NaN';
  1710. if (x <= -1e21 || x >= 1e21) return String(x);
  1711. if (x < 0) {
  1712. s = '-';
  1713. x = -x;
  1714. }
  1715. if (x > 1e-21) {
  1716. e = log(x * pow(2, 69, 1)) - 69;
  1717. z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
  1718. z *= 0x10000000000000;
  1719. e = 52 - e;
  1720. if (e > 0) {
  1721. multiply(0, z);
  1722. j = f;
  1723. while (j >= 7) {
  1724. multiply(1e7, 0);
  1725. j -= 7;
  1726. }
  1727. multiply(pow(10, j, 1), 0);
  1728. j = e - 1;
  1729. while (j >= 23) {
  1730. divide(1 << 23);
  1731. j -= 23;
  1732. }
  1733. divide(1 << j);
  1734. multiply(1, 1);
  1735. divide(2);
  1736. m = numToString();
  1737. } else {
  1738. multiply(0, z);
  1739. multiply(1 << -e, 0);
  1740. m = numToString() + repeat.call(ZERO, f);
  1741. }
  1742. }
  1743. if (f > 0) {
  1744. k = m.length;
  1745. m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
  1746. } else {
  1747. m = s + m;
  1748. } return m;
  1749. }
  1750. });
  1751. /***/ }),
  1752. /* 89 */
  1753. /***/ (function(module, exports, __webpack_require__) {
  1754. var cof = __webpack_require__(34);
  1755. module.exports = function (it, msg) {
  1756. if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
  1757. return +it;
  1758. };
  1759. /***/ }),
  1760. /* 90 */
  1761. /***/ (function(module, exports, __webpack_require__) {
  1762. 'use strict';
  1763. var toInteger = __webpack_require__(38);
  1764. var defined = __webpack_require__(35);
  1765. module.exports = function repeat(count) {
  1766. var str = String(defined(this));
  1767. var res = '';
  1768. var n = toInteger(count);
  1769. if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
  1770. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
  1771. return res;
  1772. };
  1773. /***/ }),
  1774. /* 91 */
  1775. /***/ (function(module, exports, __webpack_require__) {
  1776. 'use strict';
  1777. var $export = __webpack_require__(8);
  1778. var $fails = __webpack_require__(7);
  1779. var aNumberValue = __webpack_require__(89);
  1780. var $toPrecision = 1.0.toPrecision;
  1781. $export($export.P + $export.F * ($fails(function () {
  1782. // IE7-
  1783. return $toPrecision.call(1, undefined) !== '1';
  1784. }) || !$fails(function () {
  1785. // V8 ~ Android 4.3-
  1786. $toPrecision.call({});
  1787. })), 'Number', {
  1788. toPrecision: function toPrecision(precision) {
  1789. var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
  1790. return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
  1791. }
  1792. });
  1793. /***/ }),
  1794. /* 92 */
  1795. /***/ (function(module, exports, __webpack_require__) {
  1796. // 20.1.2.1 Number.EPSILON
  1797. var $export = __webpack_require__(8);
  1798. $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
  1799. /***/ }),
  1800. /* 93 */
  1801. /***/ (function(module, exports, __webpack_require__) {
  1802. // 20.1.2.2 Number.isFinite(number)
  1803. var $export = __webpack_require__(8);
  1804. var _isFinite = __webpack_require__(4).isFinite;
  1805. $export($export.S, 'Number', {
  1806. isFinite: function isFinite(it) {
  1807. return typeof it == 'number' && _isFinite(it);
  1808. }
  1809. });
  1810. /***/ }),
  1811. /* 94 */
  1812. /***/ (function(module, exports, __webpack_require__) {
  1813. // 20.1.2.3 Number.isInteger(number)
  1814. var $export = __webpack_require__(8);
  1815. $export($export.S, 'Number', { isInteger: __webpack_require__(95) });
  1816. /***/ }),
  1817. /* 95 */
  1818. /***/ (function(module, exports, __webpack_require__) {
  1819. // 20.1.2.3 Number.isInteger(number)
  1820. var isObject = __webpack_require__(13);
  1821. var floor = Math.floor;
  1822. module.exports = function isInteger(it) {
  1823. return !isObject(it) && isFinite(it) && floor(it) === it;
  1824. };
  1825. /***/ }),
  1826. /* 96 */
  1827. /***/ (function(module, exports, __webpack_require__) {
  1828. // 20.1.2.4 Number.isNaN(number)
  1829. var $export = __webpack_require__(8);
  1830. $export($export.S, 'Number', {
  1831. isNaN: function isNaN(number) {
  1832. // eslint-disable-next-line no-self-compare
  1833. return number != number;
  1834. }
  1835. });
  1836. /***/ }),
  1837. /* 97 */
  1838. /***/ (function(module, exports, __webpack_require__) {
  1839. // 20.1.2.5 Number.isSafeInteger(number)
  1840. var $export = __webpack_require__(8);
  1841. var isInteger = __webpack_require__(95);
  1842. var abs = Math.abs;
  1843. $export($export.S, 'Number', {
  1844. isSafeInteger: function isSafeInteger(number) {
  1845. return isInteger(number) && abs(number) <= 0x1fffffffffffff;
  1846. }
  1847. });
  1848. /***/ }),
  1849. /* 98 */
  1850. /***/ (function(module, exports, __webpack_require__) {
  1851. // 20.1.2.6 Number.MAX_SAFE_INTEGER
  1852. var $export = __webpack_require__(8);
  1853. $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
  1854. /***/ }),
  1855. /* 99 */
  1856. /***/ (function(module, exports, __webpack_require__) {
  1857. // 20.1.2.10 Number.MIN_SAFE_INTEGER
  1858. var $export = __webpack_require__(8);
  1859. $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
  1860. /***/ }),
  1861. /* 100 */
  1862. /***/ (function(module, exports, __webpack_require__) {
  1863. var $export = __webpack_require__(8);
  1864. var $parseFloat = __webpack_require__(85);
  1865. // 20.1.2.12 Number.parseFloat(string)
  1866. $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
  1867. /***/ }),
  1868. /* 101 */
  1869. /***/ (function(module, exports, __webpack_require__) {
  1870. var $export = __webpack_require__(8);
  1871. var $parseInt = __webpack_require__(81);
  1872. // 20.1.2.13 Number.parseInt(string, radix)
  1873. $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
  1874. /***/ }),
  1875. /* 102 */
  1876. /***/ (function(module, exports, __webpack_require__) {
  1877. // 20.2.2.3 Math.acosh(x)
  1878. var $export = __webpack_require__(8);
  1879. var log1p = __webpack_require__(103);
  1880. var sqrt = Math.sqrt;
  1881. var $acosh = Math.acosh;
  1882. $export($export.S + $export.F * !($acosh
  1883. // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
  1884. && Math.floor($acosh(Number.MAX_VALUE)) == 710
  1885. // Tor Browser bug: Math.acosh(Infinity) -> NaN
  1886. && $acosh(Infinity) == Infinity
  1887. ), 'Math', {
  1888. acosh: function acosh(x) {
  1889. return (x = +x) < 1 ? NaN : x > 94906265.62425156
  1890. ? Math.log(x) + Math.LN2
  1891. : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
  1892. }
  1893. });
  1894. /***/ }),
  1895. /* 103 */
  1896. /***/ (function(module, exports) {
  1897. // 20.2.2.20 Math.log1p(x)
  1898. module.exports = Math.log1p || function log1p(x) {
  1899. return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
  1900. };
  1901. /***/ }),
  1902. /* 104 */
  1903. /***/ (function(module, exports, __webpack_require__) {
  1904. // 20.2.2.5 Math.asinh(x)
  1905. var $export = __webpack_require__(8);
  1906. var $asinh = Math.asinh;
  1907. function asinh(x) {
  1908. return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
  1909. }
  1910. // Tor Browser bug: Math.asinh(0) -> -0
  1911. $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
  1912. /***/ }),
  1913. /* 105 */
  1914. /***/ (function(module, exports, __webpack_require__) {
  1915. // 20.2.2.7 Math.atanh(x)
  1916. var $export = __webpack_require__(8);
  1917. var $atanh = Math.atanh;
  1918. // Tor Browser bug: Math.atanh(-0) -> 0
  1919. $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
  1920. atanh: function atanh(x) {
  1921. return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
  1922. }
  1923. });
  1924. /***/ }),
  1925. /* 106 */
  1926. /***/ (function(module, exports, __webpack_require__) {
  1927. // 20.2.2.9 Math.cbrt(x)
  1928. var $export = __webpack_require__(8);
  1929. var sign = __webpack_require__(107);
  1930. $export($export.S, 'Math', {
  1931. cbrt: function cbrt(x) {
  1932. return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
  1933. }
  1934. });
  1935. /***/ }),
  1936. /* 107 */
  1937. /***/ (function(module, exports) {
  1938. // 20.2.2.28 Math.sign(x)
  1939. module.exports = Math.sign || function sign(x) {
  1940. // eslint-disable-next-line no-self-compare
  1941. return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
  1942. };
  1943. /***/ }),
  1944. /* 108 */
  1945. /***/ (function(module, exports, __webpack_require__) {
  1946. // 20.2.2.11 Math.clz32(x)
  1947. var $export = __webpack_require__(8);
  1948. $export($export.S, 'Math', {
  1949. clz32: function clz32(x) {
  1950. return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
  1951. }
  1952. });
  1953. /***/ }),
  1954. /* 109 */
  1955. /***/ (function(module, exports, __webpack_require__) {
  1956. // 20.2.2.12 Math.cosh(x)
  1957. var $export = __webpack_require__(8);
  1958. var exp = Math.exp;
  1959. $export($export.S, 'Math', {
  1960. cosh: function cosh(x) {
  1961. return (exp(x = +x) + exp(-x)) / 2;
  1962. }
  1963. });
  1964. /***/ }),
  1965. /* 110 */
  1966. /***/ (function(module, exports, __webpack_require__) {
  1967. // 20.2.2.14 Math.expm1(x)
  1968. var $export = __webpack_require__(8);
  1969. var $expm1 = __webpack_require__(111);
  1970. $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
  1971. /***/ }),
  1972. /* 111 */
  1973. /***/ (function(module, exports) {
  1974. // 20.2.2.14 Math.expm1(x)
  1975. var $expm1 = Math.expm1;
  1976. module.exports = (!$expm1
  1977. // Old FF bug
  1978. || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
  1979. // Tor Browser bug
  1980. || $expm1(-2e-17) != -2e-17
  1981. ) ? function expm1(x) {
  1982. return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
  1983. } : $expm1;
  1984. /***/ }),
  1985. /* 112 */
  1986. /***/ (function(module, exports, __webpack_require__) {
  1987. // 20.2.2.16 Math.fround(x)
  1988. var $export = __webpack_require__(8);
  1989. $export($export.S, 'Math', { fround: __webpack_require__(113) });
  1990. /***/ }),
  1991. /* 113 */
  1992. /***/ (function(module, exports, __webpack_require__) {
  1993. // 20.2.2.16 Math.fround(x)
  1994. var sign = __webpack_require__(107);
  1995. var pow = Math.pow;
  1996. var EPSILON = pow(2, -52);
  1997. var EPSILON32 = pow(2, -23);
  1998. var MAX32 = pow(2, 127) * (2 - EPSILON32);
  1999. var MIN32 = pow(2, -126);
  2000. var roundTiesToEven = function (n) {
  2001. return n + 1 / EPSILON - 1 / EPSILON;
  2002. };
  2003. module.exports = Math.fround || function fround(x) {
  2004. var $abs = Math.abs(x);
  2005. var $sign = sign(x);
  2006. var a, result;
  2007. if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
  2008. a = (1 + EPSILON32 / EPSILON) * $abs;
  2009. result = a - (a - $abs);
  2010. // eslint-disable-next-line no-self-compare
  2011. if (result > MAX32 || result != result) return $sign * Infinity;
  2012. return $sign * result;
  2013. };
  2014. /***/ }),
  2015. /* 114 */
  2016. /***/ (function(module, exports, __webpack_require__) {
  2017. // 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
  2018. var $export = __webpack_require__(8);
  2019. var abs = Math.abs;
  2020. $export($export.S, 'Math', {
  2021. hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
  2022. var sum = 0;
  2023. var i = 0;
  2024. var aLen = arguments.length;
  2025. var larg = 0;
  2026. var arg, div;
  2027. while (i < aLen) {
  2028. arg = abs(arguments[i++]);
  2029. if (larg < arg) {
  2030. div = larg / arg;
  2031. sum = sum * div * div + 1;
  2032. larg = arg;
  2033. } else if (arg > 0) {
  2034. div = arg / larg;
  2035. sum += div * div;
  2036. } else sum += arg;
  2037. }
  2038. return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
  2039. }
  2040. });
  2041. /***/ }),
  2042. /* 115 */
  2043. /***/ (function(module, exports, __webpack_require__) {
  2044. // 20.2.2.18 Math.imul(x, y)
  2045. var $export = __webpack_require__(8);
  2046. var $imul = Math.imul;
  2047. // some WebKit versions fails with big numbers, some has wrong arity
  2048. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2049. return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
  2050. }), 'Math', {
  2051. imul: function imul(x, y) {
  2052. var UINT16 = 0xffff;
  2053. var xn = +x;
  2054. var yn = +y;
  2055. var xl = UINT16 & xn;
  2056. var yl = UINT16 & yn;
  2057. return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
  2058. }
  2059. });
  2060. /***/ }),
  2061. /* 116 */
  2062. /***/ (function(module, exports, __webpack_require__) {
  2063. // 20.2.2.21 Math.log10(x)
  2064. var $export = __webpack_require__(8);
  2065. $export($export.S, 'Math', {
  2066. log10: function log10(x) {
  2067. return Math.log(x) * Math.LOG10E;
  2068. }
  2069. });
  2070. /***/ }),
  2071. /* 117 */
  2072. /***/ (function(module, exports, __webpack_require__) {
  2073. // 20.2.2.20 Math.log1p(x)
  2074. var $export = __webpack_require__(8);
  2075. $export($export.S, 'Math', { log1p: __webpack_require__(103) });
  2076. /***/ }),
  2077. /* 118 */
  2078. /***/ (function(module, exports, __webpack_require__) {
  2079. // 20.2.2.22 Math.log2(x)
  2080. var $export = __webpack_require__(8);
  2081. $export($export.S, 'Math', {
  2082. log2: function log2(x) {
  2083. return Math.log(x) / Math.LN2;
  2084. }
  2085. });
  2086. /***/ }),
  2087. /* 119 */
  2088. /***/ (function(module, exports, __webpack_require__) {
  2089. // 20.2.2.28 Math.sign(x)
  2090. var $export = __webpack_require__(8);
  2091. $export($export.S, 'Math', { sign: __webpack_require__(107) });
  2092. /***/ }),
  2093. /* 120 */
  2094. /***/ (function(module, exports, __webpack_require__) {
  2095. // 20.2.2.30 Math.sinh(x)
  2096. var $export = __webpack_require__(8);
  2097. var expm1 = __webpack_require__(111);
  2098. var exp = Math.exp;
  2099. // V8 near Chromium 38 has a problem with very small numbers
  2100. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2101. return !Math.sinh(-2e-17) != -2e-17;
  2102. }), 'Math', {
  2103. sinh: function sinh(x) {
  2104. return Math.abs(x = +x) < 1
  2105. ? (expm1(x) - expm1(-x)) / 2
  2106. : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
  2107. }
  2108. });
  2109. /***/ }),
  2110. /* 121 */
  2111. /***/ (function(module, exports, __webpack_require__) {
  2112. // 20.2.2.33 Math.tanh(x)
  2113. var $export = __webpack_require__(8);
  2114. var expm1 = __webpack_require__(111);
  2115. var exp = Math.exp;
  2116. $export($export.S, 'Math', {
  2117. tanh: function tanh(x) {
  2118. var a = expm1(x = +x);
  2119. var b = expm1(-x);
  2120. return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
  2121. }
  2122. });
  2123. /***/ }),
  2124. /* 122 */
  2125. /***/ (function(module, exports, __webpack_require__) {
  2126. // 20.2.2.34 Math.trunc(x)
  2127. var $export = __webpack_require__(8);
  2128. $export($export.S, 'Math', {
  2129. trunc: function trunc(it) {
  2130. return (it > 0 ? Math.floor : Math.ceil)(it);
  2131. }
  2132. });
  2133. /***/ }),
  2134. /* 123 */
  2135. /***/ (function(module, exports, __webpack_require__) {
  2136. var $export = __webpack_require__(8);
  2137. var toAbsoluteIndex = __webpack_require__(39);
  2138. var fromCharCode = String.fromCharCode;
  2139. var $fromCodePoint = String.fromCodePoint;
  2140. // length should be 1, old FF problem
  2141. $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
  2142. // 21.1.2.2 String.fromCodePoint(...codePoints)
  2143. fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
  2144. var res = [];
  2145. var aLen = arguments.length;
  2146. var i = 0;
  2147. var code;
  2148. while (aLen > i) {
  2149. code = +arguments[i++];
  2150. if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
  2151. res.push(code < 0x10000
  2152. ? fromCharCode(code)
  2153. : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
  2154. );
  2155. } return res.join('');
  2156. }
  2157. });
  2158. /***/ }),
  2159. /* 124 */
  2160. /***/ (function(module, exports, __webpack_require__) {
  2161. var $export = __webpack_require__(8);
  2162. var toIObject = __webpack_require__(32);
  2163. var toLength = __webpack_require__(37);
  2164. $export($export.S, 'String', {
  2165. // 21.1.2.4 String.raw(callSite, ...substitutions)
  2166. raw: function raw(callSite) {
  2167. var tpl = toIObject(callSite.raw);
  2168. var len = toLength(tpl.length);
  2169. var aLen = arguments.length;
  2170. var res = [];
  2171. var i = 0;
  2172. while (len > i) {
  2173. res.push(String(tpl[i++]));
  2174. if (i < aLen) res.push(String(arguments[i]));
  2175. } return res.join('');
  2176. }
  2177. });
  2178. /***/ }),
  2179. /* 125 */
  2180. /***/ (function(module, exports, __webpack_require__) {
  2181. 'use strict';
  2182. // 21.1.3.25 String.prototype.trim()
  2183. __webpack_require__(82)('trim', function ($trim) {
  2184. return function trim() {
  2185. return $trim(this, 3);
  2186. };
  2187. });
  2188. /***/ }),
  2189. /* 126 */
  2190. /***/ (function(module, exports, __webpack_require__) {
  2191. 'use strict';
  2192. var $at = __webpack_require__(127)(true);
  2193. // 21.1.3.27 String.prototype[@@iterator]()
  2194. __webpack_require__(128)(String, 'String', function (iterated) {
  2195. this._t = String(iterated); // target
  2196. this._i = 0; // next index
  2197. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  2198. }, function () {
  2199. var O = this._t;
  2200. var index = this._i;
  2201. var point;
  2202. if (index >= O.length) return { value: undefined, done: true };
  2203. point = $at(O, index);
  2204. this._i += point.length;
  2205. return { value: point, done: false };
  2206. });
  2207. /***/ }),
  2208. /* 127 */
  2209. /***/ (function(module, exports, __webpack_require__) {
  2210. var toInteger = __webpack_require__(38);
  2211. var defined = __webpack_require__(35);
  2212. // true -> String#at
  2213. // false -> String#codePointAt
  2214. module.exports = function (TO_STRING) {
  2215. return function (that, pos) {
  2216. var s = String(defined(that));
  2217. var i = toInteger(pos);
  2218. var l = s.length;
  2219. var a, b;
  2220. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  2221. a = s.charCodeAt(i);
  2222. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  2223. ? TO_STRING ? s.charAt(i) : a
  2224. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  2225. };
  2226. };
  2227. /***/ }),
  2228. /* 128 */
  2229. /***/ (function(module, exports, __webpack_require__) {
  2230. 'use strict';
  2231. var LIBRARY = __webpack_require__(24);
  2232. var $export = __webpack_require__(8);
  2233. var redefine = __webpack_require__(18);
  2234. var hide = __webpack_require__(10);
  2235. var Iterators = __webpack_require__(129);
  2236. var $iterCreate = __webpack_require__(130);
  2237. var setToStringTag = __webpack_require__(25);
  2238. var getPrototypeOf = __webpack_require__(58);
  2239. var ITERATOR = __webpack_require__(26)('iterator');
  2240. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  2241. var FF_ITERATOR = '@@iterator';
  2242. var KEYS = 'keys';
  2243. var VALUES = 'values';
  2244. var returnThis = function () { return this; };
  2245. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  2246. $iterCreate(Constructor, NAME, next);
  2247. var getMethod = function (kind) {
  2248. if (!BUGGY && kind in proto) return proto[kind];
  2249. switch (kind) {
  2250. case KEYS: return function keys() { return new Constructor(this, kind); };
  2251. case VALUES: return function values() { return new Constructor(this, kind); };
  2252. } return function entries() { return new Constructor(this, kind); };
  2253. };
  2254. var TAG = NAME + ' Iterator';
  2255. var DEF_VALUES = DEFAULT == VALUES;
  2256. var VALUES_BUG = false;
  2257. var proto = Base.prototype;
  2258. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  2259. var $default = $native || getMethod(DEFAULT);
  2260. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  2261. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  2262. var methods, key, IteratorPrototype;
  2263. // Fix native
  2264. if ($anyNative) {
  2265. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  2266. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  2267. // Set @@toStringTag to native iterators
  2268. setToStringTag(IteratorPrototype, TAG, true);
  2269. // fix for some old engines
  2270. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  2271. }
  2272. }
  2273. // fix Array#{values, @@iterator}.name in V8 / FF
  2274. if (DEF_VALUES && $native && $native.name !== VALUES) {
  2275. VALUES_BUG = true;
  2276. $default = function values() { return $native.call(this); };
  2277. }
  2278. // Define iterator
  2279. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  2280. hide(proto, ITERATOR, $default);
  2281. }
  2282. // Plug for library
  2283. Iterators[NAME] = $default;
  2284. Iterators[TAG] = returnThis;
  2285. if (DEFAULT) {
  2286. methods = {
  2287. values: DEF_VALUES ? $default : getMethod(VALUES),
  2288. keys: IS_SET ? $default : getMethod(KEYS),
  2289. entries: $entries
  2290. };
  2291. if (FORCED) for (key in methods) {
  2292. if (!(key in proto)) redefine(proto, key, methods[key]);
  2293. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  2294. }
  2295. return methods;
  2296. };
  2297. /***/ }),
  2298. /* 129 */
  2299. /***/ (function(module, exports) {
  2300. module.exports = {};
  2301. /***/ }),
  2302. /* 130 */
  2303. /***/ (function(module, exports, __webpack_require__) {
  2304. 'use strict';
  2305. var create = __webpack_require__(45);
  2306. var descriptor = __webpack_require__(17);
  2307. var setToStringTag = __webpack_require__(25);
  2308. var IteratorPrototype = {};
  2309. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  2310. __webpack_require__(10)(IteratorPrototype, __webpack_require__(26)('iterator'), function () { return this; });
  2311. module.exports = function (Constructor, NAME, next) {
  2312. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  2313. setToStringTag(Constructor, NAME + ' Iterator');
  2314. };
  2315. /***/ }),
  2316. /* 131 */
  2317. /***/ (function(module, exports, __webpack_require__) {
  2318. 'use strict';
  2319. var $export = __webpack_require__(8);
  2320. var $at = __webpack_require__(127)(false);
  2321. $export($export.P, 'String', {
  2322. // 21.1.3.3 String.prototype.codePointAt(pos)
  2323. codePointAt: function codePointAt(pos) {
  2324. return $at(this, pos);
  2325. }
  2326. });
  2327. /***/ }),
  2328. /* 132 */
  2329. /***/ (function(module, exports, __webpack_require__) {
  2330. // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
  2331. 'use strict';
  2332. var $export = __webpack_require__(8);
  2333. var toLength = __webpack_require__(37);
  2334. var context = __webpack_require__(133);
  2335. var ENDS_WITH = 'endsWith';
  2336. var $endsWith = ''[ENDS_WITH];
  2337. $export($export.P + $export.F * __webpack_require__(135)(ENDS_WITH), 'String', {
  2338. endsWith: function endsWith(searchString /* , endPosition = @length */) {
  2339. var that = context(this, searchString, ENDS_WITH);
  2340. var endPosition = arguments.length > 1 ? arguments[1] : undefined;
  2341. var len = toLength(that.length);
  2342. var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
  2343. var search = String(searchString);
  2344. return $endsWith
  2345. ? $endsWith.call(that, search, end)
  2346. : that.slice(end - search.length, end) === search;
  2347. }
  2348. });
  2349. /***/ }),
  2350. /* 133 */
  2351. /***/ (function(module, exports, __webpack_require__) {
  2352. // helper for String#{startsWith, endsWith, includes}
  2353. var isRegExp = __webpack_require__(134);
  2354. var defined = __webpack_require__(35);
  2355. module.exports = function (that, searchString, NAME) {
  2356. if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
  2357. return String(defined(that));
  2358. };
  2359. /***/ }),
  2360. /* 134 */
  2361. /***/ (function(module, exports, __webpack_require__) {
  2362. // 7.2.8 IsRegExp(argument)
  2363. var isObject = __webpack_require__(13);
  2364. var cof = __webpack_require__(34);
  2365. var MATCH = __webpack_require__(26)('match');
  2366. module.exports = function (it) {
  2367. var isRegExp;
  2368. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
  2369. };
  2370. /***/ }),
  2371. /* 135 */
  2372. /***/ (function(module, exports, __webpack_require__) {
  2373. var MATCH = __webpack_require__(26)('match');
  2374. module.exports = function (KEY) {
  2375. var re = /./;
  2376. try {
  2377. '/./'[KEY](re);
  2378. } catch (e) {
  2379. try {
  2380. re[MATCH] = false;
  2381. return !'/./'[KEY](re);
  2382. } catch (f) { /* empty */ }
  2383. } return true;
  2384. };
  2385. /***/ }),
  2386. /* 136 */
  2387. /***/ (function(module, exports, __webpack_require__) {
  2388. // 21.1.3.7 String.prototype.includes(searchString, position = 0)
  2389. 'use strict';
  2390. var $export = __webpack_require__(8);
  2391. var context = __webpack_require__(133);
  2392. var INCLUDES = 'includes';
  2393. $export($export.P + $export.F * __webpack_require__(135)(INCLUDES), 'String', {
  2394. includes: function includes(searchString /* , position = 0 */) {
  2395. return !!~context(this, searchString, INCLUDES)
  2396. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  2397. }
  2398. });
  2399. /***/ }),
  2400. /* 137 */
  2401. /***/ (function(module, exports, __webpack_require__) {
  2402. var $export = __webpack_require__(8);
  2403. $export($export.P, 'String', {
  2404. // 21.1.3.13 String.prototype.repeat(count)
  2405. repeat: __webpack_require__(90)
  2406. });
  2407. /***/ }),
  2408. /* 138 */
  2409. /***/ (function(module, exports, __webpack_require__) {
  2410. // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
  2411. 'use strict';
  2412. var $export = __webpack_require__(8);
  2413. var toLength = __webpack_require__(37);
  2414. var context = __webpack_require__(133);
  2415. var STARTS_WITH = 'startsWith';
  2416. var $startsWith = ''[STARTS_WITH];
  2417. $export($export.P + $export.F * __webpack_require__(135)(STARTS_WITH), 'String', {
  2418. startsWith: function startsWith(searchString /* , position = 0 */) {
  2419. var that = context(this, searchString, STARTS_WITH);
  2420. var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  2421. var search = String(searchString);
  2422. return $startsWith
  2423. ? $startsWith.call(that, search, index)
  2424. : that.slice(index, index + search.length) === search;
  2425. }
  2426. });
  2427. /***/ }),
  2428. /* 139 */
  2429. /***/ (function(module, exports, __webpack_require__) {
  2430. 'use strict';
  2431. // B.2.3.2 String.prototype.anchor(name)
  2432. __webpack_require__(140)('anchor', function (createHTML) {
  2433. return function anchor(name) {
  2434. return createHTML(this, 'a', 'name', name);
  2435. };
  2436. });
  2437. /***/ }),
  2438. /* 140 */
  2439. /***/ (function(module, exports, __webpack_require__) {
  2440. var $export = __webpack_require__(8);
  2441. var fails = __webpack_require__(7);
  2442. var defined = __webpack_require__(35);
  2443. var quot = /"/g;
  2444. // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
  2445. var createHTML = function (string, tag, attribute, value) {
  2446. var S = String(defined(string));
  2447. var p1 = '<' + tag;
  2448. if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  2449. return p1 + '>' + S + '</' + tag + '>';
  2450. };
  2451. module.exports = function (NAME, exec) {
  2452. var O = {};
  2453. O[NAME] = exec(createHTML);
  2454. $export($export.P + $export.F * fails(function () {
  2455. var test = ''[NAME]('"');
  2456. return test !== test.toLowerCase() || test.split('"').length > 3;
  2457. }), 'String', O);
  2458. };
  2459. /***/ }),
  2460. /* 141 */
  2461. /***/ (function(module, exports, __webpack_require__) {
  2462. 'use strict';
  2463. // B.2.3.3 String.prototype.big()
  2464. __webpack_require__(140)('big', function (createHTML) {
  2465. return function big() {
  2466. return createHTML(this, 'big', '', '');
  2467. };
  2468. });
  2469. /***/ }),
  2470. /* 142 */
  2471. /***/ (function(module, exports, __webpack_require__) {
  2472. 'use strict';
  2473. // B.2.3.4 String.prototype.blink()
  2474. __webpack_require__(140)('blink', function (createHTML) {
  2475. return function blink() {
  2476. return createHTML(this, 'blink', '', '');
  2477. };
  2478. });
  2479. /***/ }),
  2480. /* 143 */
  2481. /***/ (function(module, exports, __webpack_require__) {
  2482. 'use strict';
  2483. // B.2.3.5 String.prototype.bold()
  2484. __webpack_require__(140)('bold', function (createHTML) {
  2485. return function bold() {
  2486. return createHTML(this, 'b', '', '');
  2487. };
  2488. });
  2489. /***/ }),
  2490. /* 144 */
  2491. /***/ (function(module, exports, __webpack_require__) {
  2492. 'use strict';
  2493. // B.2.3.6 String.prototype.fixed()
  2494. __webpack_require__(140)('fixed', function (createHTML) {
  2495. return function fixed() {
  2496. return createHTML(this, 'tt', '', '');
  2497. };
  2498. });
  2499. /***/ }),
  2500. /* 145 */
  2501. /***/ (function(module, exports, __webpack_require__) {
  2502. 'use strict';
  2503. // B.2.3.7 String.prototype.fontcolor(color)
  2504. __webpack_require__(140)('fontcolor', function (createHTML) {
  2505. return function fontcolor(color) {
  2506. return createHTML(this, 'font', 'color', color);
  2507. };
  2508. });
  2509. /***/ }),
  2510. /* 146 */
  2511. /***/ (function(module, exports, __webpack_require__) {
  2512. 'use strict';
  2513. // B.2.3.8 String.prototype.fontsize(size)
  2514. __webpack_require__(140)('fontsize', function (createHTML) {
  2515. return function fontsize(size) {
  2516. return createHTML(this, 'font', 'size', size);
  2517. };
  2518. });
  2519. /***/ }),
  2520. /* 147 */
  2521. /***/ (function(module, exports, __webpack_require__) {
  2522. 'use strict';
  2523. // B.2.3.9 String.prototype.italics()
  2524. __webpack_require__(140)('italics', function (createHTML) {
  2525. return function italics() {
  2526. return createHTML(this, 'i', '', '');
  2527. };
  2528. });
  2529. /***/ }),
  2530. /* 148 */
  2531. /***/ (function(module, exports, __webpack_require__) {
  2532. 'use strict';
  2533. // B.2.3.10 String.prototype.link(url)
  2534. __webpack_require__(140)('link', function (createHTML) {
  2535. return function link(url) {
  2536. return createHTML(this, 'a', 'href', url);
  2537. };
  2538. });
  2539. /***/ }),
  2540. /* 149 */
  2541. /***/ (function(module, exports, __webpack_require__) {
  2542. 'use strict';
  2543. // B.2.3.11 String.prototype.small()
  2544. __webpack_require__(140)('small', function (createHTML) {
  2545. return function small() {
  2546. return createHTML(this, 'small', '', '');
  2547. };
  2548. });
  2549. /***/ }),
  2550. /* 150 */
  2551. /***/ (function(module, exports, __webpack_require__) {
  2552. 'use strict';
  2553. // B.2.3.12 String.prototype.strike()
  2554. __webpack_require__(140)('strike', function (createHTML) {
  2555. return function strike() {
  2556. return createHTML(this, 'strike', '', '');
  2557. };
  2558. });
  2559. /***/ }),
  2560. /* 151 */
  2561. /***/ (function(module, exports, __webpack_require__) {
  2562. 'use strict';
  2563. // B.2.3.13 String.prototype.sub()
  2564. __webpack_require__(140)('sub', function (createHTML) {
  2565. return function sub() {
  2566. return createHTML(this, 'sub', '', '');
  2567. };
  2568. });
  2569. /***/ }),
  2570. /* 152 */
  2571. /***/ (function(module, exports, __webpack_require__) {
  2572. 'use strict';
  2573. // B.2.3.14 String.prototype.sup()
  2574. __webpack_require__(140)('sup', function (createHTML) {
  2575. return function sup() {
  2576. return createHTML(this, 'sup', '', '');
  2577. };
  2578. });
  2579. /***/ }),
  2580. /* 153 */
  2581. /***/ (function(module, exports, __webpack_require__) {
  2582. // 20.3.3.1 / 15.9.4.4 Date.now()
  2583. var $export = __webpack_require__(8);
  2584. $export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
  2585. /***/ }),
  2586. /* 154 */
  2587. /***/ (function(module, exports, __webpack_require__) {
  2588. 'use strict';
  2589. var $export = __webpack_require__(8);
  2590. var toObject = __webpack_require__(57);
  2591. var toPrimitive = __webpack_require__(16);
  2592. $export($export.P + $export.F * __webpack_require__(7)(function () {
  2593. return new Date(NaN).toJSON() !== null
  2594. || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
  2595. }), 'Date', {
  2596. // eslint-disable-next-line no-unused-vars
  2597. toJSON: function toJSON(key) {
  2598. var O = toObject(this);
  2599. var pv = toPrimitive(O);
  2600. return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  2601. }
  2602. });
  2603. /***/ }),
  2604. /* 155 */
  2605. /***/ (function(module, exports, __webpack_require__) {
  2606. // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
  2607. var $export = __webpack_require__(8);
  2608. var toISOString = __webpack_require__(156);
  2609. // PhantomJS / old WebKit has a broken implementations
  2610. $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
  2611. toISOString: toISOString
  2612. });
  2613. /***/ }),
  2614. /* 156 */
  2615. /***/ (function(module, exports, __webpack_require__) {
  2616. 'use strict';
  2617. // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
  2618. var fails = __webpack_require__(7);
  2619. var getTime = Date.prototype.getTime;
  2620. var $toISOString = Date.prototype.toISOString;
  2621. var lz = function (num) {
  2622. return num > 9 ? num : '0' + num;
  2623. };
  2624. // PhantomJS / old WebKit has a broken implementations
  2625. module.exports = (fails(function () {
  2626. return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
  2627. }) || !fails(function () {
  2628. $toISOString.call(new Date(NaN));
  2629. })) ? function toISOString() {
  2630. if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
  2631. var d = this;
  2632. var y = d.getUTCFullYear();
  2633. var m = d.getUTCMilliseconds();
  2634. var s = y < 0 ? '-' : y > 9999 ? '+' : '';
  2635. return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
  2636. '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
  2637. 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
  2638. ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
  2639. } : $toISOString;
  2640. /***/ }),
  2641. /* 157 */
  2642. /***/ (function(module, exports, __webpack_require__) {
  2643. var DateProto = Date.prototype;
  2644. var INVALID_DATE = 'Invalid Date';
  2645. var TO_STRING = 'toString';
  2646. var $toString = DateProto[TO_STRING];
  2647. var getTime = DateProto.getTime;
  2648. if (new Date(NaN) + '' != INVALID_DATE) {
  2649. __webpack_require__(18)(DateProto, TO_STRING, function toString() {
  2650. var value = getTime.call(this);
  2651. // eslint-disable-next-line no-self-compare
  2652. return value === value ? $toString.call(this) : INVALID_DATE;
  2653. });
  2654. }
  2655. /***/ }),
  2656. /* 158 */
  2657. /***/ (function(module, exports, __webpack_require__) {
  2658. var TO_PRIMITIVE = __webpack_require__(26)('toPrimitive');
  2659. var proto = Date.prototype;
  2660. if (!(TO_PRIMITIVE in proto)) __webpack_require__(10)(proto, TO_PRIMITIVE, __webpack_require__(159));
  2661. /***/ }),
  2662. /* 159 */
  2663. /***/ (function(module, exports, __webpack_require__) {
  2664. 'use strict';
  2665. var anObject = __webpack_require__(12);
  2666. var toPrimitive = __webpack_require__(16);
  2667. var NUMBER = 'number';
  2668. module.exports = function (hint) {
  2669. if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
  2670. return toPrimitive(anObject(this), hint != NUMBER);
  2671. };
  2672. /***/ }),
  2673. /* 160 */
  2674. /***/ (function(module, exports, __webpack_require__) {
  2675. // 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
  2676. var $export = __webpack_require__(8);
  2677. $export($export.S, 'Array', { isArray: __webpack_require__(44) });
  2678. /***/ }),
  2679. /* 161 */
  2680. /***/ (function(module, exports, __webpack_require__) {
  2681. 'use strict';
  2682. var ctx = __webpack_require__(20);
  2683. var $export = __webpack_require__(8);
  2684. var toObject = __webpack_require__(57);
  2685. var call = __webpack_require__(162);
  2686. var isArrayIter = __webpack_require__(163);
  2687. var toLength = __webpack_require__(37);
  2688. var createProperty = __webpack_require__(164);
  2689. var getIterFn = __webpack_require__(165);
  2690. $export($export.S + $export.F * !__webpack_require__(166)(function (iter) { Array.from(iter); }), 'Array', {
  2691. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  2692. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  2693. var O = toObject(arrayLike);
  2694. var C = typeof this == 'function' ? this : Array;
  2695. var aLen = arguments.length;
  2696. var mapfn = aLen > 1 ? arguments[1] : undefined;
  2697. var mapping = mapfn !== undefined;
  2698. var index = 0;
  2699. var iterFn = getIterFn(O);
  2700. var length, result, step, iterator;
  2701. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  2702. // if object isn't iterable or it's array with default iterator - use simple case
  2703. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  2704. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  2705. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  2706. }
  2707. } else {
  2708. length = toLength(O.length);
  2709. for (result = new C(length); length > index; index++) {
  2710. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  2711. }
  2712. }
  2713. result.length = index;
  2714. return result;
  2715. }
  2716. });
  2717. /***/ }),
  2718. /* 162 */
  2719. /***/ (function(module, exports, __webpack_require__) {
  2720. // call something on iterator step with safe closing on error
  2721. var anObject = __webpack_require__(12);
  2722. module.exports = function (iterator, fn, value, entries) {
  2723. try {
  2724. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  2725. // 7.4.6 IteratorClose(iterator, completion)
  2726. } catch (e) {
  2727. var ret = iterator['return'];
  2728. if (ret !== undefined) anObject(ret.call(iterator));
  2729. throw e;
  2730. }
  2731. };
  2732. /***/ }),
  2733. /* 163 */
  2734. /***/ (function(module, exports, __webpack_require__) {
  2735. // check on default Array iterator
  2736. var Iterators = __webpack_require__(129);
  2737. var ITERATOR = __webpack_require__(26)('iterator');
  2738. var ArrayProto = Array.prototype;
  2739. module.exports = function (it) {
  2740. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  2741. };
  2742. /***/ }),
  2743. /* 164 */
  2744. /***/ (function(module, exports, __webpack_require__) {
  2745. 'use strict';
  2746. var $defineProperty = __webpack_require__(11);
  2747. var createDesc = __webpack_require__(17);
  2748. module.exports = function (object, index, value) {
  2749. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  2750. else object[index] = value;
  2751. };
  2752. /***/ }),
  2753. /* 165 */
  2754. /***/ (function(module, exports, __webpack_require__) {
  2755. var classof = __webpack_require__(74);
  2756. var ITERATOR = __webpack_require__(26)('iterator');
  2757. var Iterators = __webpack_require__(129);
  2758. module.exports = __webpack_require__(9).getIteratorMethod = function (it) {
  2759. if (it != undefined) return it[ITERATOR]
  2760. || it['@@iterator']
  2761. || Iterators[classof(it)];
  2762. };
  2763. /***/ }),
  2764. /* 166 */
  2765. /***/ (function(module, exports, __webpack_require__) {
  2766. var ITERATOR = __webpack_require__(26)('iterator');
  2767. var SAFE_CLOSING = false;
  2768. try {
  2769. var riter = [7][ITERATOR]();
  2770. riter['return'] = function () { SAFE_CLOSING = true; };
  2771. // eslint-disable-next-line no-throw-literal
  2772. Array.from(riter, function () { throw 2; });
  2773. } catch (e) { /* empty */ }
  2774. module.exports = function (exec, skipClosing) {
  2775. if (!skipClosing && !SAFE_CLOSING) return false;
  2776. var safe = false;
  2777. try {
  2778. var arr = [7];
  2779. var iter = arr[ITERATOR]();
  2780. iter.next = function () { return { done: safe = true }; };
  2781. arr[ITERATOR] = function () { return iter; };
  2782. exec(arr);
  2783. } catch (e) { /* empty */ }
  2784. return safe;
  2785. };
  2786. /***/ }),
  2787. /* 167 */
  2788. /***/ (function(module, exports, __webpack_require__) {
  2789. 'use strict';
  2790. var $export = __webpack_require__(8);
  2791. var createProperty = __webpack_require__(164);
  2792. // WebKit Array.of isn't generic
  2793. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2794. function F() { /* empty */ }
  2795. return !(Array.of.call(F) instanceof F);
  2796. }), 'Array', {
  2797. // 22.1.2.3 Array.of( ...items)
  2798. of: function of(/* ...args */) {
  2799. var index = 0;
  2800. var aLen = arguments.length;
  2801. var result = new (typeof this == 'function' ? this : Array)(aLen);
  2802. while (aLen > index) createProperty(result, index, arguments[index++]);
  2803. result.length = aLen;
  2804. return result;
  2805. }
  2806. });
  2807. /***/ }),
  2808. /* 168 */
  2809. /***/ (function(module, exports, __webpack_require__) {
  2810. 'use strict';
  2811. // 22.1.3.13 Array.prototype.join(separator)
  2812. var $export = __webpack_require__(8);
  2813. var toIObject = __webpack_require__(32);
  2814. var arrayJoin = [].join;
  2815. // fallback for not array-like strings
  2816. $export($export.P + $export.F * (__webpack_require__(33) != Object || !__webpack_require__(169)(arrayJoin)), 'Array', {
  2817. join: function join(separator) {
  2818. return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
  2819. }
  2820. });
  2821. /***/ }),
  2822. /* 169 */
  2823. /***/ (function(module, exports, __webpack_require__) {
  2824. 'use strict';
  2825. var fails = __webpack_require__(7);
  2826. module.exports = function (method, arg) {
  2827. return !!method && fails(function () {
  2828. // eslint-disable-next-line no-useless-call
  2829. arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
  2830. });
  2831. };
  2832. /***/ }),
  2833. /* 170 */
  2834. /***/ (function(module, exports, __webpack_require__) {
  2835. 'use strict';
  2836. var $export = __webpack_require__(8);
  2837. var html = __webpack_require__(47);
  2838. var cof = __webpack_require__(34);
  2839. var toAbsoluteIndex = __webpack_require__(39);
  2840. var toLength = __webpack_require__(37);
  2841. var arraySlice = [].slice;
  2842. // fallback for not array-like ES3 strings and DOM objects
  2843. $export($export.P + $export.F * __webpack_require__(7)(function () {
  2844. if (html) arraySlice.call(html);
  2845. }), 'Array', {
  2846. slice: function slice(begin, end) {
  2847. var len = toLength(this.length);
  2848. var klass = cof(this);
  2849. end = end === undefined ? len : end;
  2850. if (klass == 'Array') return arraySlice.call(this, begin, end);
  2851. var start = toAbsoluteIndex(begin, len);
  2852. var upTo = toAbsoluteIndex(end, len);
  2853. var size = toLength(upTo - start);
  2854. var cloned = new Array(size);
  2855. var i = 0;
  2856. for (; i < size; i++) cloned[i] = klass == 'String'
  2857. ? this.charAt(start + i)
  2858. : this[start + i];
  2859. return cloned;
  2860. }
  2861. });
  2862. /***/ }),
  2863. /* 171 */
  2864. /***/ (function(module, exports, __webpack_require__) {
  2865. 'use strict';
  2866. var $export = __webpack_require__(8);
  2867. var aFunction = __webpack_require__(21);
  2868. var toObject = __webpack_require__(57);
  2869. var fails = __webpack_require__(7);
  2870. var $sort = [].sort;
  2871. var test = [1, 2, 3];
  2872. $export($export.P + $export.F * (fails(function () {
  2873. // IE8-
  2874. test.sort(undefined);
  2875. }) || !fails(function () {
  2876. // V8 bug
  2877. test.sort(null);
  2878. // Old WebKit
  2879. }) || !__webpack_require__(169)($sort)), 'Array', {
  2880. // 22.1.3.25 Array.prototype.sort(comparefn)
  2881. sort: function sort(comparefn) {
  2882. return comparefn === undefined
  2883. ? $sort.call(toObject(this))
  2884. : $sort.call(toObject(this), aFunction(comparefn));
  2885. }
  2886. });
  2887. /***/ }),
  2888. /* 172 */
  2889. /***/ (function(module, exports, __webpack_require__) {
  2890. 'use strict';
  2891. var $export = __webpack_require__(8);
  2892. var $forEach = __webpack_require__(173)(0);
  2893. var STRICT = __webpack_require__(169)([].forEach, true);
  2894. $export($export.P + $export.F * !STRICT, 'Array', {
  2895. // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
  2896. forEach: function forEach(callbackfn /* , thisArg */) {
  2897. return $forEach(this, callbackfn, arguments[1]);
  2898. }
  2899. });
  2900. /***/ }),
  2901. /* 173 */
  2902. /***/ (function(module, exports, __webpack_require__) {
  2903. // 0 -> Array#forEach
  2904. // 1 -> Array#map
  2905. // 2 -> Array#filter
  2906. // 3 -> Array#some
  2907. // 4 -> Array#every
  2908. // 5 -> Array#find
  2909. // 6 -> Array#findIndex
  2910. var ctx = __webpack_require__(20);
  2911. var IObject = __webpack_require__(33);
  2912. var toObject = __webpack_require__(57);
  2913. var toLength = __webpack_require__(37);
  2914. var asc = __webpack_require__(174);
  2915. module.exports = function (TYPE, $create) {
  2916. var IS_MAP = TYPE == 1;
  2917. var IS_FILTER = TYPE == 2;
  2918. var IS_SOME = TYPE == 3;
  2919. var IS_EVERY = TYPE == 4;
  2920. var IS_FIND_INDEX = TYPE == 6;
  2921. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  2922. var create = $create || asc;
  2923. return function ($this, callbackfn, that) {
  2924. var O = toObject($this);
  2925. var self = IObject(O);
  2926. var f = ctx(callbackfn, that, 3);
  2927. var length = toLength(self.length);
  2928. var index = 0;
  2929. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  2930. var val, res;
  2931. for (;length > index; index++) if (NO_HOLES || index in self) {
  2932. val = self[index];
  2933. res = f(val, index, O);
  2934. if (TYPE) {
  2935. if (IS_MAP) result[index] = res; // map
  2936. else if (res) switch (TYPE) {
  2937. case 3: return true; // some
  2938. case 5: return val; // find
  2939. case 6: return index; // findIndex
  2940. case 2: result.push(val); // filter
  2941. } else if (IS_EVERY) return false; // every
  2942. }
  2943. }
  2944. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  2945. };
  2946. };
  2947. /***/ }),
  2948. /* 174 */
  2949. /***/ (function(module, exports, __webpack_require__) {
  2950. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  2951. var speciesConstructor = __webpack_require__(175);
  2952. module.exports = function (original, length) {
  2953. return new (speciesConstructor(original))(length);
  2954. };
  2955. /***/ }),
  2956. /* 175 */
  2957. /***/ (function(module, exports, __webpack_require__) {
  2958. var isObject = __webpack_require__(13);
  2959. var isArray = __webpack_require__(44);
  2960. var SPECIES = __webpack_require__(26)('species');
  2961. module.exports = function (original) {
  2962. var C;
  2963. if (isArray(original)) {
  2964. C = original.constructor;
  2965. // cross-realm fallback
  2966. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  2967. if (isObject(C)) {
  2968. C = C[SPECIES];
  2969. if (C === null) C = undefined;
  2970. }
  2971. } return C === undefined ? Array : C;
  2972. };
  2973. /***/ }),
  2974. /* 176 */
  2975. /***/ (function(module, exports, __webpack_require__) {
  2976. 'use strict';
  2977. var $export = __webpack_require__(8);
  2978. var $map = __webpack_require__(173)(1);
  2979. $export($export.P + $export.F * !__webpack_require__(169)([].map, true), 'Array', {
  2980. // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
  2981. map: function map(callbackfn /* , thisArg */) {
  2982. return $map(this, callbackfn, arguments[1]);
  2983. }
  2984. });
  2985. /***/ }),
  2986. /* 177 */
  2987. /***/ (function(module, exports, __webpack_require__) {
  2988. 'use strict';
  2989. var $export = __webpack_require__(8);
  2990. var $filter = __webpack_require__(173)(2);
  2991. $export($export.P + $export.F * !__webpack_require__(169)([].filter, true), 'Array', {
  2992. // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
  2993. filter: function filter(callbackfn /* , thisArg */) {
  2994. return $filter(this, callbackfn, arguments[1]);
  2995. }
  2996. });
  2997. /***/ }),
  2998. /* 178 */
  2999. /***/ (function(module, exports, __webpack_require__) {
  3000. 'use strict';
  3001. var $export = __webpack_require__(8);
  3002. var $some = __webpack_require__(173)(3);
  3003. $export($export.P + $export.F * !__webpack_require__(169)([].some, true), 'Array', {
  3004. // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
  3005. some: function some(callbackfn /* , thisArg */) {
  3006. return $some(this, callbackfn, arguments[1]);
  3007. }
  3008. });
  3009. /***/ }),
  3010. /* 179 */
  3011. /***/ (function(module, exports, __webpack_require__) {
  3012. 'use strict';
  3013. var $export = __webpack_require__(8);
  3014. var $every = __webpack_require__(173)(4);
  3015. $export($export.P + $export.F * !__webpack_require__(169)([].every, true), 'Array', {
  3016. // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
  3017. every: function every(callbackfn /* , thisArg */) {
  3018. return $every(this, callbackfn, arguments[1]);
  3019. }
  3020. });
  3021. /***/ }),
  3022. /* 180 */
  3023. /***/ (function(module, exports, __webpack_require__) {
  3024. 'use strict';
  3025. var $export = __webpack_require__(8);
  3026. var $reduce = __webpack_require__(181);
  3027. $export($export.P + $export.F * !__webpack_require__(169)([].reduce, true), 'Array', {
  3028. // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
  3029. reduce: function reduce(callbackfn /* , initialValue */) {
  3030. return $reduce(this, callbackfn, arguments.length, arguments[1], false);
  3031. }
  3032. });
  3033. /***/ }),
  3034. /* 181 */
  3035. /***/ (function(module, exports, __webpack_require__) {
  3036. var aFunction = __webpack_require__(21);
  3037. var toObject = __webpack_require__(57);
  3038. var IObject = __webpack_require__(33);
  3039. var toLength = __webpack_require__(37);
  3040. module.exports = function (that, callbackfn, aLen, memo, isRight) {
  3041. aFunction(callbackfn);
  3042. var O = toObject(that);
  3043. var self = IObject(O);
  3044. var length = toLength(O.length);
  3045. var index = isRight ? length - 1 : 0;
  3046. var i = isRight ? -1 : 1;
  3047. if (aLen < 2) for (;;) {
  3048. if (index in self) {
  3049. memo = self[index];
  3050. index += i;
  3051. break;
  3052. }
  3053. index += i;
  3054. if (isRight ? index < 0 : length <= index) {
  3055. throw TypeError('Reduce of empty array with no initial value');
  3056. }
  3057. }
  3058. for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
  3059. memo = callbackfn(memo, self[index], index, O);
  3060. }
  3061. return memo;
  3062. };
  3063. /***/ }),
  3064. /* 182 */
  3065. /***/ (function(module, exports, __webpack_require__) {
  3066. 'use strict';
  3067. var $export = __webpack_require__(8);
  3068. var $reduce = __webpack_require__(181);
  3069. $export($export.P + $export.F * !__webpack_require__(169)([].reduceRight, true), 'Array', {
  3070. // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
  3071. reduceRight: function reduceRight(callbackfn /* , initialValue */) {
  3072. return $reduce(this, callbackfn, arguments.length, arguments[1], true);
  3073. }
  3074. });
  3075. /***/ }),
  3076. /* 183 */
  3077. /***/ (function(module, exports, __webpack_require__) {
  3078. 'use strict';
  3079. var $export = __webpack_require__(8);
  3080. var $indexOf = __webpack_require__(36)(false);
  3081. var $native = [].indexOf;
  3082. var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
  3083. $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(169)($native)), 'Array', {
  3084. // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
  3085. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  3086. return NEGATIVE_ZERO
  3087. // convert -0 to +0
  3088. ? $native.apply(this, arguments) || 0
  3089. : $indexOf(this, searchElement, arguments[1]);
  3090. }
  3091. });
  3092. /***/ }),
  3093. /* 184 */
  3094. /***/ (function(module, exports, __webpack_require__) {
  3095. 'use strict';
  3096. var $export = __webpack_require__(8);
  3097. var toIObject = __webpack_require__(32);
  3098. var toInteger = __webpack_require__(38);
  3099. var toLength = __webpack_require__(37);
  3100. var $native = [].lastIndexOf;
  3101. var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
  3102. $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(169)($native)), 'Array', {
  3103. // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
  3104. lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
  3105. // convert -0 to +0
  3106. if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
  3107. var O = toIObject(this);
  3108. var length = toLength(O.length);
  3109. var index = length - 1;
  3110. if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
  3111. if (index < 0) index = length + index;
  3112. for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
  3113. return -1;
  3114. }
  3115. });
  3116. /***/ }),
  3117. /* 185 */
  3118. /***/ (function(module, exports, __webpack_require__) {
  3119. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  3120. var $export = __webpack_require__(8);
  3121. $export($export.P, 'Array', { copyWithin: __webpack_require__(186) });
  3122. __webpack_require__(187)('copyWithin');
  3123. /***/ }),
  3124. /* 186 */
  3125. /***/ (function(module, exports, __webpack_require__) {
  3126. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  3127. 'use strict';
  3128. var toObject = __webpack_require__(57);
  3129. var toAbsoluteIndex = __webpack_require__(39);
  3130. var toLength = __webpack_require__(37);
  3131. module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
  3132. var O = toObject(this);
  3133. var len = toLength(O.length);
  3134. var to = toAbsoluteIndex(target, len);
  3135. var from = toAbsoluteIndex(start, len);
  3136. var end = arguments.length > 2 ? arguments[2] : undefined;
  3137. var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
  3138. var inc = 1;
  3139. if (from < to && to < from + count) {
  3140. inc = -1;
  3141. from += count - 1;
  3142. to += count - 1;
  3143. }
  3144. while (count-- > 0) {
  3145. if (from in O) O[to] = O[from];
  3146. else delete O[to];
  3147. to += inc;
  3148. from += inc;
  3149. } return O;
  3150. };
  3151. /***/ }),
  3152. /* 187 */
  3153. /***/ (function(module, exports, __webpack_require__) {
  3154. // 22.1.3.31 Array.prototype[@@unscopables]
  3155. var UNSCOPABLES = __webpack_require__(26)('unscopables');
  3156. var ArrayProto = Array.prototype;
  3157. if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(10)(ArrayProto, UNSCOPABLES, {});
  3158. module.exports = function (key) {
  3159. ArrayProto[UNSCOPABLES][key] = true;
  3160. };
  3161. /***/ }),
  3162. /* 188 */
  3163. /***/ (function(module, exports, __webpack_require__) {
  3164. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  3165. var $export = __webpack_require__(8);
  3166. $export($export.P, 'Array', { fill: __webpack_require__(189) });
  3167. __webpack_require__(187)('fill');
  3168. /***/ }),
  3169. /* 189 */
  3170. /***/ (function(module, exports, __webpack_require__) {
  3171. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  3172. 'use strict';
  3173. var toObject = __webpack_require__(57);
  3174. var toAbsoluteIndex = __webpack_require__(39);
  3175. var toLength = __webpack_require__(37);
  3176. module.exports = function fill(value /* , start = 0, end = @length */) {
  3177. var O = toObject(this);
  3178. var length = toLength(O.length);
  3179. var aLen = arguments.length;
  3180. var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
  3181. var end = aLen > 2 ? arguments[2] : undefined;
  3182. var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  3183. while (endPos > index) O[index++] = value;
  3184. return O;
  3185. };
  3186. /***/ }),
  3187. /* 190 */
  3188. /***/ (function(module, exports, __webpack_require__) {
  3189. 'use strict';
  3190. // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
  3191. var $export = __webpack_require__(8);
  3192. var $find = __webpack_require__(173)(5);
  3193. var KEY = 'find';
  3194. var forced = true;
  3195. // Shouldn't skip holes
  3196. if (KEY in []) Array(1)[KEY](function () { forced = false; });
  3197. $export($export.P + $export.F * forced, 'Array', {
  3198. find: function find(callbackfn /* , that = undefined */) {
  3199. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3200. }
  3201. });
  3202. __webpack_require__(187)(KEY);
  3203. /***/ }),
  3204. /* 191 */
  3205. /***/ (function(module, exports, __webpack_require__) {
  3206. 'use strict';
  3207. // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
  3208. var $export = __webpack_require__(8);
  3209. var $find = __webpack_require__(173)(6);
  3210. var KEY = 'findIndex';
  3211. var forced = true;
  3212. // Shouldn't skip holes
  3213. if (KEY in []) Array(1)[KEY](function () { forced = false; });
  3214. $export($export.P + $export.F * forced, 'Array', {
  3215. findIndex: function findIndex(callbackfn /* , that = undefined */) {
  3216. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3217. }
  3218. });
  3219. __webpack_require__(187)(KEY);
  3220. /***/ }),
  3221. /* 192 */
  3222. /***/ (function(module, exports, __webpack_require__) {
  3223. __webpack_require__(193)('Array');
  3224. /***/ }),
  3225. /* 193 */
  3226. /***/ (function(module, exports, __webpack_require__) {
  3227. 'use strict';
  3228. var global = __webpack_require__(4);
  3229. var dP = __webpack_require__(11);
  3230. var DESCRIPTORS = __webpack_require__(6);
  3231. var SPECIES = __webpack_require__(26)('species');
  3232. module.exports = function (KEY) {
  3233. var C = global[KEY];
  3234. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  3235. configurable: true,
  3236. get: function () { return this; }
  3237. });
  3238. };
  3239. /***/ }),
  3240. /* 194 */
  3241. /***/ (function(module, exports, __webpack_require__) {
  3242. 'use strict';
  3243. var addToUnscopables = __webpack_require__(187);
  3244. var step = __webpack_require__(195);
  3245. var Iterators = __webpack_require__(129);
  3246. var toIObject = __webpack_require__(32);
  3247. // 22.1.3.4 Array.prototype.entries()
  3248. // 22.1.3.13 Array.prototype.keys()
  3249. // 22.1.3.29 Array.prototype.values()
  3250. // 22.1.3.30 Array.prototype[@@iterator]()
  3251. module.exports = __webpack_require__(128)(Array, 'Array', function (iterated, kind) {
  3252. this._t = toIObject(iterated); // target
  3253. this._i = 0; // next index
  3254. this._k = kind; // kind
  3255. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  3256. }, function () {
  3257. var O = this._t;
  3258. var kind = this._k;
  3259. var index = this._i++;
  3260. if (!O || index >= O.length) {
  3261. this._t = undefined;
  3262. return step(1);
  3263. }
  3264. if (kind == 'keys') return step(0, index);
  3265. if (kind == 'values') return step(0, O[index]);
  3266. return step(0, [index, O[index]]);
  3267. }, 'values');
  3268. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  3269. Iterators.Arguments = Iterators.Array;
  3270. addToUnscopables('keys');
  3271. addToUnscopables('values');
  3272. addToUnscopables('entries');
  3273. /***/ }),
  3274. /* 195 */
  3275. /***/ (function(module, exports) {
  3276. module.exports = function (done, value) {
  3277. return { value: value, done: !!done };
  3278. };
  3279. /***/ }),
  3280. /* 196 */
  3281. /***/ (function(module, exports, __webpack_require__) {
  3282. var global = __webpack_require__(4);
  3283. var inheritIfRequired = __webpack_require__(87);
  3284. var dP = __webpack_require__(11).f;
  3285. var gOPN = __webpack_require__(49).f;
  3286. var isRegExp = __webpack_require__(134);
  3287. var $flags = __webpack_require__(197);
  3288. var $RegExp = global.RegExp;
  3289. var Base = $RegExp;
  3290. var proto = $RegExp.prototype;
  3291. var re1 = /a/g;
  3292. var re2 = /a/g;
  3293. // "new" creates a new object, old webkit buggy here
  3294. var CORRECT_NEW = new $RegExp(re1) !== re1;
  3295. if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(7)(function () {
  3296. re2[__webpack_require__(26)('match')] = false;
  3297. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  3298. return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
  3299. }))) {
  3300. $RegExp = function RegExp(p, f) {
  3301. var tiRE = this instanceof $RegExp;
  3302. var piRE = isRegExp(p);
  3303. var fiU = f === undefined;
  3304. return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
  3305. : inheritIfRequired(CORRECT_NEW
  3306. ? new Base(piRE && !fiU ? p.source : p, f)
  3307. : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
  3308. , tiRE ? this : proto, $RegExp);
  3309. };
  3310. var proxy = function (key) {
  3311. key in $RegExp || dP($RegExp, key, {
  3312. configurable: true,
  3313. get: function () { return Base[key]; },
  3314. set: function (it) { Base[key] = it; }
  3315. });
  3316. };
  3317. for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
  3318. proto.constructor = $RegExp;
  3319. $RegExp.prototype = proto;
  3320. __webpack_require__(18)(global, 'RegExp', $RegExp);
  3321. }
  3322. __webpack_require__(193)('RegExp');
  3323. /***/ }),
  3324. /* 197 */
  3325. /***/ (function(module, exports, __webpack_require__) {
  3326. 'use strict';
  3327. // 21.2.5.3 get RegExp.prototype.flags
  3328. var anObject = __webpack_require__(12);
  3329. module.exports = function () {
  3330. var that = anObject(this);
  3331. var result = '';
  3332. if (that.global) result += 'g';
  3333. if (that.ignoreCase) result += 'i';
  3334. if (that.multiline) result += 'm';
  3335. if (that.unicode) result += 'u';
  3336. if (that.sticky) result += 'y';
  3337. return result;
  3338. };
  3339. /***/ }),
  3340. /* 198 */
  3341. /***/ (function(module, exports, __webpack_require__) {
  3342. 'use strict';
  3343. __webpack_require__(199);
  3344. var anObject = __webpack_require__(12);
  3345. var $flags = __webpack_require__(197);
  3346. var DESCRIPTORS = __webpack_require__(6);
  3347. var TO_STRING = 'toString';
  3348. var $toString = /./[TO_STRING];
  3349. var define = function (fn) {
  3350. __webpack_require__(18)(RegExp.prototype, TO_STRING, fn, true);
  3351. };
  3352. // 21.2.5.14 RegExp.prototype.toString()
  3353. if (__webpack_require__(7)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
  3354. define(function toString() {
  3355. var R = anObject(this);
  3356. return '/'.concat(R.source, '/',
  3357. 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
  3358. });
  3359. // FF44- RegExp#toString has a wrong name
  3360. } else if ($toString.name != TO_STRING) {
  3361. define(function toString() {
  3362. return $toString.call(this);
  3363. });
  3364. }
  3365. /***/ }),
  3366. /* 199 */
  3367. /***/ (function(module, exports, __webpack_require__) {
  3368. // 21.2.5.3 get RegExp.prototype.flags()
  3369. if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(11).f(RegExp.prototype, 'flags', {
  3370. configurable: true,
  3371. get: __webpack_require__(197)
  3372. });
  3373. /***/ }),
  3374. /* 200 */
  3375. /***/ (function(module, exports, __webpack_require__) {
  3376. // @@match logic
  3377. __webpack_require__(201)('match', 1, function (defined, MATCH, $match) {
  3378. // 21.1.3.11 String.prototype.match(regexp)
  3379. return [function match(regexp) {
  3380. 'use strict';
  3381. var O = defined(this);
  3382. var fn = regexp == undefined ? undefined : regexp[MATCH];
  3383. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  3384. }, $match];
  3385. });
  3386. /***/ }),
  3387. /* 201 */
  3388. /***/ (function(module, exports, __webpack_require__) {
  3389. 'use strict';
  3390. var hide = __webpack_require__(10);
  3391. var redefine = __webpack_require__(18);
  3392. var fails = __webpack_require__(7);
  3393. var defined = __webpack_require__(35);
  3394. var wks = __webpack_require__(26);
  3395. module.exports = function (KEY, length, exec) {
  3396. var SYMBOL = wks(KEY);
  3397. var fns = exec(defined, SYMBOL, ''[KEY]);
  3398. var strfn = fns[0];
  3399. var rxfn = fns[1];
  3400. if (fails(function () {
  3401. var O = {};
  3402. O[SYMBOL] = function () { return 7; };
  3403. return ''[KEY](O) != 7;
  3404. })) {
  3405. redefine(String.prototype, KEY, strfn);
  3406. hide(RegExp.prototype, SYMBOL, length == 2
  3407. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  3408. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  3409. ? function (string, arg) { return rxfn.call(string, this, arg); }
  3410. // 21.2.5.6 RegExp.prototype[@@match](string)
  3411. // 21.2.5.9 RegExp.prototype[@@search](string)
  3412. : function (string) { return rxfn.call(string, this); }
  3413. );
  3414. }
  3415. };
  3416. /***/ }),
  3417. /* 202 */
  3418. /***/ (function(module, exports, __webpack_require__) {
  3419. // @@replace logic
  3420. __webpack_require__(201)('replace', 2, function (defined, REPLACE, $replace) {
  3421. // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
  3422. return [function replace(searchValue, replaceValue) {
  3423. 'use strict';
  3424. var O = defined(this);
  3425. var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
  3426. return fn !== undefined
  3427. ? fn.call(searchValue, O, replaceValue)
  3428. : $replace.call(String(O), searchValue, replaceValue);
  3429. }, $replace];
  3430. });
  3431. /***/ }),
  3432. /* 203 */
  3433. /***/ (function(module, exports, __webpack_require__) {
  3434. // @@search logic
  3435. __webpack_require__(201)('search', 1, function (defined, SEARCH, $search) {
  3436. // 21.1.3.15 String.prototype.search(regexp)
  3437. return [function search(regexp) {
  3438. 'use strict';
  3439. var O = defined(this);
  3440. var fn = regexp == undefined ? undefined : regexp[SEARCH];
  3441. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  3442. }, $search];
  3443. });
  3444. /***/ }),
  3445. /* 204 */
  3446. /***/ (function(module, exports, __webpack_require__) {
  3447. // @@split logic
  3448. __webpack_require__(201)('split', 2, function (defined, SPLIT, $split) {
  3449. 'use strict';
  3450. var isRegExp = __webpack_require__(134);
  3451. var _split = $split;
  3452. var $push = [].push;
  3453. var $SPLIT = 'split';
  3454. var LENGTH = 'length';
  3455. var LAST_INDEX = 'lastIndex';
  3456. if (
  3457. 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
  3458. 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
  3459. 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
  3460. '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
  3461. '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
  3462. ''[$SPLIT](/.?/)[LENGTH]
  3463. ) {
  3464. var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
  3465. // based on es5-shim implementation, need to rework it
  3466. $split = function (separator, limit) {
  3467. var string = String(this);
  3468. if (separator === undefined && limit === 0) return [];
  3469. // If `separator` is not a regex, use native split
  3470. if (!isRegExp(separator)) return _split.call(string, separator, limit);
  3471. var output = [];
  3472. var flags = (separator.ignoreCase ? 'i' : '') +
  3473. (separator.multiline ? 'm' : '') +
  3474. (separator.unicode ? 'u' : '') +
  3475. (separator.sticky ? 'y' : '');
  3476. var lastLastIndex = 0;
  3477. var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
  3478. // Make `global` and avoid `lastIndex` issues by working with a copy
  3479. var separatorCopy = new RegExp(separator.source, flags + 'g');
  3480. var separator2, match, lastIndex, lastLength, i;
  3481. // Doesn't need flags gy, but they don't hurt
  3482. if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
  3483. while (match = separatorCopy.exec(string)) {
  3484. // `separatorCopy.lastIndex` is not reliable cross-browser
  3485. lastIndex = match.index + match[0][LENGTH];
  3486. if (lastIndex > lastLastIndex) {
  3487. output.push(string.slice(lastLastIndex, match.index));
  3488. // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
  3489. // eslint-disable-next-line no-loop-func
  3490. if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {
  3491. for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;
  3492. });
  3493. if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
  3494. lastLength = match[0][LENGTH];
  3495. lastLastIndex = lastIndex;
  3496. if (output[LENGTH] >= splitLimit) break;
  3497. }
  3498. if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
  3499. }
  3500. if (lastLastIndex === string[LENGTH]) {
  3501. if (lastLength || !separatorCopy.test('')) output.push('');
  3502. } else output.push(string.slice(lastLastIndex));
  3503. return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
  3504. };
  3505. // Chakra, V8
  3506. } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
  3507. $split = function (separator, limit) {
  3508. return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
  3509. };
  3510. }
  3511. // 21.1.3.17 String.prototype.split(separator, limit)
  3512. return [function split(separator, limit) {
  3513. var O = defined(this);
  3514. var fn = separator == undefined ? undefined : separator[SPLIT];
  3515. return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
  3516. }, $split];
  3517. });
  3518. /***/ }),
  3519. /* 205 */
  3520. /***/ (function(module, exports, __webpack_require__) {
  3521. 'use strict';
  3522. var LIBRARY = __webpack_require__(24);
  3523. var global = __webpack_require__(4);
  3524. var ctx = __webpack_require__(20);
  3525. var classof = __webpack_require__(74);
  3526. var $export = __webpack_require__(8);
  3527. var isObject = __webpack_require__(13);
  3528. var aFunction = __webpack_require__(21);
  3529. var anInstance = __webpack_require__(206);
  3530. var forOf = __webpack_require__(207);
  3531. var speciesConstructor = __webpack_require__(208);
  3532. var task = __webpack_require__(209).set;
  3533. var microtask = __webpack_require__(210)();
  3534. var newPromiseCapabilityModule = __webpack_require__(211);
  3535. var perform = __webpack_require__(212);
  3536. var userAgent = __webpack_require__(213);
  3537. var promiseResolve = __webpack_require__(214);
  3538. var PROMISE = 'Promise';
  3539. var TypeError = global.TypeError;
  3540. var process = global.process;
  3541. var versions = process && process.versions;
  3542. var v8 = versions && versions.v8 || '';
  3543. var $Promise = global[PROMISE];
  3544. var isNode = classof(process) == 'process';
  3545. var empty = function () { /* empty */ };
  3546. var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
  3547. var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
  3548. var USE_NATIVE = !!function () {
  3549. try {
  3550. // correct subclassing with @@species support
  3551. var promise = $Promise.resolve(1);
  3552. var FakePromise = (promise.constructor = {})[__webpack_require__(26)('species')] = function (exec) {
  3553. exec(empty, empty);
  3554. };
  3555. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  3556. return (isNode || typeof PromiseRejectionEvent == 'function')
  3557. && promise.then(empty) instanceof FakePromise
  3558. // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  3559. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  3560. // we can't detect it synchronously, so just check versions
  3561. && v8.indexOf('6.6') !== 0
  3562. && userAgent.indexOf('Chrome/66') === -1;
  3563. } catch (e) { /* empty */ }
  3564. }();
  3565. // helpers
  3566. var isThenable = function (it) {
  3567. var then;
  3568. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  3569. };
  3570. var notify = function (promise, isReject) {
  3571. if (promise._n) return;
  3572. promise._n = true;
  3573. var chain = promise._c;
  3574. microtask(function () {
  3575. var value = promise._v;
  3576. var ok = promise._s == 1;
  3577. var i = 0;
  3578. var run = function (reaction) {
  3579. var handler = ok ? reaction.ok : reaction.fail;
  3580. var resolve = reaction.resolve;
  3581. var reject = reaction.reject;
  3582. var domain = reaction.domain;
  3583. var result, then, exited;
  3584. try {
  3585. if (handler) {
  3586. if (!ok) {
  3587. if (promise._h == 2) onHandleUnhandled(promise);
  3588. promise._h = 1;
  3589. }
  3590. if (handler === true) result = value;
  3591. else {
  3592. if (domain) domain.enter();
  3593. result = handler(value); // may throw
  3594. if (domain) {
  3595. domain.exit();
  3596. exited = true;
  3597. }
  3598. }
  3599. if (result === reaction.promise) {
  3600. reject(TypeError('Promise-chain cycle'));
  3601. } else if (then = isThenable(result)) {
  3602. then.call(result, resolve, reject);
  3603. } else resolve(result);
  3604. } else reject(value);
  3605. } catch (e) {
  3606. if (domain && !exited) domain.exit();
  3607. reject(e);
  3608. }
  3609. };
  3610. while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
  3611. promise._c = [];
  3612. promise._n = false;
  3613. if (isReject && !promise._h) onUnhandled(promise);
  3614. });
  3615. };
  3616. var onUnhandled = function (promise) {
  3617. task.call(global, function () {
  3618. var value = promise._v;
  3619. var unhandled = isUnhandled(promise);
  3620. var result, handler, console;
  3621. if (unhandled) {
  3622. result = perform(function () {
  3623. if (isNode) {
  3624. process.emit('unhandledRejection', value, promise);
  3625. } else if (handler = global.onunhandledrejection) {
  3626. handler({ promise: promise, reason: value });
  3627. } else if ((console = global.console) && console.error) {
  3628. console.error('Unhandled promise rejection', value);
  3629. }
  3630. });
  3631. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  3632. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  3633. } promise._a = undefined;
  3634. if (unhandled && result.e) throw result.v;
  3635. });
  3636. };
  3637. var isUnhandled = function (promise) {
  3638. return promise._h !== 1 && (promise._a || promise._c).length === 0;
  3639. };
  3640. var onHandleUnhandled = function (promise) {
  3641. task.call(global, function () {
  3642. var handler;
  3643. if (isNode) {
  3644. process.emit('rejectionHandled', promise);
  3645. } else if (handler = global.onrejectionhandled) {
  3646. handler({ promise: promise, reason: promise._v });
  3647. }
  3648. });
  3649. };
  3650. var $reject = function (value) {
  3651. var promise = this;
  3652. if (promise._d) return;
  3653. promise._d = true;
  3654. promise = promise._w || promise; // unwrap
  3655. promise._v = value;
  3656. promise._s = 2;
  3657. if (!promise._a) promise._a = promise._c.slice();
  3658. notify(promise, true);
  3659. };
  3660. var $resolve = function (value) {
  3661. var promise = this;
  3662. var then;
  3663. if (promise._d) return;
  3664. promise._d = true;
  3665. promise = promise._w || promise; // unwrap
  3666. try {
  3667. if (promise === value) throw TypeError("Promise can't be resolved itself");
  3668. if (then = isThenable(value)) {
  3669. microtask(function () {
  3670. var wrapper = { _w: promise, _d: false }; // wrap
  3671. try {
  3672. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  3673. } catch (e) {
  3674. $reject.call(wrapper, e);
  3675. }
  3676. });
  3677. } else {
  3678. promise._v = value;
  3679. promise._s = 1;
  3680. notify(promise, false);
  3681. }
  3682. } catch (e) {
  3683. $reject.call({ _w: promise, _d: false }, e); // wrap
  3684. }
  3685. };
  3686. // constructor polyfill
  3687. if (!USE_NATIVE) {
  3688. // 25.4.3.1 Promise(executor)
  3689. $Promise = function Promise(executor) {
  3690. anInstance(this, $Promise, PROMISE, '_h');
  3691. aFunction(executor);
  3692. Internal.call(this);
  3693. try {
  3694. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  3695. } catch (err) {
  3696. $reject.call(this, err);
  3697. }
  3698. };
  3699. // eslint-disable-next-line no-unused-vars
  3700. Internal = function Promise(executor) {
  3701. this._c = []; // <- awaiting reactions
  3702. this._a = undefined; // <- checked in isUnhandled reactions
  3703. this._s = 0; // <- state
  3704. this._d = false; // <- done
  3705. this._v = undefined; // <- value
  3706. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  3707. this._n = false; // <- notify
  3708. };
  3709. Internal.prototype = __webpack_require__(215)($Promise.prototype, {
  3710. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  3711. then: function then(onFulfilled, onRejected) {
  3712. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  3713. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  3714. reaction.fail = typeof onRejected == 'function' && onRejected;
  3715. reaction.domain = isNode ? process.domain : undefined;
  3716. this._c.push(reaction);
  3717. if (this._a) this._a.push(reaction);
  3718. if (this._s) notify(this, false);
  3719. return reaction.promise;
  3720. },
  3721. // 25.4.5.1 Promise.prototype.catch(onRejected)
  3722. 'catch': function (onRejected) {
  3723. return this.then(undefined, onRejected);
  3724. }
  3725. });
  3726. OwnPromiseCapability = function () {
  3727. var promise = new Internal();
  3728. this.promise = promise;
  3729. this.resolve = ctx($resolve, promise, 1);
  3730. this.reject = ctx($reject, promise, 1);
  3731. };
  3732. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  3733. return C === $Promise || C === Wrapper
  3734. ? new OwnPromiseCapability(C)
  3735. : newGenericPromiseCapability(C);
  3736. };
  3737. }
  3738. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
  3739. __webpack_require__(25)($Promise, PROMISE);
  3740. __webpack_require__(193)(PROMISE);
  3741. Wrapper = __webpack_require__(9)[PROMISE];
  3742. // statics
  3743. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  3744. // 25.4.4.5 Promise.reject(r)
  3745. reject: function reject(r) {
  3746. var capability = newPromiseCapability(this);
  3747. var $$reject = capability.reject;
  3748. $$reject(r);
  3749. return capability.promise;
  3750. }
  3751. });
  3752. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  3753. // 25.4.4.6 Promise.resolve(x)
  3754. resolve: function resolve(x) {
  3755. return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  3756. }
  3757. });
  3758. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(166)(function (iter) {
  3759. $Promise.all(iter)['catch'](empty);
  3760. })), PROMISE, {
  3761. // 25.4.4.1 Promise.all(iterable)
  3762. all: function all(iterable) {
  3763. var C = this;
  3764. var capability = newPromiseCapability(C);
  3765. var resolve = capability.resolve;
  3766. var reject = capability.reject;
  3767. var result = perform(function () {
  3768. var values = [];
  3769. var index = 0;
  3770. var remaining = 1;
  3771. forOf(iterable, false, function (promise) {
  3772. var $index = index++;
  3773. var alreadyCalled = false;
  3774. values.push(undefined);
  3775. remaining++;
  3776. C.resolve(promise).then(function (value) {
  3777. if (alreadyCalled) return;
  3778. alreadyCalled = true;
  3779. values[$index] = value;
  3780. --remaining || resolve(values);
  3781. }, reject);
  3782. });
  3783. --remaining || resolve(values);
  3784. });
  3785. if (result.e) reject(result.v);
  3786. return capability.promise;
  3787. },
  3788. // 25.4.4.4 Promise.race(iterable)
  3789. race: function race(iterable) {
  3790. var C = this;
  3791. var capability = newPromiseCapability(C);
  3792. var reject = capability.reject;
  3793. var result = perform(function () {
  3794. forOf(iterable, false, function (promise) {
  3795. C.resolve(promise).then(capability.resolve, reject);
  3796. });
  3797. });
  3798. if (result.e) reject(result.v);
  3799. return capability.promise;
  3800. }
  3801. });
  3802. /***/ }),
  3803. /* 206 */
  3804. /***/ (function(module, exports) {
  3805. module.exports = function (it, Constructor, name, forbiddenField) {
  3806. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  3807. throw TypeError(name + ': incorrect invocation!');
  3808. } return it;
  3809. };
  3810. /***/ }),
  3811. /* 207 */
  3812. /***/ (function(module, exports, __webpack_require__) {
  3813. var ctx = __webpack_require__(20);
  3814. var call = __webpack_require__(162);
  3815. var isArrayIter = __webpack_require__(163);
  3816. var anObject = __webpack_require__(12);
  3817. var toLength = __webpack_require__(37);
  3818. var getIterFn = __webpack_require__(165);
  3819. var BREAK = {};
  3820. var RETURN = {};
  3821. var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  3822. var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  3823. var f = ctx(fn, that, entries ? 2 : 1);
  3824. var index = 0;
  3825. var length, step, iterator, result;
  3826. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  3827. // fast case for arrays with default iterator
  3828. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  3829. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  3830. if (result === BREAK || result === RETURN) return result;
  3831. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  3832. result = call(iterator, f, step.value, entries);
  3833. if (result === BREAK || result === RETURN) return result;
  3834. }
  3835. };
  3836. exports.BREAK = BREAK;
  3837. exports.RETURN = RETURN;
  3838. /***/ }),
  3839. /* 208 */
  3840. /***/ (function(module, exports, __webpack_require__) {
  3841. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  3842. var anObject = __webpack_require__(12);
  3843. var aFunction = __webpack_require__(21);
  3844. var SPECIES = __webpack_require__(26)('species');
  3845. module.exports = function (O, D) {
  3846. var C = anObject(O).constructor;
  3847. var S;
  3848. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  3849. };
  3850. /***/ }),
  3851. /* 209 */
  3852. /***/ (function(module, exports, __webpack_require__) {
  3853. var ctx = __webpack_require__(20);
  3854. var invoke = __webpack_require__(77);
  3855. var html = __webpack_require__(47);
  3856. var cel = __webpack_require__(15);
  3857. var global = __webpack_require__(4);
  3858. var process = global.process;
  3859. var setTask = global.setImmediate;
  3860. var clearTask = global.clearImmediate;
  3861. var MessageChannel = global.MessageChannel;
  3862. var Dispatch = global.Dispatch;
  3863. var counter = 0;
  3864. var queue = {};
  3865. var ONREADYSTATECHANGE = 'onreadystatechange';
  3866. var defer, channel, port;
  3867. var run = function () {
  3868. var id = +this;
  3869. // eslint-disable-next-line no-prototype-builtins
  3870. if (queue.hasOwnProperty(id)) {
  3871. var fn = queue[id];
  3872. delete queue[id];
  3873. fn();
  3874. }
  3875. };
  3876. var listener = function (event) {
  3877. run.call(event.data);
  3878. };
  3879. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  3880. if (!setTask || !clearTask) {
  3881. setTask = function setImmediate(fn) {
  3882. var args = [];
  3883. var i = 1;
  3884. while (arguments.length > i) args.push(arguments[i++]);
  3885. queue[++counter] = function () {
  3886. // eslint-disable-next-line no-new-func
  3887. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  3888. };
  3889. defer(counter);
  3890. return counter;
  3891. };
  3892. clearTask = function clearImmediate(id) {
  3893. delete queue[id];
  3894. };
  3895. // Node.js 0.8-
  3896. if (__webpack_require__(34)(process) == 'process') {
  3897. defer = function (id) {
  3898. process.nextTick(ctx(run, id, 1));
  3899. };
  3900. // Sphere (JS game engine) Dispatch API
  3901. } else if (Dispatch && Dispatch.now) {
  3902. defer = function (id) {
  3903. Dispatch.now(ctx(run, id, 1));
  3904. };
  3905. // Browsers with MessageChannel, includes WebWorkers
  3906. } else if (MessageChannel) {
  3907. channel = new MessageChannel();
  3908. port = channel.port2;
  3909. channel.port1.onmessage = listener;
  3910. defer = ctx(port.postMessage, port, 1);
  3911. // Browsers with postMessage, skip WebWorkers
  3912. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  3913. } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
  3914. defer = function (id) {
  3915. global.postMessage(id + '', '*');
  3916. };
  3917. global.addEventListener('message', listener, false);
  3918. // IE8-
  3919. } else if (ONREADYSTATECHANGE in cel('script')) {
  3920. defer = function (id) {
  3921. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
  3922. html.removeChild(this);
  3923. run.call(id);
  3924. };
  3925. };
  3926. // Rest old browsers
  3927. } else {
  3928. defer = function (id) {
  3929. setTimeout(ctx(run, id, 1), 0);
  3930. };
  3931. }
  3932. }
  3933. module.exports = {
  3934. set: setTask,
  3935. clear: clearTask
  3936. };
  3937. /***/ }),
  3938. /* 210 */
  3939. /***/ (function(module, exports, __webpack_require__) {
  3940. var global = __webpack_require__(4);
  3941. var macrotask = __webpack_require__(209).set;
  3942. var Observer = global.MutationObserver || global.WebKitMutationObserver;
  3943. var process = global.process;
  3944. var Promise = global.Promise;
  3945. var isNode = __webpack_require__(34)(process) == 'process';
  3946. module.exports = function () {
  3947. var head, last, notify;
  3948. var flush = function () {
  3949. var parent, fn;
  3950. if (isNode && (parent = process.domain)) parent.exit();
  3951. while (head) {
  3952. fn = head.fn;
  3953. head = head.next;
  3954. try {
  3955. fn();
  3956. } catch (e) {
  3957. if (head) notify();
  3958. else last = undefined;
  3959. throw e;
  3960. }
  3961. } last = undefined;
  3962. if (parent) parent.enter();
  3963. };
  3964. // Node.js
  3965. if (isNode) {
  3966. notify = function () {
  3967. process.nextTick(flush);
  3968. };
  3969. // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  3970. } else if (Observer && !(global.navigator && global.navigator.standalone)) {
  3971. var toggle = true;
  3972. var node = document.createTextNode('');
  3973. new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
  3974. notify = function () {
  3975. node.data = toggle = !toggle;
  3976. };
  3977. // environments with maybe non-completely correct, but existent Promise
  3978. } else if (Promise && Promise.resolve) {
  3979. // Promise.resolve without an argument throws an error in LG WebOS 2
  3980. var promise = Promise.resolve(undefined);
  3981. notify = function () {
  3982. promise.then(flush);
  3983. };
  3984. // for other environments - macrotask based on:
  3985. // - setImmediate
  3986. // - MessageChannel
  3987. // - window.postMessag
  3988. // - onreadystatechange
  3989. // - setTimeout
  3990. } else {
  3991. notify = function () {
  3992. // strange IE + webpack dev server bug - use .call(global)
  3993. macrotask.call(global, flush);
  3994. };
  3995. }
  3996. return function (fn) {
  3997. var task = { fn: fn, next: undefined };
  3998. if (last) last.next = task;
  3999. if (!head) {
  4000. head = task;
  4001. notify();
  4002. } last = task;
  4003. };
  4004. };
  4005. /***/ }),
  4006. /* 211 */
  4007. /***/ (function(module, exports, __webpack_require__) {
  4008. 'use strict';
  4009. // 25.4.1.5 NewPromiseCapability(C)
  4010. var aFunction = __webpack_require__(21);
  4011. function PromiseCapability(C) {
  4012. var resolve, reject;
  4013. this.promise = new C(function ($$resolve, $$reject) {
  4014. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  4015. resolve = $$resolve;
  4016. reject = $$reject;
  4017. });
  4018. this.resolve = aFunction(resolve);
  4019. this.reject = aFunction(reject);
  4020. }
  4021. module.exports.f = function (C) {
  4022. return new PromiseCapability(C);
  4023. };
  4024. /***/ }),
  4025. /* 212 */
  4026. /***/ (function(module, exports) {
  4027. module.exports = function (exec) {
  4028. try {
  4029. return { e: false, v: exec() };
  4030. } catch (e) {
  4031. return { e: true, v: e };
  4032. }
  4033. };
  4034. /***/ }),
  4035. /* 213 */
  4036. /***/ (function(module, exports, __webpack_require__) {
  4037. var global = __webpack_require__(4);
  4038. var navigator = global.navigator;
  4039. module.exports = navigator && navigator.userAgent || '';
  4040. /***/ }),
  4041. /* 214 */
  4042. /***/ (function(module, exports, __webpack_require__) {
  4043. var anObject = __webpack_require__(12);
  4044. var isObject = __webpack_require__(13);
  4045. var newPromiseCapability = __webpack_require__(211);
  4046. module.exports = function (C, x) {
  4047. anObject(C);
  4048. if (isObject(x) && x.constructor === C) return x;
  4049. var promiseCapability = newPromiseCapability.f(C);
  4050. var resolve = promiseCapability.resolve;
  4051. resolve(x);
  4052. return promiseCapability.promise;
  4053. };
  4054. /***/ }),
  4055. /* 215 */
  4056. /***/ (function(module, exports, __webpack_require__) {
  4057. var redefine = __webpack_require__(18);
  4058. module.exports = function (target, src, safe) {
  4059. for (var key in src) redefine(target, key, src[key], safe);
  4060. return target;
  4061. };
  4062. /***/ }),
  4063. /* 216 */
  4064. /***/ (function(module, exports, __webpack_require__) {
  4065. 'use strict';
  4066. var strong = __webpack_require__(217);
  4067. var validate = __webpack_require__(218);
  4068. var MAP = 'Map';
  4069. // 23.1 Map Objects
  4070. module.exports = __webpack_require__(219)(MAP, function (get) {
  4071. return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4072. }, {
  4073. // 23.1.3.6 Map.prototype.get(key)
  4074. get: function get(key) {
  4075. var entry = strong.getEntry(validate(this, MAP), key);
  4076. return entry && entry.v;
  4077. },
  4078. // 23.1.3.9 Map.prototype.set(key, value)
  4079. set: function set(key, value) {
  4080. return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
  4081. }
  4082. }, strong, true);
  4083. /***/ }),
  4084. /* 217 */
  4085. /***/ (function(module, exports, __webpack_require__) {
  4086. 'use strict';
  4087. var dP = __webpack_require__(11).f;
  4088. var create = __webpack_require__(45);
  4089. var redefineAll = __webpack_require__(215);
  4090. var ctx = __webpack_require__(20);
  4091. var anInstance = __webpack_require__(206);
  4092. var forOf = __webpack_require__(207);
  4093. var $iterDefine = __webpack_require__(128);
  4094. var step = __webpack_require__(195);
  4095. var setSpecies = __webpack_require__(193);
  4096. var DESCRIPTORS = __webpack_require__(6);
  4097. var fastKey = __webpack_require__(22).fastKey;
  4098. var validate = __webpack_require__(218);
  4099. var SIZE = DESCRIPTORS ? '_s' : 'size';
  4100. var getEntry = function (that, key) {
  4101. // fast case
  4102. var index = fastKey(key);
  4103. var entry;
  4104. if (index !== 'F') return that._i[index];
  4105. // frozen object case
  4106. for (entry = that._f; entry; entry = entry.n) {
  4107. if (entry.k == key) return entry;
  4108. }
  4109. };
  4110. module.exports = {
  4111. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  4112. var C = wrapper(function (that, iterable) {
  4113. anInstance(that, C, NAME, '_i');
  4114. that._t = NAME; // collection type
  4115. that._i = create(null); // index
  4116. that._f = undefined; // first entry
  4117. that._l = undefined; // last entry
  4118. that[SIZE] = 0; // size
  4119. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4120. });
  4121. redefineAll(C.prototype, {
  4122. // 23.1.3.1 Map.prototype.clear()
  4123. // 23.2.3.2 Set.prototype.clear()
  4124. clear: function clear() {
  4125. for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
  4126. entry.r = true;
  4127. if (entry.p) entry.p = entry.p.n = undefined;
  4128. delete data[entry.i];
  4129. }
  4130. that._f = that._l = undefined;
  4131. that[SIZE] = 0;
  4132. },
  4133. // 23.1.3.3 Map.prototype.delete(key)
  4134. // 23.2.3.4 Set.prototype.delete(value)
  4135. 'delete': function (key) {
  4136. var that = validate(this, NAME);
  4137. var entry = getEntry(that, key);
  4138. if (entry) {
  4139. var next = entry.n;
  4140. var prev = entry.p;
  4141. delete that._i[entry.i];
  4142. entry.r = true;
  4143. if (prev) prev.n = next;
  4144. if (next) next.p = prev;
  4145. if (that._f == entry) that._f = next;
  4146. if (that._l == entry) that._l = prev;
  4147. that[SIZE]--;
  4148. } return !!entry;
  4149. },
  4150. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  4151. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  4152. forEach: function forEach(callbackfn /* , that = undefined */) {
  4153. validate(this, NAME);
  4154. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  4155. var entry;
  4156. while (entry = entry ? entry.n : this._f) {
  4157. f(entry.v, entry.k, this);
  4158. // revert to the last existing entry
  4159. while (entry && entry.r) entry = entry.p;
  4160. }
  4161. },
  4162. // 23.1.3.7 Map.prototype.has(key)
  4163. // 23.2.3.7 Set.prototype.has(value)
  4164. has: function has(key) {
  4165. return !!getEntry(validate(this, NAME), key);
  4166. }
  4167. });
  4168. if (DESCRIPTORS) dP(C.prototype, 'size', {
  4169. get: function () {
  4170. return validate(this, NAME)[SIZE];
  4171. }
  4172. });
  4173. return C;
  4174. },
  4175. def: function (that, key, value) {
  4176. var entry = getEntry(that, key);
  4177. var prev, index;
  4178. // change existing entry
  4179. if (entry) {
  4180. entry.v = value;
  4181. // create new entry
  4182. } else {
  4183. that._l = entry = {
  4184. i: index = fastKey(key, true), // <- index
  4185. k: key, // <- key
  4186. v: value, // <- value
  4187. p: prev = that._l, // <- previous entry
  4188. n: undefined, // <- next entry
  4189. r: false // <- removed
  4190. };
  4191. if (!that._f) that._f = entry;
  4192. if (prev) prev.n = entry;
  4193. that[SIZE]++;
  4194. // add to index
  4195. if (index !== 'F') that._i[index] = entry;
  4196. } return that;
  4197. },
  4198. getEntry: getEntry,
  4199. setStrong: function (C, NAME, IS_MAP) {
  4200. // add .keys, .values, .entries, [@@iterator]
  4201. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  4202. $iterDefine(C, NAME, function (iterated, kind) {
  4203. this._t = validate(iterated, NAME); // target
  4204. this._k = kind; // kind
  4205. this._l = undefined; // previous
  4206. }, function () {
  4207. var that = this;
  4208. var kind = that._k;
  4209. var entry = that._l;
  4210. // revert to the last existing entry
  4211. while (entry && entry.r) entry = entry.p;
  4212. // get next entry
  4213. if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
  4214. // or finish the iteration
  4215. that._t = undefined;
  4216. return step(1);
  4217. }
  4218. // return step by kind
  4219. if (kind == 'keys') return step(0, entry.k);
  4220. if (kind == 'values') return step(0, entry.v);
  4221. return step(0, [entry.k, entry.v]);
  4222. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  4223. // add [@@species], 23.1.2.2, 23.2.2.2
  4224. setSpecies(NAME);
  4225. }
  4226. };
  4227. /***/ }),
  4228. /* 218 */
  4229. /***/ (function(module, exports, __webpack_require__) {
  4230. var isObject = __webpack_require__(13);
  4231. module.exports = function (it, TYPE) {
  4232. if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  4233. return it;
  4234. };
  4235. /***/ }),
  4236. /* 219 */
  4237. /***/ (function(module, exports, __webpack_require__) {
  4238. 'use strict';
  4239. var global = __webpack_require__(4);
  4240. var $export = __webpack_require__(8);
  4241. var redefine = __webpack_require__(18);
  4242. var redefineAll = __webpack_require__(215);
  4243. var meta = __webpack_require__(22);
  4244. var forOf = __webpack_require__(207);
  4245. var anInstance = __webpack_require__(206);
  4246. var isObject = __webpack_require__(13);
  4247. var fails = __webpack_require__(7);
  4248. var $iterDetect = __webpack_require__(166);
  4249. var setToStringTag = __webpack_require__(25);
  4250. var inheritIfRequired = __webpack_require__(87);
  4251. module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  4252. var Base = global[NAME];
  4253. var C = Base;
  4254. var ADDER = IS_MAP ? 'set' : 'add';
  4255. var proto = C && C.prototype;
  4256. var O = {};
  4257. var fixMethod = function (KEY) {
  4258. var fn = proto[KEY];
  4259. redefine(proto, KEY,
  4260. KEY == 'delete' ? function (a) {
  4261. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  4262. } : KEY == 'has' ? function has(a) {
  4263. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  4264. } : KEY == 'get' ? function get(a) {
  4265. return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
  4266. } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
  4267. : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
  4268. );
  4269. };
  4270. if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
  4271. new C().entries().next();
  4272. }))) {
  4273. // create collection constructor
  4274. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  4275. redefineAll(C.prototype, methods);
  4276. meta.NEED = true;
  4277. } else {
  4278. var instance = new C();
  4279. // early implementations not supports chaining
  4280. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  4281. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  4282. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  4283. // most early implementations doesn't supports iterables, most modern - not close it correctly
  4284. var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
  4285. // for early implementations -0 and +0 not the same
  4286. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  4287. // V8 ~ Chromium 42- fails only with 5+ elements
  4288. var $instance = new C();
  4289. var index = 5;
  4290. while (index--) $instance[ADDER](index, index);
  4291. return !$instance.has(-0);
  4292. });
  4293. if (!ACCEPT_ITERABLES) {
  4294. C = wrapper(function (target, iterable) {
  4295. anInstance(target, C, NAME);
  4296. var that = inheritIfRequired(new Base(), target, C);
  4297. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4298. return that;
  4299. });
  4300. C.prototype = proto;
  4301. proto.constructor = C;
  4302. }
  4303. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  4304. fixMethod('delete');
  4305. fixMethod('has');
  4306. IS_MAP && fixMethod('get');
  4307. }
  4308. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  4309. // weak collections should not contains .clear method
  4310. if (IS_WEAK && proto.clear) delete proto.clear;
  4311. }
  4312. setToStringTag(C, NAME);
  4313. O[NAME] = C;
  4314. $export($export.G + $export.W + $export.F * (C != Base), O);
  4315. if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
  4316. return C;
  4317. };
  4318. /***/ }),
  4319. /* 220 */
  4320. /***/ (function(module, exports, __webpack_require__) {
  4321. 'use strict';
  4322. var strong = __webpack_require__(217);
  4323. var validate = __webpack_require__(218);
  4324. var SET = 'Set';
  4325. // 23.2 Set Objects
  4326. module.exports = __webpack_require__(219)(SET, function (get) {
  4327. return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4328. }, {
  4329. // 23.2.3.1 Set.prototype.add(value)
  4330. add: function add(value) {
  4331. return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
  4332. }
  4333. }, strong);
  4334. /***/ }),
  4335. /* 221 */
  4336. /***/ (function(module, exports, __webpack_require__) {
  4337. 'use strict';
  4338. var each = __webpack_require__(173)(0);
  4339. var redefine = __webpack_require__(18);
  4340. var meta = __webpack_require__(22);
  4341. var assign = __webpack_require__(68);
  4342. var weak = __webpack_require__(222);
  4343. var isObject = __webpack_require__(13);
  4344. var fails = __webpack_require__(7);
  4345. var validate = __webpack_require__(218);
  4346. var WEAK_MAP = 'WeakMap';
  4347. var getWeak = meta.getWeak;
  4348. var isExtensible = Object.isExtensible;
  4349. var uncaughtFrozenStore = weak.ufstore;
  4350. var tmp = {};
  4351. var InternalMap;
  4352. var wrapper = function (get) {
  4353. return function WeakMap() {
  4354. return get(this, arguments.length > 0 ? arguments[0] : undefined);
  4355. };
  4356. };
  4357. var methods = {
  4358. // 23.3.3.3 WeakMap.prototype.get(key)
  4359. get: function get(key) {
  4360. if (isObject(key)) {
  4361. var data = getWeak(key);
  4362. if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
  4363. return data ? data[this._i] : undefined;
  4364. }
  4365. },
  4366. // 23.3.3.5 WeakMap.prototype.set(key, value)
  4367. set: function set(key, value) {
  4368. return weak.def(validate(this, WEAK_MAP), key, value);
  4369. }
  4370. };
  4371. // 23.3 WeakMap Objects
  4372. var $WeakMap = module.exports = __webpack_require__(219)(WEAK_MAP, wrapper, methods, weak, true, true);
  4373. // IE11 WeakMap frozen keys fix
  4374. if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {
  4375. InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
  4376. assign(InternalMap.prototype, methods);
  4377. meta.NEED = true;
  4378. each(['delete', 'has', 'get', 'set'], function (key) {
  4379. var proto = $WeakMap.prototype;
  4380. var method = proto[key];
  4381. redefine(proto, key, function (a, b) {
  4382. // store frozen objects on internal weakmap shim
  4383. if (isObject(a) && !isExtensible(a)) {
  4384. if (!this._f) this._f = new InternalMap();
  4385. var result = this._f[key](a, b);
  4386. return key == 'set' ? this : result;
  4387. // store all the rest on native weakmap
  4388. } return method.call(this, a, b);
  4389. });
  4390. });
  4391. }
  4392. /***/ }),
  4393. /* 222 */
  4394. /***/ (function(module, exports, __webpack_require__) {
  4395. 'use strict';
  4396. var redefineAll = __webpack_require__(215);
  4397. var getWeak = __webpack_require__(22).getWeak;
  4398. var anObject = __webpack_require__(12);
  4399. var isObject = __webpack_require__(13);
  4400. var anInstance = __webpack_require__(206);
  4401. var forOf = __webpack_require__(207);
  4402. var createArrayMethod = __webpack_require__(173);
  4403. var $has = __webpack_require__(5);
  4404. var validate = __webpack_require__(218);
  4405. var arrayFind = createArrayMethod(5);
  4406. var arrayFindIndex = createArrayMethod(6);
  4407. var id = 0;
  4408. // fallback for uncaught frozen keys
  4409. var uncaughtFrozenStore = function (that) {
  4410. return that._l || (that._l = new UncaughtFrozenStore());
  4411. };
  4412. var UncaughtFrozenStore = function () {
  4413. this.a = [];
  4414. };
  4415. var findUncaughtFrozen = function (store, key) {
  4416. return arrayFind(store.a, function (it) {
  4417. return it[0] === key;
  4418. });
  4419. };
  4420. UncaughtFrozenStore.prototype = {
  4421. get: function (key) {
  4422. var entry = findUncaughtFrozen(this, key);
  4423. if (entry) return entry[1];
  4424. },
  4425. has: function (key) {
  4426. return !!findUncaughtFrozen(this, key);
  4427. },
  4428. set: function (key, value) {
  4429. var entry = findUncaughtFrozen(this, key);
  4430. if (entry) entry[1] = value;
  4431. else this.a.push([key, value]);
  4432. },
  4433. 'delete': function (key) {
  4434. var index = arrayFindIndex(this.a, function (it) {
  4435. return it[0] === key;
  4436. });
  4437. if (~index) this.a.splice(index, 1);
  4438. return !!~index;
  4439. }
  4440. };
  4441. module.exports = {
  4442. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  4443. var C = wrapper(function (that, iterable) {
  4444. anInstance(that, C, NAME, '_i');
  4445. that._t = NAME; // collection type
  4446. that._i = id++; // collection id
  4447. that._l = undefined; // leak store for uncaught frozen objects
  4448. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4449. });
  4450. redefineAll(C.prototype, {
  4451. // 23.3.3.2 WeakMap.prototype.delete(key)
  4452. // 23.4.3.3 WeakSet.prototype.delete(value)
  4453. 'delete': function (key) {
  4454. if (!isObject(key)) return false;
  4455. var data = getWeak(key);
  4456. if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
  4457. return data && $has(data, this._i) && delete data[this._i];
  4458. },
  4459. // 23.3.3.4 WeakMap.prototype.has(key)
  4460. // 23.4.3.4 WeakSet.prototype.has(value)
  4461. has: function has(key) {
  4462. if (!isObject(key)) return false;
  4463. var data = getWeak(key);
  4464. if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
  4465. return data && $has(data, this._i);
  4466. }
  4467. });
  4468. return C;
  4469. },
  4470. def: function (that, key, value) {
  4471. var data = getWeak(anObject(key), true);
  4472. if (data === true) uncaughtFrozenStore(that).set(key, value);
  4473. else data[that._i] = value;
  4474. return that;
  4475. },
  4476. ufstore: uncaughtFrozenStore
  4477. };
  4478. /***/ }),
  4479. /* 223 */
  4480. /***/ (function(module, exports, __webpack_require__) {
  4481. 'use strict';
  4482. var weak = __webpack_require__(222);
  4483. var validate = __webpack_require__(218);
  4484. var WEAK_SET = 'WeakSet';
  4485. // 23.4 WeakSet Objects
  4486. __webpack_require__(219)(WEAK_SET, function (get) {
  4487. return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4488. }, {
  4489. // 23.4.3.1 WeakSet.prototype.add(value)
  4490. add: function add(value) {
  4491. return weak.def(validate(this, WEAK_SET), value, true);
  4492. }
  4493. }, weak, false, true);
  4494. /***/ }),
  4495. /* 224 */
  4496. /***/ (function(module, exports, __webpack_require__) {
  4497. 'use strict';
  4498. var $export = __webpack_require__(8);
  4499. var $typed = __webpack_require__(225);
  4500. var buffer = __webpack_require__(226);
  4501. var anObject = __webpack_require__(12);
  4502. var toAbsoluteIndex = __webpack_require__(39);
  4503. var toLength = __webpack_require__(37);
  4504. var isObject = __webpack_require__(13);
  4505. var ArrayBuffer = __webpack_require__(4).ArrayBuffer;
  4506. var speciesConstructor = __webpack_require__(208);
  4507. var $ArrayBuffer = buffer.ArrayBuffer;
  4508. var $DataView = buffer.DataView;
  4509. var $isView = $typed.ABV && ArrayBuffer.isView;
  4510. var $slice = $ArrayBuffer.prototype.slice;
  4511. var VIEW = $typed.VIEW;
  4512. var ARRAY_BUFFER = 'ArrayBuffer';
  4513. $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
  4514. $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
  4515. // 24.1.3.1 ArrayBuffer.isView(arg)
  4516. isView: function isView(it) {
  4517. return $isView && $isView(it) || isObject(it) && VIEW in it;
  4518. }
  4519. });
  4520. $export($export.P + $export.U + $export.F * __webpack_require__(7)(function () {
  4521. return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
  4522. }), ARRAY_BUFFER, {
  4523. // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
  4524. slice: function slice(start, end) {
  4525. if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
  4526. var len = anObject(this).byteLength;
  4527. var first = toAbsoluteIndex(start, len);
  4528. var fin = toAbsoluteIndex(end === undefined ? len : end, len);
  4529. var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
  4530. var viewS = new $DataView(this);
  4531. var viewT = new $DataView(result);
  4532. var index = 0;
  4533. while (first < fin) {
  4534. viewT.setUint8(index++, viewS.getUint8(first++));
  4535. } return result;
  4536. }
  4537. });
  4538. __webpack_require__(193)(ARRAY_BUFFER);
  4539. /***/ }),
  4540. /* 225 */
  4541. /***/ (function(module, exports, __webpack_require__) {
  4542. var global = __webpack_require__(4);
  4543. var hide = __webpack_require__(10);
  4544. var uid = __webpack_require__(19);
  4545. var TYPED = uid('typed_array');
  4546. var VIEW = uid('view');
  4547. var ABV = !!(global.ArrayBuffer && global.DataView);
  4548. var CONSTR = ABV;
  4549. var i = 0;
  4550. var l = 9;
  4551. var Typed;
  4552. var TypedArrayConstructors = (
  4553. 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
  4554. ).split(',');
  4555. while (i < l) {
  4556. if (Typed = global[TypedArrayConstructors[i++]]) {
  4557. hide(Typed.prototype, TYPED, true);
  4558. hide(Typed.prototype, VIEW, true);
  4559. } else CONSTR = false;
  4560. }
  4561. module.exports = {
  4562. ABV: ABV,
  4563. CONSTR: CONSTR,
  4564. TYPED: TYPED,
  4565. VIEW: VIEW
  4566. };
  4567. /***/ }),
  4568. /* 226 */
  4569. /***/ (function(module, exports, __webpack_require__) {
  4570. 'use strict';
  4571. var global = __webpack_require__(4);
  4572. var DESCRIPTORS = __webpack_require__(6);
  4573. var LIBRARY = __webpack_require__(24);
  4574. var $typed = __webpack_require__(225);
  4575. var hide = __webpack_require__(10);
  4576. var redefineAll = __webpack_require__(215);
  4577. var fails = __webpack_require__(7);
  4578. var anInstance = __webpack_require__(206);
  4579. var toInteger = __webpack_require__(38);
  4580. var toLength = __webpack_require__(37);
  4581. var toIndex = __webpack_require__(227);
  4582. var gOPN = __webpack_require__(49).f;
  4583. var dP = __webpack_require__(11).f;
  4584. var arrayFill = __webpack_require__(189);
  4585. var setToStringTag = __webpack_require__(25);
  4586. var ARRAY_BUFFER = 'ArrayBuffer';
  4587. var DATA_VIEW = 'DataView';
  4588. var PROTOTYPE = 'prototype';
  4589. var WRONG_LENGTH = 'Wrong length!';
  4590. var WRONG_INDEX = 'Wrong index!';
  4591. var $ArrayBuffer = global[ARRAY_BUFFER];
  4592. var $DataView = global[DATA_VIEW];
  4593. var Math = global.Math;
  4594. var RangeError = global.RangeError;
  4595. // eslint-disable-next-line no-shadow-restricted-names
  4596. var Infinity = global.Infinity;
  4597. var BaseBuffer = $ArrayBuffer;
  4598. var abs = Math.abs;
  4599. var pow = Math.pow;
  4600. var floor = Math.floor;
  4601. var log = Math.log;
  4602. var LN2 = Math.LN2;
  4603. var BUFFER = 'buffer';
  4604. var BYTE_LENGTH = 'byteLength';
  4605. var BYTE_OFFSET = 'byteOffset';
  4606. var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
  4607. var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
  4608. var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
  4609. // IEEE754 conversions based on https://github.com/feross/ieee754
  4610. function packIEEE754(value, mLen, nBytes) {
  4611. var buffer = new Array(nBytes);
  4612. var eLen = nBytes * 8 - mLen - 1;
  4613. var eMax = (1 << eLen) - 1;
  4614. var eBias = eMax >> 1;
  4615. var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
  4616. var i = 0;
  4617. var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  4618. var e, m, c;
  4619. value = abs(value);
  4620. // eslint-disable-next-line no-self-compare
  4621. if (value != value || value === Infinity) {
  4622. // eslint-disable-next-line no-self-compare
  4623. m = value != value ? 1 : 0;
  4624. e = eMax;
  4625. } else {
  4626. e = floor(log(value) / LN2);
  4627. if (value * (c = pow(2, -e)) < 1) {
  4628. e--;
  4629. c *= 2;
  4630. }
  4631. if (e + eBias >= 1) {
  4632. value += rt / c;
  4633. } else {
  4634. value += rt * pow(2, 1 - eBias);
  4635. }
  4636. if (value * c >= 2) {
  4637. e++;
  4638. c /= 2;
  4639. }
  4640. if (e + eBias >= eMax) {
  4641. m = 0;
  4642. e = eMax;
  4643. } else if (e + eBias >= 1) {
  4644. m = (value * c - 1) * pow(2, mLen);
  4645. e = e + eBias;
  4646. } else {
  4647. m = value * pow(2, eBias - 1) * pow(2, mLen);
  4648. e = 0;
  4649. }
  4650. }
  4651. for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
  4652. e = e << mLen | m;
  4653. eLen += mLen;
  4654. for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
  4655. buffer[--i] |= s * 128;
  4656. return buffer;
  4657. }
  4658. function unpackIEEE754(buffer, mLen, nBytes) {
  4659. var eLen = nBytes * 8 - mLen - 1;
  4660. var eMax = (1 << eLen) - 1;
  4661. var eBias = eMax >> 1;
  4662. var nBits = eLen - 7;
  4663. var i = nBytes - 1;
  4664. var s = buffer[i--];
  4665. var e = s & 127;
  4666. var m;
  4667. s >>= 7;
  4668. for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
  4669. m = e & (1 << -nBits) - 1;
  4670. e >>= -nBits;
  4671. nBits += mLen;
  4672. for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
  4673. if (e === 0) {
  4674. e = 1 - eBias;
  4675. } else if (e === eMax) {
  4676. return m ? NaN : s ? -Infinity : Infinity;
  4677. } else {
  4678. m = m + pow(2, mLen);
  4679. e = e - eBias;
  4680. } return (s ? -1 : 1) * m * pow(2, e - mLen);
  4681. }
  4682. function unpackI32(bytes) {
  4683. return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
  4684. }
  4685. function packI8(it) {
  4686. return [it & 0xff];
  4687. }
  4688. function packI16(it) {
  4689. return [it & 0xff, it >> 8 & 0xff];
  4690. }
  4691. function packI32(it) {
  4692. return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
  4693. }
  4694. function packF64(it) {
  4695. return packIEEE754(it, 52, 8);
  4696. }
  4697. function packF32(it) {
  4698. return packIEEE754(it, 23, 4);
  4699. }
  4700. function addGetter(C, key, internal) {
  4701. dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
  4702. }
  4703. function get(view, bytes, index, isLittleEndian) {
  4704. var numIndex = +index;
  4705. var intIndex = toIndex(numIndex);
  4706. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  4707. var store = view[$BUFFER]._b;
  4708. var start = intIndex + view[$OFFSET];
  4709. var pack = store.slice(start, start + bytes);
  4710. return isLittleEndian ? pack : pack.reverse();
  4711. }
  4712. function set(view, bytes, index, conversion, value, isLittleEndian) {
  4713. var numIndex = +index;
  4714. var intIndex = toIndex(numIndex);
  4715. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  4716. var store = view[$BUFFER]._b;
  4717. var start = intIndex + view[$OFFSET];
  4718. var pack = conversion(+value);
  4719. for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
  4720. }
  4721. if (!$typed.ABV) {
  4722. $ArrayBuffer = function ArrayBuffer(length) {
  4723. anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
  4724. var byteLength = toIndex(length);
  4725. this._b = arrayFill.call(new Array(byteLength), 0);
  4726. this[$LENGTH] = byteLength;
  4727. };
  4728. $DataView = function DataView(buffer, byteOffset, byteLength) {
  4729. anInstance(this, $DataView, DATA_VIEW);
  4730. anInstance(buffer, $ArrayBuffer, DATA_VIEW);
  4731. var bufferLength = buffer[$LENGTH];
  4732. var offset = toInteger(byteOffset);
  4733. if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
  4734. byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
  4735. if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
  4736. this[$BUFFER] = buffer;
  4737. this[$OFFSET] = offset;
  4738. this[$LENGTH] = byteLength;
  4739. };
  4740. if (DESCRIPTORS) {
  4741. addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
  4742. addGetter($DataView, BUFFER, '_b');
  4743. addGetter($DataView, BYTE_LENGTH, '_l');
  4744. addGetter($DataView, BYTE_OFFSET, '_o');
  4745. }
  4746. redefineAll($DataView[PROTOTYPE], {
  4747. getInt8: function getInt8(byteOffset) {
  4748. return get(this, 1, byteOffset)[0] << 24 >> 24;
  4749. },
  4750. getUint8: function getUint8(byteOffset) {
  4751. return get(this, 1, byteOffset)[0];
  4752. },
  4753. getInt16: function getInt16(byteOffset /* , littleEndian */) {
  4754. var bytes = get(this, 2, byteOffset, arguments[1]);
  4755. return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
  4756. },
  4757. getUint16: function getUint16(byteOffset /* , littleEndian */) {
  4758. var bytes = get(this, 2, byteOffset, arguments[1]);
  4759. return bytes[1] << 8 | bytes[0];
  4760. },
  4761. getInt32: function getInt32(byteOffset /* , littleEndian */) {
  4762. return unpackI32(get(this, 4, byteOffset, arguments[1]));
  4763. },
  4764. getUint32: function getUint32(byteOffset /* , littleEndian */) {
  4765. return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
  4766. },
  4767. getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
  4768. return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
  4769. },
  4770. getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
  4771. return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
  4772. },
  4773. setInt8: function setInt8(byteOffset, value) {
  4774. set(this, 1, byteOffset, packI8, value);
  4775. },
  4776. setUint8: function setUint8(byteOffset, value) {
  4777. set(this, 1, byteOffset, packI8, value);
  4778. },
  4779. setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
  4780. set(this, 2, byteOffset, packI16, value, arguments[2]);
  4781. },
  4782. setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
  4783. set(this, 2, byteOffset, packI16, value, arguments[2]);
  4784. },
  4785. setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
  4786. set(this, 4, byteOffset, packI32, value, arguments[2]);
  4787. },
  4788. setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
  4789. set(this, 4, byteOffset, packI32, value, arguments[2]);
  4790. },
  4791. setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
  4792. set(this, 4, byteOffset, packF32, value, arguments[2]);
  4793. },
  4794. setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
  4795. set(this, 8, byteOffset, packF64, value, arguments[2]);
  4796. }
  4797. });
  4798. } else {
  4799. if (!fails(function () {
  4800. $ArrayBuffer(1);
  4801. }) || !fails(function () {
  4802. new $ArrayBuffer(-1); // eslint-disable-line no-new
  4803. }) || fails(function () {
  4804. new $ArrayBuffer(); // eslint-disable-line no-new
  4805. new $ArrayBuffer(1.5); // eslint-disable-line no-new
  4806. new $ArrayBuffer(NaN); // eslint-disable-line no-new
  4807. return $ArrayBuffer.name != ARRAY_BUFFER;
  4808. })) {
  4809. $ArrayBuffer = function ArrayBuffer(length) {
  4810. anInstance(this, $ArrayBuffer);
  4811. return new BaseBuffer(toIndex(length));
  4812. };
  4813. var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
  4814. for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
  4815. if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
  4816. }
  4817. if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
  4818. }
  4819. // iOS Safari 7.x bug
  4820. var view = new $DataView(new $ArrayBuffer(2));
  4821. var $setInt8 = $DataView[PROTOTYPE].setInt8;
  4822. view.setInt8(0, 2147483648);
  4823. view.setInt8(1, 2147483649);
  4824. if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
  4825. setInt8: function setInt8(byteOffset, value) {
  4826. $setInt8.call(this, byteOffset, value << 24 >> 24);
  4827. },
  4828. setUint8: function setUint8(byteOffset, value) {
  4829. $setInt8.call(this, byteOffset, value << 24 >> 24);
  4830. }
  4831. }, true);
  4832. }
  4833. setToStringTag($ArrayBuffer, ARRAY_BUFFER);
  4834. setToStringTag($DataView, DATA_VIEW);
  4835. hide($DataView[PROTOTYPE], $typed.VIEW, true);
  4836. exports[ARRAY_BUFFER] = $ArrayBuffer;
  4837. exports[DATA_VIEW] = $DataView;
  4838. /***/ }),
  4839. /* 227 */
  4840. /***/ (function(module, exports, __webpack_require__) {
  4841. // https://tc39.github.io/ecma262/#sec-toindex
  4842. var toInteger = __webpack_require__(38);
  4843. var toLength = __webpack_require__(37);
  4844. module.exports = function (it) {
  4845. if (it === undefined) return 0;
  4846. var number = toInteger(it);
  4847. var length = toLength(number);
  4848. if (number !== length) throw RangeError('Wrong length!');
  4849. return length;
  4850. };
  4851. /***/ }),
  4852. /* 228 */
  4853. /***/ (function(module, exports, __webpack_require__) {
  4854. var $export = __webpack_require__(8);
  4855. $export($export.G + $export.W + $export.F * !__webpack_require__(225).ABV, {
  4856. DataView: __webpack_require__(226).DataView
  4857. });
  4858. /***/ }),
  4859. /* 229 */
  4860. /***/ (function(module, exports, __webpack_require__) {
  4861. __webpack_require__(230)('Int8', 1, function (init) {
  4862. return function Int8Array(data, byteOffset, length) {
  4863. return init(this, data, byteOffset, length);
  4864. };
  4865. });
  4866. /***/ }),
  4867. /* 230 */
  4868. /***/ (function(module, exports, __webpack_require__) {
  4869. 'use strict';
  4870. if (__webpack_require__(6)) {
  4871. var LIBRARY = __webpack_require__(24);
  4872. var global = __webpack_require__(4);
  4873. var fails = __webpack_require__(7);
  4874. var $export = __webpack_require__(8);
  4875. var $typed = __webpack_require__(225);
  4876. var $buffer = __webpack_require__(226);
  4877. var ctx = __webpack_require__(20);
  4878. var anInstance = __webpack_require__(206);
  4879. var propertyDesc = __webpack_require__(17);
  4880. var hide = __webpack_require__(10);
  4881. var redefineAll = __webpack_require__(215);
  4882. var toInteger = __webpack_require__(38);
  4883. var toLength = __webpack_require__(37);
  4884. var toIndex = __webpack_require__(227);
  4885. var toAbsoluteIndex = __webpack_require__(39);
  4886. var toPrimitive = __webpack_require__(16);
  4887. var has = __webpack_require__(5);
  4888. var classof = __webpack_require__(74);
  4889. var isObject = __webpack_require__(13);
  4890. var toObject = __webpack_require__(57);
  4891. var isArrayIter = __webpack_require__(163);
  4892. var create = __webpack_require__(45);
  4893. var getPrototypeOf = __webpack_require__(58);
  4894. var gOPN = __webpack_require__(49).f;
  4895. var getIterFn = __webpack_require__(165);
  4896. var uid = __webpack_require__(19);
  4897. var wks = __webpack_require__(26);
  4898. var createArrayMethod = __webpack_require__(173);
  4899. var createArrayIncludes = __webpack_require__(36);
  4900. var speciesConstructor = __webpack_require__(208);
  4901. var ArrayIterators = __webpack_require__(194);
  4902. var Iterators = __webpack_require__(129);
  4903. var $iterDetect = __webpack_require__(166);
  4904. var setSpecies = __webpack_require__(193);
  4905. var arrayFill = __webpack_require__(189);
  4906. var arrayCopyWithin = __webpack_require__(186);
  4907. var $DP = __webpack_require__(11);
  4908. var $GOPD = __webpack_require__(50);
  4909. var dP = $DP.f;
  4910. var gOPD = $GOPD.f;
  4911. var RangeError = global.RangeError;
  4912. var TypeError = global.TypeError;
  4913. var Uint8Array = global.Uint8Array;
  4914. var ARRAY_BUFFER = 'ArrayBuffer';
  4915. var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
  4916. var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
  4917. var PROTOTYPE = 'prototype';
  4918. var ArrayProto = Array[PROTOTYPE];
  4919. var $ArrayBuffer = $buffer.ArrayBuffer;
  4920. var $DataView = $buffer.DataView;
  4921. var arrayForEach = createArrayMethod(0);
  4922. var arrayFilter = createArrayMethod(2);
  4923. var arraySome = createArrayMethod(3);
  4924. var arrayEvery = createArrayMethod(4);
  4925. var arrayFind = createArrayMethod(5);
  4926. var arrayFindIndex = createArrayMethod(6);
  4927. var arrayIncludes = createArrayIncludes(true);
  4928. var arrayIndexOf = createArrayIncludes(false);
  4929. var arrayValues = ArrayIterators.values;
  4930. var arrayKeys = ArrayIterators.keys;
  4931. var arrayEntries = ArrayIterators.entries;
  4932. var arrayLastIndexOf = ArrayProto.lastIndexOf;
  4933. var arrayReduce = ArrayProto.reduce;
  4934. var arrayReduceRight = ArrayProto.reduceRight;
  4935. var arrayJoin = ArrayProto.join;
  4936. var arraySort = ArrayProto.sort;
  4937. var arraySlice = ArrayProto.slice;
  4938. var arrayToString = ArrayProto.toString;
  4939. var arrayToLocaleString = ArrayProto.toLocaleString;
  4940. var ITERATOR = wks('iterator');
  4941. var TAG = wks('toStringTag');
  4942. var TYPED_CONSTRUCTOR = uid('typed_constructor');
  4943. var DEF_CONSTRUCTOR = uid('def_constructor');
  4944. var ALL_CONSTRUCTORS = $typed.CONSTR;
  4945. var TYPED_ARRAY = $typed.TYPED;
  4946. var VIEW = $typed.VIEW;
  4947. var WRONG_LENGTH = 'Wrong length!';
  4948. var $map = createArrayMethod(1, function (O, length) {
  4949. return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
  4950. });
  4951. var LITTLE_ENDIAN = fails(function () {
  4952. // eslint-disable-next-line no-undef
  4953. return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
  4954. });
  4955. var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
  4956. new Uint8Array(1).set({});
  4957. });
  4958. var toOffset = function (it, BYTES) {
  4959. var offset = toInteger(it);
  4960. if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
  4961. return offset;
  4962. };
  4963. var validate = function (it) {
  4964. if (isObject(it) && TYPED_ARRAY in it) return it;
  4965. throw TypeError(it + ' is not a typed array!');
  4966. };
  4967. var allocate = function (C, length) {
  4968. if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
  4969. throw TypeError('It is not a typed array constructor!');
  4970. } return new C(length);
  4971. };
  4972. var speciesFromList = function (O, list) {
  4973. return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
  4974. };
  4975. var fromList = function (C, list) {
  4976. var index = 0;
  4977. var length = list.length;
  4978. var result = allocate(C, length);
  4979. while (length > index) result[index] = list[index++];
  4980. return result;
  4981. };
  4982. var addGetter = function (it, key, internal) {
  4983. dP(it, key, { get: function () { return this._d[internal]; } });
  4984. };
  4985. var $from = function from(source /* , mapfn, thisArg */) {
  4986. var O = toObject(source);
  4987. var aLen = arguments.length;
  4988. var mapfn = aLen > 1 ? arguments[1] : undefined;
  4989. var mapping = mapfn !== undefined;
  4990. var iterFn = getIterFn(O);
  4991. var i, length, values, result, step, iterator;
  4992. if (iterFn != undefined && !isArrayIter(iterFn)) {
  4993. for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
  4994. values.push(step.value);
  4995. } O = values;
  4996. }
  4997. if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
  4998. for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
  4999. result[i] = mapping ? mapfn(O[i], i) : O[i];
  5000. }
  5001. return result;
  5002. };
  5003. var $of = function of(/* ...items */) {
  5004. var index = 0;
  5005. var length = arguments.length;
  5006. var result = allocate(this, length);
  5007. while (length > index) result[index] = arguments[index++];
  5008. return result;
  5009. };
  5010. // iOS Safari 6.x fails here
  5011. var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
  5012. var $toLocaleString = function toLocaleString() {
  5013. return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
  5014. };
  5015. var proto = {
  5016. copyWithin: function copyWithin(target, start /* , end */) {
  5017. return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
  5018. },
  5019. every: function every(callbackfn /* , thisArg */) {
  5020. return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5021. },
  5022. fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
  5023. return arrayFill.apply(validate(this), arguments);
  5024. },
  5025. filter: function filter(callbackfn /* , thisArg */) {
  5026. return speciesFromList(this, arrayFilter(validate(this), callbackfn,
  5027. arguments.length > 1 ? arguments[1] : undefined));
  5028. },
  5029. find: function find(predicate /* , thisArg */) {
  5030. return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  5031. },
  5032. findIndex: function findIndex(predicate /* , thisArg */) {
  5033. return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  5034. },
  5035. forEach: function forEach(callbackfn /* , thisArg */) {
  5036. arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5037. },
  5038. indexOf: function indexOf(searchElement /* , fromIndex */) {
  5039. return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  5040. },
  5041. includes: function includes(searchElement /* , fromIndex */) {
  5042. return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  5043. },
  5044. join: function join(separator) { // eslint-disable-line no-unused-vars
  5045. return arrayJoin.apply(validate(this), arguments);
  5046. },
  5047. lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
  5048. return arrayLastIndexOf.apply(validate(this), arguments);
  5049. },
  5050. map: function map(mapfn /* , thisArg */) {
  5051. return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
  5052. },
  5053. reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  5054. return arrayReduce.apply(validate(this), arguments);
  5055. },
  5056. reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  5057. return arrayReduceRight.apply(validate(this), arguments);
  5058. },
  5059. reverse: function reverse() {
  5060. var that = this;
  5061. var length = validate(that).length;
  5062. var middle = Math.floor(length / 2);
  5063. var index = 0;
  5064. var value;
  5065. while (index < middle) {
  5066. value = that[index];
  5067. that[index++] = that[--length];
  5068. that[length] = value;
  5069. } return that;
  5070. },
  5071. some: function some(callbackfn /* , thisArg */) {
  5072. return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5073. },
  5074. sort: function sort(comparefn) {
  5075. return arraySort.call(validate(this), comparefn);
  5076. },
  5077. subarray: function subarray(begin, end) {
  5078. var O = validate(this);
  5079. var length = O.length;
  5080. var $begin = toAbsoluteIndex(begin, length);
  5081. return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
  5082. O.buffer,
  5083. O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
  5084. toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
  5085. );
  5086. }
  5087. };
  5088. var $slice = function slice(start, end) {
  5089. return speciesFromList(this, arraySlice.call(validate(this), start, end));
  5090. };
  5091. var $set = function set(arrayLike /* , offset */) {
  5092. validate(this);
  5093. var offset = toOffset(arguments[1], 1);
  5094. var length = this.length;
  5095. var src = toObject(arrayLike);
  5096. var len = toLength(src.length);
  5097. var index = 0;
  5098. if (len + offset > length) throw RangeError(WRONG_LENGTH);
  5099. while (index < len) this[offset + index] = src[index++];
  5100. };
  5101. var $iterators = {
  5102. entries: function entries() {
  5103. return arrayEntries.call(validate(this));
  5104. },
  5105. keys: function keys() {
  5106. return arrayKeys.call(validate(this));
  5107. },
  5108. values: function values() {
  5109. return arrayValues.call(validate(this));
  5110. }
  5111. };
  5112. var isTAIndex = function (target, key) {
  5113. return isObject(target)
  5114. && target[TYPED_ARRAY]
  5115. && typeof key != 'symbol'
  5116. && key in target
  5117. && String(+key) == String(key);
  5118. };
  5119. var $getDesc = function getOwnPropertyDescriptor(target, key) {
  5120. return isTAIndex(target, key = toPrimitive(key, true))
  5121. ? propertyDesc(2, target[key])
  5122. : gOPD(target, key);
  5123. };
  5124. var $setDesc = function defineProperty(target, key, desc) {
  5125. if (isTAIndex(target, key = toPrimitive(key, true))
  5126. && isObject(desc)
  5127. && has(desc, 'value')
  5128. && !has(desc, 'get')
  5129. && !has(desc, 'set')
  5130. // TODO: add validation descriptor w/o calling accessors
  5131. && !desc.configurable
  5132. && (!has(desc, 'writable') || desc.writable)
  5133. && (!has(desc, 'enumerable') || desc.enumerable)
  5134. ) {
  5135. target[key] = desc.value;
  5136. return target;
  5137. } return dP(target, key, desc);
  5138. };
  5139. if (!ALL_CONSTRUCTORS) {
  5140. $GOPD.f = $getDesc;
  5141. $DP.f = $setDesc;
  5142. }
  5143. $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
  5144. getOwnPropertyDescriptor: $getDesc,
  5145. defineProperty: $setDesc
  5146. });
  5147. if (fails(function () { arrayToString.call({}); })) {
  5148. arrayToString = arrayToLocaleString = function toString() {
  5149. return arrayJoin.call(this);
  5150. };
  5151. }
  5152. var $TypedArrayPrototype$ = redefineAll({}, proto);
  5153. redefineAll($TypedArrayPrototype$, $iterators);
  5154. hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
  5155. redefineAll($TypedArrayPrototype$, {
  5156. slice: $slice,
  5157. set: $set,
  5158. constructor: function () { /* noop */ },
  5159. toString: arrayToString,
  5160. toLocaleString: $toLocaleString
  5161. });
  5162. addGetter($TypedArrayPrototype$, 'buffer', 'b');
  5163. addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
  5164. addGetter($TypedArrayPrototype$, 'byteLength', 'l');
  5165. addGetter($TypedArrayPrototype$, 'length', 'e');
  5166. dP($TypedArrayPrototype$, TAG, {
  5167. get: function () { return this[TYPED_ARRAY]; }
  5168. });
  5169. // eslint-disable-next-line max-statements
  5170. module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
  5171. CLAMPED = !!CLAMPED;
  5172. var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
  5173. var GETTER = 'get' + KEY;
  5174. var SETTER = 'set' + KEY;
  5175. var TypedArray = global[NAME];
  5176. var Base = TypedArray || {};
  5177. var TAC = TypedArray && getPrototypeOf(TypedArray);
  5178. var FORCED = !TypedArray || !$typed.ABV;
  5179. var O = {};
  5180. var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
  5181. var getter = function (that, index) {
  5182. var data = that._d;
  5183. return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
  5184. };
  5185. var setter = function (that, index, value) {
  5186. var data = that._d;
  5187. if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
  5188. data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
  5189. };
  5190. var addElement = function (that, index) {
  5191. dP(that, index, {
  5192. get: function () {
  5193. return getter(this, index);
  5194. },
  5195. set: function (value) {
  5196. return setter(this, index, value);
  5197. },
  5198. enumerable: true
  5199. });
  5200. };
  5201. if (FORCED) {
  5202. TypedArray = wrapper(function (that, data, $offset, $length) {
  5203. anInstance(that, TypedArray, NAME, '_d');
  5204. var index = 0;
  5205. var offset = 0;
  5206. var buffer, byteLength, length, klass;
  5207. if (!isObject(data)) {
  5208. length = toIndex(data);
  5209. byteLength = length * BYTES;
  5210. buffer = new $ArrayBuffer(byteLength);
  5211. } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  5212. buffer = data;
  5213. offset = toOffset($offset, BYTES);
  5214. var $len = data.byteLength;
  5215. if ($length === undefined) {
  5216. if ($len % BYTES) throw RangeError(WRONG_LENGTH);
  5217. byteLength = $len - offset;
  5218. if (byteLength < 0) throw RangeError(WRONG_LENGTH);
  5219. } else {
  5220. byteLength = toLength($length) * BYTES;
  5221. if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
  5222. }
  5223. length = byteLength / BYTES;
  5224. } else if (TYPED_ARRAY in data) {
  5225. return fromList(TypedArray, data);
  5226. } else {
  5227. return $from.call(TypedArray, data);
  5228. }
  5229. hide(that, '_d', {
  5230. b: buffer,
  5231. o: offset,
  5232. l: byteLength,
  5233. e: length,
  5234. v: new $DataView(buffer)
  5235. });
  5236. while (index < length) addElement(that, index++);
  5237. });
  5238. TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
  5239. hide(TypedArrayPrototype, 'constructor', TypedArray);
  5240. } else if (!fails(function () {
  5241. TypedArray(1);
  5242. }) || !fails(function () {
  5243. new TypedArray(-1); // eslint-disable-line no-new
  5244. }) || !$iterDetect(function (iter) {
  5245. new TypedArray(); // eslint-disable-line no-new
  5246. new TypedArray(null); // eslint-disable-line no-new
  5247. new TypedArray(1.5); // eslint-disable-line no-new
  5248. new TypedArray(iter); // eslint-disable-line no-new
  5249. }, true)) {
  5250. TypedArray = wrapper(function (that, data, $offset, $length) {
  5251. anInstance(that, TypedArray, NAME);
  5252. var klass;
  5253. // `ws` module bug, temporarily remove validation length for Uint8Array
  5254. // https://github.com/websockets/ws/pull/645
  5255. if (!isObject(data)) return new Base(toIndex(data));
  5256. if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  5257. return $length !== undefined
  5258. ? new Base(data, toOffset($offset, BYTES), $length)
  5259. : $offset !== undefined
  5260. ? new Base(data, toOffset($offset, BYTES))
  5261. : new Base(data);
  5262. }
  5263. if (TYPED_ARRAY in data) return fromList(TypedArray, data);
  5264. return $from.call(TypedArray, data);
  5265. });
  5266. arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
  5267. if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
  5268. });
  5269. TypedArray[PROTOTYPE] = TypedArrayPrototype;
  5270. if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
  5271. }
  5272. var $nativeIterator = TypedArrayPrototype[ITERATOR];
  5273. var CORRECT_ITER_NAME = !!$nativeIterator
  5274. && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
  5275. var $iterator = $iterators.values;
  5276. hide(TypedArray, TYPED_CONSTRUCTOR, true);
  5277. hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
  5278. hide(TypedArrayPrototype, VIEW, true);
  5279. hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
  5280. if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
  5281. dP(TypedArrayPrototype, TAG, {
  5282. get: function () { return NAME; }
  5283. });
  5284. }
  5285. O[NAME] = TypedArray;
  5286. $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
  5287. $export($export.S, NAME, {
  5288. BYTES_PER_ELEMENT: BYTES
  5289. });
  5290. $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
  5291. from: $from,
  5292. of: $of
  5293. });
  5294. if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
  5295. $export($export.P, NAME, proto);
  5296. setSpecies(NAME);
  5297. $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
  5298. $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
  5299. if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
  5300. $export($export.P + $export.F * fails(function () {
  5301. new TypedArray(1).slice();
  5302. }), NAME, { slice: $slice });
  5303. $export($export.P + $export.F * (fails(function () {
  5304. return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
  5305. }) || !fails(function () {
  5306. TypedArrayPrototype.toLocaleString.call([1, 2]);
  5307. })), NAME, { toLocaleString: $toLocaleString });
  5308. Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
  5309. if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
  5310. };
  5311. } else module.exports = function () { /* empty */ };
  5312. /***/ }),
  5313. /* 231 */
  5314. /***/ (function(module, exports, __webpack_require__) {
  5315. __webpack_require__(230)('Uint8', 1, function (init) {
  5316. return function Uint8Array(data, byteOffset, length) {
  5317. return init(this, data, byteOffset, length);
  5318. };
  5319. });
  5320. /***/ }),
  5321. /* 232 */
  5322. /***/ (function(module, exports, __webpack_require__) {
  5323. __webpack_require__(230)('Uint8', 1, function (init) {
  5324. return function Uint8ClampedArray(data, byteOffset, length) {
  5325. return init(this, data, byteOffset, length);
  5326. };
  5327. }, true);
  5328. /***/ }),
  5329. /* 233 */
  5330. /***/ (function(module, exports, __webpack_require__) {
  5331. __webpack_require__(230)('Int16', 2, function (init) {
  5332. return function Int16Array(data, byteOffset, length) {
  5333. return init(this, data, byteOffset, length);
  5334. };
  5335. });
  5336. /***/ }),
  5337. /* 234 */
  5338. /***/ (function(module, exports, __webpack_require__) {
  5339. __webpack_require__(230)('Uint16', 2, function (init) {
  5340. return function Uint16Array(data, byteOffset, length) {
  5341. return init(this, data, byteOffset, length);
  5342. };
  5343. });
  5344. /***/ }),
  5345. /* 235 */
  5346. /***/ (function(module, exports, __webpack_require__) {
  5347. __webpack_require__(230)('Int32', 4, function (init) {
  5348. return function Int32Array(data, byteOffset, length) {
  5349. return init(this, data, byteOffset, length);
  5350. };
  5351. });
  5352. /***/ }),
  5353. /* 236 */
  5354. /***/ (function(module, exports, __webpack_require__) {
  5355. __webpack_require__(230)('Uint32', 4, function (init) {
  5356. return function Uint32Array(data, byteOffset, length) {
  5357. return init(this, data, byteOffset, length);
  5358. };
  5359. });
  5360. /***/ }),
  5361. /* 237 */
  5362. /***/ (function(module, exports, __webpack_require__) {
  5363. __webpack_require__(230)('Float32', 4, function (init) {
  5364. return function Float32Array(data, byteOffset, length) {
  5365. return init(this, data, byteOffset, length);
  5366. };
  5367. });
  5368. /***/ }),
  5369. /* 238 */
  5370. /***/ (function(module, exports, __webpack_require__) {
  5371. __webpack_require__(230)('Float64', 8, function (init) {
  5372. return function Float64Array(data, byteOffset, length) {
  5373. return init(this, data, byteOffset, length);
  5374. };
  5375. });
  5376. /***/ }),
  5377. /* 239 */
  5378. /***/ (function(module, exports, __webpack_require__) {
  5379. // 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
  5380. var $export = __webpack_require__(8);
  5381. var aFunction = __webpack_require__(21);
  5382. var anObject = __webpack_require__(12);
  5383. var rApply = (__webpack_require__(4).Reflect || {}).apply;
  5384. var fApply = Function.apply;
  5385. // MS Edge argumentsList argument is optional
  5386. $export($export.S + $export.F * !__webpack_require__(7)(function () {
  5387. rApply(function () { /* empty */ });
  5388. }), 'Reflect', {
  5389. apply: function apply(target, thisArgument, argumentsList) {
  5390. var T = aFunction(target);
  5391. var L = anObject(argumentsList);
  5392. return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
  5393. }
  5394. });
  5395. /***/ }),
  5396. /* 240 */
  5397. /***/ (function(module, exports, __webpack_require__) {
  5398. // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
  5399. var $export = __webpack_require__(8);
  5400. var create = __webpack_require__(45);
  5401. var aFunction = __webpack_require__(21);
  5402. var anObject = __webpack_require__(12);
  5403. var isObject = __webpack_require__(13);
  5404. var fails = __webpack_require__(7);
  5405. var bind = __webpack_require__(76);
  5406. var rConstruct = (__webpack_require__(4).Reflect || {}).construct;
  5407. // MS Edge supports only 2 arguments and argumentsList argument is optional
  5408. // FF Nightly sets third argument as `new.target`, but does not create `this` from it
  5409. var NEW_TARGET_BUG = fails(function () {
  5410. function F() { /* empty */ }
  5411. return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
  5412. });
  5413. var ARGS_BUG = !fails(function () {
  5414. rConstruct(function () { /* empty */ });
  5415. });
  5416. $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
  5417. construct: function construct(Target, args /* , newTarget */) {
  5418. aFunction(Target);
  5419. anObject(args);
  5420. var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
  5421. if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
  5422. if (Target == newTarget) {
  5423. // w/o altered newTarget, optimization for 0-4 arguments
  5424. switch (args.length) {
  5425. case 0: return new Target();
  5426. case 1: return new Target(args[0]);
  5427. case 2: return new Target(args[0], args[1]);
  5428. case 3: return new Target(args[0], args[1], args[2]);
  5429. case 4: return new Target(args[0], args[1], args[2], args[3]);
  5430. }
  5431. // w/o altered newTarget, lot of arguments case
  5432. var $args = [null];
  5433. $args.push.apply($args, args);
  5434. return new (bind.apply(Target, $args))();
  5435. }
  5436. // with altered newTarget, not support built-in constructors
  5437. var proto = newTarget.prototype;
  5438. var instance = create(isObject(proto) ? proto : Object.prototype);
  5439. var result = Function.apply.call(Target, instance, args);
  5440. return isObject(result) ? result : instance;
  5441. }
  5442. });
  5443. /***/ }),
  5444. /* 241 */
  5445. /***/ (function(module, exports, __webpack_require__) {
  5446. // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
  5447. var dP = __webpack_require__(11);
  5448. var $export = __webpack_require__(8);
  5449. var anObject = __webpack_require__(12);
  5450. var toPrimitive = __webpack_require__(16);
  5451. // MS Edge has broken Reflect.defineProperty - throwing instead of returning false
  5452. $export($export.S + $export.F * __webpack_require__(7)(function () {
  5453. // eslint-disable-next-line no-undef
  5454. Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
  5455. }), 'Reflect', {
  5456. defineProperty: function defineProperty(target, propertyKey, attributes) {
  5457. anObject(target);
  5458. propertyKey = toPrimitive(propertyKey, true);
  5459. anObject(attributes);
  5460. try {
  5461. dP.f(target, propertyKey, attributes);
  5462. return true;
  5463. } catch (e) {
  5464. return false;
  5465. }
  5466. }
  5467. });
  5468. /***/ }),
  5469. /* 242 */
  5470. /***/ (function(module, exports, __webpack_require__) {
  5471. // 26.1.4 Reflect.deleteProperty(target, propertyKey)
  5472. var $export = __webpack_require__(8);
  5473. var gOPD = __webpack_require__(50).f;
  5474. var anObject = __webpack_require__(12);
  5475. $export($export.S, 'Reflect', {
  5476. deleteProperty: function deleteProperty(target, propertyKey) {
  5477. var desc = gOPD(anObject(target), propertyKey);
  5478. return desc && !desc.configurable ? false : delete target[propertyKey];
  5479. }
  5480. });
  5481. /***/ }),
  5482. /* 243 */
  5483. /***/ (function(module, exports, __webpack_require__) {
  5484. 'use strict';
  5485. // 26.1.5 Reflect.enumerate(target)
  5486. var $export = __webpack_require__(8);
  5487. var anObject = __webpack_require__(12);
  5488. var Enumerate = function (iterated) {
  5489. this._t = anObject(iterated); // target
  5490. this._i = 0; // next index
  5491. var keys = this._k = []; // keys
  5492. var key;
  5493. for (key in iterated) keys.push(key);
  5494. };
  5495. __webpack_require__(130)(Enumerate, 'Object', function () {
  5496. var that = this;
  5497. var keys = that._k;
  5498. var key;
  5499. do {
  5500. if (that._i >= keys.length) return { value: undefined, done: true };
  5501. } while (!((key = keys[that._i++]) in that._t));
  5502. return { value: key, done: false };
  5503. });
  5504. $export($export.S, 'Reflect', {
  5505. enumerate: function enumerate(target) {
  5506. return new Enumerate(target);
  5507. }
  5508. });
  5509. /***/ }),
  5510. /* 244 */
  5511. /***/ (function(module, exports, __webpack_require__) {
  5512. // 26.1.6 Reflect.get(target, propertyKey [, receiver])
  5513. var gOPD = __webpack_require__(50);
  5514. var getPrototypeOf = __webpack_require__(58);
  5515. var has = __webpack_require__(5);
  5516. var $export = __webpack_require__(8);
  5517. var isObject = __webpack_require__(13);
  5518. var anObject = __webpack_require__(12);
  5519. function get(target, propertyKey /* , receiver */) {
  5520. var receiver = arguments.length < 3 ? target : arguments[2];
  5521. var desc, proto;
  5522. if (anObject(target) === receiver) return target[propertyKey];
  5523. if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
  5524. ? desc.value
  5525. : desc.get !== undefined
  5526. ? desc.get.call(receiver)
  5527. : undefined;
  5528. if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
  5529. }
  5530. $export($export.S, 'Reflect', { get: get });
  5531. /***/ }),
  5532. /* 245 */
  5533. /***/ (function(module, exports, __webpack_require__) {
  5534. // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
  5535. var gOPD = __webpack_require__(50);
  5536. var $export = __webpack_require__(8);
  5537. var anObject = __webpack_require__(12);
  5538. $export($export.S, 'Reflect', {
  5539. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
  5540. return gOPD.f(anObject(target), propertyKey);
  5541. }
  5542. });
  5543. /***/ }),
  5544. /* 246 */
  5545. /***/ (function(module, exports, __webpack_require__) {
  5546. // 26.1.8 Reflect.getPrototypeOf(target)
  5547. var $export = __webpack_require__(8);
  5548. var getProto = __webpack_require__(58);
  5549. var anObject = __webpack_require__(12);
  5550. $export($export.S, 'Reflect', {
  5551. getPrototypeOf: function getPrototypeOf(target) {
  5552. return getProto(anObject(target));
  5553. }
  5554. });
  5555. /***/ }),
  5556. /* 247 */
  5557. /***/ (function(module, exports, __webpack_require__) {
  5558. // 26.1.9 Reflect.has(target, propertyKey)
  5559. var $export = __webpack_require__(8);
  5560. $export($export.S, 'Reflect', {
  5561. has: function has(target, propertyKey) {
  5562. return propertyKey in target;
  5563. }
  5564. });
  5565. /***/ }),
  5566. /* 248 */
  5567. /***/ (function(module, exports, __webpack_require__) {
  5568. // 26.1.10 Reflect.isExtensible(target)
  5569. var $export = __webpack_require__(8);
  5570. var anObject = __webpack_require__(12);
  5571. var $isExtensible = Object.isExtensible;
  5572. $export($export.S, 'Reflect', {
  5573. isExtensible: function isExtensible(target) {
  5574. anObject(target);
  5575. return $isExtensible ? $isExtensible(target) : true;
  5576. }
  5577. });
  5578. /***/ }),
  5579. /* 249 */
  5580. /***/ (function(module, exports, __webpack_require__) {
  5581. // 26.1.11 Reflect.ownKeys(target)
  5582. var $export = __webpack_require__(8);
  5583. $export($export.S, 'Reflect', { ownKeys: __webpack_require__(250) });
  5584. /***/ }),
  5585. /* 250 */
  5586. /***/ (function(module, exports, __webpack_require__) {
  5587. // all object keys, includes non-enumerable and symbols
  5588. var gOPN = __webpack_require__(49);
  5589. var gOPS = __webpack_require__(42);
  5590. var anObject = __webpack_require__(12);
  5591. var Reflect = __webpack_require__(4).Reflect;
  5592. module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
  5593. var keys = gOPN.f(anObject(it));
  5594. var getSymbols = gOPS.f;
  5595. return getSymbols ? keys.concat(getSymbols(it)) : keys;
  5596. };
  5597. /***/ }),
  5598. /* 251 */
  5599. /***/ (function(module, exports, __webpack_require__) {
  5600. // 26.1.12 Reflect.preventExtensions(target)
  5601. var $export = __webpack_require__(8);
  5602. var anObject = __webpack_require__(12);
  5603. var $preventExtensions = Object.preventExtensions;
  5604. $export($export.S, 'Reflect', {
  5605. preventExtensions: function preventExtensions(target) {
  5606. anObject(target);
  5607. try {
  5608. if ($preventExtensions) $preventExtensions(target);
  5609. return true;
  5610. } catch (e) {
  5611. return false;
  5612. }
  5613. }
  5614. });
  5615. /***/ }),
  5616. /* 252 */
  5617. /***/ (function(module, exports, __webpack_require__) {
  5618. // 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
  5619. var dP = __webpack_require__(11);
  5620. var gOPD = __webpack_require__(50);
  5621. var getPrototypeOf = __webpack_require__(58);
  5622. var has = __webpack_require__(5);
  5623. var $export = __webpack_require__(8);
  5624. var createDesc = __webpack_require__(17);
  5625. var anObject = __webpack_require__(12);
  5626. var isObject = __webpack_require__(13);
  5627. function set(target, propertyKey, V /* , receiver */) {
  5628. var receiver = arguments.length < 4 ? target : arguments[3];
  5629. var ownDesc = gOPD.f(anObject(target), propertyKey);
  5630. var existingDescriptor, proto;
  5631. if (!ownDesc) {
  5632. if (isObject(proto = getPrototypeOf(target))) {
  5633. return set(proto, propertyKey, V, receiver);
  5634. }
  5635. ownDesc = createDesc(0);
  5636. }
  5637. if (has(ownDesc, 'value')) {
  5638. if (ownDesc.writable === false || !isObject(receiver)) return false;
  5639. if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
  5640. if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
  5641. existingDescriptor.value = V;
  5642. dP.f(receiver, propertyKey, existingDescriptor);
  5643. } else dP.f(receiver, propertyKey, createDesc(0, V));
  5644. return true;
  5645. }
  5646. return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
  5647. }
  5648. $export($export.S, 'Reflect', { set: set });
  5649. /***/ }),
  5650. /* 253 */
  5651. /***/ (function(module, exports, __webpack_require__) {
  5652. // 26.1.14 Reflect.setPrototypeOf(target, proto)
  5653. var $export = __webpack_require__(8);
  5654. var setProto = __webpack_require__(72);
  5655. if (setProto) $export($export.S, 'Reflect', {
  5656. setPrototypeOf: function setPrototypeOf(target, proto) {
  5657. setProto.check(target, proto);
  5658. try {
  5659. setProto.set(target, proto);
  5660. return true;
  5661. } catch (e) {
  5662. return false;
  5663. }
  5664. }
  5665. });
  5666. /***/ }),
  5667. /* 254 */
  5668. /***/ (function(module, exports, __webpack_require__) {
  5669. 'use strict';
  5670. // https://github.com/tc39/Array.prototype.includes
  5671. var $export = __webpack_require__(8);
  5672. var $includes = __webpack_require__(36)(true);
  5673. $export($export.P, 'Array', {
  5674. includes: function includes(el /* , fromIndex = 0 */) {
  5675. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  5676. }
  5677. });
  5678. __webpack_require__(187)('includes');
  5679. /***/ }),
  5680. /* 255 */
  5681. /***/ (function(module, exports, __webpack_require__) {
  5682. 'use strict';
  5683. // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
  5684. var $export = __webpack_require__(8);
  5685. var flattenIntoArray = __webpack_require__(256);
  5686. var toObject = __webpack_require__(57);
  5687. var toLength = __webpack_require__(37);
  5688. var aFunction = __webpack_require__(21);
  5689. var arraySpeciesCreate = __webpack_require__(174);
  5690. $export($export.P, 'Array', {
  5691. flatMap: function flatMap(callbackfn /* , thisArg */) {
  5692. var O = toObject(this);
  5693. var sourceLen, A;
  5694. aFunction(callbackfn);
  5695. sourceLen = toLength(O.length);
  5696. A = arraySpeciesCreate(O, 0);
  5697. flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
  5698. return A;
  5699. }
  5700. });
  5701. __webpack_require__(187)('flatMap');
  5702. /***/ }),
  5703. /* 256 */
  5704. /***/ (function(module, exports, __webpack_require__) {
  5705. 'use strict';
  5706. // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
  5707. var isArray = __webpack_require__(44);
  5708. var isObject = __webpack_require__(13);
  5709. var toLength = __webpack_require__(37);
  5710. var ctx = __webpack_require__(20);
  5711. var IS_CONCAT_SPREADABLE = __webpack_require__(26)('isConcatSpreadable');
  5712. function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  5713. var targetIndex = start;
  5714. var sourceIndex = 0;
  5715. var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
  5716. var element, spreadable;
  5717. while (sourceIndex < sourceLen) {
  5718. if (sourceIndex in source) {
  5719. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  5720. spreadable = false;
  5721. if (isObject(element)) {
  5722. spreadable = element[IS_CONCAT_SPREADABLE];
  5723. spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
  5724. }
  5725. if (spreadable && depth > 0) {
  5726. targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
  5727. } else {
  5728. if (targetIndex >= 0x1fffffffffffff) throw TypeError();
  5729. target[targetIndex] = element;
  5730. }
  5731. targetIndex++;
  5732. }
  5733. sourceIndex++;
  5734. }
  5735. return targetIndex;
  5736. }
  5737. module.exports = flattenIntoArray;
  5738. /***/ }),
  5739. /* 257 */
  5740. /***/ (function(module, exports, __webpack_require__) {
  5741. 'use strict';
  5742. // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
  5743. var $export = __webpack_require__(8);
  5744. var flattenIntoArray = __webpack_require__(256);
  5745. var toObject = __webpack_require__(57);
  5746. var toLength = __webpack_require__(37);
  5747. var toInteger = __webpack_require__(38);
  5748. var arraySpeciesCreate = __webpack_require__(174);
  5749. $export($export.P, 'Array', {
  5750. flatten: function flatten(/* depthArg = 1 */) {
  5751. var depthArg = arguments[0];
  5752. var O = toObject(this);
  5753. var sourceLen = toLength(O.length);
  5754. var A = arraySpeciesCreate(O, 0);
  5755. flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
  5756. return A;
  5757. }
  5758. });
  5759. __webpack_require__(187)('flatten');
  5760. /***/ }),
  5761. /* 258 */
  5762. /***/ (function(module, exports, __webpack_require__) {
  5763. 'use strict';
  5764. // https://github.com/mathiasbynens/String.prototype.at
  5765. var $export = __webpack_require__(8);
  5766. var $at = __webpack_require__(127)(true);
  5767. $export($export.P, 'String', {
  5768. at: function at(pos) {
  5769. return $at(this, pos);
  5770. }
  5771. });
  5772. /***/ }),
  5773. /* 259 */
  5774. /***/ (function(module, exports, __webpack_require__) {
  5775. 'use strict';
  5776. // https://github.com/tc39/proposal-string-pad-start-end
  5777. var $export = __webpack_require__(8);
  5778. var $pad = __webpack_require__(260);
  5779. var userAgent = __webpack_require__(213);
  5780. // https://github.com/zloirock/core-js/issues/280
  5781. $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
  5782. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  5783. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
  5784. }
  5785. });
  5786. /***/ }),
  5787. /* 260 */
  5788. /***/ (function(module, exports, __webpack_require__) {
  5789. // https://github.com/tc39/proposal-string-pad-start-end
  5790. var toLength = __webpack_require__(37);
  5791. var repeat = __webpack_require__(90);
  5792. var defined = __webpack_require__(35);
  5793. module.exports = function (that, maxLength, fillString, left) {
  5794. var S = String(defined(that));
  5795. var stringLength = S.length;
  5796. var fillStr = fillString === undefined ? ' ' : String(fillString);
  5797. var intMaxLength = toLength(maxLength);
  5798. if (intMaxLength <= stringLength || fillStr == '') return S;
  5799. var fillLen = intMaxLength - stringLength;
  5800. var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
  5801. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  5802. return left ? stringFiller + S : S + stringFiller;
  5803. };
  5804. /***/ }),
  5805. /* 261 */
  5806. /***/ (function(module, exports, __webpack_require__) {
  5807. 'use strict';
  5808. // https://github.com/tc39/proposal-string-pad-start-end
  5809. var $export = __webpack_require__(8);
  5810. var $pad = __webpack_require__(260);
  5811. var userAgent = __webpack_require__(213);
  5812. // https://github.com/zloirock/core-js/issues/280
  5813. $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
  5814. padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
  5815. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
  5816. }
  5817. });
  5818. /***/ }),
  5819. /* 262 */
  5820. /***/ (function(module, exports, __webpack_require__) {
  5821. 'use strict';
  5822. // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
  5823. __webpack_require__(82)('trimLeft', function ($trim) {
  5824. return function trimLeft() {
  5825. return $trim(this, 1);
  5826. };
  5827. }, 'trimStart');
  5828. /***/ }),
  5829. /* 263 */
  5830. /***/ (function(module, exports, __webpack_require__) {
  5831. 'use strict';
  5832. // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
  5833. __webpack_require__(82)('trimRight', function ($trim) {
  5834. return function trimRight() {
  5835. return $trim(this, 2);
  5836. };
  5837. }, 'trimEnd');
  5838. /***/ }),
  5839. /* 264 */
  5840. /***/ (function(module, exports, __webpack_require__) {
  5841. 'use strict';
  5842. // https://tc39.github.io/String.prototype.matchAll/
  5843. var $export = __webpack_require__(8);
  5844. var defined = __webpack_require__(35);
  5845. var toLength = __webpack_require__(37);
  5846. var isRegExp = __webpack_require__(134);
  5847. var getFlags = __webpack_require__(197);
  5848. var RegExpProto = RegExp.prototype;
  5849. var $RegExpStringIterator = function (regexp, string) {
  5850. this._r = regexp;
  5851. this._s = string;
  5852. };
  5853. __webpack_require__(130)($RegExpStringIterator, 'RegExp String', function next() {
  5854. var match = this._r.exec(this._s);
  5855. return { value: match, done: match === null };
  5856. });
  5857. $export($export.P, 'String', {
  5858. matchAll: function matchAll(regexp) {
  5859. defined(this);
  5860. if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');
  5861. var S = String(this);
  5862. var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);
  5863. var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
  5864. rx.lastIndex = toLength(regexp.lastIndex);
  5865. return new $RegExpStringIterator(rx, S);
  5866. }
  5867. });
  5868. /***/ }),
  5869. /* 265 */
  5870. /***/ (function(module, exports, __webpack_require__) {
  5871. __webpack_require__(28)('asyncIterator');
  5872. /***/ }),
  5873. /* 266 */
  5874. /***/ (function(module, exports, __webpack_require__) {
  5875. __webpack_require__(28)('observable');
  5876. /***/ }),
  5877. /* 267 */
  5878. /***/ (function(module, exports, __webpack_require__) {
  5879. // https://github.com/tc39/proposal-object-getownpropertydescriptors
  5880. var $export = __webpack_require__(8);
  5881. var ownKeys = __webpack_require__(250);
  5882. var toIObject = __webpack_require__(32);
  5883. var gOPD = __webpack_require__(50);
  5884. var createProperty = __webpack_require__(164);
  5885. $export($export.S, 'Object', {
  5886. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  5887. var O = toIObject(object);
  5888. var getDesc = gOPD.f;
  5889. var keys = ownKeys(O);
  5890. var result = {};
  5891. var i = 0;
  5892. var key, desc;
  5893. while (keys.length > i) {
  5894. desc = getDesc(O, key = keys[i++]);
  5895. if (desc !== undefined) createProperty(result, key, desc);
  5896. }
  5897. return result;
  5898. }
  5899. });
  5900. /***/ }),
  5901. /* 268 */
  5902. /***/ (function(module, exports, __webpack_require__) {
  5903. // https://github.com/tc39/proposal-object-values-entries
  5904. var $export = __webpack_require__(8);
  5905. var $values = __webpack_require__(269)(false);
  5906. $export($export.S, 'Object', {
  5907. values: function values(it) {
  5908. return $values(it);
  5909. }
  5910. });
  5911. /***/ }),
  5912. /* 269 */
  5913. /***/ (function(module, exports, __webpack_require__) {
  5914. var getKeys = __webpack_require__(30);
  5915. var toIObject = __webpack_require__(32);
  5916. var isEnum = __webpack_require__(43).f;
  5917. module.exports = function (isEntries) {
  5918. return function (it) {
  5919. var O = toIObject(it);
  5920. var keys = getKeys(O);
  5921. var length = keys.length;
  5922. var i = 0;
  5923. var result = [];
  5924. var key;
  5925. while (length > i) if (isEnum.call(O, key = keys[i++])) {
  5926. result.push(isEntries ? [key, O[key]] : O[key]);
  5927. } return result;
  5928. };
  5929. };
  5930. /***/ }),
  5931. /* 270 */
  5932. /***/ (function(module, exports, __webpack_require__) {
  5933. // https://github.com/tc39/proposal-object-values-entries
  5934. var $export = __webpack_require__(8);
  5935. var $entries = __webpack_require__(269)(true);
  5936. $export($export.S, 'Object', {
  5937. entries: function entries(it) {
  5938. return $entries(it);
  5939. }
  5940. });
  5941. /***/ }),
  5942. /* 271 */
  5943. /***/ (function(module, exports, __webpack_require__) {
  5944. 'use strict';
  5945. var $export = __webpack_require__(8);
  5946. var toObject = __webpack_require__(57);
  5947. var aFunction = __webpack_require__(21);
  5948. var $defineProperty = __webpack_require__(11);
  5949. // B.2.2.2 Object.prototype.__defineGetter__(P, getter)
  5950. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  5951. __defineGetter__: function __defineGetter__(P, getter) {
  5952. $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
  5953. }
  5954. });
  5955. /***/ }),
  5956. /* 272 */
  5957. /***/ (function(module, exports, __webpack_require__) {
  5958. 'use strict';
  5959. // Forced replacement prototype accessors methods
  5960. module.exports = __webpack_require__(24) || !__webpack_require__(7)(function () {
  5961. var K = Math.random();
  5962. // In FF throws only define methods
  5963. // eslint-disable-next-line no-undef, no-useless-call
  5964. __defineSetter__.call(null, K, function () { /* empty */ });
  5965. delete __webpack_require__(4)[K];
  5966. });
  5967. /***/ }),
  5968. /* 273 */
  5969. /***/ (function(module, exports, __webpack_require__) {
  5970. 'use strict';
  5971. var $export = __webpack_require__(8);
  5972. var toObject = __webpack_require__(57);
  5973. var aFunction = __webpack_require__(21);
  5974. var $defineProperty = __webpack_require__(11);
  5975. // B.2.2.3 Object.prototype.__defineSetter__(P, setter)
  5976. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  5977. __defineSetter__: function __defineSetter__(P, setter) {
  5978. $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
  5979. }
  5980. });
  5981. /***/ }),
  5982. /* 274 */
  5983. /***/ (function(module, exports, __webpack_require__) {
  5984. 'use strict';
  5985. var $export = __webpack_require__(8);
  5986. var toObject = __webpack_require__(57);
  5987. var toPrimitive = __webpack_require__(16);
  5988. var getPrototypeOf = __webpack_require__(58);
  5989. var getOwnPropertyDescriptor = __webpack_require__(50).f;
  5990. // B.2.2.4 Object.prototype.__lookupGetter__(P)
  5991. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  5992. __lookupGetter__: function __lookupGetter__(P) {
  5993. var O = toObject(this);
  5994. var K = toPrimitive(P, true);
  5995. var D;
  5996. do {
  5997. if (D = getOwnPropertyDescriptor(O, K)) return D.get;
  5998. } while (O = getPrototypeOf(O));
  5999. }
  6000. });
  6001. /***/ }),
  6002. /* 275 */
  6003. /***/ (function(module, exports, __webpack_require__) {
  6004. 'use strict';
  6005. var $export = __webpack_require__(8);
  6006. var toObject = __webpack_require__(57);
  6007. var toPrimitive = __webpack_require__(16);
  6008. var getPrototypeOf = __webpack_require__(58);
  6009. var getOwnPropertyDescriptor = __webpack_require__(50).f;
  6010. // B.2.2.5 Object.prototype.__lookupSetter__(P)
  6011. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  6012. __lookupSetter__: function __lookupSetter__(P) {
  6013. var O = toObject(this);
  6014. var K = toPrimitive(P, true);
  6015. var D;
  6016. do {
  6017. if (D = getOwnPropertyDescriptor(O, K)) return D.set;
  6018. } while (O = getPrototypeOf(O));
  6019. }
  6020. });
  6021. /***/ }),
  6022. /* 276 */
  6023. /***/ (function(module, exports, __webpack_require__) {
  6024. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6025. var $export = __webpack_require__(8);
  6026. $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(277)('Map') });
  6027. /***/ }),
  6028. /* 277 */
  6029. /***/ (function(module, exports, __webpack_require__) {
  6030. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6031. var classof = __webpack_require__(74);
  6032. var from = __webpack_require__(278);
  6033. module.exports = function (NAME) {
  6034. return function toJSON() {
  6035. if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
  6036. return from(this);
  6037. };
  6038. };
  6039. /***/ }),
  6040. /* 278 */
  6041. /***/ (function(module, exports, __webpack_require__) {
  6042. var forOf = __webpack_require__(207);
  6043. module.exports = function (iter, ITERATOR) {
  6044. var result = [];
  6045. forOf(iter, false, result.push, result, ITERATOR);
  6046. return result;
  6047. };
  6048. /***/ }),
  6049. /* 279 */
  6050. /***/ (function(module, exports, __webpack_require__) {
  6051. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6052. var $export = __webpack_require__(8);
  6053. $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(277)('Set') });
  6054. /***/ }),
  6055. /* 280 */
  6056. /***/ (function(module, exports, __webpack_require__) {
  6057. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
  6058. __webpack_require__(281)('Map');
  6059. /***/ }),
  6060. /* 281 */
  6061. /***/ (function(module, exports, __webpack_require__) {
  6062. 'use strict';
  6063. // https://tc39.github.io/proposal-setmap-offrom/
  6064. var $export = __webpack_require__(8);
  6065. module.exports = function (COLLECTION) {
  6066. $export($export.S, COLLECTION, { of: function of() {
  6067. var length = arguments.length;
  6068. var A = new Array(length);
  6069. while (length--) A[length] = arguments[length];
  6070. return new this(A);
  6071. } });
  6072. };
  6073. /***/ }),
  6074. /* 282 */
  6075. /***/ (function(module, exports, __webpack_require__) {
  6076. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
  6077. __webpack_require__(281)('Set');
  6078. /***/ }),
  6079. /* 283 */
  6080. /***/ (function(module, exports, __webpack_require__) {
  6081. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
  6082. __webpack_require__(281)('WeakMap');
  6083. /***/ }),
  6084. /* 284 */
  6085. /***/ (function(module, exports, __webpack_require__) {
  6086. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
  6087. __webpack_require__(281)('WeakSet');
  6088. /***/ }),
  6089. /* 285 */
  6090. /***/ (function(module, exports, __webpack_require__) {
  6091. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
  6092. __webpack_require__(286)('Map');
  6093. /***/ }),
  6094. /* 286 */
  6095. /***/ (function(module, exports, __webpack_require__) {
  6096. 'use strict';
  6097. // https://tc39.github.io/proposal-setmap-offrom/
  6098. var $export = __webpack_require__(8);
  6099. var aFunction = __webpack_require__(21);
  6100. var ctx = __webpack_require__(20);
  6101. var forOf = __webpack_require__(207);
  6102. module.exports = function (COLLECTION) {
  6103. $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
  6104. var mapFn = arguments[1];
  6105. var mapping, A, n, cb;
  6106. aFunction(this);
  6107. mapping = mapFn !== undefined;
  6108. if (mapping) aFunction(mapFn);
  6109. if (source == undefined) return new this();
  6110. A = [];
  6111. if (mapping) {
  6112. n = 0;
  6113. cb = ctx(mapFn, arguments[2], 2);
  6114. forOf(source, false, function (nextItem) {
  6115. A.push(cb(nextItem, n++));
  6116. });
  6117. } else {
  6118. forOf(source, false, A.push, A);
  6119. }
  6120. return new this(A);
  6121. } });
  6122. };
  6123. /***/ }),
  6124. /* 287 */
  6125. /***/ (function(module, exports, __webpack_require__) {
  6126. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
  6127. __webpack_require__(286)('Set');
  6128. /***/ }),
  6129. /* 288 */
  6130. /***/ (function(module, exports, __webpack_require__) {
  6131. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
  6132. __webpack_require__(286)('WeakMap');
  6133. /***/ }),
  6134. /* 289 */
  6135. /***/ (function(module, exports, __webpack_require__) {
  6136. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
  6137. __webpack_require__(286)('WeakSet');
  6138. /***/ }),
  6139. /* 290 */
  6140. /***/ (function(module, exports, __webpack_require__) {
  6141. // https://github.com/tc39/proposal-global
  6142. var $export = __webpack_require__(8);
  6143. $export($export.G, { global: __webpack_require__(4) });
  6144. /***/ }),
  6145. /* 291 */
  6146. /***/ (function(module, exports, __webpack_require__) {
  6147. // https://github.com/tc39/proposal-global
  6148. var $export = __webpack_require__(8);
  6149. $export($export.S, 'System', { global: __webpack_require__(4) });
  6150. /***/ }),
  6151. /* 292 */
  6152. /***/ (function(module, exports, __webpack_require__) {
  6153. // https://github.com/ljharb/proposal-is-error
  6154. var $export = __webpack_require__(8);
  6155. var cof = __webpack_require__(34);
  6156. $export($export.S, 'Error', {
  6157. isError: function isError(it) {
  6158. return cof(it) === 'Error';
  6159. }
  6160. });
  6161. /***/ }),
  6162. /* 293 */
  6163. /***/ (function(module, exports, __webpack_require__) {
  6164. // https://rwaldron.github.io/proposal-math-extensions/
  6165. var $export = __webpack_require__(8);
  6166. $export($export.S, 'Math', {
  6167. clamp: function clamp(x, lower, upper) {
  6168. return Math.min(upper, Math.max(lower, x));
  6169. }
  6170. });
  6171. /***/ }),
  6172. /* 294 */
  6173. /***/ (function(module, exports, __webpack_require__) {
  6174. // https://rwaldron.github.io/proposal-math-extensions/
  6175. var $export = __webpack_require__(8);
  6176. $export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });
  6177. /***/ }),
  6178. /* 295 */
  6179. /***/ (function(module, exports, __webpack_require__) {
  6180. // https://rwaldron.github.io/proposal-math-extensions/
  6181. var $export = __webpack_require__(8);
  6182. var RAD_PER_DEG = 180 / Math.PI;
  6183. $export($export.S, 'Math', {
  6184. degrees: function degrees(radians) {
  6185. return radians * RAD_PER_DEG;
  6186. }
  6187. });
  6188. /***/ }),
  6189. /* 296 */
  6190. /***/ (function(module, exports, __webpack_require__) {
  6191. // https://rwaldron.github.io/proposal-math-extensions/
  6192. var $export = __webpack_require__(8);
  6193. var scale = __webpack_require__(297);
  6194. var fround = __webpack_require__(113);
  6195. $export($export.S, 'Math', {
  6196. fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {
  6197. return fround(scale(x, inLow, inHigh, outLow, outHigh));
  6198. }
  6199. });
  6200. /***/ }),
  6201. /* 297 */
  6202. /***/ (function(module, exports) {
  6203. // https://rwaldron.github.io/proposal-math-extensions/
  6204. module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
  6205. if (
  6206. arguments.length === 0
  6207. // eslint-disable-next-line no-self-compare
  6208. || x != x
  6209. // eslint-disable-next-line no-self-compare
  6210. || inLow != inLow
  6211. // eslint-disable-next-line no-self-compare
  6212. || inHigh != inHigh
  6213. // eslint-disable-next-line no-self-compare
  6214. || outLow != outLow
  6215. // eslint-disable-next-line no-self-compare
  6216. || outHigh != outHigh
  6217. ) return NaN;
  6218. if (x === Infinity || x === -Infinity) return x;
  6219. return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
  6220. };
  6221. /***/ }),
  6222. /* 298 */
  6223. /***/ (function(module, exports, __webpack_require__) {
  6224. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6225. var $export = __webpack_require__(8);
  6226. $export($export.S, 'Math', {
  6227. iaddh: function iaddh(x0, x1, y0, y1) {
  6228. var $x0 = x0 >>> 0;
  6229. var $x1 = x1 >>> 0;
  6230. var $y0 = y0 >>> 0;
  6231. return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
  6232. }
  6233. });
  6234. /***/ }),
  6235. /* 299 */
  6236. /***/ (function(module, exports, __webpack_require__) {
  6237. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6238. var $export = __webpack_require__(8);
  6239. $export($export.S, 'Math', {
  6240. isubh: function isubh(x0, x1, y0, y1) {
  6241. var $x0 = x0 >>> 0;
  6242. var $x1 = x1 >>> 0;
  6243. var $y0 = y0 >>> 0;
  6244. return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
  6245. }
  6246. });
  6247. /***/ }),
  6248. /* 300 */
  6249. /***/ (function(module, exports, __webpack_require__) {
  6250. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6251. var $export = __webpack_require__(8);
  6252. $export($export.S, 'Math', {
  6253. imulh: function imulh(u, v) {
  6254. var UINT16 = 0xffff;
  6255. var $u = +u;
  6256. var $v = +v;
  6257. var u0 = $u & UINT16;
  6258. var v0 = $v & UINT16;
  6259. var u1 = $u >> 16;
  6260. var v1 = $v >> 16;
  6261. var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
  6262. return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
  6263. }
  6264. });
  6265. /***/ }),
  6266. /* 301 */
  6267. /***/ (function(module, exports, __webpack_require__) {
  6268. // https://rwaldron.github.io/proposal-math-extensions/
  6269. var $export = __webpack_require__(8);
  6270. $export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });
  6271. /***/ }),
  6272. /* 302 */
  6273. /***/ (function(module, exports, __webpack_require__) {
  6274. // https://rwaldron.github.io/proposal-math-extensions/
  6275. var $export = __webpack_require__(8);
  6276. var DEG_PER_RAD = Math.PI / 180;
  6277. $export($export.S, 'Math', {
  6278. radians: function radians(degrees) {
  6279. return degrees * DEG_PER_RAD;
  6280. }
  6281. });
  6282. /***/ }),
  6283. /* 303 */
  6284. /***/ (function(module, exports, __webpack_require__) {
  6285. // https://rwaldron.github.io/proposal-math-extensions/
  6286. var $export = __webpack_require__(8);
  6287. $export($export.S, 'Math', { scale: __webpack_require__(297) });
  6288. /***/ }),
  6289. /* 304 */
  6290. /***/ (function(module, exports, __webpack_require__) {
  6291. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6292. var $export = __webpack_require__(8);
  6293. $export($export.S, 'Math', {
  6294. umulh: function umulh(u, v) {
  6295. var UINT16 = 0xffff;
  6296. var $u = +u;
  6297. var $v = +v;
  6298. var u0 = $u & UINT16;
  6299. var v0 = $v & UINT16;
  6300. var u1 = $u >>> 16;
  6301. var v1 = $v >>> 16;
  6302. var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
  6303. return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
  6304. }
  6305. });
  6306. /***/ }),
  6307. /* 305 */
  6308. /***/ (function(module, exports, __webpack_require__) {
  6309. // http://jfbastien.github.io/papers/Math.signbit.html
  6310. var $export = __webpack_require__(8);
  6311. $export($export.S, 'Math', { signbit: function signbit(x) {
  6312. // eslint-disable-next-line no-self-compare
  6313. return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
  6314. } });
  6315. /***/ }),
  6316. /* 306 */
  6317. /***/ (function(module, exports, __webpack_require__) {
  6318. // https://github.com/tc39/proposal-promise-finally
  6319. 'use strict';
  6320. var $export = __webpack_require__(8);
  6321. var core = __webpack_require__(9);
  6322. var global = __webpack_require__(4);
  6323. var speciesConstructor = __webpack_require__(208);
  6324. var promiseResolve = __webpack_require__(214);
  6325. $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  6326. var C = speciesConstructor(this, core.Promise || global.Promise);
  6327. var isFunction = typeof onFinally == 'function';
  6328. return this.then(
  6329. isFunction ? function (x) {
  6330. return promiseResolve(C, onFinally()).then(function () { return x; });
  6331. } : onFinally,
  6332. isFunction ? function (e) {
  6333. return promiseResolve(C, onFinally()).then(function () { throw e; });
  6334. } : onFinally
  6335. );
  6336. } });
  6337. /***/ }),
  6338. /* 307 */
  6339. /***/ (function(module, exports, __webpack_require__) {
  6340. 'use strict';
  6341. // https://github.com/tc39/proposal-promise-try
  6342. var $export = __webpack_require__(8);
  6343. var newPromiseCapability = __webpack_require__(211);
  6344. var perform = __webpack_require__(212);
  6345. $export($export.S, 'Promise', { 'try': function (callbackfn) {
  6346. var promiseCapability = newPromiseCapability.f(this);
  6347. var result = perform(callbackfn);
  6348. (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  6349. return promiseCapability.promise;
  6350. } });
  6351. /***/ }),
  6352. /* 308 */
  6353. /***/ (function(module, exports, __webpack_require__) {
  6354. var metadata = __webpack_require__(309);
  6355. var anObject = __webpack_require__(12);
  6356. var toMetaKey = metadata.key;
  6357. var ordinaryDefineOwnMetadata = metadata.set;
  6358. metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
  6359. ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
  6360. } });
  6361. /***/ }),
  6362. /* 309 */
  6363. /***/ (function(module, exports, __webpack_require__) {
  6364. var Map = __webpack_require__(216);
  6365. var $export = __webpack_require__(8);
  6366. var shared = __webpack_require__(23)('metadata');
  6367. var store = shared.store || (shared.store = new (__webpack_require__(221))());
  6368. var getOrCreateMetadataMap = function (target, targetKey, create) {
  6369. var targetMetadata = store.get(target);
  6370. if (!targetMetadata) {
  6371. if (!create) return undefined;
  6372. store.set(target, targetMetadata = new Map());
  6373. }
  6374. var keyMetadata = targetMetadata.get(targetKey);
  6375. if (!keyMetadata) {
  6376. if (!create) return undefined;
  6377. targetMetadata.set(targetKey, keyMetadata = new Map());
  6378. } return keyMetadata;
  6379. };
  6380. var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
  6381. var metadataMap = getOrCreateMetadataMap(O, P, false);
  6382. return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
  6383. };
  6384. var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
  6385. var metadataMap = getOrCreateMetadataMap(O, P, false);
  6386. return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
  6387. };
  6388. var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
  6389. getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
  6390. };
  6391. var ordinaryOwnMetadataKeys = function (target, targetKey) {
  6392. var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
  6393. var keys = [];
  6394. if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
  6395. return keys;
  6396. };
  6397. var toMetaKey = function (it) {
  6398. return it === undefined || typeof it == 'symbol' ? it : String(it);
  6399. };
  6400. var exp = function (O) {
  6401. $export($export.S, 'Reflect', O);
  6402. };
  6403. module.exports = {
  6404. store: store,
  6405. map: getOrCreateMetadataMap,
  6406. has: ordinaryHasOwnMetadata,
  6407. get: ordinaryGetOwnMetadata,
  6408. set: ordinaryDefineOwnMetadata,
  6409. keys: ordinaryOwnMetadataKeys,
  6410. key: toMetaKey,
  6411. exp: exp
  6412. };
  6413. /***/ }),
  6414. /* 310 */
  6415. /***/ (function(module, exports, __webpack_require__) {
  6416. var metadata = __webpack_require__(309);
  6417. var anObject = __webpack_require__(12);
  6418. var toMetaKey = metadata.key;
  6419. var getOrCreateMetadataMap = metadata.map;
  6420. var store = metadata.store;
  6421. metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
  6422. var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
  6423. var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
  6424. if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;
  6425. if (metadataMap.size) return true;
  6426. var targetMetadata = store.get(target);
  6427. targetMetadata['delete'](targetKey);
  6428. return !!targetMetadata.size || store['delete'](target);
  6429. } });
  6430. /***/ }),
  6431. /* 311 */
  6432. /***/ (function(module, exports, __webpack_require__) {
  6433. var metadata = __webpack_require__(309);
  6434. var anObject = __webpack_require__(12);
  6435. var getPrototypeOf = __webpack_require__(58);
  6436. var ordinaryHasOwnMetadata = metadata.has;
  6437. var ordinaryGetOwnMetadata = metadata.get;
  6438. var toMetaKey = metadata.key;
  6439. var ordinaryGetMetadata = function (MetadataKey, O, P) {
  6440. var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  6441. if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
  6442. var parent = getPrototypeOf(O);
  6443. return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
  6444. };
  6445. metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
  6446. return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6447. } });
  6448. /***/ }),
  6449. /* 312 */
  6450. /***/ (function(module, exports, __webpack_require__) {
  6451. var Set = __webpack_require__(220);
  6452. var from = __webpack_require__(278);
  6453. var metadata = __webpack_require__(309);
  6454. var anObject = __webpack_require__(12);
  6455. var getPrototypeOf = __webpack_require__(58);
  6456. var ordinaryOwnMetadataKeys = metadata.keys;
  6457. var toMetaKey = metadata.key;
  6458. var ordinaryMetadataKeys = function (O, P) {
  6459. var oKeys = ordinaryOwnMetadataKeys(O, P);
  6460. var parent = getPrototypeOf(O);
  6461. if (parent === null) return oKeys;
  6462. var pKeys = ordinaryMetadataKeys(parent, P);
  6463. return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
  6464. };
  6465. metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
  6466. return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
  6467. } });
  6468. /***/ }),
  6469. /* 313 */
  6470. /***/ (function(module, exports, __webpack_require__) {
  6471. var metadata = __webpack_require__(309);
  6472. var anObject = __webpack_require__(12);
  6473. var ordinaryGetOwnMetadata = metadata.get;
  6474. var toMetaKey = metadata.key;
  6475. metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
  6476. return ordinaryGetOwnMetadata(metadataKey, anObject(target)
  6477. , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6478. } });
  6479. /***/ }),
  6480. /* 314 */
  6481. /***/ (function(module, exports, __webpack_require__) {
  6482. var metadata = __webpack_require__(309);
  6483. var anObject = __webpack_require__(12);
  6484. var ordinaryOwnMetadataKeys = metadata.keys;
  6485. var toMetaKey = metadata.key;
  6486. metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
  6487. return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
  6488. } });
  6489. /***/ }),
  6490. /* 315 */
  6491. /***/ (function(module, exports, __webpack_require__) {
  6492. var metadata = __webpack_require__(309);
  6493. var anObject = __webpack_require__(12);
  6494. var getPrototypeOf = __webpack_require__(58);
  6495. var ordinaryHasOwnMetadata = metadata.has;
  6496. var toMetaKey = metadata.key;
  6497. var ordinaryHasMetadata = function (MetadataKey, O, P) {
  6498. var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  6499. if (hasOwn) return true;
  6500. var parent = getPrototypeOf(O);
  6501. return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
  6502. };
  6503. metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
  6504. return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6505. } });
  6506. /***/ }),
  6507. /* 316 */
  6508. /***/ (function(module, exports, __webpack_require__) {
  6509. var metadata = __webpack_require__(309);
  6510. var anObject = __webpack_require__(12);
  6511. var ordinaryHasOwnMetadata = metadata.has;
  6512. var toMetaKey = metadata.key;
  6513. metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
  6514. return ordinaryHasOwnMetadata(metadataKey, anObject(target)
  6515. , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6516. } });
  6517. /***/ }),
  6518. /* 317 */
  6519. /***/ (function(module, exports, __webpack_require__) {
  6520. var $metadata = __webpack_require__(309);
  6521. var anObject = __webpack_require__(12);
  6522. var aFunction = __webpack_require__(21);
  6523. var toMetaKey = $metadata.key;
  6524. var ordinaryDefineOwnMetadata = $metadata.set;
  6525. $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
  6526. return function decorator(target, targetKey) {
  6527. ordinaryDefineOwnMetadata(
  6528. metadataKey, metadataValue,
  6529. (targetKey !== undefined ? anObject : aFunction)(target),
  6530. toMetaKey(targetKey)
  6531. );
  6532. };
  6533. } });
  6534. /***/ }),
  6535. /* 318 */
  6536. /***/ (function(module, exports, __webpack_require__) {
  6537. // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
  6538. var $export = __webpack_require__(8);
  6539. var microtask = __webpack_require__(210)();
  6540. var process = __webpack_require__(4).process;
  6541. var isNode = __webpack_require__(34)(process) == 'process';
  6542. $export($export.G, {
  6543. asap: function asap(fn) {
  6544. var domain = isNode && process.domain;
  6545. microtask(domain ? domain.bind(fn) : fn);
  6546. }
  6547. });
  6548. /***/ }),
  6549. /* 319 */
  6550. /***/ (function(module, exports, __webpack_require__) {
  6551. 'use strict';
  6552. // https://github.com/zenparsing/es-observable
  6553. var $export = __webpack_require__(8);
  6554. var global = __webpack_require__(4);
  6555. var core = __webpack_require__(9);
  6556. var microtask = __webpack_require__(210)();
  6557. var OBSERVABLE = __webpack_require__(26)('observable');
  6558. var aFunction = __webpack_require__(21);
  6559. var anObject = __webpack_require__(12);
  6560. var anInstance = __webpack_require__(206);
  6561. var redefineAll = __webpack_require__(215);
  6562. var hide = __webpack_require__(10);
  6563. var forOf = __webpack_require__(207);
  6564. var RETURN = forOf.RETURN;
  6565. var getMethod = function (fn) {
  6566. return fn == null ? undefined : aFunction(fn);
  6567. };
  6568. var cleanupSubscription = function (subscription) {
  6569. var cleanup = subscription._c;
  6570. if (cleanup) {
  6571. subscription._c = undefined;
  6572. cleanup();
  6573. }
  6574. };
  6575. var subscriptionClosed = function (subscription) {
  6576. return subscription._o === undefined;
  6577. };
  6578. var closeSubscription = function (subscription) {
  6579. if (!subscriptionClosed(subscription)) {
  6580. subscription._o = undefined;
  6581. cleanupSubscription(subscription);
  6582. }
  6583. };
  6584. var Subscription = function (observer, subscriber) {
  6585. anObject(observer);
  6586. this._c = undefined;
  6587. this._o = observer;
  6588. observer = new SubscriptionObserver(this);
  6589. try {
  6590. var cleanup = subscriber(observer);
  6591. var subscription = cleanup;
  6592. if (cleanup != null) {
  6593. if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };
  6594. else aFunction(cleanup);
  6595. this._c = cleanup;
  6596. }
  6597. } catch (e) {
  6598. observer.error(e);
  6599. return;
  6600. } if (subscriptionClosed(this)) cleanupSubscription(this);
  6601. };
  6602. Subscription.prototype = redefineAll({}, {
  6603. unsubscribe: function unsubscribe() { closeSubscription(this); }
  6604. });
  6605. var SubscriptionObserver = function (subscription) {
  6606. this._s = subscription;
  6607. };
  6608. SubscriptionObserver.prototype = redefineAll({}, {
  6609. next: function next(value) {
  6610. var subscription = this._s;
  6611. if (!subscriptionClosed(subscription)) {
  6612. var observer = subscription._o;
  6613. try {
  6614. var m = getMethod(observer.next);
  6615. if (m) return m.call(observer, value);
  6616. } catch (e) {
  6617. try {
  6618. closeSubscription(subscription);
  6619. } finally {
  6620. throw e;
  6621. }
  6622. }
  6623. }
  6624. },
  6625. error: function error(value) {
  6626. var subscription = this._s;
  6627. if (subscriptionClosed(subscription)) throw value;
  6628. var observer = subscription._o;
  6629. subscription._o = undefined;
  6630. try {
  6631. var m = getMethod(observer.error);
  6632. if (!m) throw value;
  6633. value = m.call(observer, value);
  6634. } catch (e) {
  6635. try {
  6636. cleanupSubscription(subscription);
  6637. } finally {
  6638. throw e;
  6639. }
  6640. } cleanupSubscription(subscription);
  6641. return value;
  6642. },
  6643. complete: function complete(value) {
  6644. var subscription = this._s;
  6645. if (!subscriptionClosed(subscription)) {
  6646. var observer = subscription._o;
  6647. subscription._o = undefined;
  6648. try {
  6649. var m = getMethod(observer.complete);
  6650. value = m ? m.call(observer, value) : undefined;
  6651. } catch (e) {
  6652. try {
  6653. cleanupSubscription(subscription);
  6654. } finally {
  6655. throw e;
  6656. }
  6657. } cleanupSubscription(subscription);
  6658. return value;
  6659. }
  6660. }
  6661. });
  6662. var $Observable = function Observable(subscriber) {
  6663. anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
  6664. };
  6665. redefineAll($Observable.prototype, {
  6666. subscribe: function subscribe(observer) {
  6667. return new Subscription(observer, this._f);
  6668. },
  6669. forEach: function forEach(fn) {
  6670. var that = this;
  6671. return new (core.Promise || global.Promise)(function (resolve, reject) {
  6672. aFunction(fn);
  6673. var subscription = that.subscribe({
  6674. next: function (value) {
  6675. try {
  6676. return fn(value);
  6677. } catch (e) {
  6678. reject(e);
  6679. subscription.unsubscribe();
  6680. }
  6681. },
  6682. error: reject,
  6683. complete: resolve
  6684. });
  6685. });
  6686. }
  6687. });
  6688. redefineAll($Observable, {
  6689. from: function from(x) {
  6690. var C = typeof this === 'function' ? this : $Observable;
  6691. var method = getMethod(anObject(x)[OBSERVABLE]);
  6692. if (method) {
  6693. var observable = anObject(method.call(x));
  6694. return observable.constructor === C ? observable : new C(function (observer) {
  6695. return observable.subscribe(observer);
  6696. });
  6697. }
  6698. return new C(function (observer) {
  6699. var done = false;
  6700. microtask(function () {
  6701. if (!done) {
  6702. try {
  6703. if (forOf(x, false, function (it) {
  6704. observer.next(it);
  6705. if (done) return RETURN;
  6706. }) === RETURN) return;
  6707. } catch (e) {
  6708. if (done) throw e;
  6709. observer.error(e);
  6710. return;
  6711. } observer.complete();
  6712. }
  6713. });
  6714. return function () { done = true; };
  6715. });
  6716. },
  6717. of: function of() {
  6718. for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];
  6719. return new (typeof this === 'function' ? this : $Observable)(function (observer) {
  6720. var done = false;
  6721. microtask(function () {
  6722. if (!done) {
  6723. for (var j = 0; j < items.length; ++j) {
  6724. observer.next(items[j]);
  6725. if (done) return;
  6726. } observer.complete();
  6727. }
  6728. });
  6729. return function () { done = true; };
  6730. });
  6731. }
  6732. });
  6733. hide($Observable.prototype, OBSERVABLE, function () { return this; });
  6734. $export($export.G, { Observable: $Observable });
  6735. __webpack_require__(193)('Observable');
  6736. /***/ }),
  6737. /* 320 */
  6738. /***/ (function(module, exports, __webpack_require__) {
  6739. // ie9- setTimeout & setInterval additional parameters fix
  6740. var global = __webpack_require__(4);
  6741. var $export = __webpack_require__(8);
  6742. var userAgent = __webpack_require__(213);
  6743. var slice = [].slice;
  6744. var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
  6745. var wrap = function (set) {
  6746. return function (fn, time /* , ...args */) {
  6747. var boundArgs = arguments.length > 2;
  6748. var args = boundArgs ? slice.call(arguments, 2) : false;
  6749. return set(boundArgs ? function () {
  6750. // eslint-disable-next-line no-new-func
  6751. (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
  6752. } : fn, time);
  6753. };
  6754. };
  6755. $export($export.G + $export.B + $export.F * MSIE, {
  6756. setTimeout: wrap(global.setTimeout),
  6757. setInterval: wrap(global.setInterval)
  6758. });
  6759. /***/ }),
  6760. /* 321 */
  6761. /***/ (function(module, exports, __webpack_require__) {
  6762. var $export = __webpack_require__(8);
  6763. var $task = __webpack_require__(209);
  6764. $export($export.G + $export.B, {
  6765. setImmediate: $task.set,
  6766. clearImmediate: $task.clear
  6767. });
  6768. /***/ }),
  6769. /* 322 */
  6770. /***/ (function(module, exports, __webpack_require__) {
  6771. var $iterators = __webpack_require__(194);
  6772. var getKeys = __webpack_require__(30);
  6773. var redefine = __webpack_require__(18);
  6774. var global = __webpack_require__(4);
  6775. var hide = __webpack_require__(10);
  6776. var Iterators = __webpack_require__(129);
  6777. var wks = __webpack_require__(26);
  6778. var ITERATOR = wks('iterator');
  6779. var TO_STRING_TAG = wks('toStringTag');
  6780. var ArrayValues = Iterators.Array;
  6781. var DOMIterables = {
  6782. CSSRuleList: true, // TODO: Not spec compliant, should be false.
  6783. CSSStyleDeclaration: false,
  6784. CSSValueList: false,
  6785. ClientRectList: false,
  6786. DOMRectList: false,
  6787. DOMStringList: false,
  6788. DOMTokenList: true,
  6789. DataTransferItemList: false,
  6790. FileList: false,
  6791. HTMLAllCollection: false,
  6792. HTMLCollection: false,
  6793. HTMLFormElement: false,
  6794. HTMLSelectElement: false,
  6795. MediaList: true, // TODO: Not spec compliant, should be false.
  6796. MimeTypeArray: false,
  6797. NamedNodeMap: false,
  6798. NodeList: true,
  6799. PaintRequestList: false,
  6800. Plugin: false,
  6801. PluginArray: false,
  6802. SVGLengthList: false,
  6803. SVGNumberList: false,
  6804. SVGPathSegList: false,
  6805. SVGPointList: false,
  6806. SVGStringList: false,
  6807. SVGTransformList: false,
  6808. SourceBufferList: false,
  6809. StyleSheetList: true, // TODO: Not spec compliant, should be false.
  6810. TextTrackCueList: false,
  6811. TextTrackList: false,
  6812. TouchList: false
  6813. };
  6814. for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  6815. var NAME = collections[i];
  6816. var explicit = DOMIterables[NAME];
  6817. var Collection = global[NAME];
  6818. var proto = Collection && Collection.prototype;
  6819. var key;
  6820. if (proto) {
  6821. if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
  6822. if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  6823. Iterators[NAME] = ArrayValues;
  6824. if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
  6825. }
  6826. }
  6827. /***/ }),
  6828. /* 323 */
  6829. /***/ (function(module, exports) {
  6830. /* WEBPACK VAR INJECTION */(function(global) {/**
  6831. * Copyright (c) 2014, Facebook, Inc.
  6832. * All rights reserved.
  6833. *
  6834. * This source code is licensed under the BSD-style license found in the
  6835. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  6836. * additional grant of patent rights can be found in the PATENTS file in
  6837. * the same directory.
  6838. */
  6839. !(function(global) {
  6840. "use strict";
  6841. var Op = Object.prototype;
  6842. var hasOwn = Op.hasOwnProperty;
  6843. var undefined; // More compressible than void 0.
  6844. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  6845. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  6846. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  6847. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  6848. var inModule = typeof module === "object";
  6849. var runtime = global.regeneratorRuntime;
  6850. if (runtime) {
  6851. if (inModule) {
  6852. // If regeneratorRuntime is defined globally and we're in a module,
  6853. // make the exports object identical to regeneratorRuntime.
  6854. module.exports = runtime;
  6855. }
  6856. // Don't bother evaluating the rest of this file if the runtime was
  6857. // already defined globally.
  6858. return;
  6859. }
  6860. // Define the runtime globally (as expected by generated code) as either
  6861. // module.exports (if we're in a module) or a new, empty object.
  6862. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  6863. function wrap(innerFn, outerFn, self, tryLocsList) {
  6864. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  6865. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  6866. var generator = Object.create(protoGenerator.prototype);
  6867. var context = new Context(tryLocsList || []);
  6868. // The ._invoke method unifies the implementations of the .next,
  6869. // .throw, and .return methods.
  6870. generator._invoke = makeInvokeMethod(innerFn, self, context);
  6871. return generator;
  6872. }
  6873. runtime.wrap = wrap;
  6874. // Try/catch helper to minimize deoptimizations. Returns a completion
  6875. // record like context.tryEntries[i].completion. This interface could
  6876. // have been (and was previously) designed to take a closure to be
  6877. // invoked without arguments, but in all the cases we care about we
  6878. // already have an existing method we want to call, so there's no need
  6879. // to create a new function object. We can even get away with assuming
  6880. // the method takes exactly one argument, since that happens to be true
  6881. // in every case, so we don't have to touch the arguments object. The
  6882. // only additional allocation required is the completion record, which
  6883. // has a stable shape and so hopefully should be cheap to allocate.
  6884. function tryCatch(fn, obj, arg) {
  6885. try {
  6886. return { type: "normal", arg: fn.call(obj, arg) };
  6887. } catch (err) {
  6888. return { type: "throw", arg: err };
  6889. }
  6890. }
  6891. var GenStateSuspendedStart = "suspendedStart";
  6892. var GenStateSuspendedYield = "suspendedYield";
  6893. var GenStateExecuting = "executing";
  6894. var GenStateCompleted = "completed";
  6895. // Returning this object from the innerFn has the same effect as
  6896. // breaking out of the dispatch switch statement.
  6897. var ContinueSentinel = {};
  6898. // Dummy constructor functions that we use as the .constructor and
  6899. // .constructor.prototype properties for functions that return Generator
  6900. // objects. For full spec compliance, you may wish to configure your
  6901. // minifier not to mangle the names of these two functions.
  6902. function Generator() {}
  6903. function GeneratorFunction() {}
  6904. function GeneratorFunctionPrototype() {}
  6905. // This is a polyfill for %IteratorPrototype% for environments that
  6906. // don't natively support it.
  6907. var IteratorPrototype = {};
  6908. IteratorPrototype[iteratorSymbol] = function () {
  6909. return this;
  6910. };
  6911. var getProto = Object.getPrototypeOf;
  6912. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  6913. if (NativeIteratorPrototype &&
  6914. NativeIteratorPrototype !== Op &&
  6915. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  6916. // This environment has a native %IteratorPrototype%; use it instead
  6917. // of the polyfill.
  6918. IteratorPrototype = NativeIteratorPrototype;
  6919. }
  6920. var Gp = GeneratorFunctionPrototype.prototype =
  6921. Generator.prototype = Object.create(IteratorPrototype);
  6922. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  6923. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  6924. GeneratorFunctionPrototype[toStringTagSymbol] =
  6925. GeneratorFunction.displayName = "GeneratorFunction";
  6926. // Helper for defining the .next, .throw, and .return methods of the
  6927. // Iterator interface in terms of a single ._invoke method.
  6928. function defineIteratorMethods(prototype) {
  6929. ["next", "throw", "return"].forEach(function(method) {
  6930. prototype[method] = function(arg) {
  6931. return this._invoke(method, arg);
  6932. };
  6933. });
  6934. }
  6935. runtime.isGeneratorFunction = function(genFun) {
  6936. var ctor = typeof genFun === "function" && genFun.constructor;
  6937. return ctor
  6938. ? ctor === GeneratorFunction ||
  6939. // For the native GeneratorFunction constructor, the best we can
  6940. // do is to check its .name property.
  6941. (ctor.displayName || ctor.name) === "GeneratorFunction"
  6942. : false;
  6943. };
  6944. runtime.mark = function(genFun) {
  6945. if (Object.setPrototypeOf) {
  6946. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  6947. } else {
  6948. genFun.__proto__ = GeneratorFunctionPrototype;
  6949. if (!(toStringTagSymbol in genFun)) {
  6950. genFun[toStringTagSymbol] = "GeneratorFunction";
  6951. }
  6952. }
  6953. genFun.prototype = Object.create(Gp);
  6954. return genFun;
  6955. };
  6956. // Within the body of any async function, `await x` is transformed to
  6957. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  6958. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  6959. // meant to be awaited.
  6960. runtime.awrap = function(arg) {
  6961. return { __await: arg };
  6962. };
  6963. function AsyncIterator(generator) {
  6964. function invoke(method, arg, resolve, reject) {
  6965. var record = tryCatch(generator[method], generator, arg);
  6966. if (record.type === "throw") {
  6967. reject(record.arg);
  6968. } else {
  6969. var result = record.arg;
  6970. var value = result.value;
  6971. if (value &&
  6972. typeof value === "object" &&
  6973. hasOwn.call(value, "__await")) {
  6974. return Promise.resolve(value.__await).then(function(value) {
  6975. invoke("next", value, resolve, reject);
  6976. }, function(err) {
  6977. invoke("throw", err, resolve, reject);
  6978. });
  6979. }
  6980. return Promise.resolve(value).then(function(unwrapped) {
  6981. // When a yielded Promise is resolved, its final value becomes
  6982. // the .value of the Promise<{value,done}> result for the
  6983. // current iteration. If the Promise is rejected, however, the
  6984. // result for this iteration will be rejected with the same
  6985. // reason. Note that rejections of yielded Promises are not
  6986. // thrown back into the generator function, as is the case
  6987. // when an awaited Promise is rejected. This difference in
  6988. // behavior between yield and await is important, because it
  6989. // allows the consumer to decide what to do with the yielded
  6990. // rejection (swallow it and continue, manually .throw it back
  6991. // into the generator, abandon iteration, whatever). With
  6992. // await, by contrast, there is no opportunity to examine the
  6993. // rejection reason outside the generator function, so the
  6994. // only option is to throw it from the await expression, and
  6995. // let the generator function handle the exception.
  6996. result.value = unwrapped;
  6997. resolve(result);
  6998. }, reject);
  6999. }
  7000. }
  7001. if (typeof global.process === "object" && global.process.domain) {
  7002. invoke = global.process.domain.bind(invoke);
  7003. }
  7004. var previousPromise;
  7005. function enqueue(method, arg) {
  7006. function callInvokeWithMethodAndArg() {
  7007. return new Promise(function(resolve, reject) {
  7008. invoke(method, arg, resolve, reject);
  7009. });
  7010. }
  7011. return previousPromise =
  7012. // If enqueue has been called before, then we want to wait until
  7013. // all previous Promises have been resolved before calling invoke,
  7014. // so that results are always delivered in the correct order. If
  7015. // enqueue has not been called before, then it is important to
  7016. // call invoke immediately, without waiting on a callback to fire,
  7017. // so that the async generator function has the opportunity to do
  7018. // any necessary setup in a predictable way. This predictability
  7019. // is why the Promise constructor synchronously invokes its
  7020. // executor callback, and why async functions synchronously
  7021. // execute code before the first await. Since we implement simple
  7022. // async functions in terms of async generators, it is especially
  7023. // important to get this right, even though it requires care.
  7024. previousPromise ? previousPromise.then(
  7025. callInvokeWithMethodAndArg,
  7026. // Avoid propagating failures to Promises returned by later
  7027. // invocations of the iterator.
  7028. callInvokeWithMethodAndArg
  7029. ) : callInvokeWithMethodAndArg();
  7030. }
  7031. // Define the unified helper method that is used to implement .next,
  7032. // .throw, and .return (see defineIteratorMethods).
  7033. this._invoke = enqueue;
  7034. }
  7035. defineIteratorMethods(AsyncIterator.prototype);
  7036. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  7037. return this;
  7038. };
  7039. runtime.AsyncIterator = AsyncIterator;
  7040. // Note that simple async functions are implemented on top of
  7041. // AsyncIterator objects; they just return a Promise for the value of
  7042. // the final result produced by the iterator.
  7043. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  7044. var iter = new AsyncIterator(
  7045. wrap(innerFn, outerFn, self, tryLocsList)
  7046. );
  7047. return runtime.isGeneratorFunction(outerFn)
  7048. ? iter // If outerFn is a generator, return the full iterator.
  7049. : iter.next().then(function(result) {
  7050. return result.done ? result.value : iter.next();
  7051. });
  7052. };
  7053. function makeInvokeMethod(innerFn, self, context) {
  7054. var state = GenStateSuspendedStart;
  7055. return function invoke(method, arg) {
  7056. if (state === GenStateExecuting) {
  7057. throw new Error("Generator is already running");
  7058. }
  7059. if (state === GenStateCompleted) {
  7060. if (method === "throw") {
  7061. throw arg;
  7062. }
  7063. // Be forgiving, per 25.3.3.3.3 of the spec:
  7064. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  7065. return doneResult();
  7066. }
  7067. context.method = method;
  7068. context.arg = arg;
  7069. while (true) {
  7070. var delegate = context.delegate;
  7071. if (delegate) {
  7072. var delegateResult = maybeInvokeDelegate(delegate, context);
  7073. if (delegateResult) {
  7074. if (delegateResult === ContinueSentinel) continue;
  7075. return delegateResult;
  7076. }
  7077. }
  7078. if (context.method === "next") {
  7079. // Setting context._sent for legacy support of Babel's
  7080. // function.sent implementation.
  7081. context.sent = context._sent = context.arg;
  7082. } else if (context.method === "throw") {
  7083. if (state === GenStateSuspendedStart) {
  7084. state = GenStateCompleted;
  7085. throw context.arg;
  7086. }
  7087. context.dispatchException(context.arg);
  7088. } else if (context.method === "return") {
  7089. context.abrupt("return", context.arg);
  7090. }
  7091. state = GenStateExecuting;
  7092. var record = tryCatch(innerFn, self, context);
  7093. if (record.type === "normal") {
  7094. // If an exception is thrown from innerFn, we leave state ===
  7095. // GenStateExecuting and loop back for another invocation.
  7096. state = context.done
  7097. ? GenStateCompleted
  7098. : GenStateSuspendedYield;
  7099. if (record.arg === ContinueSentinel) {
  7100. continue;
  7101. }
  7102. return {
  7103. value: record.arg,
  7104. done: context.done
  7105. };
  7106. } else if (record.type === "throw") {
  7107. state = GenStateCompleted;
  7108. // Dispatch the exception by looping back around to the
  7109. // context.dispatchException(context.arg) call above.
  7110. context.method = "throw";
  7111. context.arg = record.arg;
  7112. }
  7113. }
  7114. };
  7115. }
  7116. // Call delegate.iterator[context.method](context.arg) and handle the
  7117. // result, either by returning a { value, done } result from the
  7118. // delegate iterator, or by modifying context.method and context.arg,
  7119. // setting context.delegate to null, and returning the ContinueSentinel.
  7120. function maybeInvokeDelegate(delegate, context) {
  7121. var method = delegate.iterator[context.method];
  7122. if (method === undefined) {
  7123. // A .throw or .return when the delegate iterator has no .throw
  7124. // method always terminates the yield* loop.
  7125. context.delegate = null;
  7126. if (context.method === "throw") {
  7127. if (delegate.iterator.return) {
  7128. // If the delegate iterator has a return method, give it a
  7129. // chance to clean up.
  7130. context.method = "return";
  7131. context.arg = undefined;
  7132. maybeInvokeDelegate(delegate, context);
  7133. if (context.method === "throw") {
  7134. // If maybeInvokeDelegate(context) changed context.method from
  7135. // "return" to "throw", let that override the TypeError below.
  7136. return ContinueSentinel;
  7137. }
  7138. }
  7139. context.method = "throw";
  7140. context.arg = new TypeError(
  7141. "The iterator does not provide a 'throw' method");
  7142. }
  7143. return ContinueSentinel;
  7144. }
  7145. var record = tryCatch(method, delegate.iterator, context.arg);
  7146. if (record.type === "throw") {
  7147. context.method = "throw";
  7148. context.arg = record.arg;
  7149. context.delegate = null;
  7150. return ContinueSentinel;
  7151. }
  7152. var info = record.arg;
  7153. if (! info) {
  7154. context.method = "throw";
  7155. context.arg = new TypeError("iterator result is not an object");
  7156. context.delegate = null;
  7157. return ContinueSentinel;
  7158. }
  7159. if (info.done) {
  7160. // Assign the result of the finished delegate to the temporary
  7161. // variable specified by delegate.resultName (see delegateYield).
  7162. context[delegate.resultName] = info.value;
  7163. // Resume execution at the desired location (see delegateYield).
  7164. context.next = delegate.nextLoc;
  7165. // If context.method was "throw" but the delegate handled the
  7166. // exception, let the outer generator proceed normally. If
  7167. // context.method was "next", forget context.arg since it has been
  7168. // "consumed" by the delegate iterator. If context.method was
  7169. // "return", allow the original .return call to continue in the
  7170. // outer generator.
  7171. if (context.method !== "return") {
  7172. context.method = "next";
  7173. context.arg = undefined;
  7174. }
  7175. } else {
  7176. // Re-yield the result returned by the delegate method.
  7177. return info;
  7178. }
  7179. // The delegate iterator is finished, so forget it and continue with
  7180. // the outer generator.
  7181. context.delegate = null;
  7182. return ContinueSentinel;
  7183. }
  7184. // Define Generator.prototype.{next,throw,return} in terms of the
  7185. // unified ._invoke helper method.
  7186. defineIteratorMethods(Gp);
  7187. Gp[toStringTagSymbol] = "Generator";
  7188. // A Generator should always return itself as the iterator object when the
  7189. // @@iterator function is called on it. Some browsers' implementations of the
  7190. // iterator prototype chain incorrectly implement this, causing the Generator
  7191. // object to not be returned from this call. This ensures that doesn't happen.
  7192. // See https://github.com/facebook/regenerator/issues/274 for more details.
  7193. Gp[iteratorSymbol] = function() {
  7194. return this;
  7195. };
  7196. Gp.toString = function() {
  7197. return "[object Generator]";
  7198. };
  7199. function pushTryEntry(locs) {
  7200. var entry = { tryLoc: locs[0] };
  7201. if (1 in locs) {
  7202. entry.catchLoc = locs[1];
  7203. }
  7204. if (2 in locs) {
  7205. entry.finallyLoc = locs[2];
  7206. entry.afterLoc = locs[3];
  7207. }
  7208. this.tryEntries.push(entry);
  7209. }
  7210. function resetTryEntry(entry) {
  7211. var record = entry.completion || {};
  7212. record.type = "normal";
  7213. delete record.arg;
  7214. entry.completion = record;
  7215. }
  7216. function Context(tryLocsList) {
  7217. // The root entry object (effectively a try statement without a catch
  7218. // or a finally block) gives us a place to store values thrown from
  7219. // locations where there is no enclosing try statement.
  7220. this.tryEntries = [{ tryLoc: "root" }];
  7221. tryLocsList.forEach(pushTryEntry, this);
  7222. this.reset(true);
  7223. }
  7224. runtime.keys = function(object) {
  7225. var keys = [];
  7226. for (var key in object) {
  7227. keys.push(key);
  7228. }
  7229. keys.reverse();
  7230. // Rather than returning an object with a next method, we keep
  7231. // things simple and return the next function itself.
  7232. return function next() {
  7233. while (keys.length) {
  7234. var key = keys.pop();
  7235. if (key in object) {
  7236. next.value = key;
  7237. next.done = false;
  7238. return next;
  7239. }
  7240. }
  7241. // To avoid creating an additional object, we just hang the .value
  7242. // and .done properties off the next function object itself. This
  7243. // also ensures that the minifier will not anonymize the function.
  7244. next.done = true;
  7245. return next;
  7246. };
  7247. };
  7248. function values(iterable) {
  7249. if (iterable) {
  7250. var iteratorMethod = iterable[iteratorSymbol];
  7251. if (iteratorMethod) {
  7252. return iteratorMethod.call(iterable);
  7253. }
  7254. if (typeof iterable.next === "function") {
  7255. return iterable;
  7256. }
  7257. if (!isNaN(iterable.length)) {
  7258. var i = -1, next = function next() {
  7259. while (++i < iterable.length) {
  7260. if (hasOwn.call(iterable, i)) {
  7261. next.value = iterable[i];
  7262. next.done = false;
  7263. return next;
  7264. }
  7265. }
  7266. next.value = undefined;
  7267. next.done = true;
  7268. return next;
  7269. };
  7270. return next.next = next;
  7271. }
  7272. }
  7273. // Return an iterator with no values.
  7274. return { next: doneResult };
  7275. }
  7276. runtime.values = values;
  7277. function doneResult() {
  7278. return { value: undefined, done: true };
  7279. }
  7280. Context.prototype = {
  7281. constructor: Context,
  7282. reset: function(skipTempReset) {
  7283. this.prev = 0;
  7284. this.next = 0;
  7285. // Resetting context._sent for legacy support of Babel's
  7286. // function.sent implementation.
  7287. this.sent = this._sent = undefined;
  7288. this.done = false;
  7289. this.delegate = null;
  7290. this.method = "next";
  7291. this.arg = undefined;
  7292. this.tryEntries.forEach(resetTryEntry);
  7293. if (!skipTempReset) {
  7294. for (var name in this) {
  7295. // Not sure about the optimal order of these conditions:
  7296. if (name.charAt(0) === "t" &&
  7297. hasOwn.call(this, name) &&
  7298. !isNaN(+name.slice(1))) {
  7299. this[name] = undefined;
  7300. }
  7301. }
  7302. }
  7303. },
  7304. stop: function() {
  7305. this.done = true;
  7306. var rootEntry = this.tryEntries[0];
  7307. var rootRecord = rootEntry.completion;
  7308. if (rootRecord.type === "throw") {
  7309. throw rootRecord.arg;
  7310. }
  7311. return this.rval;
  7312. },
  7313. dispatchException: function(exception) {
  7314. if (this.done) {
  7315. throw exception;
  7316. }
  7317. var context = this;
  7318. function handle(loc, caught) {
  7319. record.type = "throw";
  7320. record.arg = exception;
  7321. context.next = loc;
  7322. if (caught) {
  7323. // If the dispatched exception was caught by a catch block,
  7324. // then let that catch block handle the exception normally.
  7325. context.method = "next";
  7326. context.arg = undefined;
  7327. }
  7328. return !! caught;
  7329. }
  7330. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7331. var entry = this.tryEntries[i];
  7332. var record = entry.completion;
  7333. if (entry.tryLoc === "root") {
  7334. // Exception thrown outside of any try block that could handle
  7335. // it, so set the completion value of the entire function to
  7336. // throw the exception.
  7337. return handle("end");
  7338. }
  7339. if (entry.tryLoc <= this.prev) {
  7340. var hasCatch = hasOwn.call(entry, "catchLoc");
  7341. var hasFinally = hasOwn.call(entry, "finallyLoc");
  7342. if (hasCatch && hasFinally) {
  7343. if (this.prev < entry.catchLoc) {
  7344. return handle(entry.catchLoc, true);
  7345. } else if (this.prev < entry.finallyLoc) {
  7346. return handle(entry.finallyLoc);
  7347. }
  7348. } else if (hasCatch) {
  7349. if (this.prev < entry.catchLoc) {
  7350. return handle(entry.catchLoc, true);
  7351. }
  7352. } else if (hasFinally) {
  7353. if (this.prev < entry.finallyLoc) {
  7354. return handle(entry.finallyLoc);
  7355. }
  7356. } else {
  7357. throw new Error("try statement without catch or finally");
  7358. }
  7359. }
  7360. }
  7361. },
  7362. abrupt: function(type, arg) {
  7363. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7364. var entry = this.tryEntries[i];
  7365. if (entry.tryLoc <= this.prev &&
  7366. hasOwn.call(entry, "finallyLoc") &&
  7367. this.prev < entry.finallyLoc) {
  7368. var finallyEntry = entry;
  7369. break;
  7370. }
  7371. }
  7372. if (finallyEntry &&
  7373. (type === "break" ||
  7374. type === "continue") &&
  7375. finallyEntry.tryLoc <= arg &&
  7376. arg <= finallyEntry.finallyLoc) {
  7377. // Ignore the finally entry if control is not jumping to a
  7378. // location outside the try/catch block.
  7379. finallyEntry = null;
  7380. }
  7381. var record = finallyEntry ? finallyEntry.completion : {};
  7382. record.type = type;
  7383. record.arg = arg;
  7384. if (finallyEntry) {
  7385. this.method = "next";
  7386. this.next = finallyEntry.finallyLoc;
  7387. return ContinueSentinel;
  7388. }
  7389. return this.complete(record);
  7390. },
  7391. complete: function(record, afterLoc) {
  7392. if (record.type === "throw") {
  7393. throw record.arg;
  7394. }
  7395. if (record.type === "break" ||
  7396. record.type === "continue") {
  7397. this.next = record.arg;
  7398. } else if (record.type === "return") {
  7399. this.rval = this.arg = record.arg;
  7400. this.method = "return";
  7401. this.next = "end";
  7402. } else if (record.type === "normal" && afterLoc) {
  7403. this.next = afterLoc;
  7404. }
  7405. return ContinueSentinel;
  7406. },
  7407. finish: function(finallyLoc) {
  7408. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7409. var entry = this.tryEntries[i];
  7410. if (entry.finallyLoc === finallyLoc) {
  7411. this.complete(entry.completion, entry.afterLoc);
  7412. resetTryEntry(entry);
  7413. return ContinueSentinel;
  7414. }
  7415. }
  7416. },
  7417. "catch": function(tryLoc) {
  7418. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7419. var entry = this.tryEntries[i];
  7420. if (entry.tryLoc === tryLoc) {
  7421. var record = entry.completion;
  7422. if (record.type === "throw") {
  7423. var thrown = record.arg;
  7424. resetTryEntry(entry);
  7425. }
  7426. return thrown;
  7427. }
  7428. }
  7429. // The context.catch method must only be called with a location
  7430. // argument that corresponds to a known catch block.
  7431. throw new Error("illegal catch attempt");
  7432. },
  7433. delegateYield: function(iterable, resultName, nextLoc) {
  7434. this.delegate = {
  7435. iterator: values(iterable),
  7436. resultName: resultName,
  7437. nextLoc: nextLoc
  7438. };
  7439. if (this.method === "next") {
  7440. // Deliberately forget the last sent value so that we don't
  7441. // accidentally pass it on to the delegate.
  7442. this.arg = undefined;
  7443. }
  7444. return ContinueSentinel;
  7445. }
  7446. };
  7447. })(
  7448. // Among the various tricks for obtaining a reference to the global
  7449. // object, this seems to be the most reliable technique that does not
  7450. // use indirect eval (which violates Content Security Policy).
  7451. typeof global === "object" ? global :
  7452. typeof window === "object" ? window :
  7453. typeof self === "object" ? self : this
  7454. );
  7455. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  7456. /***/ }),
  7457. /* 324 */
  7458. /***/ (function(module, exports, __webpack_require__) {
  7459. __webpack_require__(325);
  7460. module.exports = __webpack_require__(9).RegExp.escape;
  7461. /***/ }),
  7462. /* 325 */
  7463. /***/ (function(module, exports, __webpack_require__) {
  7464. // https://github.com/benjamingr/RexExp.escape
  7465. var $export = __webpack_require__(8);
  7466. var $re = __webpack_require__(326)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
  7467. $export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });
  7468. /***/ }),
  7469. /* 326 */
  7470. /***/ (function(module, exports) {
  7471. module.exports = function (regExp, replace) {
  7472. var replacer = replace === Object(replace) ? function (part) {
  7473. return replace[part];
  7474. } : replace;
  7475. return function (it) {
  7476. return String(it).replace(regExp, replacer);
  7477. };
  7478. };
  7479. /***/ }),
  7480. /* 327 */
  7481. /***/ (function(module, exports, __webpack_require__) {
  7482. var BSON = __webpack_require__(328),
  7483. Binary = __webpack_require__(351),
  7484. Code = __webpack_require__(346),
  7485. DBRef = __webpack_require__(350),
  7486. Decimal128 = __webpack_require__(347),
  7487. Double = __webpack_require__(331),
  7488. Int32 = __webpack_require__(345),
  7489. Long = __webpack_require__(330),
  7490. Map = __webpack_require__(329),
  7491. MaxKey = __webpack_require__(349),
  7492. MinKey = __webpack_require__(348),
  7493. ObjectId = __webpack_require__(333),
  7494. BSONRegExp = __webpack_require__(343),
  7495. Symbol = __webpack_require__(344),
  7496. Timestamp = __webpack_require__(332);
  7497. // BSON MAX VALUES
  7498. BSON.BSON_INT32_MAX = 0x7fffffff;
  7499. BSON.BSON_INT32_MIN = -0x80000000;
  7500. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  7501. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  7502. // JS MAX PRECISE VALUES
  7503. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  7504. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  7505. // Add BSON types to function creation
  7506. BSON.Binary = Binary;
  7507. BSON.Code = Code;
  7508. BSON.DBRef = DBRef;
  7509. BSON.Decimal128 = Decimal128;
  7510. BSON.Double = Double;
  7511. BSON.Int32 = Int32;
  7512. BSON.Long = Long;
  7513. BSON.Map = Map;
  7514. BSON.MaxKey = MaxKey;
  7515. BSON.MinKey = MinKey;
  7516. BSON.ObjectId = ObjectId;
  7517. BSON.ObjectID = ObjectId;
  7518. BSON.BSONRegExp = BSONRegExp;
  7519. BSON.Symbol = Symbol;
  7520. BSON.Timestamp = Timestamp;
  7521. // Return the BSON
  7522. module.exports = BSON;
  7523. /***/ }),
  7524. /* 328 */
  7525. /***/ (function(module, exports, __webpack_require__) {
  7526. 'use strict';
  7527. var Map = __webpack_require__(329),
  7528. Long = __webpack_require__(330),
  7529. Double = __webpack_require__(331),
  7530. Timestamp = __webpack_require__(332),
  7531. ObjectID = __webpack_require__(333),
  7532. BSONRegExp = __webpack_require__(343),
  7533. Symbol = __webpack_require__(344),
  7534. Int32 = __webpack_require__(345),
  7535. Code = __webpack_require__(346),
  7536. Decimal128 = __webpack_require__(347),
  7537. MinKey = __webpack_require__(348),
  7538. MaxKey = __webpack_require__(349),
  7539. DBRef = __webpack_require__(350),
  7540. Binary = __webpack_require__(351);
  7541. // Parts of the parser
  7542. var deserialize = __webpack_require__(352),
  7543. serializer = __webpack_require__(353),
  7544. calculateObjectSize = __webpack_require__(355),
  7545. utils = __webpack_require__(339);
  7546. /**
  7547. * @ignore
  7548. * @api private
  7549. */
  7550. // Default Max Size
  7551. var MAXSIZE = 1024 * 1024 * 17;
  7552. // Current Internal Temporary Serialization Buffer
  7553. var buffer = utils.allocBuffer(MAXSIZE);
  7554. var BSON = function () {};
  7555. /**
  7556. * Serialize a Javascript object.
  7557. *
  7558. * @param {Object} object the Javascript object to serialize.
  7559. * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
  7560. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7561. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7562. * @param {Number} [options.minInternalBufferSize=1024*1024*17] minimum size of the internal temporary serialization buffer **(default:1024*1024*17)**.
  7563. * @return {Buffer} returns the Buffer object containing the serialized object.
  7564. * @api public
  7565. */
  7566. BSON.prototype.serialize = function serialize(object, options) {
  7567. options = options || {};
  7568. // Unpack the options
  7569. var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
  7570. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7571. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7572. var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE;
  7573. // Resize the internal serialization buffer if needed
  7574. if (buffer.length < minInternalBufferSize) {
  7575. buffer = utils.allocBuffer(minInternalBufferSize);
  7576. }
  7577. // Attempt to serialize
  7578. var serializationIndex = serializer(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []);
  7579. // Create the final buffer
  7580. var finishedBuffer = utils.allocBuffer(serializationIndex);
  7581. // Copy into the finished buffer
  7582. buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length);
  7583. // Return the buffer
  7584. return finishedBuffer;
  7585. };
  7586. /**
  7587. * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
  7588. *
  7589. * @param {Object} object the Javascript object to serialize.
  7590. * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
  7591. * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
  7592. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7593. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7594. * @param {Number} [options.index] the index in the buffer where we wish to start serializing into.
  7595. * @return {Number} returns the index pointing to the last written byte in the buffer.
  7596. * @api public
  7597. */
  7598. BSON.prototype.serializeWithBufferAndIndex = function (object, finalBuffer, options) {
  7599. options = options || {};
  7600. // Unpack the options
  7601. var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
  7602. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7603. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7604. var startIndex = typeof options.index === 'number' ? options.index : 0;
  7605. // Attempt to serialize
  7606. var serializationIndex = serializer(finalBuffer, object, checkKeys, startIndex || 0, 0, serializeFunctions, ignoreUndefined);
  7607. // Return the index
  7608. return serializationIndex - 1;
  7609. };
  7610. /**
  7611. * Deserialize data as BSON.
  7612. *
  7613. * @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
  7614. * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
  7615. * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
  7616. * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
  7617. * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
  7618. * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
  7619. * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
  7620. * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
  7621. * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
  7622. * @return {Object} returns the deserialized Javascript Object.
  7623. * @api public
  7624. */
  7625. BSON.prototype.deserialize = function (buffer, options) {
  7626. return deserialize(buffer, options);
  7627. };
  7628. /**
  7629. * Calculate the bson size for a passed in Javascript object.
  7630. *
  7631. * @param {Object} object the Javascript object to calculate the BSON byte size for.
  7632. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7633. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7634. * @return {Number} returns the number of bytes the BSON object will take up.
  7635. * @api public
  7636. */
  7637. BSON.prototype.calculateObjectSize = function (object, options) {
  7638. options = options || {};
  7639. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7640. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7641. return calculateObjectSize(object, serializeFunctions, ignoreUndefined);
  7642. };
  7643. /**
  7644. * Deserialize stream data as BSON documents.
  7645. *
  7646. * @param {Buffer} data the buffer containing the serialized set of BSON documents.
  7647. * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
  7648. * @param {Number} numberOfDocuments number of documents to deserialize.
  7649. * @param {Array} documents an array where to store the deserialized documents.
  7650. * @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
  7651. * @param {Object} [options] additional options used for the deserialization.
  7652. * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
  7653. * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
  7654. * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
  7655. * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
  7656. * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
  7657. * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
  7658. * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
  7659. * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
  7660. * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
  7661. * @api public
  7662. */
  7663. BSON.prototype.deserializeStream = function (data, startIndex, numberOfDocuments, documents, docStartIndex, options) {
  7664. options = options != null ? options : {};
  7665. var index = startIndex;
  7666. // Loop over all documents
  7667. for (var i = 0; i < numberOfDocuments; i++) {
  7668. // Find size of the document
  7669. var size = data[index] | data[index + 1] << 8 | data[index + 2] << 16 | data[index + 3] << 24;
  7670. // Update options with index
  7671. options['index'] = index;
  7672. // Parse the document at this point
  7673. documents[docStartIndex + i] = this.deserialize(data, options);
  7674. // Adjust index by the document size
  7675. index = index + size;
  7676. }
  7677. // Return object containing end index of parsing and list of documents
  7678. return index;
  7679. };
  7680. /**
  7681. * @ignore
  7682. * @api private
  7683. */
  7684. // BSON MAX VALUES
  7685. BSON.BSON_INT32_MAX = 0x7fffffff;
  7686. BSON.BSON_INT32_MIN = -0x80000000;
  7687. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  7688. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  7689. // JS MAX PRECISE VALUES
  7690. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  7691. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  7692. // Internal long versions
  7693. // var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  7694. // var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  7695. /**
  7696. * Number BSON Type
  7697. *
  7698. * @classconstant BSON_DATA_NUMBER
  7699. **/
  7700. BSON.BSON_DATA_NUMBER = 1;
  7701. /**
  7702. * String BSON Type
  7703. *
  7704. * @classconstant BSON_DATA_STRING
  7705. **/
  7706. BSON.BSON_DATA_STRING = 2;
  7707. /**
  7708. * Object BSON Type
  7709. *
  7710. * @classconstant BSON_DATA_OBJECT
  7711. **/
  7712. BSON.BSON_DATA_OBJECT = 3;
  7713. /**
  7714. * Array BSON Type
  7715. *
  7716. * @classconstant BSON_DATA_ARRAY
  7717. **/
  7718. BSON.BSON_DATA_ARRAY = 4;
  7719. /**
  7720. * Binary BSON Type
  7721. *
  7722. * @classconstant BSON_DATA_BINARY
  7723. **/
  7724. BSON.BSON_DATA_BINARY = 5;
  7725. /**
  7726. * ObjectID BSON Type
  7727. *
  7728. * @classconstant BSON_DATA_OID
  7729. **/
  7730. BSON.BSON_DATA_OID = 7;
  7731. /**
  7732. * Boolean BSON Type
  7733. *
  7734. * @classconstant BSON_DATA_BOOLEAN
  7735. **/
  7736. BSON.BSON_DATA_BOOLEAN = 8;
  7737. /**
  7738. * Date BSON Type
  7739. *
  7740. * @classconstant BSON_DATA_DATE
  7741. **/
  7742. BSON.BSON_DATA_DATE = 9;
  7743. /**
  7744. * null BSON Type
  7745. *
  7746. * @classconstant BSON_DATA_NULL
  7747. **/
  7748. BSON.BSON_DATA_NULL = 10;
  7749. /**
  7750. * RegExp BSON Type
  7751. *
  7752. * @classconstant BSON_DATA_REGEXP
  7753. **/
  7754. BSON.BSON_DATA_REGEXP = 11;
  7755. /**
  7756. * Code BSON Type
  7757. *
  7758. * @classconstant BSON_DATA_CODE
  7759. **/
  7760. BSON.BSON_DATA_CODE = 13;
  7761. /**
  7762. * Symbol BSON Type
  7763. *
  7764. * @classconstant BSON_DATA_SYMBOL
  7765. **/
  7766. BSON.BSON_DATA_SYMBOL = 14;
  7767. /**
  7768. * Code with Scope BSON Type
  7769. *
  7770. * @classconstant BSON_DATA_CODE_W_SCOPE
  7771. **/
  7772. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  7773. /**
  7774. * 32 bit Integer BSON Type
  7775. *
  7776. * @classconstant BSON_DATA_INT
  7777. **/
  7778. BSON.BSON_DATA_INT = 16;
  7779. /**
  7780. * Timestamp BSON Type
  7781. *
  7782. * @classconstant BSON_DATA_TIMESTAMP
  7783. **/
  7784. BSON.BSON_DATA_TIMESTAMP = 17;
  7785. /**
  7786. * Long BSON Type
  7787. *
  7788. * @classconstant BSON_DATA_LONG
  7789. **/
  7790. BSON.BSON_DATA_LONG = 18;
  7791. /**
  7792. * MinKey BSON Type
  7793. *
  7794. * @classconstant BSON_DATA_MIN_KEY
  7795. **/
  7796. BSON.BSON_DATA_MIN_KEY = 0xff;
  7797. /**
  7798. * MaxKey BSON Type
  7799. *
  7800. * @classconstant BSON_DATA_MAX_KEY
  7801. **/
  7802. BSON.BSON_DATA_MAX_KEY = 0x7f;
  7803. /**
  7804. * Binary Default Type
  7805. *
  7806. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  7807. **/
  7808. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  7809. /**
  7810. * Binary Function Type
  7811. *
  7812. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  7813. **/
  7814. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  7815. /**
  7816. * Binary Byte Array Type
  7817. *
  7818. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  7819. **/
  7820. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  7821. /**
  7822. * Binary UUID Type
  7823. *
  7824. * @classconstant BSON_BINARY_SUBTYPE_UUID
  7825. **/
  7826. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  7827. /**
  7828. * Binary MD5 Type
  7829. *
  7830. * @classconstant BSON_BINARY_SUBTYPE_MD5
  7831. **/
  7832. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  7833. /**
  7834. * Binary User Defined Type
  7835. *
  7836. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  7837. **/
  7838. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  7839. // Return BSON
  7840. module.exports = BSON;
  7841. module.exports.Code = Code;
  7842. module.exports.Map = Map;
  7843. module.exports.Symbol = Symbol;
  7844. module.exports.BSON = BSON;
  7845. module.exports.DBRef = DBRef;
  7846. module.exports.Binary = Binary;
  7847. module.exports.ObjectID = ObjectID;
  7848. module.exports.Long = Long;
  7849. module.exports.Timestamp = Timestamp;
  7850. module.exports.Double = Double;
  7851. module.exports.Int32 = Int32;
  7852. module.exports.MinKey = MinKey;
  7853. module.exports.MaxKey = MaxKey;
  7854. module.exports.BSONRegExp = BSONRegExp;
  7855. module.exports.Decimal128 = Decimal128;
  7856. /***/ }),
  7857. /* 329 */
  7858. /***/ (function(module, exports) {
  7859. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  7860. // We have an ES6 Map available, return the native instance
  7861. if (typeof global.Map !== 'undefined') {
  7862. module.exports = global.Map;
  7863. module.exports.Map = global.Map;
  7864. } else {
  7865. // We will return a polyfill
  7866. var Map = function (array) {
  7867. this._keys = [];
  7868. this._values = {};
  7869. for (var i = 0; i < array.length; i++) {
  7870. if (array[i] == null) continue; // skip null and undefined
  7871. var entry = array[i];
  7872. var key = entry[0];
  7873. var value = entry[1];
  7874. // Add the key to the list of keys in order
  7875. this._keys.push(key);
  7876. // Add the key and value to the values dictionary with a point
  7877. // to the location in the ordered keys list
  7878. this._values[key] = { v: value, i: this._keys.length - 1 };
  7879. }
  7880. };
  7881. Map.prototype.clear = function () {
  7882. this._keys = [];
  7883. this._values = {};
  7884. };
  7885. Map.prototype.delete = function (key) {
  7886. var value = this._values[key];
  7887. if (value == null) return false;
  7888. // Delete entry
  7889. delete this._values[key];
  7890. // Remove the key from the ordered keys list
  7891. this._keys.splice(value.i, 1);
  7892. return true;
  7893. };
  7894. Map.prototype.entries = function () {
  7895. var self = this;
  7896. var index = 0;
  7897. return {
  7898. next: function () {
  7899. var key = self._keys[index++];
  7900. return {
  7901. value: key !== undefined ? [key, self._values[key].v] : undefined,
  7902. done: key !== undefined ? false : true
  7903. };
  7904. }
  7905. };
  7906. };
  7907. Map.prototype.forEach = function (callback, self) {
  7908. self = self || this;
  7909. for (var i = 0; i < this._keys.length; i++) {
  7910. var key = this._keys[i];
  7911. // Call the forEach callback
  7912. callback.call(self, this._values[key].v, key, self);
  7913. }
  7914. };
  7915. Map.prototype.get = function (key) {
  7916. return this._values[key] ? this._values[key].v : undefined;
  7917. };
  7918. Map.prototype.has = function (key) {
  7919. return this._values[key] != null;
  7920. };
  7921. Map.prototype.keys = function () {
  7922. var self = this;
  7923. var index = 0;
  7924. return {
  7925. next: function () {
  7926. var key = self._keys[index++];
  7927. return {
  7928. value: key !== undefined ? key : undefined,
  7929. done: key !== undefined ? false : true
  7930. };
  7931. }
  7932. };
  7933. };
  7934. Map.prototype.set = function (key, value) {
  7935. if (this._values[key]) {
  7936. this._values[key].v = value;
  7937. return this;
  7938. }
  7939. // Add the key to the list of keys in order
  7940. this._keys.push(key);
  7941. // Add the key and value to the values dictionary with a point
  7942. // to the location in the ordered keys list
  7943. this._values[key] = { v: value, i: this._keys.length - 1 };
  7944. return this;
  7945. };
  7946. Map.prototype.values = function () {
  7947. var self = this;
  7948. var index = 0;
  7949. return {
  7950. next: function () {
  7951. var key = self._keys[index++];
  7952. return {
  7953. value: key !== undefined ? self._values[key].v : undefined,
  7954. done: key !== undefined ? false : true
  7955. };
  7956. }
  7957. };
  7958. };
  7959. // Last ismaster
  7960. Object.defineProperty(Map.prototype, 'size', {
  7961. enumerable: true,
  7962. get: function () {
  7963. return this._keys.length;
  7964. }
  7965. });
  7966. module.exports = Map;
  7967. module.exports.Map = Map;
  7968. }
  7969. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  7970. /***/ }),
  7971. /* 330 */
  7972. /***/ (function(module, exports) {
  7973. // Licensed under the Apache License, Version 2.0 (the "License");
  7974. // you may not use this file except in compliance with the License.
  7975. // You may obtain a copy of the License at
  7976. //
  7977. // http://www.apache.org/licenses/LICENSE-2.0
  7978. //
  7979. // Unless required by applicable law or agreed to in writing, software
  7980. // distributed under the License is distributed on an "AS IS" BASIS,
  7981. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7982. // See the License for the specific language governing permissions and
  7983. // limitations under the License.
  7984. //
  7985. // Copyright 2009 Google Inc. All Rights Reserved
  7986. /**
  7987. * Defines a Long class for representing a 64-bit two's-complement
  7988. * integer value, which faithfully simulates the behavior of a Java "Long". This
  7989. * implementation is derived from LongLib in GWT.
  7990. *
  7991. * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
  7992. * values as *signed* integers. See the from* functions below for more
  7993. * convenient ways of constructing Longs.
  7994. *
  7995. * The internal representation of a Long is the two given signed, 32-bit values.
  7996. * We use 32-bit pieces because these are the size of integers on which
  7997. * Javascript performs bit-operations. For operations like addition and
  7998. * multiplication, we split each number into 16-bit pieces, which can easily be
  7999. * multiplied within Javascript's floating-point representation without overflow
  8000. * or change in sign.
  8001. *
  8002. * In the algorithms below, we frequently reduce the negative case to the
  8003. * positive case by negating the input(s) and then post-processing the result.
  8004. * Note that we must ALWAYS check specially whether those values are MIN_VALUE
  8005. * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
  8006. * a positive number, it overflows back into a negative). Not handling this
  8007. * case would often result in infinite recursion.
  8008. *
  8009. * @class
  8010. * @param {number} low the low (signed) 32 bits of the Long.
  8011. * @param {number} high the high (signed) 32 bits of the Long.
  8012. * @return {Long}
  8013. */
  8014. function Long(low, high) {
  8015. if (!(this instanceof Long)) return new Long(low, high);
  8016. this._bsontype = 'Long';
  8017. /**
  8018. * @type {number}
  8019. * @ignore
  8020. */
  8021. this.low_ = low | 0; // force into 32 signed bits.
  8022. /**
  8023. * @type {number}
  8024. * @ignore
  8025. */
  8026. this.high_ = high | 0; // force into 32 signed bits.
  8027. }
  8028. /**
  8029. * Return the int value.
  8030. *
  8031. * @method
  8032. * @return {number} the value, assuming it is a 32-bit integer.
  8033. */
  8034. Long.prototype.toInt = function () {
  8035. return this.low_;
  8036. };
  8037. /**
  8038. * Return the Number value.
  8039. *
  8040. * @method
  8041. * @return {number} the closest floating-point representation to this value.
  8042. */
  8043. Long.prototype.toNumber = function () {
  8044. return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
  8045. };
  8046. /**
  8047. * Return the JSON value.
  8048. *
  8049. * @method
  8050. * @return {string} the JSON representation.
  8051. */
  8052. Long.prototype.toJSON = function () {
  8053. return this.toString();
  8054. };
  8055. /**
  8056. * Return the String value.
  8057. *
  8058. * @method
  8059. * @param {number} [opt_radix] the radix in which the text should be written.
  8060. * @return {string} the textual representation of this value.
  8061. */
  8062. Long.prototype.toString = function (opt_radix) {
  8063. var radix = opt_radix || 10;
  8064. if (radix < 2 || 36 < radix) {
  8065. throw Error('radix out of range: ' + radix);
  8066. }
  8067. if (this.isZero()) {
  8068. return '0';
  8069. }
  8070. if (this.isNegative()) {
  8071. if (this.equals(Long.MIN_VALUE)) {
  8072. // We need to change the Long value before it can be negated, so we remove
  8073. // the bottom-most digit in this base and then recurse to do the rest.
  8074. var radixLong = Long.fromNumber(radix);
  8075. var div = this.div(radixLong);
  8076. var rem = div.multiply(radixLong).subtract(this);
  8077. return div.toString(radix) + rem.toInt().toString(radix);
  8078. } else {
  8079. return '-' + this.negate().toString(radix);
  8080. }
  8081. }
  8082. // Do several (6) digits each time through the loop, so as to
  8083. // minimize the calls to the very expensive emulated div.
  8084. var radixToPower = Long.fromNumber(Math.pow(radix, 6));
  8085. rem = this;
  8086. var result = '';
  8087. while (!rem.isZero()) {
  8088. var remDiv = rem.div(radixToPower);
  8089. var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
  8090. var digits = intval.toString(radix);
  8091. rem = remDiv;
  8092. if (rem.isZero()) {
  8093. return digits + result;
  8094. } else {
  8095. while (digits.length < 6) {
  8096. digits = '0' + digits;
  8097. }
  8098. result = '' + digits + result;
  8099. }
  8100. }
  8101. };
  8102. /**
  8103. * Return the high 32-bits value.
  8104. *
  8105. * @method
  8106. * @return {number} the high 32-bits as a signed value.
  8107. */
  8108. Long.prototype.getHighBits = function () {
  8109. return this.high_;
  8110. };
  8111. /**
  8112. * Return the low 32-bits value.
  8113. *
  8114. * @method
  8115. * @return {number} the low 32-bits as a signed value.
  8116. */
  8117. Long.prototype.getLowBits = function () {
  8118. return this.low_;
  8119. };
  8120. /**
  8121. * Return the low unsigned 32-bits value.
  8122. *
  8123. * @method
  8124. * @return {number} the low 32-bits as an unsigned value.
  8125. */
  8126. Long.prototype.getLowBitsUnsigned = function () {
  8127. return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_;
  8128. };
  8129. /**
  8130. * Returns the number of bits needed to represent the absolute value of this Long.
  8131. *
  8132. * @method
  8133. * @return {number} Returns the number of bits needed to represent the absolute value of this Long.
  8134. */
  8135. Long.prototype.getNumBitsAbs = function () {
  8136. if (this.isNegative()) {
  8137. if (this.equals(Long.MIN_VALUE)) {
  8138. return 64;
  8139. } else {
  8140. return this.negate().getNumBitsAbs();
  8141. }
  8142. } else {
  8143. var val = this.high_ !== 0 ? this.high_ : this.low_;
  8144. for (var bit = 31; bit > 0; bit--) {
  8145. if ((val & 1 << bit) !== 0) {
  8146. break;
  8147. }
  8148. }
  8149. return this.high_ !== 0 ? bit + 33 : bit + 1;
  8150. }
  8151. };
  8152. /**
  8153. * Return whether this value is zero.
  8154. *
  8155. * @method
  8156. * @return {boolean} whether this value is zero.
  8157. */
  8158. Long.prototype.isZero = function () {
  8159. return this.high_ === 0 && this.low_ === 0;
  8160. };
  8161. /**
  8162. * Return whether this value is negative.
  8163. *
  8164. * @method
  8165. * @return {boolean} whether this value is negative.
  8166. */
  8167. Long.prototype.isNegative = function () {
  8168. return this.high_ < 0;
  8169. };
  8170. /**
  8171. * Return whether this value is odd.
  8172. *
  8173. * @method
  8174. * @return {boolean} whether this value is odd.
  8175. */
  8176. Long.prototype.isOdd = function () {
  8177. return (this.low_ & 1) === 1;
  8178. };
  8179. /**
  8180. * Return whether this Long equals the other
  8181. *
  8182. * @method
  8183. * @param {Long} other Long to compare against.
  8184. * @return {boolean} whether this Long equals the other
  8185. */
  8186. Long.prototype.equals = function (other) {
  8187. return this.high_ === other.high_ && this.low_ === other.low_;
  8188. };
  8189. /**
  8190. * Return whether this Long does not equal the other.
  8191. *
  8192. * @method
  8193. * @param {Long} other Long to compare against.
  8194. * @return {boolean} whether this Long does not equal the other.
  8195. */
  8196. Long.prototype.notEquals = function (other) {
  8197. return this.high_ !== other.high_ || this.low_ !== other.low_;
  8198. };
  8199. /**
  8200. * Return whether this Long is less than the other.
  8201. *
  8202. * @method
  8203. * @param {Long} other Long to compare against.
  8204. * @return {boolean} whether this Long is less than the other.
  8205. */
  8206. Long.prototype.lessThan = function (other) {
  8207. return this.compare(other) < 0;
  8208. };
  8209. /**
  8210. * Return whether this Long is less than or equal to the other.
  8211. *
  8212. * @method
  8213. * @param {Long} other Long to compare against.
  8214. * @return {boolean} whether this Long is less than or equal to the other.
  8215. */
  8216. Long.prototype.lessThanOrEqual = function (other) {
  8217. return this.compare(other) <= 0;
  8218. };
  8219. /**
  8220. * Return whether this Long is greater than the other.
  8221. *
  8222. * @method
  8223. * @param {Long} other Long to compare against.
  8224. * @return {boolean} whether this Long is greater than the other.
  8225. */
  8226. Long.prototype.greaterThan = function (other) {
  8227. return this.compare(other) > 0;
  8228. };
  8229. /**
  8230. * Return whether this Long is greater than or equal to the other.
  8231. *
  8232. * @method
  8233. * @param {Long} other Long to compare against.
  8234. * @return {boolean} whether this Long is greater than or equal to the other.
  8235. */
  8236. Long.prototype.greaterThanOrEqual = function (other) {
  8237. return this.compare(other) >= 0;
  8238. };
  8239. /**
  8240. * Compares this Long with the given one.
  8241. *
  8242. * @method
  8243. * @param {Long} other Long to compare against.
  8244. * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
  8245. */
  8246. Long.prototype.compare = function (other) {
  8247. if (this.equals(other)) {
  8248. return 0;
  8249. }
  8250. var thisNeg = this.isNegative();
  8251. var otherNeg = other.isNegative();
  8252. if (thisNeg && !otherNeg) {
  8253. return -1;
  8254. }
  8255. if (!thisNeg && otherNeg) {
  8256. return 1;
  8257. }
  8258. // at this point, the signs are the same, so subtraction will not overflow
  8259. if (this.subtract(other).isNegative()) {
  8260. return -1;
  8261. } else {
  8262. return 1;
  8263. }
  8264. };
  8265. /**
  8266. * The negation of this value.
  8267. *
  8268. * @method
  8269. * @return {Long} the negation of this value.
  8270. */
  8271. Long.prototype.negate = function () {
  8272. if (this.equals(Long.MIN_VALUE)) {
  8273. return Long.MIN_VALUE;
  8274. } else {
  8275. return this.not().add(Long.ONE);
  8276. }
  8277. };
  8278. /**
  8279. * Returns the sum of this and the given Long.
  8280. *
  8281. * @method
  8282. * @param {Long} other Long to add to this one.
  8283. * @return {Long} the sum of this and the given Long.
  8284. */
  8285. Long.prototype.add = function (other) {
  8286. // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
  8287. var a48 = this.high_ >>> 16;
  8288. var a32 = this.high_ & 0xffff;
  8289. var a16 = this.low_ >>> 16;
  8290. var a00 = this.low_ & 0xffff;
  8291. var b48 = other.high_ >>> 16;
  8292. var b32 = other.high_ & 0xffff;
  8293. var b16 = other.low_ >>> 16;
  8294. var b00 = other.low_ & 0xffff;
  8295. var c48 = 0,
  8296. c32 = 0,
  8297. c16 = 0,
  8298. c00 = 0;
  8299. c00 += a00 + b00;
  8300. c16 += c00 >>> 16;
  8301. c00 &= 0xffff;
  8302. c16 += a16 + b16;
  8303. c32 += c16 >>> 16;
  8304. c16 &= 0xffff;
  8305. c32 += a32 + b32;
  8306. c48 += c32 >>> 16;
  8307. c32 &= 0xffff;
  8308. c48 += a48 + b48;
  8309. c48 &= 0xffff;
  8310. return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  8311. };
  8312. /**
  8313. * Returns the difference of this and the given Long.
  8314. *
  8315. * @method
  8316. * @param {Long} other Long to subtract from this.
  8317. * @return {Long} the difference of this and the given Long.
  8318. */
  8319. Long.prototype.subtract = function (other) {
  8320. return this.add(other.negate());
  8321. };
  8322. /**
  8323. * Returns the product of this and the given Long.
  8324. *
  8325. * @method
  8326. * @param {Long} other Long to multiply with this.
  8327. * @return {Long} the product of this and the other.
  8328. */
  8329. Long.prototype.multiply = function (other) {
  8330. if (this.isZero()) {
  8331. return Long.ZERO;
  8332. } else if (other.isZero()) {
  8333. return Long.ZERO;
  8334. }
  8335. if (this.equals(Long.MIN_VALUE)) {
  8336. return other.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  8337. } else if (other.equals(Long.MIN_VALUE)) {
  8338. return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  8339. }
  8340. if (this.isNegative()) {
  8341. if (other.isNegative()) {
  8342. return this.negate().multiply(other.negate());
  8343. } else {
  8344. return this.negate().multiply(other).negate();
  8345. }
  8346. } else if (other.isNegative()) {
  8347. return this.multiply(other.negate()).negate();
  8348. }
  8349. // If both Longs are small, use float multiplication
  8350. if (this.lessThan(Long.TWO_PWR_24_) && other.lessThan(Long.TWO_PWR_24_)) {
  8351. return Long.fromNumber(this.toNumber() * other.toNumber());
  8352. }
  8353. // Divide each Long into 4 chunks of 16 bits, and then add up 4x4 products.
  8354. // We can skip products that would overflow.
  8355. var a48 = this.high_ >>> 16;
  8356. var a32 = this.high_ & 0xffff;
  8357. var a16 = this.low_ >>> 16;
  8358. var a00 = this.low_ & 0xffff;
  8359. var b48 = other.high_ >>> 16;
  8360. var b32 = other.high_ & 0xffff;
  8361. var b16 = other.low_ >>> 16;
  8362. var b00 = other.low_ & 0xffff;
  8363. var c48 = 0,
  8364. c32 = 0,
  8365. c16 = 0,
  8366. c00 = 0;
  8367. c00 += a00 * b00;
  8368. c16 += c00 >>> 16;
  8369. c00 &= 0xffff;
  8370. c16 += a16 * b00;
  8371. c32 += c16 >>> 16;
  8372. c16 &= 0xffff;
  8373. c16 += a00 * b16;
  8374. c32 += c16 >>> 16;
  8375. c16 &= 0xffff;
  8376. c32 += a32 * b00;
  8377. c48 += c32 >>> 16;
  8378. c32 &= 0xffff;
  8379. c32 += a16 * b16;
  8380. c48 += c32 >>> 16;
  8381. c32 &= 0xffff;
  8382. c32 += a00 * b32;
  8383. c48 += c32 >>> 16;
  8384. c32 &= 0xffff;
  8385. c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
  8386. c48 &= 0xffff;
  8387. return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  8388. };
  8389. /**
  8390. * Returns this Long divided by the given one.
  8391. *
  8392. * @method
  8393. * @param {Long} other Long by which to divide.
  8394. * @return {Long} this Long divided by the given one.
  8395. */
  8396. Long.prototype.div = function (other) {
  8397. if (other.isZero()) {
  8398. throw Error('division by zero');
  8399. } else if (this.isZero()) {
  8400. return Long.ZERO;
  8401. }
  8402. if (this.equals(Long.MIN_VALUE)) {
  8403. if (other.equals(Long.ONE) || other.equals(Long.NEG_ONE)) {
  8404. return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
  8405. } else if (other.equals(Long.MIN_VALUE)) {
  8406. return Long.ONE;
  8407. } else {
  8408. // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
  8409. var halfThis = this.shiftRight(1);
  8410. var approx = halfThis.div(other).shiftLeft(1);
  8411. if (approx.equals(Long.ZERO)) {
  8412. return other.isNegative() ? Long.ONE : Long.NEG_ONE;
  8413. } else {
  8414. var rem = this.subtract(other.multiply(approx));
  8415. var result = approx.add(rem.div(other));
  8416. return result;
  8417. }
  8418. }
  8419. } else if (other.equals(Long.MIN_VALUE)) {
  8420. return Long.ZERO;
  8421. }
  8422. if (this.isNegative()) {
  8423. if (other.isNegative()) {
  8424. return this.negate().div(other.negate());
  8425. } else {
  8426. return this.negate().div(other).negate();
  8427. }
  8428. } else if (other.isNegative()) {
  8429. return this.div(other.negate()).negate();
  8430. }
  8431. // Repeat the following until the remainder is less than other: find a
  8432. // floating-point that approximates remainder / other *from below*, add this
  8433. // into the result, and subtract it from the remainder. It is critical that
  8434. // the approximate value is less than or equal to the real value so that the
  8435. // remainder never becomes negative.
  8436. var res = Long.ZERO;
  8437. rem = this;
  8438. while (rem.greaterThanOrEqual(other)) {
  8439. // Approximate the result of division. This may be a little greater or
  8440. // smaller than the actual value.
  8441. approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
  8442. // We will tweak the approximate result by changing it in the 48-th digit or
  8443. // the smallest non-fractional digit, whichever is larger.
  8444. var log2 = Math.ceil(Math.log(approx) / Math.LN2);
  8445. var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
  8446. // Decrease the approximation until it is smaller than the remainder. Note
  8447. // that if it is too large, the product overflows and is negative.
  8448. var approxRes = Long.fromNumber(approx);
  8449. var approxRem = approxRes.multiply(other);
  8450. while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
  8451. approx -= delta;
  8452. approxRes = Long.fromNumber(approx);
  8453. approxRem = approxRes.multiply(other);
  8454. }
  8455. // We know the answer can't be zero... and actually, zero would cause
  8456. // infinite recursion since we would make no progress.
  8457. if (approxRes.isZero()) {
  8458. approxRes = Long.ONE;
  8459. }
  8460. res = res.add(approxRes);
  8461. rem = rem.subtract(approxRem);
  8462. }
  8463. return res;
  8464. };
  8465. /**
  8466. * Returns this Long modulo the given one.
  8467. *
  8468. * @method
  8469. * @param {Long} other Long by which to mod.
  8470. * @return {Long} this Long modulo the given one.
  8471. */
  8472. Long.prototype.modulo = function (other) {
  8473. return this.subtract(this.div(other).multiply(other));
  8474. };
  8475. /**
  8476. * The bitwise-NOT of this value.
  8477. *
  8478. * @method
  8479. * @return {Long} the bitwise-NOT of this value.
  8480. */
  8481. Long.prototype.not = function () {
  8482. return Long.fromBits(~this.low_, ~this.high_);
  8483. };
  8484. /**
  8485. * Returns the bitwise-AND of this Long and the given one.
  8486. *
  8487. * @method
  8488. * @param {Long} other the Long with which to AND.
  8489. * @return {Long} the bitwise-AND of this and the other.
  8490. */
  8491. Long.prototype.and = function (other) {
  8492. return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);
  8493. };
  8494. /**
  8495. * Returns the bitwise-OR of this Long and the given one.
  8496. *
  8497. * @method
  8498. * @param {Long} other the Long with which to OR.
  8499. * @return {Long} the bitwise-OR of this and the other.
  8500. */
  8501. Long.prototype.or = function (other) {
  8502. return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);
  8503. };
  8504. /**
  8505. * Returns the bitwise-XOR of this Long and the given one.
  8506. *
  8507. * @method
  8508. * @param {Long} other the Long with which to XOR.
  8509. * @return {Long} the bitwise-XOR of this and the other.
  8510. */
  8511. Long.prototype.xor = function (other) {
  8512. return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
  8513. };
  8514. /**
  8515. * Returns this Long with bits shifted to the left by the given amount.
  8516. *
  8517. * @method
  8518. * @param {number} numBits the number of bits by which to shift.
  8519. * @return {Long} this shifted to the left by the given amount.
  8520. */
  8521. Long.prototype.shiftLeft = function (numBits) {
  8522. numBits &= 63;
  8523. if (numBits === 0) {
  8524. return this;
  8525. } else {
  8526. var low = this.low_;
  8527. if (numBits < 32) {
  8528. var high = this.high_;
  8529. return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
  8530. } else {
  8531. return Long.fromBits(0, low << numBits - 32);
  8532. }
  8533. }
  8534. };
  8535. /**
  8536. * Returns this Long with bits shifted to the right by the given amount.
  8537. *
  8538. * @method
  8539. * @param {number} numBits the number of bits by which to shift.
  8540. * @return {Long} this shifted to the right by the given amount.
  8541. */
  8542. Long.prototype.shiftRight = function (numBits) {
  8543. numBits &= 63;
  8544. if (numBits === 0) {
  8545. return this;
  8546. } else {
  8547. var high = this.high_;
  8548. if (numBits < 32) {
  8549. var low = this.low_;
  8550. return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
  8551. } else {
  8552. return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
  8553. }
  8554. }
  8555. };
  8556. /**
  8557. * Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
  8558. *
  8559. * @method
  8560. * @param {number} numBits the number of bits by which to shift.
  8561. * @return {Long} this shifted to the right by the given amount, with zeros placed into the new leading bits.
  8562. */
  8563. Long.prototype.shiftRightUnsigned = function (numBits) {
  8564. numBits &= 63;
  8565. if (numBits === 0) {
  8566. return this;
  8567. } else {
  8568. var high = this.high_;
  8569. if (numBits < 32) {
  8570. var low = this.low_;
  8571. return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
  8572. } else if (numBits === 32) {
  8573. return Long.fromBits(high, 0);
  8574. } else {
  8575. return Long.fromBits(high >>> numBits - 32, 0);
  8576. }
  8577. }
  8578. };
  8579. /**
  8580. * Returns a Long representing the given (32-bit) integer value.
  8581. *
  8582. * @method
  8583. * @param {number} value the 32-bit integer in question.
  8584. * @return {Long} the corresponding Long value.
  8585. */
  8586. Long.fromInt = function (value) {
  8587. if (-128 <= value && value < 128) {
  8588. var cachedObj = Long.INT_CACHE_[value];
  8589. if (cachedObj) {
  8590. return cachedObj;
  8591. }
  8592. }
  8593. var obj = new Long(value | 0, value < 0 ? -1 : 0);
  8594. if (-128 <= value && value < 128) {
  8595. Long.INT_CACHE_[value] = obj;
  8596. }
  8597. return obj;
  8598. };
  8599. /**
  8600. * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
  8601. *
  8602. * @method
  8603. * @param {number} value the number in question.
  8604. * @return {Long} the corresponding Long value.
  8605. */
  8606. Long.fromNumber = function (value) {
  8607. if (isNaN(value) || !isFinite(value)) {
  8608. return Long.ZERO;
  8609. } else if (value <= -Long.TWO_PWR_63_DBL_) {
  8610. return Long.MIN_VALUE;
  8611. } else if (value + 1 >= Long.TWO_PWR_63_DBL_) {
  8612. return Long.MAX_VALUE;
  8613. } else if (value < 0) {
  8614. return Long.fromNumber(-value).negate();
  8615. } else {
  8616. return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0);
  8617. }
  8618. };
  8619. /**
  8620. * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
  8621. *
  8622. * @method
  8623. * @param {number} lowBits the low 32-bits.
  8624. * @param {number} highBits the high 32-bits.
  8625. * @return {Long} the corresponding Long value.
  8626. */
  8627. Long.fromBits = function (lowBits, highBits) {
  8628. return new Long(lowBits, highBits);
  8629. };
  8630. /**
  8631. * Returns a Long representation of the given string, written using the given radix.
  8632. *
  8633. * @method
  8634. * @param {string} str the textual representation of the Long.
  8635. * @param {number} opt_radix the radix in which the text is written.
  8636. * @return {Long} the corresponding Long value.
  8637. */
  8638. Long.fromString = function (str, opt_radix) {
  8639. if (str.length === 0) {
  8640. throw Error('number format error: empty string');
  8641. }
  8642. var radix = opt_radix || 10;
  8643. if (radix < 2 || 36 < radix) {
  8644. throw Error('radix out of range: ' + radix);
  8645. }
  8646. if (str.charAt(0) === '-') {
  8647. return Long.fromString(str.substring(1), radix).negate();
  8648. } else if (str.indexOf('-') >= 0) {
  8649. throw Error('number format error: interior "-" character: ' + str);
  8650. }
  8651. // Do several (8) digits each time through the loop, so as to
  8652. // minimize the calls to the very expensive emulated div.
  8653. var radixToPower = Long.fromNumber(Math.pow(radix, 8));
  8654. var result = Long.ZERO;
  8655. for (var i = 0; i < str.length; i += 8) {
  8656. var size = Math.min(8, str.length - i);
  8657. var value = parseInt(str.substring(i, i + size), radix);
  8658. if (size < 8) {
  8659. var power = Long.fromNumber(Math.pow(radix, size));
  8660. result = result.multiply(power).add(Long.fromNumber(value));
  8661. } else {
  8662. result = result.multiply(radixToPower);
  8663. result = result.add(Long.fromNumber(value));
  8664. }
  8665. }
  8666. return result;
  8667. };
  8668. // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
  8669. // from* methods on which they depend.
  8670. /**
  8671. * A cache of the Long representations of small integer values.
  8672. * @type {Object}
  8673. * @ignore
  8674. */
  8675. Long.INT_CACHE_ = {};
  8676. // NOTE: the compiler should inline these constant values below and then remove
  8677. // these variables, so there should be no runtime penalty for these.
  8678. /**
  8679. * Number used repeated below in calculations. This must appear before the
  8680. * first call to any from* function below.
  8681. * @type {number}
  8682. * @ignore
  8683. */
  8684. Long.TWO_PWR_16_DBL_ = 1 << 16;
  8685. /**
  8686. * @type {number}
  8687. * @ignore
  8688. */
  8689. Long.TWO_PWR_24_DBL_ = 1 << 24;
  8690. /**
  8691. * @type {number}
  8692. * @ignore
  8693. */
  8694. Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_;
  8695. /**
  8696. * @type {number}
  8697. * @ignore
  8698. */
  8699. Long.TWO_PWR_31_DBL_ = Long.TWO_PWR_32_DBL_ / 2;
  8700. /**
  8701. * @type {number}
  8702. * @ignore
  8703. */
  8704. Long.TWO_PWR_48_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_16_DBL_;
  8705. /**
  8706. * @type {number}
  8707. * @ignore
  8708. */
  8709. Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_;
  8710. /**
  8711. * @type {number}
  8712. * @ignore
  8713. */
  8714. Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2;
  8715. /** @type {Long} */
  8716. Long.ZERO = Long.fromInt(0);
  8717. /** @type {Long} */
  8718. Long.ONE = Long.fromInt(1);
  8719. /** @type {Long} */
  8720. Long.NEG_ONE = Long.fromInt(-1);
  8721. /** @type {Long} */
  8722. Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0);
  8723. /** @type {Long} */
  8724. Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0);
  8725. /**
  8726. * @type {Long}
  8727. * @ignore
  8728. */
  8729. Long.TWO_PWR_24_ = Long.fromInt(1 << 24);
  8730. /**
  8731. * Expose.
  8732. */
  8733. module.exports = Long;
  8734. module.exports.Long = Long;
  8735. /***/ }),
  8736. /* 331 */
  8737. /***/ (function(module, exports) {
  8738. /**
  8739. * A class representation of the BSON Double type.
  8740. *
  8741. * @class
  8742. * @param {number} value the number we want to represent as a double.
  8743. * @return {Double}
  8744. */
  8745. function Double(value) {
  8746. if (!(this instanceof Double)) return new Double(value);
  8747. this._bsontype = 'Double';
  8748. this.value = value;
  8749. }
  8750. /**
  8751. * Access the number value.
  8752. *
  8753. * @method
  8754. * @return {number} returns the wrapped double number.
  8755. */
  8756. Double.prototype.valueOf = function () {
  8757. return this.value;
  8758. };
  8759. /**
  8760. * @ignore
  8761. */
  8762. Double.prototype.toJSON = function () {
  8763. return this.value;
  8764. };
  8765. module.exports = Double;
  8766. module.exports.Double = Double;
  8767. /***/ }),
  8768. /* 332 */
  8769. /***/ (function(module, exports) {
  8770. // Licensed under the Apache License, Version 2.0 (the "License");
  8771. // you may not use this file except in compliance with the License.
  8772. // You may obtain a copy of the License at
  8773. //
  8774. // http://www.apache.org/licenses/LICENSE-2.0
  8775. //
  8776. // Unless required by applicable law or agreed to in writing, software
  8777. // distributed under the License is distributed on an "AS IS" BASIS,
  8778. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8779. // See the License for the specific language governing permissions and
  8780. // limitations under the License.
  8781. //
  8782. // Copyright 2009 Google Inc. All Rights Reserved
  8783. /**
  8784. * This type is for INTERNAL use in MongoDB only and should not be used in applications.
  8785. * The appropriate corresponding type is the JavaScript Date type.
  8786. *
  8787. * Defines a Timestamp class for representing a 64-bit two's-complement
  8788. * integer value, which faithfully simulates the behavior of a Java "Timestamp". This
  8789. * implementation is derived from TimestampLib in GWT.
  8790. *
  8791. * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
  8792. * values as *signed* integers. See the from* functions below for more
  8793. * convenient ways of constructing Timestamps.
  8794. *
  8795. * The internal representation of a Timestamp is the two given signed, 32-bit values.
  8796. * We use 32-bit pieces because these are the size of integers on which
  8797. * Javascript performs bit-operations. For operations like addition and
  8798. * multiplication, we split each number into 16-bit pieces, which can easily be
  8799. * multiplied within Javascript's floating-point representation without overflow
  8800. * or change in sign.
  8801. *
  8802. * In the algorithms below, we frequently reduce the negative case to the
  8803. * positive case by negating the input(s) and then post-processing the result.
  8804. * Note that we must ALWAYS check specially whether those values are MIN_VALUE
  8805. * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
  8806. * a positive number, it overflows back into a negative). Not handling this
  8807. * case would often result in infinite recursion.
  8808. *
  8809. * @class
  8810. * @param {number} low the low (signed) 32 bits of the Timestamp.
  8811. * @param {number} high the high (signed) 32 bits of the Timestamp.
  8812. */
  8813. function Timestamp(low, high) {
  8814. if (!(this instanceof Timestamp)) return new Timestamp(low, high);
  8815. this._bsontype = 'Timestamp';
  8816. /**
  8817. * @type {number}
  8818. * @ignore
  8819. */
  8820. this.low_ = low | 0; // force into 32 signed bits.
  8821. /**
  8822. * @type {number}
  8823. * @ignore
  8824. */
  8825. this.high_ = high | 0; // force into 32 signed bits.
  8826. }
  8827. /**
  8828. * Return the int value.
  8829. *
  8830. * @return {number} the value, assuming it is a 32-bit integer.
  8831. */
  8832. Timestamp.prototype.toInt = function () {
  8833. return this.low_;
  8834. };
  8835. /**
  8836. * Return the Number value.
  8837. *
  8838. * @method
  8839. * @return {number} the closest floating-point representation to this value.
  8840. */
  8841. Timestamp.prototype.toNumber = function () {
  8842. return this.high_ * Timestamp.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
  8843. };
  8844. /**
  8845. * Return the JSON value.
  8846. *
  8847. * @method
  8848. * @return {string} the JSON representation.
  8849. */
  8850. Timestamp.prototype.toJSON = function () {
  8851. return this.toString();
  8852. };
  8853. /**
  8854. * Return the String value.
  8855. *
  8856. * @method
  8857. * @param {number} [opt_radix] the radix in which the text should be written.
  8858. * @return {string} the textual representation of this value.
  8859. */
  8860. Timestamp.prototype.toString = function (opt_radix) {
  8861. var radix = opt_radix || 10;
  8862. if (radix < 2 || 36 < radix) {
  8863. throw Error('radix out of range: ' + radix);
  8864. }
  8865. if (this.isZero()) {
  8866. return '0';
  8867. }
  8868. if (this.isNegative()) {
  8869. if (this.equals(Timestamp.MIN_VALUE)) {
  8870. // We need to change the Timestamp value before it can be negated, so we remove
  8871. // the bottom-most digit in this base and then recurse to do the rest.
  8872. var radixTimestamp = Timestamp.fromNumber(radix);
  8873. var div = this.div(radixTimestamp);
  8874. var rem = div.multiply(radixTimestamp).subtract(this);
  8875. return div.toString(radix) + rem.toInt().toString(radix);
  8876. } else {
  8877. return '-' + this.negate().toString(radix);
  8878. }
  8879. }
  8880. // Do several (6) digits each time through the loop, so as to
  8881. // minimize the calls to the very expensive emulated div.
  8882. var radixToPower = Timestamp.fromNumber(Math.pow(radix, 6));
  8883. rem = this;
  8884. var result = '';
  8885. while (!rem.isZero()) {
  8886. var remDiv = rem.div(radixToPower);
  8887. var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
  8888. var digits = intval.toString(radix);
  8889. rem = remDiv;
  8890. if (rem.isZero()) {
  8891. return digits + result;
  8892. } else {
  8893. while (digits.length < 6) {
  8894. digits = '0' + digits;
  8895. }
  8896. result = '' + digits + result;
  8897. }
  8898. }
  8899. };
  8900. /**
  8901. * Return the high 32-bits value.
  8902. *
  8903. * @method
  8904. * @return {number} the high 32-bits as a signed value.
  8905. */
  8906. Timestamp.prototype.getHighBits = function () {
  8907. return this.high_;
  8908. };
  8909. /**
  8910. * Return the low 32-bits value.
  8911. *
  8912. * @method
  8913. * @return {number} the low 32-bits as a signed value.
  8914. */
  8915. Timestamp.prototype.getLowBits = function () {
  8916. return this.low_;
  8917. };
  8918. /**
  8919. * Return the low unsigned 32-bits value.
  8920. *
  8921. * @method
  8922. * @return {number} the low 32-bits as an unsigned value.
  8923. */
  8924. Timestamp.prototype.getLowBitsUnsigned = function () {
  8925. return this.low_ >= 0 ? this.low_ : Timestamp.TWO_PWR_32_DBL_ + this.low_;
  8926. };
  8927. /**
  8928. * Returns the number of bits needed to represent the absolute value of this Timestamp.
  8929. *
  8930. * @method
  8931. * @return {number} Returns the number of bits needed to represent the absolute value of this Timestamp.
  8932. */
  8933. Timestamp.prototype.getNumBitsAbs = function () {
  8934. if (this.isNegative()) {
  8935. if (this.equals(Timestamp.MIN_VALUE)) {
  8936. return 64;
  8937. } else {
  8938. return this.negate().getNumBitsAbs();
  8939. }
  8940. } else {
  8941. var val = this.high_ !== 0 ? this.high_ : this.low_;
  8942. for (var bit = 31; bit > 0; bit--) {
  8943. if ((val & 1 << bit) !== 0) {
  8944. break;
  8945. }
  8946. }
  8947. return this.high_ !== 0 ? bit + 33 : bit + 1;
  8948. }
  8949. };
  8950. /**
  8951. * Return whether this value is zero.
  8952. *
  8953. * @method
  8954. * @return {boolean} whether this value is zero.
  8955. */
  8956. Timestamp.prototype.isZero = function () {
  8957. return this.high_ === 0 && this.low_ === 0;
  8958. };
  8959. /**
  8960. * Return whether this value is negative.
  8961. *
  8962. * @method
  8963. * @return {boolean} whether this value is negative.
  8964. */
  8965. Timestamp.prototype.isNegative = function () {
  8966. return this.high_ < 0;
  8967. };
  8968. /**
  8969. * Return whether this value is odd.
  8970. *
  8971. * @method
  8972. * @return {boolean} whether this value is odd.
  8973. */
  8974. Timestamp.prototype.isOdd = function () {
  8975. return (this.low_ & 1) === 1;
  8976. };
  8977. /**
  8978. * Return whether this Timestamp equals the other
  8979. *
  8980. * @method
  8981. * @param {Timestamp} other Timestamp to compare against.
  8982. * @return {boolean} whether this Timestamp equals the other
  8983. */
  8984. Timestamp.prototype.equals = function (other) {
  8985. return this.high_ === other.high_ && this.low_ === other.low_;
  8986. };
  8987. /**
  8988. * Return whether this Timestamp does not equal the other.
  8989. *
  8990. * @method
  8991. * @param {Timestamp} other Timestamp to compare against.
  8992. * @return {boolean} whether this Timestamp does not equal the other.
  8993. */
  8994. Timestamp.prototype.notEquals = function (other) {
  8995. return this.high_ !== other.high_ || this.low_ !== other.low_;
  8996. };
  8997. /**
  8998. * Return whether this Timestamp is less than the other.
  8999. *
  9000. * @method
  9001. * @param {Timestamp} other Timestamp to compare against.
  9002. * @return {boolean} whether this Timestamp is less than the other.
  9003. */
  9004. Timestamp.prototype.lessThan = function (other) {
  9005. return this.compare(other) < 0;
  9006. };
  9007. /**
  9008. * Return whether this Timestamp is less than or equal to the other.
  9009. *
  9010. * @method
  9011. * @param {Timestamp} other Timestamp to compare against.
  9012. * @return {boolean} whether this Timestamp is less than or equal to the other.
  9013. */
  9014. Timestamp.prototype.lessThanOrEqual = function (other) {
  9015. return this.compare(other) <= 0;
  9016. };
  9017. /**
  9018. * Return whether this Timestamp is greater than the other.
  9019. *
  9020. * @method
  9021. * @param {Timestamp} other Timestamp to compare against.
  9022. * @return {boolean} whether this Timestamp is greater than the other.
  9023. */
  9024. Timestamp.prototype.greaterThan = function (other) {
  9025. return this.compare(other) > 0;
  9026. };
  9027. /**
  9028. * Return whether this Timestamp is greater than or equal to the other.
  9029. *
  9030. * @method
  9031. * @param {Timestamp} other Timestamp to compare against.
  9032. * @return {boolean} whether this Timestamp is greater than or equal to the other.
  9033. */
  9034. Timestamp.prototype.greaterThanOrEqual = function (other) {
  9035. return this.compare(other) >= 0;
  9036. };
  9037. /**
  9038. * Compares this Timestamp with the given one.
  9039. *
  9040. * @method
  9041. * @param {Timestamp} other Timestamp to compare against.
  9042. * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
  9043. */
  9044. Timestamp.prototype.compare = function (other) {
  9045. if (this.equals(other)) {
  9046. return 0;
  9047. }
  9048. var thisNeg = this.isNegative();
  9049. var otherNeg = other.isNegative();
  9050. if (thisNeg && !otherNeg) {
  9051. return -1;
  9052. }
  9053. if (!thisNeg && otherNeg) {
  9054. return 1;
  9055. }
  9056. // at this point, the signs are the same, so subtraction will not overflow
  9057. if (this.subtract(other).isNegative()) {
  9058. return -1;
  9059. } else {
  9060. return 1;
  9061. }
  9062. };
  9063. /**
  9064. * The negation of this value.
  9065. *
  9066. * @method
  9067. * @return {Timestamp} the negation of this value.
  9068. */
  9069. Timestamp.prototype.negate = function () {
  9070. if (this.equals(Timestamp.MIN_VALUE)) {
  9071. return Timestamp.MIN_VALUE;
  9072. } else {
  9073. return this.not().add(Timestamp.ONE);
  9074. }
  9075. };
  9076. /**
  9077. * Returns the sum of this and the given Timestamp.
  9078. *
  9079. * @method
  9080. * @param {Timestamp} other Timestamp to add to this one.
  9081. * @return {Timestamp} the sum of this and the given Timestamp.
  9082. */
  9083. Timestamp.prototype.add = function (other) {
  9084. // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
  9085. var a48 = this.high_ >>> 16;
  9086. var a32 = this.high_ & 0xffff;
  9087. var a16 = this.low_ >>> 16;
  9088. var a00 = this.low_ & 0xffff;
  9089. var b48 = other.high_ >>> 16;
  9090. var b32 = other.high_ & 0xffff;
  9091. var b16 = other.low_ >>> 16;
  9092. var b00 = other.low_ & 0xffff;
  9093. var c48 = 0,
  9094. c32 = 0,
  9095. c16 = 0,
  9096. c00 = 0;
  9097. c00 += a00 + b00;
  9098. c16 += c00 >>> 16;
  9099. c00 &= 0xffff;
  9100. c16 += a16 + b16;
  9101. c32 += c16 >>> 16;
  9102. c16 &= 0xffff;
  9103. c32 += a32 + b32;
  9104. c48 += c32 >>> 16;
  9105. c32 &= 0xffff;
  9106. c48 += a48 + b48;
  9107. c48 &= 0xffff;
  9108. return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  9109. };
  9110. /**
  9111. * Returns the difference of this and the given Timestamp.
  9112. *
  9113. * @method
  9114. * @param {Timestamp} other Timestamp to subtract from this.
  9115. * @return {Timestamp} the difference of this and the given Timestamp.
  9116. */
  9117. Timestamp.prototype.subtract = function (other) {
  9118. return this.add(other.negate());
  9119. };
  9120. /**
  9121. * Returns the product of this and the given Timestamp.
  9122. *
  9123. * @method
  9124. * @param {Timestamp} other Timestamp to multiply with this.
  9125. * @return {Timestamp} the product of this and the other.
  9126. */
  9127. Timestamp.prototype.multiply = function (other) {
  9128. if (this.isZero()) {
  9129. return Timestamp.ZERO;
  9130. } else if (other.isZero()) {
  9131. return Timestamp.ZERO;
  9132. }
  9133. if (this.equals(Timestamp.MIN_VALUE)) {
  9134. return other.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
  9135. } else if (other.equals(Timestamp.MIN_VALUE)) {
  9136. return this.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
  9137. }
  9138. if (this.isNegative()) {
  9139. if (other.isNegative()) {
  9140. return this.negate().multiply(other.negate());
  9141. } else {
  9142. return this.negate().multiply(other).negate();
  9143. }
  9144. } else if (other.isNegative()) {
  9145. return this.multiply(other.negate()).negate();
  9146. }
  9147. // If both Timestamps are small, use float multiplication
  9148. if (this.lessThan(Timestamp.TWO_PWR_24_) && other.lessThan(Timestamp.TWO_PWR_24_)) {
  9149. return Timestamp.fromNumber(this.toNumber() * other.toNumber());
  9150. }
  9151. // Divide each Timestamp into 4 chunks of 16 bits, and then add up 4x4 products.
  9152. // We can skip products that would overflow.
  9153. var a48 = this.high_ >>> 16;
  9154. var a32 = this.high_ & 0xffff;
  9155. var a16 = this.low_ >>> 16;
  9156. var a00 = this.low_ & 0xffff;
  9157. var b48 = other.high_ >>> 16;
  9158. var b32 = other.high_ & 0xffff;
  9159. var b16 = other.low_ >>> 16;
  9160. var b00 = other.low_ & 0xffff;
  9161. var c48 = 0,
  9162. c32 = 0,
  9163. c16 = 0,
  9164. c00 = 0;
  9165. c00 += a00 * b00;
  9166. c16 += c00 >>> 16;
  9167. c00 &= 0xffff;
  9168. c16 += a16 * b00;
  9169. c32 += c16 >>> 16;
  9170. c16 &= 0xffff;
  9171. c16 += a00 * b16;
  9172. c32 += c16 >>> 16;
  9173. c16 &= 0xffff;
  9174. c32 += a32 * b00;
  9175. c48 += c32 >>> 16;
  9176. c32 &= 0xffff;
  9177. c32 += a16 * b16;
  9178. c48 += c32 >>> 16;
  9179. c32 &= 0xffff;
  9180. c32 += a00 * b32;
  9181. c48 += c32 >>> 16;
  9182. c32 &= 0xffff;
  9183. c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
  9184. c48 &= 0xffff;
  9185. return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  9186. };
  9187. /**
  9188. * Returns this Timestamp divided by the given one.
  9189. *
  9190. * @method
  9191. * @param {Timestamp} other Timestamp by which to divide.
  9192. * @return {Timestamp} this Timestamp divided by the given one.
  9193. */
  9194. Timestamp.prototype.div = function (other) {
  9195. if (other.isZero()) {
  9196. throw Error('division by zero');
  9197. } else if (this.isZero()) {
  9198. return Timestamp.ZERO;
  9199. }
  9200. if (this.equals(Timestamp.MIN_VALUE)) {
  9201. if (other.equals(Timestamp.ONE) || other.equals(Timestamp.NEG_ONE)) {
  9202. return Timestamp.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
  9203. } else if (other.equals(Timestamp.MIN_VALUE)) {
  9204. return Timestamp.ONE;
  9205. } else {
  9206. // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
  9207. var halfThis = this.shiftRight(1);
  9208. var approx = halfThis.div(other).shiftLeft(1);
  9209. if (approx.equals(Timestamp.ZERO)) {
  9210. return other.isNegative() ? Timestamp.ONE : Timestamp.NEG_ONE;
  9211. } else {
  9212. var rem = this.subtract(other.multiply(approx));
  9213. var result = approx.add(rem.div(other));
  9214. return result;
  9215. }
  9216. }
  9217. } else if (other.equals(Timestamp.MIN_VALUE)) {
  9218. return Timestamp.ZERO;
  9219. }
  9220. if (this.isNegative()) {
  9221. if (other.isNegative()) {
  9222. return this.negate().div(other.negate());
  9223. } else {
  9224. return this.negate().div(other).negate();
  9225. }
  9226. } else if (other.isNegative()) {
  9227. return this.div(other.negate()).negate();
  9228. }
  9229. // Repeat the following until the remainder is less than other: find a
  9230. // floating-point that approximates remainder / other *from below*, add this
  9231. // into the result, and subtract it from the remainder. It is critical that
  9232. // the approximate value is less than or equal to the real value so that the
  9233. // remainder never becomes negative.
  9234. var res = Timestamp.ZERO;
  9235. rem = this;
  9236. while (rem.greaterThanOrEqual(other)) {
  9237. // Approximate the result of division. This may be a little greater or
  9238. // smaller than the actual value.
  9239. approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
  9240. // We will tweak the approximate result by changing it in the 48-th digit or
  9241. // the smallest non-fractional digit, whichever is larger.
  9242. var log2 = Math.ceil(Math.log(approx) / Math.LN2);
  9243. var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
  9244. // Decrease the approximation until it is smaller than the remainder. Note
  9245. // that if it is too large, the product overflows and is negative.
  9246. var approxRes = Timestamp.fromNumber(approx);
  9247. var approxRem = approxRes.multiply(other);
  9248. while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
  9249. approx -= delta;
  9250. approxRes = Timestamp.fromNumber(approx);
  9251. approxRem = approxRes.multiply(other);
  9252. }
  9253. // We know the answer can't be zero... and actually, zero would cause
  9254. // infinite recursion since we would make no progress.
  9255. if (approxRes.isZero()) {
  9256. approxRes = Timestamp.ONE;
  9257. }
  9258. res = res.add(approxRes);
  9259. rem = rem.subtract(approxRem);
  9260. }
  9261. return res;
  9262. };
  9263. /**
  9264. * Returns this Timestamp modulo the given one.
  9265. *
  9266. * @method
  9267. * @param {Timestamp} other Timestamp by which to mod.
  9268. * @return {Timestamp} this Timestamp modulo the given one.
  9269. */
  9270. Timestamp.prototype.modulo = function (other) {
  9271. return this.subtract(this.div(other).multiply(other));
  9272. };
  9273. /**
  9274. * The bitwise-NOT of this value.
  9275. *
  9276. * @method
  9277. * @return {Timestamp} the bitwise-NOT of this value.
  9278. */
  9279. Timestamp.prototype.not = function () {
  9280. return Timestamp.fromBits(~this.low_, ~this.high_);
  9281. };
  9282. /**
  9283. * Returns the bitwise-AND of this Timestamp and the given one.
  9284. *
  9285. * @method
  9286. * @param {Timestamp} other the Timestamp with which to AND.
  9287. * @return {Timestamp} the bitwise-AND of this and the other.
  9288. */
  9289. Timestamp.prototype.and = function (other) {
  9290. return Timestamp.fromBits(this.low_ & other.low_, this.high_ & other.high_);
  9291. };
  9292. /**
  9293. * Returns the bitwise-OR of this Timestamp and the given one.
  9294. *
  9295. * @method
  9296. * @param {Timestamp} other the Timestamp with which to OR.
  9297. * @return {Timestamp} the bitwise-OR of this and the other.
  9298. */
  9299. Timestamp.prototype.or = function (other) {
  9300. return Timestamp.fromBits(this.low_ | other.low_, this.high_ | other.high_);
  9301. };
  9302. /**
  9303. * Returns the bitwise-XOR of this Timestamp and the given one.
  9304. *
  9305. * @method
  9306. * @param {Timestamp} other the Timestamp with which to XOR.
  9307. * @return {Timestamp} the bitwise-XOR of this and the other.
  9308. */
  9309. Timestamp.prototype.xor = function (other) {
  9310. return Timestamp.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
  9311. };
  9312. /**
  9313. * Returns this Timestamp with bits shifted to the left by the given amount.
  9314. *
  9315. * @method
  9316. * @param {number} numBits the number of bits by which to shift.
  9317. * @return {Timestamp} this shifted to the left by the given amount.
  9318. */
  9319. Timestamp.prototype.shiftLeft = function (numBits) {
  9320. numBits &= 63;
  9321. if (numBits === 0) {
  9322. return this;
  9323. } else {
  9324. var low = this.low_;
  9325. if (numBits < 32) {
  9326. var high = this.high_;
  9327. return Timestamp.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
  9328. } else {
  9329. return Timestamp.fromBits(0, low << numBits - 32);
  9330. }
  9331. }
  9332. };
  9333. /**
  9334. * Returns this Timestamp with bits shifted to the right by the given amount.
  9335. *
  9336. * @method
  9337. * @param {number} numBits the number of bits by which to shift.
  9338. * @return {Timestamp} this shifted to the right by the given amount.
  9339. */
  9340. Timestamp.prototype.shiftRight = function (numBits) {
  9341. numBits &= 63;
  9342. if (numBits === 0) {
  9343. return this;
  9344. } else {
  9345. var high = this.high_;
  9346. if (numBits < 32) {
  9347. var low = this.low_;
  9348. return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
  9349. } else {
  9350. return Timestamp.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
  9351. }
  9352. }
  9353. };
  9354. /**
  9355. * Returns this Timestamp with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
  9356. *
  9357. * @method
  9358. * @param {number} numBits the number of bits by which to shift.
  9359. * @return {Timestamp} this shifted to the right by the given amount, with zeros placed into the new leading bits.
  9360. */
  9361. Timestamp.prototype.shiftRightUnsigned = function (numBits) {
  9362. numBits &= 63;
  9363. if (numBits === 0) {
  9364. return this;
  9365. } else {
  9366. var high = this.high_;
  9367. if (numBits < 32) {
  9368. var low = this.low_;
  9369. return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
  9370. } else if (numBits === 32) {
  9371. return Timestamp.fromBits(high, 0);
  9372. } else {
  9373. return Timestamp.fromBits(high >>> numBits - 32, 0);
  9374. }
  9375. }
  9376. };
  9377. /**
  9378. * Returns a Timestamp representing the given (32-bit) integer value.
  9379. *
  9380. * @method
  9381. * @param {number} value the 32-bit integer in question.
  9382. * @return {Timestamp} the corresponding Timestamp value.
  9383. */
  9384. Timestamp.fromInt = function (value) {
  9385. if (-128 <= value && value < 128) {
  9386. var cachedObj = Timestamp.INT_CACHE_[value];
  9387. if (cachedObj) {
  9388. return cachedObj;
  9389. }
  9390. }
  9391. var obj = new Timestamp(value | 0, value < 0 ? -1 : 0);
  9392. if (-128 <= value && value < 128) {
  9393. Timestamp.INT_CACHE_[value] = obj;
  9394. }
  9395. return obj;
  9396. };
  9397. /**
  9398. * Returns a Timestamp representing the given value, provided that it is a finite number. Otherwise, zero is returned.
  9399. *
  9400. * @method
  9401. * @param {number} value the number in question.
  9402. * @return {Timestamp} the corresponding Timestamp value.
  9403. */
  9404. Timestamp.fromNumber = function (value) {
  9405. if (isNaN(value) || !isFinite(value)) {
  9406. return Timestamp.ZERO;
  9407. } else if (value <= -Timestamp.TWO_PWR_63_DBL_) {
  9408. return Timestamp.MIN_VALUE;
  9409. } else if (value + 1 >= Timestamp.TWO_PWR_63_DBL_) {
  9410. return Timestamp.MAX_VALUE;
  9411. } else if (value < 0) {
  9412. return Timestamp.fromNumber(-value).negate();
  9413. } else {
  9414. return new Timestamp(value % Timestamp.TWO_PWR_32_DBL_ | 0, value / Timestamp.TWO_PWR_32_DBL_ | 0);
  9415. }
  9416. };
  9417. /**
  9418. * Returns a Timestamp representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
  9419. *
  9420. * @method
  9421. * @param {number} lowBits the low 32-bits.
  9422. * @param {number} highBits the high 32-bits.
  9423. * @return {Timestamp} the corresponding Timestamp value.
  9424. */
  9425. Timestamp.fromBits = function (lowBits, highBits) {
  9426. return new Timestamp(lowBits, highBits);
  9427. };
  9428. /**
  9429. * Returns a Timestamp representation of the given string, written using the given radix.
  9430. *
  9431. * @method
  9432. * @param {string} str the textual representation of the Timestamp.
  9433. * @param {number} opt_radix the radix in which the text is written.
  9434. * @return {Timestamp} the corresponding Timestamp value.
  9435. */
  9436. Timestamp.fromString = function (str, opt_radix) {
  9437. if (str.length === 0) {
  9438. throw Error('number format error: empty string');
  9439. }
  9440. var radix = opt_radix || 10;
  9441. if (radix < 2 || 36 < radix) {
  9442. throw Error('radix out of range: ' + radix);
  9443. }
  9444. if (str.charAt(0) === '-') {
  9445. return Timestamp.fromString(str.substring(1), radix).negate();
  9446. } else if (str.indexOf('-') >= 0) {
  9447. throw Error('number format error: interior "-" character: ' + str);
  9448. }
  9449. // Do several (8) digits each time through the loop, so as to
  9450. // minimize the calls to the very expensive emulated div.
  9451. var radixToPower = Timestamp.fromNumber(Math.pow(radix, 8));
  9452. var result = Timestamp.ZERO;
  9453. for (var i = 0; i < str.length; i += 8) {
  9454. var size = Math.min(8, str.length - i);
  9455. var value = parseInt(str.substring(i, i + size), radix);
  9456. if (size < 8) {
  9457. var power = Timestamp.fromNumber(Math.pow(radix, size));
  9458. result = result.multiply(power).add(Timestamp.fromNumber(value));
  9459. } else {
  9460. result = result.multiply(radixToPower);
  9461. result = result.add(Timestamp.fromNumber(value));
  9462. }
  9463. }
  9464. return result;
  9465. };
  9466. // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
  9467. // from* methods on which they depend.
  9468. /**
  9469. * A cache of the Timestamp representations of small integer values.
  9470. * @type {Object}
  9471. * @ignore
  9472. */
  9473. Timestamp.INT_CACHE_ = {};
  9474. // NOTE: the compiler should inline these constant values below and then remove
  9475. // these variables, so there should be no runtime penalty for these.
  9476. /**
  9477. * Number used repeated below in calculations. This must appear before the
  9478. * first call to any from* function below.
  9479. * @type {number}
  9480. * @ignore
  9481. */
  9482. Timestamp.TWO_PWR_16_DBL_ = 1 << 16;
  9483. /**
  9484. * @type {number}
  9485. * @ignore
  9486. */
  9487. Timestamp.TWO_PWR_24_DBL_ = 1 << 24;
  9488. /**
  9489. * @type {number}
  9490. * @ignore
  9491. */
  9492. Timestamp.TWO_PWR_32_DBL_ = Timestamp.TWO_PWR_16_DBL_ * Timestamp.TWO_PWR_16_DBL_;
  9493. /**
  9494. * @type {number}
  9495. * @ignore
  9496. */
  9497. Timestamp.TWO_PWR_31_DBL_ = Timestamp.TWO_PWR_32_DBL_ / 2;
  9498. /**
  9499. * @type {number}
  9500. * @ignore
  9501. */
  9502. Timestamp.TWO_PWR_48_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_16_DBL_;
  9503. /**
  9504. * @type {number}
  9505. * @ignore
  9506. */
  9507. Timestamp.TWO_PWR_64_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_32_DBL_;
  9508. /**
  9509. * @type {number}
  9510. * @ignore
  9511. */
  9512. Timestamp.TWO_PWR_63_DBL_ = Timestamp.TWO_PWR_64_DBL_ / 2;
  9513. /** @type {Timestamp} */
  9514. Timestamp.ZERO = Timestamp.fromInt(0);
  9515. /** @type {Timestamp} */
  9516. Timestamp.ONE = Timestamp.fromInt(1);
  9517. /** @type {Timestamp} */
  9518. Timestamp.NEG_ONE = Timestamp.fromInt(-1);
  9519. /** @type {Timestamp} */
  9520. Timestamp.MAX_VALUE = Timestamp.fromBits(0xffffffff | 0, 0x7fffffff | 0);
  9521. /** @type {Timestamp} */
  9522. Timestamp.MIN_VALUE = Timestamp.fromBits(0, 0x80000000 | 0);
  9523. /**
  9524. * @type {Timestamp}
  9525. * @ignore
  9526. */
  9527. Timestamp.TWO_PWR_24_ = Timestamp.fromInt(1 << 24);
  9528. /**
  9529. * Expose.
  9530. */
  9531. module.exports = Timestamp;
  9532. module.exports.Timestamp = Timestamp;
  9533. /***/ }),
  9534. /* 333 */
  9535. /***/ (function(module, exports, __webpack_require__) {
  9536. /* WEBPACK VAR INJECTION */(function(Buffer, process) {// Custom inspect property name / symbol.
  9537. var inspect = 'inspect';
  9538. var utils = __webpack_require__(339);
  9539. /**
  9540. * Machine id.
  9541. *
  9542. * Create a random 3-byte value (i.e. unique for this
  9543. * process). Other drivers use a md5 of the machine id here, but
  9544. * that would mean an asyc call to gethostname, so we don't bother.
  9545. * @ignore
  9546. */
  9547. var MACHINE_ID = parseInt(Math.random() * 0xffffff, 10);
  9548. // Regular expression that checks for hex value
  9549. var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');
  9550. // Check if buffer exists
  9551. try {
  9552. if (Buffer && Buffer.from) {
  9553. var hasBufferType = true;
  9554. inspect = __webpack_require__(340).inspect.custom || 'inspect';
  9555. }
  9556. } catch (err) {
  9557. hasBufferType = false;
  9558. }
  9559. /**
  9560. * Create a new ObjectID instance
  9561. *
  9562. * @class
  9563. * @param {(string|number)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
  9564. * @property {number} generationTime The generation time of this ObjectId instance
  9565. * @return {ObjectID} instance of ObjectID.
  9566. */
  9567. var ObjectID = function ObjectID(id) {
  9568. // Duck-typing to support ObjectId from different npm packages
  9569. if (id instanceof ObjectID) return id;
  9570. if (!(this instanceof ObjectID)) return new ObjectID(id);
  9571. this._bsontype = 'ObjectID';
  9572. // The most common usecase (blank id, new objectId instance)
  9573. if (id == null || typeof id === 'number') {
  9574. // Generate a new id
  9575. this.id = this.generate(id);
  9576. // If we are caching the hex string
  9577. if (ObjectID.cacheHexString) this.__id = this.toString('hex');
  9578. // Return the object
  9579. return;
  9580. }
  9581. // Check if the passed in id is valid
  9582. var valid = ObjectID.isValid(id);
  9583. // Throw an error if it's not a valid setup
  9584. if (!valid && id != null) {
  9585. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  9586. } else if (valid && typeof id === 'string' && id.length === 24 && hasBufferType) {
  9587. return new ObjectID(utils.toBuffer(id, 'hex'));
  9588. } else if (valid && typeof id === 'string' && id.length === 24) {
  9589. return ObjectID.createFromHexString(id);
  9590. } else if (id != null && id.length === 12) {
  9591. // assume 12 byte string
  9592. this.id = id;
  9593. } else if (id != null && id.toHexString) {
  9594. // Duck-typing to support ObjectId from different npm packages
  9595. return id;
  9596. } else {
  9597. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  9598. }
  9599. if (ObjectID.cacheHexString) this.__id = this.toString('hex');
  9600. };
  9601. // Allow usage of ObjectId as well as ObjectID
  9602. // var ObjectId = ObjectID;
  9603. // Precomputed hex table enables speedy hex string conversion
  9604. var hexTable = [];
  9605. for (var i = 0; i < 256; i++) {
  9606. hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16);
  9607. }
  9608. /**
  9609. * Return the ObjectID id as a 24 byte hex string representation
  9610. *
  9611. * @method
  9612. * @return {string} return the 24 byte hex string representation.
  9613. */
  9614. ObjectID.prototype.toHexString = function () {
  9615. if (ObjectID.cacheHexString && this.__id) return this.__id;
  9616. var hexString = '';
  9617. if (!this.id || !this.id.length) {
  9618. throw new Error('invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' + JSON.stringify(this.id) + ']');
  9619. }
  9620. if (this.id instanceof _Buffer) {
  9621. hexString = convertToHex(this.id);
  9622. if (ObjectID.cacheHexString) this.__id = hexString;
  9623. return hexString;
  9624. }
  9625. for (var i = 0; i < this.id.length; i++) {
  9626. hexString += hexTable[this.id.charCodeAt(i)];
  9627. }
  9628. if (ObjectID.cacheHexString) this.__id = hexString;
  9629. return hexString;
  9630. };
  9631. /**
  9632. * Update the ObjectID index used in generating new ObjectID's on the driver
  9633. *
  9634. * @method
  9635. * @return {number} returns next index value.
  9636. * @ignore
  9637. */
  9638. ObjectID.prototype.get_inc = function () {
  9639. return ObjectID.index = (ObjectID.index + 1) % 0xffffff;
  9640. };
  9641. /**
  9642. * Update the ObjectID index used in generating new ObjectID's on the driver
  9643. *
  9644. * @method
  9645. * @return {number} returns next index value.
  9646. * @ignore
  9647. */
  9648. ObjectID.prototype.getInc = function () {
  9649. return this.get_inc();
  9650. };
  9651. /**
  9652. * Generate a 12 byte id buffer used in ObjectID's
  9653. *
  9654. * @method
  9655. * @param {number} [time] optional parameter allowing to pass in a second based timestamp.
  9656. * @return {Buffer} return the 12 byte id buffer string.
  9657. */
  9658. ObjectID.prototype.generate = function (time) {
  9659. if ('number' !== typeof time) {
  9660. time = ~~(Date.now() / 1000);
  9661. }
  9662. // Use pid
  9663. var pid = (typeof process === 'undefined' || process.pid === 1 ? Math.floor(Math.random() * 100000) : process.pid) % 0xffff;
  9664. var inc = this.get_inc();
  9665. // Buffer used
  9666. var buffer = utils.allocBuffer(12);
  9667. // Encode time
  9668. buffer[3] = time & 0xff;
  9669. buffer[2] = time >> 8 & 0xff;
  9670. buffer[1] = time >> 16 & 0xff;
  9671. buffer[0] = time >> 24 & 0xff;
  9672. // Encode machine
  9673. buffer[6] = MACHINE_ID & 0xff;
  9674. buffer[5] = MACHINE_ID >> 8 & 0xff;
  9675. buffer[4] = MACHINE_ID >> 16 & 0xff;
  9676. // Encode pid
  9677. buffer[8] = pid & 0xff;
  9678. buffer[7] = pid >> 8 & 0xff;
  9679. // Encode index
  9680. buffer[11] = inc & 0xff;
  9681. buffer[10] = inc >> 8 & 0xff;
  9682. buffer[9] = inc >> 16 & 0xff;
  9683. // Return the buffer
  9684. return buffer;
  9685. };
  9686. /**
  9687. * Converts the id into a 24 byte hex string for printing
  9688. *
  9689. * @param {String} format The Buffer toString format parameter.
  9690. * @return {String} return the 24 byte hex string representation.
  9691. * @ignore
  9692. */
  9693. ObjectID.prototype.toString = function (format) {
  9694. // Is the id a buffer then use the buffer toString method to return the format
  9695. if (this.id && this.id.copy) {
  9696. return this.id.toString(typeof format === 'string' ? format : 'hex');
  9697. }
  9698. // if(this.buffer )
  9699. return this.toHexString();
  9700. };
  9701. /**
  9702. * Converts to a string representation of this Id.
  9703. *
  9704. * @return {String} return the 24 byte hex string representation.
  9705. * @ignore
  9706. */
  9707. ObjectID.prototype[inspect] = ObjectID.prototype.toString;
  9708. /**
  9709. * Converts to its JSON representation.
  9710. *
  9711. * @return {String} return the 24 byte hex string representation.
  9712. * @ignore
  9713. */
  9714. ObjectID.prototype.toJSON = function () {
  9715. return this.toHexString();
  9716. };
  9717. /**
  9718. * Compares the equality of this ObjectID with `otherID`.
  9719. *
  9720. * @method
  9721. * @param {object} otherID ObjectID instance to compare against.
  9722. * @return {boolean} the result of comparing two ObjectID's
  9723. */
  9724. ObjectID.prototype.equals = function equals(otherId) {
  9725. // var id;
  9726. if (otherId instanceof ObjectID) {
  9727. return this.toString() === otherId.toString();
  9728. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12 && this.id instanceof _Buffer) {
  9729. return otherId === this.id.toString('binary');
  9730. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 24) {
  9731. return otherId.toLowerCase() === this.toHexString();
  9732. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12) {
  9733. return otherId === this.id;
  9734. } else if (otherId != null && (otherId instanceof ObjectID || otherId.toHexString)) {
  9735. return otherId.toHexString() === this.toHexString();
  9736. } else {
  9737. return false;
  9738. }
  9739. };
  9740. /**
  9741. * Returns the generation date (accurate up to the second) that this ID was generated.
  9742. *
  9743. * @method
  9744. * @return {date} the generation date
  9745. */
  9746. ObjectID.prototype.getTimestamp = function () {
  9747. var timestamp = new Date();
  9748. var time = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
  9749. timestamp.setTime(Math.floor(time) * 1000);
  9750. return timestamp;
  9751. };
  9752. /**
  9753. * @ignore
  9754. */
  9755. ObjectID.index = ~~(Math.random() * 0xffffff);
  9756. /**
  9757. * @ignore
  9758. */
  9759. ObjectID.createPk = function createPk() {
  9760. return new ObjectID();
  9761. };
  9762. /**
  9763. * Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
  9764. *
  9765. * @method
  9766. * @param {number} time an integer number representing a number of seconds.
  9767. * @return {ObjectID} return the created ObjectID
  9768. */
  9769. ObjectID.createFromTime = function createFromTime(time) {
  9770. var buffer = utils.toBuffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
  9771. // Encode time into first 4 bytes
  9772. buffer[3] = time & 0xff;
  9773. buffer[2] = time >> 8 & 0xff;
  9774. buffer[1] = time >> 16 & 0xff;
  9775. buffer[0] = time >> 24 & 0xff;
  9776. // Return the new objectId
  9777. return new ObjectID(buffer);
  9778. };
  9779. // Lookup tables
  9780. //var encodeLookup = '0123456789abcdef'.split('');
  9781. var decodeLookup = [];
  9782. i = 0;
  9783. while (i < 10) decodeLookup[0x30 + i] = i++;
  9784. while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++;
  9785. var _Buffer = Buffer;
  9786. var convertToHex = function (bytes) {
  9787. return bytes.toString('hex');
  9788. };
  9789. /**
  9790. * Creates an ObjectID from a hex string representation of an ObjectID.
  9791. *
  9792. * @method
  9793. * @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
  9794. * @return {ObjectID} return the created ObjectID
  9795. */
  9796. ObjectID.createFromHexString = function createFromHexString(string) {
  9797. // Throw an error if it's not a valid setup
  9798. if (typeof string === 'undefined' || string != null && string.length !== 24) {
  9799. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  9800. }
  9801. // Use Buffer.from method if available
  9802. if (hasBufferType) return new ObjectID(utils.toBuffer(string, 'hex'));
  9803. // Calculate lengths
  9804. var array = new _Buffer(12);
  9805. var n = 0;
  9806. var i = 0;
  9807. while (i < 24) {
  9808. array[n++] = decodeLookup[string.charCodeAt(i++)] << 4 | decodeLookup[string.charCodeAt(i++)];
  9809. }
  9810. return new ObjectID(array);
  9811. };
  9812. /**
  9813. * Checks if a value is a valid bson ObjectId
  9814. *
  9815. * @method
  9816. * @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
  9817. */
  9818. ObjectID.isValid = function isValid(id) {
  9819. if (id == null) return false;
  9820. if (typeof id === 'number') {
  9821. return true;
  9822. }
  9823. if (typeof id === 'string') {
  9824. return id.length === 12 || id.length === 24 && checkForHexRegExp.test(id);
  9825. }
  9826. if (id instanceof ObjectID) {
  9827. return true;
  9828. }
  9829. if (id instanceof _Buffer) {
  9830. return true;
  9831. }
  9832. // Duck-Typing detection of ObjectId like objects
  9833. if (id.toHexString) {
  9834. return id.id.length === 12 || id.id.length === 24 && checkForHexRegExp.test(id.id);
  9835. }
  9836. return false;
  9837. };
  9838. /**
  9839. * @ignore
  9840. */
  9841. Object.defineProperty(ObjectID.prototype, 'generationTime', {
  9842. enumerable: true,
  9843. get: function () {
  9844. return this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
  9845. },
  9846. set: function (value) {
  9847. // Encode time into first 4 bytes
  9848. this.id[3] = value & 0xff;
  9849. this.id[2] = value >> 8 & 0xff;
  9850. this.id[1] = value >> 16 & 0xff;
  9851. this.id[0] = value >> 24 & 0xff;
  9852. }
  9853. });
  9854. /**
  9855. * Expose.
  9856. */
  9857. module.exports = ObjectID;
  9858. module.exports.ObjectID = ObjectID;
  9859. module.exports.ObjectId = ObjectID;
  9860. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(334).Buffer, __webpack_require__(338)))
  9861. /***/ }),
  9862. /* 334 */
  9863. /***/ (function(module, exports, __webpack_require__) {
  9864. /* WEBPACK VAR INJECTION */(function(global) {/*!
  9865. * The buffer module from node.js, for the browser.
  9866. *
  9867. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  9868. * @license MIT
  9869. */
  9870. /* eslint-disable no-proto */
  9871. 'use strict'
  9872. var base64 = __webpack_require__(335)
  9873. var ieee754 = __webpack_require__(336)
  9874. var isArray = __webpack_require__(337)
  9875. exports.Buffer = Buffer
  9876. exports.SlowBuffer = SlowBuffer
  9877. exports.INSPECT_MAX_BYTES = 50
  9878. /**
  9879. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  9880. * === true Use Uint8Array implementation (fastest)
  9881. * === false Use Object implementation (most compatible, even IE6)
  9882. *
  9883. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  9884. * Opera 11.6+, iOS 4.2+.
  9885. *
  9886. * Due to various browser bugs, sometimes the Object implementation will be used even
  9887. * when the browser supports typed arrays.
  9888. *
  9889. * Note:
  9890. *
  9891. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  9892. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  9893. *
  9894. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  9895. *
  9896. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  9897. * incorrect length in some situations.
  9898. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  9899. * get the Object implementation, which is slower but behaves correctly.
  9900. */
  9901. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  9902. ? global.TYPED_ARRAY_SUPPORT
  9903. : typedArraySupport()
  9904. /*
  9905. * Export kMaxLength after typed array support is determined.
  9906. */
  9907. exports.kMaxLength = kMaxLength()
  9908. function typedArraySupport () {
  9909. try {
  9910. var arr = new Uint8Array(1)
  9911. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  9912. return arr.foo() === 42 && // typed array instances can be augmented
  9913. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  9914. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  9915. } catch (e) {
  9916. return false
  9917. }
  9918. }
  9919. function kMaxLength () {
  9920. return Buffer.TYPED_ARRAY_SUPPORT
  9921. ? 0x7fffffff
  9922. : 0x3fffffff
  9923. }
  9924. function createBuffer (that, length) {
  9925. if (kMaxLength() < length) {
  9926. throw new RangeError('Invalid typed array length')
  9927. }
  9928. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9929. // Return an augmented `Uint8Array` instance, for best performance
  9930. that = new Uint8Array(length)
  9931. that.__proto__ = Buffer.prototype
  9932. } else {
  9933. // Fallback: Return an object instance of the Buffer class
  9934. if (that === null) {
  9935. that = new Buffer(length)
  9936. }
  9937. that.length = length
  9938. }
  9939. return that
  9940. }
  9941. /**
  9942. * The Buffer constructor returns instances of `Uint8Array` that have their
  9943. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  9944. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  9945. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  9946. * returns a single octet.
  9947. *
  9948. * The `Uint8Array` prototype remains unmodified.
  9949. */
  9950. function Buffer (arg, encodingOrOffset, length) {
  9951. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  9952. return new Buffer(arg, encodingOrOffset, length)
  9953. }
  9954. // Common case.
  9955. if (typeof arg === 'number') {
  9956. if (typeof encodingOrOffset === 'string') {
  9957. throw new Error(
  9958. 'If encoding is specified then the first argument must be a string'
  9959. )
  9960. }
  9961. return allocUnsafe(this, arg)
  9962. }
  9963. return from(this, arg, encodingOrOffset, length)
  9964. }
  9965. Buffer.poolSize = 8192 // not used by this implementation
  9966. // TODO: Legacy, not needed anymore. Remove in next major version.
  9967. Buffer._augment = function (arr) {
  9968. arr.__proto__ = Buffer.prototype
  9969. return arr
  9970. }
  9971. function from (that, value, encodingOrOffset, length) {
  9972. if (typeof value === 'number') {
  9973. throw new TypeError('"value" argument must not be a number')
  9974. }
  9975. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  9976. return fromArrayBuffer(that, value, encodingOrOffset, length)
  9977. }
  9978. if (typeof value === 'string') {
  9979. return fromString(that, value, encodingOrOffset)
  9980. }
  9981. return fromObject(that, value)
  9982. }
  9983. /**
  9984. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  9985. * if value is a number.
  9986. * Buffer.from(str[, encoding])
  9987. * Buffer.from(array)
  9988. * Buffer.from(buffer)
  9989. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  9990. **/
  9991. Buffer.from = function (value, encodingOrOffset, length) {
  9992. return from(null, value, encodingOrOffset, length)
  9993. }
  9994. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9995. Buffer.prototype.__proto__ = Uint8Array.prototype
  9996. Buffer.__proto__ = Uint8Array
  9997. if (typeof Symbol !== 'undefined' && Symbol.species &&
  9998. Buffer[Symbol.species] === Buffer) {
  9999. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  10000. Object.defineProperty(Buffer, Symbol.species, {
  10001. value: null,
  10002. configurable: true
  10003. })
  10004. }
  10005. }
  10006. function assertSize (size) {
  10007. if (typeof size !== 'number') {
  10008. throw new TypeError('"size" argument must be a number')
  10009. } else if (size < 0) {
  10010. throw new RangeError('"size" argument must not be negative')
  10011. }
  10012. }
  10013. function alloc (that, size, fill, encoding) {
  10014. assertSize(size)
  10015. if (size <= 0) {
  10016. return createBuffer(that, size)
  10017. }
  10018. if (fill !== undefined) {
  10019. // Only pay attention to encoding if it's a string. This
  10020. // prevents accidentally sending in a number that would
  10021. // be interpretted as a start offset.
  10022. return typeof encoding === 'string'
  10023. ? createBuffer(that, size).fill(fill, encoding)
  10024. : createBuffer(that, size).fill(fill)
  10025. }
  10026. return createBuffer(that, size)
  10027. }
  10028. /**
  10029. * Creates a new filled Buffer instance.
  10030. * alloc(size[, fill[, encoding]])
  10031. **/
  10032. Buffer.alloc = function (size, fill, encoding) {
  10033. return alloc(null, size, fill, encoding)
  10034. }
  10035. function allocUnsafe (that, size) {
  10036. assertSize(size)
  10037. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  10038. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  10039. for (var i = 0; i < size; ++i) {
  10040. that[i] = 0
  10041. }
  10042. }
  10043. return that
  10044. }
  10045. /**
  10046. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  10047. * */
  10048. Buffer.allocUnsafe = function (size) {
  10049. return allocUnsafe(null, size)
  10050. }
  10051. /**
  10052. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  10053. */
  10054. Buffer.allocUnsafeSlow = function (size) {
  10055. return allocUnsafe(null, size)
  10056. }
  10057. function fromString (that, string, encoding) {
  10058. if (typeof encoding !== 'string' || encoding === '') {
  10059. encoding = 'utf8'
  10060. }
  10061. if (!Buffer.isEncoding(encoding)) {
  10062. throw new TypeError('"encoding" must be a valid string encoding')
  10063. }
  10064. var length = byteLength(string, encoding) | 0
  10065. that = createBuffer(that, length)
  10066. var actual = that.write(string, encoding)
  10067. if (actual !== length) {
  10068. // Writing a hex string, for example, that contains invalid characters will
  10069. // cause everything after the first invalid character to be ignored. (e.g.
  10070. // 'abxxcd' will be treated as 'ab')
  10071. that = that.slice(0, actual)
  10072. }
  10073. return that
  10074. }
  10075. function fromArrayLike (that, array) {
  10076. var length = array.length < 0 ? 0 : checked(array.length) | 0
  10077. that = createBuffer(that, length)
  10078. for (var i = 0; i < length; i += 1) {
  10079. that[i] = array[i] & 255
  10080. }
  10081. return that
  10082. }
  10083. function fromArrayBuffer (that, array, byteOffset, length) {
  10084. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  10085. if (byteOffset < 0 || array.byteLength < byteOffset) {
  10086. throw new RangeError('\'offset\' is out of bounds')
  10087. }
  10088. if (array.byteLength < byteOffset + (length || 0)) {
  10089. throw new RangeError('\'length\' is out of bounds')
  10090. }
  10091. if (byteOffset === undefined && length === undefined) {
  10092. array = new Uint8Array(array)
  10093. } else if (length === undefined) {
  10094. array = new Uint8Array(array, byteOffset)
  10095. } else {
  10096. array = new Uint8Array(array, byteOffset, length)
  10097. }
  10098. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10099. // Return an augmented `Uint8Array` instance, for best performance
  10100. that = array
  10101. that.__proto__ = Buffer.prototype
  10102. } else {
  10103. // Fallback: Return an object instance of the Buffer class
  10104. that = fromArrayLike(that, array)
  10105. }
  10106. return that
  10107. }
  10108. function fromObject (that, obj) {
  10109. if (Buffer.isBuffer(obj)) {
  10110. var len = checked(obj.length) | 0
  10111. that = createBuffer(that, len)
  10112. if (that.length === 0) {
  10113. return that
  10114. }
  10115. obj.copy(that, 0, 0, len)
  10116. return that
  10117. }
  10118. if (obj) {
  10119. if ((typeof ArrayBuffer !== 'undefined' &&
  10120. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  10121. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  10122. return createBuffer(that, 0)
  10123. }
  10124. return fromArrayLike(that, obj)
  10125. }
  10126. if (obj.type === 'Buffer' && isArray(obj.data)) {
  10127. return fromArrayLike(that, obj.data)
  10128. }
  10129. }
  10130. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  10131. }
  10132. function checked (length) {
  10133. // Note: cannot use `length < kMaxLength()` here because that fails when
  10134. // length is NaN (which is otherwise coerced to zero.)
  10135. if (length >= kMaxLength()) {
  10136. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  10137. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  10138. }
  10139. return length | 0
  10140. }
  10141. function SlowBuffer (length) {
  10142. if (+length != length) { // eslint-disable-line eqeqeq
  10143. length = 0
  10144. }
  10145. return Buffer.alloc(+length)
  10146. }
  10147. Buffer.isBuffer = function isBuffer (b) {
  10148. return !!(b != null && b._isBuffer)
  10149. }
  10150. Buffer.compare = function compare (a, b) {
  10151. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  10152. throw new TypeError('Arguments must be Buffers')
  10153. }
  10154. if (a === b) return 0
  10155. var x = a.length
  10156. var y = b.length
  10157. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  10158. if (a[i] !== b[i]) {
  10159. x = a[i]
  10160. y = b[i]
  10161. break
  10162. }
  10163. }
  10164. if (x < y) return -1
  10165. if (y < x) return 1
  10166. return 0
  10167. }
  10168. Buffer.isEncoding = function isEncoding (encoding) {
  10169. switch (String(encoding).toLowerCase()) {
  10170. case 'hex':
  10171. case 'utf8':
  10172. case 'utf-8':
  10173. case 'ascii':
  10174. case 'latin1':
  10175. case 'binary':
  10176. case 'base64':
  10177. case 'ucs2':
  10178. case 'ucs-2':
  10179. case 'utf16le':
  10180. case 'utf-16le':
  10181. return true
  10182. default:
  10183. return false
  10184. }
  10185. }
  10186. Buffer.concat = function concat (list, length) {
  10187. if (!isArray(list)) {
  10188. throw new TypeError('"list" argument must be an Array of Buffers')
  10189. }
  10190. if (list.length === 0) {
  10191. return Buffer.alloc(0)
  10192. }
  10193. var i
  10194. if (length === undefined) {
  10195. length = 0
  10196. for (i = 0; i < list.length; ++i) {
  10197. length += list[i].length
  10198. }
  10199. }
  10200. var buffer = Buffer.allocUnsafe(length)
  10201. var pos = 0
  10202. for (i = 0; i < list.length; ++i) {
  10203. var buf = list[i]
  10204. if (!Buffer.isBuffer(buf)) {
  10205. throw new TypeError('"list" argument must be an Array of Buffers')
  10206. }
  10207. buf.copy(buffer, pos)
  10208. pos += buf.length
  10209. }
  10210. return buffer
  10211. }
  10212. function byteLength (string, encoding) {
  10213. if (Buffer.isBuffer(string)) {
  10214. return string.length
  10215. }
  10216. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  10217. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  10218. return string.byteLength
  10219. }
  10220. if (typeof string !== 'string') {
  10221. string = '' + string
  10222. }
  10223. var len = string.length
  10224. if (len === 0) return 0
  10225. // Use a for loop to avoid recursion
  10226. var loweredCase = false
  10227. for (;;) {
  10228. switch (encoding) {
  10229. case 'ascii':
  10230. case 'latin1':
  10231. case 'binary':
  10232. return len
  10233. case 'utf8':
  10234. case 'utf-8':
  10235. case undefined:
  10236. return utf8ToBytes(string).length
  10237. case 'ucs2':
  10238. case 'ucs-2':
  10239. case 'utf16le':
  10240. case 'utf-16le':
  10241. return len * 2
  10242. case 'hex':
  10243. return len >>> 1
  10244. case 'base64':
  10245. return base64ToBytes(string).length
  10246. default:
  10247. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  10248. encoding = ('' + encoding).toLowerCase()
  10249. loweredCase = true
  10250. }
  10251. }
  10252. }
  10253. Buffer.byteLength = byteLength
  10254. function slowToString (encoding, start, end) {
  10255. var loweredCase = false
  10256. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  10257. // property of a typed array.
  10258. // This behaves neither like String nor Uint8Array in that we set start/end
  10259. // to their upper/lower bounds if the value passed is out of range.
  10260. // undefined is handled specially as per ECMA-262 6th Edition,
  10261. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  10262. if (start === undefined || start < 0) {
  10263. start = 0
  10264. }
  10265. // Return early if start > this.length. Done here to prevent potential uint32
  10266. // coercion fail below.
  10267. if (start > this.length) {
  10268. return ''
  10269. }
  10270. if (end === undefined || end > this.length) {
  10271. end = this.length
  10272. }
  10273. if (end <= 0) {
  10274. return ''
  10275. }
  10276. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  10277. end >>>= 0
  10278. start >>>= 0
  10279. if (end <= start) {
  10280. return ''
  10281. }
  10282. if (!encoding) encoding = 'utf8'
  10283. while (true) {
  10284. switch (encoding) {
  10285. case 'hex':
  10286. return hexSlice(this, start, end)
  10287. case 'utf8':
  10288. case 'utf-8':
  10289. return utf8Slice(this, start, end)
  10290. case 'ascii':
  10291. return asciiSlice(this, start, end)
  10292. case 'latin1':
  10293. case 'binary':
  10294. return latin1Slice(this, start, end)
  10295. case 'base64':
  10296. return base64Slice(this, start, end)
  10297. case 'ucs2':
  10298. case 'ucs-2':
  10299. case 'utf16le':
  10300. case 'utf-16le':
  10301. return utf16leSlice(this, start, end)
  10302. default:
  10303. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  10304. encoding = (encoding + '').toLowerCase()
  10305. loweredCase = true
  10306. }
  10307. }
  10308. }
  10309. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  10310. // Buffer instances.
  10311. Buffer.prototype._isBuffer = true
  10312. function swap (b, n, m) {
  10313. var i = b[n]
  10314. b[n] = b[m]
  10315. b[m] = i
  10316. }
  10317. Buffer.prototype.swap16 = function swap16 () {
  10318. var len = this.length
  10319. if (len % 2 !== 0) {
  10320. throw new RangeError('Buffer size must be a multiple of 16-bits')
  10321. }
  10322. for (var i = 0; i < len; i += 2) {
  10323. swap(this, i, i + 1)
  10324. }
  10325. return this
  10326. }
  10327. Buffer.prototype.swap32 = function swap32 () {
  10328. var len = this.length
  10329. if (len % 4 !== 0) {
  10330. throw new RangeError('Buffer size must be a multiple of 32-bits')
  10331. }
  10332. for (var i = 0; i < len; i += 4) {
  10333. swap(this, i, i + 3)
  10334. swap(this, i + 1, i + 2)
  10335. }
  10336. return this
  10337. }
  10338. Buffer.prototype.swap64 = function swap64 () {
  10339. var len = this.length
  10340. if (len % 8 !== 0) {
  10341. throw new RangeError('Buffer size must be a multiple of 64-bits')
  10342. }
  10343. for (var i = 0; i < len; i += 8) {
  10344. swap(this, i, i + 7)
  10345. swap(this, i + 1, i + 6)
  10346. swap(this, i + 2, i + 5)
  10347. swap(this, i + 3, i + 4)
  10348. }
  10349. return this
  10350. }
  10351. Buffer.prototype.toString = function toString () {
  10352. var length = this.length | 0
  10353. if (length === 0) return ''
  10354. if (arguments.length === 0) return utf8Slice(this, 0, length)
  10355. return slowToString.apply(this, arguments)
  10356. }
  10357. Buffer.prototype.equals = function equals (b) {
  10358. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  10359. if (this === b) return true
  10360. return Buffer.compare(this, b) === 0
  10361. }
  10362. Buffer.prototype.inspect = function inspect () {
  10363. var str = ''
  10364. var max = exports.INSPECT_MAX_BYTES
  10365. if (this.length > 0) {
  10366. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  10367. if (this.length > max) str += ' ... '
  10368. }
  10369. return '<Buffer ' + str + '>'
  10370. }
  10371. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  10372. if (!Buffer.isBuffer(target)) {
  10373. throw new TypeError('Argument must be a Buffer')
  10374. }
  10375. if (start === undefined) {
  10376. start = 0
  10377. }
  10378. if (end === undefined) {
  10379. end = target ? target.length : 0
  10380. }
  10381. if (thisStart === undefined) {
  10382. thisStart = 0
  10383. }
  10384. if (thisEnd === undefined) {
  10385. thisEnd = this.length
  10386. }
  10387. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  10388. throw new RangeError('out of range index')
  10389. }
  10390. if (thisStart >= thisEnd && start >= end) {
  10391. return 0
  10392. }
  10393. if (thisStart >= thisEnd) {
  10394. return -1
  10395. }
  10396. if (start >= end) {
  10397. return 1
  10398. }
  10399. start >>>= 0
  10400. end >>>= 0
  10401. thisStart >>>= 0
  10402. thisEnd >>>= 0
  10403. if (this === target) return 0
  10404. var x = thisEnd - thisStart
  10405. var y = end - start
  10406. var len = Math.min(x, y)
  10407. var thisCopy = this.slice(thisStart, thisEnd)
  10408. var targetCopy = target.slice(start, end)
  10409. for (var i = 0; i < len; ++i) {
  10410. if (thisCopy[i] !== targetCopy[i]) {
  10411. x = thisCopy[i]
  10412. y = targetCopy[i]
  10413. break
  10414. }
  10415. }
  10416. if (x < y) return -1
  10417. if (y < x) return 1
  10418. return 0
  10419. }
  10420. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  10421. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  10422. //
  10423. // Arguments:
  10424. // - buffer - a Buffer to search
  10425. // - val - a string, Buffer, or number
  10426. // - byteOffset - an index into `buffer`; will be clamped to an int32
  10427. // - encoding - an optional encoding, relevant is val is a string
  10428. // - dir - true for indexOf, false for lastIndexOf
  10429. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  10430. // Empty buffer means no match
  10431. if (buffer.length === 0) return -1
  10432. // Normalize byteOffset
  10433. if (typeof byteOffset === 'string') {
  10434. encoding = byteOffset
  10435. byteOffset = 0
  10436. } else if (byteOffset > 0x7fffffff) {
  10437. byteOffset = 0x7fffffff
  10438. } else if (byteOffset < -0x80000000) {
  10439. byteOffset = -0x80000000
  10440. }
  10441. byteOffset = +byteOffset // Coerce to Number.
  10442. if (isNaN(byteOffset)) {
  10443. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  10444. byteOffset = dir ? 0 : (buffer.length - 1)
  10445. }
  10446. // Normalize byteOffset: negative offsets start from the end of the buffer
  10447. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  10448. if (byteOffset >= buffer.length) {
  10449. if (dir) return -1
  10450. else byteOffset = buffer.length - 1
  10451. } else if (byteOffset < 0) {
  10452. if (dir) byteOffset = 0
  10453. else return -1
  10454. }
  10455. // Normalize val
  10456. if (typeof val === 'string') {
  10457. val = Buffer.from(val, encoding)
  10458. }
  10459. // Finally, search either indexOf (if dir is true) or lastIndexOf
  10460. if (Buffer.isBuffer(val)) {
  10461. // Special case: looking for empty string/buffer always fails
  10462. if (val.length === 0) {
  10463. return -1
  10464. }
  10465. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  10466. } else if (typeof val === 'number') {
  10467. val = val & 0xFF // Search for a byte value [0-255]
  10468. if (Buffer.TYPED_ARRAY_SUPPORT &&
  10469. typeof Uint8Array.prototype.indexOf === 'function') {
  10470. if (dir) {
  10471. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  10472. } else {
  10473. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  10474. }
  10475. }
  10476. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  10477. }
  10478. throw new TypeError('val must be string, number or Buffer')
  10479. }
  10480. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  10481. var indexSize = 1
  10482. var arrLength = arr.length
  10483. var valLength = val.length
  10484. if (encoding !== undefined) {
  10485. encoding = String(encoding).toLowerCase()
  10486. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  10487. encoding === 'utf16le' || encoding === 'utf-16le') {
  10488. if (arr.length < 2 || val.length < 2) {
  10489. return -1
  10490. }
  10491. indexSize = 2
  10492. arrLength /= 2
  10493. valLength /= 2
  10494. byteOffset /= 2
  10495. }
  10496. }
  10497. function read (buf, i) {
  10498. if (indexSize === 1) {
  10499. return buf[i]
  10500. } else {
  10501. return buf.readUInt16BE(i * indexSize)
  10502. }
  10503. }
  10504. var i
  10505. if (dir) {
  10506. var foundIndex = -1
  10507. for (i = byteOffset; i < arrLength; i++) {
  10508. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  10509. if (foundIndex === -1) foundIndex = i
  10510. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  10511. } else {
  10512. if (foundIndex !== -1) i -= i - foundIndex
  10513. foundIndex = -1
  10514. }
  10515. }
  10516. } else {
  10517. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  10518. for (i = byteOffset; i >= 0; i--) {
  10519. var found = true
  10520. for (var j = 0; j < valLength; j++) {
  10521. if (read(arr, i + j) !== read(val, j)) {
  10522. found = false
  10523. break
  10524. }
  10525. }
  10526. if (found) return i
  10527. }
  10528. }
  10529. return -1
  10530. }
  10531. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  10532. return this.indexOf(val, byteOffset, encoding) !== -1
  10533. }
  10534. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  10535. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  10536. }
  10537. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  10538. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  10539. }
  10540. function hexWrite (buf, string, offset, length) {
  10541. offset = Number(offset) || 0
  10542. var remaining = buf.length - offset
  10543. if (!length) {
  10544. length = remaining
  10545. } else {
  10546. length = Number(length)
  10547. if (length > remaining) {
  10548. length = remaining
  10549. }
  10550. }
  10551. // must be an even number of digits
  10552. var strLen = string.length
  10553. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  10554. if (length > strLen / 2) {
  10555. length = strLen / 2
  10556. }
  10557. for (var i = 0; i < length; ++i) {
  10558. var parsed = parseInt(string.substr(i * 2, 2), 16)
  10559. if (isNaN(parsed)) return i
  10560. buf[offset + i] = parsed
  10561. }
  10562. return i
  10563. }
  10564. function utf8Write (buf, string, offset, length) {
  10565. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  10566. }
  10567. function asciiWrite (buf, string, offset, length) {
  10568. return blitBuffer(asciiToBytes(string), buf, offset, length)
  10569. }
  10570. function latin1Write (buf, string, offset, length) {
  10571. return asciiWrite(buf, string, offset, length)
  10572. }
  10573. function base64Write (buf, string, offset, length) {
  10574. return blitBuffer(base64ToBytes(string), buf, offset, length)
  10575. }
  10576. function ucs2Write (buf, string, offset, length) {
  10577. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  10578. }
  10579. Buffer.prototype.write = function write (string, offset, length, encoding) {
  10580. // Buffer#write(string)
  10581. if (offset === undefined) {
  10582. encoding = 'utf8'
  10583. length = this.length
  10584. offset = 0
  10585. // Buffer#write(string, encoding)
  10586. } else if (length === undefined && typeof offset === 'string') {
  10587. encoding = offset
  10588. length = this.length
  10589. offset = 0
  10590. // Buffer#write(string, offset[, length][, encoding])
  10591. } else if (isFinite(offset)) {
  10592. offset = offset | 0
  10593. if (isFinite(length)) {
  10594. length = length | 0
  10595. if (encoding === undefined) encoding = 'utf8'
  10596. } else {
  10597. encoding = length
  10598. length = undefined
  10599. }
  10600. // legacy write(string, encoding, offset, length) - remove in v0.13
  10601. } else {
  10602. throw new Error(
  10603. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  10604. )
  10605. }
  10606. var remaining = this.length - offset
  10607. if (length === undefined || length > remaining) length = remaining
  10608. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  10609. throw new RangeError('Attempt to write outside buffer bounds')
  10610. }
  10611. if (!encoding) encoding = 'utf8'
  10612. var loweredCase = false
  10613. for (;;) {
  10614. switch (encoding) {
  10615. case 'hex':
  10616. return hexWrite(this, string, offset, length)
  10617. case 'utf8':
  10618. case 'utf-8':
  10619. return utf8Write(this, string, offset, length)
  10620. case 'ascii':
  10621. return asciiWrite(this, string, offset, length)
  10622. case 'latin1':
  10623. case 'binary':
  10624. return latin1Write(this, string, offset, length)
  10625. case 'base64':
  10626. // Warning: maxLength not taken into account in base64Write
  10627. return base64Write(this, string, offset, length)
  10628. case 'ucs2':
  10629. case 'ucs-2':
  10630. case 'utf16le':
  10631. case 'utf-16le':
  10632. return ucs2Write(this, string, offset, length)
  10633. default:
  10634. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  10635. encoding = ('' + encoding).toLowerCase()
  10636. loweredCase = true
  10637. }
  10638. }
  10639. }
  10640. Buffer.prototype.toJSON = function toJSON () {
  10641. return {
  10642. type: 'Buffer',
  10643. data: Array.prototype.slice.call(this._arr || this, 0)
  10644. }
  10645. }
  10646. function base64Slice (buf, start, end) {
  10647. if (start === 0 && end === buf.length) {
  10648. return base64.fromByteArray(buf)
  10649. } else {
  10650. return base64.fromByteArray(buf.slice(start, end))
  10651. }
  10652. }
  10653. function utf8Slice (buf, start, end) {
  10654. end = Math.min(buf.length, end)
  10655. var res = []
  10656. var i = start
  10657. while (i < end) {
  10658. var firstByte = buf[i]
  10659. var codePoint = null
  10660. var bytesPerSequence = (firstByte > 0xEF) ? 4
  10661. : (firstByte > 0xDF) ? 3
  10662. : (firstByte > 0xBF) ? 2
  10663. : 1
  10664. if (i + bytesPerSequence <= end) {
  10665. var secondByte, thirdByte, fourthByte, tempCodePoint
  10666. switch (bytesPerSequence) {
  10667. case 1:
  10668. if (firstByte < 0x80) {
  10669. codePoint = firstByte
  10670. }
  10671. break
  10672. case 2:
  10673. secondByte = buf[i + 1]
  10674. if ((secondByte & 0xC0) === 0x80) {
  10675. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  10676. if (tempCodePoint > 0x7F) {
  10677. codePoint = tempCodePoint
  10678. }
  10679. }
  10680. break
  10681. case 3:
  10682. secondByte = buf[i + 1]
  10683. thirdByte = buf[i + 2]
  10684. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  10685. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  10686. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  10687. codePoint = tempCodePoint
  10688. }
  10689. }
  10690. break
  10691. case 4:
  10692. secondByte = buf[i + 1]
  10693. thirdByte = buf[i + 2]
  10694. fourthByte = buf[i + 3]
  10695. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  10696. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  10697. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  10698. codePoint = tempCodePoint
  10699. }
  10700. }
  10701. }
  10702. }
  10703. if (codePoint === null) {
  10704. // we did not generate a valid codePoint so insert a
  10705. // replacement char (U+FFFD) and advance only 1 byte
  10706. codePoint = 0xFFFD
  10707. bytesPerSequence = 1
  10708. } else if (codePoint > 0xFFFF) {
  10709. // encode to utf16 (surrogate pair dance)
  10710. codePoint -= 0x10000
  10711. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  10712. codePoint = 0xDC00 | codePoint & 0x3FF
  10713. }
  10714. res.push(codePoint)
  10715. i += bytesPerSequence
  10716. }
  10717. return decodeCodePointsArray(res)
  10718. }
  10719. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  10720. // the lowest limit is Chrome, with 0x10000 args.
  10721. // We go 1 magnitude less, for safety
  10722. var MAX_ARGUMENTS_LENGTH = 0x1000
  10723. function decodeCodePointsArray (codePoints) {
  10724. var len = codePoints.length
  10725. if (len <= MAX_ARGUMENTS_LENGTH) {
  10726. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  10727. }
  10728. // Decode in chunks to avoid "call stack size exceeded".
  10729. var res = ''
  10730. var i = 0
  10731. while (i < len) {
  10732. res += String.fromCharCode.apply(
  10733. String,
  10734. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  10735. )
  10736. }
  10737. return res
  10738. }
  10739. function asciiSlice (buf, start, end) {
  10740. var ret = ''
  10741. end = Math.min(buf.length, end)
  10742. for (var i = start; i < end; ++i) {
  10743. ret += String.fromCharCode(buf[i] & 0x7F)
  10744. }
  10745. return ret
  10746. }
  10747. function latin1Slice (buf, start, end) {
  10748. var ret = ''
  10749. end = Math.min(buf.length, end)
  10750. for (var i = start; i < end; ++i) {
  10751. ret += String.fromCharCode(buf[i])
  10752. }
  10753. return ret
  10754. }
  10755. function hexSlice (buf, start, end) {
  10756. var len = buf.length
  10757. if (!start || start < 0) start = 0
  10758. if (!end || end < 0 || end > len) end = len
  10759. var out = ''
  10760. for (var i = start; i < end; ++i) {
  10761. out += toHex(buf[i])
  10762. }
  10763. return out
  10764. }
  10765. function utf16leSlice (buf, start, end) {
  10766. var bytes = buf.slice(start, end)
  10767. var res = ''
  10768. for (var i = 0; i < bytes.length; i += 2) {
  10769. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  10770. }
  10771. return res
  10772. }
  10773. Buffer.prototype.slice = function slice (start, end) {
  10774. var len = this.length
  10775. start = ~~start
  10776. end = end === undefined ? len : ~~end
  10777. if (start < 0) {
  10778. start += len
  10779. if (start < 0) start = 0
  10780. } else if (start > len) {
  10781. start = len
  10782. }
  10783. if (end < 0) {
  10784. end += len
  10785. if (end < 0) end = 0
  10786. } else if (end > len) {
  10787. end = len
  10788. }
  10789. if (end < start) end = start
  10790. var newBuf
  10791. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10792. newBuf = this.subarray(start, end)
  10793. newBuf.__proto__ = Buffer.prototype
  10794. } else {
  10795. var sliceLen = end - start
  10796. newBuf = new Buffer(sliceLen, undefined)
  10797. for (var i = 0; i < sliceLen; ++i) {
  10798. newBuf[i] = this[i + start]
  10799. }
  10800. }
  10801. return newBuf
  10802. }
  10803. /*
  10804. * Need to make sure that buffer isn't trying to write out of bounds.
  10805. */
  10806. function checkOffset (offset, ext, length) {
  10807. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  10808. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  10809. }
  10810. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  10811. offset = offset | 0
  10812. byteLength = byteLength | 0
  10813. if (!noAssert) checkOffset(offset, byteLength, this.length)
  10814. var val = this[offset]
  10815. var mul = 1
  10816. var i = 0
  10817. while (++i < byteLength && (mul *= 0x100)) {
  10818. val += this[offset + i] * mul
  10819. }
  10820. return val
  10821. }
  10822. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  10823. offset = offset | 0
  10824. byteLength = byteLength | 0
  10825. if (!noAssert) {
  10826. checkOffset(offset, byteLength, this.length)
  10827. }
  10828. var val = this[offset + --byteLength]
  10829. var mul = 1
  10830. while (byteLength > 0 && (mul *= 0x100)) {
  10831. val += this[offset + --byteLength] * mul
  10832. }
  10833. return val
  10834. }
  10835. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  10836. if (!noAssert) checkOffset(offset, 1, this.length)
  10837. return this[offset]
  10838. }
  10839. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  10840. if (!noAssert) checkOffset(offset, 2, this.length)
  10841. return this[offset] | (this[offset + 1] << 8)
  10842. }
  10843. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  10844. if (!noAssert) checkOffset(offset, 2, this.length)
  10845. return (this[offset] << 8) | this[offset + 1]
  10846. }
  10847. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  10848. if (!noAssert) checkOffset(offset, 4, this.length)
  10849. return ((this[offset]) |
  10850. (this[offset + 1] << 8) |
  10851. (this[offset + 2] << 16)) +
  10852. (this[offset + 3] * 0x1000000)
  10853. }
  10854. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  10855. if (!noAssert) checkOffset(offset, 4, this.length)
  10856. return (this[offset] * 0x1000000) +
  10857. ((this[offset + 1] << 16) |
  10858. (this[offset + 2] << 8) |
  10859. this[offset + 3])
  10860. }
  10861. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  10862. offset = offset | 0
  10863. byteLength = byteLength | 0
  10864. if (!noAssert) checkOffset(offset, byteLength, this.length)
  10865. var val = this[offset]
  10866. var mul = 1
  10867. var i = 0
  10868. while (++i < byteLength && (mul *= 0x100)) {
  10869. val += this[offset + i] * mul
  10870. }
  10871. mul *= 0x80
  10872. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  10873. return val
  10874. }
  10875. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  10876. offset = offset | 0
  10877. byteLength = byteLength | 0
  10878. if (!noAssert) checkOffset(offset, byteLength, this.length)
  10879. var i = byteLength
  10880. var mul = 1
  10881. var val = this[offset + --i]
  10882. while (i > 0 && (mul *= 0x100)) {
  10883. val += this[offset + --i] * mul
  10884. }
  10885. mul *= 0x80
  10886. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  10887. return val
  10888. }
  10889. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  10890. if (!noAssert) checkOffset(offset, 1, this.length)
  10891. if (!(this[offset] & 0x80)) return (this[offset])
  10892. return ((0xff - this[offset] + 1) * -1)
  10893. }
  10894. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  10895. if (!noAssert) checkOffset(offset, 2, this.length)
  10896. var val = this[offset] | (this[offset + 1] << 8)
  10897. return (val & 0x8000) ? val | 0xFFFF0000 : val
  10898. }
  10899. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  10900. if (!noAssert) checkOffset(offset, 2, this.length)
  10901. var val = this[offset + 1] | (this[offset] << 8)
  10902. return (val & 0x8000) ? val | 0xFFFF0000 : val
  10903. }
  10904. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  10905. if (!noAssert) checkOffset(offset, 4, this.length)
  10906. return (this[offset]) |
  10907. (this[offset + 1] << 8) |
  10908. (this[offset + 2] << 16) |
  10909. (this[offset + 3] << 24)
  10910. }
  10911. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  10912. if (!noAssert) checkOffset(offset, 4, this.length)
  10913. return (this[offset] << 24) |
  10914. (this[offset + 1] << 16) |
  10915. (this[offset + 2] << 8) |
  10916. (this[offset + 3])
  10917. }
  10918. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  10919. if (!noAssert) checkOffset(offset, 4, this.length)
  10920. return ieee754.read(this, offset, true, 23, 4)
  10921. }
  10922. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  10923. if (!noAssert) checkOffset(offset, 4, this.length)
  10924. return ieee754.read(this, offset, false, 23, 4)
  10925. }
  10926. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  10927. if (!noAssert) checkOffset(offset, 8, this.length)
  10928. return ieee754.read(this, offset, true, 52, 8)
  10929. }
  10930. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  10931. if (!noAssert) checkOffset(offset, 8, this.length)
  10932. return ieee754.read(this, offset, false, 52, 8)
  10933. }
  10934. function checkInt (buf, value, offset, ext, max, min) {
  10935. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  10936. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  10937. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  10938. }
  10939. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  10940. value = +value
  10941. offset = offset | 0
  10942. byteLength = byteLength | 0
  10943. if (!noAssert) {
  10944. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  10945. checkInt(this, value, offset, byteLength, maxBytes, 0)
  10946. }
  10947. var mul = 1
  10948. var i = 0
  10949. this[offset] = value & 0xFF
  10950. while (++i < byteLength && (mul *= 0x100)) {
  10951. this[offset + i] = (value / mul) & 0xFF
  10952. }
  10953. return offset + byteLength
  10954. }
  10955. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  10956. value = +value
  10957. offset = offset | 0
  10958. byteLength = byteLength | 0
  10959. if (!noAssert) {
  10960. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  10961. checkInt(this, value, offset, byteLength, maxBytes, 0)
  10962. }
  10963. var i = byteLength - 1
  10964. var mul = 1
  10965. this[offset + i] = value & 0xFF
  10966. while (--i >= 0 && (mul *= 0x100)) {
  10967. this[offset + i] = (value / mul) & 0xFF
  10968. }
  10969. return offset + byteLength
  10970. }
  10971. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  10972. value = +value
  10973. offset = offset | 0
  10974. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  10975. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  10976. this[offset] = (value & 0xff)
  10977. return offset + 1
  10978. }
  10979. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  10980. if (value < 0) value = 0xffff + value + 1
  10981. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  10982. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  10983. (littleEndian ? i : 1 - i) * 8
  10984. }
  10985. }
  10986. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  10987. value = +value
  10988. offset = offset | 0
  10989. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  10990. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10991. this[offset] = (value & 0xff)
  10992. this[offset + 1] = (value >>> 8)
  10993. } else {
  10994. objectWriteUInt16(this, value, offset, true)
  10995. }
  10996. return offset + 2
  10997. }
  10998. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  10999. value = +value
  11000. offset = offset | 0
  11001. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11002. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11003. this[offset] = (value >>> 8)
  11004. this[offset + 1] = (value & 0xff)
  11005. } else {
  11006. objectWriteUInt16(this, value, offset, false)
  11007. }
  11008. return offset + 2
  11009. }
  11010. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  11011. if (value < 0) value = 0xffffffff + value + 1
  11012. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  11013. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  11014. }
  11015. }
  11016. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  11017. value = +value
  11018. offset = offset | 0
  11019. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11020. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11021. this[offset + 3] = (value >>> 24)
  11022. this[offset + 2] = (value >>> 16)
  11023. this[offset + 1] = (value >>> 8)
  11024. this[offset] = (value & 0xff)
  11025. } else {
  11026. objectWriteUInt32(this, value, offset, true)
  11027. }
  11028. return offset + 4
  11029. }
  11030. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  11031. value = +value
  11032. offset = offset | 0
  11033. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11034. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11035. this[offset] = (value >>> 24)
  11036. this[offset + 1] = (value >>> 16)
  11037. this[offset + 2] = (value >>> 8)
  11038. this[offset + 3] = (value & 0xff)
  11039. } else {
  11040. objectWriteUInt32(this, value, offset, false)
  11041. }
  11042. return offset + 4
  11043. }
  11044. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  11045. value = +value
  11046. offset = offset | 0
  11047. if (!noAssert) {
  11048. var limit = Math.pow(2, 8 * byteLength - 1)
  11049. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11050. }
  11051. var i = 0
  11052. var mul = 1
  11053. var sub = 0
  11054. this[offset] = value & 0xFF
  11055. while (++i < byteLength && (mul *= 0x100)) {
  11056. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  11057. sub = 1
  11058. }
  11059. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11060. }
  11061. return offset + byteLength
  11062. }
  11063. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  11064. value = +value
  11065. offset = offset | 0
  11066. if (!noAssert) {
  11067. var limit = Math.pow(2, 8 * byteLength - 1)
  11068. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11069. }
  11070. var i = byteLength - 1
  11071. var mul = 1
  11072. var sub = 0
  11073. this[offset + i] = value & 0xFF
  11074. while (--i >= 0 && (mul *= 0x100)) {
  11075. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  11076. sub = 1
  11077. }
  11078. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11079. }
  11080. return offset + byteLength
  11081. }
  11082. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  11083. value = +value
  11084. offset = offset | 0
  11085. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  11086. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11087. if (value < 0) value = 0xff + value + 1
  11088. this[offset] = (value & 0xff)
  11089. return offset + 1
  11090. }
  11091. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  11092. value = +value
  11093. offset = offset | 0
  11094. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11095. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11096. this[offset] = (value & 0xff)
  11097. this[offset + 1] = (value >>> 8)
  11098. } else {
  11099. objectWriteUInt16(this, value, offset, true)
  11100. }
  11101. return offset + 2
  11102. }
  11103. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  11104. value = +value
  11105. offset = offset | 0
  11106. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11107. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11108. this[offset] = (value >>> 8)
  11109. this[offset + 1] = (value & 0xff)
  11110. } else {
  11111. objectWriteUInt16(this, value, offset, false)
  11112. }
  11113. return offset + 2
  11114. }
  11115. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  11116. value = +value
  11117. offset = offset | 0
  11118. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11119. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11120. this[offset] = (value & 0xff)
  11121. this[offset + 1] = (value >>> 8)
  11122. this[offset + 2] = (value >>> 16)
  11123. this[offset + 3] = (value >>> 24)
  11124. } else {
  11125. objectWriteUInt32(this, value, offset, true)
  11126. }
  11127. return offset + 4
  11128. }
  11129. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  11130. value = +value
  11131. offset = offset | 0
  11132. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11133. if (value < 0) value = 0xffffffff + value + 1
  11134. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11135. this[offset] = (value >>> 24)
  11136. this[offset + 1] = (value >>> 16)
  11137. this[offset + 2] = (value >>> 8)
  11138. this[offset + 3] = (value & 0xff)
  11139. } else {
  11140. objectWriteUInt32(this, value, offset, false)
  11141. }
  11142. return offset + 4
  11143. }
  11144. function checkIEEE754 (buf, value, offset, ext, max, min) {
  11145. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11146. if (offset < 0) throw new RangeError('Index out of range')
  11147. }
  11148. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  11149. if (!noAssert) {
  11150. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  11151. }
  11152. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  11153. return offset + 4
  11154. }
  11155. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  11156. return writeFloat(this, value, offset, true, noAssert)
  11157. }
  11158. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  11159. return writeFloat(this, value, offset, false, noAssert)
  11160. }
  11161. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  11162. if (!noAssert) {
  11163. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  11164. }
  11165. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  11166. return offset + 8
  11167. }
  11168. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  11169. return writeDouble(this, value, offset, true, noAssert)
  11170. }
  11171. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  11172. return writeDouble(this, value, offset, false, noAssert)
  11173. }
  11174. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  11175. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  11176. if (!start) start = 0
  11177. if (!end && end !== 0) end = this.length
  11178. if (targetStart >= target.length) targetStart = target.length
  11179. if (!targetStart) targetStart = 0
  11180. if (end > 0 && end < start) end = start
  11181. // Copy 0 bytes; we're done
  11182. if (end === start) return 0
  11183. if (target.length === 0 || this.length === 0) return 0
  11184. // Fatal error conditions
  11185. if (targetStart < 0) {
  11186. throw new RangeError('targetStart out of bounds')
  11187. }
  11188. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  11189. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  11190. // Are we oob?
  11191. if (end > this.length) end = this.length
  11192. if (target.length - targetStart < end - start) {
  11193. end = target.length - targetStart + start
  11194. }
  11195. var len = end - start
  11196. var i
  11197. if (this === target && start < targetStart && targetStart < end) {
  11198. // descending copy from end
  11199. for (i = len - 1; i >= 0; --i) {
  11200. target[i + targetStart] = this[i + start]
  11201. }
  11202. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  11203. // ascending copy from start
  11204. for (i = 0; i < len; ++i) {
  11205. target[i + targetStart] = this[i + start]
  11206. }
  11207. } else {
  11208. Uint8Array.prototype.set.call(
  11209. target,
  11210. this.subarray(start, start + len),
  11211. targetStart
  11212. )
  11213. }
  11214. return len
  11215. }
  11216. // Usage:
  11217. // buffer.fill(number[, offset[, end]])
  11218. // buffer.fill(buffer[, offset[, end]])
  11219. // buffer.fill(string[, offset[, end]][, encoding])
  11220. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  11221. // Handle string cases:
  11222. if (typeof val === 'string') {
  11223. if (typeof start === 'string') {
  11224. encoding = start
  11225. start = 0
  11226. end = this.length
  11227. } else if (typeof end === 'string') {
  11228. encoding = end
  11229. end = this.length
  11230. }
  11231. if (val.length === 1) {
  11232. var code = val.charCodeAt(0)
  11233. if (code < 256) {
  11234. val = code
  11235. }
  11236. }
  11237. if (encoding !== undefined && typeof encoding !== 'string') {
  11238. throw new TypeError('encoding must be a string')
  11239. }
  11240. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  11241. throw new TypeError('Unknown encoding: ' + encoding)
  11242. }
  11243. } else if (typeof val === 'number') {
  11244. val = val & 255
  11245. }
  11246. // Invalid ranges are not set to a default, so can range check early.
  11247. if (start < 0 || this.length < start || this.length < end) {
  11248. throw new RangeError('Out of range index')
  11249. }
  11250. if (end <= start) {
  11251. return this
  11252. }
  11253. start = start >>> 0
  11254. end = end === undefined ? this.length : end >>> 0
  11255. if (!val) val = 0
  11256. var i
  11257. if (typeof val === 'number') {
  11258. for (i = start; i < end; ++i) {
  11259. this[i] = val
  11260. }
  11261. } else {
  11262. var bytes = Buffer.isBuffer(val)
  11263. ? val
  11264. : utf8ToBytes(new Buffer(val, encoding).toString())
  11265. var len = bytes.length
  11266. for (i = 0; i < end - start; ++i) {
  11267. this[i + start] = bytes[i % len]
  11268. }
  11269. }
  11270. return this
  11271. }
  11272. // HELPER FUNCTIONS
  11273. // ================
  11274. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  11275. function base64clean (str) {
  11276. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  11277. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  11278. // Node converts strings with length < 2 to ''
  11279. if (str.length < 2) return ''
  11280. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  11281. while (str.length % 4 !== 0) {
  11282. str = str + '='
  11283. }
  11284. return str
  11285. }
  11286. function stringtrim (str) {
  11287. if (str.trim) return str.trim()
  11288. return str.replace(/^\s+|\s+$/g, '')
  11289. }
  11290. function toHex (n) {
  11291. if (n < 16) return '0' + n.toString(16)
  11292. return n.toString(16)
  11293. }
  11294. function utf8ToBytes (string, units) {
  11295. units = units || Infinity
  11296. var codePoint
  11297. var length = string.length
  11298. var leadSurrogate = null
  11299. var bytes = []
  11300. for (var i = 0; i < length; ++i) {
  11301. codePoint = string.charCodeAt(i)
  11302. // is surrogate component
  11303. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  11304. // last char was a lead
  11305. if (!leadSurrogate) {
  11306. // no lead yet
  11307. if (codePoint > 0xDBFF) {
  11308. // unexpected trail
  11309. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11310. continue
  11311. } else if (i + 1 === length) {
  11312. // unpaired lead
  11313. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11314. continue
  11315. }
  11316. // valid lead
  11317. leadSurrogate = codePoint
  11318. continue
  11319. }
  11320. // 2 leads in a row
  11321. if (codePoint < 0xDC00) {
  11322. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11323. leadSurrogate = codePoint
  11324. continue
  11325. }
  11326. // valid surrogate pair
  11327. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  11328. } else if (leadSurrogate) {
  11329. // valid bmp char, but last char was a lead
  11330. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  11331. }
  11332. leadSurrogate = null
  11333. // encode utf8
  11334. if (codePoint < 0x80) {
  11335. if ((units -= 1) < 0) break
  11336. bytes.push(codePoint)
  11337. } else if (codePoint < 0x800) {
  11338. if ((units -= 2) < 0) break
  11339. bytes.push(
  11340. codePoint >> 0x6 | 0xC0,
  11341. codePoint & 0x3F | 0x80
  11342. )
  11343. } else if (codePoint < 0x10000) {
  11344. if ((units -= 3) < 0) break
  11345. bytes.push(
  11346. codePoint >> 0xC | 0xE0,
  11347. codePoint >> 0x6 & 0x3F | 0x80,
  11348. codePoint & 0x3F | 0x80
  11349. )
  11350. } else if (codePoint < 0x110000) {
  11351. if ((units -= 4) < 0) break
  11352. bytes.push(
  11353. codePoint >> 0x12 | 0xF0,
  11354. codePoint >> 0xC & 0x3F | 0x80,
  11355. codePoint >> 0x6 & 0x3F | 0x80,
  11356. codePoint & 0x3F | 0x80
  11357. )
  11358. } else {
  11359. throw new Error('Invalid code point')
  11360. }
  11361. }
  11362. return bytes
  11363. }
  11364. function asciiToBytes (str) {
  11365. var byteArray = []
  11366. for (var i = 0; i < str.length; ++i) {
  11367. // Node's code seems to be doing this and not & 0x7F..
  11368. byteArray.push(str.charCodeAt(i) & 0xFF)
  11369. }
  11370. return byteArray
  11371. }
  11372. function utf16leToBytes (str, units) {
  11373. var c, hi, lo
  11374. var byteArray = []
  11375. for (var i = 0; i < str.length; ++i) {
  11376. if ((units -= 2) < 0) break
  11377. c = str.charCodeAt(i)
  11378. hi = c >> 8
  11379. lo = c % 256
  11380. byteArray.push(lo)
  11381. byteArray.push(hi)
  11382. }
  11383. return byteArray
  11384. }
  11385. function base64ToBytes (str) {
  11386. return base64.toByteArray(base64clean(str))
  11387. }
  11388. function blitBuffer (src, dst, offset, length) {
  11389. for (var i = 0; i < length; ++i) {
  11390. if ((i + offset >= dst.length) || (i >= src.length)) break
  11391. dst[i + offset] = src[i]
  11392. }
  11393. return i
  11394. }
  11395. function isnan (val) {
  11396. return val !== val // eslint-disable-line no-self-compare
  11397. }
  11398. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  11399. /***/ }),
  11400. /* 335 */
  11401. /***/ (function(module, exports) {
  11402. 'use strict'
  11403. exports.byteLength = byteLength
  11404. exports.toByteArray = toByteArray
  11405. exports.fromByteArray = fromByteArray
  11406. var lookup = []
  11407. var revLookup = []
  11408. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  11409. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  11410. for (var i = 0, len = code.length; i < len; ++i) {
  11411. lookup[i] = code[i]
  11412. revLookup[code.charCodeAt(i)] = i
  11413. }
  11414. // Support decoding URL-safe base64 strings, as Node.js does.
  11415. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  11416. revLookup['-'.charCodeAt(0)] = 62
  11417. revLookup['_'.charCodeAt(0)] = 63
  11418. function getLens (b64) {
  11419. var len = b64.length
  11420. if (len % 4 > 0) {
  11421. throw new Error('Invalid string. Length must be a multiple of 4')
  11422. }
  11423. // Trim off extra bytes after placeholder bytes are found
  11424. // See: https://github.com/beatgammit/base64-js/issues/42
  11425. var validLen = b64.indexOf('=')
  11426. if (validLen === -1) validLen = len
  11427. var placeHoldersLen = validLen === len
  11428. ? 0
  11429. : 4 - (validLen % 4)
  11430. return [validLen, placeHoldersLen]
  11431. }
  11432. // base64 is 4/3 + up to two characters of the original data
  11433. function byteLength (b64) {
  11434. var lens = getLens(b64)
  11435. var validLen = lens[0]
  11436. var placeHoldersLen = lens[1]
  11437. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  11438. }
  11439. function _byteLength (b64, validLen, placeHoldersLen) {
  11440. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  11441. }
  11442. function toByteArray (b64) {
  11443. var tmp
  11444. var lens = getLens(b64)
  11445. var validLen = lens[0]
  11446. var placeHoldersLen = lens[1]
  11447. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  11448. var curByte = 0
  11449. // if there are placeholders, only get up to the last complete 4 chars
  11450. var len = placeHoldersLen > 0
  11451. ? validLen - 4
  11452. : validLen
  11453. for (var i = 0; i < len; i += 4) {
  11454. tmp =
  11455. (revLookup[b64.charCodeAt(i)] << 18) |
  11456. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  11457. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  11458. revLookup[b64.charCodeAt(i + 3)]
  11459. arr[curByte++] = (tmp >> 16) & 0xFF
  11460. arr[curByte++] = (tmp >> 8) & 0xFF
  11461. arr[curByte++] = tmp & 0xFF
  11462. }
  11463. if (placeHoldersLen === 2) {
  11464. tmp =
  11465. (revLookup[b64.charCodeAt(i)] << 2) |
  11466. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  11467. arr[curByte++] = tmp & 0xFF
  11468. }
  11469. if (placeHoldersLen === 1) {
  11470. tmp =
  11471. (revLookup[b64.charCodeAt(i)] << 10) |
  11472. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  11473. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  11474. arr[curByte++] = (tmp >> 8) & 0xFF
  11475. arr[curByte++] = tmp & 0xFF
  11476. }
  11477. return arr
  11478. }
  11479. function tripletToBase64 (num) {
  11480. return lookup[num >> 18 & 0x3F] +
  11481. lookup[num >> 12 & 0x3F] +
  11482. lookup[num >> 6 & 0x3F] +
  11483. lookup[num & 0x3F]
  11484. }
  11485. function encodeChunk (uint8, start, end) {
  11486. var tmp
  11487. var output = []
  11488. for (var i = start; i < end; i += 3) {
  11489. tmp =
  11490. ((uint8[i] << 16) & 0xFF0000) +
  11491. ((uint8[i + 1] << 8) & 0xFF00) +
  11492. (uint8[i + 2] & 0xFF)
  11493. output.push(tripletToBase64(tmp))
  11494. }
  11495. return output.join('')
  11496. }
  11497. function fromByteArray (uint8) {
  11498. var tmp
  11499. var len = uint8.length
  11500. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  11501. var parts = []
  11502. var maxChunkLength = 16383 // must be multiple of 3
  11503. // go through the array every three bytes, we'll deal with trailing stuff later
  11504. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  11505. parts.push(encodeChunk(
  11506. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  11507. ))
  11508. }
  11509. // pad the end with zeros, but make sure to not forget the extra bytes
  11510. if (extraBytes === 1) {
  11511. tmp = uint8[len - 1]
  11512. parts.push(
  11513. lookup[tmp >> 2] +
  11514. lookup[(tmp << 4) & 0x3F] +
  11515. '=='
  11516. )
  11517. } else if (extraBytes === 2) {
  11518. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  11519. parts.push(
  11520. lookup[tmp >> 10] +
  11521. lookup[(tmp >> 4) & 0x3F] +
  11522. lookup[(tmp << 2) & 0x3F] +
  11523. '='
  11524. )
  11525. }
  11526. return parts.join('')
  11527. }
  11528. /***/ }),
  11529. /* 336 */
  11530. /***/ (function(module, exports) {
  11531. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  11532. var e, m
  11533. var eLen = (nBytes * 8) - mLen - 1
  11534. var eMax = (1 << eLen) - 1
  11535. var eBias = eMax >> 1
  11536. var nBits = -7
  11537. var i = isLE ? (nBytes - 1) : 0
  11538. var d = isLE ? -1 : 1
  11539. var s = buffer[offset + i]
  11540. i += d
  11541. e = s & ((1 << (-nBits)) - 1)
  11542. s >>= (-nBits)
  11543. nBits += eLen
  11544. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  11545. m = e & ((1 << (-nBits)) - 1)
  11546. e >>= (-nBits)
  11547. nBits += mLen
  11548. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  11549. if (e === 0) {
  11550. e = 1 - eBias
  11551. } else if (e === eMax) {
  11552. return m ? NaN : ((s ? -1 : 1) * Infinity)
  11553. } else {
  11554. m = m + Math.pow(2, mLen)
  11555. e = e - eBias
  11556. }
  11557. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  11558. }
  11559. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  11560. var e, m, c
  11561. var eLen = (nBytes * 8) - mLen - 1
  11562. var eMax = (1 << eLen) - 1
  11563. var eBias = eMax >> 1
  11564. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  11565. var i = isLE ? 0 : (nBytes - 1)
  11566. var d = isLE ? 1 : -1
  11567. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  11568. value = Math.abs(value)
  11569. if (isNaN(value) || value === Infinity) {
  11570. m = isNaN(value) ? 1 : 0
  11571. e = eMax
  11572. } else {
  11573. e = Math.floor(Math.log(value) / Math.LN2)
  11574. if (value * (c = Math.pow(2, -e)) < 1) {
  11575. e--
  11576. c *= 2
  11577. }
  11578. if (e + eBias >= 1) {
  11579. value += rt / c
  11580. } else {
  11581. value += rt * Math.pow(2, 1 - eBias)
  11582. }
  11583. if (value * c >= 2) {
  11584. e++
  11585. c /= 2
  11586. }
  11587. if (e + eBias >= eMax) {
  11588. m = 0
  11589. e = eMax
  11590. } else if (e + eBias >= 1) {
  11591. m = ((value * c) - 1) * Math.pow(2, mLen)
  11592. e = e + eBias
  11593. } else {
  11594. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  11595. e = 0
  11596. }
  11597. }
  11598. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  11599. e = (e << mLen) | m
  11600. eLen += mLen
  11601. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  11602. buffer[offset + i - d] |= s * 128
  11603. }
  11604. /***/ }),
  11605. /* 337 */
  11606. /***/ (function(module, exports) {
  11607. var toString = {}.toString;
  11608. module.exports = Array.isArray || function (arr) {
  11609. return toString.call(arr) == '[object Array]';
  11610. };
  11611. /***/ }),
  11612. /* 338 */
  11613. /***/ (function(module, exports) {
  11614. // shim for using process in browser
  11615. var process = module.exports = {};
  11616. // cached from whatever global is present so that test runners that stub it
  11617. // don't break things. But we need to wrap it in a try catch in case it is
  11618. // wrapped in strict mode code which doesn't define any globals. It's inside a
  11619. // function because try/catches deoptimize in certain engines.
  11620. var cachedSetTimeout;
  11621. var cachedClearTimeout;
  11622. function defaultSetTimout() {
  11623. throw new Error('setTimeout has not been defined');
  11624. }
  11625. function defaultClearTimeout () {
  11626. throw new Error('clearTimeout has not been defined');
  11627. }
  11628. (function () {
  11629. try {
  11630. if (typeof setTimeout === 'function') {
  11631. cachedSetTimeout = setTimeout;
  11632. } else {
  11633. cachedSetTimeout = defaultSetTimout;
  11634. }
  11635. } catch (e) {
  11636. cachedSetTimeout = defaultSetTimout;
  11637. }
  11638. try {
  11639. if (typeof clearTimeout === 'function') {
  11640. cachedClearTimeout = clearTimeout;
  11641. } else {
  11642. cachedClearTimeout = defaultClearTimeout;
  11643. }
  11644. } catch (e) {
  11645. cachedClearTimeout = defaultClearTimeout;
  11646. }
  11647. } ())
  11648. function runTimeout(fun) {
  11649. if (cachedSetTimeout === setTimeout) {
  11650. //normal enviroments in sane situations
  11651. return setTimeout(fun, 0);
  11652. }
  11653. // if setTimeout wasn't available but was latter defined
  11654. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  11655. cachedSetTimeout = setTimeout;
  11656. return setTimeout(fun, 0);
  11657. }
  11658. try {
  11659. // when when somebody has screwed with setTimeout but no I.E. maddness
  11660. return cachedSetTimeout(fun, 0);
  11661. } catch(e){
  11662. try {
  11663. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  11664. return cachedSetTimeout.call(null, fun, 0);
  11665. } catch(e){
  11666. // 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
  11667. return cachedSetTimeout.call(this, fun, 0);
  11668. }
  11669. }
  11670. }
  11671. function runClearTimeout(marker) {
  11672. if (cachedClearTimeout === clearTimeout) {
  11673. //normal enviroments in sane situations
  11674. return clearTimeout(marker);
  11675. }
  11676. // if clearTimeout wasn't available but was latter defined
  11677. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  11678. cachedClearTimeout = clearTimeout;
  11679. return clearTimeout(marker);
  11680. }
  11681. try {
  11682. // when when somebody has screwed with setTimeout but no I.E. maddness
  11683. return cachedClearTimeout(marker);
  11684. } catch (e){
  11685. try {
  11686. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  11687. return cachedClearTimeout.call(null, marker);
  11688. } catch (e){
  11689. // 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.
  11690. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  11691. return cachedClearTimeout.call(this, marker);
  11692. }
  11693. }
  11694. }
  11695. var queue = [];
  11696. var draining = false;
  11697. var currentQueue;
  11698. var queueIndex = -1;
  11699. function cleanUpNextTick() {
  11700. if (!draining || !currentQueue) {
  11701. return;
  11702. }
  11703. draining = false;
  11704. if (currentQueue.length) {
  11705. queue = currentQueue.concat(queue);
  11706. } else {
  11707. queueIndex = -1;
  11708. }
  11709. if (queue.length) {
  11710. drainQueue();
  11711. }
  11712. }
  11713. function drainQueue() {
  11714. if (draining) {
  11715. return;
  11716. }
  11717. var timeout = runTimeout(cleanUpNextTick);
  11718. draining = true;
  11719. var len = queue.length;
  11720. while(len) {
  11721. currentQueue = queue;
  11722. queue = [];
  11723. while (++queueIndex < len) {
  11724. if (currentQueue) {
  11725. currentQueue[queueIndex].run();
  11726. }
  11727. }
  11728. queueIndex = -1;
  11729. len = queue.length;
  11730. }
  11731. currentQueue = null;
  11732. draining = false;
  11733. runClearTimeout(timeout);
  11734. }
  11735. process.nextTick = function (fun) {
  11736. var args = new Array(arguments.length - 1);
  11737. if (arguments.length > 1) {
  11738. for (var i = 1; i < arguments.length; i++) {
  11739. args[i - 1] = arguments[i];
  11740. }
  11741. }
  11742. queue.push(new Item(fun, args));
  11743. if (queue.length === 1 && !draining) {
  11744. runTimeout(drainQueue);
  11745. }
  11746. };
  11747. // v8 likes predictible objects
  11748. function Item(fun, array) {
  11749. this.fun = fun;
  11750. this.array = array;
  11751. }
  11752. Item.prototype.run = function () {
  11753. this.fun.apply(null, this.array);
  11754. };
  11755. process.title = 'browser';
  11756. process.browser = true;
  11757. process.env = {};
  11758. process.argv = [];
  11759. process.version = ''; // empty string to avoid regexp issues
  11760. process.versions = {};
  11761. function noop() {}
  11762. process.on = noop;
  11763. process.addListener = noop;
  11764. process.once = noop;
  11765. process.off = noop;
  11766. process.removeListener = noop;
  11767. process.removeAllListeners = noop;
  11768. process.emit = noop;
  11769. process.prependListener = noop;
  11770. process.prependOnceListener = noop;
  11771. process.listeners = function (name) { return [] }
  11772. process.binding = function (name) {
  11773. throw new Error('process.binding is not supported');
  11774. };
  11775. process.cwd = function () { return '/' };
  11776. process.chdir = function (dir) {
  11777. throw new Error('process.chdir is not supported');
  11778. };
  11779. process.umask = function() { return 0; };
  11780. /***/ }),
  11781. /* 339 */
  11782. /***/ (function(module, exports, __webpack_require__) {
  11783. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  11784. /**
  11785. * Normalizes our expected stringified form of a function across versions of node
  11786. * @param {Function} fn The function to stringify
  11787. */
  11788. function normalizedFunctionString(fn) {
  11789. return fn.toString().replace(/function *\(/, 'function (');
  11790. }
  11791. function newBuffer(item, encoding) {
  11792. return new Buffer(item, encoding);
  11793. }
  11794. function allocBuffer() {
  11795. return Buffer.alloc.apply(Buffer, arguments);
  11796. }
  11797. function toBuffer() {
  11798. return Buffer.from.apply(Buffer, arguments);
  11799. }
  11800. module.exports = {
  11801. normalizedFunctionString: normalizedFunctionString,
  11802. allocBuffer: typeof Buffer.alloc === 'function' ? allocBuffer : newBuffer,
  11803. toBuffer: typeof Buffer.from === 'function' ? toBuffer : newBuffer
  11804. };
  11805. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(334).Buffer))
  11806. /***/ }),
  11807. /* 340 */
  11808. /***/ (function(module, exports, __webpack_require__) {
  11809. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  11810. //
  11811. // Permission is hereby granted, free of charge, to any person obtaining a
  11812. // copy of this software and associated documentation files (the
  11813. // "Software"), to deal in the Software without restriction, including
  11814. // without limitation the rights to use, copy, modify, merge, publish,
  11815. // distribute, sublicense, and/or sell copies of the Software, and to permit
  11816. // persons to whom the Software is furnished to do so, subject to the
  11817. // following conditions:
  11818. //
  11819. // The above copyright notice and this permission notice shall be included
  11820. // in all copies or substantial portions of the Software.
  11821. //
  11822. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11823. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  11824. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  11825. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  11826. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  11827. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  11828. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  11829. var formatRegExp = /%[sdj%]/g;
  11830. exports.format = function(f) {
  11831. if (!isString(f)) {
  11832. var objects = [];
  11833. for (var i = 0; i < arguments.length; i++) {
  11834. objects.push(inspect(arguments[i]));
  11835. }
  11836. return objects.join(' ');
  11837. }
  11838. var i = 1;
  11839. var args = arguments;
  11840. var len = args.length;
  11841. var str = String(f).replace(formatRegExp, function(x) {
  11842. if (x === '%%') return '%';
  11843. if (i >= len) return x;
  11844. switch (x) {
  11845. case '%s': return String(args[i++]);
  11846. case '%d': return Number(args[i++]);
  11847. case '%j':
  11848. try {
  11849. return JSON.stringify(args[i++]);
  11850. } catch (_) {
  11851. return '[Circular]';
  11852. }
  11853. default:
  11854. return x;
  11855. }
  11856. });
  11857. for (var x = args[i]; i < len; x = args[++i]) {
  11858. if (isNull(x) || !isObject(x)) {
  11859. str += ' ' + x;
  11860. } else {
  11861. str += ' ' + inspect(x);
  11862. }
  11863. }
  11864. return str;
  11865. };
  11866. // Mark that a method should not be used.
  11867. // Returns a modified function which warns once by default.
  11868. // If --no-deprecation is set, then it is a no-op.
  11869. exports.deprecate = function(fn, msg) {
  11870. // Allow for deprecating things in the process of starting up.
  11871. if (isUndefined(global.process)) {
  11872. return function() {
  11873. return exports.deprecate(fn, msg).apply(this, arguments);
  11874. };
  11875. }
  11876. if (process.noDeprecation === true) {
  11877. return fn;
  11878. }
  11879. var warned = false;
  11880. function deprecated() {
  11881. if (!warned) {
  11882. if (process.throwDeprecation) {
  11883. throw new Error(msg);
  11884. } else if (process.traceDeprecation) {
  11885. console.trace(msg);
  11886. } else {
  11887. console.error(msg);
  11888. }
  11889. warned = true;
  11890. }
  11891. return fn.apply(this, arguments);
  11892. }
  11893. return deprecated;
  11894. };
  11895. var debugs = {};
  11896. var debugEnviron;
  11897. exports.debuglog = function(set) {
  11898. if (isUndefined(debugEnviron))
  11899. debugEnviron = process.env.NODE_DEBUG || '';
  11900. set = set.toUpperCase();
  11901. if (!debugs[set]) {
  11902. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  11903. var pid = process.pid;
  11904. debugs[set] = function() {
  11905. var msg = exports.format.apply(exports, arguments);
  11906. console.error('%s %d: %s', set, pid, msg);
  11907. };
  11908. } else {
  11909. debugs[set] = function() {};
  11910. }
  11911. }
  11912. return debugs[set];
  11913. };
  11914. /**
  11915. * Echos the value of a value. Trys to print the value out
  11916. * in the best way possible given the different types.
  11917. *
  11918. * @param {Object} obj The object to print out.
  11919. * @param {Object} opts Optional options object that alters the output.
  11920. */
  11921. /* legacy: obj, showHidden, depth, colors*/
  11922. function inspect(obj, opts) {
  11923. // default options
  11924. var ctx = {
  11925. seen: [],
  11926. stylize: stylizeNoColor
  11927. };
  11928. // legacy...
  11929. if (arguments.length >= 3) ctx.depth = arguments[2];
  11930. if (arguments.length >= 4) ctx.colors = arguments[3];
  11931. if (isBoolean(opts)) {
  11932. // legacy...
  11933. ctx.showHidden = opts;
  11934. } else if (opts) {
  11935. // got an "options" object
  11936. exports._extend(ctx, opts);
  11937. }
  11938. // set default options
  11939. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  11940. if (isUndefined(ctx.depth)) ctx.depth = 2;
  11941. if (isUndefined(ctx.colors)) ctx.colors = false;
  11942. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  11943. if (ctx.colors) ctx.stylize = stylizeWithColor;
  11944. return formatValue(ctx, obj, ctx.depth);
  11945. }
  11946. exports.inspect = inspect;
  11947. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  11948. inspect.colors = {
  11949. 'bold' : [1, 22],
  11950. 'italic' : [3, 23],
  11951. 'underline' : [4, 24],
  11952. 'inverse' : [7, 27],
  11953. 'white' : [37, 39],
  11954. 'grey' : [90, 39],
  11955. 'black' : [30, 39],
  11956. 'blue' : [34, 39],
  11957. 'cyan' : [36, 39],
  11958. 'green' : [32, 39],
  11959. 'magenta' : [35, 39],
  11960. 'red' : [31, 39],
  11961. 'yellow' : [33, 39]
  11962. };
  11963. // Don't use 'blue' not visible on cmd.exe
  11964. inspect.styles = {
  11965. 'special': 'cyan',
  11966. 'number': 'yellow',
  11967. 'boolean': 'yellow',
  11968. 'undefined': 'grey',
  11969. 'null': 'bold',
  11970. 'string': 'green',
  11971. 'date': 'magenta',
  11972. // "name": intentionally not styling
  11973. 'regexp': 'red'
  11974. };
  11975. function stylizeWithColor(str, styleType) {
  11976. var style = inspect.styles[styleType];
  11977. if (style) {
  11978. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  11979. '\u001b[' + inspect.colors[style][1] + 'm';
  11980. } else {
  11981. return str;
  11982. }
  11983. }
  11984. function stylizeNoColor(str, styleType) {
  11985. return str;
  11986. }
  11987. function arrayToHash(array) {
  11988. var hash = {};
  11989. array.forEach(function(val, idx) {
  11990. hash[val] = true;
  11991. });
  11992. return hash;
  11993. }
  11994. function formatValue(ctx, value, recurseTimes) {
  11995. // Provide a hook for user-specified inspect functions.
  11996. // Check that value is an object with an inspect function on it
  11997. if (ctx.customInspect &&
  11998. value &&
  11999. isFunction(value.inspect) &&
  12000. // Filter out the util module, it's inspect function is special
  12001. value.inspect !== exports.inspect &&
  12002. // Also filter out any prototype objects using the circular check.
  12003. !(value.constructor && value.constructor.prototype === value)) {
  12004. var ret = value.inspect(recurseTimes, ctx);
  12005. if (!isString(ret)) {
  12006. ret = formatValue(ctx, ret, recurseTimes);
  12007. }
  12008. return ret;
  12009. }
  12010. // Primitive types cannot have properties
  12011. var primitive = formatPrimitive(ctx, value);
  12012. if (primitive) {
  12013. return primitive;
  12014. }
  12015. // Look up the keys of the object.
  12016. var keys = Object.keys(value);
  12017. var visibleKeys = arrayToHash(keys);
  12018. if (ctx.showHidden) {
  12019. keys = Object.getOwnPropertyNames(value);
  12020. }
  12021. // IE doesn't make error fields non-enumerable
  12022. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  12023. if (isError(value)
  12024. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  12025. return formatError(value);
  12026. }
  12027. // Some type of object without properties can be shortcutted.
  12028. if (keys.length === 0) {
  12029. if (isFunction(value)) {
  12030. var name = value.name ? ': ' + value.name : '';
  12031. return ctx.stylize('[Function' + name + ']', 'special');
  12032. }
  12033. if (isRegExp(value)) {
  12034. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  12035. }
  12036. if (isDate(value)) {
  12037. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  12038. }
  12039. if (isError(value)) {
  12040. return formatError(value);
  12041. }
  12042. }
  12043. var base = '', array = false, braces = ['{', '}'];
  12044. // Make Array say that they are Array
  12045. if (isArray(value)) {
  12046. array = true;
  12047. braces = ['[', ']'];
  12048. }
  12049. // Make functions say that they are functions
  12050. if (isFunction(value)) {
  12051. var n = value.name ? ': ' + value.name : '';
  12052. base = ' [Function' + n + ']';
  12053. }
  12054. // Make RegExps say that they are RegExps
  12055. if (isRegExp(value)) {
  12056. base = ' ' + RegExp.prototype.toString.call(value);
  12057. }
  12058. // Make dates with properties first say the date
  12059. if (isDate(value)) {
  12060. base = ' ' + Date.prototype.toUTCString.call(value);
  12061. }
  12062. // Make error with message first say the error
  12063. if (isError(value)) {
  12064. base = ' ' + formatError(value);
  12065. }
  12066. if (keys.length === 0 && (!array || value.length == 0)) {
  12067. return braces[0] + base + braces[1];
  12068. }
  12069. if (recurseTimes < 0) {
  12070. if (isRegExp(value)) {
  12071. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  12072. } else {
  12073. return ctx.stylize('[Object]', 'special');
  12074. }
  12075. }
  12076. ctx.seen.push(value);
  12077. var output;
  12078. if (array) {
  12079. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  12080. } else {
  12081. output = keys.map(function(key) {
  12082. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  12083. });
  12084. }
  12085. ctx.seen.pop();
  12086. return reduceToSingleString(output, base, braces);
  12087. }
  12088. function formatPrimitive(ctx, value) {
  12089. if (isUndefined(value))
  12090. return ctx.stylize('undefined', 'undefined');
  12091. if (isString(value)) {
  12092. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  12093. .replace(/'/g, "\\'")
  12094. .replace(/\\"/g, '"') + '\'';
  12095. return ctx.stylize(simple, 'string');
  12096. }
  12097. if (isNumber(value))
  12098. return ctx.stylize('' + value, 'number');
  12099. if (isBoolean(value))
  12100. return ctx.stylize('' + value, 'boolean');
  12101. // For some reason typeof null is "object", so special case here.
  12102. if (isNull(value))
  12103. return ctx.stylize('null', 'null');
  12104. }
  12105. function formatError(value) {
  12106. return '[' + Error.prototype.toString.call(value) + ']';
  12107. }
  12108. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  12109. var output = [];
  12110. for (var i = 0, l = value.length; i < l; ++i) {
  12111. if (hasOwnProperty(value, String(i))) {
  12112. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  12113. String(i), true));
  12114. } else {
  12115. output.push('');
  12116. }
  12117. }
  12118. keys.forEach(function(key) {
  12119. if (!key.match(/^\d+$/)) {
  12120. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  12121. key, true));
  12122. }
  12123. });
  12124. return output;
  12125. }
  12126. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  12127. var name, str, desc;
  12128. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  12129. if (desc.get) {
  12130. if (desc.set) {
  12131. str = ctx.stylize('[Getter/Setter]', 'special');
  12132. } else {
  12133. str = ctx.stylize('[Getter]', 'special');
  12134. }
  12135. } else {
  12136. if (desc.set) {
  12137. str = ctx.stylize('[Setter]', 'special');
  12138. }
  12139. }
  12140. if (!hasOwnProperty(visibleKeys, key)) {
  12141. name = '[' + key + ']';
  12142. }
  12143. if (!str) {
  12144. if (ctx.seen.indexOf(desc.value) < 0) {
  12145. if (isNull(recurseTimes)) {
  12146. str = formatValue(ctx, desc.value, null);
  12147. } else {
  12148. str = formatValue(ctx, desc.value, recurseTimes - 1);
  12149. }
  12150. if (str.indexOf('\n') > -1) {
  12151. if (array) {
  12152. str = str.split('\n').map(function(line) {
  12153. return ' ' + line;
  12154. }).join('\n').substr(2);
  12155. } else {
  12156. str = '\n' + str.split('\n').map(function(line) {
  12157. return ' ' + line;
  12158. }).join('\n');
  12159. }
  12160. }
  12161. } else {
  12162. str = ctx.stylize('[Circular]', 'special');
  12163. }
  12164. }
  12165. if (isUndefined(name)) {
  12166. if (array && key.match(/^\d+$/)) {
  12167. return str;
  12168. }
  12169. name = JSON.stringify('' + key);
  12170. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  12171. name = name.substr(1, name.length - 2);
  12172. name = ctx.stylize(name, 'name');
  12173. } else {
  12174. name = name.replace(/'/g, "\\'")
  12175. .replace(/\\"/g, '"')
  12176. .replace(/(^"|"$)/g, "'");
  12177. name = ctx.stylize(name, 'string');
  12178. }
  12179. }
  12180. return name + ': ' + str;
  12181. }
  12182. function reduceToSingleString(output, base, braces) {
  12183. var numLinesEst = 0;
  12184. var length = output.reduce(function(prev, cur) {
  12185. numLinesEst++;
  12186. if (cur.indexOf('\n') >= 0) numLinesEst++;
  12187. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  12188. }, 0);
  12189. if (length > 60) {
  12190. return braces[0] +
  12191. (base === '' ? '' : base + '\n ') +
  12192. ' ' +
  12193. output.join(',\n ') +
  12194. ' ' +
  12195. braces[1];
  12196. }
  12197. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  12198. }
  12199. // NOTE: These type checking functions intentionally don't use `instanceof`
  12200. // because it is fragile and can be easily faked with `Object.create()`.
  12201. function isArray(ar) {
  12202. return Array.isArray(ar);
  12203. }
  12204. exports.isArray = isArray;
  12205. function isBoolean(arg) {
  12206. return typeof arg === 'boolean';
  12207. }
  12208. exports.isBoolean = isBoolean;
  12209. function isNull(arg) {
  12210. return arg === null;
  12211. }
  12212. exports.isNull = isNull;
  12213. function isNullOrUndefined(arg) {
  12214. return arg == null;
  12215. }
  12216. exports.isNullOrUndefined = isNullOrUndefined;
  12217. function isNumber(arg) {
  12218. return typeof arg === 'number';
  12219. }
  12220. exports.isNumber = isNumber;
  12221. function isString(arg) {
  12222. return typeof arg === 'string';
  12223. }
  12224. exports.isString = isString;
  12225. function isSymbol(arg) {
  12226. return typeof arg === 'symbol';
  12227. }
  12228. exports.isSymbol = isSymbol;
  12229. function isUndefined(arg) {
  12230. return arg === void 0;
  12231. }
  12232. exports.isUndefined = isUndefined;
  12233. function isRegExp(re) {
  12234. return isObject(re) && objectToString(re) === '[object RegExp]';
  12235. }
  12236. exports.isRegExp = isRegExp;
  12237. function isObject(arg) {
  12238. return typeof arg === 'object' && arg !== null;
  12239. }
  12240. exports.isObject = isObject;
  12241. function isDate(d) {
  12242. return isObject(d) && objectToString(d) === '[object Date]';
  12243. }
  12244. exports.isDate = isDate;
  12245. function isError(e) {
  12246. return isObject(e) &&
  12247. (objectToString(e) === '[object Error]' || e instanceof Error);
  12248. }
  12249. exports.isError = isError;
  12250. function isFunction(arg) {
  12251. return typeof arg === 'function';
  12252. }
  12253. exports.isFunction = isFunction;
  12254. function isPrimitive(arg) {
  12255. return arg === null ||
  12256. typeof arg === 'boolean' ||
  12257. typeof arg === 'number' ||
  12258. typeof arg === 'string' ||
  12259. typeof arg === 'symbol' || // ES6 symbol
  12260. typeof arg === 'undefined';
  12261. }
  12262. exports.isPrimitive = isPrimitive;
  12263. exports.isBuffer = __webpack_require__(341);
  12264. function objectToString(o) {
  12265. return Object.prototype.toString.call(o);
  12266. }
  12267. function pad(n) {
  12268. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  12269. }
  12270. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  12271. 'Oct', 'Nov', 'Dec'];
  12272. // 26 Feb 16:19:34
  12273. function timestamp() {
  12274. var d = new Date();
  12275. var time = [pad(d.getHours()),
  12276. pad(d.getMinutes()),
  12277. pad(d.getSeconds())].join(':');
  12278. return [d.getDate(), months[d.getMonth()], time].join(' ');
  12279. }
  12280. // log is just a thin wrapper to console.log that prepends a timestamp
  12281. exports.log = function() {
  12282. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  12283. };
  12284. /**
  12285. * Inherit the prototype methods from one constructor into another.
  12286. *
  12287. * The Function.prototype.inherits from lang.js rewritten as a standalone
  12288. * function (not on Function.prototype). NOTE: If this file is to be loaded
  12289. * during bootstrapping this function needs to be rewritten using some native
  12290. * functions as prototype setup using normal JavaScript does not work as
  12291. * expected during bootstrapping (see mirror.js in r114903).
  12292. *
  12293. * @param {function} ctor Constructor function which needs to inherit the
  12294. * prototype.
  12295. * @param {function} superCtor Constructor function to inherit prototype from.
  12296. */
  12297. exports.inherits = __webpack_require__(342);
  12298. exports._extend = function(origin, add) {
  12299. // Don't do anything if add isn't an object
  12300. if (!add || !isObject(add)) return origin;
  12301. var keys = Object.keys(add);
  12302. var i = keys.length;
  12303. while (i--) {
  12304. origin[keys[i]] = add[keys[i]];
  12305. }
  12306. return origin;
  12307. };
  12308. function hasOwnProperty(obj, prop) {
  12309. return Object.prototype.hasOwnProperty.call(obj, prop);
  12310. }
  12311. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(338)))
  12312. /***/ }),
  12313. /* 341 */
  12314. /***/ (function(module, exports) {
  12315. module.exports = function isBuffer(arg) {
  12316. return arg && typeof arg === 'object'
  12317. && typeof arg.copy === 'function'
  12318. && typeof arg.fill === 'function'
  12319. && typeof arg.readUInt8 === 'function';
  12320. }
  12321. /***/ }),
  12322. /* 342 */
  12323. /***/ (function(module, exports) {
  12324. if (typeof Object.create === 'function') {
  12325. // implementation from standard node.js 'util' module
  12326. module.exports = function inherits(ctor, superCtor) {
  12327. ctor.super_ = superCtor
  12328. ctor.prototype = Object.create(superCtor.prototype, {
  12329. constructor: {
  12330. value: ctor,
  12331. enumerable: false,
  12332. writable: true,
  12333. configurable: true
  12334. }
  12335. });
  12336. };
  12337. } else {
  12338. // old school shim for old browsers
  12339. module.exports = function inherits(ctor, superCtor) {
  12340. ctor.super_ = superCtor
  12341. var TempCtor = function () {}
  12342. TempCtor.prototype = superCtor.prototype
  12343. ctor.prototype = new TempCtor()
  12344. ctor.prototype.constructor = ctor
  12345. }
  12346. }
  12347. /***/ }),
  12348. /* 343 */
  12349. /***/ (function(module, exports) {
  12350. /**
  12351. * A class representation of the BSON RegExp type.
  12352. *
  12353. * @class
  12354. * @return {BSONRegExp} A MinKey instance
  12355. */
  12356. function BSONRegExp(pattern, options) {
  12357. if (!(this instanceof BSONRegExp)) return new BSONRegExp();
  12358. // Execute
  12359. this._bsontype = 'BSONRegExp';
  12360. this.pattern = pattern || '';
  12361. this.options = options || '';
  12362. // Validate options
  12363. for (var i = 0; i < this.options.length; i++) {
  12364. if (!(this.options[i] === 'i' || this.options[i] === 'm' || this.options[i] === 'x' || this.options[i] === 'l' || this.options[i] === 's' || this.options[i] === 'u')) {
  12365. throw new Error('the regular expression options [' + this.options[i] + '] is not supported');
  12366. }
  12367. }
  12368. }
  12369. module.exports = BSONRegExp;
  12370. module.exports.BSONRegExp = BSONRegExp;
  12371. /***/ }),
  12372. /* 344 */
  12373. /***/ (function(module, exports, __webpack_require__) {
  12374. /* WEBPACK VAR INJECTION */(function(Buffer) {// Custom inspect property name / symbol.
  12375. var inspect = Buffer ? __webpack_require__(340).inspect.custom || 'inspect' : 'inspect';
  12376. /**
  12377. * A class representation of the BSON Symbol type.
  12378. *
  12379. * @class
  12380. * @deprecated
  12381. * @param {string} value the string representing the symbol.
  12382. * @return {Symbol}
  12383. */
  12384. function Symbol(value) {
  12385. if (!(this instanceof Symbol)) return new Symbol(value);
  12386. this._bsontype = 'Symbol';
  12387. this.value = value;
  12388. }
  12389. /**
  12390. * Access the wrapped string value.
  12391. *
  12392. * @method
  12393. * @return {String} returns the wrapped string.
  12394. */
  12395. Symbol.prototype.valueOf = function () {
  12396. return this.value;
  12397. };
  12398. /**
  12399. * @ignore
  12400. */
  12401. Symbol.prototype.toString = function () {
  12402. return this.value;
  12403. };
  12404. /**
  12405. * @ignore
  12406. */
  12407. Symbol.prototype[inspect] = function () {
  12408. return this.value;
  12409. };
  12410. /**
  12411. * @ignore
  12412. */
  12413. Symbol.prototype.toJSON = function () {
  12414. return this.value;
  12415. };
  12416. module.exports = Symbol;
  12417. module.exports.Symbol = Symbol;
  12418. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(334).Buffer))
  12419. /***/ }),
  12420. /* 345 */
  12421. /***/ (function(module, exports) {
  12422. /**
  12423. * A class representation of a BSON Int32 type.
  12424. *
  12425. * @class
  12426. * @param {number} value the number we want to represent as an int32.
  12427. * @return {Int32}
  12428. */
  12429. var Int32 = function (value) {
  12430. if (!(this instanceof Int32)) return new Int32(value);
  12431. this._bsontype = 'Int32';
  12432. this.value = value;
  12433. };
  12434. /**
  12435. * Access the number value.
  12436. *
  12437. * @method
  12438. * @return {number} returns the wrapped int32 number.
  12439. */
  12440. Int32.prototype.valueOf = function () {
  12441. return this.value;
  12442. };
  12443. /**
  12444. * @ignore
  12445. */
  12446. Int32.prototype.toJSON = function () {
  12447. return this.value;
  12448. };
  12449. module.exports = Int32;
  12450. module.exports.Int32 = Int32;
  12451. /***/ }),
  12452. /* 346 */
  12453. /***/ (function(module, exports) {
  12454. /**
  12455. * A class representation of the BSON Code type.
  12456. *
  12457. * @class
  12458. * @param {(string|function)} code a string or function.
  12459. * @param {Object} [scope] an optional scope for the function.
  12460. * @return {Code}
  12461. */
  12462. var Code = function Code(code, scope) {
  12463. if (!(this instanceof Code)) return new Code(code, scope);
  12464. this._bsontype = 'Code';
  12465. this.code = code;
  12466. this.scope = scope;
  12467. };
  12468. /**
  12469. * @ignore
  12470. */
  12471. Code.prototype.toJSON = function () {
  12472. return { scope: this.scope, code: this.code };
  12473. };
  12474. module.exports = Code;
  12475. module.exports.Code = Code;
  12476. /***/ }),
  12477. /* 347 */
  12478. /***/ (function(module, exports, __webpack_require__) {
  12479. 'use strict';
  12480. var Long = __webpack_require__(330);
  12481. var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/;
  12482. var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i;
  12483. var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i;
  12484. var EXPONENT_MAX = 6111;
  12485. var EXPONENT_MIN = -6176;
  12486. var EXPONENT_BIAS = 6176;
  12487. var MAX_DIGITS = 34;
  12488. // Nan value bits as 32 bit values (due to lack of longs)
  12489. var NAN_BUFFER = [0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12490. // Infinity value bits 32 bit values (due to lack of longs)
  12491. var INF_NEGATIVE_BUFFER = [0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12492. var INF_POSITIVE_BUFFER = [0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12493. var EXPONENT_REGEX = /^([-+])?(\d+)?$/;
  12494. var utils = __webpack_require__(339);
  12495. // Detect if the value is a digit
  12496. var isDigit = function (value) {
  12497. return !isNaN(parseInt(value, 10));
  12498. };
  12499. // Divide two uint128 values
  12500. var divideu128 = function (value) {
  12501. var DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
  12502. var _rem = Long.fromNumber(0);
  12503. var i = 0;
  12504. if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
  12505. return { quotient: value, rem: _rem };
  12506. }
  12507. for (i = 0; i <= 3; i++) {
  12508. // Adjust remainder to match value of next dividend
  12509. _rem = _rem.shiftLeft(32);
  12510. // Add the divided to _rem
  12511. _rem = _rem.add(new Long(value.parts[i], 0));
  12512. value.parts[i] = _rem.div(DIVISOR).low_;
  12513. _rem = _rem.modulo(DIVISOR);
  12514. }
  12515. return { quotient: value, rem: _rem };
  12516. };
  12517. // Multiply two Long values and return the 128 bit value
  12518. var multiply64x2 = function (left, right) {
  12519. if (!left && !right) {
  12520. return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
  12521. }
  12522. var leftHigh = left.shiftRightUnsigned(32);
  12523. var leftLow = new Long(left.getLowBits(), 0);
  12524. var rightHigh = right.shiftRightUnsigned(32);
  12525. var rightLow = new Long(right.getLowBits(), 0);
  12526. var productHigh = leftHigh.multiply(rightHigh);
  12527. var productMid = leftHigh.multiply(rightLow);
  12528. var productMid2 = leftLow.multiply(rightHigh);
  12529. var productLow = leftLow.multiply(rightLow);
  12530. productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  12531. productMid = new Long(productMid.getLowBits(), 0).add(productMid2).add(productLow.shiftRightUnsigned(32));
  12532. productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  12533. productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
  12534. // Return the 128 bit result
  12535. return { high: productHigh, low: productLow };
  12536. };
  12537. var lessThan = function (left, right) {
  12538. // Make values unsigned
  12539. var uhleft = left.high_ >>> 0;
  12540. var uhright = right.high_ >>> 0;
  12541. // Compare high bits first
  12542. if (uhleft < uhright) {
  12543. return true;
  12544. } else if (uhleft === uhright) {
  12545. var ulleft = left.low_ >>> 0;
  12546. var ulright = right.low_ >>> 0;
  12547. if (ulleft < ulright) return true;
  12548. }
  12549. return false;
  12550. };
  12551. // var longtoHex = function(value) {
  12552. // var buffer = utils.allocBuffer(8);
  12553. // var index = 0;
  12554. // // Encode the low 64 bits of the decimal
  12555. // // Encode low bits
  12556. // buffer[index++] = value.low_ & 0xff;
  12557. // buffer[index++] = (value.low_ >> 8) & 0xff;
  12558. // buffer[index++] = (value.low_ >> 16) & 0xff;
  12559. // buffer[index++] = (value.low_ >> 24) & 0xff;
  12560. // // Encode high bits
  12561. // buffer[index++] = value.high_ & 0xff;
  12562. // buffer[index++] = (value.high_ >> 8) & 0xff;
  12563. // buffer[index++] = (value.high_ >> 16) & 0xff;
  12564. // buffer[index++] = (value.high_ >> 24) & 0xff;
  12565. // return buffer.reverse().toString('hex');
  12566. // };
  12567. // var int32toHex = function(value) {
  12568. // var buffer = utils.allocBuffer(4);
  12569. // var index = 0;
  12570. // // Encode the low 64 bits of the decimal
  12571. // // Encode low bits
  12572. // buffer[index++] = value & 0xff;
  12573. // buffer[index++] = (value >> 8) & 0xff;
  12574. // buffer[index++] = (value >> 16) & 0xff;
  12575. // buffer[index++] = (value >> 24) & 0xff;
  12576. // return buffer.reverse().toString('hex');
  12577. // };
  12578. /**
  12579. * A class representation of the BSON Decimal128 type.
  12580. *
  12581. * @class
  12582. * @param {Buffer} bytes a buffer containing the raw Decimal128 bytes.
  12583. * @return {Double}
  12584. */
  12585. var Decimal128 = function (bytes) {
  12586. this._bsontype = 'Decimal128';
  12587. this.bytes = bytes;
  12588. };
  12589. /**
  12590. * Create a Decimal128 instance from a string representation
  12591. *
  12592. * @method
  12593. * @param {string} string a numeric string representation.
  12594. * @return {Decimal128} returns a Decimal128 instance.
  12595. */
  12596. Decimal128.fromString = function (string) {
  12597. // Parse state tracking
  12598. var isNegative = false;
  12599. var sawRadix = false;
  12600. var foundNonZero = false;
  12601. // Total number of significant digits (no leading or trailing zero)
  12602. var significantDigits = 0;
  12603. // Total number of significand digits read
  12604. var nDigitsRead = 0;
  12605. // Total number of digits (no leading zeros)
  12606. var nDigits = 0;
  12607. // The number of the digits after radix
  12608. var radixPosition = 0;
  12609. // The index of the first non-zero in *str*
  12610. var firstNonZero = 0;
  12611. // Digits Array
  12612. var digits = [0];
  12613. // The number of digits in digits
  12614. var nDigitsStored = 0;
  12615. // Insertion pointer for digits
  12616. var digitsInsert = 0;
  12617. // The index of the first non-zero digit
  12618. var firstDigit = 0;
  12619. // The index of the last digit
  12620. var lastDigit = 0;
  12621. // Exponent
  12622. var exponent = 0;
  12623. // loop index over array
  12624. var i = 0;
  12625. // The high 17 digits of the significand
  12626. var significandHigh = [0, 0];
  12627. // The low 17 digits of the significand
  12628. var significandLow = [0, 0];
  12629. // The biased exponent
  12630. var biasedExponent = 0;
  12631. // Read index
  12632. var index = 0;
  12633. // Trim the string
  12634. string = string.trim();
  12635. // Naively prevent against REDOS attacks.
  12636. // TODO: implementing a custom parsing for this, or refactoring the regex would yield
  12637. // further gains.
  12638. if (string.length >= 7000) {
  12639. throw new Error('' + string + ' not a valid Decimal128 string');
  12640. }
  12641. // Results
  12642. var stringMatch = string.match(PARSE_STRING_REGEXP);
  12643. var infMatch = string.match(PARSE_INF_REGEXP);
  12644. var nanMatch = string.match(PARSE_NAN_REGEXP);
  12645. // Validate the string
  12646. if (!stringMatch && !infMatch && !nanMatch || string.length === 0) {
  12647. throw new Error('' + string + ' not a valid Decimal128 string');
  12648. }
  12649. // Check if we have an illegal exponent format
  12650. if (stringMatch && stringMatch[4] && stringMatch[2] === undefined) {
  12651. throw new Error('' + string + ' not a valid Decimal128 string');
  12652. }
  12653. // Get the negative or positive sign
  12654. if (string[index] === '+' || string[index] === '-') {
  12655. isNegative = string[index++] === '-';
  12656. }
  12657. // Check if user passed Infinity or NaN
  12658. if (!isDigit(string[index]) && string[index] !== '.') {
  12659. if (string[index] === 'i' || string[index] === 'I') {
  12660. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12661. } else if (string[index] === 'N') {
  12662. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  12663. }
  12664. }
  12665. // Read all the digits
  12666. while (isDigit(string[index]) || string[index] === '.') {
  12667. if (string[index] === '.') {
  12668. if (sawRadix) {
  12669. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  12670. }
  12671. sawRadix = true;
  12672. index = index + 1;
  12673. continue;
  12674. }
  12675. if (nDigitsStored < 34) {
  12676. if (string[index] !== '0' || foundNonZero) {
  12677. if (!foundNonZero) {
  12678. firstNonZero = nDigitsRead;
  12679. }
  12680. foundNonZero = true;
  12681. // Only store 34 digits
  12682. digits[digitsInsert++] = parseInt(string[index], 10);
  12683. nDigitsStored = nDigitsStored + 1;
  12684. }
  12685. }
  12686. if (foundNonZero) {
  12687. nDigits = nDigits + 1;
  12688. }
  12689. if (sawRadix) {
  12690. radixPosition = radixPosition + 1;
  12691. }
  12692. nDigitsRead = nDigitsRead + 1;
  12693. index = index + 1;
  12694. }
  12695. if (sawRadix && !nDigitsRead) {
  12696. throw new Error('' + string + ' not a valid Decimal128 string');
  12697. }
  12698. // Read exponent if exists
  12699. if (string[index] === 'e' || string[index] === 'E') {
  12700. // Read exponent digits
  12701. var match = string.substr(++index).match(EXPONENT_REGEX);
  12702. // No digits read
  12703. if (!match || !match[2]) {
  12704. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  12705. }
  12706. // Get exponent
  12707. exponent = parseInt(match[0], 10);
  12708. // Adjust the index
  12709. index = index + match[0].length;
  12710. }
  12711. // Return not a number
  12712. if (string[index]) {
  12713. return new Decimal128(utils.toBuffer(NAN_BUFFER));
  12714. }
  12715. // Done reading input
  12716. // Find first non-zero digit in digits
  12717. firstDigit = 0;
  12718. if (!nDigitsStored) {
  12719. firstDigit = 0;
  12720. lastDigit = 0;
  12721. digits[0] = 0;
  12722. nDigits = 1;
  12723. nDigitsStored = 1;
  12724. significantDigits = 0;
  12725. } else {
  12726. lastDigit = nDigitsStored - 1;
  12727. significantDigits = nDigits;
  12728. if (exponent !== 0 && significantDigits !== 1) {
  12729. while (string[firstNonZero + significantDigits - 1] === '0') {
  12730. significantDigits = significantDigits - 1;
  12731. }
  12732. }
  12733. }
  12734. // Normalization of exponent
  12735. // Correct exponent based on radix position, and shift significand as needed
  12736. // to represent user input
  12737. // Overflow prevention
  12738. if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) {
  12739. exponent = EXPONENT_MIN;
  12740. } else {
  12741. exponent = exponent - radixPosition;
  12742. }
  12743. // Attempt to normalize the exponent
  12744. while (exponent > EXPONENT_MAX) {
  12745. // Shift exponent to significand and decrease
  12746. lastDigit = lastDigit + 1;
  12747. if (lastDigit - firstDigit > MAX_DIGITS) {
  12748. // Check if we have a zero then just hard clamp, otherwise fail
  12749. var digitsString = digits.join('');
  12750. if (digitsString.match(/^0+$/)) {
  12751. exponent = EXPONENT_MAX;
  12752. break;
  12753. } else {
  12754. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12755. }
  12756. }
  12757. exponent = exponent - 1;
  12758. }
  12759. while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
  12760. // Shift last digit
  12761. if (lastDigit === 0) {
  12762. exponent = EXPONENT_MIN;
  12763. significantDigits = 0;
  12764. break;
  12765. }
  12766. if (nDigitsStored < nDigits) {
  12767. // adjust to match digits not stored
  12768. nDigits = nDigits - 1;
  12769. } else {
  12770. // adjust to round
  12771. lastDigit = lastDigit - 1;
  12772. }
  12773. if (exponent < EXPONENT_MAX) {
  12774. exponent = exponent + 1;
  12775. } else {
  12776. // Check if we have a zero then just hard clamp, otherwise fail
  12777. digitsString = digits.join('');
  12778. if (digitsString.match(/^0+$/)) {
  12779. exponent = EXPONENT_MAX;
  12780. break;
  12781. } else {
  12782. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12783. }
  12784. }
  12785. }
  12786. // Round
  12787. // We've normalized the exponent, but might still need to round.
  12788. if (lastDigit - firstDigit + 1 < significantDigits && string[significantDigits] !== '0') {
  12789. var endOfString = nDigitsRead;
  12790. // If we have seen a radix point, 'string' is 1 longer than we have
  12791. // documented with ndigits_read, so inc the position of the first nonzero
  12792. // digit and the position that digits are read to.
  12793. if (sawRadix && exponent === EXPONENT_MIN) {
  12794. firstNonZero = firstNonZero + 1;
  12795. endOfString = endOfString + 1;
  12796. }
  12797. var roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10);
  12798. var roundBit = 0;
  12799. if (roundDigit >= 5) {
  12800. roundBit = 1;
  12801. if (roundDigit === 5) {
  12802. roundBit = digits[lastDigit] % 2 === 1;
  12803. for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
  12804. if (parseInt(string[i], 10)) {
  12805. roundBit = 1;
  12806. break;
  12807. }
  12808. }
  12809. }
  12810. }
  12811. if (roundBit) {
  12812. var dIdx = lastDigit;
  12813. for (; dIdx >= 0; dIdx--) {
  12814. if (++digits[dIdx] > 9) {
  12815. digits[dIdx] = 0;
  12816. // overflowed most significant digit
  12817. if (dIdx === 0) {
  12818. if (exponent < EXPONENT_MAX) {
  12819. exponent = exponent + 1;
  12820. digits[dIdx] = 1;
  12821. } else {
  12822. return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12823. }
  12824. }
  12825. } else {
  12826. break;
  12827. }
  12828. }
  12829. }
  12830. }
  12831. // Encode significand
  12832. // The high 17 digits of the significand
  12833. significandHigh = Long.fromNumber(0);
  12834. // The low 17 digits of the significand
  12835. significandLow = Long.fromNumber(0);
  12836. // read a zero
  12837. if (significantDigits === 0) {
  12838. significandHigh = Long.fromNumber(0);
  12839. significandLow = Long.fromNumber(0);
  12840. } else if (lastDigit - firstDigit < 17) {
  12841. dIdx = firstDigit;
  12842. significandLow = Long.fromNumber(digits[dIdx++]);
  12843. significandHigh = new Long(0, 0);
  12844. for (; dIdx <= lastDigit; dIdx++) {
  12845. significandLow = significandLow.multiply(Long.fromNumber(10));
  12846. significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
  12847. }
  12848. } else {
  12849. dIdx = firstDigit;
  12850. significandHigh = Long.fromNumber(digits[dIdx++]);
  12851. for (; dIdx <= lastDigit - 17; dIdx++) {
  12852. significandHigh = significandHigh.multiply(Long.fromNumber(10));
  12853. significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
  12854. }
  12855. significandLow = Long.fromNumber(digits[dIdx++]);
  12856. for (; dIdx <= lastDigit; dIdx++) {
  12857. significandLow = significandLow.multiply(Long.fromNumber(10));
  12858. significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
  12859. }
  12860. }
  12861. var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000'));
  12862. significand.low = significand.low.add(significandLow);
  12863. if (lessThan(significand.low, significandLow)) {
  12864. significand.high = significand.high.add(Long.fromNumber(1));
  12865. }
  12866. // Biased exponent
  12867. biasedExponent = exponent + EXPONENT_BIAS;
  12868. var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
  12869. // Encode combination, exponent, and significand.
  12870. if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber)) {
  12871. // Encode '11' into bits 1 to 3
  12872. dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
  12873. dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)));
  12874. dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
  12875. } else {
  12876. dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
  12877. dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
  12878. }
  12879. dec.low = significand.low;
  12880. // Encode sign
  12881. if (isNegative) {
  12882. dec.high = dec.high.or(Long.fromString('9223372036854775808'));
  12883. }
  12884. // Encode into a buffer
  12885. var buffer = utils.allocBuffer(16);
  12886. index = 0;
  12887. // Encode the low 64 bits of the decimal
  12888. // Encode low bits
  12889. buffer[index++] = dec.low.low_ & 0xff;
  12890. buffer[index++] = dec.low.low_ >> 8 & 0xff;
  12891. buffer[index++] = dec.low.low_ >> 16 & 0xff;
  12892. buffer[index++] = dec.low.low_ >> 24 & 0xff;
  12893. // Encode high bits
  12894. buffer[index++] = dec.low.high_ & 0xff;
  12895. buffer[index++] = dec.low.high_ >> 8 & 0xff;
  12896. buffer[index++] = dec.low.high_ >> 16 & 0xff;
  12897. buffer[index++] = dec.low.high_ >> 24 & 0xff;
  12898. // Encode the high 64 bits of the decimal
  12899. // Encode low bits
  12900. buffer[index++] = dec.high.low_ & 0xff;
  12901. buffer[index++] = dec.high.low_ >> 8 & 0xff;
  12902. buffer[index++] = dec.high.low_ >> 16 & 0xff;
  12903. buffer[index++] = dec.high.low_ >> 24 & 0xff;
  12904. // Encode high bits
  12905. buffer[index++] = dec.high.high_ & 0xff;
  12906. buffer[index++] = dec.high.high_ >> 8 & 0xff;
  12907. buffer[index++] = dec.high.high_ >> 16 & 0xff;
  12908. buffer[index++] = dec.high.high_ >> 24 & 0xff;
  12909. // Return the new Decimal128
  12910. return new Decimal128(buffer);
  12911. };
  12912. // Extract least significant 5 bits
  12913. var COMBINATION_MASK = 0x1f;
  12914. // Extract least significant 14 bits
  12915. var EXPONENT_MASK = 0x3fff;
  12916. // Value of combination field for Inf
  12917. var COMBINATION_INFINITY = 30;
  12918. // Value of combination field for NaN
  12919. var COMBINATION_NAN = 31;
  12920. // Value of combination field for NaN
  12921. // var COMBINATION_SNAN = 32;
  12922. // decimal128 exponent bias
  12923. EXPONENT_BIAS = 6176;
  12924. /**
  12925. * Create a string representation of the raw Decimal128 value
  12926. *
  12927. * @method
  12928. * @return {string} returns a Decimal128 string representation.
  12929. */
  12930. Decimal128.prototype.toString = function () {
  12931. // Note: bits in this routine are referred to starting at 0,
  12932. // from the sign bit, towards the coefficient.
  12933. // bits 0 - 31
  12934. var high;
  12935. // bits 32 - 63
  12936. var midh;
  12937. // bits 64 - 95
  12938. var midl;
  12939. // bits 96 - 127
  12940. var low;
  12941. // bits 1 - 5
  12942. var combination;
  12943. // decoded biased exponent (14 bits)
  12944. var biased_exponent;
  12945. // the number of significand digits
  12946. var significand_digits = 0;
  12947. // the base-10 digits in the significand
  12948. var significand = new Array(36);
  12949. for (var i = 0; i < significand.length; i++) significand[i] = 0;
  12950. // read pointer into significand
  12951. var index = 0;
  12952. // unbiased exponent
  12953. var exponent;
  12954. // the exponent if scientific notation is used
  12955. var scientific_exponent;
  12956. // true if the number is zero
  12957. var is_zero = false;
  12958. // the most signifcant significand bits (50-46)
  12959. var significand_msb;
  12960. // temporary storage for significand decoding
  12961. var significand128 = { parts: new Array(4) };
  12962. // indexing variables
  12963. i;
  12964. var j, k;
  12965. // Output string
  12966. var string = [];
  12967. // Unpack index
  12968. index = 0;
  12969. // Buffer reference
  12970. var buffer = this.bytes;
  12971. // Unpack the low 64bits into a long
  12972. low = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12973. midl = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12974. // Unpack the high 64bits into a long
  12975. midh = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12976. high = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12977. // Unpack index
  12978. index = 0;
  12979. // Create the state of the decimal
  12980. var dec = {
  12981. low: new Long(low, midl),
  12982. high: new Long(midh, high)
  12983. };
  12984. if (dec.high.lessThan(Long.ZERO)) {
  12985. string.push('-');
  12986. }
  12987. // Decode combination field and exponent
  12988. combination = high >> 26 & COMBINATION_MASK;
  12989. if (combination >> 3 === 3) {
  12990. // Check for 'special' values
  12991. if (combination === COMBINATION_INFINITY) {
  12992. return string.join('') + 'Infinity';
  12993. } else if (combination === COMBINATION_NAN) {
  12994. return 'NaN';
  12995. } else {
  12996. biased_exponent = high >> 15 & EXPONENT_MASK;
  12997. significand_msb = 0x08 + (high >> 14 & 0x01);
  12998. }
  12999. } else {
  13000. significand_msb = high >> 14 & 0x07;
  13001. biased_exponent = high >> 17 & EXPONENT_MASK;
  13002. }
  13003. exponent = biased_exponent - EXPONENT_BIAS;
  13004. // Create string of significand digits
  13005. // Convert the 114-bit binary number represented by
  13006. // (significand_high, significand_low) to at most 34 decimal
  13007. // digits through modulo and division.
  13008. significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  13009. significand128.parts[1] = midh;
  13010. significand128.parts[2] = midl;
  13011. significand128.parts[3] = low;
  13012. if (significand128.parts[0] === 0 && significand128.parts[1] === 0 && significand128.parts[2] === 0 && significand128.parts[3] === 0) {
  13013. is_zero = true;
  13014. } else {
  13015. for (k = 3; k >= 0; k--) {
  13016. var least_digits = 0;
  13017. // Peform the divide
  13018. var result = divideu128(significand128);
  13019. significand128 = result.quotient;
  13020. least_digits = result.rem.low_;
  13021. // We now have the 9 least significant digits (in base 2).
  13022. // Convert and output to string.
  13023. if (!least_digits) continue;
  13024. for (j = 8; j >= 0; j--) {
  13025. // significand[k * 9 + j] = Math.round(least_digits % 10);
  13026. significand[k * 9 + j] = least_digits % 10;
  13027. // least_digits = Math.round(least_digits / 10);
  13028. least_digits = Math.floor(least_digits / 10);
  13029. }
  13030. }
  13031. }
  13032. // Output format options:
  13033. // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd
  13034. // Regular - ddd.ddd
  13035. if (is_zero) {
  13036. significand_digits = 1;
  13037. significand[index] = 0;
  13038. } else {
  13039. significand_digits = 36;
  13040. i = 0;
  13041. while (!significand[index]) {
  13042. i++;
  13043. significand_digits = significand_digits - 1;
  13044. index = index + 1;
  13045. }
  13046. }
  13047. scientific_exponent = significand_digits - 1 + exponent;
  13048. // The scientific exponent checks are dictated by the string conversion
  13049. // specification and are somewhat arbitrary cutoffs.
  13050. //
  13051. // We must check exponent > 0, because if this is the case, the number
  13052. // has trailing zeros. However, we *cannot* output these trailing zeros,
  13053. // because doing so would change the precision of the value, and would
  13054. // change stored data if the string converted number is round tripped.
  13055. if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
  13056. // Scientific format
  13057. string.push(significand[index++]);
  13058. significand_digits = significand_digits - 1;
  13059. if (significand_digits) {
  13060. string.push('.');
  13061. }
  13062. for (i = 0; i < significand_digits; i++) {
  13063. string.push(significand[index++]);
  13064. }
  13065. // Exponent
  13066. string.push('E');
  13067. if (scientific_exponent > 0) {
  13068. string.push('+' + scientific_exponent);
  13069. } else {
  13070. string.push(scientific_exponent);
  13071. }
  13072. } else {
  13073. // Regular format with no decimal place
  13074. if (exponent >= 0) {
  13075. for (i = 0; i < significand_digits; i++) {
  13076. string.push(significand[index++]);
  13077. }
  13078. } else {
  13079. var radix_position = significand_digits + exponent;
  13080. // non-zero digits before radix
  13081. if (radix_position > 0) {
  13082. for (i = 0; i < radix_position; i++) {
  13083. string.push(significand[index++]);
  13084. }
  13085. } else {
  13086. string.push('0');
  13087. }
  13088. string.push('.');
  13089. // add leading zeros after radix
  13090. while (radix_position++ < 0) {
  13091. string.push('0');
  13092. }
  13093. for (i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
  13094. string.push(significand[index++]);
  13095. }
  13096. }
  13097. }
  13098. return string.join('');
  13099. };
  13100. Decimal128.prototype.toJSON = function () {
  13101. return { $numberDecimal: this.toString() };
  13102. };
  13103. module.exports = Decimal128;
  13104. module.exports.Decimal128 = Decimal128;
  13105. /***/ }),
  13106. /* 348 */
  13107. /***/ (function(module, exports) {
  13108. /**
  13109. * A class representation of the BSON MinKey type.
  13110. *
  13111. * @class
  13112. * @return {MinKey} A MinKey instance
  13113. */
  13114. function MinKey() {
  13115. if (!(this instanceof MinKey)) return new MinKey();
  13116. this._bsontype = 'MinKey';
  13117. }
  13118. module.exports = MinKey;
  13119. module.exports.MinKey = MinKey;
  13120. /***/ }),
  13121. /* 349 */
  13122. /***/ (function(module, exports) {
  13123. /**
  13124. * A class representation of the BSON MaxKey type.
  13125. *
  13126. * @class
  13127. * @return {MaxKey} A MaxKey instance
  13128. */
  13129. function MaxKey() {
  13130. if (!(this instanceof MaxKey)) return new MaxKey();
  13131. this._bsontype = 'MaxKey';
  13132. }
  13133. module.exports = MaxKey;
  13134. module.exports.MaxKey = MaxKey;
  13135. /***/ }),
  13136. /* 350 */
  13137. /***/ (function(module, exports) {
  13138. /**
  13139. * A class representation of the BSON DBRef type.
  13140. *
  13141. * @class
  13142. * @param {string} namespace the collection name.
  13143. * @param {ObjectID} oid the reference ObjectID.
  13144. * @param {string} [db] optional db name, if omitted the reference is local to the current db.
  13145. * @return {DBRef}
  13146. */
  13147. function DBRef(namespace, oid, db) {
  13148. if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);
  13149. this._bsontype = 'DBRef';
  13150. this.namespace = namespace;
  13151. this.oid = oid;
  13152. this.db = db;
  13153. }
  13154. /**
  13155. * @ignore
  13156. * @api private
  13157. */
  13158. DBRef.prototype.toJSON = function () {
  13159. return {
  13160. $ref: this.namespace,
  13161. $id: this.oid,
  13162. $db: this.db == null ? '' : this.db
  13163. };
  13164. };
  13165. module.exports = DBRef;
  13166. module.exports.DBRef = DBRef;
  13167. /***/ }),
  13168. /* 351 */
  13169. /***/ (function(module, exports, __webpack_require__) {
  13170. /* WEBPACK VAR INJECTION */(function(global) {/**
  13171. * Module dependencies.
  13172. * @ignore
  13173. */
  13174. // Test if we're in Node via presence of "global" not absence of "window"
  13175. // to support hybrid environments like Electron
  13176. if (typeof global !== 'undefined') {
  13177. var Buffer = __webpack_require__(334).Buffer; // TODO just use global Buffer
  13178. }
  13179. var utils = __webpack_require__(339);
  13180. /**
  13181. * A class representation of the BSON Binary type.
  13182. *
  13183. * Sub types
  13184. * - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type.
  13185. * - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type.
  13186. * - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type.
  13187. * - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type.
  13188. * - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type.
  13189. * - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type.
  13190. *
  13191. * @class
  13192. * @param {Buffer} buffer a buffer object containing the binary data.
  13193. * @param {Number} [subType] the option binary type.
  13194. * @return {Binary}
  13195. */
  13196. function Binary(buffer, subType) {
  13197. if (!(this instanceof Binary)) return new Binary(buffer, subType);
  13198. if (buffer != null && !(typeof buffer === 'string') && !Buffer.isBuffer(buffer) && !(buffer instanceof Uint8Array) && !Array.isArray(buffer)) {
  13199. throw new Error('only String, Buffer, Uint8Array or Array accepted');
  13200. }
  13201. this._bsontype = 'Binary';
  13202. if (buffer instanceof Number) {
  13203. this.sub_type = buffer;
  13204. this.position = 0;
  13205. } else {
  13206. this.sub_type = subType == null ? BSON_BINARY_SUBTYPE_DEFAULT : subType;
  13207. this.position = 0;
  13208. }
  13209. if (buffer != null && !(buffer instanceof Number)) {
  13210. // Only accept Buffer, Uint8Array or Arrays
  13211. if (typeof buffer === 'string') {
  13212. // Different ways of writing the length of the string for the different types
  13213. if (typeof Buffer !== 'undefined') {
  13214. this.buffer = utils.toBuffer(buffer);
  13215. } else if (typeof Uint8Array !== 'undefined' || Object.prototype.toString.call(buffer) === '[object Array]') {
  13216. this.buffer = writeStringToArray(buffer);
  13217. } else {
  13218. throw new Error('only String, Buffer, Uint8Array or Array accepted');
  13219. }
  13220. } else {
  13221. this.buffer = buffer;
  13222. }
  13223. this.position = buffer.length;
  13224. } else {
  13225. if (typeof Buffer !== 'undefined') {
  13226. this.buffer = utils.allocBuffer(Binary.BUFFER_SIZE);
  13227. } else if (typeof Uint8Array !== 'undefined') {
  13228. this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE));
  13229. } else {
  13230. this.buffer = new Array(Binary.BUFFER_SIZE);
  13231. }
  13232. // Set position to start of buffer
  13233. this.position = 0;
  13234. }
  13235. }
  13236. /**
  13237. * Updates this binary with byte_value.
  13238. *
  13239. * @method
  13240. * @param {string} byte_value a single byte we wish to write.
  13241. */
  13242. Binary.prototype.put = function put(byte_value) {
  13243. // If it's a string and a has more than one character throw an error
  13244. if (byte_value['length'] != null && typeof byte_value !== 'number' && byte_value.length !== 1) throw new Error('only accepts single character String, Uint8Array or Array');
  13245. if (typeof byte_value !== 'number' && byte_value < 0 || byte_value > 255) throw new Error('only accepts number in a valid unsigned byte range 0-255');
  13246. // Decode the byte value once
  13247. var decoded_byte = null;
  13248. if (typeof byte_value === 'string') {
  13249. decoded_byte = byte_value.charCodeAt(0);
  13250. } else if (byte_value['length'] != null) {
  13251. decoded_byte = byte_value[0];
  13252. } else {
  13253. decoded_byte = byte_value;
  13254. }
  13255. if (this.buffer.length > this.position) {
  13256. this.buffer[this.position++] = decoded_byte;
  13257. } else {
  13258. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13259. // Create additional overflow buffer
  13260. var buffer = utils.allocBuffer(Binary.BUFFER_SIZE + this.buffer.length);
  13261. // Combine the two buffers together
  13262. this.buffer.copy(buffer, 0, 0, this.buffer.length);
  13263. this.buffer = buffer;
  13264. this.buffer[this.position++] = decoded_byte;
  13265. } else {
  13266. buffer = null;
  13267. // Create a new buffer (typed or normal array)
  13268. if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
  13269. buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length));
  13270. } else {
  13271. buffer = new Array(Binary.BUFFER_SIZE + this.buffer.length);
  13272. }
  13273. // We need to copy all the content to the new array
  13274. for (var i = 0; i < this.buffer.length; i++) {
  13275. buffer[i] = this.buffer[i];
  13276. }
  13277. // Reassign the buffer
  13278. this.buffer = buffer;
  13279. // Write the byte
  13280. this.buffer[this.position++] = decoded_byte;
  13281. }
  13282. }
  13283. };
  13284. /**
  13285. * Writes a buffer or string to the binary.
  13286. *
  13287. * @method
  13288. * @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object.
  13289. * @param {number} offset specify the binary of where to write the content.
  13290. * @return {null}
  13291. */
  13292. Binary.prototype.write = function write(string, offset) {
  13293. offset = typeof offset === 'number' ? offset : this.position;
  13294. // If the buffer is to small let's extend the buffer
  13295. if (this.buffer.length < offset + string.length) {
  13296. var buffer = null;
  13297. // If we are in node.js
  13298. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13299. buffer = utils.allocBuffer(this.buffer.length + string.length);
  13300. this.buffer.copy(buffer, 0, 0, this.buffer.length);
  13301. } else if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
  13302. // Create a new buffer
  13303. buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length));
  13304. // Copy the content
  13305. for (var i = 0; i < this.position; i++) {
  13306. buffer[i] = this.buffer[i];
  13307. }
  13308. }
  13309. // Assign the new buffer
  13310. this.buffer = buffer;
  13311. }
  13312. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) {
  13313. string.copy(this.buffer, offset, 0, string.length);
  13314. this.position = offset + string.length > this.position ? offset + string.length : this.position;
  13315. // offset = string.length
  13316. } else if (typeof Buffer !== 'undefined' && typeof string === 'string' && Buffer.isBuffer(this.buffer)) {
  13317. this.buffer.write(string, offset, 'binary');
  13318. this.position = offset + string.length > this.position ? offset + string.length : this.position;
  13319. // offset = string.length;
  13320. } else if (Object.prototype.toString.call(string) === '[object Uint8Array]' || Object.prototype.toString.call(string) === '[object Array]' && typeof string !== 'string') {
  13321. for (i = 0; i < string.length; i++) {
  13322. this.buffer[offset++] = string[i];
  13323. }
  13324. this.position = offset > this.position ? offset : this.position;
  13325. } else if (typeof string === 'string') {
  13326. for (i = 0; i < string.length; i++) {
  13327. this.buffer[offset++] = string.charCodeAt(i);
  13328. }
  13329. this.position = offset > this.position ? offset : this.position;
  13330. }
  13331. };
  13332. /**
  13333. * Reads **length** bytes starting at **position**.
  13334. *
  13335. * @method
  13336. * @param {number} position read from the given position in the Binary.
  13337. * @param {number} length the number of bytes to read.
  13338. * @return {Buffer}
  13339. */
  13340. Binary.prototype.read = function read(position, length) {
  13341. length = length && length > 0 ? length : this.position;
  13342. // Let's return the data based on the type we have
  13343. if (this.buffer['slice']) {
  13344. return this.buffer.slice(position, position + length);
  13345. } else {
  13346. // Create a buffer to keep the result
  13347. var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(length)) : new Array(length);
  13348. for (var i = 0; i < length; i++) {
  13349. buffer[i] = this.buffer[position++];
  13350. }
  13351. }
  13352. // Return the buffer
  13353. return buffer;
  13354. };
  13355. /**
  13356. * Returns the value of this binary as a string.
  13357. *
  13358. * @method
  13359. * @return {string}
  13360. */
  13361. Binary.prototype.value = function value(asRaw) {
  13362. asRaw = asRaw == null ? false : asRaw;
  13363. // Optimize to serialize for the situation where the data == size of buffer
  13364. if (asRaw && typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer) && this.buffer.length === this.position) return this.buffer;
  13365. // If it's a node.js buffer object
  13366. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13367. return asRaw ? this.buffer.slice(0, this.position) : this.buffer.toString('binary', 0, this.position);
  13368. } else {
  13369. if (asRaw) {
  13370. // we support the slice command use it
  13371. if (this.buffer['slice'] != null) {
  13372. return this.buffer.slice(0, this.position);
  13373. } else {
  13374. // Create a new buffer to copy content to
  13375. var newBuffer = Object.prototype.toString.call(this.buffer) === '[object Uint8Array]' ? new Uint8Array(new ArrayBuffer(this.position)) : new Array(this.position);
  13376. // Copy content
  13377. for (var i = 0; i < this.position; i++) {
  13378. newBuffer[i] = this.buffer[i];
  13379. }
  13380. // Return the buffer
  13381. return newBuffer;
  13382. }
  13383. } else {
  13384. return convertArraytoUtf8BinaryString(this.buffer, 0, this.position);
  13385. }
  13386. }
  13387. };
  13388. /**
  13389. * Length.
  13390. *
  13391. * @method
  13392. * @return {number} the length of the binary.
  13393. */
  13394. Binary.prototype.length = function length() {
  13395. return this.position;
  13396. };
  13397. /**
  13398. * @ignore
  13399. */
  13400. Binary.prototype.toJSON = function () {
  13401. return this.buffer != null ? this.buffer.toString('base64') : '';
  13402. };
  13403. /**
  13404. * @ignore
  13405. */
  13406. Binary.prototype.toString = function (format) {
  13407. return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : '';
  13408. };
  13409. /**
  13410. * Binary default subtype
  13411. * @ignore
  13412. */
  13413. var BSON_BINARY_SUBTYPE_DEFAULT = 0;
  13414. /**
  13415. * @ignore
  13416. */
  13417. var writeStringToArray = function (data) {
  13418. // Create a buffer
  13419. var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
  13420. // Write the content to the buffer
  13421. for (var i = 0; i < data.length; i++) {
  13422. buffer[i] = data.charCodeAt(i);
  13423. }
  13424. // Write the string to the buffer
  13425. return buffer;
  13426. };
  13427. /**
  13428. * Convert Array ot Uint8Array to Binary String
  13429. *
  13430. * @ignore
  13431. */
  13432. var convertArraytoUtf8BinaryString = function (byteArray, startIndex, endIndex) {
  13433. var result = '';
  13434. for (var i = startIndex; i < endIndex; i++) {
  13435. result = result + String.fromCharCode(byteArray[i]);
  13436. }
  13437. return result;
  13438. };
  13439. Binary.BUFFER_SIZE = 256;
  13440. /**
  13441. * Default BSON type
  13442. *
  13443. * @classconstant SUBTYPE_DEFAULT
  13444. **/
  13445. Binary.SUBTYPE_DEFAULT = 0;
  13446. /**
  13447. * Function BSON type
  13448. *
  13449. * @classconstant SUBTYPE_DEFAULT
  13450. **/
  13451. Binary.SUBTYPE_FUNCTION = 1;
  13452. /**
  13453. * Byte Array BSON type
  13454. *
  13455. * @classconstant SUBTYPE_DEFAULT
  13456. **/
  13457. Binary.SUBTYPE_BYTE_ARRAY = 2;
  13458. /**
  13459. * OLD UUID BSON type
  13460. *
  13461. * @classconstant SUBTYPE_DEFAULT
  13462. **/
  13463. Binary.SUBTYPE_UUID_OLD = 3;
  13464. /**
  13465. * UUID BSON type
  13466. *
  13467. * @classconstant SUBTYPE_DEFAULT
  13468. **/
  13469. Binary.SUBTYPE_UUID = 4;
  13470. /**
  13471. * MD5 BSON type
  13472. *
  13473. * @classconstant SUBTYPE_DEFAULT
  13474. **/
  13475. Binary.SUBTYPE_MD5 = 5;
  13476. /**
  13477. * User BSON type
  13478. *
  13479. * @classconstant SUBTYPE_DEFAULT
  13480. **/
  13481. Binary.SUBTYPE_USER_DEFINED = 128;
  13482. /**
  13483. * Expose.
  13484. */
  13485. module.exports = Binary;
  13486. module.exports.Binary = Binary;
  13487. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  13488. /***/ }),
  13489. /* 352 */
  13490. /***/ (function(module, exports, __webpack_require__) {
  13491. 'use strict';
  13492. var Long = __webpack_require__(330).Long,
  13493. Double = __webpack_require__(331).Double,
  13494. Timestamp = __webpack_require__(332).Timestamp,
  13495. ObjectID = __webpack_require__(333).ObjectID,
  13496. Symbol = __webpack_require__(344).Symbol,
  13497. Code = __webpack_require__(346).Code,
  13498. MinKey = __webpack_require__(348).MinKey,
  13499. MaxKey = __webpack_require__(349).MaxKey,
  13500. Decimal128 = __webpack_require__(347),
  13501. Int32 = __webpack_require__(345),
  13502. DBRef = __webpack_require__(350).DBRef,
  13503. BSONRegExp = __webpack_require__(343).BSONRegExp,
  13504. Binary = __webpack_require__(351).Binary;
  13505. var utils = __webpack_require__(339);
  13506. var deserialize = function (buffer, options, isArray) {
  13507. options = options == null ? {} : options;
  13508. var index = options && options.index ? options.index : 0;
  13509. // Read the document size
  13510. var size = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13511. // Ensure buffer is valid size
  13512. if (size < 5 || buffer.length < size || size + index > buffer.length) {
  13513. throw new Error('corrupt bson message');
  13514. }
  13515. // Illegal end value
  13516. if (buffer[index + size - 1] !== 0) {
  13517. throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
  13518. }
  13519. // Start deserializtion
  13520. return deserializeObject(buffer, index, options, isArray);
  13521. };
  13522. var deserializeObject = function (buffer, index, options, isArray) {
  13523. var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions'];
  13524. var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions'];
  13525. var cacheFunctionsCrc32 = options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32'];
  13526. if (!cacheFunctionsCrc32) var crc32 = null;
  13527. var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
  13528. // Return raw bson buffer instead of parsing it
  13529. var raw = options['raw'] == null ? false : options['raw'];
  13530. // Return BSONRegExp objects instead of native regular expressions
  13531. var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false;
  13532. // Controls the promotion of values vs wrapper classes
  13533. var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers'];
  13534. var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs'];
  13535. var promoteValues = options['promoteValues'] == null ? true : options['promoteValues'];
  13536. // Set the start index
  13537. var startIndex = index;
  13538. // Validate that we have at least 4 bytes of buffer
  13539. if (buffer.length < 5) throw new Error('corrupt bson message < 5 bytes long');
  13540. // Read the document size
  13541. var size = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13542. // Ensure buffer is valid size
  13543. if (size < 5 || size > buffer.length) throw new Error('corrupt bson message');
  13544. // Create holding object
  13545. var object = isArray ? [] : {};
  13546. // Used for arrays to skip having to perform utf8 decoding
  13547. var arrayIndex = 0;
  13548. var done = false;
  13549. // While we have more left data left keep parsing
  13550. // while (buffer[index + 1] !== 0) {
  13551. while (!done) {
  13552. // Read the type
  13553. var elementType = buffer[index++];
  13554. // If we get a zero it's the last byte, exit
  13555. if (elementType === 0) break;
  13556. // Get the start search index
  13557. var i = index;
  13558. // Locate the end of the c string
  13559. while (buffer[i] !== 0x00 && i < buffer.length) {
  13560. i++;
  13561. }
  13562. // If are at the end of the buffer there is a problem with the document
  13563. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13564. var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i);
  13565. index = i + 1;
  13566. if (elementType === BSON.BSON_DATA_STRING) {
  13567. var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13568. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13569. object[name] = buffer.toString('utf8', index, index + stringSize - 1);
  13570. index = index + stringSize;
  13571. } else if (elementType === BSON.BSON_DATA_OID) {
  13572. var oid = utils.allocBuffer(12);
  13573. buffer.copy(oid, 0, index, index + 12);
  13574. object[name] = new ObjectID(oid);
  13575. index = index + 12;
  13576. } else if (elementType === BSON.BSON_DATA_INT && promoteValues === false) {
  13577. object[name] = new Int32(buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24);
  13578. } else if (elementType === BSON.BSON_DATA_INT) {
  13579. object[name] = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13580. } else if (elementType === BSON.BSON_DATA_NUMBER && promoteValues === false) {
  13581. object[name] = new Double(buffer.readDoubleLE(index));
  13582. index = index + 8;
  13583. } else if (elementType === BSON.BSON_DATA_NUMBER) {
  13584. object[name] = buffer.readDoubleLE(index);
  13585. index = index + 8;
  13586. } else if (elementType === BSON.BSON_DATA_DATE) {
  13587. var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13588. var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13589. object[name] = new Date(new Long(lowBits, highBits).toNumber());
  13590. } else if (elementType === BSON.BSON_DATA_BOOLEAN) {
  13591. if (buffer[index] !== 0 && buffer[index] !== 1) throw new Error('illegal boolean type value');
  13592. object[name] = buffer[index++] === 1;
  13593. } else if (elementType === BSON.BSON_DATA_OBJECT) {
  13594. var _index = index;
  13595. var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13596. if (objectSize <= 0 || objectSize > buffer.length - index) throw new Error('bad embedded document length in bson');
  13597. // We have a raw value
  13598. if (raw) {
  13599. object[name] = buffer.slice(index, index + objectSize);
  13600. } else {
  13601. object[name] = deserializeObject(buffer, _index, options, false);
  13602. }
  13603. index = index + objectSize;
  13604. } else if (elementType === BSON.BSON_DATA_ARRAY) {
  13605. _index = index;
  13606. objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13607. var arrayOptions = options;
  13608. // Stop index
  13609. var stopIndex = index + objectSize;
  13610. // All elements of array to be returned as raw bson
  13611. if (fieldsAsRaw && fieldsAsRaw[name]) {
  13612. arrayOptions = {};
  13613. for (var n in options) arrayOptions[n] = options[n];
  13614. arrayOptions['raw'] = true;
  13615. }
  13616. object[name] = deserializeObject(buffer, _index, arrayOptions, true);
  13617. index = index + objectSize;
  13618. if (buffer[index - 1] !== 0) throw new Error('invalid array terminator byte');
  13619. if (index !== stopIndex) throw new Error('corrupted array bson');
  13620. } else if (elementType === BSON.BSON_DATA_UNDEFINED) {
  13621. object[name] = undefined;
  13622. } else if (elementType === BSON.BSON_DATA_NULL) {
  13623. object[name] = null;
  13624. } else if (elementType === BSON.BSON_DATA_LONG) {
  13625. // Unpack the low and high bits
  13626. lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13627. highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13628. var long = new Long(lowBits, highBits);
  13629. // Promote the long if possible
  13630. if (promoteLongs && promoteValues === true) {
  13631. object[name] = long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) ? long.toNumber() : long;
  13632. } else {
  13633. object[name] = long;
  13634. }
  13635. } else if (elementType === BSON.BSON_DATA_DECIMAL128) {
  13636. // Buffer to contain the decimal bytes
  13637. var bytes = utils.allocBuffer(16);
  13638. // Copy the next 16 bytes into the bytes buffer
  13639. buffer.copy(bytes, 0, index, index + 16);
  13640. // Update index
  13641. index = index + 16;
  13642. // Assign the new Decimal128 value
  13643. var decimal128 = new Decimal128(bytes);
  13644. // If we have an alternative mapper use that
  13645. object[name] = decimal128.toObject ? decimal128.toObject() : decimal128;
  13646. } else if (elementType === BSON.BSON_DATA_BINARY) {
  13647. var binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13648. var totalBinarySize = binarySize;
  13649. var subType = buffer[index++];
  13650. // Did we have a negative binary size, throw
  13651. if (binarySize < 0) throw new Error('Negative binary type element size found');
  13652. // Is the length longer than the document
  13653. if (binarySize > buffer.length) throw new Error('Binary type size larger than document size');
  13654. // Decode as raw Buffer object if options specifies it
  13655. if (buffer['slice'] != null) {
  13656. // If we have subtype 2 skip the 4 bytes for the size
  13657. if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
  13658. binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13659. if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
  13660. if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
  13661. if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
  13662. }
  13663. if (promoteBuffers && promoteValues) {
  13664. object[name] = buffer.slice(index, index + binarySize);
  13665. } else {
  13666. object[name] = new Binary(buffer.slice(index, index + binarySize), subType);
  13667. }
  13668. } else {
  13669. var _buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(binarySize)) : new Array(binarySize);
  13670. // If we have subtype 2 skip the 4 bytes for the size
  13671. if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
  13672. binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13673. if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
  13674. if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
  13675. if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
  13676. }
  13677. // Copy the data
  13678. for (i = 0; i < binarySize; i++) {
  13679. _buffer[i] = buffer[index + i];
  13680. }
  13681. if (promoteBuffers && promoteValues) {
  13682. object[name] = _buffer;
  13683. } else {
  13684. object[name] = new Binary(_buffer, subType);
  13685. }
  13686. }
  13687. // Update the index
  13688. index = index + binarySize;
  13689. } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === false) {
  13690. // Get the start search index
  13691. i = index;
  13692. // Locate the end of the c string
  13693. while (buffer[i] !== 0x00 && i < buffer.length) {
  13694. i++;
  13695. }
  13696. // If are at the end of the buffer there is a problem with the document
  13697. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13698. // Return the C string
  13699. var source = buffer.toString('utf8', index, i);
  13700. // Create the regexp
  13701. index = i + 1;
  13702. // Get the start search index
  13703. i = index;
  13704. // Locate the end of the c string
  13705. while (buffer[i] !== 0x00 && i < buffer.length) {
  13706. i++;
  13707. }
  13708. // If are at the end of the buffer there is a problem with the document
  13709. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13710. // Return the C string
  13711. var regExpOptions = buffer.toString('utf8', index, i);
  13712. index = i + 1;
  13713. // For each option add the corresponding one for javascript
  13714. var optionsArray = new Array(regExpOptions.length);
  13715. // Parse options
  13716. for (i = 0; i < regExpOptions.length; i++) {
  13717. switch (regExpOptions[i]) {
  13718. case 'm':
  13719. optionsArray[i] = 'm';
  13720. break;
  13721. case 's':
  13722. optionsArray[i] = 'g';
  13723. break;
  13724. case 'i':
  13725. optionsArray[i] = 'i';
  13726. break;
  13727. }
  13728. }
  13729. object[name] = new RegExp(source, optionsArray.join(''));
  13730. } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === true) {
  13731. // Get the start search index
  13732. i = index;
  13733. // Locate the end of the c string
  13734. while (buffer[i] !== 0x00 && i < buffer.length) {
  13735. i++;
  13736. }
  13737. // If are at the end of the buffer there is a problem with the document
  13738. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13739. // Return the C string
  13740. source = buffer.toString('utf8', index, i);
  13741. index = i + 1;
  13742. // Get the start search index
  13743. i = index;
  13744. // Locate the end of the c string
  13745. while (buffer[i] !== 0x00 && i < buffer.length) {
  13746. i++;
  13747. }
  13748. // If are at the end of the buffer there is a problem with the document
  13749. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13750. // Return the C string
  13751. regExpOptions = buffer.toString('utf8', index, i);
  13752. index = i + 1;
  13753. // Set the object
  13754. object[name] = new BSONRegExp(source, regExpOptions);
  13755. } else if (elementType === BSON.BSON_DATA_SYMBOL) {
  13756. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13757. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13758. object[name] = new Symbol(buffer.toString('utf8', index, index + stringSize - 1));
  13759. index = index + stringSize;
  13760. } else if (elementType === BSON.BSON_DATA_TIMESTAMP) {
  13761. lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13762. highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13763. object[name] = new Timestamp(lowBits, highBits);
  13764. } else if (elementType === BSON.BSON_DATA_MIN_KEY) {
  13765. object[name] = new MinKey();
  13766. } else if (elementType === BSON.BSON_DATA_MAX_KEY) {
  13767. object[name] = new MaxKey();
  13768. } else if (elementType === BSON.BSON_DATA_CODE) {
  13769. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13770. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13771. var functionString = buffer.toString('utf8', index, index + stringSize - 1);
  13772. // If we are evaluating the functions
  13773. if (evalFunctions) {
  13774. // If we have cache enabled let's look for the md5 of the function in the cache
  13775. if (cacheFunctions) {
  13776. var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
  13777. // Got to do this to avoid V8 deoptimizing the call due to finding eval
  13778. object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
  13779. } else {
  13780. object[name] = isolateEval(functionString);
  13781. }
  13782. } else {
  13783. object[name] = new Code(functionString);
  13784. }
  13785. // Update parse index position
  13786. index = index + stringSize;
  13787. } else if (elementType === BSON.BSON_DATA_CODE_W_SCOPE) {
  13788. var totalSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13789. // Element cannot be shorter than totalSize + stringSize + documentSize + terminator
  13790. if (totalSize < 4 + 4 + 4 + 1) {
  13791. throw new Error('code_w_scope total size shorter minimum expected length');
  13792. }
  13793. // Get the code string size
  13794. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13795. // Check if we have a valid string
  13796. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13797. // Javascript function
  13798. functionString = buffer.toString('utf8', index, index + stringSize - 1);
  13799. // Update parse index position
  13800. index = index + stringSize;
  13801. // Parse the element
  13802. _index = index;
  13803. // Decode the size of the object document
  13804. objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13805. // Decode the scope object
  13806. var scopeObject = deserializeObject(buffer, _index, options, false);
  13807. // Adjust the index
  13808. index = index + objectSize;
  13809. // Check if field length is to short
  13810. if (totalSize < 4 + 4 + objectSize + stringSize) {
  13811. throw new Error('code_w_scope total size is to short, truncating scope');
  13812. }
  13813. // Check if totalSize field is to long
  13814. if (totalSize > 4 + 4 + objectSize + stringSize) {
  13815. throw new Error('code_w_scope total size is to long, clips outer document');
  13816. }
  13817. // If we are evaluating the functions
  13818. if (evalFunctions) {
  13819. // If we have cache enabled let's look for the md5 of the function in the cache
  13820. if (cacheFunctions) {
  13821. hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
  13822. // Got to do this to avoid V8 deoptimizing the call due to finding eval
  13823. object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
  13824. } else {
  13825. object[name] = isolateEval(functionString);
  13826. }
  13827. object[name].scope = scopeObject;
  13828. } else {
  13829. object[name] = new Code(functionString, scopeObject);
  13830. }
  13831. } else if (elementType === BSON.BSON_DATA_DBPOINTER) {
  13832. // Get the code string size
  13833. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13834. // Check if we have a valid string
  13835. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13836. // Namespace
  13837. var namespace = buffer.toString('utf8', index, index + stringSize - 1);
  13838. // Update parse index position
  13839. index = index + stringSize;
  13840. // Read the oid
  13841. var oidBuffer = utils.allocBuffer(12);
  13842. buffer.copy(oidBuffer, 0, index, index + 12);
  13843. oid = new ObjectID(oidBuffer);
  13844. // Update the index
  13845. index = index + 12;
  13846. // Split the namespace
  13847. var parts = namespace.split('.');
  13848. var db = parts.shift();
  13849. var collection = parts.join('.');
  13850. // Upgrade to DBRef type
  13851. object[name] = new DBRef(collection, oid, db);
  13852. } else {
  13853. throw new Error('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '", are you using the latest BSON parser');
  13854. }
  13855. }
  13856. // Check if the deserialization was against a valid array/object
  13857. if (size !== index - startIndex) {
  13858. if (isArray) throw new Error('corrupt array bson');
  13859. throw new Error('corrupt object bson');
  13860. }
  13861. // Check if we have a db ref object
  13862. if (object['$id'] != null) object = new DBRef(object['$ref'], object['$id'], object['$db']);
  13863. return object;
  13864. };
  13865. /**
  13866. * Ensure eval is isolated.
  13867. *
  13868. * @ignore
  13869. * @api private
  13870. */
  13871. var isolateEvalWithHash = function (functionCache, hash, functionString, object) {
  13872. // Contains the value we are going to set
  13873. var value = null;
  13874. // Check for cache hit, eval if missing and return cached function
  13875. if (functionCache[hash] == null) {
  13876. eval('value = ' + functionString);
  13877. functionCache[hash] = value;
  13878. }
  13879. // Set the object
  13880. return functionCache[hash].bind(object);
  13881. };
  13882. /**
  13883. * Ensure eval is isolated.
  13884. *
  13885. * @ignore
  13886. * @api private
  13887. */
  13888. var isolateEval = function (functionString) {
  13889. // Contains the value we are going to set
  13890. var value = null;
  13891. // Eval the function
  13892. eval('value = ' + functionString);
  13893. return value;
  13894. };
  13895. var BSON = {};
  13896. /**
  13897. * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
  13898. *
  13899. * @ignore
  13900. * @api private
  13901. */
  13902. var functionCache = BSON.functionCache = {};
  13903. /**
  13904. * Number BSON Type
  13905. *
  13906. * @classconstant BSON_DATA_NUMBER
  13907. **/
  13908. BSON.BSON_DATA_NUMBER = 1;
  13909. /**
  13910. * String BSON Type
  13911. *
  13912. * @classconstant BSON_DATA_STRING
  13913. **/
  13914. BSON.BSON_DATA_STRING = 2;
  13915. /**
  13916. * Object BSON Type
  13917. *
  13918. * @classconstant BSON_DATA_OBJECT
  13919. **/
  13920. BSON.BSON_DATA_OBJECT = 3;
  13921. /**
  13922. * Array BSON Type
  13923. *
  13924. * @classconstant BSON_DATA_ARRAY
  13925. **/
  13926. BSON.BSON_DATA_ARRAY = 4;
  13927. /**
  13928. * Binary BSON Type
  13929. *
  13930. * @classconstant BSON_DATA_BINARY
  13931. **/
  13932. BSON.BSON_DATA_BINARY = 5;
  13933. /**
  13934. * Binary BSON Type
  13935. *
  13936. * @classconstant BSON_DATA_UNDEFINED
  13937. **/
  13938. BSON.BSON_DATA_UNDEFINED = 6;
  13939. /**
  13940. * ObjectID BSON Type
  13941. *
  13942. * @classconstant BSON_DATA_OID
  13943. **/
  13944. BSON.BSON_DATA_OID = 7;
  13945. /**
  13946. * Boolean BSON Type
  13947. *
  13948. * @classconstant BSON_DATA_BOOLEAN
  13949. **/
  13950. BSON.BSON_DATA_BOOLEAN = 8;
  13951. /**
  13952. * Date BSON Type
  13953. *
  13954. * @classconstant BSON_DATA_DATE
  13955. **/
  13956. BSON.BSON_DATA_DATE = 9;
  13957. /**
  13958. * null BSON Type
  13959. *
  13960. * @classconstant BSON_DATA_NULL
  13961. **/
  13962. BSON.BSON_DATA_NULL = 10;
  13963. /**
  13964. * RegExp BSON Type
  13965. *
  13966. * @classconstant BSON_DATA_REGEXP
  13967. **/
  13968. BSON.BSON_DATA_REGEXP = 11;
  13969. /**
  13970. * Code BSON Type
  13971. *
  13972. * @classconstant BSON_DATA_DBPOINTER
  13973. **/
  13974. BSON.BSON_DATA_DBPOINTER = 12;
  13975. /**
  13976. * Code BSON Type
  13977. *
  13978. * @classconstant BSON_DATA_CODE
  13979. **/
  13980. BSON.BSON_DATA_CODE = 13;
  13981. /**
  13982. * Symbol BSON Type
  13983. *
  13984. * @classconstant BSON_DATA_SYMBOL
  13985. **/
  13986. BSON.BSON_DATA_SYMBOL = 14;
  13987. /**
  13988. * Code with Scope BSON Type
  13989. *
  13990. * @classconstant BSON_DATA_CODE_W_SCOPE
  13991. **/
  13992. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  13993. /**
  13994. * 32 bit Integer BSON Type
  13995. *
  13996. * @classconstant BSON_DATA_INT
  13997. **/
  13998. BSON.BSON_DATA_INT = 16;
  13999. /**
  14000. * Timestamp BSON Type
  14001. *
  14002. * @classconstant BSON_DATA_TIMESTAMP
  14003. **/
  14004. BSON.BSON_DATA_TIMESTAMP = 17;
  14005. /**
  14006. * Long BSON Type
  14007. *
  14008. * @classconstant BSON_DATA_LONG
  14009. **/
  14010. BSON.BSON_DATA_LONG = 18;
  14011. /**
  14012. * Long BSON Type
  14013. *
  14014. * @classconstant BSON_DATA_DECIMAL128
  14015. **/
  14016. BSON.BSON_DATA_DECIMAL128 = 19;
  14017. /**
  14018. * MinKey BSON Type
  14019. *
  14020. * @classconstant BSON_DATA_MIN_KEY
  14021. **/
  14022. BSON.BSON_DATA_MIN_KEY = 0xff;
  14023. /**
  14024. * MaxKey BSON Type
  14025. *
  14026. * @classconstant BSON_DATA_MAX_KEY
  14027. **/
  14028. BSON.BSON_DATA_MAX_KEY = 0x7f;
  14029. /**
  14030. * Binary Default Type
  14031. *
  14032. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  14033. **/
  14034. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  14035. /**
  14036. * Binary Function Type
  14037. *
  14038. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  14039. **/
  14040. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  14041. /**
  14042. * Binary Byte Array Type
  14043. *
  14044. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  14045. **/
  14046. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  14047. /**
  14048. * Binary UUID Type
  14049. *
  14050. * @classconstant BSON_BINARY_SUBTYPE_UUID
  14051. **/
  14052. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  14053. /**
  14054. * Binary MD5 Type
  14055. *
  14056. * @classconstant BSON_BINARY_SUBTYPE_MD5
  14057. **/
  14058. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  14059. /**
  14060. * Binary User Defined Type
  14061. *
  14062. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  14063. **/
  14064. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  14065. // BSON MAX VALUES
  14066. BSON.BSON_INT32_MAX = 0x7fffffff;
  14067. BSON.BSON_INT32_MIN = -0x80000000;
  14068. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  14069. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  14070. // JS MAX PRECISE VALUES
  14071. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  14072. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  14073. // Internal long versions
  14074. var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  14075. var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  14076. module.exports = deserialize;
  14077. /***/ }),
  14078. /* 353 */
  14079. /***/ (function(module, exports, __webpack_require__) {
  14080. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  14081. var writeIEEE754 = __webpack_require__(354).writeIEEE754,
  14082. Long = __webpack_require__(330).Long,
  14083. Map = __webpack_require__(329),
  14084. Binary = __webpack_require__(351).Binary;
  14085. var normalizedFunctionString = __webpack_require__(339).normalizedFunctionString;
  14086. // try {
  14087. // var _Buffer = Uint8Array;
  14088. // } catch (e) {
  14089. // _Buffer = Buffer;
  14090. // }
  14091. var regexp = /\x00/; // eslint-disable-line no-control-regex
  14092. var ignoreKeys = ['$db', '$ref', '$id', '$clusterTime'];
  14093. // To ensure that 0.4 of node works correctly
  14094. var isDate = function isDate(d) {
  14095. return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
  14096. };
  14097. var isRegExp = function isRegExp(d) {
  14098. return Object.prototype.toString.call(d) === '[object RegExp]';
  14099. };
  14100. var serializeString = function (buffer, key, value, index, isArray) {
  14101. // Encode String type
  14102. buffer[index++] = BSON.BSON_DATA_STRING;
  14103. // Number of written bytes
  14104. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14105. // Encode the name
  14106. index = index + numberOfWrittenBytes + 1;
  14107. buffer[index - 1] = 0;
  14108. // Write the string
  14109. var size = buffer.write(value, index + 4, 'utf8');
  14110. // Write the size of the string to buffer
  14111. buffer[index + 3] = size + 1 >> 24 & 0xff;
  14112. buffer[index + 2] = size + 1 >> 16 & 0xff;
  14113. buffer[index + 1] = size + 1 >> 8 & 0xff;
  14114. buffer[index] = size + 1 & 0xff;
  14115. // Update index
  14116. index = index + 4 + size;
  14117. // Write zero
  14118. buffer[index++] = 0;
  14119. return index;
  14120. };
  14121. var serializeNumber = function (buffer, key, value, index, isArray) {
  14122. // We have an integer value
  14123. if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  14124. // If the value fits in 32 bits encode as int, if it fits in a double
  14125. // encode it as a double, otherwise long
  14126. if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
  14127. // Set int type 32 bits or less
  14128. buffer[index++] = BSON.BSON_DATA_INT;
  14129. // Number of written bytes
  14130. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14131. // Encode the name
  14132. index = index + numberOfWrittenBytes;
  14133. buffer[index++] = 0;
  14134. // Write the int value
  14135. buffer[index++] = value & 0xff;
  14136. buffer[index++] = value >> 8 & 0xff;
  14137. buffer[index++] = value >> 16 & 0xff;
  14138. buffer[index++] = value >> 24 & 0xff;
  14139. } else if (value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  14140. // Encode as double
  14141. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14142. // Number of written bytes
  14143. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14144. // Encode the name
  14145. index = index + numberOfWrittenBytes;
  14146. buffer[index++] = 0;
  14147. // Write float
  14148. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14149. // Ajust index
  14150. index = index + 8;
  14151. } else {
  14152. // Set long type
  14153. buffer[index++] = BSON.BSON_DATA_LONG;
  14154. // Number of written bytes
  14155. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14156. // Encode the name
  14157. index = index + numberOfWrittenBytes;
  14158. buffer[index++] = 0;
  14159. var longVal = Long.fromNumber(value);
  14160. var lowBits = longVal.getLowBits();
  14161. var highBits = longVal.getHighBits();
  14162. // Encode low bits
  14163. buffer[index++] = lowBits & 0xff;
  14164. buffer[index++] = lowBits >> 8 & 0xff;
  14165. buffer[index++] = lowBits >> 16 & 0xff;
  14166. buffer[index++] = lowBits >> 24 & 0xff;
  14167. // Encode high bits
  14168. buffer[index++] = highBits & 0xff;
  14169. buffer[index++] = highBits >> 8 & 0xff;
  14170. buffer[index++] = highBits >> 16 & 0xff;
  14171. buffer[index++] = highBits >> 24 & 0xff;
  14172. }
  14173. } else {
  14174. // Encode as double
  14175. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14176. // Number of written bytes
  14177. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14178. // Encode the name
  14179. index = index + numberOfWrittenBytes;
  14180. buffer[index++] = 0;
  14181. // Write float
  14182. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14183. // Ajust index
  14184. index = index + 8;
  14185. }
  14186. return index;
  14187. };
  14188. var serializeNull = function (buffer, key, value, index, isArray) {
  14189. // Set long type
  14190. buffer[index++] = BSON.BSON_DATA_NULL;
  14191. // Number of written bytes
  14192. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14193. // Encode the name
  14194. index = index + numberOfWrittenBytes;
  14195. buffer[index++] = 0;
  14196. return index;
  14197. };
  14198. var serializeBoolean = function (buffer, key, value, index, isArray) {
  14199. // Write the type
  14200. buffer[index++] = BSON.BSON_DATA_BOOLEAN;
  14201. // Number of written bytes
  14202. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14203. // Encode the name
  14204. index = index + numberOfWrittenBytes;
  14205. buffer[index++] = 0;
  14206. // Encode the boolean value
  14207. buffer[index++] = value ? 1 : 0;
  14208. return index;
  14209. };
  14210. var serializeDate = function (buffer, key, value, index, isArray) {
  14211. // Write the type
  14212. buffer[index++] = BSON.BSON_DATA_DATE;
  14213. // Number of written bytes
  14214. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14215. // Encode the name
  14216. index = index + numberOfWrittenBytes;
  14217. buffer[index++] = 0;
  14218. // Write the date
  14219. var dateInMilis = Long.fromNumber(value.getTime());
  14220. var lowBits = dateInMilis.getLowBits();
  14221. var highBits = dateInMilis.getHighBits();
  14222. // Encode low bits
  14223. buffer[index++] = lowBits & 0xff;
  14224. buffer[index++] = lowBits >> 8 & 0xff;
  14225. buffer[index++] = lowBits >> 16 & 0xff;
  14226. buffer[index++] = lowBits >> 24 & 0xff;
  14227. // Encode high bits
  14228. buffer[index++] = highBits & 0xff;
  14229. buffer[index++] = highBits >> 8 & 0xff;
  14230. buffer[index++] = highBits >> 16 & 0xff;
  14231. buffer[index++] = highBits >> 24 & 0xff;
  14232. return index;
  14233. };
  14234. var serializeRegExp = function (buffer, key, value, index, isArray) {
  14235. // Write the type
  14236. buffer[index++] = BSON.BSON_DATA_REGEXP;
  14237. // Number of written bytes
  14238. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14239. // Encode the name
  14240. index = index + numberOfWrittenBytes;
  14241. buffer[index++] = 0;
  14242. if (value.source && value.source.match(regexp) != null) {
  14243. throw Error('value ' + value.source + ' must not contain null bytes');
  14244. }
  14245. // Adjust the index
  14246. index = index + buffer.write(value.source, index, 'utf8');
  14247. // Write zero
  14248. buffer[index++] = 0x00;
  14249. // Write the parameters
  14250. if (value.global) buffer[index++] = 0x73; // s
  14251. if (value.ignoreCase) buffer[index++] = 0x69; // i
  14252. if (value.multiline) buffer[index++] = 0x6d; // m
  14253. // Add ending zero
  14254. buffer[index++] = 0x00;
  14255. return index;
  14256. };
  14257. var serializeBSONRegExp = function (buffer, key, value, index, isArray) {
  14258. // Write the type
  14259. buffer[index++] = BSON.BSON_DATA_REGEXP;
  14260. // Number of written bytes
  14261. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14262. // Encode the name
  14263. index = index + numberOfWrittenBytes;
  14264. buffer[index++] = 0;
  14265. // Check the pattern for 0 bytes
  14266. if (value.pattern.match(regexp) != null) {
  14267. // The BSON spec doesn't allow keys with null bytes because keys are
  14268. // null-terminated.
  14269. throw Error('pattern ' + value.pattern + ' must not contain null bytes');
  14270. }
  14271. // Adjust the index
  14272. index = index + buffer.write(value.pattern, index, 'utf8');
  14273. // Write zero
  14274. buffer[index++] = 0x00;
  14275. // Write the options
  14276. index = index + buffer.write(value.options.split('').sort().join(''), index, 'utf8');
  14277. // Add ending zero
  14278. buffer[index++] = 0x00;
  14279. return index;
  14280. };
  14281. var serializeMinMax = function (buffer, key, value, index, isArray) {
  14282. // Write the type of either min or max key
  14283. if (value === null) {
  14284. buffer[index++] = BSON.BSON_DATA_NULL;
  14285. } else if (value._bsontype === 'MinKey') {
  14286. buffer[index++] = BSON.BSON_DATA_MIN_KEY;
  14287. } else {
  14288. buffer[index++] = BSON.BSON_DATA_MAX_KEY;
  14289. }
  14290. // Number of written bytes
  14291. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14292. // Encode the name
  14293. index = index + numberOfWrittenBytes;
  14294. buffer[index++] = 0;
  14295. return index;
  14296. };
  14297. var serializeObjectId = function (buffer, key, value, index, isArray) {
  14298. // Write the type
  14299. buffer[index++] = BSON.BSON_DATA_OID;
  14300. // Number of written bytes
  14301. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14302. // Encode the name
  14303. index = index + numberOfWrittenBytes;
  14304. buffer[index++] = 0;
  14305. // Write the objectId into the shared buffer
  14306. if (typeof value.id === 'string') {
  14307. buffer.write(value.id, index, 'binary');
  14308. } else if (value.id && value.id.copy) {
  14309. value.id.copy(buffer, index, 0, 12);
  14310. } else {
  14311. throw new Error('object [' + JSON.stringify(value) + '] is not a valid ObjectId');
  14312. }
  14313. // Ajust index
  14314. return index + 12;
  14315. };
  14316. var serializeBuffer = function (buffer, key, value, index, isArray) {
  14317. // Write the type
  14318. buffer[index++] = BSON.BSON_DATA_BINARY;
  14319. // Number of written bytes
  14320. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14321. // Encode the name
  14322. index = index + numberOfWrittenBytes;
  14323. buffer[index++] = 0;
  14324. // Get size of the buffer (current write point)
  14325. var size = value.length;
  14326. // Write the size of the string to buffer
  14327. buffer[index++] = size & 0xff;
  14328. buffer[index++] = size >> 8 & 0xff;
  14329. buffer[index++] = size >> 16 & 0xff;
  14330. buffer[index++] = size >> 24 & 0xff;
  14331. // Write the default subtype
  14332. buffer[index++] = BSON.BSON_BINARY_SUBTYPE_DEFAULT;
  14333. // Copy the content form the binary field to the buffer
  14334. value.copy(buffer, index, 0, size);
  14335. // Adjust the index
  14336. index = index + size;
  14337. return index;
  14338. };
  14339. var serializeObject = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) {
  14340. for (var i = 0; i < path.length; i++) {
  14341. if (path[i] === value) throw new Error('cyclic dependency detected');
  14342. }
  14343. // Push value to stack
  14344. path.push(value);
  14345. // Write the type
  14346. buffer[index++] = Array.isArray(value) ? BSON.BSON_DATA_ARRAY : BSON.BSON_DATA_OBJECT;
  14347. // Number of written bytes
  14348. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14349. // Encode the name
  14350. index = index + numberOfWrittenBytes;
  14351. buffer[index++] = 0;
  14352. var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
  14353. // Pop stack
  14354. path.pop();
  14355. // Write size
  14356. return endIndex;
  14357. };
  14358. var serializeDecimal128 = function (buffer, key, value, index, isArray) {
  14359. buffer[index++] = BSON.BSON_DATA_DECIMAL128;
  14360. // Number of written bytes
  14361. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14362. // Encode the name
  14363. index = index + numberOfWrittenBytes;
  14364. buffer[index++] = 0;
  14365. // Write the data from the value
  14366. value.bytes.copy(buffer, index, 0, 16);
  14367. return index + 16;
  14368. };
  14369. var serializeLong = function (buffer, key, value, index, isArray) {
  14370. // Write the type
  14371. buffer[index++] = value._bsontype === 'Long' ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_TIMESTAMP;
  14372. // Number of written bytes
  14373. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14374. // Encode the name
  14375. index = index + numberOfWrittenBytes;
  14376. buffer[index++] = 0;
  14377. // Write the date
  14378. var lowBits = value.getLowBits();
  14379. var highBits = value.getHighBits();
  14380. // Encode low bits
  14381. buffer[index++] = lowBits & 0xff;
  14382. buffer[index++] = lowBits >> 8 & 0xff;
  14383. buffer[index++] = lowBits >> 16 & 0xff;
  14384. buffer[index++] = lowBits >> 24 & 0xff;
  14385. // Encode high bits
  14386. buffer[index++] = highBits & 0xff;
  14387. buffer[index++] = highBits >> 8 & 0xff;
  14388. buffer[index++] = highBits >> 16 & 0xff;
  14389. buffer[index++] = highBits >> 24 & 0xff;
  14390. return index;
  14391. };
  14392. var serializeInt32 = function (buffer, key, value, index, isArray) {
  14393. // Set int type 32 bits or less
  14394. buffer[index++] = BSON.BSON_DATA_INT;
  14395. // Number of written bytes
  14396. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14397. // Encode the name
  14398. index = index + numberOfWrittenBytes;
  14399. buffer[index++] = 0;
  14400. // Write the int value
  14401. buffer[index++] = value & 0xff;
  14402. buffer[index++] = value >> 8 & 0xff;
  14403. buffer[index++] = value >> 16 & 0xff;
  14404. buffer[index++] = value >> 24 & 0xff;
  14405. return index;
  14406. };
  14407. var serializeDouble = function (buffer, key, value, index, isArray) {
  14408. // Encode as double
  14409. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14410. // Number of written bytes
  14411. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14412. // Encode the name
  14413. index = index + numberOfWrittenBytes;
  14414. buffer[index++] = 0;
  14415. // Write float
  14416. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14417. // Ajust index
  14418. index = index + 8;
  14419. return index;
  14420. };
  14421. var serializeFunction = function (buffer, key, value, index, checkKeys, depth, isArray) {
  14422. buffer[index++] = BSON.BSON_DATA_CODE;
  14423. // Number of written bytes
  14424. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14425. // Encode the name
  14426. index = index + numberOfWrittenBytes;
  14427. buffer[index++] = 0;
  14428. // Function string
  14429. var functionString = normalizedFunctionString(value);
  14430. // Write the string
  14431. var size = buffer.write(functionString, index + 4, 'utf8') + 1;
  14432. // Write the size of the string to buffer
  14433. buffer[index] = size & 0xff;
  14434. buffer[index + 1] = size >> 8 & 0xff;
  14435. buffer[index + 2] = size >> 16 & 0xff;
  14436. buffer[index + 3] = size >> 24 & 0xff;
  14437. // Update index
  14438. index = index + 4 + size - 1;
  14439. // Write zero
  14440. buffer[index++] = 0;
  14441. return index;
  14442. };
  14443. var serializeCode = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) {
  14444. if (value.scope && typeof value.scope === 'object') {
  14445. // Write the type
  14446. buffer[index++] = BSON.BSON_DATA_CODE_W_SCOPE;
  14447. // Number of written bytes
  14448. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14449. // Encode the name
  14450. index = index + numberOfWrittenBytes;
  14451. buffer[index++] = 0;
  14452. // Starting index
  14453. var startIndex = index;
  14454. // Serialize the function
  14455. // Get the function string
  14456. var functionString = typeof value.code === 'string' ? value.code : value.code.toString();
  14457. // Index adjustment
  14458. index = index + 4;
  14459. // Write string into buffer
  14460. var codeSize = buffer.write(functionString, index + 4, 'utf8') + 1;
  14461. // Write the size of the string to buffer
  14462. buffer[index] = codeSize & 0xff;
  14463. buffer[index + 1] = codeSize >> 8 & 0xff;
  14464. buffer[index + 2] = codeSize >> 16 & 0xff;
  14465. buffer[index + 3] = codeSize >> 24 & 0xff;
  14466. // Write end 0
  14467. buffer[index + 4 + codeSize - 1] = 0;
  14468. // Write the
  14469. index = index + codeSize + 4;
  14470. //
  14471. // Serialize the scope value
  14472. var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined);
  14473. index = endIndex - 1;
  14474. // Writ the total
  14475. var totalSize = endIndex - startIndex;
  14476. // Write the total size of the object
  14477. buffer[startIndex++] = totalSize & 0xff;
  14478. buffer[startIndex++] = totalSize >> 8 & 0xff;
  14479. buffer[startIndex++] = totalSize >> 16 & 0xff;
  14480. buffer[startIndex++] = totalSize >> 24 & 0xff;
  14481. // Write trailing zero
  14482. buffer[index++] = 0;
  14483. } else {
  14484. buffer[index++] = BSON.BSON_DATA_CODE;
  14485. // Number of written bytes
  14486. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14487. // Encode the name
  14488. index = index + numberOfWrittenBytes;
  14489. buffer[index++] = 0;
  14490. // Function string
  14491. functionString = value.code.toString();
  14492. // Write the string
  14493. var size = buffer.write(functionString, index + 4, 'utf8') + 1;
  14494. // Write the size of the string to buffer
  14495. buffer[index] = size & 0xff;
  14496. buffer[index + 1] = size >> 8 & 0xff;
  14497. buffer[index + 2] = size >> 16 & 0xff;
  14498. buffer[index + 3] = size >> 24 & 0xff;
  14499. // Update index
  14500. index = index + 4 + size - 1;
  14501. // Write zero
  14502. buffer[index++] = 0;
  14503. }
  14504. return index;
  14505. };
  14506. var serializeBinary = function (buffer, key, value, index, isArray) {
  14507. // Write the type
  14508. buffer[index++] = BSON.BSON_DATA_BINARY;
  14509. // Number of written bytes
  14510. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14511. // Encode the name
  14512. index = index + numberOfWrittenBytes;
  14513. buffer[index++] = 0;
  14514. // Extract the buffer
  14515. var data = value.value(true);
  14516. // Calculate size
  14517. var size = value.position;
  14518. // Add the deprecated 02 type 4 bytes of size to total
  14519. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4;
  14520. // Write the size of the string to buffer
  14521. buffer[index++] = size & 0xff;
  14522. buffer[index++] = size >> 8 & 0xff;
  14523. buffer[index++] = size >> 16 & 0xff;
  14524. buffer[index++] = size >> 24 & 0xff;
  14525. // Write the subtype to the buffer
  14526. buffer[index++] = value.sub_type;
  14527. // If we have binary type 2 the 4 first bytes are the size
  14528. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
  14529. size = size - 4;
  14530. buffer[index++] = size & 0xff;
  14531. buffer[index++] = size >> 8 & 0xff;
  14532. buffer[index++] = size >> 16 & 0xff;
  14533. buffer[index++] = size >> 24 & 0xff;
  14534. }
  14535. // Write the data to the object
  14536. data.copy(buffer, index, 0, value.position);
  14537. // Adjust the index
  14538. index = index + value.position;
  14539. return index;
  14540. };
  14541. var serializeSymbol = function (buffer, key, value, index, isArray) {
  14542. // Write the type
  14543. buffer[index++] = BSON.BSON_DATA_SYMBOL;
  14544. // Number of written bytes
  14545. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14546. // Encode the name
  14547. index = index + numberOfWrittenBytes;
  14548. buffer[index++] = 0;
  14549. // Write the string
  14550. var size = buffer.write(value.value, index + 4, 'utf8') + 1;
  14551. // Write the size of the string to buffer
  14552. buffer[index] = size & 0xff;
  14553. buffer[index + 1] = size >> 8 & 0xff;
  14554. buffer[index + 2] = size >> 16 & 0xff;
  14555. buffer[index + 3] = size >> 24 & 0xff;
  14556. // Update index
  14557. index = index + 4 + size - 1;
  14558. // Write zero
  14559. buffer[index++] = 0x00;
  14560. return index;
  14561. };
  14562. var serializeDBRef = function (buffer, key, value, index, depth, serializeFunctions, isArray) {
  14563. // Write the type
  14564. buffer[index++] = BSON.BSON_DATA_OBJECT;
  14565. // Number of written bytes
  14566. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14567. // Encode the name
  14568. index = index + numberOfWrittenBytes;
  14569. buffer[index++] = 0;
  14570. var startIndex = index;
  14571. var endIndex;
  14572. // Serialize object
  14573. if (null != value.db) {
  14574. endIndex = serializeInto(buffer, {
  14575. $ref: value.namespace,
  14576. $id: value.oid,
  14577. $db: value.db
  14578. }, false, index, depth + 1, serializeFunctions);
  14579. } else {
  14580. endIndex = serializeInto(buffer, {
  14581. $ref: value.namespace,
  14582. $id: value.oid
  14583. }, false, index, depth + 1, serializeFunctions);
  14584. }
  14585. // Calculate object size
  14586. var size = endIndex - startIndex;
  14587. // Write the size
  14588. buffer[startIndex++] = size & 0xff;
  14589. buffer[startIndex++] = size >> 8 & 0xff;
  14590. buffer[startIndex++] = size >> 16 & 0xff;
  14591. buffer[startIndex++] = size >> 24 & 0xff;
  14592. // Set index
  14593. return endIndex;
  14594. };
  14595. var serializeInto = function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) {
  14596. startingIndex = startingIndex || 0;
  14597. path = path || [];
  14598. // Push the object to the path
  14599. path.push(object);
  14600. // Start place to serialize into
  14601. var index = startingIndex + 4;
  14602. // var self = this;
  14603. // Special case isArray
  14604. if (Array.isArray(object)) {
  14605. // Get object keys
  14606. for (var i = 0; i < object.length; i++) {
  14607. var key = '' + i;
  14608. var value = object[i];
  14609. // Is there an override value
  14610. if (value && value.toBSON) {
  14611. if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
  14612. value = value.toBSON();
  14613. }
  14614. var type = typeof value;
  14615. if (type === 'string') {
  14616. index = serializeString(buffer, key, value, index, true);
  14617. } else if (type === 'number') {
  14618. index = serializeNumber(buffer, key, value, index, true);
  14619. } else if (type === 'boolean') {
  14620. index = serializeBoolean(buffer, key, value, index, true);
  14621. } else if (value instanceof Date || isDate(value)) {
  14622. index = serializeDate(buffer, key, value, index, true);
  14623. } else if (value === undefined) {
  14624. index = serializeNull(buffer, key, value, index, true);
  14625. } else if (value === null) {
  14626. index = serializeNull(buffer, key, value, index, true);
  14627. } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  14628. index = serializeObjectId(buffer, key, value, index, true);
  14629. } else if (Buffer.isBuffer(value)) {
  14630. index = serializeBuffer(buffer, key, value, index, true);
  14631. } else if (value instanceof RegExp || isRegExp(value)) {
  14632. index = serializeRegExp(buffer, key, value, index, true);
  14633. } else if (type === 'object' && value['_bsontype'] == null) {
  14634. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path);
  14635. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  14636. index = serializeDecimal128(buffer, key, value, index, true);
  14637. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  14638. index = serializeLong(buffer, key, value, index, true);
  14639. } else if (value['_bsontype'] === 'Double') {
  14640. index = serializeDouble(buffer, key, value, index, true);
  14641. } else if (typeof value === 'function' && serializeFunctions) {
  14642. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions, true);
  14643. } else if (value['_bsontype'] === 'Code') {
  14644. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true);
  14645. } else if (value['_bsontype'] === 'Binary') {
  14646. index = serializeBinary(buffer, key, value, index, true);
  14647. } else if (value['_bsontype'] === 'Symbol') {
  14648. index = serializeSymbol(buffer, key, value, index, true);
  14649. } else if (value['_bsontype'] === 'DBRef') {
  14650. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true);
  14651. } else if (value['_bsontype'] === 'BSONRegExp') {
  14652. index = serializeBSONRegExp(buffer, key, value, index, true);
  14653. } else if (value['_bsontype'] === 'Int32') {
  14654. index = serializeInt32(buffer, key, value, index, true);
  14655. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  14656. index = serializeMinMax(buffer, key, value, index, true);
  14657. }
  14658. }
  14659. } else if (object instanceof Map) {
  14660. var iterator = object.entries();
  14661. var done = false;
  14662. while (!done) {
  14663. // Unpack the next entry
  14664. var entry = iterator.next();
  14665. done = entry.done;
  14666. // Are we done, then skip and terminate
  14667. if (done) continue;
  14668. // Get the entry values
  14669. key = entry.value[0];
  14670. value = entry.value[1];
  14671. // Check the type of the value
  14672. type = typeof value;
  14673. // Check the key and throw error if it's illegal
  14674. if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
  14675. if (key.match(regexp) != null) {
  14676. // The BSON spec doesn't allow keys with null bytes because keys are
  14677. // null-terminated.
  14678. throw Error('key ' + key + ' must not contain null bytes');
  14679. }
  14680. if (checkKeys) {
  14681. if ('$' === key[0]) {
  14682. throw Error('key ' + key + " must not start with '$'");
  14683. } else if (~key.indexOf('.')) {
  14684. throw Error('key ' + key + " must not contain '.'");
  14685. }
  14686. }
  14687. }
  14688. if (type === 'string') {
  14689. index = serializeString(buffer, key, value, index);
  14690. } else if (type === 'number') {
  14691. index = serializeNumber(buffer, key, value, index);
  14692. } else if (type === 'boolean') {
  14693. index = serializeBoolean(buffer, key, value, index);
  14694. } else if (value instanceof Date || isDate(value)) {
  14695. index = serializeDate(buffer, key, value, index);
  14696. // } else if (value === undefined && ignoreUndefined === true) {
  14697. } else if (value === null || value === undefined && ignoreUndefined === false) {
  14698. index = serializeNull(buffer, key, value, index);
  14699. } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  14700. index = serializeObjectId(buffer, key, value, index);
  14701. } else if (Buffer.isBuffer(value)) {
  14702. index = serializeBuffer(buffer, key, value, index);
  14703. } else if (value instanceof RegExp || isRegExp(value)) {
  14704. index = serializeRegExp(buffer, key, value, index);
  14705. } else if (type === 'object' && value['_bsontype'] == null) {
  14706. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
  14707. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  14708. index = serializeDecimal128(buffer, key, value, index);
  14709. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  14710. index = serializeLong(buffer, key, value, index);
  14711. } else if (value['_bsontype'] === 'Double') {
  14712. index = serializeDouble(buffer, key, value, index);
  14713. } else if (value['_bsontype'] === 'Code') {
  14714. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
  14715. } else if (typeof value === 'function' && serializeFunctions) {
  14716. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
  14717. } else if (value['_bsontype'] === 'Binary') {
  14718. index = serializeBinary(buffer, key, value, index);
  14719. } else if (value['_bsontype'] === 'Symbol') {
  14720. index = serializeSymbol(buffer, key, value, index);
  14721. } else if (value['_bsontype'] === 'DBRef') {
  14722. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
  14723. } else if (value['_bsontype'] === 'BSONRegExp') {
  14724. index = serializeBSONRegExp(buffer, key, value, index);
  14725. } else if (value['_bsontype'] === 'Int32') {
  14726. index = serializeInt32(buffer, key, value, index);
  14727. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  14728. index = serializeMinMax(buffer, key, value, index);
  14729. }
  14730. }
  14731. } else {
  14732. // Did we provide a custom serialization method
  14733. if (object.toBSON) {
  14734. if (typeof object.toBSON !== 'function') throw new Error('toBSON is not a function');
  14735. object = object.toBSON();
  14736. if (object != null && typeof object !== 'object') throw new Error('toBSON function did not return an object');
  14737. }
  14738. // Iterate over all the keys
  14739. for (key in object) {
  14740. value = object[key];
  14741. // Is there an override value
  14742. if (value && value.toBSON) {
  14743. if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
  14744. value = value.toBSON();
  14745. }
  14746. // Check the type of the value
  14747. type = typeof value;
  14748. // Check the key and throw error if it's illegal
  14749. if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
  14750. if (key.match(regexp) != null) {
  14751. // The BSON spec doesn't allow keys with null bytes because keys are
  14752. // null-terminated.
  14753. throw Error('key ' + key + ' must not contain null bytes');
  14754. }
  14755. if (checkKeys) {
  14756. if ('$' === key[0]) {
  14757. throw Error('key ' + key + " must not start with '$'");
  14758. } else if (~key.indexOf('.')) {
  14759. throw Error('key ' + key + " must not contain '.'");
  14760. }
  14761. }
  14762. }
  14763. if (type === 'string') {
  14764. index = serializeString(buffer, key, value, index);
  14765. } else if (type === 'number') {
  14766. index = serializeNumber(buffer, key, value, index);
  14767. } else if (type === 'boolean') {
  14768. index = serializeBoolean(buffer, key, value, index);
  14769. } else if (value instanceof Date || isDate(value)) {
  14770. index = serializeDate(buffer, key, value, index);
  14771. } else if (value === undefined) {
  14772. if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index);
  14773. } else if (value === null) {
  14774. index = serializeNull(buffer, key, value, index);
  14775. } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  14776. index = serializeObjectId(buffer, key, value, index);
  14777. } else if (Buffer.isBuffer(value)) {
  14778. index = serializeBuffer(buffer, key, value, index);
  14779. } else if (value instanceof RegExp || isRegExp(value)) {
  14780. index = serializeRegExp(buffer, key, value, index);
  14781. } else if (type === 'object' && value['_bsontype'] == null) {
  14782. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
  14783. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  14784. index = serializeDecimal128(buffer, key, value, index);
  14785. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  14786. index = serializeLong(buffer, key, value, index);
  14787. } else if (value['_bsontype'] === 'Double') {
  14788. index = serializeDouble(buffer, key, value, index);
  14789. } else if (value['_bsontype'] === 'Code') {
  14790. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
  14791. } else if (typeof value === 'function' && serializeFunctions) {
  14792. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
  14793. } else if (value['_bsontype'] === 'Binary') {
  14794. index = serializeBinary(buffer, key, value, index);
  14795. } else if (value['_bsontype'] === 'Symbol') {
  14796. index = serializeSymbol(buffer, key, value, index);
  14797. } else if (value['_bsontype'] === 'DBRef') {
  14798. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
  14799. } else if (value['_bsontype'] === 'BSONRegExp') {
  14800. index = serializeBSONRegExp(buffer, key, value, index);
  14801. } else if (value['_bsontype'] === 'Int32') {
  14802. index = serializeInt32(buffer, key, value, index);
  14803. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  14804. index = serializeMinMax(buffer, key, value, index);
  14805. }
  14806. }
  14807. }
  14808. // Remove the path
  14809. path.pop();
  14810. // Final padding byte for object
  14811. buffer[index++] = 0x00;
  14812. // Final size
  14813. var size = index - startingIndex;
  14814. // Write the size of the object
  14815. buffer[startingIndex++] = size & 0xff;
  14816. buffer[startingIndex++] = size >> 8 & 0xff;
  14817. buffer[startingIndex++] = size >> 16 & 0xff;
  14818. buffer[startingIndex++] = size >> 24 & 0xff;
  14819. return index;
  14820. };
  14821. var BSON = {};
  14822. /**
  14823. * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
  14824. *
  14825. * @ignore
  14826. * @api private
  14827. */
  14828. // var functionCache = (BSON.functionCache = {});
  14829. /**
  14830. * Number BSON Type
  14831. *
  14832. * @classconstant BSON_DATA_NUMBER
  14833. **/
  14834. BSON.BSON_DATA_NUMBER = 1;
  14835. /**
  14836. * String BSON Type
  14837. *
  14838. * @classconstant BSON_DATA_STRING
  14839. **/
  14840. BSON.BSON_DATA_STRING = 2;
  14841. /**
  14842. * Object BSON Type
  14843. *
  14844. * @classconstant BSON_DATA_OBJECT
  14845. **/
  14846. BSON.BSON_DATA_OBJECT = 3;
  14847. /**
  14848. * Array BSON Type
  14849. *
  14850. * @classconstant BSON_DATA_ARRAY
  14851. **/
  14852. BSON.BSON_DATA_ARRAY = 4;
  14853. /**
  14854. * Binary BSON Type
  14855. *
  14856. * @classconstant BSON_DATA_BINARY
  14857. **/
  14858. BSON.BSON_DATA_BINARY = 5;
  14859. /**
  14860. * ObjectID BSON Type, deprecated
  14861. *
  14862. * @classconstant BSON_DATA_UNDEFINED
  14863. **/
  14864. BSON.BSON_DATA_UNDEFINED = 6;
  14865. /**
  14866. * ObjectID BSON Type
  14867. *
  14868. * @classconstant BSON_DATA_OID
  14869. **/
  14870. BSON.BSON_DATA_OID = 7;
  14871. /**
  14872. * Boolean BSON Type
  14873. *
  14874. * @classconstant BSON_DATA_BOOLEAN
  14875. **/
  14876. BSON.BSON_DATA_BOOLEAN = 8;
  14877. /**
  14878. * Date BSON Type
  14879. *
  14880. * @classconstant BSON_DATA_DATE
  14881. **/
  14882. BSON.BSON_DATA_DATE = 9;
  14883. /**
  14884. * null BSON Type
  14885. *
  14886. * @classconstant BSON_DATA_NULL
  14887. **/
  14888. BSON.BSON_DATA_NULL = 10;
  14889. /**
  14890. * RegExp BSON Type
  14891. *
  14892. * @classconstant BSON_DATA_REGEXP
  14893. **/
  14894. BSON.BSON_DATA_REGEXP = 11;
  14895. /**
  14896. * Code BSON Type
  14897. *
  14898. * @classconstant BSON_DATA_CODE
  14899. **/
  14900. BSON.BSON_DATA_CODE = 13;
  14901. /**
  14902. * Symbol BSON Type
  14903. *
  14904. * @classconstant BSON_DATA_SYMBOL
  14905. **/
  14906. BSON.BSON_DATA_SYMBOL = 14;
  14907. /**
  14908. * Code with Scope BSON Type
  14909. *
  14910. * @classconstant BSON_DATA_CODE_W_SCOPE
  14911. **/
  14912. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  14913. /**
  14914. * 32 bit Integer BSON Type
  14915. *
  14916. * @classconstant BSON_DATA_INT
  14917. **/
  14918. BSON.BSON_DATA_INT = 16;
  14919. /**
  14920. * Timestamp BSON Type
  14921. *
  14922. * @classconstant BSON_DATA_TIMESTAMP
  14923. **/
  14924. BSON.BSON_DATA_TIMESTAMP = 17;
  14925. /**
  14926. * Long BSON Type
  14927. *
  14928. * @classconstant BSON_DATA_LONG
  14929. **/
  14930. BSON.BSON_DATA_LONG = 18;
  14931. /**
  14932. * Long BSON Type
  14933. *
  14934. * @classconstant BSON_DATA_DECIMAL128
  14935. **/
  14936. BSON.BSON_DATA_DECIMAL128 = 19;
  14937. /**
  14938. * MinKey BSON Type
  14939. *
  14940. * @classconstant BSON_DATA_MIN_KEY
  14941. **/
  14942. BSON.BSON_DATA_MIN_KEY = 0xff;
  14943. /**
  14944. * MaxKey BSON Type
  14945. *
  14946. * @classconstant BSON_DATA_MAX_KEY
  14947. **/
  14948. BSON.BSON_DATA_MAX_KEY = 0x7f;
  14949. /**
  14950. * Binary Default Type
  14951. *
  14952. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  14953. **/
  14954. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  14955. /**
  14956. * Binary Function Type
  14957. *
  14958. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  14959. **/
  14960. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  14961. /**
  14962. * Binary Byte Array Type
  14963. *
  14964. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  14965. **/
  14966. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  14967. /**
  14968. * Binary UUID Type
  14969. *
  14970. * @classconstant BSON_BINARY_SUBTYPE_UUID
  14971. **/
  14972. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  14973. /**
  14974. * Binary MD5 Type
  14975. *
  14976. * @classconstant BSON_BINARY_SUBTYPE_MD5
  14977. **/
  14978. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  14979. /**
  14980. * Binary User Defined Type
  14981. *
  14982. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  14983. **/
  14984. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  14985. // BSON MAX VALUES
  14986. BSON.BSON_INT32_MAX = 0x7fffffff;
  14987. BSON.BSON_INT32_MIN = -0x80000000;
  14988. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  14989. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  14990. // JS MAX PRECISE VALUES
  14991. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  14992. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  14993. // Internal long versions
  14994. // var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  14995. // var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  14996. module.exports = serializeInto;
  14997. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(334).Buffer))
  14998. /***/ }),
  14999. /* 354 */
  15000. /***/ (function(module, exports) {
  15001. // Copyright (c) 2008, Fair Oaks Labs, Inc.
  15002. // All rights reserved.
  15003. //
  15004. // Redistribution and use in source and binary forms, with or without
  15005. // modification, are permitted provided that the following conditions are met:
  15006. //
  15007. // * Redistributions of source code must retain the above copyright notice,
  15008. // this list of conditions and the following disclaimer.
  15009. //
  15010. // * Redistributions in binary form must reproduce the above copyright notice,
  15011. // this list of conditions and the following disclaimer in the documentation
  15012. // and/or other materials provided with the distribution.
  15013. //
  15014. // * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
  15015. // may be used to endorse or promote products derived from this software
  15016. // without specific prior written permission.
  15017. //
  15018. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  15019. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15020. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  15021. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  15022. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  15023. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  15024. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  15025. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  15026. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  15027. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  15028. // POSSIBILITY OF SUCH DAMAGE.
  15029. //
  15030. //
  15031. // Modifications to writeIEEE754 to support negative zeroes made by Brian White
  15032. var readIEEE754 = function (buffer, offset, endian, mLen, nBytes) {
  15033. var e,
  15034. m,
  15035. bBE = endian === 'big',
  15036. eLen = nBytes * 8 - mLen - 1,
  15037. eMax = (1 << eLen) - 1,
  15038. eBias = eMax >> 1,
  15039. nBits = -7,
  15040. i = bBE ? 0 : nBytes - 1,
  15041. d = bBE ? 1 : -1,
  15042. s = buffer[offset + i];
  15043. i += d;
  15044. e = s & (1 << -nBits) - 1;
  15045. s >>= -nBits;
  15046. nBits += eLen;
  15047. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
  15048. m = e & (1 << -nBits) - 1;
  15049. e >>= -nBits;
  15050. nBits += mLen;
  15051. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
  15052. if (e === 0) {
  15053. e = 1 - eBias;
  15054. } else if (e === eMax) {
  15055. return m ? NaN : (s ? -1 : 1) * Infinity;
  15056. } else {
  15057. m = m + Math.pow(2, mLen);
  15058. e = e - eBias;
  15059. }
  15060. return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  15061. };
  15062. var writeIEEE754 = function (buffer, value, offset, endian, mLen, nBytes) {
  15063. var e,
  15064. m,
  15065. c,
  15066. bBE = endian === 'big',
  15067. eLen = nBytes * 8 - mLen - 1,
  15068. eMax = (1 << eLen) - 1,
  15069. eBias = eMax >> 1,
  15070. rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  15071. i = bBE ? nBytes - 1 : 0,
  15072. d = bBE ? -1 : 1,
  15073. s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  15074. value = Math.abs(value);
  15075. if (isNaN(value) || value === Infinity) {
  15076. m = isNaN(value) ? 1 : 0;
  15077. e = eMax;
  15078. } else {
  15079. e = Math.floor(Math.log(value) / Math.LN2);
  15080. if (value * (c = Math.pow(2, -e)) < 1) {
  15081. e--;
  15082. c *= 2;
  15083. }
  15084. if (e + eBias >= 1) {
  15085. value += rt / c;
  15086. } else {
  15087. value += rt * Math.pow(2, 1 - eBias);
  15088. }
  15089. if (value * c >= 2) {
  15090. e++;
  15091. c /= 2;
  15092. }
  15093. if (e + eBias >= eMax) {
  15094. m = 0;
  15095. e = eMax;
  15096. } else if (e + eBias >= 1) {
  15097. m = (value * c - 1) * Math.pow(2, mLen);
  15098. e = e + eBias;
  15099. } else {
  15100. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
  15101. e = 0;
  15102. }
  15103. }
  15104. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
  15105. e = e << mLen | m;
  15106. eLen += mLen;
  15107. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
  15108. buffer[offset + i - d] |= s * 128;
  15109. };
  15110. exports.readIEEE754 = readIEEE754;
  15111. exports.writeIEEE754 = writeIEEE754;
  15112. /***/ }),
  15113. /* 355 */
  15114. /***/ (function(module, exports, __webpack_require__) {
  15115. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  15116. var Long = __webpack_require__(330).Long,
  15117. Double = __webpack_require__(331).Double,
  15118. Timestamp = __webpack_require__(332).Timestamp,
  15119. ObjectID = __webpack_require__(333).ObjectID,
  15120. Symbol = __webpack_require__(344).Symbol,
  15121. BSONRegExp = __webpack_require__(343).BSONRegExp,
  15122. Code = __webpack_require__(346).Code,
  15123. Decimal128 = __webpack_require__(347),
  15124. MinKey = __webpack_require__(348).MinKey,
  15125. MaxKey = __webpack_require__(349).MaxKey,
  15126. DBRef = __webpack_require__(350).DBRef,
  15127. Binary = __webpack_require__(351).Binary;
  15128. var normalizedFunctionString = __webpack_require__(339).normalizedFunctionString;
  15129. // To ensure that 0.4 of node works correctly
  15130. var isDate = function isDate(d) {
  15131. return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
  15132. };
  15133. var calculateObjectSize = function calculateObjectSize(object, serializeFunctions, ignoreUndefined) {
  15134. var totalLength = 4 + 1;
  15135. if (Array.isArray(object)) {
  15136. for (var i = 0; i < object.length; i++) {
  15137. totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined);
  15138. }
  15139. } else {
  15140. // If we have toBSON defined, override the current object
  15141. if (object.toBSON) {
  15142. object = object.toBSON();
  15143. }
  15144. // Calculate size
  15145. for (var key in object) {
  15146. totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
  15147. }
  15148. }
  15149. return totalLength;
  15150. };
  15151. /**
  15152. * @ignore
  15153. * @api private
  15154. */
  15155. function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
  15156. // If we have toBSON defined, override the current object
  15157. if (value && value.toBSON) {
  15158. value = value.toBSON();
  15159. }
  15160. switch (typeof value) {
  15161. case 'string':
  15162. return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
  15163. case 'number':
  15164. if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  15165. if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
  15166. // 32 bit
  15167. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1);
  15168. } else {
  15169. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15170. }
  15171. } else {
  15172. // 64 bit
  15173. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15174. }
  15175. case 'undefined':
  15176. if (isArray || !ignoreUndefined) return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
  15177. return 0;
  15178. case 'boolean':
  15179. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1);
  15180. case 'object':
  15181. if (value == null || value instanceof MinKey || value instanceof MaxKey || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  15182. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
  15183. } else if (value instanceof ObjectID || value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
  15184. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1);
  15185. } else if (value instanceof Date || isDate(value)) {
  15186. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15187. } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
  15188. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.length;
  15189. } else if (value instanceof Long || value instanceof Double || value instanceof Timestamp || value['_bsontype'] === 'Long' || value['_bsontype'] === 'Double' || value['_bsontype'] === 'Timestamp') {
  15190. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15191. } else if (value instanceof Decimal128 || value['_bsontype'] === 'Decimal128') {
  15192. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1);
  15193. } else if (value instanceof Code || value['_bsontype'] === 'Code') {
  15194. // Calculate size depending on the availability of a scope
  15195. if (value.scope != null && Object.keys(value.scope).length > 0) {
  15196. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
  15197. } else {
  15198. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1;
  15199. }
  15200. } else if (value instanceof Binary || value['_bsontype'] === 'Binary') {
  15201. // Check what kind of subtype we have
  15202. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
  15203. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1 + 4);
  15204. } else {
  15205. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1);
  15206. }
  15207. } else if (value instanceof Symbol || value['_bsontype'] === 'Symbol') {
  15208. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + Buffer.byteLength(value.value, 'utf8') + 4 + 1 + 1;
  15209. } else if (value instanceof DBRef || value['_bsontype'] === 'DBRef') {
  15210. // Set up correct object for serialization
  15211. var ordered_values = {
  15212. $ref: value.namespace,
  15213. $id: value.oid
  15214. };
  15215. // Add db reference if it exists
  15216. if (null != value.db) {
  15217. ordered_values['$db'] = value.db;
  15218. }
  15219. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined);
  15220. } else if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]') {
  15221. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
  15222. } else if (value instanceof BSONRegExp || value['_bsontype'] === 'BSONRegExp') {
  15223. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.pattern, 'utf8') + 1 + Buffer.byteLength(value.options, 'utf8') + 1;
  15224. } else {
  15225. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1;
  15226. }
  15227. case 'function':
  15228. // WTF for 0.4.X where typeof /someregexp/ === 'function'
  15229. if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]' || String.call(value) === '[object RegExp]') {
  15230. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
  15231. } else {
  15232. if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
  15233. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
  15234. } else if (serializeFunctions) {
  15235. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1;
  15236. }
  15237. }
  15238. }
  15239. return 0;
  15240. }
  15241. var BSON = {};
  15242. // BSON MAX VALUES
  15243. BSON.BSON_INT32_MAX = 0x7fffffff;
  15244. BSON.BSON_INT32_MIN = -0x80000000;
  15245. // JS MAX PRECISE VALUES
  15246. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  15247. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  15248. module.exports = calculateObjectSize;
  15249. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(334).Buffer))
  15250. /***/ })
  15251. /******/ ])
  15252. });
  15253. ;