vendor.js 1019 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var _toString = Object.prototype.toString;
  12. var hasOwnProperty = Object.prototype.hasOwnProperty;
  13. function isFn(fn) {
  14. return typeof fn === 'function';
  15. }
  16. function isStr(str) {
  17. return typeof str === 'string';
  18. }
  19. function isPlainObject(obj) {
  20. return _toString.call(obj) === '[object Object]';
  21. }
  22. function hasOwn(obj, key) {
  23. return hasOwnProperty.call(obj, key);
  24. }
  25. function noop() {}
  26. /**
  27. * Create a cached version of a pure function.
  28. */
  29. function cached(fn) {
  30. var cache = Object.create(null);
  31. return function cachedFn(str) {
  32. var hit = cache[str];
  33. return hit || (cache[str] = fn(str));
  34. };
  35. }
  36. /**
  37. * Camelize a hyphen-delimited string.
  38. */
  39. var camelizeRE = /-(\w)/g;
  40. var camelize = cached(function (str) {
  41. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  42. });
  43. var HOOKS = [
  44. 'invoke',
  45. 'success',
  46. 'fail',
  47. 'complete',
  48. 'returnValue'];
  49. var globalInterceptors = {};
  50. var scopedInterceptors = {};
  51. function mergeHook(parentVal, childVal) {
  52. var res = childVal ?
  53. parentVal ?
  54. parentVal.concat(childVal) :
  55. Array.isArray(childVal) ?
  56. childVal : [childVal] :
  57. parentVal;
  58. return res ?
  59. dedupeHooks(res) :
  60. res;
  61. }
  62. function dedupeHooks(hooks) {
  63. var res = [];
  64. for (var i = 0; i < hooks.length; i++) {
  65. if (res.indexOf(hooks[i]) === -1) {
  66. res.push(hooks[i]);
  67. }
  68. }
  69. return res;
  70. }
  71. function removeHook(hooks, hook) {
  72. var index = hooks.indexOf(hook);
  73. if (index !== -1) {
  74. hooks.splice(index, 1);
  75. }
  76. }
  77. function mergeInterceptorHook(interceptor, option) {
  78. Object.keys(option).forEach(function (hook) {
  79. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  80. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  81. }
  82. });
  83. }
  84. function removeInterceptorHook(interceptor, option) {
  85. if (!interceptor || !option) {
  86. return;
  87. }
  88. Object.keys(option).forEach(function (hook) {
  89. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  90. removeHook(interceptor[hook], option[hook]);
  91. }
  92. });
  93. }
  94. function addInterceptor(method, option) {
  95. if (typeof method === 'string' && isPlainObject(option)) {
  96. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  97. } else if (isPlainObject(method)) {
  98. mergeInterceptorHook(globalInterceptors, method);
  99. }
  100. }
  101. function removeInterceptor(method, option) {
  102. if (typeof method === 'string') {
  103. if (isPlainObject(option)) {
  104. removeInterceptorHook(scopedInterceptors[method], option);
  105. } else {
  106. delete scopedInterceptors[method];
  107. }
  108. } else if (isPlainObject(method)) {
  109. removeInterceptorHook(globalInterceptors, method);
  110. }
  111. }
  112. function wrapperHook(hook) {
  113. return function (data) {
  114. return hook(data) || data;
  115. };
  116. }
  117. function isPromise(obj) {
  118. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  119. }
  120. function queue(hooks, data) {
  121. var promise = false;
  122. for (var i = 0; i < hooks.length; i++) {
  123. var hook = hooks[i];
  124. if (promise) {
  125. promise = Promise.resolve(wrapperHook(hook));
  126. } else {
  127. var res = hook(data);
  128. if (isPromise(res)) {
  129. promise = Promise.resolve(res);
  130. }
  131. if (res === false) {
  132. return {
  133. then: function then() {} };
  134. }
  135. }
  136. }
  137. return promise || {
  138. then: function then(callback) {
  139. return callback(data);
  140. } };
  141. }
  142. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  143. ['success', 'fail', 'complete'].forEach(function (name) {
  144. if (Array.isArray(interceptor[name])) {
  145. var oldCallback = options[name];
  146. options[name] = function callbackInterceptor(res) {
  147. queue(interceptor[name], res).then(function (res) {
  148. /* eslint-disable no-mixed-operators */
  149. return isFn(oldCallback) && oldCallback(res) || res;
  150. });
  151. };
  152. }
  153. });
  154. return options;
  155. }
  156. function wrapperReturnValue(method, returnValue) {
  157. var returnValueHooks = [];
  158. if (Array.isArray(globalInterceptors.returnValue)) {
  159. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  160. }
  161. var interceptor = scopedInterceptors[method];
  162. if (interceptor && Array.isArray(interceptor.returnValue)) {
  163. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  164. }
  165. returnValueHooks.forEach(function (hook) {
  166. returnValue = hook(returnValue) || returnValue;
  167. });
  168. return returnValue;
  169. }
  170. function getApiInterceptorHooks(method) {
  171. var interceptor = Object.create(null);
  172. Object.keys(globalInterceptors).forEach(function (hook) {
  173. if (hook !== 'returnValue') {
  174. interceptor[hook] = globalInterceptors[hook].slice();
  175. }
  176. });
  177. var scopedInterceptor = scopedInterceptors[method];
  178. if (scopedInterceptor) {
  179. Object.keys(scopedInterceptor).forEach(function (hook) {
  180. if (hook !== 'returnValue') {
  181. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  182. }
  183. });
  184. }
  185. return interceptor;
  186. }
  187. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  188. var interceptor = getApiInterceptorHooks(method);
  189. if (interceptor && Object.keys(interceptor).length) {
  190. if (Array.isArray(interceptor.invoke)) {
  191. var res = queue(interceptor.invoke, options);
  192. return res.then(function (options) {
  193. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  194. });
  195. } else {
  196. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  197. }
  198. }
  199. return api.apply(void 0, [options].concat(params));
  200. }
  201. var promiseInterceptor = {
  202. returnValue: function returnValue(res) {
  203. if (!isPromise(res)) {
  204. return res;
  205. }
  206. return res.then(function (res) {
  207. return res[1];
  208. }).catch(function (res) {
  209. return res[0];
  210. });
  211. } };
  212. var SYNC_API_RE =
  213. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  214. var CONTEXT_API_RE = /^create|Manager$/;
  215. // Context例外情况
  216. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  217. // 同步例外情况
  218. var ASYNC_API = ['createBLEConnection'];
  219. var CALLBACK_API_RE = /^on|^off/;
  220. function isContextApi(name) {
  221. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  222. }
  223. function isSyncApi(name) {
  224. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  225. }
  226. function isCallbackApi(name) {
  227. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  228. }
  229. function handlePromise(promise) {
  230. return promise.then(function (data) {
  231. return [null, data];
  232. }).
  233. catch(function (err) {return [err];});
  234. }
  235. function shouldPromise(name) {
  236. if (
  237. isContextApi(name) ||
  238. isSyncApi(name) ||
  239. isCallbackApi(name))
  240. {
  241. return false;
  242. }
  243. return true;
  244. }
  245. /* eslint-disable no-extend-native */
  246. if (!Promise.prototype.finally) {
  247. Promise.prototype.finally = function (callback) {
  248. var promise = this.constructor;
  249. return this.then(
  250. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  251. function (reason) {return promise.resolve(callback()).then(function () {
  252. throw reason;
  253. });});
  254. };
  255. }
  256. function promisify(name, api) {
  257. if (!shouldPromise(name)) {
  258. return api;
  259. }
  260. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  261. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  262. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  263. }
  264. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  265. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  266. success: resolve,
  267. fail: reject })].concat(
  268. params));
  269. })));
  270. };
  271. }
  272. var EPS = 1e-4;
  273. var BASE_DEVICE_WIDTH = 750;
  274. var isIOS = false;
  275. var deviceWidth = 0;
  276. var deviceDPR = 0;
  277. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  278. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  279. deviceWidth = windowWidth;
  280. deviceDPR = pixelRatio;
  281. isIOS = platform === 'ios';
  282. }
  283. function upx2px(number, newDeviceWidth) {
  284. if (deviceWidth === 0) {
  285. checkDeviceWidth();
  286. }
  287. number = Number(number);
  288. if (number === 0) {
  289. return 0;
  290. }
  291. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  292. if (result < 0) {
  293. result = -result;
  294. }
  295. result = Math.floor(result + EPS);
  296. if (result === 0) {
  297. if (deviceDPR === 1 || !isIOS) {
  298. result = 1;
  299. } else {
  300. result = 0.5;
  301. }
  302. }
  303. return number < 0 ? -result : result;
  304. }
  305. var interceptors = {
  306. promiseInterceptor: promiseInterceptor };
  307. var baseApi = /*#__PURE__*/Object.freeze({
  308. __proto__: null,
  309. upx2px: upx2px,
  310. addInterceptor: addInterceptor,
  311. removeInterceptor: removeInterceptor,
  312. interceptors: interceptors });
  313. function findExistsPageIndex(url) {
  314. var pages = getCurrentPages();
  315. var len = pages.length;
  316. while (len--) {
  317. var page = pages[len];
  318. if (page.$page && page.$page.fullPath === url) {
  319. return len;
  320. }
  321. }
  322. return -1;
  323. }
  324. var redirectTo = {
  325. name: function name(fromArgs) {
  326. if (fromArgs.exists === 'back' && fromArgs.delta) {
  327. return 'navigateBack';
  328. }
  329. return 'redirectTo';
  330. },
  331. args: function args(fromArgs) {
  332. if (fromArgs.exists === 'back' && fromArgs.url) {
  333. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  334. if (existsPageIndex !== -1) {
  335. var delta = getCurrentPages().length - 1 - existsPageIndex;
  336. if (delta > 0) {
  337. fromArgs.delta = delta;
  338. }
  339. }
  340. }
  341. } };
  342. var previewImage = {
  343. args: function args(fromArgs) {
  344. var currentIndex = parseInt(fromArgs.current);
  345. if (isNaN(currentIndex)) {
  346. return;
  347. }
  348. var urls = fromArgs.urls;
  349. if (!Array.isArray(urls)) {
  350. return;
  351. }
  352. var len = urls.length;
  353. if (!len) {
  354. return;
  355. }
  356. if (currentIndex < 0) {
  357. currentIndex = 0;
  358. } else if (currentIndex >= len) {
  359. currentIndex = len - 1;
  360. }
  361. if (currentIndex > 0) {
  362. fromArgs.current = urls[currentIndex];
  363. fromArgs.urls = urls.filter(
  364. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  365. } else {
  366. fromArgs.current = urls[0];
  367. }
  368. return {
  369. indicator: false,
  370. loop: false };
  371. } };
  372. var UUID_KEY = '__DC_STAT_UUID';
  373. var deviceId;
  374. function addUuid(result) {
  375. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  376. if (!deviceId) {
  377. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  378. wx.setStorage({
  379. key: UUID_KEY,
  380. data: deviceId });
  381. }
  382. result.deviceId = deviceId;
  383. }
  384. function addSafeAreaInsets(result) {
  385. if (result.safeArea) {
  386. var safeArea = result.safeArea;
  387. result.safeAreaInsets = {
  388. top: safeArea.top,
  389. left: safeArea.left,
  390. right: result.windowWidth - safeArea.right,
  391. bottom: result.windowHeight - safeArea.bottom };
  392. }
  393. }
  394. var getSystemInfo = {
  395. returnValue: function returnValue(result) {
  396. addUuid(result);
  397. addSafeAreaInsets(result);
  398. } };
  399. // import navigateTo from 'uni-helpers/navigate-to'
  400. var protocols = {
  401. redirectTo: redirectTo,
  402. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  403. previewImage: previewImage,
  404. getSystemInfo: getSystemInfo,
  405. getSystemInfoSync: getSystemInfo };
  406. var todos = [
  407. 'vibrate',
  408. 'preloadPage',
  409. 'unPreloadPage',
  410. 'loadSubPackage'];
  411. var canIUses = [];
  412. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  413. function processCallback(methodName, method, returnValue) {
  414. return function (res) {
  415. return method(processReturnValue(methodName, res, returnValue));
  416. };
  417. }
  418. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  419. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  420. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  421. if (isFn(argsOption)) {
  422. argsOption = argsOption(fromArgs, toArgs) || {};
  423. }
  424. for (var key in fromArgs) {
  425. if (hasOwn(argsOption, key)) {
  426. var keyOption = argsOption[key];
  427. if (isFn(keyOption)) {
  428. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  429. }
  430. if (!keyOption) {// 不支持的参数
  431. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  432. } else if (isStr(keyOption)) {// 重写参数 key
  433. toArgs[keyOption] = fromArgs[key];
  434. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  435. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  436. }
  437. } else if (CALLBACKS.indexOf(key) !== -1) {
  438. if (isFn(fromArgs[key])) {
  439. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  440. }
  441. } else {
  442. if (!keepFromArgs) {
  443. toArgs[key] = fromArgs[key];
  444. }
  445. }
  446. }
  447. return toArgs;
  448. } else if (isFn(fromArgs)) {
  449. fromArgs = processCallback(methodName, fromArgs, returnValue);
  450. }
  451. return fromArgs;
  452. }
  453. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  454. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  455. res = protocols.returnValue(methodName, res);
  456. }
  457. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  458. }
  459. function wrapper(methodName, method) {
  460. if (hasOwn(protocols, methodName)) {
  461. var protocol = protocols[methodName];
  462. if (!protocol) {// 暂不支持的 api
  463. return function () {
  464. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  465. };
  466. }
  467. return function (arg1, arg2) {// 目前 api 最多两个参数
  468. var options = protocol;
  469. if (isFn(protocol)) {
  470. options = protocol(arg1);
  471. }
  472. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  473. var args = [arg1];
  474. if (typeof arg2 !== 'undefined') {
  475. args.push(arg2);
  476. }
  477. if (isFn(options.name)) {
  478. methodName = options.name(arg1);
  479. } else if (isStr(options.name)) {
  480. methodName = options.name;
  481. }
  482. var returnValue = wx[methodName].apply(wx, args);
  483. if (isSyncApi(methodName)) {// 同步 api
  484. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  485. }
  486. return returnValue;
  487. };
  488. }
  489. return method;
  490. }
  491. var todoApis = Object.create(null);
  492. var TODOS = [
  493. 'onTabBarMidButtonTap',
  494. 'subscribePush',
  495. 'unsubscribePush',
  496. 'onPush',
  497. 'offPush',
  498. 'share'];
  499. function createTodoApi(name) {
  500. return function todoApi(_ref)
  501. {var fail = _ref.fail,complete = _ref.complete;
  502. var res = {
  503. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  504. isFn(fail) && fail(res);
  505. isFn(complete) && complete(res);
  506. };
  507. }
  508. TODOS.forEach(function (name) {
  509. todoApis[name] = createTodoApi(name);
  510. });
  511. var providers = {
  512. oauth: ['weixin'],
  513. share: ['weixin'],
  514. payment: ['wxpay'],
  515. push: ['weixin'] };
  516. function getProvider(_ref2)
  517. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  518. var res = false;
  519. if (providers[service]) {
  520. res = {
  521. errMsg: 'getProvider:ok',
  522. service: service,
  523. provider: providers[service] };
  524. isFn(success) && success(res);
  525. } else {
  526. res = {
  527. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  528. isFn(fail) && fail(res);
  529. }
  530. isFn(complete) && complete(res);
  531. }
  532. var extraApi = /*#__PURE__*/Object.freeze({
  533. __proto__: null,
  534. getProvider: getProvider });
  535. var getEmitter = function () {
  536. var Emitter;
  537. return function getUniEmitter() {
  538. if (!Emitter) {
  539. Emitter = new _vue.default();
  540. }
  541. return Emitter;
  542. };
  543. }();
  544. function apply(ctx, method, args) {
  545. return ctx[method].apply(ctx, args);
  546. }
  547. function $on() {
  548. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  549. }
  550. function $off() {
  551. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  552. }
  553. function $once() {
  554. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  555. }
  556. function $emit() {
  557. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  558. }
  559. var eventApi = /*#__PURE__*/Object.freeze({
  560. __proto__: null,
  561. $on: $on,
  562. $off: $off,
  563. $once: $once,
  564. $emit: $emit });
  565. var api = /*#__PURE__*/Object.freeze({
  566. __proto__: null });
  567. var MPPage = Page;
  568. var MPComponent = Component;
  569. var customizeRE = /:/g;
  570. var customize = cached(function (str) {
  571. return camelize(str.replace(customizeRE, '-'));
  572. });
  573. function initTriggerEvent(mpInstance) {
  574. {
  575. if (!wx.canIUse('nextTick')) {
  576. return;
  577. }
  578. }
  579. var oldTriggerEvent = mpInstance.triggerEvent;
  580. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  581. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  582. };
  583. }
  584. function initHook(name, options) {
  585. var oldHook = options[name];
  586. if (!oldHook) {
  587. options[name] = function () {
  588. initTriggerEvent(this);
  589. };
  590. } else {
  591. options[name] = function () {
  592. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  593. return oldHook.apply(this, args);
  594. };
  595. }
  596. }
  597. if (!MPPage.__$wrappered) {
  598. MPPage.__$wrappered = true;
  599. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  600. initHook('onLoad', options);
  601. return MPPage(options);
  602. };
  603. Page.after = MPPage.after;
  604. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  605. initHook('created', options);
  606. return MPComponent(options);
  607. };
  608. }
  609. var PAGE_EVENT_HOOKS = [
  610. 'onPullDownRefresh',
  611. 'onReachBottom',
  612. 'onAddToFavorites',
  613. 'onShareTimeline',
  614. 'onShareAppMessage',
  615. 'onPageScroll',
  616. 'onResize',
  617. 'onTabItemTap'];
  618. function initMocks(vm, mocks) {
  619. var mpInstance = vm.$mp[vm.mpType];
  620. mocks.forEach(function (mock) {
  621. if (hasOwn(mpInstance, mock)) {
  622. vm[mock] = mpInstance[mock];
  623. }
  624. });
  625. }
  626. function hasHook(hook, vueOptions) {
  627. if (!vueOptions) {
  628. return true;
  629. }
  630. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  631. return true;
  632. }
  633. vueOptions = vueOptions.default || vueOptions;
  634. if (isFn(vueOptions)) {
  635. if (isFn(vueOptions.extendOptions[hook])) {
  636. return true;
  637. }
  638. if (vueOptions.super &&
  639. vueOptions.super.options &&
  640. Array.isArray(vueOptions.super.options[hook])) {
  641. return true;
  642. }
  643. return false;
  644. }
  645. if (isFn(vueOptions[hook])) {
  646. return true;
  647. }
  648. var mixins = vueOptions.mixins;
  649. if (Array.isArray(mixins)) {
  650. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  651. }
  652. }
  653. function initHooks(mpOptions, hooks, vueOptions) {
  654. hooks.forEach(function (hook) {
  655. if (hasHook(hook, vueOptions)) {
  656. mpOptions[hook] = function (args) {
  657. return this.$vm && this.$vm.__call_hook(hook, args);
  658. };
  659. }
  660. });
  661. }
  662. function initVueComponent(Vue, vueOptions) {
  663. vueOptions = vueOptions.default || vueOptions;
  664. var VueComponent;
  665. if (isFn(vueOptions)) {
  666. VueComponent = vueOptions;
  667. } else {
  668. VueComponent = Vue.extend(vueOptions);
  669. }
  670. vueOptions = VueComponent.options;
  671. return [VueComponent, vueOptions];
  672. }
  673. function initSlots(vm, vueSlots) {
  674. if (Array.isArray(vueSlots) && vueSlots.length) {
  675. var $slots = Object.create(null);
  676. vueSlots.forEach(function (slotName) {
  677. $slots[slotName] = true;
  678. });
  679. vm.$scopedSlots = vm.$slots = $slots;
  680. }
  681. }
  682. function initVueIds(vueIds, mpInstance) {
  683. vueIds = (vueIds || '').split(',');
  684. var len = vueIds.length;
  685. if (len === 1) {
  686. mpInstance._$vueId = vueIds[0];
  687. } else if (len === 2) {
  688. mpInstance._$vueId = vueIds[0];
  689. mpInstance._$vuePid = vueIds[1];
  690. }
  691. }
  692. function initData(vueOptions, context) {
  693. var data = vueOptions.data || {};
  694. var methods = vueOptions.methods || {};
  695. if (typeof data === 'function') {
  696. try {
  697. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  698. } catch (e) {
  699. if (Object({"VUE_APP_NAME":"sqxp-uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  700. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  701. }
  702. }
  703. } else {
  704. try {
  705. // 对 data 格式化
  706. data = JSON.parse(JSON.stringify(data));
  707. } catch (e) {}
  708. }
  709. if (!isPlainObject(data)) {
  710. data = {};
  711. }
  712. Object.keys(methods).forEach(function (methodName) {
  713. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  714. data[methodName] = methods[methodName];
  715. }
  716. });
  717. return data;
  718. }
  719. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  720. function createObserver(name) {
  721. return function observer(newVal, oldVal) {
  722. if (this.$vm) {
  723. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  724. }
  725. };
  726. }
  727. function initBehaviors(vueOptions, initBehavior) {
  728. var vueBehaviors = vueOptions.behaviors;
  729. var vueExtends = vueOptions.extends;
  730. var vueMixins = vueOptions.mixins;
  731. var vueProps = vueOptions.props;
  732. if (!vueProps) {
  733. vueOptions.props = vueProps = [];
  734. }
  735. var behaviors = [];
  736. if (Array.isArray(vueBehaviors)) {
  737. vueBehaviors.forEach(function (behavior) {
  738. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  739. if (behavior === 'uni://form-field') {
  740. if (Array.isArray(vueProps)) {
  741. vueProps.push('name');
  742. vueProps.push('value');
  743. } else {
  744. vueProps.name = {
  745. type: String,
  746. default: '' };
  747. vueProps.value = {
  748. type: [String, Number, Boolean, Array, Object, Date],
  749. default: '' };
  750. }
  751. }
  752. });
  753. }
  754. if (isPlainObject(vueExtends) && vueExtends.props) {
  755. behaviors.push(
  756. initBehavior({
  757. properties: initProperties(vueExtends.props, true) }));
  758. }
  759. if (Array.isArray(vueMixins)) {
  760. vueMixins.forEach(function (vueMixin) {
  761. if (isPlainObject(vueMixin) && vueMixin.props) {
  762. behaviors.push(
  763. initBehavior({
  764. properties: initProperties(vueMixin.props, true) }));
  765. }
  766. });
  767. }
  768. return behaviors;
  769. }
  770. function parsePropType(key, type, defaultValue, file) {
  771. // [String]=>String
  772. if (Array.isArray(type) && type.length === 1) {
  773. return type[0];
  774. }
  775. return type;
  776. }
  777. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  778. var properties = {};
  779. if (!isBehavior) {
  780. properties.vueId = {
  781. type: String,
  782. value: '' };
  783. // 用于字节跳动小程序模拟抽象节点
  784. properties.generic = {
  785. type: Object,
  786. value: null };
  787. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  788. type: null,
  789. value: [],
  790. observer: function observer(newVal, oldVal) {
  791. var $slots = Object.create(null);
  792. newVal.forEach(function (slotName) {
  793. $slots[slotName] = true;
  794. });
  795. this.setData({
  796. $slots: $slots });
  797. } };
  798. }
  799. if (Array.isArray(props)) {// ['title']
  800. props.forEach(function (key) {
  801. properties[key] = {
  802. type: null,
  803. observer: createObserver(key) };
  804. });
  805. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  806. Object.keys(props).forEach(function (key) {
  807. var opts = props[key];
  808. if (isPlainObject(opts)) {// title:{type:String,default:''}
  809. var value = opts.default;
  810. if (isFn(value)) {
  811. value = value();
  812. }
  813. opts.type = parsePropType(key, opts.type);
  814. properties[key] = {
  815. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  816. value: value,
  817. observer: createObserver(key) };
  818. } else {// content:String
  819. var type = parsePropType(key, opts);
  820. properties[key] = {
  821. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  822. observer: createObserver(key) };
  823. }
  824. });
  825. }
  826. return properties;
  827. }
  828. function wrapper$1(event) {
  829. // TODO 又得兼容 mpvue 的 mp 对象
  830. try {
  831. event.mp = JSON.parse(JSON.stringify(event));
  832. } catch (e) {}
  833. event.stopPropagation = noop;
  834. event.preventDefault = noop;
  835. event.target = event.target || {};
  836. if (!hasOwn(event, 'detail')) {
  837. event.detail = {};
  838. }
  839. if (hasOwn(event, 'markerId')) {
  840. event.detail = typeof event.detail === 'object' ? event.detail : {};
  841. event.detail.markerId = event.markerId;
  842. }
  843. if (isPlainObject(event.detail)) {
  844. event.target = Object.assign({}, event.target, event.detail);
  845. }
  846. return event;
  847. }
  848. function getExtraValue(vm, dataPathsArray) {
  849. var context = vm;
  850. dataPathsArray.forEach(function (dataPathArray) {
  851. var dataPath = dataPathArray[0];
  852. var value = dataPathArray[2];
  853. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  854. var propPath = dataPathArray[1];
  855. var valuePath = dataPathArray[3];
  856. var vFor;
  857. if (Number.isInteger(dataPath)) {
  858. vFor = dataPath;
  859. } else if (!dataPath) {
  860. vFor = context;
  861. } else if (typeof dataPath === 'string' && dataPath) {
  862. if (dataPath.indexOf('#s#') === 0) {
  863. vFor = dataPath.substr(3);
  864. } else {
  865. vFor = vm.__get_value(dataPath, context);
  866. }
  867. }
  868. if (Number.isInteger(vFor)) {
  869. context = value;
  870. } else if (!propPath) {
  871. context = vFor[value];
  872. } else {
  873. if (Array.isArray(vFor)) {
  874. context = vFor.find(function (vForItem) {
  875. return vm.__get_value(propPath, vForItem) === value;
  876. });
  877. } else if (isPlainObject(vFor)) {
  878. context = Object.keys(vFor).find(function (vForKey) {
  879. return vm.__get_value(propPath, vFor[vForKey]) === value;
  880. });
  881. } else {
  882. console.error('v-for 暂不支持循环数据:', vFor);
  883. }
  884. }
  885. if (valuePath) {
  886. context = vm.__get_value(valuePath, context);
  887. }
  888. }
  889. });
  890. return context;
  891. }
  892. function processEventExtra(vm, extra, event) {
  893. var extraObj = {};
  894. if (Array.isArray(extra) && extra.length) {
  895. /**
  896. *[
  897. * ['data.items', 'data.id', item.data.id],
  898. * ['metas', 'id', meta.id]
  899. *],
  900. *[
  901. * ['data.items', 'data.id', item.data.id],
  902. * ['metas', 'id', meta.id]
  903. *],
  904. *'test'
  905. */
  906. extra.forEach(function (dataPath, index) {
  907. if (typeof dataPath === 'string') {
  908. if (!dataPath) {// model,prop.sync
  909. extraObj['$' + index] = vm;
  910. } else {
  911. if (dataPath === '$event') {// $event
  912. extraObj['$' + index] = event;
  913. } else if (dataPath === 'arguments') {
  914. if (event.detail && event.detail.__args__) {
  915. extraObj['$' + index] = event.detail.__args__;
  916. } else {
  917. extraObj['$' + index] = [event];
  918. }
  919. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  920. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  921. } else {
  922. extraObj['$' + index] = vm.__get_value(dataPath);
  923. }
  924. }
  925. } else {
  926. extraObj['$' + index] = getExtraValue(vm, dataPath);
  927. }
  928. });
  929. }
  930. return extraObj;
  931. }
  932. function getObjByArray(arr) {
  933. var obj = {};
  934. for (var i = 1; i < arr.length; i++) {
  935. var element = arr[i];
  936. obj[element[0]] = element[1];
  937. }
  938. return obj;
  939. }
  940. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  941. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  942. if (isCustom) {// 自定义事件
  943. isCustomMPEvent = event.currentTarget &&
  944. event.currentTarget.dataset &&
  945. event.currentTarget.dataset.comType === 'wx';
  946. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  947. if (isCustomMPEvent) {
  948. return [event];
  949. }
  950. return event.detail.__args__ || event.detail;
  951. }
  952. }
  953. var extraObj = processEventExtra(vm, extra, event);
  954. var ret = [];
  955. args.forEach(function (arg) {
  956. if (arg === '$event') {
  957. if (methodName === '__set_model' && !isCustom) {// input v-model value
  958. ret.push(event.target.value);
  959. } else {
  960. if (isCustom && !isCustomMPEvent) {
  961. ret.push(event.detail.__args__[0]);
  962. } else {// wxcomponent 组件或内置组件
  963. ret.push(event);
  964. }
  965. }
  966. } else {
  967. if (Array.isArray(arg) && arg[0] === 'o') {
  968. ret.push(getObjByArray(arg));
  969. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  970. ret.push(extraObj[arg]);
  971. } else {
  972. ret.push(arg);
  973. }
  974. }
  975. });
  976. return ret;
  977. }
  978. var ONCE = '~';
  979. var CUSTOM = '^';
  980. function isMatchEventType(eventType, optType) {
  981. return eventType === optType ||
  982. optType === 'regionchange' && (
  983. eventType === 'begin' ||
  984. eventType === 'end');
  985. }
  986. function getContextVm(vm) {
  987. var $parent = vm.$parent;
  988. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  989. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  990. $parent = $parent.$parent;
  991. }
  992. return $parent && $parent.$parent;
  993. }
  994. function handleEvent(event) {var _this = this;
  995. event = wrapper$1(event);
  996. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  997. var dataset = (event.currentTarget || event.target).dataset;
  998. if (!dataset) {
  999. return console.warn('事件信息不存在');
  1000. }
  1001. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1002. if (!eventOpts) {
  1003. return console.warn('事件信息不存在');
  1004. }
  1005. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1006. var eventType = event.type;
  1007. var ret = [];
  1008. eventOpts.forEach(function (eventOpt) {
  1009. var type = eventOpt[0];
  1010. var eventsArray = eventOpt[1];
  1011. var isCustom = type.charAt(0) === CUSTOM;
  1012. type = isCustom ? type.slice(1) : type;
  1013. var isOnce = type.charAt(0) === ONCE;
  1014. type = isOnce ? type.slice(1) : type;
  1015. if (eventsArray && isMatchEventType(eventType, type)) {
  1016. eventsArray.forEach(function (eventArray) {
  1017. var methodName = eventArray[0];
  1018. if (methodName) {
  1019. var handlerCtx = _this.$vm;
  1020. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1021. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1022. }
  1023. if (methodName === '$emit') {
  1024. handlerCtx.$emit.apply(handlerCtx,
  1025. processEventArgs(
  1026. _this.$vm,
  1027. event,
  1028. eventArray[1],
  1029. eventArray[2],
  1030. isCustom,
  1031. methodName));
  1032. return;
  1033. }
  1034. var handler = handlerCtx[methodName];
  1035. if (!isFn(handler)) {
  1036. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1037. }
  1038. if (isOnce) {
  1039. if (handler.once) {
  1040. return;
  1041. }
  1042. handler.once = true;
  1043. }
  1044. var params = processEventArgs(
  1045. _this.$vm,
  1046. event,
  1047. eventArray[1],
  1048. eventArray[2],
  1049. isCustom,
  1050. methodName);
  1051. params = Array.isArray(params) ? params : [];
  1052. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1053. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1054. // eslint-disable-next-line no-sparse-arrays
  1055. params = params.concat([,,,,,,,,,, event]);
  1056. }
  1057. ret.push(handler.apply(handlerCtx, params));
  1058. }
  1059. });
  1060. }
  1061. });
  1062. if (
  1063. eventType === 'input' &&
  1064. ret.length === 1 &&
  1065. typeof ret[0] !== 'undefined')
  1066. {
  1067. return ret[0];
  1068. }
  1069. }
  1070. var eventChannels = {};
  1071. var eventChannelStack = [];
  1072. function getEventChannel(id) {
  1073. if (id) {
  1074. var eventChannel = eventChannels[id];
  1075. delete eventChannels[id];
  1076. return eventChannel;
  1077. }
  1078. return eventChannelStack.shift();
  1079. }
  1080. var hooks = [
  1081. 'onShow',
  1082. 'onHide',
  1083. 'onError',
  1084. 'onPageNotFound',
  1085. 'onThemeChange',
  1086. 'onUnhandledRejection'];
  1087. function initEventChannel() {
  1088. _vue.default.prototype.getOpenerEventChannel = function () {
  1089. // 微信小程序使用自身getOpenerEventChannel
  1090. {
  1091. return this.$scope.getOpenerEventChannel();
  1092. }
  1093. };
  1094. var callHook = _vue.default.prototype.__call_hook;
  1095. _vue.default.prototype.__call_hook = function (hook, args) {
  1096. if (hook === 'onLoad' && args && args.__id__) {
  1097. this.__eventChannel__ = getEventChannel(args.__id__);
  1098. delete args.__id__;
  1099. }
  1100. return callHook.call(this, hook, args);
  1101. };
  1102. }
  1103. function parseBaseApp(vm, _ref3)
  1104. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1105. initEventChannel();
  1106. if (vm.$options.store) {
  1107. _vue.default.prototype.$store = vm.$options.store;
  1108. }
  1109. _vue.default.prototype.mpHost = "mp-weixin";
  1110. _vue.default.mixin({
  1111. beforeCreate: function beforeCreate() {
  1112. if (!this.$options.mpType) {
  1113. return;
  1114. }
  1115. this.mpType = this.$options.mpType;
  1116. this.$mp = _defineProperty({
  1117. data: {} },
  1118. this.mpType, this.$options.mpInstance);
  1119. this.$scope = this.$options.mpInstance;
  1120. delete this.$options.mpType;
  1121. delete this.$options.mpInstance;
  1122. if (this.mpType !== 'app') {
  1123. initRefs(this);
  1124. initMocks(this, mocks);
  1125. }
  1126. } });
  1127. var appOptions = {
  1128. onLaunch: function onLaunch(args) {
  1129. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1130. return;
  1131. }
  1132. {
  1133. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1134. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1135. }
  1136. }
  1137. this.$vm = vm;
  1138. this.$vm.$mp = {
  1139. app: this };
  1140. this.$vm.$scope = this;
  1141. // vm 上也挂载 globalData
  1142. this.$vm.globalData = this.globalData;
  1143. this.$vm._isMounted = true;
  1144. this.$vm.__call_hook('mounted', args);
  1145. this.$vm.__call_hook('onLaunch', args);
  1146. } };
  1147. // 兼容旧版本 globalData
  1148. appOptions.globalData = vm.$options.globalData || {};
  1149. // 将 methods 中的方法挂在 getApp() 中
  1150. var methods = vm.$options.methods;
  1151. if (methods) {
  1152. Object.keys(methods).forEach(function (name) {
  1153. appOptions[name] = methods[name];
  1154. });
  1155. }
  1156. initHooks(appOptions, hooks);
  1157. return appOptions;
  1158. }
  1159. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1160. function findVmByVueId(vm, vuePid) {
  1161. var $children = vm.$children;
  1162. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1163. for (var i = $children.length - 1; i >= 0; i--) {
  1164. var childVm = $children[i];
  1165. if (childVm.$scope._$vueId === vuePid) {
  1166. return childVm;
  1167. }
  1168. }
  1169. // 反向递归查找
  1170. var parentVm;
  1171. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1172. parentVm = findVmByVueId($children[_i], vuePid);
  1173. if (parentVm) {
  1174. return parentVm;
  1175. }
  1176. }
  1177. }
  1178. function initBehavior(options) {
  1179. return Behavior(options);
  1180. }
  1181. function isPage() {
  1182. return !!this.route;
  1183. }
  1184. function initRelation(detail) {
  1185. this.triggerEvent('__l', detail);
  1186. }
  1187. function selectAllComponents(mpInstance, selector, $refs) {
  1188. var components = mpInstance.selectAllComponents(selector);
  1189. components.forEach(function (component) {
  1190. var ref = component.dataset.ref;
  1191. $refs[ref] = component.$vm || component;
  1192. {
  1193. if (component.dataset.vueGeneric === 'scoped') {
  1194. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1195. selectAllComponents(scopedComponent, selector, $refs);
  1196. });
  1197. }
  1198. }
  1199. });
  1200. }
  1201. function initRefs(vm) {
  1202. var mpInstance = vm.$scope;
  1203. Object.defineProperty(vm, '$refs', {
  1204. get: function get() {
  1205. var $refs = {};
  1206. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1207. // TODO 暂不考虑 for 中的 scoped
  1208. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1209. forComponents.forEach(function (component) {
  1210. var ref = component.dataset.ref;
  1211. if (!$refs[ref]) {
  1212. $refs[ref] = [];
  1213. }
  1214. $refs[ref].push(component.$vm || component);
  1215. });
  1216. return $refs;
  1217. } });
  1218. }
  1219. function handleLink(event) {var _ref4 =
  1220. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1221. var parentVm;
  1222. if (vuePid) {
  1223. parentVm = findVmByVueId(this.$vm, vuePid);
  1224. }
  1225. if (!parentVm) {
  1226. parentVm = this.$vm;
  1227. }
  1228. vueOptions.parent = parentVm;
  1229. }
  1230. function parseApp(vm) {
  1231. return parseBaseApp(vm, {
  1232. mocks: mocks,
  1233. initRefs: initRefs });
  1234. }
  1235. function createApp(vm) {
  1236. App(parseApp(vm));
  1237. return vm;
  1238. }
  1239. var encodeReserveRE = /[!'()*]/g;
  1240. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1241. var commaRE = /%2C/g;
  1242. // fixed encodeURIComponent which is more conformant to RFC3986:
  1243. // - escapes [!'()*]
  1244. // - preserve commas
  1245. var encode = function encode(str) {return encodeURIComponent(str).
  1246. replace(encodeReserveRE, encodeReserveReplacer).
  1247. replace(commaRE, ',');};
  1248. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1249. var res = obj ? Object.keys(obj).map(function (key) {
  1250. var val = obj[key];
  1251. if (val === undefined) {
  1252. return '';
  1253. }
  1254. if (val === null) {
  1255. return encodeStr(key);
  1256. }
  1257. if (Array.isArray(val)) {
  1258. var result = [];
  1259. val.forEach(function (val2) {
  1260. if (val2 === undefined) {
  1261. return;
  1262. }
  1263. if (val2 === null) {
  1264. result.push(encodeStr(key));
  1265. } else {
  1266. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1267. }
  1268. });
  1269. return result.join('&');
  1270. }
  1271. return encodeStr(key) + '=' + encodeStr(val);
  1272. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1273. return res ? "?".concat(res) : '';
  1274. }
  1275. function parseBaseComponent(vueComponentOptions)
  1276. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1277. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1278. var options = _objectSpread({
  1279. multipleSlots: true,
  1280. addGlobalClass: true },
  1281. vueOptions.options || {});
  1282. {
  1283. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1284. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1285. Object.assign(options, vueOptions['mp-weixin'].options);
  1286. }
  1287. }
  1288. var componentOptions = {
  1289. options: options,
  1290. data: initData(vueOptions, _vue.default.prototype),
  1291. behaviors: initBehaviors(vueOptions, initBehavior),
  1292. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1293. lifetimes: {
  1294. attached: function attached() {
  1295. var properties = this.properties;
  1296. var options = {
  1297. mpType: isPage.call(this) ? 'page' : 'component',
  1298. mpInstance: this,
  1299. propsData: properties };
  1300. initVueIds(properties.vueId, this);
  1301. // 处理父子关系
  1302. initRelation.call(this, {
  1303. vuePid: this._$vuePid,
  1304. vueOptions: options });
  1305. // 初始化 vue 实例
  1306. this.$vm = new VueComponent(options);
  1307. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1308. initSlots(this.$vm, properties.vueSlots);
  1309. // 触发首次 setData
  1310. this.$vm.$mount();
  1311. },
  1312. ready: function ready() {
  1313. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1314. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1315. if (this.$vm) {
  1316. this.$vm._isMounted = true;
  1317. this.$vm.__call_hook('mounted');
  1318. this.$vm.__call_hook('onReady');
  1319. }
  1320. },
  1321. detached: function detached() {
  1322. this.$vm && this.$vm.$destroy();
  1323. } },
  1324. pageLifetimes: {
  1325. show: function show(args) {
  1326. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1327. },
  1328. hide: function hide() {
  1329. this.$vm && this.$vm.__call_hook('onPageHide');
  1330. },
  1331. resize: function resize(size) {
  1332. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1333. } },
  1334. methods: {
  1335. __l: handleLink,
  1336. __e: handleEvent } };
  1337. // externalClasses
  1338. if (vueOptions.externalClasses) {
  1339. componentOptions.externalClasses = vueOptions.externalClasses;
  1340. }
  1341. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1342. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1343. componentOptions.methods[callMethod] = function (args) {
  1344. return this.$vm[callMethod](args);
  1345. };
  1346. });
  1347. }
  1348. if (isPage) {
  1349. return componentOptions;
  1350. }
  1351. return [componentOptions, VueComponent];
  1352. }
  1353. function parseComponent(vueComponentOptions) {
  1354. return parseBaseComponent(vueComponentOptions, {
  1355. isPage: isPage,
  1356. initRelation: initRelation });
  1357. }
  1358. var hooks$1 = [
  1359. 'onShow',
  1360. 'onHide',
  1361. 'onUnload'];
  1362. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1363. function parseBasePage(vuePageOptions, _ref6)
  1364. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1365. var pageOptions = parseComponent(vuePageOptions);
  1366. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1367. pageOptions.methods.onLoad = function (query) {
  1368. this.options = query;
  1369. var copyQuery = Object.assign({}, query);
  1370. delete copyQuery.__id__;
  1371. this.$page = {
  1372. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1373. this.$vm.$mp.query = query; // 兼容 mpvue
  1374. this.$vm.__call_hook('onLoad', query);
  1375. };
  1376. return pageOptions;
  1377. }
  1378. function parsePage(vuePageOptions) {
  1379. return parseBasePage(vuePageOptions, {
  1380. isPage: isPage,
  1381. initRelation: initRelation });
  1382. }
  1383. function createPage(vuePageOptions) {
  1384. {
  1385. return Component(parsePage(vuePageOptions));
  1386. }
  1387. }
  1388. function createComponent(vueOptions) {
  1389. {
  1390. return Component(parseComponent(vueOptions));
  1391. }
  1392. }
  1393. function createSubpackageApp(vm) {
  1394. var appOptions = parseApp(vm);
  1395. var app = getApp({
  1396. allowDefault: true });
  1397. var globalData = app.globalData;
  1398. if (globalData) {
  1399. Object.keys(appOptions.globalData).forEach(function (name) {
  1400. if (!hasOwn(globalData, name)) {
  1401. globalData[name] = appOptions.globalData[name];
  1402. }
  1403. });
  1404. }
  1405. Object.keys(appOptions).forEach(function (name) {
  1406. if (!hasOwn(app, name)) {
  1407. app[name] = appOptions[name];
  1408. }
  1409. });
  1410. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1411. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1412. appOptions.onShow.apply(app, args);
  1413. });
  1414. }
  1415. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1416. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1417. appOptions.onHide.apply(app, args);
  1418. });
  1419. }
  1420. if (isFn(appOptions.onLaunch)) {
  1421. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1422. appOptions.onLaunch.call(app, args);
  1423. }
  1424. return vm;
  1425. }
  1426. todos.forEach(function (todoApi) {
  1427. protocols[todoApi] = false;
  1428. });
  1429. canIUses.forEach(function (canIUseApi) {
  1430. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1431. canIUseApi;
  1432. if (!wx.canIUse(apiName)) {
  1433. protocols[canIUseApi] = false;
  1434. }
  1435. });
  1436. var uni = {};
  1437. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1438. uni = new Proxy({}, {
  1439. get: function get(target, name) {
  1440. if (hasOwn(target, name)) {
  1441. return target[name];
  1442. }
  1443. if (baseApi[name]) {
  1444. return baseApi[name];
  1445. }
  1446. if (api[name]) {
  1447. return promisify(name, api[name]);
  1448. }
  1449. {
  1450. if (extraApi[name]) {
  1451. return promisify(name, extraApi[name]);
  1452. }
  1453. if (todoApis[name]) {
  1454. return promisify(name, todoApis[name]);
  1455. }
  1456. }
  1457. if (eventApi[name]) {
  1458. return eventApi[name];
  1459. }
  1460. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1461. return;
  1462. }
  1463. return promisify(name, wrapper(name, wx[name]));
  1464. },
  1465. set: function set(target, name, value) {
  1466. target[name] = value;
  1467. return true;
  1468. } });
  1469. } else {
  1470. Object.keys(baseApi).forEach(function (name) {
  1471. uni[name] = baseApi[name];
  1472. });
  1473. {
  1474. Object.keys(todoApis).forEach(function (name) {
  1475. uni[name] = promisify(name, todoApis[name]);
  1476. });
  1477. Object.keys(extraApi).forEach(function (name) {
  1478. uni[name] = promisify(name, todoApis[name]);
  1479. });
  1480. }
  1481. Object.keys(eventApi).forEach(function (name) {
  1482. uni[name] = eventApi[name];
  1483. });
  1484. Object.keys(api).forEach(function (name) {
  1485. uni[name] = promisify(name, api[name]);
  1486. });
  1487. Object.keys(wx).forEach(function (name) {
  1488. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1489. uni[name] = promisify(name, wrapper(name, wx[name]));
  1490. }
  1491. });
  1492. }
  1493. wx.createApp = createApp;
  1494. wx.createPage = createPage;
  1495. wx.createComponent = createComponent;
  1496. wx.createSubpackageApp = createSubpackageApp;
  1497. var uni$1 = uni;var _default =
  1498. uni$1;exports.default = _default;
  1499. /***/ }),
  1500. /* 2 */
  1501. /*!******************************************************************************************!*\
  1502. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1503. \******************************************************************************************/
  1504. /*! exports provided: default */
  1505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1506. "use strict";
  1507. __webpack_require__.r(__webpack_exports__);
  1508. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1509. * Vue.js v2.6.11
  1510. * (c) 2014-2021 Evan You
  1511. * Released under the MIT License.
  1512. */
  1513. /* */
  1514. var emptyObject = Object.freeze({});
  1515. // These helpers produce better VM code in JS engines due to their
  1516. // explicitness and function inlining.
  1517. function isUndef (v) {
  1518. return v === undefined || v === null
  1519. }
  1520. function isDef (v) {
  1521. return v !== undefined && v !== null
  1522. }
  1523. function isTrue (v) {
  1524. return v === true
  1525. }
  1526. function isFalse (v) {
  1527. return v === false
  1528. }
  1529. /**
  1530. * Check if value is primitive.
  1531. */
  1532. function isPrimitive (value) {
  1533. return (
  1534. typeof value === 'string' ||
  1535. typeof value === 'number' ||
  1536. // $flow-disable-line
  1537. typeof value === 'symbol' ||
  1538. typeof value === 'boolean'
  1539. )
  1540. }
  1541. /**
  1542. * Quick object check - this is primarily used to tell
  1543. * Objects from primitive values when we know the value
  1544. * is a JSON-compliant type.
  1545. */
  1546. function isObject (obj) {
  1547. return obj !== null && typeof obj === 'object'
  1548. }
  1549. /**
  1550. * Get the raw type string of a value, e.g., [object Object].
  1551. */
  1552. var _toString = Object.prototype.toString;
  1553. function toRawType (value) {
  1554. return _toString.call(value).slice(8, -1)
  1555. }
  1556. /**
  1557. * Strict object type check. Only returns true
  1558. * for plain JavaScript objects.
  1559. */
  1560. function isPlainObject (obj) {
  1561. return _toString.call(obj) === '[object Object]'
  1562. }
  1563. function isRegExp (v) {
  1564. return _toString.call(v) === '[object RegExp]'
  1565. }
  1566. /**
  1567. * Check if val is a valid array index.
  1568. */
  1569. function isValidArrayIndex (val) {
  1570. var n = parseFloat(String(val));
  1571. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1572. }
  1573. function isPromise (val) {
  1574. return (
  1575. isDef(val) &&
  1576. typeof val.then === 'function' &&
  1577. typeof val.catch === 'function'
  1578. )
  1579. }
  1580. /**
  1581. * Convert a value to a string that is actually rendered.
  1582. */
  1583. function toString (val) {
  1584. return val == null
  1585. ? ''
  1586. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1587. ? JSON.stringify(val, null, 2)
  1588. : String(val)
  1589. }
  1590. /**
  1591. * Convert an input value to a number for persistence.
  1592. * If the conversion fails, return original string.
  1593. */
  1594. function toNumber (val) {
  1595. var n = parseFloat(val);
  1596. return isNaN(n) ? val : n
  1597. }
  1598. /**
  1599. * Make a map and return a function for checking if a key
  1600. * is in that map.
  1601. */
  1602. function makeMap (
  1603. str,
  1604. expectsLowerCase
  1605. ) {
  1606. var map = Object.create(null);
  1607. var list = str.split(',');
  1608. for (var i = 0; i < list.length; i++) {
  1609. map[list[i]] = true;
  1610. }
  1611. return expectsLowerCase
  1612. ? function (val) { return map[val.toLowerCase()]; }
  1613. : function (val) { return map[val]; }
  1614. }
  1615. /**
  1616. * Check if a tag is a built-in tag.
  1617. */
  1618. var isBuiltInTag = makeMap('slot,component', true);
  1619. /**
  1620. * Check if an attribute is a reserved attribute.
  1621. */
  1622. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1623. /**
  1624. * Remove an item from an array.
  1625. */
  1626. function remove (arr, item) {
  1627. if (arr.length) {
  1628. var index = arr.indexOf(item);
  1629. if (index > -1) {
  1630. return arr.splice(index, 1)
  1631. }
  1632. }
  1633. }
  1634. /**
  1635. * Check whether an object has the property.
  1636. */
  1637. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1638. function hasOwn (obj, key) {
  1639. return hasOwnProperty.call(obj, key)
  1640. }
  1641. /**
  1642. * Create a cached version of a pure function.
  1643. */
  1644. function cached (fn) {
  1645. var cache = Object.create(null);
  1646. return (function cachedFn (str) {
  1647. var hit = cache[str];
  1648. return hit || (cache[str] = fn(str))
  1649. })
  1650. }
  1651. /**
  1652. * Camelize a hyphen-delimited string.
  1653. */
  1654. var camelizeRE = /-(\w)/g;
  1655. var camelize = cached(function (str) {
  1656. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1657. });
  1658. /**
  1659. * Capitalize a string.
  1660. */
  1661. var capitalize = cached(function (str) {
  1662. return str.charAt(0).toUpperCase() + str.slice(1)
  1663. });
  1664. /**
  1665. * Hyphenate a camelCase string.
  1666. */
  1667. var hyphenateRE = /\B([A-Z])/g;
  1668. var hyphenate = cached(function (str) {
  1669. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1670. });
  1671. /**
  1672. * Simple bind polyfill for environments that do not support it,
  1673. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1674. * since native bind is now performant enough in most browsers.
  1675. * But removing it would mean breaking code that was able to run in
  1676. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1677. */
  1678. /* istanbul ignore next */
  1679. function polyfillBind (fn, ctx) {
  1680. function boundFn (a) {
  1681. var l = arguments.length;
  1682. return l
  1683. ? l > 1
  1684. ? fn.apply(ctx, arguments)
  1685. : fn.call(ctx, a)
  1686. : fn.call(ctx)
  1687. }
  1688. boundFn._length = fn.length;
  1689. return boundFn
  1690. }
  1691. function nativeBind (fn, ctx) {
  1692. return fn.bind(ctx)
  1693. }
  1694. var bind = Function.prototype.bind
  1695. ? nativeBind
  1696. : polyfillBind;
  1697. /**
  1698. * Convert an Array-like object to a real Array.
  1699. */
  1700. function toArray (list, start) {
  1701. start = start || 0;
  1702. var i = list.length - start;
  1703. var ret = new Array(i);
  1704. while (i--) {
  1705. ret[i] = list[i + start];
  1706. }
  1707. return ret
  1708. }
  1709. /**
  1710. * Mix properties into target object.
  1711. */
  1712. function extend (to, _from) {
  1713. for (var key in _from) {
  1714. to[key] = _from[key];
  1715. }
  1716. return to
  1717. }
  1718. /**
  1719. * Merge an Array of Objects into a single Object.
  1720. */
  1721. function toObject (arr) {
  1722. var res = {};
  1723. for (var i = 0; i < arr.length; i++) {
  1724. if (arr[i]) {
  1725. extend(res, arr[i]);
  1726. }
  1727. }
  1728. return res
  1729. }
  1730. /* eslint-disable no-unused-vars */
  1731. /**
  1732. * Perform no operation.
  1733. * Stubbing args to make Flow happy without leaving useless transpiled code
  1734. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1735. */
  1736. function noop (a, b, c) {}
  1737. /**
  1738. * Always return false.
  1739. */
  1740. var no = function (a, b, c) { return false; };
  1741. /* eslint-enable no-unused-vars */
  1742. /**
  1743. * Return the same value.
  1744. */
  1745. var identity = function (_) { return _; };
  1746. /**
  1747. * Check if two values are loosely equal - that is,
  1748. * if they are plain objects, do they have the same shape?
  1749. */
  1750. function looseEqual (a, b) {
  1751. if (a === b) { return true }
  1752. var isObjectA = isObject(a);
  1753. var isObjectB = isObject(b);
  1754. if (isObjectA && isObjectB) {
  1755. try {
  1756. var isArrayA = Array.isArray(a);
  1757. var isArrayB = Array.isArray(b);
  1758. if (isArrayA && isArrayB) {
  1759. return a.length === b.length && a.every(function (e, i) {
  1760. return looseEqual(e, b[i])
  1761. })
  1762. } else if (a instanceof Date && b instanceof Date) {
  1763. return a.getTime() === b.getTime()
  1764. } else if (!isArrayA && !isArrayB) {
  1765. var keysA = Object.keys(a);
  1766. var keysB = Object.keys(b);
  1767. return keysA.length === keysB.length && keysA.every(function (key) {
  1768. return looseEqual(a[key], b[key])
  1769. })
  1770. } else {
  1771. /* istanbul ignore next */
  1772. return false
  1773. }
  1774. } catch (e) {
  1775. /* istanbul ignore next */
  1776. return false
  1777. }
  1778. } else if (!isObjectA && !isObjectB) {
  1779. return String(a) === String(b)
  1780. } else {
  1781. return false
  1782. }
  1783. }
  1784. /**
  1785. * Return the first index at which a loosely equal value can be
  1786. * found in the array (if value is a plain object, the array must
  1787. * contain an object of the same shape), or -1 if it is not present.
  1788. */
  1789. function looseIndexOf (arr, val) {
  1790. for (var i = 0; i < arr.length; i++) {
  1791. if (looseEqual(arr[i], val)) { return i }
  1792. }
  1793. return -1
  1794. }
  1795. /**
  1796. * Ensure a function is called only once.
  1797. */
  1798. function once (fn) {
  1799. var called = false;
  1800. return function () {
  1801. if (!called) {
  1802. called = true;
  1803. fn.apply(this, arguments);
  1804. }
  1805. }
  1806. }
  1807. var ASSET_TYPES = [
  1808. 'component',
  1809. 'directive',
  1810. 'filter'
  1811. ];
  1812. var LIFECYCLE_HOOKS = [
  1813. 'beforeCreate',
  1814. 'created',
  1815. 'beforeMount',
  1816. 'mounted',
  1817. 'beforeUpdate',
  1818. 'updated',
  1819. 'beforeDestroy',
  1820. 'destroyed',
  1821. 'activated',
  1822. 'deactivated',
  1823. 'errorCaptured',
  1824. 'serverPrefetch'
  1825. ];
  1826. /* */
  1827. var config = ({
  1828. /**
  1829. * Option merge strategies (used in core/util/options)
  1830. */
  1831. // $flow-disable-line
  1832. optionMergeStrategies: Object.create(null),
  1833. /**
  1834. * Whether to suppress warnings.
  1835. */
  1836. silent: false,
  1837. /**
  1838. * Show production mode tip message on boot?
  1839. */
  1840. productionTip: "development" !== 'production',
  1841. /**
  1842. * Whether to enable devtools
  1843. */
  1844. devtools: "development" !== 'production',
  1845. /**
  1846. * Whether to record perf
  1847. */
  1848. performance: false,
  1849. /**
  1850. * Error handler for watcher errors
  1851. */
  1852. errorHandler: null,
  1853. /**
  1854. * Warn handler for watcher warns
  1855. */
  1856. warnHandler: null,
  1857. /**
  1858. * Ignore certain custom elements
  1859. */
  1860. ignoredElements: [],
  1861. /**
  1862. * Custom user key aliases for v-on
  1863. */
  1864. // $flow-disable-line
  1865. keyCodes: Object.create(null),
  1866. /**
  1867. * Check if a tag is reserved so that it cannot be registered as a
  1868. * component. This is platform-dependent and may be overwritten.
  1869. */
  1870. isReservedTag: no,
  1871. /**
  1872. * Check if an attribute is reserved so that it cannot be used as a component
  1873. * prop. This is platform-dependent and may be overwritten.
  1874. */
  1875. isReservedAttr: no,
  1876. /**
  1877. * Check if a tag is an unknown element.
  1878. * Platform-dependent.
  1879. */
  1880. isUnknownElement: no,
  1881. /**
  1882. * Get the namespace of an element
  1883. */
  1884. getTagNamespace: noop,
  1885. /**
  1886. * Parse the real tag name for the specific platform.
  1887. */
  1888. parsePlatformTagName: identity,
  1889. /**
  1890. * Check if an attribute must be bound using property, e.g. value
  1891. * Platform-dependent.
  1892. */
  1893. mustUseProp: no,
  1894. /**
  1895. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  1896. * This will significantly reduce performance if set to false.
  1897. */
  1898. async: true,
  1899. /**
  1900. * Exposed for legacy reasons
  1901. */
  1902. _lifecycleHooks: LIFECYCLE_HOOKS
  1903. });
  1904. /* */
  1905. /**
  1906. * unicode letters used for parsing html tags, component names and property paths.
  1907. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  1908. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  1909. */
  1910. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  1911. /**
  1912. * Check if a string starts with $ or _
  1913. */
  1914. function isReserved (str) {
  1915. var c = (str + '').charCodeAt(0);
  1916. return c === 0x24 || c === 0x5F
  1917. }
  1918. /**
  1919. * Define a property.
  1920. */
  1921. function def (obj, key, val, enumerable) {
  1922. Object.defineProperty(obj, key, {
  1923. value: val,
  1924. enumerable: !!enumerable,
  1925. writable: true,
  1926. configurable: true
  1927. });
  1928. }
  1929. /**
  1930. * Parse simple path.
  1931. */
  1932. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  1933. function parsePath (path) {
  1934. if (bailRE.test(path)) {
  1935. return
  1936. }
  1937. var segments = path.split('.');
  1938. return function (obj) {
  1939. for (var i = 0; i < segments.length; i++) {
  1940. if (!obj) { return }
  1941. obj = obj[segments[i]];
  1942. }
  1943. return obj
  1944. }
  1945. }
  1946. /* */
  1947. // can we use __proto__?
  1948. var hasProto = '__proto__' in {};
  1949. // Browser environment sniffing
  1950. var inBrowser = typeof window !== 'undefined';
  1951. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  1952. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  1953. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  1954. var isIE = UA && /msie|trident/.test(UA);
  1955. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  1956. var isEdge = UA && UA.indexOf('edge/') > 0;
  1957. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  1958. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  1959. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  1960. var isPhantomJS = UA && /phantomjs/.test(UA);
  1961. var isFF = UA && UA.match(/firefox\/(\d+)/);
  1962. // Firefox has a "watch" function on Object.prototype...
  1963. var nativeWatch = ({}).watch;
  1964. if (inBrowser) {
  1965. try {
  1966. var opts = {};
  1967. Object.defineProperty(opts, 'passive', ({
  1968. get: function get () {
  1969. }
  1970. })); // https://github.com/facebook/flow/issues/285
  1971. window.addEventListener('test-passive', null, opts);
  1972. } catch (e) {}
  1973. }
  1974. // this needs to be lazy-evaled because vue may be required before
  1975. // vue-server-renderer can set VUE_ENV
  1976. var _isServer;
  1977. var isServerRendering = function () {
  1978. if (_isServer === undefined) {
  1979. /* istanbul ignore if */
  1980. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  1981. // detect presence of vue-server-renderer and avoid
  1982. // Webpack shimming the process
  1983. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  1984. } else {
  1985. _isServer = false;
  1986. }
  1987. }
  1988. return _isServer
  1989. };
  1990. // detect devtools
  1991. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1992. /* istanbul ignore next */
  1993. function isNative (Ctor) {
  1994. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  1995. }
  1996. var hasSymbol =
  1997. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  1998. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  1999. var _Set;
  2000. /* istanbul ignore if */ // $flow-disable-line
  2001. if (typeof Set !== 'undefined' && isNative(Set)) {
  2002. // use native Set when available.
  2003. _Set = Set;
  2004. } else {
  2005. // a non-standard Set polyfill that only works with primitive keys.
  2006. _Set = /*@__PURE__*/(function () {
  2007. function Set () {
  2008. this.set = Object.create(null);
  2009. }
  2010. Set.prototype.has = function has (key) {
  2011. return this.set[key] === true
  2012. };
  2013. Set.prototype.add = function add (key) {
  2014. this.set[key] = true;
  2015. };
  2016. Set.prototype.clear = function clear () {
  2017. this.set = Object.create(null);
  2018. };
  2019. return Set;
  2020. }());
  2021. }
  2022. /* */
  2023. var warn = noop;
  2024. var tip = noop;
  2025. var generateComponentTrace = (noop); // work around flow check
  2026. var formatComponentName = (noop);
  2027. if (true) {
  2028. var hasConsole = typeof console !== 'undefined';
  2029. var classifyRE = /(?:^|[-_])(\w)/g;
  2030. var classify = function (str) { return str
  2031. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2032. .replace(/[-_]/g, ''); };
  2033. warn = function (msg, vm) {
  2034. var trace = vm ? generateComponentTrace(vm) : '';
  2035. if (config.warnHandler) {
  2036. config.warnHandler.call(null, msg, vm, trace);
  2037. } else if (hasConsole && (!config.silent)) {
  2038. console.error(("[Vue warn]: " + msg + trace));
  2039. }
  2040. };
  2041. tip = function (msg, vm) {
  2042. if (hasConsole && (!config.silent)) {
  2043. console.warn("[Vue tip]: " + msg + (
  2044. vm ? generateComponentTrace(vm) : ''
  2045. ));
  2046. }
  2047. };
  2048. formatComponentName = function (vm, includeFile) {
  2049. if (vm.$root === vm) {
  2050. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2051. return ('') + vm.$options.__file
  2052. }
  2053. return '<Root>'
  2054. }
  2055. var options = typeof vm === 'function' && vm.cid != null
  2056. ? vm.options
  2057. : vm._isVue
  2058. ? vm.$options || vm.constructor.options
  2059. : vm;
  2060. var name = options.name || options._componentTag;
  2061. var file = options.__file;
  2062. if (!name && file) {
  2063. var match = file.match(/([^/\\]+)\.vue$/);
  2064. name = match && match[1];
  2065. }
  2066. return (
  2067. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2068. (file && includeFile !== false ? (" at " + file) : '')
  2069. )
  2070. };
  2071. var repeat = function (str, n) {
  2072. var res = '';
  2073. while (n) {
  2074. if (n % 2 === 1) { res += str; }
  2075. if (n > 1) { str += str; }
  2076. n >>= 1;
  2077. }
  2078. return res
  2079. };
  2080. generateComponentTrace = function (vm) {
  2081. if (vm._isVue && vm.$parent) {
  2082. var tree = [];
  2083. var currentRecursiveSequence = 0;
  2084. while (vm && vm.$options.name !== 'PageBody') {
  2085. if (tree.length > 0) {
  2086. var last = tree[tree.length - 1];
  2087. if (last.constructor === vm.constructor) {
  2088. currentRecursiveSequence++;
  2089. vm = vm.$parent;
  2090. continue
  2091. } else if (currentRecursiveSequence > 0) {
  2092. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2093. currentRecursiveSequence = 0;
  2094. }
  2095. }
  2096. !vm.$options.isReserved && tree.push(vm);
  2097. vm = vm.$parent;
  2098. }
  2099. return '\n\nfound in\n\n' + tree
  2100. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2101. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2102. : formatComponentName(vm))); })
  2103. .join('\n')
  2104. } else {
  2105. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2106. }
  2107. };
  2108. }
  2109. /* */
  2110. var uid = 0;
  2111. /**
  2112. * A dep is an observable that can have multiple
  2113. * directives subscribing to it.
  2114. */
  2115. var Dep = function Dep () {
  2116. this.id = uid++;
  2117. this.subs = [];
  2118. };
  2119. Dep.prototype.addSub = function addSub (sub) {
  2120. this.subs.push(sub);
  2121. };
  2122. Dep.prototype.removeSub = function removeSub (sub) {
  2123. remove(this.subs, sub);
  2124. };
  2125. Dep.prototype.depend = function depend () {
  2126. if (Dep.SharedObject.target) {
  2127. Dep.SharedObject.target.addDep(this);
  2128. }
  2129. };
  2130. Dep.prototype.notify = function notify () {
  2131. // stabilize the subscriber list first
  2132. var subs = this.subs.slice();
  2133. if ( true && !config.async) {
  2134. // subs aren't sorted in scheduler if not running async
  2135. // we need to sort them now to make sure they fire in correct
  2136. // order
  2137. subs.sort(function (a, b) { return a.id - b.id; });
  2138. }
  2139. for (var i = 0, l = subs.length; i < l; i++) {
  2140. subs[i].update();
  2141. }
  2142. };
  2143. // The current target watcher being evaluated.
  2144. // This is globally unique because only one watcher
  2145. // can be evaluated at a time.
  2146. // fixed by xxxxxx (nvue shared vuex)
  2147. /* eslint-disable no-undef */
  2148. Dep.SharedObject = {};
  2149. Dep.SharedObject.target = null;
  2150. Dep.SharedObject.targetStack = [];
  2151. function pushTarget (target) {
  2152. Dep.SharedObject.targetStack.push(target);
  2153. Dep.SharedObject.target = target;
  2154. Dep.target = target;
  2155. }
  2156. function popTarget () {
  2157. Dep.SharedObject.targetStack.pop();
  2158. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2159. Dep.target = Dep.SharedObject.target;
  2160. }
  2161. /* */
  2162. var VNode = function VNode (
  2163. tag,
  2164. data,
  2165. children,
  2166. text,
  2167. elm,
  2168. context,
  2169. componentOptions,
  2170. asyncFactory
  2171. ) {
  2172. this.tag = tag;
  2173. this.data = data;
  2174. this.children = children;
  2175. this.text = text;
  2176. this.elm = elm;
  2177. this.ns = undefined;
  2178. this.context = context;
  2179. this.fnContext = undefined;
  2180. this.fnOptions = undefined;
  2181. this.fnScopeId = undefined;
  2182. this.key = data && data.key;
  2183. this.componentOptions = componentOptions;
  2184. this.componentInstance = undefined;
  2185. this.parent = undefined;
  2186. this.raw = false;
  2187. this.isStatic = false;
  2188. this.isRootInsert = true;
  2189. this.isComment = false;
  2190. this.isCloned = false;
  2191. this.isOnce = false;
  2192. this.asyncFactory = asyncFactory;
  2193. this.asyncMeta = undefined;
  2194. this.isAsyncPlaceholder = false;
  2195. };
  2196. var prototypeAccessors = { child: { configurable: true } };
  2197. // DEPRECATED: alias for componentInstance for backwards compat.
  2198. /* istanbul ignore next */
  2199. prototypeAccessors.child.get = function () {
  2200. return this.componentInstance
  2201. };
  2202. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2203. var createEmptyVNode = function (text) {
  2204. if ( text === void 0 ) text = '';
  2205. var node = new VNode();
  2206. node.text = text;
  2207. node.isComment = true;
  2208. return node
  2209. };
  2210. function createTextVNode (val) {
  2211. return new VNode(undefined, undefined, undefined, String(val))
  2212. }
  2213. // optimized shallow clone
  2214. // used for static nodes and slot nodes because they may be reused across
  2215. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2216. // on their elm reference.
  2217. function cloneVNode (vnode) {
  2218. var cloned = new VNode(
  2219. vnode.tag,
  2220. vnode.data,
  2221. // #7975
  2222. // clone children array to avoid mutating original in case of cloning
  2223. // a child.
  2224. vnode.children && vnode.children.slice(),
  2225. vnode.text,
  2226. vnode.elm,
  2227. vnode.context,
  2228. vnode.componentOptions,
  2229. vnode.asyncFactory
  2230. );
  2231. cloned.ns = vnode.ns;
  2232. cloned.isStatic = vnode.isStatic;
  2233. cloned.key = vnode.key;
  2234. cloned.isComment = vnode.isComment;
  2235. cloned.fnContext = vnode.fnContext;
  2236. cloned.fnOptions = vnode.fnOptions;
  2237. cloned.fnScopeId = vnode.fnScopeId;
  2238. cloned.asyncMeta = vnode.asyncMeta;
  2239. cloned.isCloned = true;
  2240. return cloned
  2241. }
  2242. /*
  2243. * not type checking this file because flow doesn't play well with
  2244. * dynamically accessing methods on Array prototype
  2245. */
  2246. var arrayProto = Array.prototype;
  2247. var arrayMethods = Object.create(arrayProto);
  2248. var methodsToPatch = [
  2249. 'push',
  2250. 'pop',
  2251. 'shift',
  2252. 'unshift',
  2253. 'splice',
  2254. 'sort',
  2255. 'reverse'
  2256. ];
  2257. /**
  2258. * Intercept mutating methods and emit events
  2259. */
  2260. methodsToPatch.forEach(function (method) {
  2261. // cache original method
  2262. var original = arrayProto[method];
  2263. def(arrayMethods, method, function mutator () {
  2264. var args = [], len = arguments.length;
  2265. while ( len-- ) args[ len ] = arguments[ len ];
  2266. var result = original.apply(this, args);
  2267. var ob = this.__ob__;
  2268. var inserted;
  2269. switch (method) {
  2270. case 'push':
  2271. case 'unshift':
  2272. inserted = args;
  2273. break
  2274. case 'splice':
  2275. inserted = args.slice(2);
  2276. break
  2277. }
  2278. if (inserted) { ob.observeArray(inserted); }
  2279. // notify change
  2280. ob.dep.notify();
  2281. return result
  2282. });
  2283. });
  2284. /* */
  2285. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2286. /**
  2287. * In some cases we may want to disable observation inside a component's
  2288. * update computation.
  2289. */
  2290. var shouldObserve = true;
  2291. function toggleObserving (value) {
  2292. shouldObserve = value;
  2293. }
  2294. /**
  2295. * Observer class that is attached to each observed
  2296. * object. Once attached, the observer converts the target
  2297. * object's property keys into getter/setters that
  2298. * collect dependencies and dispatch updates.
  2299. */
  2300. var Observer = function Observer (value) {
  2301. this.value = value;
  2302. this.dep = new Dep();
  2303. this.vmCount = 0;
  2304. def(value, '__ob__', this);
  2305. if (Array.isArray(value)) {
  2306. if (hasProto) {
  2307. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2308. if(value.push !== value.__proto__.push){
  2309. copyAugment(value, arrayMethods, arrayKeys);
  2310. } else {
  2311. protoAugment(value, arrayMethods);
  2312. }
  2313. }
  2314. } else {
  2315. copyAugment(value, arrayMethods, arrayKeys);
  2316. }
  2317. this.observeArray(value);
  2318. } else {
  2319. this.walk(value);
  2320. }
  2321. };
  2322. /**
  2323. * Walk through all properties and convert them into
  2324. * getter/setters. This method should only be called when
  2325. * value type is Object.
  2326. */
  2327. Observer.prototype.walk = function walk (obj) {
  2328. var keys = Object.keys(obj);
  2329. for (var i = 0; i < keys.length; i++) {
  2330. defineReactive$$1(obj, keys[i]);
  2331. }
  2332. };
  2333. /**
  2334. * Observe a list of Array items.
  2335. */
  2336. Observer.prototype.observeArray = function observeArray (items) {
  2337. for (var i = 0, l = items.length; i < l; i++) {
  2338. observe(items[i]);
  2339. }
  2340. };
  2341. // helpers
  2342. /**
  2343. * Augment a target Object or Array by intercepting
  2344. * the prototype chain using __proto__
  2345. */
  2346. function protoAugment (target, src) {
  2347. /* eslint-disable no-proto */
  2348. target.__proto__ = src;
  2349. /* eslint-enable no-proto */
  2350. }
  2351. /**
  2352. * Augment a target Object or Array by defining
  2353. * hidden properties.
  2354. */
  2355. /* istanbul ignore next */
  2356. function copyAugment (target, src, keys) {
  2357. for (var i = 0, l = keys.length; i < l; i++) {
  2358. var key = keys[i];
  2359. def(target, key, src[key]);
  2360. }
  2361. }
  2362. /**
  2363. * Attempt to create an observer instance for a value,
  2364. * returns the new observer if successfully observed,
  2365. * or the existing observer if the value already has one.
  2366. */
  2367. function observe (value, asRootData) {
  2368. if (!isObject(value) || value instanceof VNode) {
  2369. return
  2370. }
  2371. var ob;
  2372. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2373. ob = value.__ob__;
  2374. } else if (
  2375. shouldObserve &&
  2376. !isServerRendering() &&
  2377. (Array.isArray(value) || isPlainObject(value)) &&
  2378. Object.isExtensible(value) &&
  2379. !value._isVue
  2380. ) {
  2381. ob = new Observer(value);
  2382. }
  2383. if (asRootData && ob) {
  2384. ob.vmCount++;
  2385. }
  2386. return ob
  2387. }
  2388. /**
  2389. * Define a reactive property on an Object.
  2390. */
  2391. function defineReactive$$1 (
  2392. obj,
  2393. key,
  2394. val,
  2395. customSetter,
  2396. shallow
  2397. ) {
  2398. var dep = new Dep();
  2399. var property = Object.getOwnPropertyDescriptor(obj, key);
  2400. if (property && property.configurable === false) {
  2401. return
  2402. }
  2403. // cater for pre-defined getter/setters
  2404. var getter = property && property.get;
  2405. var setter = property && property.set;
  2406. if ((!getter || setter) && arguments.length === 2) {
  2407. val = obj[key];
  2408. }
  2409. var childOb = !shallow && observe(val);
  2410. Object.defineProperty(obj, key, {
  2411. enumerable: true,
  2412. configurable: true,
  2413. get: function reactiveGetter () {
  2414. var value = getter ? getter.call(obj) : val;
  2415. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2416. dep.depend();
  2417. if (childOb) {
  2418. childOb.dep.depend();
  2419. if (Array.isArray(value)) {
  2420. dependArray(value);
  2421. }
  2422. }
  2423. }
  2424. return value
  2425. },
  2426. set: function reactiveSetter (newVal) {
  2427. var value = getter ? getter.call(obj) : val;
  2428. /* eslint-disable no-self-compare */
  2429. if (newVal === value || (newVal !== newVal && value !== value)) {
  2430. return
  2431. }
  2432. /* eslint-enable no-self-compare */
  2433. if ( true && customSetter) {
  2434. customSetter();
  2435. }
  2436. // #7981: for accessor properties without setter
  2437. if (getter && !setter) { return }
  2438. if (setter) {
  2439. setter.call(obj, newVal);
  2440. } else {
  2441. val = newVal;
  2442. }
  2443. childOb = !shallow && observe(newVal);
  2444. dep.notify();
  2445. }
  2446. });
  2447. }
  2448. /**
  2449. * Set a property on an object. Adds the new property and
  2450. * triggers change notification if the property doesn't
  2451. * already exist.
  2452. */
  2453. function set (target, key, val) {
  2454. if ( true &&
  2455. (isUndef(target) || isPrimitive(target))
  2456. ) {
  2457. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2458. }
  2459. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2460. target.length = Math.max(target.length, key);
  2461. target.splice(key, 1, val);
  2462. return val
  2463. }
  2464. if (key in target && !(key in Object.prototype)) {
  2465. target[key] = val;
  2466. return val
  2467. }
  2468. var ob = (target).__ob__;
  2469. if (target._isVue || (ob && ob.vmCount)) {
  2470. true && warn(
  2471. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2472. 'at runtime - declare it upfront in the data option.'
  2473. );
  2474. return val
  2475. }
  2476. if (!ob) {
  2477. target[key] = val;
  2478. return val
  2479. }
  2480. defineReactive$$1(ob.value, key, val);
  2481. ob.dep.notify();
  2482. return val
  2483. }
  2484. /**
  2485. * Delete a property and trigger change if necessary.
  2486. */
  2487. function del (target, key) {
  2488. if ( true &&
  2489. (isUndef(target) || isPrimitive(target))
  2490. ) {
  2491. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2492. }
  2493. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2494. target.splice(key, 1);
  2495. return
  2496. }
  2497. var ob = (target).__ob__;
  2498. if (target._isVue || (ob && ob.vmCount)) {
  2499. true && warn(
  2500. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2501. '- just set it to null.'
  2502. );
  2503. return
  2504. }
  2505. if (!hasOwn(target, key)) {
  2506. return
  2507. }
  2508. delete target[key];
  2509. if (!ob) {
  2510. return
  2511. }
  2512. ob.dep.notify();
  2513. }
  2514. /**
  2515. * Collect dependencies on array elements when the array is touched, since
  2516. * we cannot intercept array element access like property getters.
  2517. */
  2518. function dependArray (value) {
  2519. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2520. e = value[i];
  2521. e && e.__ob__ && e.__ob__.dep.depend();
  2522. if (Array.isArray(e)) {
  2523. dependArray(e);
  2524. }
  2525. }
  2526. }
  2527. /* */
  2528. /**
  2529. * Option overwriting strategies are functions that handle
  2530. * how to merge a parent option value and a child option
  2531. * value into the final value.
  2532. */
  2533. var strats = config.optionMergeStrategies;
  2534. /**
  2535. * Options with restrictions
  2536. */
  2537. if (true) {
  2538. strats.el = strats.propsData = function (parent, child, vm, key) {
  2539. if (!vm) {
  2540. warn(
  2541. "option \"" + key + "\" can only be used during instance " +
  2542. 'creation with the `new` keyword.'
  2543. );
  2544. }
  2545. return defaultStrat(parent, child)
  2546. };
  2547. }
  2548. /**
  2549. * Helper that recursively merges two data objects together.
  2550. */
  2551. function mergeData (to, from) {
  2552. if (!from) { return to }
  2553. var key, toVal, fromVal;
  2554. var keys = hasSymbol
  2555. ? Reflect.ownKeys(from)
  2556. : Object.keys(from);
  2557. for (var i = 0; i < keys.length; i++) {
  2558. key = keys[i];
  2559. // in case the object is already observed...
  2560. if (key === '__ob__') { continue }
  2561. toVal = to[key];
  2562. fromVal = from[key];
  2563. if (!hasOwn(to, key)) {
  2564. set(to, key, fromVal);
  2565. } else if (
  2566. toVal !== fromVal &&
  2567. isPlainObject(toVal) &&
  2568. isPlainObject(fromVal)
  2569. ) {
  2570. mergeData(toVal, fromVal);
  2571. }
  2572. }
  2573. return to
  2574. }
  2575. /**
  2576. * Data
  2577. */
  2578. function mergeDataOrFn (
  2579. parentVal,
  2580. childVal,
  2581. vm
  2582. ) {
  2583. if (!vm) {
  2584. // in a Vue.extend merge, both should be functions
  2585. if (!childVal) {
  2586. return parentVal
  2587. }
  2588. if (!parentVal) {
  2589. return childVal
  2590. }
  2591. // when parentVal & childVal are both present,
  2592. // we need to return a function that returns the
  2593. // merged result of both functions... no need to
  2594. // check if parentVal is a function here because
  2595. // it has to be a function to pass previous merges.
  2596. return function mergedDataFn () {
  2597. return mergeData(
  2598. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2599. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2600. )
  2601. }
  2602. } else {
  2603. return function mergedInstanceDataFn () {
  2604. // instance merge
  2605. var instanceData = typeof childVal === 'function'
  2606. ? childVal.call(vm, vm)
  2607. : childVal;
  2608. var defaultData = typeof parentVal === 'function'
  2609. ? parentVal.call(vm, vm)
  2610. : parentVal;
  2611. if (instanceData) {
  2612. return mergeData(instanceData, defaultData)
  2613. } else {
  2614. return defaultData
  2615. }
  2616. }
  2617. }
  2618. }
  2619. strats.data = function (
  2620. parentVal,
  2621. childVal,
  2622. vm
  2623. ) {
  2624. if (!vm) {
  2625. if (childVal && typeof childVal !== 'function') {
  2626. true && warn(
  2627. 'The "data" option should be a function ' +
  2628. 'that returns a per-instance value in component ' +
  2629. 'definitions.',
  2630. vm
  2631. );
  2632. return parentVal
  2633. }
  2634. return mergeDataOrFn(parentVal, childVal)
  2635. }
  2636. return mergeDataOrFn(parentVal, childVal, vm)
  2637. };
  2638. /**
  2639. * Hooks and props are merged as arrays.
  2640. */
  2641. function mergeHook (
  2642. parentVal,
  2643. childVal
  2644. ) {
  2645. var res = childVal
  2646. ? parentVal
  2647. ? parentVal.concat(childVal)
  2648. : Array.isArray(childVal)
  2649. ? childVal
  2650. : [childVal]
  2651. : parentVal;
  2652. return res
  2653. ? dedupeHooks(res)
  2654. : res
  2655. }
  2656. function dedupeHooks (hooks) {
  2657. var res = [];
  2658. for (var i = 0; i < hooks.length; i++) {
  2659. if (res.indexOf(hooks[i]) === -1) {
  2660. res.push(hooks[i]);
  2661. }
  2662. }
  2663. return res
  2664. }
  2665. LIFECYCLE_HOOKS.forEach(function (hook) {
  2666. strats[hook] = mergeHook;
  2667. });
  2668. /**
  2669. * Assets
  2670. *
  2671. * When a vm is present (instance creation), we need to do
  2672. * a three-way merge between constructor options, instance
  2673. * options and parent options.
  2674. */
  2675. function mergeAssets (
  2676. parentVal,
  2677. childVal,
  2678. vm,
  2679. key
  2680. ) {
  2681. var res = Object.create(parentVal || null);
  2682. if (childVal) {
  2683. true && assertObjectType(key, childVal, vm);
  2684. return extend(res, childVal)
  2685. } else {
  2686. return res
  2687. }
  2688. }
  2689. ASSET_TYPES.forEach(function (type) {
  2690. strats[type + 's'] = mergeAssets;
  2691. });
  2692. /**
  2693. * Watchers.
  2694. *
  2695. * Watchers hashes should not overwrite one
  2696. * another, so we merge them as arrays.
  2697. */
  2698. strats.watch = function (
  2699. parentVal,
  2700. childVal,
  2701. vm,
  2702. key
  2703. ) {
  2704. // work around Firefox's Object.prototype.watch...
  2705. if (parentVal === nativeWatch) { parentVal = undefined; }
  2706. if (childVal === nativeWatch) { childVal = undefined; }
  2707. /* istanbul ignore if */
  2708. if (!childVal) { return Object.create(parentVal || null) }
  2709. if (true) {
  2710. assertObjectType(key, childVal, vm);
  2711. }
  2712. if (!parentVal) { return childVal }
  2713. var ret = {};
  2714. extend(ret, parentVal);
  2715. for (var key$1 in childVal) {
  2716. var parent = ret[key$1];
  2717. var child = childVal[key$1];
  2718. if (parent && !Array.isArray(parent)) {
  2719. parent = [parent];
  2720. }
  2721. ret[key$1] = parent
  2722. ? parent.concat(child)
  2723. : Array.isArray(child) ? child : [child];
  2724. }
  2725. return ret
  2726. };
  2727. /**
  2728. * Other object hashes.
  2729. */
  2730. strats.props =
  2731. strats.methods =
  2732. strats.inject =
  2733. strats.computed = function (
  2734. parentVal,
  2735. childVal,
  2736. vm,
  2737. key
  2738. ) {
  2739. if (childVal && "development" !== 'production') {
  2740. assertObjectType(key, childVal, vm);
  2741. }
  2742. if (!parentVal) { return childVal }
  2743. var ret = Object.create(null);
  2744. extend(ret, parentVal);
  2745. if (childVal) { extend(ret, childVal); }
  2746. return ret
  2747. };
  2748. strats.provide = mergeDataOrFn;
  2749. /**
  2750. * Default strategy.
  2751. */
  2752. var defaultStrat = function (parentVal, childVal) {
  2753. return childVal === undefined
  2754. ? parentVal
  2755. : childVal
  2756. };
  2757. /**
  2758. * Validate component names
  2759. */
  2760. function checkComponents (options) {
  2761. for (var key in options.components) {
  2762. validateComponentName(key);
  2763. }
  2764. }
  2765. function validateComponentName (name) {
  2766. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2767. warn(
  2768. 'Invalid component name: "' + name + '". Component names ' +
  2769. 'should conform to valid custom element name in html5 specification.'
  2770. );
  2771. }
  2772. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2773. warn(
  2774. 'Do not use built-in or reserved HTML elements as component ' +
  2775. 'id: ' + name
  2776. );
  2777. }
  2778. }
  2779. /**
  2780. * Ensure all props option syntax are normalized into the
  2781. * Object-based format.
  2782. */
  2783. function normalizeProps (options, vm) {
  2784. var props = options.props;
  2785. if (!props) { return }
  2786. var res = {};
  2787. var i, val, name;
  2788. if (Array.isArray(props)) {
  2789. i = props.length;
  2790. while (i--) {
  2791. val = props[i];
  2792. if (typeof val === 'string') {
  2793. name = camelize(val);
  2794. res[name] = { type: null };
  2795. } else if (true) {
  2796. warn('props must be strings when using array syntax.');
  2797. }
  2798. }
  2799. } else if (isPlainObject(props)) {
  2800. for (var key in props) {
  2801. val = props[key];
  2802. name = camelize(key);
  2803. res[name] = isPlainObject(val)
  2804. ? val
  2805. : { type: val };
  2806. }
  2807. } else if (true) {
  2808. warn(
  2809. "Invalid value for option \"props\": expected an Array or an Object, " +
  2810. "but got " + (toRawType(props)) + ".",
  2811. vm
  2812. );
  2813. }
  2814. options.props = res;
  2815. }
  2816. /**
  2817. * Normalize all injections into Object-based format
  2818. */
  2819. function normalizeInject (options, vm) {
  2820. var inject = options.inject;
  2821. if (!inject) { return }
  2822. var normalized = options.inject = {};
  2823. if (Array.isArray(inject)) {
  2824. for (var i = 0; i < inject.length; i++) {
  2825. normalized[inject[i]] = { from: inject[i] };
  2826. }
  2827. } else if (isPlainObject(inject)) {
  2828. for (var key in inject) {
  2829. var val = inject[key];
  2830. normalized[key] = isPlainObject(val)
  2831. ? extend({ from: key }, val)
  2832. : { from: val };
  2833. }
  2834. } else if (true) {
  2835. warn(
  2836. "Invalid value for option \"inject\": expected an Array or an Object, " +
  2837. "but got " + (toRawType(inject)) + ".",
  2838. vm
  2839. );
  2840. }
  2841. }
  2842. /**
  2843. * Normalize raw function directives into object format.
  2844. */
  2845. function normalizeDirectives (options) {
  2846. var dirs = options.directives;
  2847. if (dirs) {
  2848. for (var key in dirs) {
  2849. var def$$1 = dirs[key];
  2850. if (typeof def$$1 === 'function') {
  2851. dirs[key] = { bind: def$$1, update: def$$1 };
  2852. }
  2853. }
  2854. }
  2855. }
  2856. function assertObjectType (name, value, vm) {
  2857. if (!isPlainObject(value)) {
  2858. warn(
  2859. "Invalid value for option \"" + name + "\": expected an Object, " +
  2860. "but got " + (toRawType(value)) + ".",
  2861. vm
  2862. );
  2863. }
  2864. }
  2865. /**
  2866. * Merge two option objects into a new one.
  2867. * Core utility used in both instantiation and inheritance.
  2868. */
  2869. function mergeOptions (
  2870. parent,
  2871. child,
  2872. vm
  2873. ) {
  2874. if (true) {
  2875. checkComponents(child);
  2876. }
  2877. if (typeof child === 'function') {
  2878. child = child.options;
  2879. }
  2880. normalizeProps(child, vm);
  2881. normalizeInject(child, vm);
  2882. normalizeDirectives(child);
  2883. // Apply extends and mixins on the child options,
  2884. // but only if it is a raw options object that isn't
  2885. // the result of another mergeOptions call.
  2886. // Only merged options has the _base property.
  2887. if (!child._base) {
  2888. if (child.extends) {
  2889. parent = mergeOptions(parent, child.extends, vm);
  2890. }
  2891. if (child.mixins) {
  2892. for (var i = 0, l = child.mixins.length; i < l; i++) {
  2893. parent = mergeOptions(parent, child.mixins[i], vm);
  2894. }
  2895. }
  2896. }
  2897. var options = {};
  2898. var key;
  2899. for (key in parent) {
  2900. mergeField(key);
  2901. }
  2902. for (key in child) {
  2903. if (!hasOwn(parent, key)) {
  2904. mergeField(key);
  2905. }
  2906. }
  2907. function mergeField (key) {
  2908. var strat = strats[key] || defaultStrat;
  2909. options[key] = strat(parent[key], child[key], vm, key);
  2910. }
  2911. return options
  2912. }
  2913. /**
  2914. * Resolve an asset.
  2915. * This function is used because child instances need access
  2916. * to assets defined in its ancestor chain.
  2917. */
  2918. function resolveAsset (
  2919. options,
  2920. type,
  2921. id,
  2922. warnMissing
  2923. ) {
  2924. /* istanbul ignore if */
  2925. if (typeof id !== 'string') {
  2926. return
  2927. }
  2928. var assets = options[type];
  2929. // check local registration variations first
  2930. if (hasOwn(assets, id)) { return assets[id] }
  2931. var camelizedId = camelize(id);
  2932. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  2933. var PascalCaseId = capitalize(camelizedId);
  2934. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  2935. // fallback to prototype chain
  2936. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  2937. if ( true && warnMissing && !res) {
  2938. warn(
  2939. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  2940. options
  2941. );
  2942. }
  2943. return res
  2944. }
  2945. /* */
  2946. function validateProp (
  2947. key,
  2948. propOptions,
  2949. propsData,
  2950. vm
  2951. ) {
  2952. var prop = propOptions[key];
  2953. var absent = !hasOwn(propsData, key);
  2954. var value = propsData[key];
  2955. // boolean casting
  2956. var booleanIndex = getTypeIndex(Boolean, prop.type);
  2957. if (booleanIndex > -1) {
  2958. if (absent && !hasOwn(prop, 'default')) {
  2959. value = false;
  2960. } else if (value === '' || value === hyphenate(key)) {
  2961. // only cast empty string / same name to boolean if
  2962. // boolean has higher priority
  2963. var stringIndex = getTypeIndex(String, prop.type);
  2964. if (stringIndex < 0 || booleanIndex < stringIndex) {
  2965. value = true;
  2966. }
  2967. }
  2968. }
  2969. // check default value
  2970. if (value === undefined) {
  2971. value = getPropDefaultValue(vm, prop, key);
  2972. // since the default value is a fresh copy,
  2973. // make sure to observe it.
  2974. var prevShouldObserve = shouldObserve;
  2975. toggleObserving(true);
  2976. observe(value);
  2977. toggleObserving(prevShouldObserve);
  2978. }
  2979. if (
  2980. true
  2981. ) {
  2982. assertProp(prop, key, value, vm, absent);
  2983. }
  2984. return value
  2985. }
  2986. /**
  2987. * Get the default value of a prop.
  2988. */
  2989. function getPropDefaultValue (vm, prop, key) {
  2990. // no default, return undefined
  2991. if (!hasOwn(prop, 'default')) {
  2992. return undefined
  2993. }
  2994. var def = prop.default;
  2995. // warn against non-factory defaults for Object & Array
  2996. if ( true && isObject(def)) {
  2997. warn(
  2998. 'Invalid default value for prop "' + key + '": ' +
  2999. 'Props with type Object/Array must use a factory function ' +
  3000. 'to return the default value.',
  3001. vm
  3002. );
  3003. }
  3004. // the raw prop value was also undefined from previous render,
  3005. // return previous default value to avoid unnecessary watcher trigger
  3006. if (vm && vm.$options.propsData &&
  3007. vm.$options.propsData[key] === undefined &&
  3008. vm._props[key] !== undefined
  3009. ) {
  3010. return vm._props[key]
  3011. }
  3012. // call factory function for non-Function types
  3013. // a value is Function if its prototype is function even across different execution context
  3014. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3015. ? def.call(vm)
  3016. : def
  3017. }
  3018. /**
  3019. * Assert whether a prop is valid.
  3020. */
  3021. function assertProp (
  3022. prop,
  3023. name,
  3024. value,
  3025. vm,
  3026. absent
  3027. ) {
  3028. if (prop.required && absent) {
  3029. warn(
  3030. 'Missing required prop: "' + name + '"',
  3031. vm
  3032. );
  3033. return
  3034. }
  3035. if (value == null && !prop.required) {
  3036. return
  3037. }
  3038. var type = prop.type;
  3039. var valid = !type || type === true;
  3040. var expectedTypes = [];
  3041. if (type) {
  3042. if (!Array.isArray(type)) {
  3043. type = [type];
  3044. }
  3045. for (var i = 0; i < type.length && !valid; i++) {
  3046. var assertedType = assertType(value, type[i]);
  3047. expectedTypes.push(assertedType.expectedType || '');
  3048. valid = assertedType.valid;
  3049. }
  3050. }
  3051. if (!valid) {
  3052. warn(
  3053. getInvalidTypeMessage(name, value, expectedTypes),
  3054. vm
  3055. );
  3056. return
  3057. }
  3058. var validator = prop.validator;
  3059. if (validator) {
  3060. if (!validator(value)) {
  3061. warn(
  3062. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3063. vm
  3064. );
  3065. }
  3066. }
  3067. }
  3068. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3069. function assertType (value, type) {
  3070. var valid;
  3071. var expectedType = getType(type);
  3072. if (simpleCheckRE.test(expectedType)) {
  3073. var t = typeof value;
  3074. valid = t === expectedType.toLowerCase();
  3075. // for primitive wrapper objects
  3076. if (!valid && t === 'object') {
  3077. valid = value instanceof type;
  3078. }
  3079. } else if (expectedType === 'Object') {
  3080. valid = isPlainObject(value);
  3081. } else if (expectedType === 'Array') {
  3082. valid = Array.isArray(value);
  3083. } else {
  3084. valid = value instanceof type;
  3085. }
  3086. return {
  3087. valid: valid,
  3088. expectedType: expectedType
  3089. }
  3090. }
  3091. /**
  3092. * Use function string name to check built-in types,
  3093. * because a simple equality check will fail when running
  3094. * across different vms / iframes.
  3095. */
  3096. function getType (fn) {
  3097. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3098. return match ? match[1] : ''
  3099. }
  3100. function isSameType (a, b) {
  3101. return getType(a) === getType(b)
  3102. }
  3103. function getTypeIndex (type, expectedTypes) {
  3104. if (!Array.isArray(expectedTypes)) {
  3105. return isSameType(expectedTypes, type) ? 0 : -1
  3106. }
  3107. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3108. if (isSameType(expectedTypes[i], type)) {
  3109. return i
  3110. }
  3111. }
  3112. return -1
  3113. }
  3114. function getInvalidTypeMessage (name, value, expectedTypes) {
  3115. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3116. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3117. var expectedType = expectedTypes[0];
  3118. var receivedType = toRawType(value);
  3119. var expectedValue = styleValue(value, expectedType);
  3120. var receivedValue = styleValue(value, receivedType);
  3121. // check if we need to specify expected value
  3122. if (expectedTypes.length === 1 &&
  3123. isExplicable(expectedType) &&
  3124. !isBoolean(expectedType, receivedType)) {
  3125. message += " with value " + expectedValue;
  3126. }
  3127. message += ", got " + receivedType + " ";
  3128. // check if we need to specify received value
  3129. if (isExplicable(receivedType)) {
  3130. message += "with value " + receivedValue + ".";
  3131. }
  3132. return message
  3133. }
  3134. function styleValue (value, type) {
  3135. if (type === 'String') {
  3136. return ("\"" + value + "\"")
  3137. } else if (type === 'Number') {
  3138. return ("" + (Number(value)))
  3139. } else {
  3140. return ("" + value)
  3141. }
  3142. }
  3143. function isExplicable (value) {
  3144. var explicitTypes = ['string', 'number', 'boolean'];
  3145. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3146. }
  3147. function isBoolean () {
  3148. var args = [], len = arguments.length;
  3149. while ( len-- ) args[ len ] = arguments[ len ];
  3150. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3151. }
  3152. /* */
  3153. function handleError (err, vm, info) {
  3154. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3155. // See: https://github.com/vuejs/vuex/issues/1505
  3156. pushTarget();
  3157. try {
  3158. if (vm) {
  3159. var cur = vm;
  3160. while ((cur = cur.$parent)) {
  3161. var hooks = cur.$options.errorCaptured;
  3162. if (hooks) {
  3163. for (var i = 0; i < hooks.length; i++) {
  3164. try {
  3165. var capture = hooks[i].call(cur, err, vm, info) === false;
  3166. if (capture) { return }
  3167. } catch (e) {
  3168. globalHandleError(e, cur, 'errorCaptured hook');
  3169. }
  3170. }
  3171. }
  3172. }
  3173. }
  3174. globalHandleError(err, vm, info);
  3175. } finally {
  3176. popTarget();
  3177. }
  3178. }
  3179. function invokeWithErrorHandling (
  3180. handler,
  3181. context,
  3182. args,
  3183. vm,
  3184. info
  3185. ) {
  3186. var res;
  3187. try {
  3188. res = args ? handler.apply(context, args) : handler.call(context);
  3189. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3190. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3191. // issue #9511
  3192. // avoid catch triggering multiple times when nested calls
  3193. res._handled = true;
  3194. }
  3195. } catch (e) {
  3196. handleError(e, vm, info);
  3197. }
  3198. return res
  3199. }
  3200. function globalHandleError (err, vm, info) {
  3201. if (config.errorHandler) {
  3202. try {
  3203. return config.errorHandler.call(null, err, vm, info)
  3204. } catch (e) {
  3205. // if the user intentionally throws the original error in the handler,
  3206. // do not log it twice
  3207. if (e !== err) {
  3208. logError(e, null, 'config.errorHandler');
  3209. }
  3210. }
  3211. }
  3212. logError(err, vm, info);
  3213. }
  3214. function logError (err, vm, info) {
  3215. if (true) {
  3216. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3217. }
  3218. /* istanbul ignore else */
  3219. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3220. console.error(err);
  3221. } else {
  3222. throw err
  3223. }
  3224. }
  3225. /* */
  3226. var callbacks = [];
  3227. var pending = false;
  3228. function flushCallbacks () {
  3229. pending = false;
  3230. var copies = callbacks.slice(0);
  3231. callbacks.length = 0;
  3232. for (var i = 0; i < copies.length; i++) {
  3233. copies[i]();
  3234. }
  3235. }
  3236. // Here we have async deferring wrappers using microtasks.
  3237. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3238. // However, it has subtle problems when state is changed right before repaint
  3239. // (e.g. #6813, out-in transitions).
  3240. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3241. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3242. // So we now use microtasks everywhere, again.
  3243. // A major drawback of this tradeoff is that there are some scenarios
  3244. // where microtasks have too high a priority and fire in between supposedly
  3245. // sequential events (e.g. #4521, #6690, which have workarounds)
  3246. // or even between bubbling of the same event (#6566).
  3247. var timerFunc;
  3248. // The nextTick behavior leverages the microtask queue, which can be accessed
  3249. // via either native Promise.then or MutationObserver.
  3250. // MutationObserver has wider support, however it is seriously bugged in
  3251. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3252. // completely stops working after triggering a few times... so, if native
  3253. // Promise is available, we will use it:
  3254. /* istanbul ignore next, $flow-disable-line */
  3255. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3256. var p = Promise.resolve();
  3257. timerFunc = function () {
  3258. p.then(flushCallbacks);
  3259. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3260. // it can get stuck in a weird state where callbacks are pushed into the
  3261. // microtask queue but the queue isn't being flushed, until the browser
  3262. // needs to do some other work, e.g. handle a timer. Therefore we can
  3263. // "force" the microtask queue to be flushed by adding an empty timer.
  3264. if (isIOS) { setTimeout(noop); }
  3265. };
  3266. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3267. isNative(MutationObserver) ||
  3268. // PhantomJS and iOS 7.x
  3269. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3270. )) {
  3271. // Use MutationObserver where native Promise is not available,
  3272. // e.g. PhantomJS, iOS7, Android 4.4
  3273. // (#6466 MutationObserver is unreliable in IE11)
  3274. var counter = 1;
  3275. var observer = new MutationObserver(flushCallbacks);
  3276. var textNode = document.createTextNode(String(counter));
  3277. observer.observe(textNode, {
  3278. characterData: true
  3279. });
  3280. timerFunc = function () {
  3281. counter = (counter + 1) % 2;
  3282. textNode.data = String(counter);
  3283. };
  3284. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3285. // Fallback to setImmediate.
  3286. // Technically it leverages the (macro) task queue,
  3287. // but it is still a better choice than setTimeout.
  3288. timerFunc = function () {
  3289. setImmediate(flushCallbacks);
  3290. };
  3291. } else {
  3292. // Fallback to setTimeout.
  3293. timerFunc = function () {
  3294. setTimeout(flushCallbacks, 0);
  3295. };
  3296. }
  3297. function nextTick (cb, ctx) {
  3298. var _resolve;
  3299. callbacks.push(function () {
  3300. if (cb) {
  3301. try {
  3302. cb.call(ctx);
  3303. } catch (e) {
  3304. handleError(e, ctx, 'nextTick');
  3305. }
  3306. } else if (_resolve) {
  3307. _resolve(ctx);
  3308. }
  3309. });
  3310. if (!pending) {
  3311. pending = true;
  3312. timerFunc();
  3313. }
  3314. // $flow-disable-line
  3315. if (!cb && typeof Promise !== 'undefined') {
  3316. return new Promise(function (resolve) {
  3317. _resolve = resolve;
  3318. })
  3319. }
  3320. }
  3321. /* */
  3322. /* not type checking this file because flow doesn't play well with Proxy */
  3323. var initProxy;
  3324. if (true) {
  3325. var allowedGlobals = makeMap(
  3326. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3327. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3328. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3329. 'require' // for Webpack/Browserify
  3330. );
  3331. var warnNonPresent = function (target, key) {
  3332. warn(
  3333. "Property or method \"" + key + "\" is not defined on the instance but " +
  3334. 'referenced during render. Make sure that this property is reactive, ' +
  3335. 'either in the data option, or for class-based components, by ' +
  3336. 'initializing the property. ' +
  3337. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3338. target
  3339. );
  3340. };
  3341. var warnReservedPrefix = function (target, key) {
  3342. warn(
  3343. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3344. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3345. 'prevent conflicts with Vue internals. ' +
  3346. 'See: https://vuejs.org/v2/api/#data',
  3347. target
  3348. );
  3349. };
  3350. var hasProxy =
  3351. typeof Proxy !== 'undefined' && isNative(Proxy);
  3352. if (hasProxy) {
  3353. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3354. config.keyCodes = new Proxy(config.keyCodes, {
  3355. set: function set (target, key, value) {
  3356. if (isBuiltInModifier(key)) {
  3357. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3358. return false
  3359. } else {
  3360. target[key] = value;
  3361. return true
  3362. }
  3363. }
  3364. });
  3365. }
  3366. var hasHandler = {
  3367. has: function has (target, key) {
  3368. var has = key in target;
  3369. var isAllowed = allowedGlobals(key) ||
  3370. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3371. if (!has && !isAllowed) {
  3372. if (key in target.$data) { warnReservedPrefix(target, key); }
  3373. else { warnNonPresent(target, key); }
  3374. }
  3375. return has || !isAllowed
  3376. }
  3377. };
  3378. var getHandler = {
  3379. get: function get (target, key) {
  3380. if (typeof key === 'string' && !(key in target)) {
  3381. if (key in target.$data) { warnReservedPrefix(target, key); }
  3382. else { warnNonPresent(target, key); }
  3383. }
  3384. return target[key]
  3385. }
  3386. };
  3387. initProxy = function initProxy (vm) {
  3388. if (hasProxy) {
  3389. // determine which proxy handler to use
  3390. var options = vm.$options;
  3391. var handlers = options.render && options.render._withStripped
  3392. ? getHandler
  3393. : hasHandler;
  3394. vm._renderProxy = new Proxy(vm, handlers);
  3395. } else {
  3396. vm._renderProxy = vm;
  3397. }
  3398. };
  3399. }
  3400. /* */
  3401. var seenObjects = new _Set();
  3402. /**
  3403. * Recursively traverse an object to evoke all converted
  3404. * getters, so that every nested property inside the object
  3405. * is collected as a "deep" dependency.
  3406. */
  3407. function traverse (val) {
  3408. _traverse(val, seenObjects);
  3409. seenObjects.clear();
  3410. }
  3411. function _traverse (val, seen) {
  3412. var i, keys;
  3413. var isA = Array.isArray(val);
  3414. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3415. return
  3416. }
  3417. if (val.__ob__) {
  3418. var depId = val.__ob__.dep.id;
  3419. if (seen.has(depId)) {
  3420. return
  3421. }
  3422. seen.add(depId);
  3423. }
  3424. if (isA) {
  3425. i = val.length;
  3426. while (i--) { _traverse(val[i], seen); }
  3427. } else {
  3428. keys = Object.keys(val);
  3429. i = keys.length;
  3430. while (i--) { _traverse(val[keys[i]], seen); }
  3431. }
  3432. }
  3433. var mark;
  3434. var measure;
  3435. if (true) {
  3436. var perf = inBrowser && window.performance;
  3437. /* istanbul ignore if */
  3438. if (
  3439. perf &&
  3440. perf.mark &&
  3441. perf.measure &&
  3442. perf.clearMarks &&
  3443. perf.clearMeasures
  3444. ) {
  3445. mark = function (tag) { return perf.mark(tag); };
  3446. measure = function (name, startTag, endTag) {
  3447. perf.measure(name, startTag, endTag);
  3448. perf.clearMarks(startTag);
  3449. perf.clearMarks(endTag);
  3450. // perf.clearMeasures(name)
  3451. };
  3452. }
  3453. }
  3454. /* */
  3455. var normalizeEvent = cached(function (name) {
  3456. var passive = name.charAt(0) === '&';
  3457. name = passive ? name.slice(1) : name;
  3458. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3459. name = once$$1 ? name.slice(1) : name;
  3460. var capture = name.charAt(0) === '!';
  3461. name = capture ? name.slice(1) : name;
  3462. return {
  3463. name: name,
  3464. once: once$$1,
  3465. capture: capture,
  3466. passive: passive
  3467. }
  3468. });
  3469. function createFnInvoker (fns, vm) {
  3470. function invoker () {
  3471. var arguments$1 = arguments;
  3472. var fns = invoker.fns;
  3473. if (Array.isArray(fns)) {
  3474. var cloned = fns.slice();
  3475. for (var i = 0; i < cloned.length; i++) {
  3476. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3477. }
  3478. } else {
  3479. // return handler return value for single handlers
  3480. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3481. }
  3482. }
  3483. invoker.fns = fns;
  3484. return invoker
  3485. }
  3486. function updateListeners (
  3487. on,
  3488. oldOn,
  3489. add,
  3490. remove$$1,
  3491. createOnceHandler,
  3492. vm
  3493. ) {
  3494. var name, def$$1, cur, old, event;
  3495. for (name in on) {
  3496. def$$1 = cur = on[name];
  3497. old = oldOn[name];
  3498. event = normalizeEvent(name);
  3499. if (isUndef(cur)) {
  3500. true && warn(
  3501. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3502. vm
  3503. );
  3504. } else if (isUndef(old)) {
  3505. if (isUndef(cur.fns)) {
  3506. cur = on[name] = createFnInvoker(cur, vm);
  3507. }
  3508. if (isTrue(event.once)) {
  3509. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3510. }
  3511. add(event.name, cur, event.capture, event.passive, event.params);
  3512. } else if (cur !== old) {
  3513. old.fns = cur;
  3514. on[name] = old;
  3515. }
  3516. }
  3517. for (name in oldOn) {
  3518. if (isUndef(on[name])) {
  3519. event = normalizeEvent(name);
  3520. remove$$1(event.name, oldOn[name], event.capture);
  3521. }
  3522. }
  3523. }
  3524. /* */
  3525. /* */
  3526. // fixed by xxxxxx (mp properties)
  3527. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3528. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3529. if (isUndef(propOptions)) {
  3530. return res
  3531. }
  3532. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3533. var attrs = data.attrs;
  3534. var props = data.props;
  3535. if (isDef(attrs) || isDef(props)) {
  3536. for (var key in propOptions) {
  3537. var altKey = hyphenate(key);
  3538. var result = checkProp(res, props, key, altKey, true) ||
  3539. checkProp(res, attrs, key, altKey, false);
  3540. // externalClass
  3541. if (
  3542. result &&
  3543. res[key] &&
  3544. externalClasses.indexOf(altKey) !== -1 &&
  3545. context[camelize(res[key])]
  3546. ) {
  3547. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3548. res[key] = context[camelize(res[key])];
  3549. }
  3550. }
  3551. }
  3552. return res
  3553. }
  3554. function extractPropsFromVNodeData (
  3555. data,
  3556. Ctor,
  3557. tag,
  3558. context// fixed by xxxxxx
  3559. ) {
  3560. // we are only extracting raw values here.
  3561. // validation and default values are handled in the child
  3562. // component itself.
  3563. var propOptions = Ctor.options.props;
  3564. if (isUndef(propOptions)) {
  3565. // fixed by xxxxxx
  3566. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3567. }
  3568. var res = {};
  3569. var attrs = data.attrs;
  3570. var props = data.props;
  3571. if (isDef(attrs) || isDef(props)) {
  3572. for (var key in propOptions) {
  3573. var altKey = hyphenate(key);
  3574. if (true) {
  3575. var keyInLowerCase = key.toLowerCase();
  3576. if (
  3577. key !== keyInLowerCase &&
  3578. attrs && hasOwn(attrs, keyInLowerCase)
  3579. ) {
  3580. tip(
  3581. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3582. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3583. " \"" + key + "\". " +
  3584. "Note that HTML attributes are case-insensitive and camelCased " +
  3585. "props need to use their kebab-case equivalents when using in-DOM " +
  3586. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3587. );
  3588. }
  3589. }
  3590. checkProp(res, props, key, altKey, true) ||
  3591. checkProp(res, attrs, key, altKey, false);
  3592. }
  3593. }
  3594. // fixed by xxxxxx
  3595. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3596. }
  3597. function checkProp (
  3598. res,
  3599. hash,
  3600. key,
  3601. altKey,
  3602. preserve
  3603. ) {
  3604. if (isDef(hash)) {
  3605. if (hasOwn(hash, key)) {
  3606. res[key] = hash[key];
  3607. if (!preserve) {
  3608. delete hash[key];
  3609. }
  3610. return true
  3611. } else if (hasOwn(hash, altKey)) {
  3612. res[key] = hash[altKey];
  3613. if (!preserve) {
  3614. delete hash[altKey];
  3615. }
  3616. return true
  3617. }
  3618. }
  3619. return false
  3620. }
  3621. /* */
  3622. // The template compiler attempts to minimize the need for normalization by
  3623. // statically analyzing the template at compile time.
  3624. //
  3625. // For plain HTML markup, normalization can be completely skipped because the
  3626. // generated render function is guaranteed to return Array<VNode>. There are
  3627. // two cases where extra normalization is needed:
  3628. // 1. When the children contains components - because a functional component
  3629. // may return an Array instead of a single root. In this case, just a simple
  3630. // normalization is needed - if any child is an Array, we flatten the whole
  3631. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3632. // because functional components already normalize their own children.
  3633. function simpleNormalizeChildren (children) {
  3634. for (var i = 0; i < children.length; i++) {
  3635. if (Array.isArray(children[i])) {
  3636. return Array.prototype.concat.apply([], children)
  3637. }
  3638. }
  3639. return children
  3640. }
  3641. // 2. When the children contains constructs that always generated nested Arrays,
  3642. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3643. // with hand-written render functions / JSX. In such cases a full normalization
  3644. // is needed to cater to all possible types of children values.
  3645. function normalizeChildren (children) {
  3646. return isPrimitive(children)
  3647. ? [createTextVNode(children)]
  3648. : Array.isArray(children)
  3649. ? normalizeArrayChildren(children)
  3650. : undefined
  3651. }
  3652. function isTextNode (node) {
  3653. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3654. }
  3655. function normalizeArrayChildren (children, nestedIndex) {
  3656. var res = [];
  3657. var i, c, lastIndex, last;
  3658. for (i = 0; i < children.length; i++) {
  3659. c = children[i];
  3660. if (isUndef(c) || typeof c === 'boolean') { continue }
  3661. lastIndex = res.length - 1;
  3662. last = res[lastIndex];
  3663. // nested
  3664. if (Array.isArray(c)) {
  3665. if (c.length > 0) {
  3666. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3667. // merge adjacent text nodes
  3668. if (isTextNode(c[0]) && isTextNode(last)) {
  3669. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3670. c.shift();
  3671. }
  3672. res.push.apply(res, c);
  3673. }
  3674. } else if (isPrimitive(c)) {
  3675. if (isTextNode(last)) {
  3676. // merge adjacent text nodes
  3677. // this is necessary for SSR hydration because text nodes are
  3678. // essentially merged when rendered to HTML strings
  3679. res[lastIndex] = createTextVNode(last.text + c);
  3680. } else if (c !== '') {
  3681. // convert primitive to vnode
  3682. res.push(createTextVNode(c));
  3683. }
  3684. } else {
  3685. if (isTextNode(c) && isTextNode(last)) {
  3686. // merge adjacent text nodes
  3687. res[lastIndex] = createTextVNode(last.text + c.text);
  3688. } else {
  3689. // default key for nested array children (likely generated by v-for)
  3690. if (isTrue(children._isVList) &&
  3691. isDef(c.tag) &&
  3692. isUndef(c.key) &&
  3693. isDef(nestedIndex)) {
  3694. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3695. }
  3696. res.push(c);
  3697. }
  3698. }
  3699. }
  3700. return res
  3701. }
  3702. /* */
  3703. function initProvide (vm) {
  3704. var provide = vm.$options.provide;
  3705. if (provide) {
  3706. vm._provided = typeof provide === 'function'
  3707. ? provide.call(vm)
  3708. : provide;
  3709. }
  3710. }
  3711. function initInjections (vm) {
  3712. var result = resolveInject(vm.$options.inject, vm);
  3713. if (result) {
  3714. toggleObserving(false);
  3715. Object.keys(result).forEach(function (key) {
  3716. /* istanbul ignore else */
  3717. if (true) {
  3718. defineReactive$$1(vm, key, result[key], function () {
  3719. warn(
  3720. "Avoid mutating an injected value directly since the changes will be " +
  3721. "overwritten whenever the provided component re-renders. " +
  3722. "injection being mutated: \"" + key + "\"",
  3723. vm
  3724. );
  3725. });
  3726. } else {}
  3727. });
  3728. toggleObserving(true);
  3729. }
  3730. }
  3731. function resolveInject (inject, vm) {
  3732. if (inject) {
  3733. // inject is :any because flow is not smart enough to figure out cached
  3734. var result = Object.create(null);
  3735. var keys = hasSymbol
  3736. ? Reflect.ownKeys(inject)
  3737. : Object.keys(inject);
  3738. for (var i = 0; i < keys.length; i++) {
  3739. var key = keys[i];
  3740. // #6574 in case the inject object is observed...
  3741. if (key === '__ob__') { continue }
  3742. var provideKey = inject[key].from;
  3743. var source = vm;
  3744. while (source) {
  3745. if (source._provided && hasOwn(source._provided, provideKey)) {
  3746. result[key] = source._provided[provideKey];
  3747. break
  3748. }
  3749. source = source.$parent;
  3750. }
  3751. if (!source) {
  3752. if ('default' in inject[key]) {
  3753. var provideDefault = inject[key].default;
  3754. result[key] = typeof provideDefault === 'function'
  3755. ? provideDefault.call(vm)
  3756. : provideDefault;
  3757. } else if (true) {
  3758. warn(("Injection \"" + key + "\" not found"), vm);
  3759. }
  3760. }
  3761. }
  3762. return result
  3763. }
  3764. }
  3765. /* */
  3766. /**
  3767. * Runtime helper for resolving raw children VNodes into a slot object.
  3768. */
  3769. function resolveSlots (
  3770. children,
  3771. context
  3772. ) {
  3773. if (!children || !children.length) {
  3774. return {}
  3775. }
  3776. var slots = {};
  3777. for (var i = 0, l = children.length; i < l; i++) {
  3778. var child = children[i];
  3779. var data = child.data;
  3780. // remove slot attribute if the node is resolved as a Vue slot node
  3781. if (data && data.attrs && data.attrs.slot) {
  3782. delete data.attrs.slot;
  3783. }
  3784. // named slots should only be respected if the vnode was rendered in the
  3785. // same context.
  3786. if ((child.context === context || child.fnContext === context) &&
  3787. data && data.slot != null
  3788. ) {
  3789. var name = data.slot;
  3790. var slot = (slots[name] || (slots[name] = []));
  3791. if (child.tag === 'template') {
  3792. slot.push.apply(slot, child.children || []);
  3793. } else {
  3794. slot.push(child);
  3795. }
  3796. } else {
  3797. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  3798. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  3799. (slots['page'] || (slots['page'] = [])).push(child);
  3800. }else{
  3801. (slots.default || (slots.default = [])).push(child);
  3802. }
  3803. }
  3804. }
  3805. // ignore slots that contains only whitespace
  3806. for (var name$1 in slots) {
  3807. if (slots[name$1].every(isWhitespace)) {
  3808. delete slots[name$1];
  3809. }
  3810. }
  3811. return slots
  3812. }
  3813. function isWhitespace (node) {
  3814. return (node.isComment && !node.asyncFactory) || node.text === ' '
  3815. }
  3816. /* */
  3817. function normalizeScopedSlots (
  3818. slots,
  3819. normalSlots,
  3820. prevSlots
  3821. ) {
  3822. var res;
  3823. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  3824. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  3825. var key = slots && slots.$key;
  3826. if (!slots) {
  3827. res = {};
  3828. } else if (slots._normalized) {
  3829. // fast path 1: child component re-render only, parent did not change
  3830. return slots._normalized
  3831. } else if (
  3832. isStable &&
  3833. prevSlots &&
  3834. prevSlots !== emptyObject &&
  3835. key === prevSlots.$key &&
  3836. !hasNormalSlots &&
  3837. !prevSlots.$hasNormal
  3838. ) {
  3839. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  3840. // only need to normalize once
  3841. return prevSlots
  3842. } else {
  3843. res = {};
  3844. for (var key$1 in slots) {
  3845. if (slots[key$1] && key$1[0] !== '$') {
  3846. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  3847. }
  3848. }
  3849. }
  3850. // expose normal slots on scopedSlots
  3851. for (var key$2 in normalSlots) {
  3852. if (!(key$2 in res)) {
  3853. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  3854. }
  3855. }
  3856. // avoriaz seems to mock a non-extensible $scopedSlots object
  3857. // and when that is passed down this would cause an error
  3858. if (slots && Object.isExtensible(slots)) {
  3859. (slots)._normalized = res;
  3860. }
  3861. def(res, '$stable', isStable);
  3862. def(res, '$key', key);
  3863. def(res, '$hasNormal', hasNormalSlots);
  3864. return res
  3865. }
  3866. function normalizeScopedSlot(normalSlots, key, fn) {
  3867. var normalized = function () {
  3868. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  3869. res = res && typeof res === 'object' && !Array.isArray(res)
  3870. ? [res] // single vnode
  3871. : normalizeChildren(res);
  3872. return res && (
  3873. res.length === 0 ||
  3874. (res.length === 1 && res[0].isComment) // #9658
  3875. ) ? undefined
  3876. : res
  3877. };
  3878. // this is a slot using the new v-slot syntax without scope. although it is
  3879. // compiled as a scoped slot, render fn users would expect it to be present
  3880. // on this.$slots because the usage is semantically a normal slot.
  3881. if (fn.proxy) {
  3882. Object.defineProperty(normalSlots, key, {
  3883. get: normalized,
  3884. enumerable: true,
  3885. configurable: true
  3886. });
  3887. }
  3888. return normalized
  3889. }
  3890. function proxyNormalSlot(slots, key) {
  3891. return function () { return slots[key]; }
  3892. }
  3893. /* */
  3894. /**
  3895. * Runtime helper for rendering v-for lists.
  3896. */
  3897. function renderList (
  3898. val,
  3899. render
  3900. ) {
  3901. var ret, i, l, keys, key;
  3902. if (Array.isArray(val) || typeof val === 'string') {
  3903. ret = new Array(val.length);
  3904. for (i = 0, l = val.length; i < l; i++) {
  3905. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  3906. }
  3907. } else if (typeof val === 'number') {
  3908. ret = new Array(val);
  3909. for (i = 0; i < val; i++) {
  3910. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  3911. }
  3912. } else if (isObject(val)) {
  3913. if (hasSymbol && val[Symbol.iterator]) {
  3914. ret = [];
  3915. var iterator = val[Symbol.iterator]();
  3916. var result = iterator.next();
  3917. while (!result.done) {
  3918. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  3919. result = iterator.next();
  3920. }
  3921. } else {
  3922. keys = Object.keys(val);
  3923. ret = new Array(keys.length);
  3924. for (i = 0, l = keys.length; i < l; i++) {
  3925. key = keys[i];
  3926. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  3927. }
  3928. }
  3929. }
  3930. if (!isDef(ret)) {
  3931. ret = [];
  3932. }
  3933. (ret)._isVList = true;
  3934. return ret
  3935. }
  3936. /* */
  3937. /**
  3938. * Runtime helper for rendering <slot>
  3939. */
  3940. function renderSlot (
  3941. name,
  3942. fallback,
  3943. props,
  3944. bindObject
  3945. ) {
  3946. var scopedSlotFn = this.$scopedSlots[name];
  3947. var nodes;
  3948. if (scopedSlotFn) { // scoped slot
  3949. props = props || {};
  3950. if (bindObject) {
  3951. if ( true && !isObject(bindObject)) {
  3952. warn(
  3953. 'slot v-bind without argument expects an Object',
  3954. this
  3955. );
  3956. }
  3957. props = extend(extend({}, bindObject), props);
  3958. }
  3959. // fixed by xxxxxx app-plus scopedSlot
  3960. nodes = scopedSlotFn(props, this, props._i) || fallback;
  3961. } else {
  3962. nodes = this.$slots[name] || fallback;
  3963. }
  3964. var target = props && props.slot;
  3965. if (target) {
  3966. return this.$createElement('template', { slot: target }, nodes)
  3967. } else {
  3968. return nodes
  3969. }
  3970. }
  3971. /* */
  3972. /**
  3973. * Runtime helper for resolving filters
  3974. */
  3975. function resolveFilter (id) {
  3976. return resolveAsset(this.$options, 'filters', id, true) || identity
  3977. }
  3978. /* */
  3979. function isKeyNotMatch (expect, actual) {
  3980. if (Array.isArray(expect)) {
  3981. return expect.indexOf(actual) === -1
  3982. } else {
  3983. return expect !== actual
  3984. }
  3985. }
  3986. /**
  3987. * Runtime helper for checking keyCodes from config.
  3988. * exposed as Vue.prototype._k
  3989. * passing in eventKeyName as last argument separately for backwards compat
  3990. */
  3991. function checkKeyCodes (
  3992. eventKeyCode,
  3993. key,
  3994. builtInKeyCode,
  3995. eventKeyName,
  3996. builtInKeyName
  3997. ) {
  3998. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  3999. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4000. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4001. } else if (mappedKeyCode) {
  4002. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4003. } else if (eventKeyName) {
  4004. return hyphenate(eventKeyName) !== key
  4005. }
  4006. }
  4007. /* */
  4008. /**
  4009. * Runtime helper for merging v-bind="object" into a VNode's data.
  4010. */
  4011. function bindObjectProps (
  4012. data,
  4013. tag,
  4014. value,
  4015. asProp,
  4016. isSync
  4017. ) {
  4018. if (value) {
  4019. if (!isObject(value)) {
  4020. true && warn(
  4021. 'v-bind without argument expects an Object or Array value',
  4022. this
  4023. );
  4024. } else {
  4025. if (Array.isArray(value)) {
  4026. value = toObject(value);
  4027. }
  4028. var hash;
  4029. var loop = function ( key ) {
  4030. if (
  4031. key === 'class' ||
  4032. key === 'style' ||
  4033. isReservedAttribute(key)
  4034. ) {
  4035. hash = data;
  4036. } else {
  4037. var type = data.attrs && data.attrs.type;
  4038. hash = asProp || config.mustUseProp(tag, type, key)
  4039. ? data.domProps || (data.domProps = {})
  4040. : data.attrs || (data.attrs = {});
  4041. }
  4042. var camelizedKey = camelize(key);
  4043. var hyphenatedKey = hyphenate(key);
  4044. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4045. hash[key] = value[key];
  4046. if (isSync) {
  4047. var on = data.on || (data.on = {});
  4048. on[("update:" + key)] = function ($event) {
  4049. value[key] = $event;
  4050. };
  4051. }
  4052. }
  4053. };
  4054. for (var key in value) loop( key );
  4055. }
  4056. }
  4057. return data
  4058. }
  4059. /* */
  4060. /**
  4061. * Runtime helper for rendering static trees.
  4062. */
  4063. function renderStatic (
  4064. index,
  4065. isInFor
  4066. ) {
  4067. var cached = this._staticTrees || (this._staticTrees = []);
  4068. var tree = cached[index];
  4069. // if has already-rendered static tree and not inside v-for,
  4070. // we can reuse the same tree.
  4071. if (tree && !isInFor) {
  4072. return tree
  4073. }
  4074. // otherwise, render a fresh tree.
  4075. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4076. this._renderProxy,
  4077. null,
  4078. this // for render fns generated for functional component templates
  4079. );
  4080. markStatic(tree, ("__static__" + index), false);
  4081. return tree
  4082. }
  4083. /**
  4084. * Runtime helper for v-once.
  4085. * Effectively it means marking the node as static with a unique key.
  4086. */
  4087. function markOnce (
  4088. tree,
  4089. index,
  4090. key
  4091. ) {
  4092. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4093. return tree
  4094. }
  4095. function markStatic (
  4096. tree,
  4097. key,
  4098. isOnce
  4099. ) {
  4100. if (Array.isArray(tree)) {
  4101. for (var i = 0; i < tree.length; i++) {
  4102. if (tree[i] && typeof tree[i] !== 'string') {
  4103. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4104. }
  4105. }
  4106. } else {
  4107. markStaticNode(tree, key, isOnce);
  4108. }
  4109. }
  4110. function markStaticNode (node, key, isOnce) {
  4111. node.isStatic = true;
  4112. node.key = key;
  4113. node.isOnce = isOnce;
  4114. }
  4115. /* */
  4116. function bindObjectListeners (data, value) {
  4117. if (value) {
  4118. if (!isPlainObject(value)) {
  4119. true && warn(
  4120. 'v-on without argument expects an Object value',
  4121. this
  4122. );
  4123. } else {
  4124. var on = data.on = data.on ? extend({}, data.on) : {};
  4125. for (var key in value) {
  4126. var existing = on[key];
  4127. var ours = value[key];
  4128. on[key] = existing ? [].concat(existing, ours) : ours;
  4129. }
  4130. }
  4131. }
  4132. return data
  4133. }
  4134. /* */
  4135. function resolveScopedSlots (
  4136. fns, // see flow/vnode
  4137. res,
  4138. // the following are added in 2.6
  4139. hasDynamicKeys,
  4140. contentHashKey
  4141. ) {
  4142. res = res || { $stable: !hasDynamicKeys };
  4143. for (var i = 0; i < fns.length; i++) {
  4144. var slot = fns[i];
  4145. if (Array.isArray(slot)) {
  4146. resolveScopedSlots(slot, res, hasDynamicKeys);
  4147. } else if (slot) {
  4148. // marker for reverse proxying v-slot without scope on this.$slots
  4149. if (slot.proxy) {
  4150. slot.fn.proxy = true;
  4151. }
  4152. res[slot.key] = slot.fn;
  4153. }
  4154. }
  4155. if (contentHashKey) {
  4156. (res).$key = contentHashKey;
  4157. }
  4158. return res
  4159. }
  4160. /* */
  4161. function bindDynamicKeys (baseObj, values) {
  4162. for (var i = 0; i < values.length; i += 2) {
  4163. var key = values[i];
  4164. if (typeof key === 'string' && key) {
  4165. baseObj[values[i]] = values[i + 1];
  4166. } else if ( true && key !== '' && key !== null) {
  4167. // null is a special value for explicitly removing a binding
  4168. warn(
  4169. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4170. this
  4171. );
  4172. }
  4173. }
  4174. return baseObj
  4175. }
  4176. // helper to dynamically append modifier runtime markers to event names.
  4177. // ensure only append when value is already string, otherwise it will be cast
  4178. // to string and cause the type check to miss.
  4179. function prependModifier (value, symbol) {
  4180. return typeof value === 'string' ? symbol + value : value
  4181. }
  4182. /* */
  4183. function installRenderHelpers (target) {
  4184. target._o = markOnce;
  4185. target._n = toNumber;
  4186. target._s = toString;
  4187. target._l = renderList;
  4188. target._t = renderSlot;
  4189. target._q = looseEqual;
  4190. target._i = looseIndexOf;
  4191. target._m = renderStatic;
  4192. target._f = resolveFilter;
  4193. target._k = checkKeyCodes;
  4194. target._b = bindObjectProps;
  4195. target._v = createTextVNode;
  4196. target._e = createEmptyVNode;
  4197. target._u = resolveScopedSlots;
  4198. target._g = bindObjectListeners;
  4199. target._d = bindDynamicKeys;
  4200. target._p = prependModifier;
  4201. }
  4202. /* */
  4203. function FunctionalRenderContext (
  4204. data,
  4205. props,
  4206. children,
  4207. parent,
  4208. Ctor
  4209. ) {
  4210. var this$1 = this;
  4211. var options = Ctor.options;
  4212. // ensure the createElement function in functional components
  4213. // gets a unique context - this is necessary for correct named slot check
  4214. var contextVm;
  4215. if (hasOwn(parent, '_uid')) {
  4216. contextVm = Object.create(parent);
  4217. // $flow-disable-line
  4218. contextVm._original = parent;
  4219. } else {
  4220. // the context vm passed in is a functional context as well.
  4221. // in this case we want to make sure we are able to get a hold to the
  4222. // real context instance.
  4223. contextVm = parent;
  4224. // $flow-disable-line
  4225. parent = parent._original;
  4226. }
  4227. var isCompiled = isTrue(options._compiled);
  4228. var needNormalization = !isCompiled;
  4229. this.data = data;
  4230. this.props = props;
  4231. this.children = children;
  4232. this.parent = parent;
  4233. this.listeners = data.on || emptyObject;
  4234. this.injections = resolveInject(options.inject, parent);
  4235. this.slots = function () {
  4236. if (!this$1.$slots) {
  4237. normalizeScopedSlots(
  4238. data.scopedSlots,
  4239. this$1.$slots = resolveSlots(children, parent)
  4240. );
  4241. }
  4242. return this$1.$slots
  4243. };
  4244. Object.defineProperty(this, 'scopedSlots', ({
  4245. enumerable: true,
  4246. get: function get () {
  4247. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4248. }
  4249. }));
  4250. // support for compiled functional template
  4251. if (isCompiled) {
  4252. // exposing $options for renderStatic()
  4253. this.$options = options;
  4254. // pre-resolve slots for renderSlot()
  4255. this.$slots = this.slots();
  4256. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4257. }
  4258. if (options._scopeId) {
  4259. this._c = function (a, b, c, d) {
  4260. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4261. if (vnode && !Array.isArray(vnode)) {
  4262. vnode.fnScopeId = options._scopeId;
  4263. vnode.fnContext = parent;
  4264. }
  4265. return vnode
  4266. };
  4267. } else {
  4268. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4269. }
  4270. }
  4271. installRenderHelpers(FunctionalRenderContext.prototype);
  4272. function createFunctionalComponent (
  4273. Ctor,
  4274. propsData,
  4275. data,
  4276. contextVm,
  4277. children
  4278. ) {
  4279. var options = Ctor.options;
  4280. var props = {};
  4281. var propOptions = options.props;
  4282. if (isDef(propOptions)) {
  4283. for (var key in propOptions) {
  4284. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4285. }
  4286. } else {
  4287. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4288. if (isDef(data.props)) { mergeProps(props, data.props); }
  4289. }
  4290. var renderContext = new FunctionalRenderContext(
  4291. data,
  4292. props,
  4293. children,
  4294. contextVm,
  4295. Ctor
  4296. );
  4297. var vnode = options.render.call(null, renderContext._c, renderContext);
  4298. if (vnode instanceof VNode) {
  4299. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4300. } else if (Array.isArray(vnode)) {
  4301. var vnodes = normalizeChildren(vnode) || [];
  4302. var res = new Array(vnodes.length);
  4303. for (var i = 0; i < vnodes.length; i++) {
  4304. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4305. }
  4306. return res
  4307. }
  4308. }
  4309. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4310. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4311. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4312. // that should not be matched to match.
  4313. var clone = cloneVNode(vnode);
  4314. clone.fnContext = contextVm;
  4315. clone.fnOptions = options;
  4316. if (true) {
  4317. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4318. }
  4319. if (data.slot) {
  4320. (clone.data || (clone.data = {})).slot = data.slot;
  4321. }
  4322. return clone
  4323. }
  4324. function mergeProps (to, from) {
  4325. for (var key in from) {
  4326. to[camelize(key)] = from[key];
  4327. }
  4328. }
  4329. /* */
  4330. /* */
  4331. /* */
  4332. /* */
  4333. // inline hooks to be invoked on component VNodes during patch
  4334. var componentVNodeHooks = {
  4335. init: function init (vnode, hydrating) {
  4336. if (
  4337. vnode.componentInstance &&
  4338. !vnode.componentInstance._isDestroyed &&
  4339. vnode.data.keepAlive
  4340. ) {
  4341. // kept-alive components, treat as a patch
  4342. var mountedNode = vnode; // work around flow
  4343. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4344. } else {
  4345. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4346. vnode,
  4347. activeInstance
  4348. );
  4349. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4350. }
  4351. },
  4352. prepatch: function prepatch (oldVnode, vnode) {
  4353. var options = vnode.componentOptions;
  4354. var child = vnode.componentInstance = oldVnode.componentInstance;
  4355. updateChildComponent(
  4356. child,
  4357. options.propsData, // updated props
  4358. options.listeners, // updated listeners
  4359. vnode, // new parent vnode
  4360. options.children // new children
  4361. );
  4362. },
  4363. insert: function insert (vnode) {
  4364. var context = vnode.context;
  4365. var componentInstance = vnode.componentInstance;
  4366. if (!componentInstance._isMounted) {
  4367. callHook(componentInstance, 'onServiceCreated');
  4368. callHook(componentInstance, 'onServiceAttached');
  4369. componentInstance._isMounted = true;
  4370. callHook(componentInstance, 'mounted');
  4371. }
  4372. if (vnode.data.keepAlive) {
  4373. if (context._isMounted) {
  4374. // vue-router#1212
  4375. // During updates, a kept-alive component's child components may
  4376. // change, so directly walking the tree here may call activated hooks
  4377. // on incorrect children. Instead we push them into a queue which will
  4378. // be processed after the whole patch process ended.
  4379. queueActivatedComponent(componentInstance);
  4380. } else {
  4381. activateChildComponent(componentInstance, true /* direct */);
  4382. }
  4383. }
  4384. },
  4385. destroy: function destroy (vnode) {
  4386. var componentInstance = vnode.componentInstance;
  4387. if (!componentInstance._isDestroyed) {
  4388. if (!vnode.data.keepAlive) {
  4389. componentInstance.$destroy();
  4390. } else {
  4391. deactivateChildComponent(componentInstance, true /* direct */);
  4392. }
  4393. }
  4394. }
  4395. };
  4396. var hooksToMerge = Object.keys(componentVNodeHooks);
  4397. function createComponent (
  4398. Ctor,
  4399. data,
  4400. context,
  4401. children,
  4402. tag
  4403. ) {
  4404. if (isUndef(Ctor)) {
  4405. return
  4406. }
  4407. var baseCtor = context.$options._base;
  4408. // plain options object: turn it into a constructor
  4409. if (isObject(Ctor)) {
  4410. Ctor = baseCtor.extend(Ctor);
  4411. }
  4412. // if at this stage it's not a constructor or an async component factory,
  4413. // reject.
  4414. if (typeof Ctor !== 'function') {
  4415. if (true) {
  4416. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4417. }
  4418. return
  4419. }
  4420. // async component
  4421. var asyncFactory;
  4422. if (isUndef(Ctor.cid)) {
  4423. asyncFactory = Ctor;
  4424. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4425. if (Ctor === undefined) {
  4426. // return a placeholder node for async component, which is rendered
  4427. // as a comment node but preserves all the raw information for the node.
  4428. // the information will be used for async server-rendering and hydration.
  4429. return createAsyncPlaceholder(
  4430. asyncFactory,
  4431. data,
  4432. context,
  4433. children,
  4434. tag
  4435. )
  4436. }
  4437. }
  4438. data = data || {};
  4439. // resolve constructor options in case global mixins are applied after
  4440. // component constructor creation
  4441. resolveConstructorOptions(Ctor);
  4442. // transform component v-model data into props & events
  4443. if (isDef(data.model)) {
  4444. transformModel(Ctor.options, data);
  4445. }
  4446. // extract props
  4447. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4448. // functional component
  4449. if (isTrue(Ctor.options.functional)) {
  4450. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4451. }
  4452. // extract listeners, since these needs to be treated as
  4453. // child component listeners instead of DOM listeners
  4454. var listeners = data.on;
  4455. // replace with listeners with .native modifier
  4456. // so it gets processed during parent component patch.
  4457. data.on = data.nativeOn;
  4458. if (isTrue(Ctor.options.abstract)) {
  4459. // abstract components do not keep anything
  4460. // other than props & listeners & slot
  4461. // work around flow
  4462. var slot = data.slot;
  4463. data = {};
  4464. if (slot) {
  4465. data.slot = slot;
  4466. }
  4467. }
  4468. // install component management hooks onto the placeholder node
  4469. installComponentHooks(data);
  4470. // return a placeholder vnode
  4471. var name = Ctor.options.name || tag;
  4472. var vnode = new VNode(
  4473. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4474. data, undefined, undefined, undefined, context,
  4475. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4476. asyncFactory
  4477. );
  4478. return vnode
  4479. }
  4480. function createComponentInstanceForVnode (
  4481. vnode, // we know it's MountedComponentVNode but flow doesn't
  4482. parent // activeInstance in lifecycle state
  4483. ) {
  4484. var options = {
  4485. _isComponent: true,
  4486. _parentVnode: vnode,
  4487. parent: parent
  4488. };
  4489. // check inline-template render functions
  4490. var inlineTemplate = vnode.data.inlineTemplate;
  4491. if (isDef(inlineTemplate)) {
  4492. options.render = inlineTemplate.render;
  4493. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4494. }
  4495. return new vnode.componentOptions.Ctor(options)
  4496. }
  4497. function installComponentHooks (data) {
  4498. var hooks = data.hook || (data.hook = {});
  4499. for (var i = 0; i < hooksToMerge.length; i++) {
  4500. var key = hooksToMerge[i];
  4501. var existing = hooks[key];
  4502. var toMerge = componentVNodeHooks[key];
  4503. if (existing !== toMerge && !(existing && existing._merged)) {
  4504. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4505. }
  4506. }
  4507. }
  4508. function mergeHook$1 (f1, f2) {
  4509. var merged = function (a, b) {
  4510. // flow complains about extra args which is why we use any
  4511. f1(a, b);
  4512. f2(a, b);
  4513. };
  4514. merged._merged = true;
  4515. return merged
  4516. }
  4517. // transform component v-model info (value and callback) into
  4518. // prop and event handler respectively.
  4519. function transformModel (options, data) {
  4520. var prop = (options.model && options.model.prop) || 'value';
  4521. var event = (options.model && options.model.event) || 'input'
  4522. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4523. var on = data.on || (data.on = {});
  4524. var existing = on[event];
  4525. var callback = data.model.callback;
  4526. if (isDef(existing)) {
  4527. if (
  4528. Array.isArray(existing)
  4529. ? existing.indexOf(callback) === -1
  4530. : existing !== callback
  4531. ) {
  4532. on[event] = [callback].concat(existing);
  4533. }
  4534. } else {
  4535. on[event] = callback;
  4536. }
  4537. }
  4538. /* */
  4539. var SIMPLE_NORMALIZE = 1;
  4540. var ALWAYS_NORMALIZE = 2;
  4541. // wrapper function for providing a more flexible interface
  4542. // without getting yelled at by flow
  4543. function createElement (
  4544. context,
  4545. tag,
  4546. data,
  4547. children,
  4548. normalizationType,
  4549. alwaysNormalize
  4550. ) {
  4551. if (Array.isArray(data) || isPrimitive(data)) {
  4552. normalizationType = children;
  4553. children = data;
  4554. data = undefined;
  4555. }
  4556. if (isTrue(alwaysNormalize)) {
  4557. normalizationType = ALWAYS_NORMALIZE;
  4558. }
  4559. return _createElement(context, tag, data, children, normalizationType)
  4560. }
  4561. function _createElement (
  4562. context,
  4563. tag,
  4564. data,
  4565. children,
  4566. normalizationType
  4567. ) {
  4568. if (isDef(data) && isDef((data).__ob__)) {
  4569. true && warn(
  4570. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4571. 'Always create fresh vnode data objects in each render!',
  4572. context
  4573. );
  4574. return createEmptyVNode()
  4575. }
  4576. // object syntax in v-bind
  4577. if (isDef(data) && isDef(data.is)) {
  4578. tag = data.is;
  4579. }
  4580. if (!tag) {
  4581. // in case of component :is set to falsy value
  4582. return createEmptyVNode()
  4583. }
  4584. // warn against non-primitive key
  4585. if ( true &&
  4586. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4587. ) {
  4588. {
  4589. warn(
  4590. 'Avoid using non-primitive value as key, ' +
  4591. 'use string/number value instead.',
  4592. context
  4593. );
  4594. }
  4595. }
  4596. // support single function children as default scoped slot
  4597. if (Array.isArray(children) &&
  4598. typeof children[0] === 'function'
  4599. ) {
  4600. data = data || {};
  4601. data.scopedSlots = { default: children[0] };
  4602. children.length = 0;
  4603. }
  4604. if (normalizationType === ALWAYS_NORMALIZE) {
  4605. children = normalizeChildren(children);
  4606. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4607. children = simpleNormalizeChildren(children);
  4608. }
  4609. var vnode, ns;
  4610. if (typeof tag === 'string') {
  4611. var Ctor;
  4612. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4613. if (config.isReservedTag(tag)) {
  4614. // platform built-in elements
  4615. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4616. warn(
  4617. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4618. context
  4619. );
  4620. }
  4621. vnode = new VNode(
  4622. config.parsePlatformTagName(tag), data, children,
  4623. undefined, undefined, context
  4624. );
  4625. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4626. // component
  4627. vnode = createComponent(Ctor, data, context, children, tag);
  4628. } else {
  4629. // unknown or unlisted namespaced elements
  4630. // check at runtime because it may get assigned a namespace when its
  4631. // parent normalizes children
  4632. vnode = new VNode(
  4633. tag, data, children,
  4634. undefined, undefined, context
  4635. );
  4636. }
  4637. } else {
  4638. // direct component options / constructor
  4639. vnode = createComponent(tag, data, context, children);
  4640. }
  4641. if (Array.isArray(vnode)) {
  4642. return vnode
  4643. } else if (isDef(vnode)) {
  4644. if (isDef(ns)) { applyNS(vnode, ns); }
  4645. if (isDef(data)) { registerDeepBindings(data); }
  4646. return vnode
  4647. } else {
  4648. return createEmptyVNode()
  4649. }
  4650. }
  4651. function applyNS (vnode, ns, force) {
  4652. vnode.ns = ns;
  4653. if (vnode.tag === 'foreignObject') {
  4654. // use default namespace inside foreignObject
  4655. ns = undefined;
  4656. force = true;
  4657. }
  4658. if (isDef(vnode.children)) {
  4659. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4660. var child = vnode.children[i];
  4661. if (isDef(child.tag) && (
  4662. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4663. applyNS(child, ns, force);
  4664. }
  4665. }
  4666. }
  4667. }
  4668. // ref #5318
  4669. // necessary to ensure parent re-render when deep bindings like :style and
  4670. // :class are used on slot nodes
  4671. function registerDeepBindings (data) {
  4672. if (isObject(data.style)) {
  4673. traverse(data.style);
  4674. }
  4675. if (isObject(data.class)) {
  4676. traverse(data.class);
  4677. }
  4678. }
  4679. /* */
  4680. function initRender (vm) {
  4681. vm._vnode = null; // the root of the child tree
  4682. vm._staticTrees = null; // v-once cached trees
  4683. var options = vm.$options;
  4684. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4685. var renderContext = parentVnode && parentVnode.context;
  4686. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4687. vm.$scopedSlots = emptyObject;
  4688. // bind the createElement fn to this instance
  4689. // so that we get proper render context inside it.
  4690. // args order: tag, data, children, normalizationType, alwaysNormalize
  4691. // internal version is used by render functions compiled from templates
  4692. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4693. // normalization is always applied for the public version, used in
  4694. // user-written render functions.
  4695. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4696. // $attrs & $listeners are exposed for easier HOC creation.
  4697. // they need to be reactive so that HOCs using them are always updated
  4698. var parentData = parentVnode && parentVnode.data;
  4699. /* istanbul ignore else */
  4700. if (true) {
  4701. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4702. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4703. }, true);
  4704. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4705. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4706. }, true);
  4707. } else {}
  4708. }
  4709. var currentRenderingInstance = null;
  4710. function renderMixin (Vue) {
  4711. // install runtime convenience helpers
  4712. installRenderHelpers(Vue.prototype);
  4713. Vue.prototype.$nextTick = function (fn) {
  4714. return nextTick(fn, this)
  4715. };
  4716. Vue.prototype._render = function () {
  4717. var vm = this;
  4718. var ref = vm.$options;
  4719. var render = ref.render;
  4720. var _parentVnode = ref._parentVnode;
  4721. if (_parentVnode) {
  4722. vm.$scopedSlots = normalizeScopedSlots(
  4723. _parentVnode.data.scopedSlots,
  4724. vm.$slots,
  4725. vm.$scopedSlots
  4726. );
  4727. }
  4728. // set parent vnode. this allows render functions to have access
  4729. // to the data on the placeholder node.
  4730. vm.$vnode = _parentVnode;
  4731. // render self
  4732. var vnode;
  4733. try {
  4734. // There's no need to maintain a stack because all render fns are called
  4735. // separately from one another. Nested component's render fns are called
  4736. // when parent component is patched.
  4737. currentRenderingInstance = vm;
  4738. vnode = render.call(vm._renderProxy, vm.$createElement);
  4739. } catch (e) {
  4740. handleError(e, vm, "render");
  4741. // return error render result,
  4742. // or previous vnode to prevent render error causing blank component
  4743. /* istanbul ignore else */
  4744. if ( true && vm.$options.renderError) {
  4745. try {
  4746. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4747. } catch (e) {
  4748. handleError(e, vm, "renderError");
  4749. vnode = vm._vnode;
  4750. }
  4751. } else {
  4752. vnode = vm._vnode;
  4753. }
  4754. } finally {
  4755. currentRenderingInstance = null;
  4756. }
  4757. // if the returned array contains only a single node, allow it
  4758. if (Array.isArray(vnode) && vnode.length === 1) {
  4759. vnode = vnode[0];
  4760. }
  4761. // return empty vnode in case the render function errored out
  4762. if (!(vnode instanceof VNode)) {
  4763. if ( true && Array.isArray(vnode)) {
  4764. warn(
  4765. 'Multiple root nodes returned from render function. Render function ' +
  4766. 'should return a single root node.',
  4767. vm
  4768. );
  4769. }
  4770. vnode = createEmptyVNode();
  4771. }
  4772. // set parent
  4773. vnode.parent = _parentVnode;
  4774. return vnode
  4775. };
  4776. }
  4777. /* */
  4778. function ensureCtor (comp, base) {
  4779. if (
  4780. comp.__esModule ||
  4781. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4782. ) {
  4783. comp = comp.default;
  4784. }
  4785. return isObject(comp)
  4786. ? base.extend(comp)
  4787. : comp
  4788. }
  4789. function createAsyncPlaceholder (
  4790. factory,
  4791. data,
  4792. context,
  4793. children,
  4794. tag
  4795. ) {
  4796. var node = createEmptyVNode();
  4797. node.asyncFactory = factory;
  4798. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4799. return node
  4800. }
  4801. function resolveAsyncComponent (
  4802. factory,
  4803. baseCtor
  4804. ) {
  4805. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  4806. return factory.errorComp
  4807. }
  4808. if (isDef(factory.resolved)) {
  4809. return factory.resolved
  4810. }
  4811. var owner = currentRenderingInstance;
  4812. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  4813. // already pending
  4814. factory.owners.push(owner);
  4815. }
  4816. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  4817. return factory.loadingComp
  4818. }
  4819. if (owner && !isDef(factory.owners)) {
  4820. var owners = factory.owners = [owner];
  4821. var sync = true;
  4822. var timerLoading = null;
  4823. var timerTimeout = null
  4824. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  4825. var forceRender = function (renderCompleted) {
  4826. for (var i = 0, l = owners.length; i < l; i++) {
  4827. (owners[i]).$forceUpdate();
  4828. }
  4829. if (renderCompleted) {
  4830. owners.length = 0;
  4831. if (timerLoading !== null) {
  4832. clearTimeout(timerLoading);
  4833. timerLoading = null;
  4834. }
  4835. if (timerTimeout !== null) {
  4836. clearTimeout(timerTimeout);
  4837. timerTimeout = null;
  4838. }
  4839. }
  4840. };
  4841. var resolve = once(function (res) {
  4842. // cache resolved
  4843. factory.resolved = ensureCtor(res, baseCtor);
  4844. // invoke callbacks only if this is not a synchronous resolve
  4845. // (async resolves are shimmed as synchronous during SSR)
  4846. if (!sync) {
  4847. forceRender(true);
  4848. } else {
  4849. owners.length = 0;
  4850. }
  4851. });
  4852. var reject = once(function (reason) {
  4853. true && warn(
  4854. "Failed to resolve async component: " + (String(factory)) +
  4855. (reason ? ("\nReason: " + reason) : '')
  4856. );
  4857. if (isDef(factory.errorComp)) {
  4858. factory.error = true;
  4859. forceRender(true);
  4860. }
  4861. });
  4862. var res = factory(resolve, reject);
  4863. if (isObject(res)) {
  4864. if (isPromise(res)) {
  4865. // () => Promise
  4866. if (isUndef(factory.resolved)) {
  4867. res.then(resolve, reject);
  4868. }
  4869. } else if (isPromise(res.component)) {
  4870. res.component.then(resolve, reject);
  4871. if (isDef(res.error)) {
  4872. factory.errorComp = ensureCtor(res.error, baseCtor);
  4873. }
  4874. if (isDef(res.loading)) {
  4875. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  4876. if (res.delay === 0) {
  4877. factory.loading = true;
  4878. } else {
  4879. timerLoading = setTimeout(function () {
  4880. timerLoading = null;
  4881. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  4882. factory.loading = true;
  4883. forceRender(false);
  4884. }
  4885. }, res.delay || 200);
  4886. }
  4887. }
  4888. if (isDef(res.timeout)) {
  4889. timerTimeout = setTimeout(function () {
  4890. timerTimeout = null;
  4891. if (isUndef(factory.resolved)) {
  4892. reject(
  4893. true
  4894. ? ("timeout (" + (res.timeout) + "ms)")
  4895. : undefined
  4896. );
  4897. }
  4898. }, res.timeout);
  4899. }
  4900. }
  4901. }
  4902. sync = false;
  4903. // return in case resolved synchronously
  4904. return factory.loading
  4905. ? factory.loadingComp
  4906. : factory.resolved
  4907. }
  4908. }
  4909. /* */
  4910. function isAsyncPlaceholder (node) {
  4911. return node.isComment && node.asyncFactory
  4912. }
  4913. /* */
  4914. function getFirstComponentChild (children) {
  4915. if (Array.isArray(children)) {
  4916. for (var i = 0; i < children.length; i++) {
  4917. var c = children[i];
  4918. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  4919. return c
  4920. }
  4921. }
  4922. }
  4923. }
  4924. /* */
  4925. /* */
  4926. function initEvents (vm) {
  4927. vm._events = Object.create(null);
  4928. vm._hasHookEvent = false;
  4929. // init parent attached events
  4930. var listeners = vm.$options._parentListeners;
  4931. if (listeners) {
  4932. updateComponentListeners(vm, listeners);
  4933. }
  4934. }
  4935. var target;
  4936. function add (event, fn) {
  4937. target.$on(event, fn);
  4938. }
  4939. function remove$1 (event, fn) {
  4940. target.$off(event, fn);
  4941. }
  4942. function createOnceHandler (event, fn) {
  4943. var _target = target;
  4944. return function onceHandler () {
  4945. var res = fn.apply(null, arguments);
  4946. if (res !== null) {
  4947. _target.$off(event, onceHandler);
  4948. }
  4949. }
  4950. }
  4951. function updateComponentListeners (
  4952. vm,
  4953. listeners,
  4954. oldListeners
  4955. ) {
  4956. target = vm;
  4957. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  4958. target = undefined;
  4959. }
  4960. function eventsMixin (Vue) {
  4961. var hookRE = /^hook:/;
  4962. Vue.prototype.$on = function (event, fn) {
  4963. var vm = this;
  4964. if (Array.isArray(event)) {
  4965. for (var i = 0, l = event.length; i < l; i++) {
  4966. vm.$on(event[i], fn);
  4967. }
  4968. } else {
  4969. (vm._events[event] || (vm._events[event] = [])).push(fn);
  4970. // optimize hook:event cost by using a boolean flag marked at registration
  4971. // instead of a hash lookup
  4972. if (hookRE.test(event)) {
  4973. vm._hasHookEvent = true;
  4974. }
  4975. }
  4976. return vm
  4977. };
  4978. Vue.prototype.$once = function (event, fn) {
  4979. var vm = this;
  4980. function on () {
  4981. vm.$off(event, on);
  4982. fn.apply(vm, arguments);
  4983. }
  4984. on.fn = fn;
  4985. vm.$on(event, on);
  4986. return vm
  4987. };
  4988. Vue.prototype.$off = function (event, fn) {
  4989. var vm = this;
  4990. // all
  4991. if (!arguments.length) {
  4992. vm._events = Object.create(null);
  4993. return vm
  4994. }
  4995. // array of events
  4996. if (Array.isArray(event)) {
  4997. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  4998. vm.$off(event[i$1], fn);
  4999. }
  5000. return vm
  5001. }
  5002. // specific event
  5003. var cbs = vm._events[event];
  5004. if (!cbs) {
  5005. return vm
  5006. }
  5007. if (!fn) {
  5008. vm._events[event] = null;
  5009. return vm
  5010. }
  5011. // specific handler
  5012. var cb;
  5013. var i = cbs.length;
  5014. while (i--) {
  5015. cb = cbs[i];
  5016. if (cb === fn || cb.fn === fn) {
  5017. cbs.splice(i, 1);
  5018. break
  5019. }
  5020. }
  5021. return vm
  5022. };
  5023. Vue.prototype.$emit = function (event) {
  5024. var vm = this;
  5025. if (true) {
  5026. var lowerCaseEvent = event.toLowerCase();
  5027. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5028. tip(
  5029. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5030. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5031. "Note that HTML attributes are case-insensitive and you cannot use " +
  5032. "v-on to listen to camelCase events when using in-DOM templates. " +
  5033. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5034. );
  5035. }
  5036. }
  5037. var cbs = vm._events[event];
  5038. if (cbs) {
  5039. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5040. var args = toArray(arguments, 1);
  5041. var info = "event handler for \"" + event + "\"";
  5042. for (var i = 0, l = cbs.length; i < l; i++) {
  5043. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5044. }
  5045. }
  5046. return vm
  5047. };
  5048. }
  5049. /* */
  5050. var activeInstance = null;
  5051. var isUpdatingChildComponent = false;
  5052. function setActiveInstance(vm) {
  5053. var prevActiveInstance = activeInstance;
  5054. activeInstance = vm;
  5055. return function () {
  5056. activeInstance = prevActiveInstance;
  5057. }
  5058. }
  5059. function initLifecycle (vm) {
  5060. var options = vm.$options;
  5061. // locate first non-abstract parent
  5062. var parent = options.parent;
  5063. if (parent && !options.abstract) {
  5064. while (parent.$options.abstract && parent.$parent) {
  5065. parent = parent.$parent;
  5066. }
  5067. parent.$children.push(vm);
  5068. }
  5069. vm.$parent = parent;
  5070. vm.$root = parent ? parent.$root : vm;
  5071. vm.$children = [];
  5072. vm.$refs = {};
  5073. vm._watcher = null;
  5074. vm._inactive = null;
  5075. vm._directInactive = false;
  5076. vm._isMounted = false;
  5077. vm._isDestroyed = false;
  5078. vm._isBeingDestroyed = false;
  5079. }
  5080. function lifecycleMixin (Vue) {
  5081. Vue.prototype._update = function (vnode, hydrating) {
  5082. var vm = this;
  5083. var prevEl = vm.$el;
  5084. var prevVnode = vm._vnode;
  5085. var restoreActiveInstance = setActiveInstance(vm);
  5086. vm._vnode = vnode;
  5087. // Vue.prototype.__patch__ is injected in entry points
  5088. // based on the rendering backend used.
  5089. if (!prevVnode) {
  5090. // initial render
  5091. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5092. } else {
  5093. // updates
  5094. vm.$el = vm.__patch__(prevVnode, vnode);
  5095. }
  5096. restoreActiveInstance();
  5097. // update __vue__ reference
  5098. if (prevEl) {
  5099. prevEl.__vue__ = null;
  5100. }
  5101. if (vm.$el) {
  5102. vm.$el.__vue__ = vm;
  5103. }
  5104. // if parent is an HOC, update its $el as well
  5105. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5106. vm.$parent.$el = vm.$el;
  5107. }
  5108. // updated hook is called by the scheduler to ensure that children are
  5109. // updated in a parent's updated hook.
  5110. };
  5111. Vue.prototype.$forceUpdate = function () {
  5112. var vm = this;
  5113. if (vm._watcher) {
  5114. vm._watcher.update();
  5115. }
  5116. };
  5117. Vue.prototype.$destroy = function () {
  5118. var vm = this;
  5119. if (vm._isBeingDestroyed) {
  5120. return
  5121. }
  5122. callHook(vm, 'beforeDestroy');
  5123. vm._isBeingDestroyed = true;
  5124. // remove self from parent
  5125. var parent = vm.$parent;
  5126. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5127. remove(parent.$children, vm);
  5128. }
  5129. // teardown watchers
  5130. if (vm._watcher) {
  5131. vm._watcher.teardown();
  5132. }
  5133. var i = vm._watchers.length;
  5134. while (i--) {
  5135. vm._watchers[i].teardown();
  5136. }
  5137. // remove reference from data ob
  5138. // frozen object may not have observer.
  5139. if (vm._data.__ob__) {
  5140. vm._data.__ob__.vmCount--;
  5141. }
  5142. // call the last hook...
  5143. vm._isDestroyed = true;
  5144. // invoke destroy hooks on current rendered tree
  5145. vm.__patch__(vm._vnode, null);
  5146. // fire destroyed hook
  5147. callHook(vm, 'destroyed');
  5148. // turn off all instance listeners.
  5149. vm.$off();
  5150. // remove __vue__ reference
  5151. if (vm.$el) {
  5152. vm.$el.__vue__ = null;
  5153. }
  5154. // release circular reference (#6759)
  5155. if (vm.$vnode) {
  5156. vm.$vnode.parent = null;
  5157. }
  5158. };
  5159. }
  5160. function updateChildComponent (
  5161. vm,
  5162. propsData,
  5163. listeners,
  5164. parentVnode,
  5165. renderChildren
  5166. ) {
  5167. if (true) {
  5168. isUpdatingChildComponent = true;
  5169. }
  5170. // determine whether component has slot children
  5171. // we need to do this before overwriting $options._renderChildren.
  5172. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5173. // dynamic slot names). Static scoped slots compiled from template has the
  5174. // "$stable" marker.
  5175. var newScopedSlots = parentVnode.data.scopedSlots;
  5176. var oldScopedSlots = vm.$scopedSlots;
  5177. var hasDynamicScopedSlot = !!(
  5178. (newScopedSlots && !newScopedSlots.$stable) ||
  5179. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5180. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5181. );
  5182. // Any static slot children from the parent may have changed during parent's
  5183. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5184. // update is necessary to ensure correctness.
  5185. var needsForceUpdate = !!(
  5186. renderChildren || // has new static slots
  5187. vm.$options._renderChildren || // has old static slots
  5188. hasDynamicScopedSlot
  5189. );
  5190. vm.$options._parentVnode = parentVnode;
  5191. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5192. if (vm._vnode) { // update child tree's parent
  5193. vm._vnode.parent = parentVnode;
  5194. }
  5195. vm.$options._renderChildren = renderChildren;
  5196. // update $attrs and $listeners hash
  5197. // these are also reactive so they may trigger child update if the child
  5198. // used them during render
  5199. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5200. vm.$listeners = listeners || emptyObject;
  5201. // update props
  5202. if (propsData && vm.$options.props) {
  5203. toggleObserving(false);
  5204. var props = vm._props;
  5205. var propKeys = vm.$options._propKeys || [];
  5206. for (var i = 0; i < propKeys.length; i++) {
  5207. var key = propKeys[i];
  5208. var propOptions = vm.$options.props; // wtf flow?
  5209. props[key] = validateProp(key, propOptions, propsData, vm);
  5210. }
  5211. toggleObserving(true);
  5212. // keep a copy of raw propsData
  5213. vm.$options.propsData = propsData;
  5214. }
  5215. // fixed by xxxxxx update properties(mp runtime)
  5216. vm._$updateProperties && vm._$updateProperties(vm);
  5217. // update listeners
  5218. listeners = listeners || emptyObject;
  5219. var oldListeners = vm.$options._parentListeners;
  5220. vm.$options._parentListeners = listeners;
  5221. updateComponentListeners(vm, listeners, oldListeners);
  5222. // resolve slots + force update if has children
  5223. if (needsForceUpdate) {
  5224. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5225. vm.$forceUpdate();
  5226. }
  5227. if (true) {
  5228. isUpdatingChildComponent = false;
  5229. }
  5230. }
  5231. function isInInactiveTree (vm) {
  5232. while (vm && (vm = vm.$parent)) {
  5233. if (vm._inactive) { return true }
  5234. }
  5235. return false
  5236. }
  5237. function activateChildComponent (vm, direct) {
  5238. if (direct) {
  5239. vm._directInactive = false;
  5240. if (isInInactiveTree(vm)) {
  5241. return
  5242. }
  5243. } else if (vm._directInactive) {
  5244. return
  5245. }
  5246. if (vm._inactive || vm._inactive === null) {
  5247. vm._inactive = false;
  5248. for (var i = 0; i < vm.$children.length; i++) {
  5249. activateChildComponent(vm.$children[i]);
  5250. }
  5251. callHook(vm, 'activated');
  5252. }
  5253. }
  5254. function deactivateChildComponent (vm, direct) {
  5255. if (direct) {
  5256. vm._directInactive = true;
  5257. if (isInInactiveTree(vm)) {
  5258. return
  5259. }
  5260. }
  5261. if (!vm._inactive) {
  5262. vm._inactive = true;
  5263. for (var i = 0; i < vm.$children.length; i++) {
  5264. deactivateChildComponent(vm.$children[i]);
  5265. }
  5266. callHook(vm, 'deactivated');
  5267. }
  5268. }
  5269. function callHook (vm, hook) {
  5270. // #7573 disable dep collection when invoking lifecycle hooks
  5271. pushTarget();
  5272. var handlers = vm.$options[hook];
  5273. var info = hook + " hook";
  5274. if (handlers) {
  5275. for (var i = 0, j = handlers.length; i < j; i++) {
  5276. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5277. }
  5278. }
  5279. if (vm._hasHookEvent) {
  5280. vm.$emit('hook:' + hook);
  5281. }
  5282. popTarget();
  5283. }
  5284. /* */
  5285. var MAX_UPDATE_COUNT = 100;
  5286. var queue = [];
  5287. var activatedChildren = [];
  5288. var has = {};
  5289. var circular = {};
  5290. var waiting = false;
  5291. var flushing = false;
  5292. var index = 0;
  5293. /**
  5294. * Reset the scheduler's state.
  5295. */
  5296. function resetSchedulerState () {
  5297. index = queue.length = activatedChildren.length = 0;
  5298. has = {};
  5299. if (true) {
  5300. circular = {};
  5301. }
  5302. waiting = flushing = false;
  5303. }
  5304. // Async edge case #6566 requires saving the timestamp when event listeners are
  5305. // attached. However, calling performance.now() has a perf overhead especially
  5306. // if the page has thousands of event listeners. Instead, we take a timestamp
  5307. // every time the scheduler flushes and use that for all event listeners
  5308. // attached during that flush.
  5309. var currentFlushTimestamp = 0;
  5310. // Async edge case fix requires storing an event listener's attach timestamp.
  5311. var getNow = Date.now;
  5312. // Determine what event timestamp the browser is using. Annoyingly, the
  5313. // timestamp can either be hi-res (relative to page load) or low-res
  5314. // (relative to UNIX epoch), so in order to compare time we have to use the
  5315. // same timestamp type when saving the flush timestamp.
  5316. // All IE versions use low-res event timestamps, and have problematic clock
  5317. // implementations (#9632)
  5318. if (inBrowser && !isIE) {
  5319. var performance = window.performance;
  5320. if (
  5321. performance &&
  5322. typeof performance.now === 'function' &&
  5323. getNow() > document.createEvent('Event').timeStamp
  5324. ) {
  5325. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5326. // smaller than it, it means the event is using a hi-res timestamp,
  5327. // and we need to use the hi-res version for event listener timestamps as
  5328. // well.
  5329. getNow = function () { return performance.now(); };
  5330. }
  5331. }
  5332. /**
  5333. * Flush both queues and run the watchers.
  5334. */
  5335. function flushSchedulerQueue () {
  5336. currentFlushTimestamp = getNow();
  5337. flushing = true;
  5338. var watcher, id;
  5339. // Sort queue before flush.
  5340. // This ensures that:
  5341. // 1. Components are updated from parent to child. (because parent is always
  5342. // created before the child)
  5343. // 2. A component's user watchers are run before its render watcher (because
  5344. // user watchers are created before the render watcher)
  5345. // 3. If a component is destroyed during a parent component's watcher run,
  5346. // its watchers can be skipped.
  5347. queue.sort(function (a, b) { return a.id - b.id; });
  5348. // do not cache length because more watchers might be pushed
  5349. // as we run existing watchers
  5350. for (index = 0; index < queue.length; index++) {
  5351. watcher = queue[index];
  5352. if (watcher.before) {
  5353. watcher.before();
  5354. }
  5355. id = watcher.id;
  5356. has[id] = null;
  5357. watcher.run();
  5358. // in dev build, check and stop circular updates.
  5359. if ( true && has[id] != null) {
  5360. circular[id] = (circular[id] || 0) + 1;
  5361. if (circular[id] > MAX_UPDATE_COUNT) {
  5362. warn(
  5363. 'You may have an infinite update loop ' + (
  5364. watcher.user
  5365. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5366. : "in a component render function."
  5367. ),
  5368. watcher.vm
  5369. );
  5370. break
  5371. }
  5372. }
  5373. }
  5374. // keep copies of post queues before resetting state
  5375. var activatedQueue = activatedChildren.slice();
  5376. var updatedQueue = queue.slice();
  5377. resetSchedulerState();
  5378. // call component updated and activated hooks
  5379. callActivatedHooks(activatedQueue);
  5380. callUpdatedHooks(updatedQueue);
  5381. // devtool hook
  5382. /* istanbul ignore if */
  5383. if (devtools && config.devtools) {
  5384. devtools.emit('flush');
  5385. }
  5386. }
  5387. function callUpdatedHooks (queue) {
  5388. var i = queue.length;
  5389. while (i--) {
  5390. var watcher = queue[i];
  5391. var vm = watcher.vm;
  5392. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5393. callHook(vm, 'updated');
  5394. }
  5395. }
  5396. }
  5397. /**
  5398. * Queue a kept-alive component that was activated during patch.
  5399. * The queue will be processed after the entire tree has been patched.
  5400. */
  5401. function queueActivatedComponent (vm) {
  5402. // setting _inactive to false here so that a render function can
  5403. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5404. vm._inactive = false;
  5405. activatedChildren.push(vm);
  5406. }
  5407. function callActivatedHooks (queue) {
  5408. for (var i = 0; i < queue.length; i++) {
  5409. queue[i]._inactive = true;
  5410. activateChildComponent(queue[i], true /* true */);
  5411. }
  5412. }
  5413. /**
  5414. * Push a watcher into the watcher queue.
  5415. * Jobs with duplicate IDs will be skipped unless it's
  5416. * pushed when the queue is being flushed.
  5417. */
  5418. function queueWatcher (watcher) {
  5419. var id = watcher.id;
  5420. if (has[id] == null) {
  5421. has[id] = true;
  5422. if (!flushing) {
  5423. queue.push(watcher);
  5424. } else {
  5425. // if already flushing, splice the watcher based on its id
  5426. // if already past its id, it will be run next immediately.
  5427. var i = queue.length - 1;
  5428. while (i > index && queue[i].id > watcher.id) {
  5429. i--;
  5430. }
  5431. queue.splice(i + 1, 0, watcher);
  5432. }
  5433. // queue the flush
  5434. if (!waiting) {
  5435. waiting = true;
  5436. if ( true && !config.async) {
  5437. flushSchedulerQueue();
  5438. return
  5439. }
  5440. nextTick(flushSchedulerQueue);
  5441. }
  5442. }
  5443. }
  5444. /* */
  5445. var uid$2 = 0;
  5446. /**
  5447. * A watcher parses an expression, collects dependencies,
  5448. * and fires callback when the expression value changes.
  5449. * This is used for both the $watch() api and directives.
  5450. */
  5451. var Watcher = function Watcher (
  5452. vm,
  5453. expOrFn,
  5454. cb,
  5455. options,
  5456. isRenderWatcher
  5457. ) {
  5458. this.vm = vm;
  5459. if (isRenderWatcher) {
  5460. vm._watcher = this;
  5461. }
  5462. vm._watchers.push(this);
  5463. // options
  5464. if (options) {
  5465. this.deep = !!options.deep;
  5466. this.user = !!options.user;
  5467. this.lazy = !!options.lazy;
  5468. this.sync = !!options.sync;
  5469. this.before = options.before;
  5470. } else {
  5471. this.deep = this.user = this.lazy = this.sync = false;
  5472. }
  5473. this.cb = cb;
  5474. this.id = ++uid$2; // uid for batching
  5475. this.active = true;
  5476. this.dirty = this.lazy; // for lazy watchers
  5477. this.deps = [];
  5478. this.newDeps = [];
  5479. this.depIds = new _Set();
  5480. this.newDepIds = new _Set();
  5481. this.expression = true
  5482. ? expOrFn.toString()
  5483. : undefined;
  5484. // parse expression for getter
  5485. if (typeof expOrFn === 'function') {
  5486. this.getter = expOrFn;
  5487. } else {
  5488. this.getter = parsePath(expOrFn);
  5489. if (!this.getter) {
  5490. this.getter = noop;
  5491. true && warn(
  5492. "Failed watching path: \"" + expOrFn + "\" " +
  5493. 'Watcher only accepts simple dot-delimited paths. ' +
  5494. 'For full control, use a function instead.',
  5495. vm
  5496. );
  5497. }
  5498. }
  5499. this.value = this.lazy
  5500. ? undefined
  5501. : this.get();
  5502. };
  5503. /**
  5504. * Evaluate the getter, and re-collect dependencies.
  5505. */
  5506. Watcher.prototype.get = function get () {
  5507. pushTarget(this);
  5508. var value;
  5509. var vm = this.vm;
  5510. try {
  5511. value = this.getter.call(vm, vm);
  5512. } catch (e) {
  5513. if (this.user) {
  5514. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5515. } else {
  5516. throw e
  5517. }
  5518. } finally {
  5519. // "touch" every property so they are all tracked as
  5520. // dependencies for deep watching
  5521. if (this.deep) {
  5522. traverse(value);
  5523. }
  5524. popTarget();
  5525. this.cleanupDeps();
  5526. }
  5527. return value
  5528. };
  5529. /**
  5530. * Add a dependency to this directive.
  5531. */
  5532. Watcher.prototype.addDep = function addDep (dep) {
  5533. var id = dep.id;
  5534. if (!this.newDepIds.has(id)) {
  5535. this.newDepIds.add(id);
  5536. this.newDeps.push(dep);
  5537. if (!this.depIds.has(id)) {
  5538. dep.addSub(this);
  5539. }
  5540. }
  5541. };
  5542. /**
  5543. * Clean up for dependency collection.
  5544. */
  5545. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5546. var i = this.deps.length;
  5547. while (i--) {
  5548. var dep = this.deps[i];
  5549. if (!this.newDepIds.has(dep.id)) {
  5550. dep.removeSub(this);
  5551. }
  5552. }
  5553. var tmp = this.depIds;
  5554. this.depIds = this.newDepIds;
  5555. this.newDepIds = tmp;
  5556. this.newDepIds.clear();
  5557. tmp = this.deps;
  5558. this.deps = this.newDeps;
  5559. this.newDeps = tmp;
  5560. this.newDeps.length = 0;
  5561. };
  5562. /**
  5563. * Subscriber interface.
  5564. * Will be called when a dependency changes.
  5565. */
  5566. Watcher.prototype.update = function update () {
  5567. /* istanbul ignore else */
  5568. if (this.lazy) {
  5569. this.dirty = true;
  5570. } else if (this.sync) {
  5571. this.run();
  5572. } else {
  5573. queueWatcher(this);
  5574. }
  5575. };
  5576. /**
  5577. * Scheduler job interface.
  5578. * Will be called by the scheduler.
  5579. */
  5580. Watcher.prototype.run = function run () {
  5581. if (this.active) {
  5582. var value = this.get();
  5583. if (
  5584. value !== this.value ||
  5585. // Deep watchers and watchers on Object/Arrays should fire even
  5586. // when the value is the same, because the value may
  5587. // have mutated.
  5588. isObject(value) ||
  5589. this.deep
  5590. ) {
  5591. // set new value
  5592. var oldValue = this.value;
  5593. this.value = value;
  5594. if (this.user) {
  5595. try {
  5596. this.cb.call(this.vm, value, oldValue);
  5597. } catch (e) {
  5598. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5599. }
  5600. } else {
  5601. this.cb.call(this.vm, value, oldValue);
  5602. }
  5603. }
  5604. }
  5605. };
  5606. /**
  5607. * Evaluate the value of the watcher.
  5608. * This only gets called for lazy watchers.
  5609. */
  5610. Watcher.prototype.evaluate = function evaluate () {
  5611. this.value = this.get();
  5612. this.dirty = false;
  5613. };
  5614. /**
  5615. * Depend on all deps collected by this watcher.
  5616. */
  5617. Watcher.prototype.depend = function depend () {
  5618. var i = this.deps.length;
  5619. while (i--) {
  5620. this.deps[i].depend();
  5621. }
  5622. };
  5623. /**
  5624. * Remove self from all dependencies' subscriber list.
  5625. */
  5626. Watcher.prototype.teardown = function teardown () {
  5627. if (this.active) {
  5628. // remove self from vm's watcher list
  5629. // this is a somewhat expensive operation so we skip it
  5630. // if the vm is being destroyed.
  5631. if (!this.vm._isBeingDestroyed) {
  5632. remove(this.vm._watchers, this);
  5633. }
  5634. var i = this.deps.length;
  5635. while (i--) {
  5636. this.deps[i].removeSub(this);
  5637. }
  5638. this.active = false;
  5639. }
  5640. };
  5641. /* */
  5642. var sharedPropertyDefinition = {
  5643. enumerable: true,
  5644. configurable: true,
  5645. get: noop,
  5646. set: noop
  5647. };
  5648. function proxy (target, sourceKey, key) {
  5649. sharedPropertyDefinition.get = function proxyGetter () {
  5650. return this[sourceKey][key]
  5651. };
  5652. sharedPropertyDefinition.set = function proxySetter (val) {
  5653. this[sourceKey][key] = val;
  5654. };
  5655. Object.defineProperty(target, key, sharedPropertyDefinition);
  5656. }
  5657. function initState (vm) {
  5658. vm._watchers = [];
  5659. var opts = vm.$options;
  5660. if (opts.props) { initProps(vm, opts.props); }
  5661. if (opts.methods) { initMethods(vm, opts.methods); }
  5662. if (opts.data) {
  5663. initData(vm);
  5664. } else {
  5665. observe(vm._data = {}, true /* asRootData */);
  5666. }
  5667. if (opts.computed) { initComputed(vm, opts.computed); }
  5668. if (opts.watch && opts.watch !== nativeWatch) {
  5669. initWatch(vm, opts.watch);
  5670. }
  5671. }
  5672. function initProps (vm, propsOptions) {
  5673. var propsData = vm.$options.propsData || {};
  5674. var props = vm._props = {};
  5675. // cache prop keys so that future props updates can iterate using Array
  5676. // instead of dynamic object key enumeration.
  5677. var keys = vm.$options._propKeys = [];
  5678. var isRoot = !vm.$parent;
  5679. // root instance props should be converted
  5680. if (!isRoot) {
  5681. toggleObserving(false);
  5682. }
  5683. var loop = function ( key ) {
  5684. keys.push(key);
  5685. var value = validateProp(key, propsOptions, propsData, vm);
  5686. /* istanbul ignore else */
  5687. if (true) {
  5688. var hyphenatedKey = hyphenate(key);
  5689. if (isReservedAttribute(hyphenatedKey) ||
  5690. config.isReservedAttr(hyphenatedKey)) {
  5691. warn(
  5692. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5693. vm
  5694. );
  5695. }
  5696. defineReactive$$1(props, key, value, function () {
  5697. if (!isRoot && !isUpdatingChildComponent) {
  5698. {
  5699. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5700. return
  5701. }
  5702. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5703. if(
  5704. key === 'value' &&
  5705. Array.isArray(vm.$options.behaviors) &&
  5706. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5707. ){
  5708. return
  5709. }
  5710. if(vm._getFormData){
  5711. return
  5712. }
  5713. var $parent = vm.$parent;
  5714. while($parent){
  5715. if($parent.__next_tick_pending){
  5716. return
  5717. }
  5718. $parent = $parent.$parent;
  5719. }
  5720. }
  5721. warn(
  5722. "Avoid mutating a prop directly since the value will be " +
  5723. "overwritten whenever the parent component re-renders. " +
  5724. "Instead, use a data or computed property based on the prop's " +
  5725. "value. Prop being mutated: \"" + key + "\"",
  5726. vm
  5727. );
  5728. }
  5729. });
  5730. } else {}
  5731. // static props are already proxied on the component's prototype
  5732. // during Vue.extend(). We only need to proxy props defined at
  5733. // instantiation here.
  5734. if (!(key in vm)) {
  5735. proxy(vm, "_props", key);
  5736. }
  5737. };
  5738. for (var key in propsOptions) loop( key );
  5739. toggleObserving(true);
  5740. }
  5741. function initData (vm) {
  5742. var data = vm.$options.data;
  5743. data = vm._data = typeof data === 'function'
  5744. ? getData(data, vm)
  5745. : data || {};
  5746. if (!isPlainObject(data)) {
  5747. data = {};
  5748. true && warn(
  5749. 'data functions should return an object:\n' +
  5750. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5751. vm
  5752. );
  5753. }
  5754. // proxy data on instance
  5755. var keys = Object.keys(data);
  5756. var props = vm.$options.props;
  5757. var methods = vm.$options.methods;
  5758. var i = keys.length;
  5759. while (i--) {
  5760. var key = keys[i];
  5761. if (true) {
  5762. if (methods && hasOwn(methods, key)) {
  5763. warn(
  5764. ("Method \"" + key + "\" has already been defined as a data property."),
  5765. vm
  5766. );
  5767. }
  5768. }
  5769. if (props && hasOwn(props, key)) {
  5770. true && warn(
  5771. "The data property \"" + key + "\" is already declared as a prop. " +
  5772. "Use prop default value instead.",
  5773. vm
  5774. );
  5775. } else if (!isReserved(key)) {
  5776. proxy(vm, "_data", key);
  5777. }
  5778. }
  5779. // observe data
  5780. observe(data, true /* asRootData */);
  5781. }
  5782. function getData (data, vm) {
  5783. // #7573 disable dep collection when invoking data getters
  5784. pushTarget();
  5785. try {
  5786. return data.call(vm, vm)
  5787. } catch (e) {
  5788. handleError(e, vm, "data()");
  5789. return {}
  5790. } finally {
  5791. popTarget();
  5792. }
  5793. }
  5794. var computedWatcherOptions = { lazy: true };
  5795. function initComputed (vm, computed) {
  5796. // $flow-disable-line
  5797. var watchers = vm._computedWatchers = Object.create(null);
  5798. // computed properties are just getters during SSR
  5799. var isSSR = isServerRendering();
  5800. for (var key in computed) {
  5801. var userDef = computed[key];
  5802. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  5803. if ( true && getter == null) {
  5804. warn(
  5805. ("Getter is missing for computed property \"" + key + "\"."),
  5806. vm
  5807. );
  5808. }
  5809. if (!isSSR) {
  5810. // create internal watcher for the computed property.
  5811. watchers[key] = new Watcher(
  5812. vm,
  5813. getter || noop,
  5814. noop,
  5815. computedWatcherOptions
  5816. );
  5817. }
  5818. // component-defined computed properties are already defined on the
  5819. // component prototype. We only need to define computed properties defined
  5820. // at instantiation here.
  5821. if (!(key in vm)) {
  5822. defineComputed(vm, key, userDef);
  5823. } else if (true) {
  5824. if (key in vm.$data) {
  5825. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  5826. } else if (vm.$options.props && key in vm.$options.props) {
  5827. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  5828. }
  5829. }
  5830. }
  5831. }
  5832. function defineComputed (
  5833. target,
  5834. key,
  5835. userDef
  5836. ) {
  5837. var shouldCache = !isServerRendering();
  5838. if (typeof userDef === 'function') {
  5839. sharedPropertyDefinition.get = shouldCache
  5840. ? createComputedGetter(key)
  5841. : createGetterInvoker(userDef);
  5842. sharedPropertyDefinition.set = noop;
  5843. } else {
  5844. sharedPropertyDefinition.get = userDef.get
  5845. ? shouldCache && userDef.cache !== false
  5846. ? createComputedGetter(key)
  5847. : createGetterInvoker(userDef.get)
  5848. : noop;
  5849. sharedPropertyDefinition.set = userDef.set || noop;
  5850. }
  5851. if ( true &&
  5852. sharedPropertyDefinition.set === noop) {
  5853. sharedPropertyDefinition.set = function () {
  5854. warn(
  5855. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  5856. this
  5857. );
  5858. };
  5859. }
  5860. Object.defineProperty(target, key, sharedPropertyDefinition);
  5861. }
  5862. function createComputedGetter (key) {
  5863. return function computedGetter () {
  5864. var watcher = this._computedWatchers && this._computedWatchers[key];
  5865. if (watcher) {
  5866. if (watcher.dirty) {
  5867. watcher.evaluate();
  5868. }
  5869. if (Dep.SharedObject.target) {// fixed by xxxxxx
  5870. watcher.depend();
  5871. }
  5872. return watcher.value
  5873. }
  5874. }
  5875. }
  5876. function createGetterInvoker(fn) {
  5877. return function computedGetter () {
  5878. return fn.call(this, this)
  5879. }
  5880. }
  5881. function initMethods (vm, methods) {
  5882. var props = vm.$options.props;
  5883. for (var key in methods) {
  5884. if (true) {
  5885. if (typeof methods[key] !== 'function') {
  5886. warn(
  5887. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  5888. "Did you reference the function correctly?",
  5889. vm
  5890. );
  5891. }
  5892. if (props && hasOwn(props, key)) {
  5893. warn(
  5894. ("Method \"" + key + "\" has already been defined as a prop."),
  5895. vm
  5896. );
  5897. }
  5898. if ((key in vm) && isReserved(key)) {
  5899. warn(
  5900. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  5901. "Avoid defining component methods that start with _ or $."
  5902. );
  5903. }
  5904. }
  5905. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5906. }
  5907. }
  5908. function initWatch (vm, watch) {
  5909. for (var key in watch) {
  5910. var handler = watch[key];
  5911. if (Array.isArray(handler)) {
  5912. for (var i = 0; i < handler.length; i++) {
  5913. createWatcher(vm, key, handler[i]);
  5914. }
  5915. } else {
  5916. createWatcher(vm, key, handler);
  5917. }
  5918. }
  5919. }
  5920. function createWatcher (
  5921. vm,
  5922. expOrFn,
  5923. handler,
  5924. options
  5925. ) {
  5926. if (isPlainObject(handler)) {
  5927. options = handler;
  5928. handler = handler.handler;
  5929. }
  5930. if (typeof handler === 'string') {
  5931. handler = vm[handler];
  5932. }
  5933. return vm.$watch(expOrFn, handler, options)
  5934. }
  5935. function stateMixin (Vue) {
  5936. // flow somehow has problems with directly declared definition object
  5937. // when using Object.defineProperty, so we have to procedurally build up
  5938. // the object here.
  5939. var dataDef = {};
  5940. dataDef.get = function () { return this._data };
  5941. var propsDef = {};
  5942. propsDef.get = function () { return this._props };
  5943. if (true) {
  5944. dataDef.set = function () {
  5945. warn(
  5946. 'Avoid replacing instance root $data. ' +
  5947. 'Use nested data properties instead.',
  5948. this
  5949. );
  5950. };
  5951. propsDef.set = function () {
  5952. warn("$props is readonly.", this);
  5953. };
  5954. }
  5955. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5956. Object.defineProperty(Vue.prototype, '$props', propsDef);
  5957. Vue.prototype.$set = set;
  5958. Vue.prototype.$delete = del;
  5959. Vue.prototype.$watch = function (
  5960. expOrFn,
  5961. cb,
  5962. options
  5963. ) {
  5964. var vm = this;
  5965. if (isPlainObject(cb)) {
  5966. return createWatcher(vm, expOrFn, cb, options)
  5967. }
  5968. options = options || {};
  5969. options.user = true;
  5970. var watcher = new Watcher(vm, expOrFn, cb, options);
  5971. if (options.immediate) {
  5972. try {
  5973. cb.call(vm, watcher.value);
  5974. } catch (error) {
  5975. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  5976. }
  5977. }
  5978. return function unwatchFn () {
  5979. watcher.teardown();
  5980. }
  5981. };
  5982. }
  5983. /* */
  5984. var uid$3 = 0;
  5985. function initMixin (Vue) {
  5986. Vue.prototype._init = function (options) {
  5987. var vm = this;
  5988. // a uid
  5989. vm._uid = uid$3++;
  5990. var startTag, endTag;
  5991. /* istanbul ignore if */
  5992. if ( true && config.performance && mark) {
  5993. startTag = "vue-perf-start:" + (vm._uid);
  5994. endTag = "vue-perf-end:" + (vm._uid);
  5995. mark(startTag);
  5996. }
  5997. // a flag to avoid this being observed
  5998. vm._isVue = true;
  5999. // merge options
  6000. if (options && options._isComponent) {
  6001. // optimize internal component instantiation
  6002. // since dynamic options merging is pretty slow, and none of the
  6003. // internal component options needs special treatment.
  6004. initInternalComponent(vm, options);
  6005. } else {
  6006. vm.$options = mergeOptions(
  6007. resolveConstructorOptions(vm.constructor),
  6008. options || {},
  6009. vm
  6010. );
  6011. }
  6012. /* istanbul ignore else */
  6013. if (true) {
  6014. initProxy(vm);
  6015. } else {}
  6016. // expose real self
  6017. vm._self = vm;
  6018. initLifecycle(vm);
  6019. initEvents(vm);
  6020. initRender(vm);
  6021. callHook(vm, 'beforeCreate');
  6022. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6023. initState(vm);
  6024. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6025. !vm._$fallback && callHook(vm, 'created');
  6026. /* istanbul ignore if */
  6027. if ( true && config.performance && mark) {
  6028. vm._name = formatComponentName(vm, false);
  6029. mark(endTag);
  6030. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6031. }
  6032. if (vm.$options.el) {
  6033. vm.$mount(vm.$options.el);
  6034. }
  6035. };
  6036. }
  6037. function initInternalComponent (vm, options) {
  6038. var opts = vm.$options = Object.create(vm.constructor.options);
  6039. // doing this because it's faster than dynamic enumeration.
  6040. var parentVnode = options._parentVnode;
  6041. opts.parent = options.parent;
  6042. opts._parentVnode = parentVnode;
  6043. var vnodeComponentOptions = parentVnode.componentOptions;
  6044. opts.propsData = vnodeComponentOptions.propsData;
  6045. opts._parentListeners = vnodeComponentOptions.listeners;
  6046. opts._renderChildren = vnodeComponentOptions.children;
  6047. opts._componentTag = vnodeComponentOptions.tag;
  6048. if (options.render) {
  6049. opts.render = options.render;
  6050. opts.staticRenderFns = options.staticRenderFns;
  6051. }
  6052. }
  6053. function resolveConstructorOptions (Ctor) {
  6054. var options = Ctor.options;
  6055. if (Ctor.super) {
  6056. var superOptions = resolveConstructorOptions(Ctor.super);
  6057. var cachedSuperOptions = Ctor.superOptions;
  6058. if (superOptions !== cachedSuperOptions) {
  6059. // super option changed,
  6060. // need to resolve new options.
  6061. Ctor.superOptions = superOptions;
  6062. // check if there are any late-modified/attached options (#4976)
  6063. var modifiedOptions = resolveModifiedOptions(Ctor);
  6064. // update base extend options
  6065. if (modifiedOptions) {
  6066. extend(Ctor.extendOptions, modifiedOptions);
  6067. }
  6068. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6069. if (options.name) {
  6070. options.components[options.name] = Ctor;
  6071. }
  6072. }
  6073. }
  6074. return options
  6075. }
  6076. function resolveModifiedOptions (Ctor) {
  6077. var modified;
  6078. var latest = Ctor.options;
  6079. var sealed = Ctor.sealedOptions;
  6080. for (var key in latest) {
  6081. if (latest[key] !== sealed[key]) {
  6082. if (!modified) { modified = {}; }
  6083. modified[key] = latest[key];
  6084. }
  6085. }
  6086. return modified
  6087. }
  6088. function Vue (options) {
  6089. if ( true &&
  6090. !(this instanceof Vue)
  6091. ) {
  6092. warn('Vue is a constructor and should be called with the `new` keyword');
  6093. }
  6094. this._init(options);
  6095. }
  6096. initMixin(Vue);
  6097. stateMixin(Vue);
  6098. eventsMixin(Vue);
  6099. lifecycleMixin(Vue);
  6100. renderMixin(Vue);
  6101. /* */
  6102. function initUse (Vue) {
  6103. Vue.use = function (plugin) {
  6104. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6105. if (installedPlugins.indexOf(plugin) > -1) {
  6106. return this
  6107. }
  6108. // additional parameters
  6109. var args = toArray(arguments, 1);
  6110. args.unshift(this);
  6111. if (typeof plugin.install === 'function') {
  6112. plugin.install.apply(plugin, args);
  6113. } else if (typeof plugin === 'function') {
  6114. plugin.apply(null, args);
  6115. }
  6116. installedPlugins.push(plugin);
  6117. return this
  6118. };
  6119. }
  6120. /* */
  6121. function initMixin$1 (Vue) {
  6122. Vue.mixin = function (mixin) {
  6123. this.options = mergeOptions(this.options, mixin);
  6124. return this
  6125. };
  6126. }
  6127. /* */
  6128. function initExtend (Vue) {
  6129. /**
  6130. * Each instance constructor, including Vue, has a unique
  6131. * cid. This enables us to create wrapped "child
  6132. * constructors" for prototypal inheritance and cache them.
  6133. */
  6134. Vue.cid = 0;
  6135. var cid = 1;
  6136. /**
  6137. * Class inheritance
  6138. */
  6139. Vue.extend = function (extendOptions) {
  6140. extendOptions = extendOptions || {};
  6141. var Super = this;
  6142. var SuperId = Super.cid;
  6143. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6144. if (cachedCtors[SuperId]) {
  6145. return cachedCtors[SuperId]
  6146. }
  6147. var name = extendOptions.name || Super.options.name;
  6148. if ( true && name) {
  6149. validateComponentName(name);
  6150. }
  6151. var Sub = function VueComponent (options) {
  6152. this._init(options);
  6153. };
  6154. Sub.prototype = Object.create(Super.prototype);
  6155. Sub.prototype.constructor = Sub;
  6156. Sub.cid = cid++;
  6157. Sub.options = mergeOptions(
  6158. Super.options,
  6159. extendOptions
  6160. );
  6161. Sub['super'] = Super;
  6162. // For props and computed properties, we define the proxy getters on
  6163. // the Vue instances at extension time, on the extended prototype. This
  6164. // avoids Object.defineProperty calls for each instance created.
  6165. if (Sub.options.props) {
  6166. initProps$1(Sub);
  6167. }
  6168. if (Sub.options.computed) {
  6169. initComputed$1(Sub);
  6170. }
  6171. // allow further extension/mixin/plugin usage
  6172. Sub.extend = Super.extend;
  6173. Sub.mixin = Super.mixin;
  6174. Sub.use = Super.use;
  6175. // create asset registers, so extended classes
  6176. // can have their private assets too.
  6177. ASSET_TYPES.forEach(function (type) {
  6178. Sub[type] = Super[type];
  6179. });
  6180. // enable recursive self-lookup
  6181. if (name) {
  6182. Sub.options.components[name] = Sub;
  6183. }
  6184. // keep a reference to the super options at extension time.
  6185. // later at instantiation we can check if Super's options have
  6186. // been updated.
  6187. Sub.superOptions = Super.options;
  6188. Sub.extendOptions = extendOptions;
  6189. Sub.sealedOptions = extend({}, Sub.options);
  6190. // cache constructor
  6191. cachedCtors[SuperId] = Sub;
  6192. return Sub
  6193. };
  6194. }
  6195. function initProps$1 (Comp) {
  6196. var props = Comp.options.props;
  6197. for (var key in props) {
  6198. proxy(Comp.prototype, "_props", key);
  6199. }
  6200. }
  6201. function initComputed$1 (Comp) {
  6202. var computed = Comp.options.computed;
  6203. for (var key in computed) {
  6204. defineComputed(Comp.prototype, key, computed[key]);
  6205. }
  6206. }
  6207. /* */
  6208. function initAssetRegisters (Vue) {
  6209. /**
  6210. * Create asset registration methods.
  6211. */
  6212. ASSET_TYPES.forEach(function (type) {
  6213. Vue[type] = function (
  6214. id,
  6215. definition
  6216. ) {
  6217. if (!definition) {
  6218. return this.options[type + 's'][id]
  6219. } else {
  6220. /* istanbul ignore if */
  6221. if ( true && type === 'component') {
  6222. validateComponentName(id);
  6223. }
  6224. if (type === 'component' && isPlainObject(definition)) {
  6225. definition.name = definition.name || id;
  6226. definition = this.options._base.extend(definition);
  6227. }
  6228. if (type === 'directive' && typeof definition === 'function') {
  6229. definition = { bind: definition, update: definition };
  6230. }
  6231. this.options[type + 's'][id] = definition;
  6232. return definition
  6233. }
  6234. };
  6235. });
  6236. }
  6237. /* */
  6238. function getComponentName (opts) {
  6239. return opts && (opts.Ctor.options.name || opts.tag)
  6240. }
  6241. function matches (pattern, name) {
  6242. if (Array.isArray(pattern)) {
  6243. return pattern.indexOf(name) > -1
  6244. } else if (typeof pattern === 'string') {
  6245. return pattern.split(',').indexOf(name) > -1
  6246. } else if (isRegExp(pattern)) {
  6247. return pattern.test(name)
  6248. }
  6249. /* istanbul ignore next */
  6250. return false
  6251. }
  6252. function pruneCache (keepAliveInstance, filter) {
  6253. var cache = keepAliveInstance.cache;
  6254. var keys = keepAliveInstance.keys;
  6255. var _vnode = keepAliveInstance._vnode;
  6256. for (var key in cache) {
  6257. var cachedNode = cache[key];
  6258. if (cachedNode) {
  6259. var name = getComponentName(cachedNode.componentOptions);
  6260. if (name && !filter(name)) {
  6261. pruneCacheEntry(cache, key, keys, _vnode);
  6262. }
  6263. }
  6264. }
  6265. }
  6266. function pruneCacheEntry (
  6267. cache,
  6268. key,
  6269. keys,
  6270. current
  6271. ) {
  6272. var cached$$1 = cache[key];
  6273. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6274. cached$$1.componentInstance.$destroy();
  6275. }
  6276. cache[key] = null;
  6277. remove(keys, key);
  6278. }
  6279. var patternTypes = [String, RegExp, Array];
  6280. var KeepAlive = {
  6281. name: 'keep-alive',
  6282. abstract: true,
  6283. props: {
  6284. include: patternTypes,
  6285. exclude: patternTypes,
  6286. max: [String, Number]
  6287. },
  6288. created: function created () {
  6289. this.cache = Object.create(null);
  6290. this.keys = [];
  6291. },
  6292. destroyed: function destroyed () {
  6293. for (var key in this.cache) {
  6294. pruneCacheEntry(this.cache, key, this.keys);
  6295. }
  6296. },
  6297. mounted: function mounted () {
  6298. var this$1 = this;
  6299. this.$watch('include', function (val) {
  6300. pruneCache(this$1, function (name) { return matches(val, name); });
  6301. });
  6302. this.$watch('exclude', function (val) {
  6303. pruneCache(this$1, function (name) { return !matches(val, name); });
  6304. });
  6305. },
  6306. render: function render () {
  6307. var slot = this.$slots.default;
  6308. var vnode = getFirstComponentChild(slot);
  6309. var componentOptions = vnode && vnode.componentOptions;
  6310. if (componentOptions) {
  6311. // check pattern
  6312. var name = getComponentName(componentOptions);
  6313. var ref = this;
  6314. var include = ref.include;
  6315. var exclude = ref.exclude;
  6316. if (
  6317. // not included
  6318. (include && (!name || !matches(include, name))) ||
  6319. // excluded
  6320. (exclude && name && matches(exclude, name))
  6321. ) {
  6322. return vnode
  6323. }
  6324. var ref$1 = this;
  6325. var cache = ref$1.cache;
  6326. var keys = ref$1.keys;
  6327. var key = vnode.key == null
  6328. // same constructor may get registered as different local components
  6329. // so cid alone is not enough (#3269)
  6330. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6331. : vnode.key;
  6332. if (cache[key]) {
  6333. vnode.componentInstance = cache[key].componentInstance;
  6334. // make current key freshest
  6335. remove(keys, key);
  6336. keys.push(key);
  6337. } else {
  6338. cache[key] = vnode;
  6339. keys.push(key);
  6340. // prune oldest entry
  6341. if (this.max && keys.length > parseInt(this.max)) {
  6342. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6343. }
  6344. }
  6345. vnode.data.keepAlive = true;
  6346. }
  6347. return vnode || (slot && slot[0])
  6348. }
  6349. };
  6350. var builtInComponents = {
  6351. KeepAlive: KeepAlive
  6352. };
  6353. /* */
  6354. function initGlobalAPI (Vue) {
  6355. // config
  6356. var configDef = {};
  6357. configDef.get = function () { return config; };
  6358. if (true) {
  6359. configDef.set = function () {
  6360. warn(
  6361. 'Do not replace the Vue.config object, set individual fields instead.'
  6362. );
  6363. };
  6364. }
  6365. Object.defineProperty(Vue, 'config', configDef);
  6366. // exposed util methods.
  6367. // NOTE: these are not considered part of the public API - avoid relying on
  6368. // them unless you are aware of the risk.
  6369. Vue.util = {
  6370. warn: warn,
  6371. extend: extend,
  6372. mergeOptions: mergeOptions,
  6373. defineReactive: defineReactive$$1
  6374. };
  6375. Vue.set = set;
  6376. Vue.delete = del;
  6377. Vue.nextTick = nextTick;
  6378. // 2.6 explicit observable API
  6379. Vue.observable = function (obj) {
  6380. observe(obj);
  6381. return obj
  6382. };
  6383. Vue.options = Object.create(null);
  6384. ASSET_TYPES.forEach(function (type) {
  6385. Vue.options[type + 's'] = Object.create(null);
  6386. });
  6387. // this is used to identify the "base" constructor to extend all plain-object
  6388. // components with in Weex's multi-instance scenarios.
  6389. Vue.options._base = Vue;
  6390. extend(Vue.options.components, builtInComponents);
  6391. initUse(Vue);
  6392. initMixin$1(Vue);
  6393. initExtend(Vue);
  6394. initAssetRegisters(Vue);
  6395. }
  6396. initGlobalAPI(Vue);
  6397. Object.defineProperty(Vue.prototype, '$isServer', {
  6398. get: isServerRendering
  6399. });
  6400. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6401. get: function get () {
  6402. /* istanbul ignore next */
  6403. return this.$vnode && this.$vnode.ssrContext
  6404. }
  6405. });
  6406. // expose FunctionalRenderContext for ssr runtime helper installation
  6407. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6408. value: FunctionalRenderContext
  6409. });
  6410. Vue.version = '2.6.11';
  6411. /**
  6412. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6413. */
  6414. var ARRAYTYPE = '[object Array]';
  6415. var OBJECTTYPE = '[object Object]';
  6416. // const FUNCTIONTYPE = '[object Function]'
  6417. function diff(current, pre) {
  6418. var result = {};
  6419. syncKeys(current, pre);
  6420. _diff(current, pre, '', result);
  6421. return result
  6422. }
  6423. function syncKeys(current, pre) {
  6424. if (current === pre) { return }
  6425. var rootCurrentType = type(current);
  6426. var rootPreType = type(pre);
  6427. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6428. if(Object.keys(current).length >= Object.keys(pre).length){
  6429. for (var key in pre) {
  6430. var currentValue = current[key];
  6431. if (currentValue === undefined) {
  6432. current[key] = null;
  6433. } else {
  6434. syncKeys(currentValue, pre[key]);
  6435. }
  6436. }
  6437. }
  6438. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6439. if (current.length >= pre.length) {
  6440. pre.forEach(function (item, index) {
  6441. syncKeys(current[index], item);
  6442. });
  6443. }
  6444. }
  6445. }
  6446. function _diff(current, pre, path, result) {
  6447. if (current === pre) { return }
  6448. var rootCurrentType = type(current);
  6449. var rootPreType = type(pre);
  6450. if (rootCurrentType == OBJECTTYPE) {
  6451. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6452. setResult(result, path, current);
  6453. } else {
  6454. var loop = function ( key ) {
  6455. var currentValue = current[key];
  6456. var preValue = pre[key];
  6457. var currentType = type(currentValue);
  6458. var preType = type(preValue);
  6459. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6460. if (currentValue != pre[key]) {
  6461. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6462. }
  6463. } else if (currentType == ARRAYTYPE) {
  6464. if (preType != ARRAYTYPE) {
  6465. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6466. } else {
  6467. if (currentValue.length < preValue.length) {
  6468. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6469. } else {
  6470. currentValue.forEach(function (item, index) {
  6471. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6472. });
  6473. }
  6474. }
  6475. } else if (currentType == OBJECTTYPE) {
  6476. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6477. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6478. } else {
  6479. for (var subKey in currentValue) {
  6480. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6481. }
  6482. }
  6483. }
  6484. };
  6485. for (var key in current) loop( key );
  6486. }
  6487. } else if (rootCurrentType == ARRAYTYPE) {
  6488. if (rootPreType != ARRAYTYPE) {
  6489. setResult(result, path, current);
  6490. } else {
  6491. if (current.length < pre.length) {
  6492. setResult(result, path, current);
  6493. } else {
  6494. current.forEach(function (item, index) {
  6495. _diff(item, pre[index], path + '[' + index + ']', result);
  6496. });
  6497. }
  6498. }
  6499. } else {
  6500. setResult(result, path, current);
  6501. }
  6502. }
  6503. function setResult(result, k, v) {
  6504. // if (type(v) != FUNCTIONTYPE) {
  6505. result[k] = v;
  6506. // }
  6507. }
  6508. function type(obj) {
  6509. return Object.prototype.toString.call(obj)
  6510. }
  6511. /* */
  6512. function flushCallbacks$1(vm) {
  6513. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6514. if (Object({"VUE_APP_NAME":"sqxp-uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6515. var mpInstance = vm.$scope;
  6516. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6517. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6518. }
  6519. var copies = vm.__next_tick_callbacks.slice(0);
  6520. vm.__next_tick_callbacks.length = 0;
  6521. for (var i = 0; i < copies.length; i++) {
  6522. copies[i]();
  6523. }
  6524. }
  6525. }
  6526. function hasRenderWatcher(vm) {
  6527. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6528. }
  6529. function nextTick$1(vm, cb) {
  6530. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6531. //2.nextTick 之前存在 render watcher
  6532. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6533. if(Object({"VUE_APP_NAME":"sqxp-uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6534. var mpInstance = vm.$scope;
  6535. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6536. ']:nextVueTick');
  6537. }
  6538. return nextTick(cb, vm)
  6539. }else{
  6540. if(Object({"VUE_APP_NAME":"sqxp-uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6541. var mpInstance$1 = vm.$scope;
  6542. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6543. ']:nextMPTick');
  6544. }
  6545. }
  6546. var _resolve;
  6547. if (!vm.__next_tick_callbacks) {
  6548. vm.__next_tick_callbacks = [];
  6549. }
  6550. vm.__next_tick_callbacks.push(function () {
  6551. if (cb) {
  6552. try {
  6553. cb.call(vm);
  6554. } catch (e) {
  6555. handleError(e, vm, 'nextTick');
  6556. }
  6557. } else if (_resolve) {
  6558. _resolve(vm);
  6559. }
  6560. });
  6561. // $flow-disable-line
  6562. if (!cb && typeof Promise !== 'undefined') {
  6563. return new Promise(function (resolve) {
  6564. _resolve = resolve;
  6565. })
  6566. }
  6567. }
  6568. /* */
  6569. function cloneWithData(vm) {
  6570. // 确保当前 vm 所有数据被同步
  6571. var ret = Object.create(null);
  6572. var dataKeys = [].concat(
  6573. Object.keys(vm._data || {}),
  6574. Object.keys(vm._computedWatchers || {}));
  6575. dataKeys.reduce(function(ret, key) {
  6576. ret[key] = vm[key];
  6577. return ret
  6578. }, ret);
  6579. // vue-composition-api
  6580. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6581. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6582. if (rawBindings) {
  6583. Object.keys(rawBindings).forEach(function (key) {
  6584. ret[key] = vm[key];
  6585. });
  6586. }
  6587. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6588. Object.assign(ret, vm.$mp.data || {});
  6589. if (
  6590. Array.isArray(vm.$options.behaviors) &&
  6591. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6592. ) { //form-field
  6593. ret['name'] = vm.name;
  6594. ret['value'] = vm.value;
  6595. }
  6596. return JSON.parse(JSON.stringify(ret))
  6597. }
  6598. var patch = function(oldVnode, vnode) {
  6599. var this$1 = this;
  6600. if (vnode === null) { //destroy
  6601. return
  6602. }
  6603. if (this.mpType === 'page' || this.mpType === 'component') {
  6604. var mpInstance = this.$scope;
  6605. var data = Object.create(null);
  6606. try {
  6607. data = cloneWithData(this);
  6608. } catch (err) {
  6609. console.error(err);
  6610. }
  6611. data.__webviewId__ = mpInstance.data.__webviewId__;
  6612. var mpData = Object.create(null);
  6613. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6614. mpData[key] = mpInstance.data[key];
  6615. });
  6616. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6617. if (Object.keys(diffData).length) {
  6618. if (Object({"VUE_APP_NAME":"sqxp-uniapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6619. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6620. ']差量更新',
  6621. JSON.stringify(diffData));
  6622. }
  6623. this.__next_tick_pending = true;
  6624. mpInstance.setData(diffData, function () {
  6625. this$1.__next_tick_pending = false;
  6626. flushCallbacks$1(this$1);
  6627. });
  6628. } else {
  6629. flushCallbacks$1(this);
  6630. }
  6631. }
  6632. };
  6633. /* */
  6634. function createEmptyRender() {
  6635. }
  6636. function mountComponent$1(
  6637. vm,
  6638. el,
  6639. hydrating
  6640. ) {
  6641. if (!vm.mpType) {//main.js 中的 new Vue
  6642. return vm
  6643. }
  6644. if (vm.mpType === 'app') {
  6645. vm.$options.render = createEmptyRender;
  6646. }
  6647. if (!vm.$options.render) {
  6648. vm.$options.render = createEmptyRender;
  6649. if (true) {
  6650. /* istanbul ignore if */
  6651. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6652. vm.$options.el || el) {
  6653. warn(
  6654. 'You are using the runtime-only build of Vue where the template ' +
  6655. 'compiler is not available. Either pre-compile the templates into ' +
  6656. 'render functions, or use the compiler-included build.',
  6657. vm
  6658. );
  6659. } else {
  6660. warn(
  6661. 'Failed to mount component: template or render function not defined.',
  6662. vm
  6663. );
  6664. }
  6665. }
  6666. }
  6667. !vm._$fallback && callHook(vm, 'beforeMount');
  6668. var updateComponent = function () {
  6669. vm._update(vm._render(), hydrating);
  6670. };
  6671. // we set this to vm._watcher inside the watcher's constructor
  6672. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6673. // component's mounted hook), which relies on vm._watcher being already defined
  6674. new Watcher(vm, updateComponent, noop, {
  6675. before: function before() {
  6676. if (vm._isMounted && !vm._isDestroyed) {
  6677. callHook(vm, 'beforeUpdate');
  6678. }
  6679. }
  6680. }, true /* isRenderWatcher */);
  6681. hydrating = false;
  6682. return vm
  6683. }
  6684. /* */
  6685. function renderClass (
  6686. staticClass,
  6687. dynamicClass
  6688. ) {
  6689. if (isDef(staticClass) || isDef(dynamicClass)) {
  6690. return concat(staticClass, stringifyClass(dynamicClass))
  6691. }
  6692. /* istanbul ignore next */
  6693. return ''
  6694. }
  6695. function concat (a, b) {
  6696. return a ? b ? (a + ' ' + b) : a : (b || '')
  6697. }
  6698. function stringifyClass (value) {
  6699. if (Array.isArray(value)) {
  6700. return stringifyArray(value)
  6701. }
  6702. if (isObject(value)) {
  6703. return stringifyObject(value)
  6704. }
  6705. if (typeof value === 'string') {
  6706. return value
  6707. }
  6708. /* istanbul ignore next */
  6709. return ''
  6710. }
  6711. function stringifyArray (value) {
  6712. var res = '';
  6713. var stringified;
  6714. for (var i = 0, l = value.length; i < l; i++) {
  6715. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6716. if (res) { res += ' '; }
  6717. res += stringified;
  6718. }
  6719. }
  6720. return res
  6721. }
  6722. function stringifyObject (value) {
  6723. var res = '';
  6724. for (var key in value) {
  6725. if (value[key]) {
  6726. if (res) { res += ' '; }
  6727. res += key;
  6728. }
  6729. }
  6730. return res
  6731. }
  6732. /* */
  6733. var parseStyleText = cached(function (cssText) {
  6734. var res = {};
  6735. var listDelimiter = /;(?![^(]*\))/g;
  6736. var propertyDelimiter = /:(.+)/;
  6737. cssText.split(listDelimiter).forEach(function (item) {
  6738. if (item) {
  6739. var tmp = item.split(propertyDelimiter);
  6740. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6741. }
  6742. });
  6743. return res
  6744. });
  6745. // normalize possible array / string values into Object
  6746. function normalizeStyleBinding (bindingStyle) {
  6747. if (Array.isArray(bindingStyle)) {
  6748. return toObject(bindingStyle)
  6749. }
  6750. if (typeof bindingStyle === 'string') {
  6751. return parseStyleText(bindingStyle)
  6752. }
  6753. return bindingStyle
  6754. }
  6755. /* */
  6756. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6757. function getTarget(obj, path) {
  6758. var parts = path.split('.');
  6759. var key = parts[0];
  6760. if (key.indexOf('__$n') === 0) { //number index
  6761. key = parseInt(key.replace('__$n', ''));
  6762. }
  6763. if (parts.length === 1) {
  6764. return obj[key]
  6765. }
  6766. return getTarget(obj[key], parts.slice(1).join('.'))
  6767. }
  6768. function internalMixin(Vue) {
  6769. Vue.config.errorHandler = function(err, vm, info) {
  6770. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6771. console.error(err);
  6772. /* eslint-disable no-undef */
  6773. var app = getApp();
  6774. if (app && app.onError) {
  6775. app.onError(err);
  6776. }
  6777. };
  6778. var oldEmit = Vue.prototype.$emit;
  6779. Vue.prototype.$emit = function(event) {
  6780. if (this.$scope && event) {
  6781. this.$scope['triggerEvent'](event, {
  6782. __args__: toArray(arguments, 1)
  6783. });
  6784. }
  6785. return oldEmit.apply(this, arguments)
  6786. };
  6787. Vue.prototype.$nextTick = function(fn) {
  6788. return nextTick$1(this, fn)
  6789. };
  6790. MP_METHODS.forEach(function (method) {
  6791. Vue.prototype[method] = function(args) {
  6792. if (this.$scope && this.$scope[method]) {
  6793. return this.$scope[method](args)
  6794. }
  6795. // mp-alipay
  6796. if (typeof my === 'undefined') {
  6797. return
  6798. }
  6799. if (method === 'createSelectorQuery') {
  6800. /* eslint-disable no-undef */
  6801. return my.createSelectorQuery(args)
  6802. } else if (method === 'createIntersectionObserver') {
  6803. /* eslint-disable no-undef */
  6804. return my.createIntersectionObserver(args)
  6805. }
  6806. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  6807. };
  6808. });
  6809. Vue.prototype.__init_provide = initProvide;
  6810. Vue.prototype.__init_injections = initInjections;
  6811. Vue.prototype.__call_hook = function(hook, args) {
  6812. var vm = this;
  6813. // #7573 disable dep collection when invoking lifecycle hooks
  6814. pushTarget();
  6815. var handlers = vm.$options[hook];
  6816. var info = hook + " hook";
  6817. var ret;
  6818. if (handlers) {
  6819. for (var i = 0, j = handlers.length; i < j; i++) {
  6820. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  6821. }
  6822. }
  6823. if (vm._hasHookEvent) {
  6824. vm.$emit('hook:' + hook, args);
  6825. }
  6826. popTarget();
  6827. return ret
  6828. };
  6829. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  6830. if (Array.isArray(modifiers)) {
  6831. if (modifiers.indexOf('trim') !== -1) {
  6832. value = value.trim();
  6833. }
  6834. if (modifiers.indexOf('number') !== -1) {
  6835. value = this._n(value);
  6836. }
  6837. }
  6838. if (!target) {
  6839. target = this;
  6840. }
  6841. target[key] = value;
  6842. };
  6843. Vue.prototype.__set_sync = function(target, key, value) {
  6844. if (!target) {
  6845. target = this;
  6846. }
  6847. target[key] = value;
  6848. };
  6849. Vue.prototype.__get_orig = function(item) {
  6850. if (isPlainObject(item)) {
  6851. return item['$orig'] || item
  6852. }
  6853. return item
  6854. };
  6855. Vue.prototype.__get_value = function(dataPath, target) {
  6856. return getTarget(target || this, dataPath)
  6857. };
  6858. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  6859. return renderClass(staticClass, dynamicClass)
  6860. };
  6861. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  6862. if (!dynamicStyle && !staticStyle) {
  6863. return ''
  6864. }
  6865. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  6866. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  6867. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  6868. };
  6869. Vue.prototype.__map = function(val, iteratee) {
  6870. //TODO 暂不考虑 string
  6871. var ret, i, l, keys, key;
  6872. if (Array.isArray(val)) {
  6873. ret = new Array(val.length);
  6874. for (i = 0, l = val.length; i < l; i++) {
  6875. ret[i] = iteratee(val[i], i);
  6876. }
  6877. return ret
  6878. } else if (isObject(val)) {
  6879. keys = Object.keys(val);
  6880. ret = Object.create(null);
  6881. for (i = 0, l = keys.length; i < l; i++) {
  6882. key = keys[i];
  6883. ret[key] = iteratee(val[key], key, i);
  6884. }
  6885. return ret
  6886. } else if (typeof val === 'number') {
  6887. ret = new Array(val);
  6888. for (i = 0, l = val; i < l; i++) {
  6889. // 第一个参数暂时仍和小程序一致
  6890. ret[i] = iteratee(i, i);
  6891. }
  6892. return ret
  6893. }
  6894. return []
  6895. };
  6896. }
  6897. /* */
  6898. var LIFECYCLE_HOOKS$1 = [
  6899. //App
  6900. 'onLaunch',
  6901. 'onShow',
  6902. 'onHide',
  6903. 'onUniNViewMessage',
  6904. 'onPageNotFound',
  6905. 'onThemeChange',
  6906. 'onError',
  6907. 'onUnhandledRejection',
  6908. //Page
  6909. 'onInit',
  6910. 'onLoad',
  6911. // 'onShow',
  6912. 'onReady',
  6913. // 'onHide',
  6914. 'onUnload',
  6915. 'onPullDownRefresh',
  6916. 'onReachBottom',
  6917. 'onTabItemTap',
  6918. 'onAddToFavorites',
  6919. 'onShareTimeline',
  6920. 'onShareAppMessage',
  6921. 'onResize',
  6922. 'onPageScroll',
  6923. 'onNavigationBarButtonTap',
  6924. 'onBackPress',
  6925. 'onNavigationBarSearchInputChanged',
  6926. 'onNavigationBarSearchInputConfirmed',
  6927. 'onNavigationBarSearchInputClicked',
  6928. //Component
  6929. // 'onReady', // 兼容旧版本,应该移除该事件
  6930. 'onPageShow',
  6931. 'onPageHide',
  6932. 'onPageResize'
  6933. ];
  6934. function lifecycleMixin$1(Vue) {
  6935. //fixed vue-class-component
  6936. var oldExtend = Vue.extend;
  6937. Vue.extend = function(extendOptions) {
  6938. extendOptions = extendOptions || {};
  6939. var methods = extendOptions.methods;
  6940. if (methods) {
  6941. Object.keys(methods).forEach(function (methodName) {
  6942. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  6943. extendOptions[methodName] = methods[methodName];
  6944. delete methods[methodName];
  6945. }
  6946. });
  6947. }
  6948. return oldExtend.call(this, extendOptions)
  6949. };
  6950. var strategies = Vue.config.optionMergeStrategies;
  6951. var mergeHook = strategies.created;
  6952. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  6953. strategies[hook] = mergeHook;
  6954. });
  6955. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  6956. }
  6957. /* */
  6958. // install platform patch function
  6959. Vue.prototype.__patch__ = patch;
  6960. // public mount method
  6961. Vue.prototype.$mount = function(
  6962. el ,
  6963. hydrating
  6964. ) {
  6965. return mountComponent$1(this, el, hydrating)
  6966. };
  6967. lifecycleMixin$1(Vue);
  6968. internalMixin(Vue);
  6969. /* */
  6970. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  6971. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  6972. /***/ }),
  6973. /* 3 */
  6974. /*!***********************************!*\
  6975. !*** (webpack)/buildin/global.js ***!
  6976. \***********************************/
  6977. /*! no static exports found */
  6978. /***/ (function(module, exports) {
  6979. var g;
  6980. // This works in non-strict mode
  6981. g = (function() {
  6982. return this;
  6983. })();
  6984. try {
  6985. // This works if eval is allowed (see CSP)
  6986. g = g || new Function("return this")();
  6987. } catch (e) {
  6988. // This works if the window reference is available
  6989. if (typeof window === "object") g = window;
  6990. }
  6991. // g can still be undefined, but nothing to do about it...
  6992. // We return undefined, instead of nothing here, so it's
  6993. // easier to handle this case. if(!global) { ...}
  6994. module.exports = g;
  6995. /***/ }),
  6996. /* 4 */
  6997. /*!****************************************!*\
  6998. !*** F:/uniapp/sqxp-uniapp/pages.json ***!
  6999. \****************************************/
  7000. /*! no static exports found */
  7001. /***/ (function(module, exports) {
  7002. /***/ }),
  7003. /* 5 */,
  7004. /* 6 */,
  7005. /* 7 */,
  7006. /* 8 */,
  7007. /* 9 */,
  7008. /* 10 */
  7009. /*!**********************************************************************************************************!*\
  7010. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  7011. \**********************************************************************************************************/
  7012. /*! exports provided: default */
  7013. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7014. "use strict";
  7015. __webpack_require__.r(__webpack_exports__);
  7016. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  7017. /* globals __VUE_SSR_CONTEXT__ */
  7018. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  7019. // This module is a runtime utility for cleaner component module output and will
  7020. // be included in the final webpack user bundle.
  7021. function normalizeComponent (
  7022. scriptExports,
  7023. render,
  7024. staticRenderFns,
  7025. functionalTemplate,
  7026. injectStyles,
  7027. scopeId,
  7028. moduleIdentifier, /* server only */
  7029. shadowMode, /* vue-cli only */
  7030. components, // fixed by xxxxxx auto components
  7031. renderjs // fixed by xxxxxx renderjs
  7032. ) {
  7033. // Vue.extend constructor export interop
  7034. var options = typeof scriptExports === 'function'
  7035. ? scriptExports.options
  7036. : scriptExports
  7037. // fixed by xxxxxx auto components
  7038. if (components) {
  7039. if (!options.components) {
  7040. options.components = {}
  7041. }
  7042. var hasOwn = Object.prototype.hasOwnProperty
  7043. for (var name in components) {
  7044. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  7045. options.components[name] = components[name]
  7046. }
  7047. }
  7048. }
  7049. // fixed by xxxxxx renderjs
  7050. if (renderjs) {
  7051. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  7052. this[renderjs.__module] = this
  7053. });
  7054. (options.mixins || (options.mixins = [])).push(renderjs)
  7055. }
  7056. // render functions
  7057. if (render) {
  7058. options.render = render
  7059. options.staticRenderFns = staticRenderFns
  7060. options._compiled = true
  7061. }
  7062. // functional template
  7063. if (functionalTemplate) {
  7064. options.functional = true
  7065. }
  7066. // scopedId
  7067. if (scopeId) {
  7068. options._scopeId = 'data-v-' + scopeId
  7069. }
  7070. var hook
  7071. if (moduleIdentifier) { // server build
  7072. hook = function (context) {
  7073. // 2.3 injection
  7074. context =
  7075. context || // cached call
  7076. (this.$vnode && this.$vnode.ssrContext) || // stateful
  7077. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  7078. // 2.2 with runInNewContext: true
  7079. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  7080. context = __VUE_SSR_CONTEXT__
  7081. }
  7082. // inject component styles
  7083. if (injectStyles) {
  7084. injectStyles.call(this, context)
  7085. }
  7086. // register component module identifier for async chunk inferrence
  7087. if (context && context._registeredComponents) {
  7088. context._registeredComponents.add(moduleIdentifier)
  7089. }
  7090. }
  7091. // used by ssr in case component is cached and beforeCreate
  7092. // never gets called
  7093. options._ssrRegister = hook
  7094. } else if (injectStyles) {
  7095. hook = shadowMode
  7096. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  7097. : injectStyles
  7098. }
  7099. if (hook) {
  7100. if (options.functional) {
  7101. // for template-only hot-reload because in that case the render fn doesn't
  7102. // go through the normalizer
  7103. options._injectStyles = hook
  7104. // register for functioal component in vue file
  7105. var originalRender = options.render
  7106. options.render = function renderWithStyleInjection (h, context) {
  7107. hook.call(context)
  7108. return originalRender(h, context)
  7109. }
  7110. } else {
  7111. // inject component registration as beforeCreate hook
  7112. var existing = options.beforeCreate
  7113. options.beforeCreate = existing
  7114. ? [].concat(existing, hook)
  7115. : [hook]
  7116. }
  7117. }
  7118. return {
  7119. exports: scriptExports,
  7120. options: options
  7121. }
  7122. }
  7123. /***/ }),
  7124. /* 11 */
  7125. /*!********************************************!*\
  7126. !*** F:/uniapp/sqxp-uniapp/store/index.js ***!
  7127. \********************************************/
  7128. /*! no static exports found */
  7129. /***/ (function(module, exports, __webpack_require__) {
  7130. "use strict";
  7131. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  7132. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 12));
  7133. var _user = _interopRequireDefault(__webpack_require__(/*! ./modules/user */ 13));
  7134. var _cinema = _interopRequireDefault(__webpack_require__(/*! ./modules/cinema.js */ 22));
  7135. var _getters = _interopRequireDefault(__webpack_require__(/*! ./getters */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  7136. _vue.default.use(_vuex.default);
  7137. var store = new _vuex.default.Store({
  7138. modules: {
  7139. user: _user.default,
  7140. cinema: _cinema.default },
  7141. getters: _getters.default });var _default =
  7142. store;exports.default = _default;
  7143. /***/ }),
  7144. /* 12 */
  7145. /*!********************************************!*\
  7146. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  7147. \********************************************/
  7148. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  7149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7150. "use strict";
  7151. __webpack_require__.r(__webpack_exports__);
  7152. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  7153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  7154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  7155. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  7156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  7157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  7158. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  7159. /*!
  7160. * vuex v3.4.0
  7161. * (c) 2020 Evan You
  7162. * @license MIT
  7163. */
  7164. function applyMixin (Vue) {
  7165. var version = Number(Vue.version.split('.')[0]);
  7166. if (version >= 2) {
  7167. Vue.mixin({ beforeCreate: vuexInit });
  7168. } else {
  7169. // override init and inject vuex init procedure
  7170. // for 1.x backwards compatibility.
  7171. var _init = Vue.prototype._init;
  7172. Vue.prototype._init = function (options) {
  7173. if ( options === void 0 ) options = {};
  7174. options.init = options.init
  7175. ? [vuexInit].concat(options.init)
  7176. : vuexInit;
  7177. _init.call(this, options);
  7178. };
  7179. }
  7180. /**
  7181. * Vuex init hook, injected into each instances init hooks list.
  7182. */
  7183. function vuexInit () {
  7184. var options = this.$options;
  7185. // store injection
  7186. if (options.store) {
  7187. this.$store = typeof options.store === 'function'
  7188. ? options.store()
  7189. : options.store;
  7190. } else if (options.parent && options.parent.$store) {
  7191. this.$store = options.parent.$store;
  7192. }
  7193. }
  7194. }
  7195. var target = typeof window !== 'undefined'
  7196. ? window
  7197. : typeof global !== 'undefined'
  7198. ? global
  7199. : {};
  7200. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  7201. function devtoolPlugin (store) {
  7202. if (!devtoolHook) { return }
  7203. store._devtoolHook = devtoolHook;
  7204. devtoolHook.emit('vuex:init', store);
  7205. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  7206. store.replaceState(targetState);
  7207. });
  7208. store.subscribe(function (mutation, state) {
  7209. devtoolHook.emit('vuex:mutation', mutation, state);
  7210. }, { prepend: true });
  7211. store.subscribeAction(function (action, state) {
  7212. devtoolHook.emit('vuex:action', action, state);
  7213. }, { prepend: true });
  7214. }
  7215. /**
  7216. * Get the first item that pass the test
  7217. * by second argument function
  7218. *
  7219. * @param {Array} list
  7220. * @param {Function} f
  7221. * @return {*}
  7222. */
  7223. /**
  7224. * forEach for object
  7225. */
  7226. function forEachValue (obj, fn) {
  7227. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  7228. }
  7229. function isObject (obj) {
  7230. return obj !== null && typeof obj === 'object'
  7231. }
  7232. function isPromise (val) {
  7233. return val && typeof val.then === 'function'
  7234. }
  7235. function assert (condition, msg) {
  7236. if (!condition) { throw new Error(("[vuex] " + msg)) }
  7237. }
  7238. function partial (fn, arg) {
  7239. return function () {
  7240. return fn(arg)
  7241. }
  7242. }
  7243. // Base data struct for store's module, package with some attribute and method
  7244. var Module = function Module (rawModule, runtime) {
  7245. this.runtime = runtime;
  7246. // Store some children item
  7247. this._children = Object.create(null);
  7248. // Store the origin module object which passed by programmer
  7249. this._rawModule = rawModule;
  7250. var rawState = rawModule.state;
  7251. // Store the origin module's state
  7252. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  7253. };
  7254. var prototypeAccessors = { namespaced: { configurable: true } };
  7255. prototypeAccessors.namespaced.get = function () {
  7256. return !!this._rawModule.namespaced
  7257. };
  7258. Module.prototype.addChild = function addChild (key, module) {
  7259. this._children[key] = module;
  7260. };
  7261. Module.prototype.removeChild = function removeChild (key) {
  7262. delete this._children[key];
  7263. };
  7264. Module.prototype.getChild = function getChild (key) {
  7265. return this._children[key]
  7266. };
  7267. Module.prototype.hasChild = function hasChild (key) {
  7268. return key in this._children
  7269. };
  7270. Module.prototype.update = function update (rawModule) {
  7271. this._rawModule.namespaced = rawModule.namespaced;
  7272. if (rawModule.actions) {
  7273. this._rawModule.actions = rawModule.actions;
  7274. }
  7275. if (rawModule.mutations) {
  7276. this._rawModule.mutations = rawModule.mutations;
  7277. }
  7278. if (rawModule.getters) {
  7279. this._rawModule.getters = rawModule.getters;
  7280. }
  7281. };
  7282. Module.prototype.forEachChild = function forEachChild (fn) {
  7283. forEachValue(this._children, fn);
  7284. };
  7285. Module.prototype.forEachGetter = function forEachGetter (fn) {
  7286. if (this._rawModule.getters) {
  7287. forEachValue(this._rawModule.getters, fn);
  7288. }
  7289. };
  7290. Module.prototype.forEachAction = function forEachAction (fn) {
  7291. if (this._rawModule.actions) {
  7292. forEachValue(this._rawModule.actions, fn);
  7293. }
  7294. };
  7295. Module.prototype.forEachMutation = function forEachMutation (fn) {
  7296. if (this._rawModule.mutations) {
  7297. forEachValue(this._rawModule.mutations, fn);
  7298. }
  7299. };
  7300. Object.defineProperties( Module.prototype, prototypeAccessors );
  7301. var ModuleCollection = function ModuleCollection (rawRootModule) {
  7302. // register root module (Vuex.Store options)
  7303. this.register([], rawRootModule, false);
  7304. };
  7305. ModuleCollection.prototype.get = function get (path) {
  7306. return path.reduce(function (module, key) {
  7307. return module.getChild(key)
  7308. }, this.root)
  7309. };
  7310. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  7311. var module = this.root;
  7312. return path.reduce(function (namespace, key) {
  7313. module = module.getChild(key);
  7314. return namespace + (module.namespaced ? key + '/' : '')
  7315. }, '')
  7316. };
  7317. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  7318. update([], this.root, rawRootModule);
  7319. };
  7320. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  7321. var this$1 = this;
  7322. if ( runtime === void 0 ) runtime = true;
  7323. if ((true)) {
  7324. assertRawModule(path, rawModule);
  7325. }
  7326. var newModule = new Module(rawModule, runtime);
  7327. if (path.length === 0) {
  7328. this.root = newModule;
  7329. } else {
  7330. var parent = this.get(path.slice(0, -1));
  7331. parent.addChild(path[path.length - 1], newModule);
  7332. }
  7333. // register nested modules
  7334. if (rawModule.modules) {
  7335. forEachValue(rawModule.modules, function (rawChildModule, key) {
  7336. this$1.register(path.concat(key), rawChildModule, runtime);
  7337. });
  7338. }
  7339. };
  7340. ModuleCollection.prototype.unregister = function unregister (path) {
  7341. var parent = this.get(path.slice(0, -1));
  7342. var key = path[path.length - 1];
  7343. if (!parent.getChild(key).runtime) { return }
  7344. parent.removeChild(key);
  7345. };
  7346. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  7347. var parent = this.get(path.slice(0, -1));
  7348. var key = path[path.length - 1];
  7349. return parent.hasChild(key)
  7350. };
  7351. function update (path, targetModule, newModule) {
  7352. if ((true)) {
  7353. assertRawModule(path, newModule);
  7354. }
  7355. // update target module
  7356. targetModule.update(newModule);
  7357. // update nested modules
  7358. if (newModule.modules) {
  7359. for (var key in newModule.modules) {
  7360. if (!targetModule.getChild(key)) {
  7361. if ((true)) {
  7362. console.warn(
  7363. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  7364. 'manual reload is needed'
  7365. );
  7366. }
  7367. return
  7368. }
  7369. update(
  7370. path.concat(key),
  7371. targetModule.getChild(key),
  7372. newModule.modules[key]
  7373. );
  7374. }
  7375. }
  7376. }
  7377. var functionAssert = {
  7378. assert: function (value) { return typeof value === 'function'; },
  7379. expected: 'function'
  7380. };
  7381. var objectAssert = {
  7382. assert: function (value) { return typeof value === 'function' ||
  7383. (typeof value === 'object' && typeof value.handler === 'function'); },
  7384. expected: 'function or object with "handler" function'
  7385. };
  7386. var assertTypes = {
  7387. getters: functionAssert,
  7388. mutations: functionAssert,
  7389. actions: objectAssert
  7390. };
  7391. function assertRawModule (path, rawModule) {
  7392. Object.keys(assertTypes).forEach(function (key) {
  7393. if (!rawModule[key]) { return }
  7394. var assertOptions = assertTypes[key];
  7395. forEachValue(rawModule[key], function (value, type) {
  7396. assert(
  7397. assertOptions.assert(value),
  7398. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  7399. );
  7400. });
  7401. });
  7402. }
  7403. function makeAssertionMessage (path, key, type, value, expected) {
  7404. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  7405. if (path.length > 0) {
  7406. buf += " in module \"" + (path.join('.')) + "\"";
  7407. }
  7408. buf += " is " + (JSON.stringify(value)) + ".";
  7409. return buf
  7410. }
  7411. var Vue; // bind on install
  7412. var Store = function Store (options) {
  7413. var this$1 = this;
  7414. if ( options === void 0 ) options = {};
  7415. // Auto install if it is not done yet and `window` has `Vue`.
  7416. // To allow users to avoid auto-installation in some cases,
  7417. // this code should be placed here. See #731
  7418. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  7419. install(window.Vue);
  7420. }
  7421. if ((true)) {
  7422. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  7423. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  7424. assert(this instanceof Store, "store must be called with the new operator.");
  7425. }
  7426. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  7427. var strict = options.strict; if ( strict === void 0 ) strict = false;
  7428. // store internal state
  7429. this._committing = false;
  7430. this._actions = Object.create(null);
  7431. this._actionSubscribers = [];
  7432. this._mutations = Object.create(null);
  7433. this._wrappedGetters = Object.create(null);
  7434. this._modules = new ModuleCollection(options);
  7435. this._modulesNamespaceMap = Object.create(null);
  7436. this._subscribers = [];
  7437. this._watcherVM = new Vue();
  7438. this._makeLocalGettersCache = Object.create(null);
  7439. // bind commit and dispatch to self
  7440. var store = this;
  7441. var ref = this;
  7442. var dispatch = ref.dispatch;
  7443. var commit = ref.commit;
  7444. this.dispatch = function boundDispatch (type, payload) {
  7445. return dispatch.call(store, type, payload)
  7446. };
  7447. this.commit = function boundCommit (type, payload, options) {
  7448. return commit.call(store, type, payload, options)
  7449. };
  7450. // strict mode
  7451. this.strict = strict;
  7452. var state = this._modules.root.state;
  7453. // init root module.
  7454. // this also recursively registers all sub-modules
  7455. // and collects all module getters inside this._wrappedGetters
  7456. installModule(this, state, [], this._modules.root);
  7457. // initialize the store vm, which is responsible for the reactivity
  7458. // (also registers _wrappedGetters as computed properties)
  7459. resetStoreVM(this, state);
  7460. // apply plugins
  7461. plugins.forEach(function (plugin) { return plugin(this$1); });
  7462. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  7463. if (useDevtools) {
  7464. devtoolPlugin(this);
  7465. }
  7466. };
  7467. var prototypeAccessors$1 = { state: { configurable: true } };
  7468. prototypeAccessors$1.state.get = function () {
  7469. return this._vm._data.$$state
  7470. };
  7471. prototypeAccessors$1.state.set = function (v) {
  7472. if ((true)) {
  7473. assert(false, "use store.replaceState() to explicit replace store state.");
  7474. }
  7475. };
  7476. Store.prototype.commit = function commit (_type, _payload, _options) {
  7477. var this$1 = this;
  7478. // check object-style commit
  7479. var ref = unifyObjectStyle(_type, _payload, _options);
  7480. var type = ref.type;
  7481. var payload = ref.payload;
  7482. var options = ref.options;
  7483. var mutation = { type: type, payload: payload };
  7484. var entry = this._mutations[type];
  7485. if (!entry) {
  7486. if ((true)) {
  7487. console.error(("[vuex] unknown mutation type: " + type));
  7488. }
  7489. return
  7490. }
  7491. this._withCommit(function () {
  7492. entry.forEach(function commitIterator (handler) {
  7493. handler(payload);
  7494. });
  7495. });
  7496. this._subscribers
  7497. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  7498. .forEach(function (sub) { return sub(mutation, this$1.state); });
  7499. if (
  7500. ( true) &&
  7501. options && options.silent
  7502. ) {
  7503. console.warn(
  7504. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  7505. 'Use the filter functionality in the vue-devtools'
  7506. );
  7507. }
  7508. };
  7509. Store.prototype.dispatch = function dispatch (_type, _payload) {
  7510. var this$1 = this;
  7511. // check object-style dispatch
  7512. var ref = unifyObjectStyle(_type, _payload);
  7513. var type = ref.type;
  7514. var payload = ref.payload;
  7515. var action = { type: type, payload: payload };
  7516. var entry = this._actions[type];
  7517. if (!entry) {
  7518. if ((true)) {
  7519. console.error(("[vuex] unknown action type: " + type));
  7520. }
  7521. return
  7522. }
  7523. try {
  7524. this._actionSubscribers
  7525. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  7526. .filter(function (sub) { return sub.before; })
  7527. .forEach(function (sub) { return sub.before(action, this$1.state); });
  7528. } catch (e) {
  7529. if ((true)) {
  7530. console.warn("[vuex] error in before action subscribers: ");
  7531. console.error(e);
  7532. }
  7533. }
  7534. var result = entry.length > 1
  7535. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  7536. : entry[0](payload);
  7537. return new Promise(function (resolve, reject) {
  7538. result.then(function (res) {
  7539. try {
  7540. this$1._actionSubscribers
  7541. .filter(function (sub) { return sub.after; })
  7542. .forEach(function (sub) { return sub.after(action, this$1.state); });
  7543. } catch (e) {
  7544. if ((true)) {
  7545. console.warn("[vuex] error in after action subscribers: ");
  7546. console.error(e);
  7547. }
  7548. }
  7549. resolve(res);
  7550. }, function (error) {
  7551. try {
  7552. this$1._actionSubscribers
  7553. .filter(function (sub) { return sub.error; })
  7554. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  7555. } catch (e) {
  7556. if ((true)) {
  7557. console.warn("[vuex] error in error action subscribers: ");
  7558. console.error(e);
  7559. }
  7560. }
  7561. reject(error);
  7562. });
  7563. })
  7564. };
  7565. Store.prototype.subscribe = function subscribe (fn, options) {
  7566. return genericSubscribe(fn, this._subscribers, options)
  7567. };
  7568. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  7569. var subs = typeof fn === 'function' ? { before: fn } : fn;
  7570. return genericSubscribe(subs, this._actionSubscribers, options)
  7571. };
  7572. Store.prototype.watch = function watch (getter, cb, options) {
  7573. var this$1 = this;
  7574. if ((true)) {
  7575. assert(typeof getter === 'function', "store.watch only accepts a function.");
  7576. }
  7577. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  7578. };
  7579. Store.prototype.replaceState = function replaceState (state) {
  7580. var this$1 = this;
  7581. this._withCommit(function () {
  7582. this$1._vm._data.$$state = state;
  7583. });
  7584. };
  7585. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  7586. if ( options === void 0 ) options = {};
  7587. if (typeof path === 'string') { path = [path]; }
  7588. if ((true)) {
  7589. assert(Array.isArray(path), "module path must be a string or an Array.");
  7590. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  7591. }
  7592. this._modules.register(path, rawModule);
  7593. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  7594. // reset store to update getters...
  7595. resetStoreVM(this, this.state);
  7596. };
  7597. Store.prototype.unregisterModule = function unregisterModule (path) {
  7598. var this$1 = this;
  7599. if (typeof path === 'string') { path = [path]; }
  7600. if ((true)) {
  7601. assert(Array.isArray(path), "module path must be a string or an Array.");
  7602. }
  7603. this._modules.unregister(path);
  7604. this._withCommit(function () {
  7605. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  7606. Vue.delete(parentState, path[path.length - 1]);
  7607. });
  7608. resetStore(this);
  7609. };
  7610. Store.prototype.hasModule = function hasModule (path) {
  7611. if (typeof path === 'string') { path = [path]; }
  7612. if ((true)) {
  7613. assert(Array.isArray(path), "module path must be a string or an Array.");
  7614. }
  7615. return this._modules.isRegistered(path)
  7616. };
  7617. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  7618. this._modules.update(newOptions);
  7619. resetStore(this, true);
  7620. };
  7621. Store.prototype._withCommit = function _withCommit (fn) {
  7622. var committing = this._committing;
  7623. this._committing = true;
  7624. fn();
  7625. this._committing = committing;
  7626. };
  7627. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  7628. function genericSubscribe (fn, subs, options) {
  7629. if (subs.indexOf(fn) < 0) {
  7630. options && options.prepend
  7631. ? subs.unshift(fn)
  7632. : subs.push(fn);
  7633. }
  7634. return function () {
  7635. var i = subs.indexOf(fn);
  7636. if (i > -1) {
  7637. subs.splice(i, 1);
  7638. }
  7639. }
  7640. }
  7641. function resetStore (store, hot) {
  7642. store._actions = Object.create(null);
  7643. store._mutations = Object.create(null);
  7644. store._wrappedGetters = Object.create(null);
  7645. store._modulesNamespaceMap = Object.create(null);
  7646. var state = store.state;
  7647. // init all modules
  7648. installModule(store, state, [], store._modules.root, true);
  7649. // reset vm
  7650. resetStoreVM(store, state, hot);
  7651. }
  7652. function resetStoreVM (store, state, hot) {
  7653. var oldVm = store._vm;
  7654. // bind store public getters
  7655. store.getters = {};
  7656. // reset local getters cache
  7657. store._makeLocalGettersCache = Object.create(null);
  7658. var wrappedGetters = store._wrappedGetters;
  7659. var computed = {};
  7660. forEachValue(wrappedGetters, function (fn, key) {
  7661. // use computed to leverage its lazy-caching mechanism
  7662. // direct inline function use will lead to closure preserving oldVm.
  7663. // using partial to return function with only arguments preserved in closure environment.
  7664. computed[key] = partial(fn, store);
  7665. Object.defineProperty(store.getters, key, {
  7666. get: function () { return store._vm[key]; },
  7667. enumerable: true // for local getters
  7668. });
  7669. });
  7670. // use a Vue instance to store the state tree
  7671. // suppress warnings just in case the user has added
  7672. // some funky global mixins
  7673. var silent = Vue.config.silent;
  7674. Vue.config.silent = true;
  7675. store._vm = new Vue({
  7676. data: {
  7677. $$state: state
  7678. },
  7679. computed: computed
  7680. });
  7681. Vue.config.silent = silent;
  7682. // enable strict mode for new vm
  7683. if (store.strict) {
  7684. enableStrictMode(store);
  7685. }
  7686. if (oldVm) {
  7687. if (hot) {
  7688. // dispatch changes in all subscribed watchers
  7689. // to force getter re-evaluation for hot reloading.
  7690. store._withCommit(function () {
  7691. oldVm._data.$$state = null;
  7692. });
  7693. }
  7694. Vue.nextTick(function () { return oldVm.$destroy(); });
  7695. }
  7696. }
  7697. function installModule (store, rootState, path, module, hot) {
  7698. var isRoot = !path.length;
  7699. var namespace = store._modules.getNamespace(path);
  7700. // register in namespace map
  7701. if (module.namespaced) {
  7702. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  7703. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  7704. }
  7705. store._modulesNamespaceMap[namespace] = module;
  7706. }
  7707. // set state
  7708. if (!isRoot && !hot) {
  7709. var parentState = getNestedState(rootState, path.slice(0, -1));
  7710. var moduleName = path[path.length - 1];
  7711. store._withCommit(function () {
  7712. if ((true)) {
  7713. if (moduleName in parentState) {
  7714. console.warn(
  7715. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  7716. );
  7717. }
  7718. }
  7719. Vue.set(parentState, moduleName, module.state);
  7720. });
  7721. }
  7722. var local = module.context = makeLocalContext(store, namespace, path);
  7723. module.forEachMutation(function (mutation, key) {
  7724. var namespacedType = namespace + key;
  7725. registerMutation(store, namespacedType, mutation, local);
  7726. });
  7727. module.forEachAction(function (action, key) {
  7728. var type = action.root ? key : namespace + key;
  7729. var handler = action.handler || action;
  7730. registerAction(store, type, handler, local);
  7731. });
  7732. module.forEachGetter(function (getter, key) {
  7733. var namespacedType = namespace + key;
  7734. registerGetter(store, namespacedType, getter, local);
  7735. });
  7736. module.forEachChild(function (child, key) {
  7737. installModule(store, rootState, path.concat(key), child, hot);
  7738. });
  7739. }
  7740. /**
  7741. * make localized dispatch, commit, getters and state
  7742. * if there is no namespace, just use root ones
  7743. */
  7744. function makeLocalContext (store, namespace, path) {
  7745. var noNamespace = namespace === '';
  7746. var local = {
  7747. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  7748. var args = unifyObjectStyle(_type, _payload, _options);
  7749. var payload = args.payload;
  7750. var options = args.options;
  7751. var type = args.type;
  7752. if (!options || !options.root) {
  7753. type = namespace + type;
  7754. if (( true) && !store._actions[type]) {
  7755. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  7756. return
  7757. }
  7758. }
  7759. return store.dispatch(type, payload)
  7760. },
  7761. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  7762. var args = unifyObjectStyle(_type, _payload, _options);
  7763. var payload = args.payload;
  7764. var options = args.options;
  7765. var type = args.type;
  7766. if (!options || !options.root) {
  7767. type = namespace + type;
  7768. if (( true) && !store._mutations[type]) {
  7769. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  7770. return
  7771. }
  7772. }
  7773. store.commit(type, payload, options);
  7774. }
  7775. };
  7776. // getters and state object must be gotten lazily
  7777. // because they will be changed by vm update
  7778. Object.defineProperties(local, {
  7779. getters: {
  7780. get: noNamespace
  7781. ? function () { return store.getters; }
  7782. : function () { return makeLocalGetters(store, namespace); }
  7783. },
  7784. state: {
  7785. get: function () { return getNestedState(store.state, path); }
  7786. }
  7787. });
  7788. return local
  7789. }
  7790. function makeLocalGetters (store, namespace) {
  7791. if (!store._makeLocalGettersCache[namespace]) {
  7792. var gettersProxy = {};
  7793. var splitPos = namespace.length;
  7794. Object.keys(store.getters).forEach(function (type) {
  7795. // skip if the target getter is not match this namespace
  7796. if (type.slice(0, splitPos) !== namespace) { return }
  7797. // extract local getter type
  7798. var localType = type.slice(splitPos);
  7799. // Add a port to the getters proxy.
  7800. // Define as getter property because
  7801. // we do not want to evaluate the getters in this time.
  7802. Object.defineProperty(gettersProxy, localType, {
  7803. get: function () { return store.getters[type]; },
  7804. enumerable: true
  7805. });
  7806. });
  7807. store._makeLocalGettersCache[namespace] = gettersProxy;
  7808. }
  7809. return store._makeLocalGettersCache[namespace]
  7810. }
  7811. function registerMutation (store, type, handler, local) {
  7812. var entry = store._mutations[type] || (store._mutations[type] = []);
  7813. entry.push(function wrappedMutationHandler (payload) {
  7814. handler.call(store, local.state, payload);
  7815. });
  7816. }
  7817. function registerAction (store, type, handler, local) {
  7818. var entry = store._actions[type] || (store._actions[type] = []);
  7819. entry.push(function wrappedActionHandler (payload) {
  7820. var res = handler.call(store, {
  7821. dispatch: local.dispatch,
  7822. commit: local.commit,
  7823. getters: local.getters,
  7824. state: local.state,
  7825. rootGetters: store.getters,
  7826. rootState: store.state
  7827. }, payload);
  7828. if (!isPromise(res)) {
  7829. res = Promise.resolve(res);
  7830. }
  7831. if (store._devtoolHook) {
  7832. return res.catch(function (err) {
  7833. store._devtoolHook.emit('vuex:error', err);
  7834. throw err
  7835. })
  7836. } else {
  7837. return res
  7838. }
  7839. });
  7840. }
  7841. function registerGetter (store, type, rawGetter, local) {
  7842. if (store._wrappedGetters[type]) {
  7843. if ((true)) {
  7844. console.error(("[vuex] duplicate getter key: " + type));
  7845. }
  7846. return
  7847. }
  7848. store._wrappedGetters[type] = function wrappedGetter (store) {
  7849. return rawGetter(
  7850. local.state, // local state
  7851. local.getters, // local getters
  7852. store.state, // root state
  7853. store.getters // root getters
  7854. )
  7855. };
  7856. }
  7857. function enableStrictMode (store) {
  7858. store._vm.$watch(function () { return this._data.$$state }, function () {
  7859. if ((true)) {
  7860. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  7861. }
  7862. }, { deep: true, sync: true });
  7863. }
  7864. function getNestedState (state, path) {
  7865. return path.reduce(function (state, key) { return state[key]; }, state)
  7866. }
  7867. function unifyObjectStyle (type, payload, options) {
  7868. if (isObject(type) && type.type) {
  7869. options = payload;
  7870. payload = type;
  7871. type = type.type;
  7872. }
  7873. if ((true)) {
  7874. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  7875. }
  7876. return { type: type, payload: payload, options: options }
  7877. }
  7878. function install (_Vue) {
  7879. if (Vue && _Vue === Vue) {
  7880. if ((true)) {
  7881. console.error(
  7882. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  7883. );
  7884. }
  7885. return
  7886. }
  7887. Vue = _Vue;
  7888. applyMixin(Vue);
  7889. }
  7890. /**
  7891. * Reduce the code which written in Vue.js for getting the state.
  7892. * @param {String} [namespace] - Module's namespace
  7893. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  7894. * @param {Object}
  7895. */
  7896. var mapState = normalizeNamespace(function (namespace, states) {
  7897. var res = {};
  7898. if (( true) && !isValidMap(states)) {
  7899. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  7900. }
  7901. normalizeMap(states).forEach(function (ref) {
  7902. var key = ref.key;
  7903. var val = ref.val;
  7904. res[key] = function mappedState () {
  7905. var state = this.$store.state;
  7906. var getters = this.$store.getters;
  7907. if (namespace) {
  7908. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  7909. if (!module) {
  7910. return
  7911. }
  7912. state = module.context.state;
  7913. getters = module.context.getters;
  7914. }
  7915. return typeof val === 'function'
  7916. ? val.call(this, state, getters)
  7917. : state[val]
  7918. };
  7919. // mark vuex getter for devtools
  7920. res[key].vuex = true;
  7921. });
  7922. return res
  7923. });
  7924. /**
  7925. * Reduce the code which written in Vue.js for committing the mutation
  7926. * @param {String} [namespace] - Module's namespace
  7927. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  7928. * @return {Object}
  7929. */
  7930. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  7931. var res = {};
  7932. if (( true) && !isValidMap(mutations)) {
  7933. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  7934. }
  7935. normalizeMap(mutations).forEach(function (ref) {
  7936. var key = ref.key;
  7937. var val = ref.val;
  7938. res[key] = function mappedMutation () {
  7939. var args = [], len = arguments.length;
  7940. while ( len-- ) args[ len ] = arguments[ len ];
  7941. // Get the commit method from store
  7942. var commit = this.$store.commit;
  7943. if (namespace) {
  7944. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  7945. if (!module) {
  7946. return
  7947. }
  7948. commit = module.context.commit;
  7949. }
  7950. return typeof val === 'function'
  7951. ? val.apply(this, [commit].concat(args))
  7952. : commit.apply(this.$store, [val].concat(args))
  7953. };
  7954. });
  7955. return res
  7956. });
  7957. /**
  7958. * Reduce the code which written in Vue.js for getting the getters
  7959. * @param {String} [namespace] - Module's namespace
  7960. * @param {Object|Array} getters
  7961. * @return {Object}
  7962. */
  7963. var mapGetters = normalizeNamespace(function (namespace, getters) {
  7964. var res = {};
  7965. if (( true) && !isValidMap(getters)) {
  7966. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  7967. }
  7968. normalizeMap(getters).forEach(function (ref) {
  7969. var key = ref.key;
  7970. var val = ref.val;
  7971. // The namespace has been mutated by normalizeNamespace
  7972. val = namespace + val;
  7973. res[key] = function mappedGetter () {
  7974. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  7975. return
  7976. }
  7977. if (( true) && !(val in this.$store.getters)) {
  7978. console.error(("[vuex] unknown getter: " + val));
  7979. return
  7980. }
  7981. return this.$store.getters[val]
  7982. };
  7983. // mark vuex getter for devtools
  7984. res[key].vuex = true;
  7985. });
  7986. return res
  7987. });
  7988. /**
  7989. * Reduce the code which written in Vue.js for dispatch the action
  7990. * @param {String} [namespace] - Module's namespace
  7991. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  7992. * @return {Object}
  7993. */
  7994. var mapActions = normalizeNamespace(function (namespace, actions) {
  7995. var res = {};
  7996. if (( true) && !isValidMap(actions)) {
  7997. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  7998. }
  7999. normalizeMap(actions).forEach(function (ref) {
  8000. var key = ref.key;
  8001. var val = ref.val;
  8002. res[key] = function mappedAction () {
  8003. var args = [], len = arguments.length;
  8004. while ( len-- ) args[ len ] = arguments[ len ];
  8005. // get dispatch function from store
  8006. var dispatch = this.$store.dispatch;
  8007. if (namespace) {
  8008. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  8009. if (!module) {
  8010. return
  8011. }
  8012. dispatch = module.context.dispatch;
  8013. }
  8014. return typeof val === 'function'
  8015. ? val.apply(this, [dispatch].concat(args))
  8016. : dispatch.apply(this.$store, [val].concat(args))
  8017. };
  8018. });
  8019. return res
  8020. });
  8021. /**
  8022. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  8023. * @param {String} namespace
  8024. * @return {Object}
  8025. */
  8026. var createNamespacedHelpers = function (namespace) { return ({
  8027. mapState: mapState.bind(null, namespace),
  8028. mapGetters: mapGetters.bind(null, namespace),
  8029. mapMutations: mapMutations.bind(null, namespace),
  8030. mapActions: mapActions.bind(null, namespace)
  8031. }); };
  8032. /**
  8033. * Normalize the map
  8034. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  8035. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  8036. * @param {Array|Object} map
  8037. * @return {Object}
  8038. */
  8039. function normalizeMap (map) {
  8040. if (!isValidMap(map)) {
  8041. return []
  8042. }
  8043. return Array.isArray(map)
  8044. ? map.map(function (key) { return ({ key: key, val: key }); })
  8045. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  8046. }
  8047. /**
  8048. * Validate whether given map is valid or not
  8049. * @param {*} map
  8050. * @return {Boolean}
  8051. */
  8052. function isValidMap (map) {
  8053. return Array.isArray(map) || isObject(map)
  8054. }
  8055. /**
  8056. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  8057. * @param {Function} fn
  8058. * @return {Function}
  8059. */
  8060. function normalizeNamespace (fn) {
  8061. return function (namespace, map) {
  8062. if (typeof namespace !== 'string') {
  8063. map = namespace;
  8064. namespace = '';
  8065. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  8066. namespace += '/';
  8067. }
  8068. return fn(namespace, map)
  8069. }
  8070. }
  8071. /**
  8072. * Search a special module from store by namespace. if module not exist, print error message.
  8073. * @param {Object} store
  8074. * @param {String} helper
  8075. * @param {String} namespace
  8076. * @return {Object}
  8077. */
  8078. function getModuleByNamespace (store, helper, namespace) {
  8079. var module = store._modulesNamespaceMap[namespace];
  8080. if (( true) && !module) {
  8081. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  8082. }
  8083. return module
  8084. }
  8085. var index = {
  8086. Store: Store,
  8087. install: install,
  8088. version: '3.4.0',
  8089. mapState: mapState,
  8090. mapMutations: mapMutations,
  8091. mapGetters: mapGetters,
  8092. mapActions: mapActions,
  8093. createNamespacedHelpers: createNamespacedHelpers
  8094. };
  8095. /* harmony default export */ __webpack_exports__["default"] = (index);
  8096. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  8097. /***/ }),
  8098. /* 13 */
  8099. /*!***************************************************!*\
  8100. !*** F:/uniapp/sqxp-uniapp/store/modules/user.js ***!
  8101. \***************************************************/
  8102. /*! no static exports found */
  8103. /***/ (function(module, exports, __webpack_require__) {
  8104. "use strict";
  8105. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _login = __webpack_require__(/*! @/api/login */ 14);
  8106. var _auth = __webpack_require__(/*! @/utils/auth */ 19);
  8107. var user = {
  8108. state: {
  8109. token: (0, _auth.getToken)(),
  8110. userInfo: '',
  8111. name: '',
  8112. avatar: '',
  8113. roles: [],
  8114. permissions: [] },
  8115. mutations: {
  8116. SET_TOKEN: function SET_TOKEN(state, token) {
  8117. state.token = token;
  8118. },
  8119. SET_USERINFO: function SET_USERINFO(state, userInfo) {
  8120. state.userInfo = userInfo;
  8121. },
  8122. SET_NAME: function SET_NAME(state, name) {
  8123. state.name = name;
  8124. },
  8125. SET_AVATAR: function SET_AVATAR(state, avatar) {
  8126. state.avatar = avatar;
  8127. },
  8128. SET_ROLES: function SET_ROLES(state, roles) {
  8129. state.roles = roles;
  8130. },
  8131. SET_PERMISSIONS: function SET_PERMISSIONS(state, permissions) {
  8132. state.permissions = permissions;
  8133. } },
  8134. actions: {
  8135. // 登录
  8136. Login: function Login(_ref,
  8137. userInfo) {var commit = _ref.commit;
  8138. console.log('开始登录');
  8139. return new Promise(function (resolve, reject) {
  8140. (0, _login.login)().then(function (res) {
  8141. (0, _auth.setToken)(res.data.token);
  8142. commit('SET_TOKEN', res.data.token);
  8143. resolve(res);
  8144. }).catch(function (error) {
  8145. reject(error);
  8146. });
  8147. });
  8148. },
  8149. // 获取用户信息
  8150. GetInfo: function GetInfo(_ref2)
  8151. {var commit = _ref2.commit,state = _ref2.state;
  8152. return new Promise(function (resolve, reject) {
  8153. (0, _login.getInfo)().then(function (res) {
  8154. commit('SET_USERINFO', res.data.student);
  8155. resolve(res);
  8156. }).catch(function (error) {
  8157. reject(error);
  8158. });
  8159. });
  8160. }
  8161. // 退出系统
  8162. // LogOut({ commit, state }) {
  8163. // return new Promise((resolve, reject) => {
  8164. // logout(state.token).then(() => {
  8165. // commit('SET_TOKEN', '')
  8166. // commit('SET_ROLES', [])
  8167. // commit('SET_PERMISSIONS', [])
  8168. // removeToken()
  8169. // resolve()
  8170. // }).catch(error => {
  8171. // reject(error)
  8172. // })
  8173. // })
  8174. // },
  8175. // 前端 登出
  8176. // FedLogOut({ commit }) {
  8177. // return new Promise(resolve => {
  8178. // commit('SET_TOKEN', '')
  8179. // removeToken()
  8180. // resolve()
  8181. // })
  8182. // }
  8183. } };var _default =
  8184. user;exports.default = _default;
  8185. /***/ }),
  8186. /* 14 */
  8187. /*!******************************************!*\
  8188. !*** F:/uniapp/sqxp-uniapp/api/login.js ***!
  8189. \******************************************/
  8190. /*! no static exports found */
  8191. /***/ (function(module, exports, __webpack_require__) {
  8192. "use strict";
  8193. Object.defineProperty(exports, "__esModule", { value: true });exports.login = login;exports.updateUserInfo = updateUserInfo;exports.getInfo = getInfo;exports.logout = logout;exports.bindUserCard = bindUserCard;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 15));var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  8194. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  8195. //微信小程序登录code
  8196. function wxlogin() {return _wxlogin.apply(this, arguments);}
  8197. // 登录方法
  8198. function _wxlogin() {_wxlogin = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var wxLogin;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return wx.login();case 2:wxLogin = _context.sent;return _context.abrupt("return", wxLogin);case 4:case "end":return _context.stop();}}}, _callee);}));return _wxlogin.apply(this, arguments);}function login() {return _login.apply(this, arguments);}
  8199. // 更新用户信息
  8200. function _login() {_login = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var res;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return wxlogin();case 2:res = _context2.sent;return _context2.abrupt("return", (0, _request.default)({ url: _baseurl.baseUrl + '/login/jscode', method: 'post', params: { jscode: res.code }, header: { isLogin: true } }));case 4:case "end":return _context2.stop();}}}, _callee2);}));return _login.apply(this, arguments);}function updateUserInfo(data) {
  8201. return (0, _request.default)({
  8202. url: _baseurl.baseUrl + '/student/user/info',
  8203. method: 'post',
  8204. data: data });
  8205. }
  8206. // 获取用户详细信息
  8207. function getInfo() {return _getInfo.apply(this, arguments);}
  8208. // 退出方法
  8209. function _getInfo() {_getInfo = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:return _context3.abrupt("return", (0, _request.default)({ url: _baseurl.baseUrl + '/getInfo', method: 'get' }));case 1:case "end":return _context3.stop();}}}, _callee3);}));return _getInfo.apply(this, arguments);}function logout() {
  8210. return (0, _request.default)({
  8211. url: '/logout',
  8212. method: 'post' });
  8213. }
  8214. // 绑定用户身份证信息
  8215. function bindUserCard(data) {
  8216. return (0, _request.default)({
  8217. url: _baseurl.baseUrl + '/gzpt/userInfo/bind',
  8218. method: 'put',
  8219. data: data });
  8220. }
  8221. /***/ }),
  8222. /* 15 */
  8223. /*!**********************************************************!*\
  8224. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  8225. \**********************************************************/
  8226. /*! no static exports found */
  8227. /***/ (function(module, exports, __webpack_require__) {
  8228. module.exports = __webpack_require__(/*! regenerator-runtime */ 16);
  8229. /***/ }),
  8230. /* 16 */
  8231. /*!************************************************************!*\
  8232. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  8233. \************************************************************/
  8234. /*! no static exports found */
  8235. /***/ (function(module, exports, __webpack_require__) {
  8236. /**
  8237. * Copyright (c) 2014-present, Facebook, Inc.
  8238. *
  8239. * This source code is licensed under the MIT license found in the
  8240. * LICENSE file in the root directory of this source tree.
  8241. */
  8242. // This method of obtaining a reference to the global object needs to be
  8243. // kept identical to the way it is obtained in runtime.js
  8244. var g = (function() {
  8245. return this || (typeof self === "object" && self);
  8246. })() || Function("return this")();
  8247. // Use `getOwnPropertyNames` because not all browsers support calling
  8248. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  8249. var hadRuntime = g.regeneratorRuntime &&
  8250. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  8251. // Save the old regeneratorRuntime in case it needs to be restored later.
  8252. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  8253. // Force reevalutation of runtime.js.
  8254. g.regeneratorRuntime = undefined;
  8255. module.exports = __webpack_require__(/*! ./runtime */ 17);
  8256. if (hadRuntime) {
  8257. // Restore the original runtime.
  8258. g.regeneratorRuntime = oldRuntime;
  8259. } else {
  8260. // Remove the global property added by runtime.js.
  8261. try {
  8262. delete g.regeneratorRuntime;
  8263. } catch(e) {
  8264. g.regeneratorRuntime = undefined;
  8265. }
  8266. }
  8267. /***/ }),
  8268. /* 17 */
  8269. /*!*****************************************************!*\
  8270. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  8271. \*****************************************************/
  8272. /*! no static exports found */
  8273. /***/ (function(module, exports) {
  8274. /**
  8275. * Copyright (c) 2014-present, Facebook, Inc.
  8276. *
  8277. * This source code is licensed under the MIT license found in the
  8278. * LICENSE file in the root directory of this source tree.
  8279. */
  8280. !(function(global) {
  8281. "use strict";
  8282. var Op = Object.prototype;
  8283. var hasOwn = Op.hasOwnProperty;
  8284. var undefined; // More compressible than void 0.
  8285. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  8286. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  8287. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  8288. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  8289. var inModule = typeof module === "object";
  8290. var runtime = global.regeneratorRuntime;
  8291. if (runtime) {
  8292. if (inModule) {
  8293. // If regeneratorRuntime is defined globally and we're in a module,
  8294. // make the exports object identical to regeneratorRuntime.
  8295. module.exports = runtime;
  8296. }
  8297. // Don't bother evaluating the rest of this file if the runtime was
  8298. // already defined globally.
  8299. return;
  8300. }
  8301. // Define the runtime globally (as expected by generated code) as either
  8302. // module.exports (if we're in a module) or a new, empty object.
  8303. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  8304. function wrap(innerFn, outerFn, self, tryLocsList) {
  8305. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  8306. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  8307. var generator = Object.create(protoGenerator.prototype);
  8308. var context = new Context(tryLocsList || []);
  8309. // The ._invoke method unifies the implementations of the .next,
  8310. // .throw, and .return methods.
  8311. generator._invoke = makeInvokeMethod(innerFn, self, context);
  8312. return generator;
  8313. }
  8314. runtime.wrap = wrap;
  8315. // Try/catch helper to minimize deoptimizations. Returns a completion
  8316. // record like context.tryEntries[i].completion. This interface could
  8317. // have been (and was previously) designed to take a closure to be
  8318. // invoked without arguments, but in all the cases we care about we
  8319. // already have an existing method we want to call, so there's no need
  8320. // to create a new function object. We can even get away with assuming
  8321. // the method takes exactly one argument, since that happens to be true
  8322. // in every case, so we don't have to touch the arguments object. The
  8323. // only additional allocation required is the completion record, which
  8324. // has a stable shape and so hopefully should be cheap to allocate.
  8325. function tryCatch(fn, obj, arg) {
  8326. try {
  8327. return { type: "normal", arg: fn.call(obj, arg) };
  8328. } catch (err) {
  8329. return { type: "throw", arg: err };
  8330. }
  8331. }
  8332. var GenStateSuspendedStart = "suspendedStart";
  8333. var GenStateSuspendedYield = "suspendedYield";
  8334. var GenStateExecuting = "executing";
  8335. var GenStateCompleted = "completed";
  8336. // Returning this object from the innerFn has the same effect as
  8337. // breaking out of the dispatch switch statement.
  8338. var ContinueSentinel = {};
  8339. // Dummy constructor functions that we use as the .constructor and
  8340. // .constructor.prototype properties for functions that return Generator
  8341. // objects. For full spec compliance, you may wish to configure your
  8342. // minifier not to mangle the names of these two functions.
  8343. function Generator() {}
  8344. function GeneratorFunction() {}
  8345. function GeneratorFunctionPrototype() {}
  8346. // This is a polyfill for %IteratorPrototype% for environments that
  8347. // don't natively support it.
  8348. var IteratorPrototype = {};
  8349. IteratorPrototype[iteratorSymbol] = function () {
  8350. return this;
  8351. };
  8352. var getProto = Object.getPrototypeOf;
  8353. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  8354. if (NativeIteratorPrototype &&
  8355. NativeIteratorPrototype !== Op &&
  8356. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  8357. // This environment has a native %IteratorPrototype%; use it instead
  8358. // of the polyfill.
  8359. IteratorPrototype = NativeIteratorPrototype;
  8360. }
  8361. var Gp = GeneratorFunctionPrototype.prototype =
  8362. Generator.prototype = Object.create(IteratorPrototype);
  8363. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  8364. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  8365. GeneratorFunctionPrototype[toStringTagSymbol] =
  8366. GeneratorFunction.displayName = "GeneratorFunction";
  8367. // Helper for defining the .next, .throw, and .return methods of the
  8368. // Iterator interface in terms of a single ._invoke method.
  8369. function defineIteratorMethods(prototype) {
  8370. ["next", "throw", "return"].forEach(function(method) {
  8371. prototype[method] = function(arg) {
  8372. return this._invoke(method, arg);
  8373. };
  8374. });
  8375. }
  8376. runtime.isGeneratorFunction = function(genFun) {
  8377. var ctor = typeof genFun === "function" && genFun.constructor;
  8378. return ctor
  8379. ? ctor === GeneratorFunction ||
  8380. // For the native GeneratorFunction constructor, the best we can
  8381. // do is to check its .name property.
  8382. (ctor.displayName || ctor.name) === "GeneratorFunction"
  8383. : false;
  8384. };
  8385. runtime.mark = function(genFun) {
  8386. if (Object.setPrototypeOf) {
  8387. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  8388. } else {
  8389. genFun.__proto__ = GeneratorFunctionPrototype;
  8390. if (!(toStringTagSymbol in genFun)) {
  8391. genFun[toStringTagSymbol] = "GeneratorFunction";
  8392. }
  8393. }
  8394. genFun.prototype = Object.create(Gp);
  8395. return genFun;
  8396. };
  8397. // Within the body of any async function, `await x` is transformed to
  8398. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  8399. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  8400. // meant to be awaited.
  8401. runtime.awrap = function(arg) {
  8402. return { __await: arg };
  8403. };
  8404. function AsyncIterator(generator) {
  8405. function invoke(method, arg, resolve, reject) {
  8406. var record = tryCatch(generator[method], generator, arg);
  8407. if (record.type === "throw") {
  8408. reject(record.arg);
  8409. } else {
  8410. var result = record.arg;
  8411. var value = result.value;
  8412. if (value &&
  8413. typeof value === "object" &&
  8414. hasOwn.call(value, "__await")) {
  8415. return Promise.resolve(value.__await).then(function(value) {
  8416. invoke("next", value, resolve, reject);
  8417. }, function(err) {
  8418. invoke("throw", err, resolve, reject);
  8419. });
  8420. }
  8421. return Promise.resolve(value).then(function(unwrapped) {
  8422. // When a yielded Promise is resolved, its final value becomes
  8423. // the .value of the Promise<{value,done}> result for the
  8424. // current iteration.
  8425. result.value = unwrapped;
  8426. resolve(result);
  8427. }, function(error) {
  8428. // If a rejected Promise was yielded, throw the rejection back
  8429. // into the async generator function so it can be handled there.
  8430. return invoke("throw", error, resolve, reject);
  8431. });
  8432. }
  8433. }
  8434. var previousPromise;
  8435. function enqueue(method, arg) {
  8436. function callInvokeWithMethodAndArg() {
  8437. return new Promise(function(resolve, reject) {
  8438. invoke(method, arg, resolve, reject);
  8439. });
  8440. }
  8441. return previousPromise =
  8442. // If enqueue has been called before, then we want to wait until
  8443. // all previous Promises have been resolved before calling invoke,
  8444. // so that results are always delivered in the correct order. If
  8445. // enqueue has not been called before, then it is important to
  8446. // call invoke immediately, without waiting on a callback to fire,
  8447. // so that the async generator function has the opportunity to do
  8448. // any necessary setup in a predictable way. This predictability
  8449. // is why the Promise constructor synchronously invokes its
  8450. // executor callback, and why async functions synchronously
  8451. // execute code before the first await. Since we implement simple
  8452. // async functions in terms of async generators, it is especially
  8453. // important to get this right, even though it requires care.
  8454. previousPromise ? previousPromise.then(
  8455. callInvokeWithMethodAndArg,
  8456. // Avoid propagating failures to Promises returned by later
  8457. // invocations of the iterator.
  8458. callInvokeWithMethodAndArg
  8459. ) : callInvokeWithMethodAndArg();
  8460. }
  8461. // Define the unified helper method that is used to implement .next,
  8462. // .throw, and .return (see defineIteratorMethods).
  8463. this._invoke = enqueue;
  8464. }
  8465. defineIteratorMethods(AsyncIterator.prototype);
  8466. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  8467. return this;
  8468. };
  8469. runtime.AsyncIterator = AsyncIterator;
  8470. // Note that simple async functions are implemented on top of
  8471. // AsyncIterator objects; they just return a Promise for the value of
  8472. // the final result produced by the iterator.
  8473. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  8474. var iter = new AsyncIterator(
  8475. wrap(innerFn, outerFn, self, tryLocsList)
  8476. );
  8477. return runtime.isGeneratorFunction(outerFn)
  8478. ? iter // If outerFn is a generator, return the full iterator.
  8479. : iter.next().then(function(result) {
  8480. return result.done ? result.value : iter.next();
  8481. });
  8482. };
  8483. function makeInvokeMethod(innerFn, self, context) {
  8484. var state = GenStateSuspendedStart;
  8485. return function invoke(method, arg) {
  8486. if (state === GenStateExecuting) {
  8487. throw new Error("Generator is already running");
  8488. }
  8489. if (state === GenStateCompleted) {
  8490. if (method === "throw") {
  8491. throw arg;
  8492. }
  8493. // Be forgiving, per 25.3.3.3.3 of the spec:
  8494. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  8495. return doneResult();
  8496. }
  8497. context.method = method;
  8498. context.arg = arg;
  8499. while (true) {
  8500. var delegate = context.delegate;
  8501. if (delegate) {
  8502. var delegateResult = maybeInvokeDelegate(delegate, context);
  8503. if (delegateResult) {
  8504. if (delegateResult === ContinueSentinel) continue;
  8505. return delegateResult;
  8506. }
  8507. }
  8508. if (context.method === "next") {
  8509. // Setting context._sent for legacy support of Babel's
  8510. // function.sent implementation.
  8511. context.sent = context._sent = context.arg;
  8512. } else if (context.method === "throw") {
  8513. if (state === GenStateSuspendedStart) {
  8514. state = GenStateCompleted;
  8515. throw context.arg;
  8516. }
  8517. context.dispatchException(context.arg);
  8518. } else if (context.method === "return") {
  8519. context.abrupt("return", context.arg);
  8520. }
  8521. state = GenStateExecuting;
  8522. var record = tryCatch(innerFn, self, context);
  8523. if (record.type === "normal") {
  8524. // If an exception is thrown from innerFn, we leave state ===
  8525. // GenStateExecuting and loop back for another invocation.
  8526. state = context.done
  8527. ? GenStateCompleted
  8528. : GenStateSuspendedYield;
  8529. if (record.arg === ContinueSentinel) {
  8530. continue;
  8531. }
  8532. return {
  8533. value: record.arg,
  8534. done: context.done
  8535. };
  8536. } else if (record.type === "throw") {
  8537. state = GenStateCompleted;
  8538. // Dispatch the exception by looping back around to the
  8539. // context.dispatchException(context.arg) call above.
  8540. context.method = "throw";
  8541. context.arg = record.arg;
  8542. }
  8543. }
  8544. };
  8545. }
  8546. // Call delegate.iterator[context.method](context.arg) and handle the
  8547. // result, either by returning a { value, done } result from the
  8548. // delegate iterator, or by modifying context.method and context.arg,
  8549. // setting context.delegate to null, and returning the ContinueSentinel.
  8550. function maybeInvokeDelegate(delegate, context) {
  8551. var method = delegate.iterator[context.method];
  8552. if (method === undefined) {
  8553. // A .throw or .return when the delegate iterator has no .throw
  8554. // method always terminates the yield* loop.
  8555. context.delegate = null;
  8556. if (context.method === "throw") {
  8557. if (delegate.iterator.return) {
  8558. // If the delegate iterator has a return method, give it a
  8559. // chance to clean up.
  8560. context.method = "return";
  8561. context.arg = undefined;
  8562. maybeInvokeDelegate(delegate, context);
  8563. if (context.method === "throw") {
  8564. // If maybeInvokeDelegate(context) changed context.method from
  8565. // "return" to "throw", let that override the TypeError below.
  8566. return ContinueSentinel;
  8567. }
  8568. }
  8569. context.method = "throw";
  8570. context.arg = new TypeError(
  8571. "The iterator does not provide a 'throw' method");
  8572. }
  8573. return ContinueSentinel;
  8574. }
  8575. var record = tryCatch(method, delegate.iterator, context.arg);
  8576. if (record.type === "throw") {
  8577. context.method = "throw";
  8578. context.arg = record.arg;
  8579. context.delegate = null;
  8580. return ContinueSentinel;
  8581. }
  8582. var info = record.arg;
  8583. if (! info) {
  8584. context.method = "throw";
  8585. context.arg = new TypeError("iterator result is not an object");
  8586. context.delegate = null;
  8587. return ContinueSentinel;
  8588. }
  8589. if (info.done) {
  8590. // Assign the result of the finished delegate to the temporary
  8591. // variable specified by delegate.resultName (see delegateYield).
  8592. context[delegate.resultName] = info.value;
  8593. // Resume execution at the desired location (see delegateYield).
  8594. context.next = delegate.nextLoc;
  8595. // If context.method was "throw" but the delegate handled the
  8596. // exception, let the outer generator proceed normally. If
  8597. // context.method was "next", forget context.arg since it has been
  8598. // "consumed" by the delegate iterator. If context.method was
  8599. // "return", allow the original .return call to continue in the
  8600. // outer generator.
  8601. if (context.method !== "return") {
  8602. context.method = "next";
  8603. context.arg = undefined;
  8604. }
  8605. } else {
  8606. // Re-yield the result returned by the delegate method.
  8607. return info;
  8608. }
  8609. // The delegate iterator is finished, so forget it and continue with
  8610. // the outer generator.
  8611. context.delegate = null;
  8612. return ContinueSentinel;
  8613. }
  8614. // Define Generator.prototype.{next,throw,return} in terms of the
  8615. // unified ._invoke helper method.
  8616. defineIteratorMethods(Gp);
  8617. Gp[toStringTagSymbol] = "Generator";
  8618. // A Generator should always return itself as the iterator object when the
  8619. // @@iterator function is called on it. Some browsers' implementations of the
  8620. // iterator prototype chain incorrectly implement this, causing the Generator
  8621. // object to not be returned from this call. This ensures that doesn't happen.
  8622. // See https://github.com/facebook/regenerator/issues/274 for more details.
  8623. Gp[iteratorSymbol] = function() {
  8624. return this;
  8625. };
  8626. Gp.toString = function() {
  8627. return "[object Generator]";
  8628. };
  8629. function pushTryEntry(locs) {
  8630. var entry = { tryLoc: locs[0] };
  8631. if (1 in locs) {
  8632. entry.catchLoc = locs[1];
  8633. }
  8634. if (2 in locs) {
  8635. entry.finallyLoc = locs[2];
  8636. entry.afterLoc = locs[3];
  8637. }
  8638. this.tryEntries.push(entry);
  8639. }
  8640. function resetTryEntry(entry) {
  8641. var record = entry.completion || {};
  8642. record.type = "normal";
  8643. delete record.arg;
  8644. entry.completion = record;
  8645. }
  8646. function Context(tryLocsList) {
  8647. // The root entry object (effectively a try statement without a catch
  8648. // or a finally block) gives us a place to store values thrown from
  8649. // locations where there is no enclosing try statement.
  8650. this.tryEntries = [{ tryLoc: "root" }];
  8651. tryLocsList.forEach(pushTryEntry, this);
  8652. this.reset(true);
  8653. }
  8654. runtime.keys = function(object) {
  8655. var keys = [];
  8656. for (var key in object) {
  8657. keys.push(key);
  8658. }
  8659. keys.reverse();
  8660. // Rather than returning an object with a next method, we keep
  8661. // things simple and return the next function itself.
  8662. return function next() {
  8663. while (keys.length) {
  8664. var key = keys.pop();
  8665. if (key in object) {
  8666. next.value = key;
  8667. next.done = false;
  8668. return next;
  8669. }
  8670. }
  8671. // To avoid creating an additional object, we just hang the .value
  8672. // and .done properties off the next function object itself. This
  8673. // also ensures that the minifier will not anonymize the function.
  8674. next.done = true;
  8675. return next;
  8676. };
  8677. };
  8678. function values(iterable) {
  8679. if (iterable) {
  8680. var iteratorMethod = iterable[iteratorSymbol];
  8681. if (iteratorMethod) {
  8682. return iteratorMethod.call(iterable);
  8683. }
  8684. if (typeof iterable.next === "function") {
  8685. return iterable;
  8686. }
  8687. if (!isNaN(iterable.length)) {
  8688. var i = -1, next = function next() {
  8689. while (++i < iterable.length) {
  8690. if (hasOwn.call(iterable, i)) {
  8691. next.value = iterable[i];
  8692. next.done = false;
  8693. return next;
  8694. }
  8695. }
  8696. next.value = undefined;
  8697. next.done = true;
  8698. return next;
  8699. };
  8700. return next.next = next;
  8701. }
  8702. }
  8703. // Return an iterator with no values.
  8704. return { next: doneResult };
  8705. }
  8706. runtime.values = values;
  8707. function doneResult() {
  8708. return { value: undefined, done: true };
  8709. }
  8710. Context.prototype = {
  8711. constructor: Context,
  8712. reset: function(skipTempReset) {
  8713. this.prev = 0;
  8714. this.next = 0;
  8715. // Resetting context._sent for legacy support of Babel's
  8716. // function.sent implementation.
  8717. this.sent = this._sent = undefined;
  8718. this.done = false;
  8719. this.delegate = null;
  8720. this.method = "next";
  8721. this.arg = undefined;
  8722. this.tryEntries.forEach(resetTryEntry);
  8723. if (!skipTempReset) {
  8724. for (var name in this) {
  8725. // Not sure about the optimal order of these conditions:
  8726. if (name.charAt(0) === "t" &&
  8727. hasOwn.call(this, name) &&
  8728. !isNaN(+name.slice(1))) {
  8729. this[name] = undefined;
  8730. }
  8731. }
  8732. }
  8733. },
  8734. stop: function() {
  8735. this.done = true;
  8736. var rootEntry = this.tryEntries[0];
  8737. var rootRecord = rootEntry.completion;
  8738. if (rootRecord.type === "throw") {
  8739. throw rootRecord.arg;
  8740. }
  8741. return this.rval;
  8742. },
  8743. dispatchException: function(exception) {
  8744. if (this.done) {
  8745. throw exception;
  8746. }
  8747. var context = this;
  8748. function handle(loc, caught) {
  8749. record.type = "throw";
  8750. record.arg = exception;
  8751. context.next = loc;
  8752. if (caught) {
  8753. // If the dispatched exception was caught by a catch block,
  8754. // then let that catch block handle the exception normally.
  8755. context.method = "next";
  8756. context.arg = undefined;
  8757. }
  8758. return !! caught;
  8759. }
  8760. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8761. var entry = this.tryEntries[i];
  8762. var record = entry.completion;
  8763. if (entry.tryLoc === "root") {
  8764. // Exception thrown outside of any try block that could handle
  8765. // it, so set the completion value of the entire function to
  8766. // throw the exception.
  8767. return handle("end");
  8768. }
  8769. if (entry.tryLoc <= this.prev) {
  8770. var hasCatch = hasOwn.call(entry, "catchLoc");
  8771. var hasFinally = hasOwn.call(entry, "finallyLoc");
  8772. if (hasCatch && hasFinally) {
  8773. if (this.prev < entry.catchLoc) {
  8774. return handle(entry.catchLoc, true);
  8775. } else if (this.prev < entry.finallyLoc) {
  8776. return handle(entry.finallyLoc);
  8777. }
  8778. } else if (hasCatch) {
  8779. if (this.prev < entry.catchLoc) {
  8780. return handle(entry.catchLoc, true);
  8781. }
  8782. } else if (hasFinally) {
  8783. if (this.prev < entry.finallyLoc) {
  8784. return handle(entry.finallyLoc);
  8785. }
  8786. } else {
  8787. throw new Error("try statement without catch or finally");
  8788. }
  8789. }
  8790. }
  8791. },
  8792. abrupt: function(type, arg) {
  8793. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8794. var entry = this.tryEntries[i];
  8795. if (entry.tryLoc <= this.prev &&
  8796. hasOwn.call(entry, "finallyLoc") &&
  8797. this.prev < entry.finallyLoc) {
  8798. var finallyEntry = entry;
  8799. break;
  8800. }
  8801. }
  8802. if (finallyEntry &&
  8803. (type === "break" ||
  8804. type === "continue") &&
  8805. finallyEntry.tryLoc <= arg &&
  8806. arg <= finallyEntry.finallyLoc) {
  8807. // Ignore the finally entry if control is not jumping to a
  8808. // location outside the try/catch block.
  8809. finallyEntry = null;
  8810. }
  8811. var record = finallyEntry ? finallyEntry.completion : {};
  8812. record.type = type;
  8813. record.arg = arg;
  8814. if (finallyEntry) {
  8815. this.method = "next";
  8816. this.next = finallyEntry.finallyLoc;
  8817. return ContinueSentinel;
  8818. }
  8819. return this.complete(record);
  8820. },
  8821. complete: function(record, afterLoc) {
  8822. if (record.type === "throw") {
  8823. throw record.arg;
  8824. }
  8825. if (record.type === "break" ||
  8826. record.type === "continue") {
  8827. this.next = record.arg;
  8828. } else if (record.type === "return") {
  8829. this.rval = this.arg = record.arg;
  8830. this.method = "return";
  8831. this.next = "end";
  8832. } else if (record.type === "normal" && afterLoc) {
  8833. this.next = afterLoc;
  8834. }
  8835. return ContinueSentinel;
  8836. },
  8837. finish: function(finallyLoc) {
  8838. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8839. var entry = this.tryEntries[i];
  8840. if (entry.finallyLoc === finallyLoc) {
  8841. this.complete(entry.completion, entry.afterLoc);
  8842. resetTryEntry(entry);
  8843. return ContinueSentinel;
  8844. }
  8845. }
  8846. },
  8847. "catch": function(tryLoc) {
  8848. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8849. var entry = this.tryEntries[i];
  8850. if (entry.tryLoc === tryLoc) {
  8851. var record = entry.completion;
  8852. if (record.type === "throw") {
  8853. var thrown = record.arg;
  8854. resetTryEntry(entry);
  8855. }
  8856. return thrown;
  8857. }
  8858. }
  8859. // The context.catch method must only be called with a location
  8860. // argument that corresponds to a known catch block.
  8861. throw new Error("illegal catch attempt");
  8862. },
  8863. delegateYield: function(iterable, resultName, nextLoc) {
  8864. this.delegate = {
  8865. iterator: values(iterable),
  8866. resultName: resultName,
  8867. nextLoc: nextLoc
  8868. };
  8869. if (this.method === "next") {
  8870. // Deliberately forget the last sent value so that we don't
  8871. // accidentally pass it on to the delegate.
  8872. this.arg = undefined;
  8873. }
  8874. return ContinueSentinel;
  8875. }
  8876. };
  8877. })(
  8878. // In sloppy mode, unbound `this` refers to the global object, fallback to
  8879. // Function constructor if we're in global strict mode. That is sadly a form
  8880. // of indirect eval which violates Content Security Policy.
  8881. (function() {
  8882. return this || (typeof self === "object" && self);
  8883. })() || Function("return this")()
  8884. );
  8885. /***/ }),
  8886. /* 18 */
  8887. /*!**********************************************!*\
  8888. !*** F:/uniapp/sqxp-uniapp/utils/request.js ***!
  8889. \**********************************************/
  8890. /*! no static exports found */
  8891. /***/ (function(module, exports, __webpack_require__) {
  8892. "use strict";
  8893. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 15));var _auth = __webpack_require__(/*! @/utils/auth */ 19);
  8894. var _login = __webpack_require__(/*! @/api/login.js */ 14);
  8895. var _errorCode = _interopRequireDefault(__webpack_require__(/*! @/utils/errorCode */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  8896. /**
  8897. * http请求封装
  8898. */
  8899. var myAxios = function myAxios(req) {
  8900. var query = '';
  8901. req.params && Object.keys(req.params).map(function (key, index) {
  8902. if (index) {
  8903. query += '&' + key + '=' + encodeURIComponent(req.params[key]);
  8904. } else {
  8905. query += '?' + key + '=' + encodeURIComponent(req.params[key]);
  8906. }
  8907. });
  8908. var reqData = {
  8909. url: req.baseURL ? req.baseURL : '' + req.url + query,
  8910. method: req.method,
  8911. data: _objectSpread({},
  8912. req.data),
  8913. header: _objectSpread({},
  8914. req.header),
  8915. timeout: req.timeout || 10000 };
  8916. // 请求拦截器
  8917. function reqMiddleware(_x) {return _reqMiddleware.apply(this, arguments);}
  8918. // 响应拦截器
  8919. function _reqMiddleware() {_reqMiddleware = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(config) {var token;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:if (!config.header.isLogin) {_context3.next = 2;break;}return _context3.abrupt("return", config);case 2:_context3.next = 4;return (0, _auth.getToken)();case 4:token = _context3.sent;config.header['Authorization'] = 'Bearer ' + token; // 让每个请求携带自定义token 请根据实际情况自行修改
  8920. return _context3.abrupt("return", config);case 7:case "end":return _context3.stop();}}}, _callee3);}));return _reqMiddleware.apply(this, arguments);}function resMiddleware(_x2) {return _resMiddleware.apply(this, arguments);}
  8921. // 2. 函数内部返回Promise 对象
  8922. function _resMiddleware() {_resMiddleware = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(res) {var code, msg;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:code = res.data.code || 200; // 获取错误信息
  8923. msg = _errorCode.default[code] || res.data.msg || _errorCode.default['default']; //重置Authorization时间
  8924. if (code !== 401) (0, _auth.refreshToken)();if (code === 401) {console.log('拦截器信息:' + msg); // this.$store.dispatch('Login')
  8925. } else if (code === 500) {console.log('拦截器信息:' + msg);} else if (code === 502) {console.log('拦截器信息:' + msg);} else if (code !== 200) {console.log('拦截器信息:' + msg);}return _context4.abrupt("return", res.data);case 5:case "end":return _context4.stop();}}}, _callee4);}));return _resMiddleware.apply(this, arguments);}return new Promise( /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return reqMiddleware(reqData);case 2:reqData = _context2.sent; // 3.wx.request() 小程序发送请求
  8926. wx.request(_objectSpread(_objectSpread({},
  8927. reqData), {}, {
  8928. // 请求成功之后调用的函数
  8929. success: function () {var _success = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(result) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  8930. resMiddleware(result));case 2:result = _context.sent;
  8931. resolve(result);case 4:case "end":return _context.stop();}}}, _callee);}));function success(_x5) {return _success.apply(this, arguments);}return success;}(),
  8932. // 请求失败之后调用的函数
  8933. fail: function fail(error) {
  8934. reject(error);
  8935. },
  8936. complete: function complete() {
  8937. } }));case 4:case "end":return _context2.stop();}}}, _callee2);}));return function (_x3, _x4) {return _ref.apply(this, arguments);};}());
  8938. };var _default =
  8939. myAxios;exports.default = _default;
  8940. /***/ }),
  8941. /* 19 */
  8942. /*!*******************************************!*\
  8943. !*** F:/uniapp/sqxp-uniapp/utils/auth.js ***!
  8944. \*******************************************/
  8945. /*! no static exports found */
  8946. /***/ (function(module, exports, __webpack_require__) {
  8947. "use strict";
  8948. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getToken = getToken;exports.setToken = setToken;exports.refreshToken = refreshToken;exports.removeToken = removeToken;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 15));
  8949. var _login = __webpack_require__(/*! @/api/login.js */ 14);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  8950. var TokenKey = 'Admin-Token';
  8951. //获取token
  8952. function getToken() {return _getToken.apply(this, arguments);}
  8953. //设置token
  8954. function _getToken() {_getToken = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var tokenObj, res;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:tokenObj = uni.getStorageSync(TokenKey);if (!(new Date().getTime() - tokenObj.date < 1000 * 60 * 28)) {_context.next = 5;break;}return _context.abrupt("return", tokenObj.token);case 5:_context.next = 7;return (0, _login.login)();case 7:res = _context.sent;setToken(res.data.token);return _context.abrupt("return", res.data.token);case 10:case "end":return _context.stop();}}}, _callee);}));return _getToken.apply(this, arguments);}function setToken(token) {
  8955. var tokenObj = {
  8956. token: token,
  8957. date: new Date().getTime() };
  8958. return uni.setStorageSync(TokenKey, tokenObj);
  8959. }
  8960. //刷新token时间
  8961. function refreshToken(token) {
  8962. var tokenObj = uni.getStorageSync(TokenKey);
  8963. if (!tokenObj) return;
  8964. tokenObj.date = new Date().getTime();
  8965. return uni.setStorageSync(TokenKey, tokenObj);
  8966. }
  8967. //移除token
  8968. function removeToken() {
  8969. return uni.removeStorageSync(TokenKey);
  8970. }
  8971. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8972. /***/ }),
  8973. /* 20 */
  8974. /*!************************************************!*\
  8975. !*** F:/uniapp/sqxp-uniapp/utils/errorCode.js ***!
  8976. \************************************************/
  8977. /*! no static exports found */
  8978. /***/ (function(module, exports, __webpack_require__) {
  8979. "use strict";
  8980. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  8981. '401': '认证失败,无法访问系统资源',
  8982. '403': '当前操作没有权限',
  8983. '404': '访问资源不存在',
  8984. '500': '系统内部错误',
  8985. 'default': '系统未知错误,请反馈给管理员' };exports.default = _default;
  8986. /***/ }),
  8987. /* 21 */
  8988. /*!********************************************!*\
  8989. !*** F:/uniapp/sqxp-uniapp/api/baseurl.js ***!
  8990. \********************************************/
  8991. /*! no static exports found */
  8992. /***/ (function(module, exports, __webpack_require__) {
  8993. "use strict";
  8994. Object.defineProperty(exports, "__esModule", { value: true });exports.baseUrl = void 0; // export const baseUrl = 'http://192.168.8.219:8080';
  8995. var baseUrl = 'http://192.168.8.213:8080/zzjs-admin';
  8996. // export const baseUrl = 'https://zzjs.zzxcx.net/prod-api';
  8997. exports.baseUrl = baseUrl;
  8998. /***/ }),
  8999. /* 22 */
  9000. /*!*****************************************************!*\
  9001. !*** F:/uniapp/sqxp-uniapp/store/modules/cinema.js ***!
  9002. \*****************************************************/
  9003. /*! no static exports found */
  9004. /***/ (function(module, exports, __webpack_require__) {
  9005. "use strict";
  9006. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var cinema = {
  9007. state: {
  9008. filmList: null,
  9009. filmDiscount: 1,
  9010. discountRule: {} },
  9011. mutations: {
  9012. SET_FILMLIST: function SET_FILMLIST(state, filmList) {
  9013. state.filmList = filmList;
  9014. },
  9015. SET_FILMDISCOUNT: function SET_FILMDISCOUNT(state, filmDiscount) {
  9016. state.filmDiscount = filmDiscount;
  9017. },
  9018. SET_DISCOUNTRULE: function SET_DISCOUNTRULE(state, discountRule) {
  9019. state.discountRule = discountRule;
  9020. } } };var _default =
  9021. cinema;exports.default = _default;
  9022. /***/ }),
  9023. /* 23 */
  9024. /*!**********************************************!*\
  9025. !*** F:/uniapp/sqxp-uniapp/store/getters.js ***!
  9026. \**********************************************/
  9027. /*! no static exports found */
  9028. /***/ (function(module, exports, __webpack_require__) {
  9029. "use strict";
  9030. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var getters = {
  9031. token: function token(state) {return state.user.token;},
  9032. userInfo: function userInfo(state) {return state.user.userInfo;},
  9033. avatar: function avatar(state) {return state.user.avatar;},
  9034. name: function name(state) {return state.user.name;},
  9035. introduction: function introduction(state) {return state.user.introduction;},
  9036. roles: function roles(state) {return state.user.roles;},
  9037. permissions: function permissions(state) {return state.user.permissions;} };var _default =
  9038. getters;exports.default = _default;
  9039. /***/ }),
  9040. /* 24 */
  9041. /*!**************************************************************!*\
  9042. !*** F:/uniapp/sqxp-uniapp/wxcomponents/vant/toast/toast.js ***!
  9043. \**************************************************************/
  9044. /*! no static exports found */
  9045. /***/ (function(module, exports, __webpack_require__) {
  9046. "use strict";
  9047. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _validator = __webpack_require__(/*! ../common/validator */ 25);
  9048. var defaultOptions = {
  9049. type: 'text',
  9050. mask: false,
  9051. message: '',
  9052. show: true,
  9053. zIndex: 1000,
  9054. duration: 2000,
  9055. position: 'middle',
  9056. forbidClick: false,
  9057. loadingType: 'circular',
  9058. selector: '#van-toast' };
  9059. var queue = [];
  9060. var currentOptions = Object.assign({}, defaultOptions);
  9061. function parseOptions(message) {
  9062. return (0, _validator.isObj)(message) ? message : { message: message };
  9063. }
  9064. function getContext() {
  9065. var pages = getCurrentPages();
  9066. return pages[pages.length - 1];
  9067. }
  9068. function Toast(toastOptions) {
  9069. var options = Object.assign(
  9070. Object.assign({}, currentOptions),
  9071. parseOptions(toastOptions));
  9072. var context = options.context || getContext();
  9073. var toast = context.selectComponent(options.selector);
  9074. if (!toast) {
  9075. console.warn('未找到 van-toast 节点,请确认 selector 及 context 是否正确');
  9076. return;
  9077. }
  9078. delete options.context;
  9079. delete options.selector;
  9080. toast.clear = function () {
  9081. toast.setData({ show: false });
  9082. if (options.onClose) {
  9083. options.onClose();
  9084. }
  9085. };
  9086. queue.push(toast);
  9087. toast.setData(options);
  9088. clearTimeout(toast.timer);
  9089. if (options.duration != null && options.duration > 0) {
  9090. toast.timer = setTimeout(function () {
  9091. toast.clear();
  9092. queue = queue.filter(function (item) {return item !== toast;});
  9093. }, options.duration);
  9094. }
  9095. return toast;
  9096. }
  9097. var createMethod = function createMethod(type) {return function (options) {return (
  9098. Toast(Object.assign({ type: type }, parseOptions(options))));};};
  9099. Toast.loading = createMethod('loading');
  9100. Toast.success = createMethod('success');
  9101. Toast.fail = createMethod('fail');
  9102. Toast.clear = function () {
  9103. queue.forEach(function (toast) {
  9104. toast.clear();
  9105. });
  9106. queue = [];
  9107. };
  9108. Toast.setDefaultOptions = function (options) {
  9109. Object.assign(currentOptions, options);
  9110. };
  9111. Toast.resetDefaultOptions = function () {
  9112. currentOptions = Object.assign({}, defaultOptions);
  9113. };var _default =
  9114. Toast;exports.default = _default;
  9115. /***/ }),
  9116. /* 25 */
  9117. /*!*******************************************************************!*\
  9118. !*** F:/uniapp/sqxp-uniapp/wxcomponents/vant/common/validator.js ***!
  9119. \*******************************************************************/
  9120. /*! no static exports found */
  9121. /***/ (function(module, exports, __webpack_require__) {
  9122. "use strict";
  9123. Object.defineProperty(exports, "__esModule", { value: true });exports.isFunction = isFunction;exports.isPlainObject = isPlainObject;exports.isPromise = isPromise;exports.isDef = isDef;exports.isObj = isObj;exports.isNumber = isNumber;exports.isBoolean = isBoolean;exports.isImageUrl = isImageUrl;exports.isVideoUrl = isVideoUrl;function isFunction(val) {
  9124. return typeof val === 'function';
  9125. }
  9126. function isPlainObject(val) {
  9127. return val !== null && typeof val === 'object' && !Array.isArray(val);
  9128. }
  9129. function isPromise(val) {
  9130. return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch);
  9131. }
  9132. function isDef(value) {
  9133. return value !== undefined && value !== null;
  9134. }
  9135. function isObj(x) {
  9136. var type = typeof x;
  9137. return x !== null && (type === 'object' || type === 'function');
  9138. }
  9139. function isNumber(value) {
  9140. return /^\d+(\.\d+)?$/.test(value);
  9141. }
  9142. function isBoolean(value) {
  9143. return typeof value === 'boolean';
  9144. }
  9145. var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
  9146. var VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i;
  9147. function isImageUrl(url) {
  9148. return IMAGE_REGEXP.test(url);
  9149. }
  9150. function isVideoUrl(url) {
  9151. return VIDEO_REGEXP.test(url);
  9152. }
  9153. /***/ }),
  9154. /* 26 */
  9155. /*!********************************************!*\
  9156. !*** F:/uniapp/sqxp-uniapp/utils/utils.js ***!
  9157. \********************************************/
  9158. /*! no static exports found */
  9159. /***/ (function(module, exports, __webpack_require__) {
  9160. "use strict";
  9161. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.debounce = debounce;exports.debounce1 = debounce1;exports.goMiniApp = goMiniApp;exports.goPage = goPage;exports.clickJumpType = clickJumpType;exports.wxPay = wxPay;var _applist = __webpack_require__(/*! @/api/applist.js */ 27);
  9162. var _sha = _interopRequireDefault(__webpack_require__(/*! crypto-js/sha256 */ 28));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  9163. //防抖函数
  9164. function debounce(func, fnThis, wait) {
  9165. var timer;
  9166. return function () {
  9167. timer && clearTimeout(timer);
  9168. timer = setTimeout(function () {
  9169. func.call(fnThis);
  9170. timer = null;
  9171. }, wait);
  9172. };
  9173. }
  9174. //节流函数
  9175. function debounce1(func, fnThis, wait) {
  9176. var timer;
  9177. return function () {
  9178. clearTimeout(timer);
  9179. timer = setTimeout(func.bind(fnThis), wait);
  9180. };
  9181. }
  9182. var goMiniAppFlag = false;
  9183. //跳转小程序
  9184. function goMiniApp(data, item) {
  9185. if (goMiniAppFlag) return;
  9186. goMiniAppFlag = true;
  9187. var myData = JSON.parse(data);
  9188. wx.navigateToMiniProgram(_objectSpread(_objectSpread({},
  9189. myData), {}, {
  9190. success: function success(res) {
  9191. // 打开成功
  9192. goMiniAppFlag = false;
  9193. item && (0, _applist.BrowseRecordAdd)(item.id);
  9194. },
  9195. fail: function fail() {
  9196. goMiniAppFlag = false;
  9197. } }));
  9198. }
  9199. //跳转页面
  9200. function goPage(url, type) {
  9201. if (type == 'reLaunch') {
  9202. uni.reLaunch({
  9203. url: url });
  9204. return;
  9205. }
  9206. if (type == 'redirectTo') {
  9207. uni.redirectTo({
  9208. url: url });
  9209. return;
  9210. }
  9211. uni.navigateTo({
  9212. url: url });
  9213. }
  9214. //根据类型跳转
  9215. function clickJumpType(item) {
  9216. if (item.jumpUrlType == 'goMiniApp') {
  9217. goMiniApp(item.jumpUrl);
  9218. }
  9219. if (item.jumpUrlType == 'goPage') {
  9220. goPage(item.jumpUrl);
  9221. }
  9222. if (item.jumpUrlType == 'goWebView') {
  9223. goPage("/pages/webview/webview?src=".concat(item.jumpUrl));
  9224. }
  9225. }
  9226. function base64_encode(str) {
  9227. var c1, c2, c3;
  9228. var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  9229. var i = 0,
  9230. len = str.length,
  9231. string = '';
  9232. while (i < len) {
  9233. c1 = str.charCodeAt(i++) & 0xff;
  9234. if (i == len) {
  9235. string += base64EncodeChars.charAt(c1 >> 2);
  9236. string += base64EncodeChars.charAt((c1 & 0x3) << 4);
  9237. string += "==";
  9238. break;
  9239. }
  9240. c2 = str.charCodeAt(i++);
  9241. if (i == len) {
  9242. string += base64EncodeChars.charAt(c1 >> 2);
  9243. string += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
  9244. string += base64EncodeChars.charAt((c2 & 0xF) << 2);
  9245. string += "=";
  9246. break;
  9247. }
  9248. c3 = str.charCodeAt(i++);
  9249. string += base64EncodeChars.charAt(c1 >> 2);
  9250. string += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
  9251. string += base64EncodeChars.charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6);
  9252. string += base64EncodeChars.charAt(c3 & 0x3F);
  9253. }
  9254. return string;
  9255. }
  9256. //微信支付调起支付
  9257. function wxPay(data) {
  9258. wx.requestPayment(_objectSpread({},
  9259. data));
  9260. }
  9261. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9262. /***/ }),
  9263. /* 27 */
  9264. /*!********************************************!*\
  9265. !*** F:/uniapp/sqxp-uniapp/api/applist.js ***!
  9266. \********************************************/
  9267. /*! no static exports found */
  9268. /***/ (function(module, exports, __webpack_require__) {
  9269. "use strict";
  9270. Object.defineProperty(exports, "__esModule", { value: true });exports.getTypeAppList = getTypeAppList;exports.collectionList = collectionList;exports.getBrowseRecordInfoList = getBrowseRecordInfoList;exports.typeList = typeList;exports.addFavorites = addFavorites;exports.delFavorites = delFavorites;exports.BrowseRecordAdd = BrowseRecordAdd;exports.BrowseRecordDel = BrowseRecordDel;exports.getCarouselChartList = getCarouselChartList;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  9271. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9272. // 按品类查询商家列表
  9273. function getTypeAppList(id, params) {
  9274. return (0, _request.default)({
  9275. url: _baseurl.baseUrl + "/student/applet/customer/getCustomerListByProductId/".concat(id),
  9276. method: 'get',
  9277. params: params });
  9278. }
  9279. // 查询用户收藏列表
  9280. function collectionList(params) {
  9281. return (0, _request.default)({
  9282. url: _baseurl.baseUrl + '/student/applet/collection/collectionList',
  9283. method: 'get',
  9284. params: params });
  9285. }
  9286. // 查询用户浏览记录
  9287. function getBrowseRecordInfoList(params) {
  9288. return (0, _request.default)({
  9289. url: _baseurl.baseUrl + '/student/applet/record/info/getBrowseRecordInfoList',
  9290. method: 'get',
  9291. params: params });
  9292. }
  9293. // 查询品类列表
  9294. function typeList(params) {
  9295. return (0, _request.default)({
  9296. url: _baseurl.baseUrl + '/student/applet/product/info/list',
  9297. method: 'get',
  9298. params: params });
  9299. }
  9300. // 收藏商家
  9301. function addFavorites(id) {
  9302. return (0, _request.default)({
  9303. url: _baseurl.baseUrl + "/student/applet/collection/collectionBusiness/".concat(id),
  9304. method: 'put' });
  9305. }
  9306. // 删除收藏
  9307. function delFavorites(ids) {
  9308. return (0, _request.default)({
  9309. url: _baseurl.baseUrl + "/student/applet/collection/cancelCollection/".concat(ids),
  9310. method: 'delete' });
  9311. }
  9312. // 新增记录
  9313. function BrowseRecordAdd(id) {
  9314. return (0, _request.default)({
  9315. url: _baseurl.baseUrl + "/student/applet/record/info/insertBrowseRecord/".concat(id),
  9316. method: 'put' });
  9317. }
  9318. // 删除记录
  9319. function BrowseRecordDel(ids) {
  9320. return (0, _request.default)({
  9321. url: _baseurl.baseUrl + "/student/applet/record/info/".concat(ids),
  9322. method: 'delete' });
  9323. }
  9324. // 查询轮播图列表
  9325. function getCarouselChartList() {
  9326. return (0, _request.default)({
  9327. url: _baseurl.baseUrl + "/student/applet/homePage/getHomePageDataList",
  9328. method: 'get' });
  9329. }
  9330. /***/ }),
  9331. /* 28 */
  9332. /*!**************************************************************!*\
  9333. !*** F:/uniapp/sqxp-uniapp/node_modules/crypto-js/sha256.js ***!
  9334. \**************************************************************/
  9335. /*! no static exports found */
  9336. /***/ (function(module, exports, __webpack_require__) {
  9337. ;(function (root, factory) {
  9338. if (true) {
  9339. // CommonJS
  9340. module.exports = exports = factory(__webpack_require__(/*! ./core */ 29));
  9341. } else
  9342. {}
  9343. })(this, function (CryptoJS) {
  9344. (function (Math) {
  9345. // Shortcuts
  9346. var C = CryptoJS;
  9347. var C_lib = C.lib;
  9348. var WordArray = C_lib.WordArray;
  9349. var Hasher = C_lib.Hasher;
  9350. var C_algo = C.algo;
  9351. // Initialization and round constants tables
  9352. var H = [];
  9353. var K = [];
  9354. // Compute constants
  9355. (function () {
  9356. function isPrime(n) {
  9357. var sqrtN = Math.sqrt(n);
  9358. for (var factor = 2; factor <= sqrtN; factor++) {
  9359. if (!(n % factor)) {
  9360. return false;
  9361. }
  9362. }
  9363. return true;
  9364. }
  9365. function getFractionalBits(n) {
  9366. return (n - (n | 0)) * 0x100000000 | 0;
  9367. }
  9368. var n = 2;
  9369. var nPrime = 0;
  9370. while (nPrime < 64) {
  9371. if (isPrime(n)) {
  9372. if (nPrime < 8) {
  9373. H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
  9374. }
  9375. K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
  9376. nPrime++;
  9377. }
  9378. n++;
  9379. }
  9380. })();
  9381. // Reusable object
  9382. var W = [];
  9383. /**
  9384. * SHA-256 hash algorithm.
  9385. */
  9386. var SHA256 = C_algo.SHA256 = Hasher.extend({
  9387. _doReset: function _doReset() {
  9388. this._hash = new WordArray.init(H.slice(0));
  9389. },
  9390. _doProcessBlock: function _doProcessBlock(M, offset) {
  9391. // Shortcut
  9392. var H = this._hash.words;
  9393. // Working variables
  9394. var a = H[0];
  9395. var b = H[1];
  9396. var c = H[2];
  9397. var d = H[3];
  9398. var e = H[4];
  9399. var f = H[5];
  9400. var g = H[6];
  9401. var h = H[7];
  9402. // Computation
  9403. for (var i = 0; i < 64; i++) {
  9404. if (i < 16) {
  9405. W[i] = M[offset + i] | 0;
  9406. } else {
  9407. var gamma0x = W[i - 15];
  9408. var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (
  9409. gamma0x << 14 | gamma0x >>> 18) ^
  9410. gamma0x >>> 3;
  9411. var gamma1x = W[i - 2];
  9412. var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (
  9413. gamma1x << 13 | gamma1x >>> 19) ^
  9414. gamma1x >>> 10;
  9415. W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
  9416. }
  9417. var ch = e & f ^ ~e & g;
  9418. var maj = a & b ^ a & c ^ b & c;
  9419. var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
  9420. var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
  9421. var t1 = h + sigma1 + ch + K[i] + W[i];
  9422. var t2 = sigma0 + maj;
  9423. h = g;
  9424. g = f;
  9425. f = e;
  9426. e = d + t1 | 0;
  9427. d = c;
  9428. c = b;
  9429. b = a;
  9430. a = t1 + t2 | 0;
  9431. }
  9432. // Intermediate hash value
  9433. H[0] = H[0] + a | 0;
  9434. H[1] = H[1] + b | 0;
  9435. H[2] = H[2] + c | 0;
  9436. H[3] = H[3] + d | 0;
  9437. H[4] = H[4] + e | 0;
  9438. H[5] = H[5] + f | 0;
  9439. H[6] = H[6] + g | 0;
  9440. H[7] = H[7] + h | 0;
  9441. },
  9442. _doFinalize: function _doFinalize() {
  9443. // Shortcuts
  9444. var data = this._data;
  9445. var dataWords = data.words;
  9446. var nBitsTotal = this._nDataBytes * 8;
  9447. var nBitsLeft = data.sigBytes * 8;
  9448. // Add padding
  9449. dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;
  9450. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
  9451. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
  9452. data.sigBytes = dataWords.length * 4;
  9453. // Hash final blocks
  9454. this._process();
  9455. // Return final computed hash
  9456. return this._hash;
  9457. },
  9458. clone: function clone() {
  9459. var clone = Hasher.clone.call(this);
  9460. clone._hash = this._hash.clone();
  9461. return clone;
  9462. } });
  9463. /**
  9464. * Shortcut function to the hasher's object interface.
  9465. *
  9466. * @param {WordArray|string} message The message to hash.
  9467. *
  9468. * @return {WordArray} The hash.
  9469. *
  9470. * @static
  9471. *
  9472. * @example
  9473. *
  9474. * var hash = CryptoJS.SHA256('message');
  9475. * var hash = CryptoJS.SHA256(wordArray);
  9476. */
  9477. C.SHA256 = Hasher._createHelper(SHA256);
  9478. /**
  9479. * Shortcut function to the HMAC's object interface.
  9480. *
  9481. * @param {WordArray|string} message The message to hash.
  9482. * @param {WordArray|string} key The secret key.
  9483. *
  9484. * @return {WordArray} The HMAC.
  9485. *
  9486. * @static
  9487. *
  9488. * @example
  9489. *
  9490. * var hmac = CryptoJS.HmacSHA256(message, key);
  9491. */
  9492. C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
  9493. })(Math);
  9494. return CryptoJS.SHA256;
  9495. });
  9496. /***/ }),
  9497. /* 29 */
  9498. /*!************************************************************!*\
  9499. !*** F:/uniapp/sqxp-uniapp/node_modules/crypto-js/core.js ***!
  9500. \************************************************************/
  9501. /*! no static exports found */
  9502. /***/ (function(module, exports, __webpack_require__) {
  9503. /* WEBPACK VAR INJECTION */(function(global) {;(function (root, factory) {
  9504. if (true) {
  9505. // CommonJS
  9506. module.exports = exports = factory();
  9507. } else
  9508. {}
  9509. })(this, function () {
  9510. /*globals window, global, require*/
  9511. /**
  9512. * CryptoJS core components.
  9513. */
  9514. var CryptoJS = CryptoJS || function (Math, undefined) {
  9515. var crypto;
  9516. // Native crypto from window (Browser)
  9517. if (typeof window !== 'undefined' && window.crypto) {
  9518. crypto = window.crypto;
  9519. }
  9520. // Native (experimental IE 11) crypto from window (Browser)
  9521. if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
  9522. crypto = window.msCrypto;
  9523. }
  9524. // Native crypto from global (NodeJS)
  9525. if (!crypto && typeof global !== 'undefined' && global.crypto) {
  9526. crypto = global.crypto;
  9527. }
  9528. // Native crypto import via require (NodeJS)
  9529. if (!crypto && "function" === 'function') {
  9530. try {
  9531. crypto = __webpack_require__(/*! crypto */ 30);
  9532. } catch (err) {}
  9533. }
  9534. /*
  9535. * Cryptographically secure pseudorandom number generator
  9536. *
  9537. * As Math.random() is cryptographically not safe to use
  9538. */
  9539. var cryptoSecureRandomInt = function cryptoSecureRandomInt() {
  9540. if (crypto) {
  9541. // Use getRandomValues method (Browser)
  9542. if (typeof crypto.getRandomValues === 'function') {
  9543. try {
  9544. return crypto.getRandomValues(new Uint32Array(1))[0];
  9545. } catch (err) {}
  9546. }
  9547. // Use randomBytes method (NodeJS)
  9548. if (typeof crypto.randomBytes === 'function') {
  9549. try {
  9550. return crypto.randomBytes(4).readInt32LE();
  9551. } catch (err) {}
  9552. }
  9553. }
  9554. throw new Error('Native crypto module could not be used to get secure random number.');
  9555. };
  9556. /*
  9557. * Local polyfill of Object.create
  9558. */
  9559. var create = Object.create || function () {
  9560. function F() {}
  9561. return function (obj) {
  9562. var subtype;
  9563. F.prototype = obj;
  9564. subtype = new F();
  9565. F.prototype = null;
  9566. return subtype;
  9567. };
  9568. }();
  9569. /**
  9570. * CryptoJS namespace.
  9571. */
  9572. var C = {};
  9573. /**
  9574. * Library namespace.
  9575. */
  9576. var C_lib = C.lib = {};
  9577. /**
  9578. * Base object for prototypal inheritance.
  9579. */
  9580. var Base = C_lib.Base = function () {
  9581. return {
  9582. /**
  9583. * Creates a new object that inherits from this object.
  9584. *
  9585. * @param {Object} overrides Properties to copy into the new object.
  9586. *
  9587. * @return {Object} The new object.
  9588. *
  9589. * @static
  9590. *
  9591. * @example
  9592. *
  9593. * var MyType = CryptoJS.lib.Base.extend({
  9594. * field: 'value',
  9595. *
  9596. * method: function () {
  9597. * }
  9598. * });
  9599. */
  9600. extend: function extend(overrides) {
  9601. // Spawn
  9602. var subtype = create(this);
  9603. // Augment
  9604. if (overrides) {
  9605. subtype.mixIn(overrides);
  9606. }
  9607. // Create default initializer
  9608. if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
  9609. subtype.init = function () {
  9610. subtype.$super.init.apply(this, arguments);
  9611. };
  9612. }
  9613. // Initializer's prototype is the subtype object
  9614. subtype.init.prototype = subtype;
  9615. // Reference supertype
  9616. subtype.$super = this;
  9617. return subtype;
  9618. },
  9619. /**
  9620. * Extends this object and runs the init method.
  9621. * Arguments to create() will be passed to init().
  9622. *
  9623. * @return {Object} The new object.
  9624. *
  9625. * @static
  9626. *
  9627. * @example
  9628. *
  9629. * var instance = MyType.create();
  9630. */
  9631. create: function create() {
  9632. var instance = this.extend();
  9633. instance.init.apply(instance, arguments);
  9634. return instance;
  9635. },
  9636. /**
  9637. * Initializes a newly created object.
  9638. * Override this method to add some logic when your objects are created.
  9639. *
  9640. * @example
  9641. *
  9642. * var MyType = CryptoJS.lib.Base.extend({
  9643. * init: function () {
  9644. * // ...
  9645. * }
  9646. * });
  9647. */
  9648. init: function init() {
  9649. },
  9650. /**
  9651. * Copies properties into this object.
  9652. *
  9653. * @param {Object} properties The properties to mix in.
  9654. *
  9655. * @example
  9656. *
  9657. * MyType.mixIn({
  9658. * field: 'value'
  9659. * });
  9660. */
  9661. mixIn: function mixIn(properties) {
  9662. for (var propertyName in properties) {
  9663. if (properties.hasOwnProperty(propertyName)) {
  9664. this[propertyName] = properties[propertyName];
  9665. }
  9666. }
  9667. // IE won't copy toString using the loop above
  9668. if (properties.hasOwnProperty('toString')) {
  9669. this.toString = properties.toString;
  9670. }
  9671. },
  9672. /**
  9673. * Creates a copy of this object.
  9674. *
  9675. * @return {Object} The clone.
  9676. *
  9677. * @example
  9678. *
  9679. * var clone = instance.clone();
  9680. */
  9681. clone: function clone() {
  9682. return this.init.prototype.extend(this);
  9683. } };
  9684. }();
  9685. /**
  9686. * An array of 32-bit words.
  9687. *
  9688. * @property {Array} words The array of 32-bit words.
  9689. * @property {number} sigBytes The number of significant bytes in this word array.
  9690. */
  9691. var WordArray = C_lib.WordArray = Base.extend({
  9692. /**
  9693. * Initializes a newly created word array.
  9694. *
  9695. * @param {Array} words (Optional) An array of 32-bit words.
  9696. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  9697. *
  9698. * @example
  9699. *
  9700. * var wordArray = CryptoJS.lib.WordArray.create();
  9701. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  9702. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  9703. */
  9704. init: function init(words, sigBytes) {
  9705. words = this.words = words || [];
  9706. if (sigBytes != undefined) {
  9707. this.sigBytes = sigBytes;
  9708. } else {
  9709. this.sigBytes = words.length * 4;
  9710. }
  9711. },
  9712. /**
  9713. * Converts this word array to a string.
  9714. *
  9715. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  9716. *
  9717. * @return {string} The stringified word array.
  9718. *
  9719. * @example
  9720. *
  9721. * var string = wordArray + '';
  9722. * var string = wordArray.toString();
  9723. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  9724. */
  9725. toString: function toString(encoder) {
  9726. return (encoder || Hex).stringify(this);
  9727. },
  9728. /**
  9729. * Concatenates a word array to this word array.
  9730. *
  9731. * @param {WordArray} wordArray The word array to append.
  9732. *
  9733. * @return {WordArray} This word array.
  9734. *
  9735. * @example
  9736. *
  9737. * wordArray1.concat(wordArray2);
  9738. */
  9739. concat: function concat(wordArray) {
  9740. // Shortcuts
  9741. var thisWords = this.words;
  9742. var thatWords = wordArray.words;
  9743. var thisSigBytes = this.sigBytes;
  9744. var thatSigBytes = wordArray.sigBytes;
  9745. // Clamp excess bits
  9746. this.clamp();
  9747. // Concat
  9748. if (thisSigBytes % 4) {
  9749. // Copy one byte at a time
  9750. for (var i = 0; i < thatSigBytes; i++) {
  9751. var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
  9752. thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;
  9753. }
  9754. } else {
  9755. // Copy one word at a time
  9756. for (var i = 0; i < thatSigBytes; i += 4) {
  9757. thisWords[thisSigBytes + i >>> 2] = thatWords[i >>> 2];
  9758. }
  9759. }
  9760. this.sigBytes += thatSigBytes;
  9761. // Chainable
  9762. return this;
  9763. },
  9764. /**
  9765. * Removes insignificant bits.
  9766. *
  9767. * @example
  9768. *
  9769. * wordArray.clamp();
  9770. */
  9771. clamp: function clamp() {
  9772. // Shortcuts
  9773. var words = this.words;
  9774. var sigBytes = this.sigBytes;
  9775. // Clamp
  9776. words[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8;
  9777. words.length = Math.ceil(sigBytes / 4);
  9778. },
  9779. /**
  9780. * Creates a copy of this word array.
  9781. *
  9782. * @return {WordArray} The clone.
  9783. *
  9784. * @example
  9785. *
  9786. * var clone = wordArray.clone();
  9787. */
  9788. clone: function clone() {
  9789. var clone = Base.clone.call(this);
  9790. clone.words = this.words.slice(0);
  9791. return clone;
  9792. },
  9793. /**
  9794. * Creates a word array filled with random bytes.
  9795. *
  9796. * @param {number} nBytes The number of random bytes to generate.
  9797. *
  9798. * @return {WordArray} The random word array.
  9799. *
  9800. * @static
  9801. *
  9802. * @example
  9803. *
  9804. * var wordArray = CryptoJS.lib.WordArray.random(16);
  9805. */
  9806. random: function random(nBytes) {
  9807. var words = [];
  9808. for (var i = 0; i < nBytes; i += 4) {
  9809. words.push(cryptoSecureRandomInt());
  9810. }
  9811. return new WordArray.init(words, nBytes);
  9812. } });
  9813. /**
  9814. * Encoder namespace.
  9815. */
  9816. var C_enc = C.enc = {};
  9817. /**
  9818. * Hex encoding strategy.
  9819. */
  9820. var Hex = C_enc.Hex = {
  9821. /**
  9822. * Converts a word array to a hex string.
  9823. *
  9824. * @param {WordArray} wordArray The word array.
  9825. *
  9826. * @return {string} The hex string.
  9827. *
  9828. * @static
  9829. *
  9830. * @example
  9831. *
  9832. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  9833. */
  9834. stringify: function stringify(wordArray) {
  9835. // Shortcuts
  9836. var words = wordArray.words;
  9837. var sigBytes = wordArray.sigBytes;
  9838. // Convert
  9839. var hexChars = [];
  9840. for (var i = 0; i < sigBytes; i++) {
  9841. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
  9842. hexChars.push((bite >>> 4).toString(16));
  9843. hexChars.push((bite & 0x0f).toString(16));
  9844. }
  9845. return hexChars.join('');
  9846. },
  9847. /**
  9848. * Converts a hex string to a word array.
  9849. *
  9850. * @param {string} hexStr The hex string.
  9851. *
  9852. * @return {WordArray} The word array.
  9853. *
  9854. * @static
  9855. *
  9856. * @example
  9857. *
  9858. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  9859. */
  9860. parse: function parse(hexStr) {
  9861. // Shortcut
  9862. var hexStrLength = hexStr.length;
  9863. // Convert
  9864. var words = [];
  9865. for (var i = 0; i < hexStrLength; i += 2) {
  9866. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;
  9867. }
  9868. return new WordArray.init(words, hexStrLength / 2);
  9869. } };
  9870. /**
  9871. * Latin1 encoding strategy.
  9872. */
  9873. var Latin1 = C_enc.Latin1 = {
  9874. /**
  9875. * Converts a word array to a Latin1 string.
  9876. *
  9877. * @param {WordArray} wordArray The word array.
  9878. *
  9879. * @return {string} The Latin1 string.
  9880. *
  9881. * @static
  9882. *
  9883. * @example
  9884. *
  9885. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  9886. */
  9887. stringify: function stringify(wordArray) {
  9888. // Shortcuts
  9889. var words = wordArray.words;
  9890. var sigBytes = wordArray.sigBytes;
  9891. // Convert
  9892. var latin1Chars = [];
  9893. for (var i = 0; i < sigBytes; i++) {
  9894. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
  9895. latin1Chars.push(String.fromCharCode(bite));
  9896. }
  9897. return latin1Chars.join('');
  9898. },
  9899. /**
  9900. * Converts a Latin1 string to a word array.
  9901. *
  9902. * @param {string} latin1Str The Latin1 string.
  9903. *
  9904. * @return {WordArray} The word array.
  9905. *
  9906. * @static
  9907. *
  9908. * @example
  9909. *
  9910. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  9911. */
  9912. parse: function parse(latin1Str) {
  9913. // Shortcut
  9914. var latin1StrLength = latin1Str.length;
  9915. // Convert
  9916. var words = [];
  9917. for (var i = 0; i < latin1StrLength; i++) {
  9918. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8;
  9919. }
  9920. return new WordArray.init(words, latin1StrLength);
  9921. } };
  9922. /**
  9923. * UTF-8 encoding strategy.
  9924. */
  9925. var Utf8 = C_enc.Utf8 = {
  9926. /**
  9927. * Converts a word array to a UTF-8 string.
  9928. *
  9929. * @param {WordArray} wordArray The word array.
  9930. *
  9931. * @return {string} The UTF-8 string.
  9932. *
  9933. * @static
  9934. *
  9935. * @example
  9936. *
  9937. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  9938. */
  9939. stringify: function stringify(wordArray) {
  9940. try {
  9941. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  9942. } catch (e) {
  9943. throw new Error('Malformed UTF-8 data');
  9944. }
  9945. },
  9946. /**
  9947. * Converts a UTF-8 string to a word array.
  9948. *
  9949. * @param {string} utf8Str The UTF-8 string.
  9950. *
  9951. * @return {WordArray} The word array.
  9952. *
  9953. * @static
  9954. *
  9955. * @example
  9956. *
  9957. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  9958. */
  9959. parse: function parse(utf8Str) {
  9960. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  9961. } };
  9962. /**
  9963. * Abstract buffered block algorithm template.
  9964. *
  9965. * The property blockSize must be implemented in a concrete subtype.
  9966. *
  9967. * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
  9968. */
  9969. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  9970. /**
  9971. * Resets this block algorithm's data buffer to its initial state.
  9972. *
  9973. * @example
  9974. *
  9975. * bufferedBlockAlgorithm.reset();
  9976. */
  9977. reset: function reset() {
  9978. // Initial values
  9979. this._data = new WordArray.init();
  9980. this._nDataBytes = 0;
  9981. },
  9982. /**
  9983. * Adds new data to this block algorithm's buffer.
  9984. *
  9985. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  9986. *
  9987. * @example
  9988. *
  9989. * bufferedBlockAlgorithm._append('data');
  9990. * bufferedBlockAlgorithm._append(wordArray);
  9991. */
  9992. _append: function _append(data) {
  9993. // Convert string to WordArray, else assume WordArray already
  9994. if (typeof data == 'string') {
  9995. data = Utf8.parse(data);
  9996. }
  9997. // Append
  9998. this._data.concat(data);
  9999. this._nDataBytes += data.sigBytes;
  10000. },
  10001. /**
  10002. * Processes available data blocks.
  10003. *
  10004. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  10005. *
  10006. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  10007. *
  10008. * @return {WordArray} The processed data.
  10009. *
  10010. * @example
  10011. *
  10012. * var processedData = bufferedBlockAlgorithm._process();
  10013. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  10014. */
  10015. _process: function _process(doFlush) {
  10016. var processedWords;
  10017. // Shortcuts
  10018. var data = this._data;
  10019. var dataWords = data.words;
  10020. var dataSigBytes = data.sigBytes;
  10021. var blockSize = this.blockSize;
  10022. var blockSizeBytes = blockSize * 4;
  10023. // Count blocks ready
  10024. var nBlocksReady = dataSigBytes / blockSizeBytes;
  10025. if (doFlush) {
  10026. // Round up to include partial blocks
  10027. nBlocksReady = Math.ceil(nBlocksReady);
  10028. } else {
  10029. // Round down to include only full blocks,
  10030. // less the number of blocks that must remain in the buffer
  10031. nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
  10032. }
  10033. // Count words ready
  10034. var nWordsReady = nBlocksReady * blockSize;
  10035. // Count bytes ready
  10036. var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
  10037. // Process blocks
  10038. if (nWordsReady) {
  10039. for (var offset = 0; offset < nWordsReady; offset += blockSize) {
  10040. // Perform concrete-algorithm logic
  10041. this._doProcessBlock(dataWords, offset);
  10042. }
  10043. // Remove processed words
  10044. processedWords = dataWords.splice(0, nWordsReady);
  10045. data.sigBytes -= nBytesReady;
  10046. }
  10047. // Return processed words
  10048. return new WordArray.init(processedWords, nBytesReady);
  10049. },
  10050. /**
  10051. * Creates a copy of this object.
  10052. *
  10053. * @return {Object} The clone.
  10054. *
  10055. * @example
  10056. *
  10057. * var clone = bufferedBlockAlgorithm.clone();
  10058. */
  10059. clone: function clone() {
  10060. var clone = Base.clone.call(this);
  10061. clone._data = this._data.clone();
  10062. return clone;
  10063. },
  10064. _minBufferSize: 0 });
  10065. /**
  10066. * Abstract hasher template.
  10067. *
  10068. * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
  10069. */
  10070. var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  10071. /**
  10072. * Configuration options.
  10073. */
  10074. cfg: Base.extend(),
  10075. /**
  10076. * Initializes a newly created hasher.
  10077. *
  10078. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  10079. *
  10080. * @example
  10081. *
  10082. * var hasher = CryptoJS.algo.SHA256.create();
  10083. */
  10084. init: function init(cfg) {
  10085. // Apply config defaults
  10086. this.cfg = this.cfg.extend(cfg);
  10087. // Set initial values
  10088. this.reset();
  10089. },
  10090. /**
  10091. * Resets this hasher to its initial state.
  10092. *
  10093. * @example
  10094. *
  10095. * hasher.reset();
  10096. */
  10097. reset: function reset() {
  10098. // Reset data buffer
  10099. BufferedBlockAlgorithm.reset.call(this);
  10100. // Perform concrete-hasher logic
  10101. this._doReset();
  10102. },
  10103. /**
  10104. * Updates this hasher with a message.
  10105. *
  10106. * @param {WordArray|string} messageUpdate The message to append.
  10107. *
  10108. * @return {Hasher} This hasher.
  10109. *
  10110. * @example
  10111. *
  10112. * hasher.update('message');
  10113. * hasher.update(wordArray);
  10114. */
  10115. update: function update(messageUpdate) {
  10116. // Append
  10117. this._append(messageUpdate);
  10118. // Update the hash
  10119. this._process();
  10120. // Chainable
  10121. return this;
  10122. },
  10123. /**
  10124. * Finalizes the hash computation.
  10125. * Note that the finalize operation is effectively a destructive, read-once operation.
  10126. *
  10127. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  10128. *
  10129. * @return {WordArray} The hash.
  10130. *
  10131. * @example
  10132. *
  10133. * var hash = hasher.finalize();
  10134. * var hash = hasher.finalize('message');
  10135. * var hash = hasher.finalize(wordArray);
  10136. */
  10137. finalize: function finalize(messageUpdate) {
  10138. // Final message update
  10139. if (messageUpdate) {
  10140. this._append(messageUpdate);
  10141. }
  10142. // Perform concrete-hasher logic
  10143. var hash = this._doFinalize();
  10144. return hash;
  10145. },
  10146. blockSize: 512 / 32,
  10147. /**
  10148. * Creates a shortcut function to a hasher's object interface.
  10149. *
  10150. * @param {Hasher} hasher The hasher to create a helper for.
  10151. *
  10152. * @return {Function} The shortcut function.
  10153. *
  10154. * @static
  10155. *
  10156. * @example
  10157. *
  10158. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  10159. */
  10160. _createHelper: function _createHelper(hasher) {
  10161. return function (message, cfg) {
  10162. return new hasher.init(cfg).finalize(message);
  10163. };
  10164. },
  10165. /**
  10166. * Creates a shortcut function to the HMAC's object interface.
  10167. *
  10168. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  10169. *
  10170. * @return {Function} The shortcut function.
  10171. *
  10172. * @static
  10173. *
  10174. * @example
  10175. *
  10176. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  10177. */
  10178. _createHmacHelper: function _createHmacHelper(hasher) {
  10179. return function (message, key) {
  10180. return new C_algo.HMAC.init(hasher, key).finalize(message);
  10181. };
  10182. } });
  10183. /**
  10184. * Algorithm namespace.
  10185. */
  10186. var C_algo = C.algo = {};
  10187. return C;
  10188. }(Math);
  10189. return CryptoJS;
  10190. });
  10191. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../HBuilderX/plugins/uniapp-cli/node_modules/webpack/buildin/global.js */ 3)))
  10192. /***/ }),
  10193. /* 30 */
  10194. /*!*************************************************!*\
  10195. !*** ./node_modules/crypto-browserify/index.js ***!
  10196. \*************************************************/
  10197. /*! no static exports found */
  10198. /***/ (function(module, exports, __webpack_require__) {
  10199. "use strict";
  10200. exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ 31)
  10201. exports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ 39)
  10202. exports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ 74)
  10203. var algos = __webpack_require__(/*! browserify-sign/algos */ 77)
  10204. var algoKeys = Object.keys(algos)
  10205. var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)
  10206. exports.getHashes = function () {
  10207. return hashes
  10208. }
  10209. var p = __webpack_require__(/*! pbkdf2 */ 79)
  10210. exports.pbkdf2 = p.pbkdf2
  10211. exports.pbkdf2Sync = p.pbkdf2Sync
  10212. var aes = __webpack_require__(/*! browserify-cipher */ 85)
  10213. exports.Cipher = aes.Cipher
  10214. exports.createCipher = aes.createCipher
  10215. exports.Cipheriv = aes.Cipheriv
  10216. exports.createCipheriv = aes.createCipheriv
  10217. exports.Decipher = aes.Decipher
  10218. exports.createDecipher = aes.createDecipher
  10219. exports.Decipheriv = aes.Decipheriv
  10220. exports.createDecipheriv = aes.createDecipheriv
  10221. exports.getCiphers = aes.getCiphers
  10222. exports.listCiphers = aes.listCiphers
  10223. var dh = __webpack_require__(/*! diffie-hellman */ 114)
  10224. exports.DiffieHellmanGroup = dh.DiffieHellmanGroup
  10225. exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup
  10226. exports.getDiffieHellman = dh.getDiffieHellman
  10227. exports.createDiffieHellman = dh.createDiffieHellman
  10228. exports.DiffieHellman = dh.DiffieHellman
  10229. var sign = __webpack_require__(/*! browserify-sign */ 124)
  10230. exports.createSign = sign.createSign
  10231. exports.Sign = sign.Sign
  10232. exports.createVerify = sign.createVerify
  10233. exports.Verify = sign.Verify
  10234. exports.createECDH = __webpack_require__(/*! create-ecdh */ 179)
  10235. var publicEncrypt = __webpack_require__(/*! public-encrypt */ 180)
  10236. exports.publicEncrypt = publicEncrypt.publicEncrypt
  10237. exports.privateEncrypt = publicEncrypt.privateEncrypt
  10238. exports.publicDecrypt = publicEncrypt.publicDecrypt
  10239. exports.privateDecrypt = publicEncrypt.privateDecrypt
  10240. // the least I can do is make error messages for the rest of the node.js/crypto api.
  10241. // ;[
  10242. // 'createCredentials'
  10243. // ].forEach(function (name) {
  10244. // exports[name] = function () {
  10245. // throw new Error([
  10246. // 'sorry, ' + name + ' is not implemented yet',
  10247. // 'we accept pull requests',
  10248. // 'https://github.com/crypto-browserify/crypto-browserify'
  10249. // ].join('\n'))
  10250. // }
  10251. // })
  10252. var rf = __webpack_require__(/*! randomfill */ 186)
  10253. exports.randomFill = rf.randomFill
  10254. exports.randomFillSync = rf.randomFillSync
  10255. exports.createCredentials = function () {
  10256. throw new Error([
  10257. 'sorry, createCredentials is not implemented yet',
  10258. 'we accept pull requests',
  10259. 'https://github.com/crypto-browserify/crypto-browserify'
  10260. ].join('\n'))
  10261. }
  10262. exports.constants = {
  10263. 'DH_CHECK_P_NOT_SAFE_PRIME': 2,
  10264. 'DH_CHECK_P_NOT_PRIME': 1,
  10265. 'DH_UNABLE_TO_CHECK_GENERATOR': 4,
  10266. 'DH_NOT_SUITABLE_GENERATOR': 8,
  10267. 'NPN_ENABLED': 1,
  10268. 'ALPN_ENABLED': 1,
  10269. 'RSA_PKCS1_PADDING': 1,
  10270. 'RSA_SSLV23_PADDING': 2,
  10271. 'RSA_NO_PADDING': 3,
  10272. 'RSA_PKCS1_OAEP_PADDING': 4,
  10273. 'RSA_X931_PADDING': 5,
  10274. 'RSA_PKCS1_PSS_PADDING': 6,
  10275. 'POINT_CONVERSION_COMPRESSED': 2,
  10276. 'POINT_CONVERSION_UNCOMPRESSED': 4,
  10277. 'POINT_CONVERSION_HYBRID': 6
  10278. }
  10279. /***/ }),
  10280. /* 31 */
  10281. /*!*********************************************!*\
  10282. !*** ./node_modules/randombytes/browser.js ***!
  10283. \*********************************************/
  10284. /*! no static exports found */
  10285. /***/ (function(module, exports, __webpack_require__) {
  10286. "use strict";
  10287. /* WEBPACK VAR INJECTION */(function(global, process) {
  10288. // limit of Crypto.getRandomValues()
  10289. // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
  10290. var MAX_BYTES = 65536
  10291. // Node supports requesting up to this number of bytes
  10292. // https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
  10293. var MAX_UINT32 = 4294967295
  10294. function oldBrowser () {
  10295. throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11')
  10296. }
  10297. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  10298. var crypto = global.crypto || global.msCrypto
  10299. if (crypto && crypto.getRandomValues) {
  10300. module.exports = randomBytes
  10301. } else {
  10302. module.exports = oldBrowser
  10303. }
  10304. function randomBytes (size, cb) {
  10305. // phantomjs needs to throw
  10306. if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')
  10307. var bytes = Buffer.allocUnsafe(size)
  10308. if (size > 0) { // getRandomValues fails on IE if size == 0
  10309. if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues
  10310. // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
  10311. for (var generated = 0; generated < size; generated += MAX_BYTES) {
  10312. // buffer.slice automatically checks if the end is past the end of
  10313. // the buffer so we don't have to here
  10314. crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))
  10315. }
  10316. } else {
  10317. crypto.getRandomValues(bytes)
  10318. }
  10319. }
  10320. if (typeof cb === 'function') {
  10321. return process.nextTick(function () {
  10322. cb(null, bytes)
  10323. })
  10324. }
  10325. return bytes
  10326. }
  10327. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 32)))
  10328. /***/ }),
  10329. /* 32 */
  10330. /*!********************************************************!*\
  10331. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  10332. \********************************************************/
  10333. /*! no static exports found */
  10334. /***/ (function(module, exports, __webpack_require__) {
  10335. exports.nextTick = function nextTick(fn) {
  10336. var args = Array.prototype.slice.call(arguments);
  10337. args.shift();
  10338. setTimeout(function () {
  10339. fn.apply(null, args);
  10340. }, 0);
  10341. };
  10342. exports.platform = exports.arch =
  10343. exports.execPath = exports.title = 'browser';
  10344. exports.pid = 1;
  10345. exports.browser = true;
  10346. exports.env = {};
  10347. exports.argv = [];
  10348. exports.binding = function (name) {
  10349. throw new Error('No such module. (Possibly not yet loaded)')
  10350. };
  10351. (function () {
  10352. var cwd = '/';
  10353. var path;
  10354. exports.cwd = function () { return cwd };
  10355. exports.chdir = function (dir) {
  10356. if (!path) path = __webpack_require__(/*! path */ 33);
  10357. cwd = path.resolve(dir, cwd);
  10358. };
  10359. })();
  10360. exports.exit = exports.kill =
  10361. exports.umask = exports.dlopen =
  10362. exports.uptime = exports.memoryUsage =
  10363. exports.uvCounters = function() {};
  10364. exports.features = {};
  10365. /***/ }),
  10366. /* 33 */
  10367. /*!***********************************************!*\
  10368. !*** ./node_modules/path-browserify/index.js ***!
  10369. \***********************************************/
  10370. /*! no static exports found */
  10371. /***/ (function(module, exports, __webpack_require__) {
  10372. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  10373. // backported and transplited with Babel, with backwards-compat fixes
  10374. // Copyright Joyent, Inc. and other Node contributors.
  10375. //
  10376. // Permission is hereby granted, free of charge, to any person obtaining a
  10377. // copy of this software and associated documentation files (the
  10378. // "Software"), to deal in the Software without restriction, including
  10379. // without limitation the rights to use, copy, modify, merge, publish,
  10380. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10381. // persons to whom the Software is furnished to do so, subject to the
  10382. // following conditions:
  10383. //
  10384. // The above copyright notice and this permission notice shall be included
  10385. // in all copies or substantial portions of the Software.
  10386. //
  10387. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10388. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10389. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10390. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10391. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10392. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10393. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10394. // resolves . and .. elements in a path array with directory names there
  10395. // must be no slashes, empty elements, or device names (c:\) in the array
  10396. // (so also no leading and trailing slashes - it does not distinguish
  10397. // relative and absolute paths)
  10398. function normalizeArray(parts, allowAboveRoot) {
  10399. // if the path tries to go above the root, `up` ends up > 0
  10400. var up = 0;
  10401. for (var i = parts.length - 1; i >= 0; i--) {
  10402. var last = parts[i];
  10403. if (last === '.') {
  10404. parts.splice(i, 1);
  10405. } else if (last === '..') {
  10406. parts.splice(i, 1);
  10407. up++;
  10408. } else if (up) {
  10409. parts.splice(i, 1);
  10410. up--;
  10411. }
  10412. }
  10413. // if the path is allowed to go above the root, restore leading ..s
  10414. if (allowAboveRoot) {
  10415. for (; up--; up) {
  10416. parts.unshift('..');
  10417. }
  10418. }
  10419. return parts;
  10420. }
  10421. // path.resolve([from ...], to)
  10422. // posix version
  10423. exports.resolve = function() {
  10424. var resolvedPath = '',
  10425. resolvedAbsolute = false;
  10426. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  10427. var path = (i >= 0) ? arguments[i] : process.cwd();
  10428. // Skip empty and invalid entries
  10429. if (typeof path !== 'string') {
  10430. throw new TypeError('Arguments to path.resolve must be strings');
  10431. } else if (!path) {
  10432. continue;
  10433. }
  10434. resolvedPath = path + '/' + resolvedPath;
  10435. resolvedAbsolute = path.charAt(0) === '/';
  10436. }
  10437. // At this point the path should be resolved to a full absolute path, but
  10438. // handle relative paths to be safe (might happen when process.cwd() fails)
  10439. // Normalize the path
  10440. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  10441. return !!p;
  10442. }), !resolvedAbsolute).join('/');
  10443. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  10444. };
  10445. // path.normalize(path)
  10446. // posix version
  10447. exports.normalize = function(path) {
  10448. var isAbsolute = exports.isAbsolute(path),
  10449. trailingSlash = substr(path, -1) === '/';
  10450. // Normalize the path
  10451. path = normalizeArray(filter(path.split('/'), function(p) {
  10452. return !!p;
  10453. }), !isAbsolute).join('/');
  10454. if (!path && !isAbsolute) {
  10455. path = '.';
  10456. }
  10457. if (path && trailingSlash) {
  10458. path += '/';
  10459. }
  10460. return (isAbsolute ? '/' : '') + path;
  10461. };
  10462. // posix version
  10463. exports.isAbsolute = function(path) {
  10464. return path.charAt(0) === '/';
  10465. };
  10466. // posix version
  10467. exports.join = function() {
  10468. var paths = Array.prototype.slice.call(arguments, 0);
  10469. return exports.normalize(filter(paths, function(p, index) {
  10470. if (typeof p !== 'string') {
  10471. throw new TypeError('Arguments to path.join must be strings');
  10472. }
  10473. return p;
  10474. }).join('/'));
  10475. };
  10476. // path.relative(from, to)
  10477. // posix version
  10478. exports.relative = function(from, to) {
  10479. from = exports.resolve(from).substr(1);
  10480. to = exports.resolve(to).substr(1);
  10481. function trim(arr) {
  10482. var start = 0;
  10483. for (; start < arr.length; start++) {
  10484. if (arr[start] !== '') break;
  10485. }
  10486. var end = arr.length - 1;
  10487. for (; end >= 0; end--) {
  10488. if (arr[end] !== '') break;
  10489. }
  10490. if (start > end) return [];
  10491. return arr.slice(start, end - start + 1);
  10492. }
  10493. var fromParts = trim(from.split('/'));
  10494. var toParts = trim(to.split('/'));
  10495. var length = Math.min(fromParts.length, toParts.length);
  10496. var samePartsLength = length;
  10497. for (var i = 0; i < length; i++) {
  10498. if (fromParts[i] !== toParts[i]) {
  10499. samePartsLength = i;
  10500. break;
  10501. }
  10502. }
  10503. var outputParts = [];
  10504. for (var i = samePartsLength; i < fromParts.length; i++) {
  10505. outputParts.push('..');
  10506. }
  10507. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  10508. return outputParts.join('/');
  10509. };
  10510. exports.sep = '/';
  10511. exports.delimiter = ':';
  10512. exports.dirname = function (path) {
  10513. if (typeof path !== 'string') path = path + '';
  10514. if (path.length === 0) return '.';
  10515. var code = path.charCodeAt(0);
  10516. var hasRoot = code === 47 /*/*/;
  10517. var end = -1;
  10518. var matchedSlash = true;
  10519. for (var i = path.length - 1; i >= 1; --i) {
  10520. code = path.charCodeAt(i);
  10521. if (code === 47 /*/*/) {
  10522. if (!matchedSlash) {
  10523. end = i;
  10524. break;
  10525. }
  10526. } else {
  10527. // We saw the first non-path separator
  10528. matchedSlash = false;
  10529. }
  10530. }
  10531. if (end === -1) return hasRoot ? '/' : '.';
  10532. if (hasRoot && end === 1) {
  10533. // return '//';
  10534. // Backwards-compat fix:
  10535. return '/';
  10536. }
  10537. return path.slice(0, end);
  10538. };
  10539. function basename(path) {
  10540. if (typeof path !== 'string') path = path + '';
  10541. var start = 0;
  10542. var end = -1;
  10543. var matchedSlash = true;
  10544. var i;
  10545. for (i = path.length - 1; i >= 0; --i) {
  10546. if (path.charCodeAt(i) === 47 /*/*/) {
  10547. // If we reached a path separator that was not part of a set of path
  10548. // separators at the end of the string, stop now
  10549. if (!matchedSlash) {
  10550. start = i + 1;
  10551. break;
  10552. }
  10553. } else if (end === -1) {
  10554. // We saw the first non-path separator, mark this as the end of our
  10555. // path component
  10556. matchedSlash = false;
  10557. end = i + 1;
  10558. }
  10559. }
  10560. if (end === -1) return '';
  10561. return path.slice(start, end);
  10562. }
  10563. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  10564. // in new Node.js versions, so only basename() above is backported here
  10565. exports.basename = function (path, ext) {
  10566. var f = basename(path);
  10567. if (ext && f.substr(-1 * ext.length) === ext) {
  10568. f = f.substr(0, f.length - ext.length);
  10569. }
  10570. return f;
  10571. };
  10572. exports.extname = function (path) {
  10573. if (typeof path !== 'string') path = path + '';
  10574. var startDot = -1;
  10575. var startPart = 0;
  10576. var end = -1;
  10577. var matchedSlash = true;
  10578. // Track the state of characters (if any) we see before our first dot and
  10579. // after any path separator we find
  10580. var preDotState = 0;
  10581. for (var i = path.length - 1; i >= 0; --i) {
  10582. var code = path.charCodeAt(i);
  10583. if (code === 47 /*/*/) {
  10584. // If we reached a path separator that was not part of a set of path
  10585. // separators at the end of the string, stop now
  10586. if (!matchedSlash) {
  10587. startPart = i + 1;
  10588. break;
  10589. }
  10590. continue;
  10591. }
  10592. if (end === -1) {
  10593. // We saw the first non-path separator, mark this as the end of our
  10594. // extension
  10595. matchedSlash = false;
  10596. end = i + 1;
  10597. }
  10598. if (code === 46 /*.*/) {
  10599. // If this is our first dot, mark it as the start of our extension
  10600. if (startDot === -1)
  10601. startDot = i;
  10602. else if (preDotState !== 1)
  10603. preDotState = 1;
  10604. } else if (startDot !== -1) {
  10605. // We saw a non-dot and non-path separator before our dot, so we should
  10606. // have a good chance at having a non-empty extension
  10607. preDotState = -1;
  10608. }
  10609. }
  10610. if (startDot === -1 || end === -1 ||
  10611. // We saw a non-dot character immediately before the dot
  10612. preDotState === 0 ||
  10613. // The (right-most) trimmed path component is exactly '..'
  10614. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10615. return '';
  10616. }
  10617. return path.slice(startDot, end);
  10618. };
  10619. function filter (xs, f) {
  10620. if (xs.filter) return xs.filter(f);
  10621. var res = [];
  10622. for (var i = 0; i < xs.length; i++) {
  10623. if (f(xs[i], i, xs)) res.push(xs[i]);
  10624. }
  10625. return res;
  10626. }
  10627. // String.prototype.substr - negative index don't work in IE8
  10628. var substr = 'ab'.substr(-1) === 'b'
  10629. ? function (str, start, len) { return str.substr(start, len) }
  10630. : function (str, start, len) {
  10631. if (start < 0) start = str.length + start;
  10632. return str.substr(start, len);
  10633. }
  10634. ;
  10635. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 32)))
  10636. /***/ }),
  10637. /* 34 */
  10638. /*!*******************************************!*\
  10639. !*** ./node_modules/safe-buffer/index.js ***!
  10640. \*******************************************/
  10641. /*! no static exports found */
  10642. /***/ (function(module, exports, __webpack_require__) {
  10643. /* eslint-disable node/no-deprecated-api */
  10644. var buffer = __webpack_require__(/*! buffer */ 35)
  10645. var Buffer = buffer.Buffer
  10646. // alternative to using Object.keys for old browsers
  10647. function copyProps (src, dst) {
  10648. for (var key in src) {
  10649. dst[key] = src[key]
  10650. }
  10651. }
  10652. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  10653. module.exports = buffer
  10654. } else {
  10655. // Copy properties from require('buffer')
  10656. copyProps(buffer, exports)
  10657. exports.Buffer = SafeBuffer
  10658. }
  10659. function SafeBuffer (arg, encodingOrOffset, length) {
  10660. return Buffer(arg, encodingOrOffset, length)
  10661. }
  10662. // Copy static methods from Buffer
  10663. copyProps(Buffer, SafeBuffer)
  10664. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  10665. if (typeof arg === 'number') {
  10666. throw new TypeError('Argument must not be a number')
  10667. }
  10668. return Buffer(arg, encodingOrOffset, length)
  10669. }
  10670. SafeBuffer.alloc = function (size, fill, encoding) {
  10671. if (typeof size !== 'number') {
  10672. throw new TypeError('Argument must be a number')
  10673. }
  10674. var buf = Buffer(size)
  10675. if (fill !== undefined) {
  10676. if (typeof encoding === 'string') {
  10677. buf.fill(fill, encoding)
  10678. } else {
  10679. buf.fill(fill)
  10680. }
  10681. } else {
  10682. buf.fill(0)
  10683. }
  10684. return buf
  10685. }
  10686. SafeBuffer.allocUnsafe = function (size) {
  10687. if (typeof size !== 'number') {
  10688. throw new TypeError('Argument must be a number')
  10689. }
  10690. return Buffer(size)
  10691. }
  10692. SafeBuffer.allocUnsafeSlow = function (size) {
  10693. if (typeof size !== 'number') {
  10694. throw new TypeError('Argument must be a number')
  10695. }
  10696. return buffer.SlowBuffer(size)
  10697. }
  10698. /***/ }),
  10699. /* 35 */
  10700. /*!**************************************!*\
  10701. !*** ./node_modules/buffer/index.js ***!
  10702. \**************************************/
  10703. /*! no static exports found */
  10704. /***/ (function(module, exports, __webpack_require__) {
  10705. "use strict";
  10706. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10707. * The buffer module from node.js, for the browser.
  10708. *
  10709. * @author Feross Aboukhadijeh <http://feross.org>
  10710. * @license MIT
  10711. */
  10712. /* eslint-disable no-proto */
  10713. var base64 = __webpack_require__(/*! base64-js */ 36)
  10714. var ieee754 = __webpack_require__(/*! ieee754 */ 37)
  10715. var isArray = __webpack_require__(/*! isarray */ 38)
  10716. exports.Buffer = Buffer
  10717. exports.SlowBuffer = SlowBuffer
  10718. exports.INSPECT_MAX_BYTES = 50
  10719. /**
  10720. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  10721. * === true Use Uint8Array implementation (fastest)
  10722. * === false Use Object implementation (most compatible, even IE6)
  10723. *
  10724. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  10725. * Opera 11.6+, iOS 4.2+.
  10726. *
  10727. * Due to various browser bugs, sometimes the Object implementation will be used even
  10728. * when the browser supports typed arrays.
  10729. *
  10730. * Note:
  10731. *
  10732. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  10733. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  10734. *
  10735. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  10736. *
  10737. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  10738. * incorrect length in some situations.
  10739. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  10740. * get the Object implementation, which is slower but behaves correctly.
  10741. */
  10742. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  10743. ? global.TYPED_ARRAY_SUPPORT
  10744. : typedArraySupport()
  10745. /*
  10746. * Export kMaxLength after typed array support is determined.
  10747. */
  10748. exports.kMaxLength = kMaxLength()
  10749. function typedArraySupport () {
  10750. try {
  10751. var arr = new Uint8Array(1)
  10752. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  10753. return arr.foo() === 42 && // typed array instances can be augmented
  10754. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  10755. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  10756. } catch (e) {
  10757. return false
  10758. }
  10759. }
  10760. function kMaxLength () {
  10761. return Buffer.TYPED_ARRAY_SUPPORT
  10762. ? 0x7fffffff
  10763. : 0x3fffffff
  10764. }
  10765. function createBuffer (that, length) {
  10766. if (kMaxLength() < length) {
  10767. throw new RangeError('Invalid typed array length')
  10768. }
  10769. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10770. // Return an augmented `Uint8Array` instance, for best performance
  10771. that = new Uint8Array(length)
  10772. that.__proto__ = Buffer.prototype
  10773. } else {
  10774. // Fallback: Return an object instance of the Buffer class
  10775. if (that === null) {
  10776. that = new Buffer(length)
  10777. }
  10778. that.length = length
  10779. }
  10780. return that
  10781. }
  10782. /**
  10783. * The Buffer constructor returns instances of `Uint8Array` that have their
  10784. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  10785. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  10786. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  10787. * returns a single octet.
  10788. *
  10789. * The `Uint8Array` prototype remains unmodified.
  10790. */
  10791. function Buffer (arg, encodingOrOffset, length) {
  10792. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  10793. return new Buffer(arg, encodingOrOffset, length)
  10794. }
  10795. // Common case.
  10796. if (typeof arg === 'number') {
  10797. if (typeof encodingOrOffset === 'string') {
  10798. throw new Error(
  10799. 'If encoding is specified then the first argument must be a string'
  10800. )
  10801. }
  10802. return allocUnsafe(this, arg)
  10803. }
  10804. return from(this, arg, encodingOrOffset, length)
  10805. }
  10806. Buffer.poolSize = 8192 // not used by this implementation
  10807. // TODO: Legacy, not needed anymore. Remove in next major version.
  10808. Buffer._augment = function (arr) {
  10809. arr.__proto__ = Buffer.prototype
  10810. return arr
  10811. }
  10812. function from (that, value, encodingOrOffset, length) {
  10813. if (typeof value === 'number') {
  10814. throw new TypeError('"value" argument must not be a number')
  10815. }
  10816. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  10817. return fromArrayBuffer(that, value, encodingOrOffset, length)
  10818. }
  10819. if (typeof value === 'string') {
  10820. return fromString(that, value, encodingOrOffset)
  10821. }
  10822. return fromObject(that, value)
  10823. }
  10824. /**
  10825. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  10826. * if value is a number.
  10827. * Buffer.from(str[, encoding])
  10828. * Buffer.from(array)
  10829. * Buffer.from(buffer)
  10830. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  10831. **/
  10832. Buffer.from = function (value, encodingOrOffset, length) {
  10833. return from(null, value, encodingOrOffset, length)
  10834. }
  10835. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10836. Buffer.prototype.__proto__ = Uint8Array.prototype
  10837. Buffer.__proto__ = Uint8Array
  10838. if (typeof Symbol !== 'undefined' && Symbol.species &&
  10839. Buffer[Symbol.species] === Buffer) {
  10840. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  10841. Object.defineProperty(Buffer, Symbol.species, {
  10842. value: null,
  10843. configurable: true
  10844. })
  10845. }
  10846. }
  10847. function assertSize (size) {
  10848. if (typeof size !== 'number') {
  10849. throw new TypeError('"size" argument must be a number')
  10850. } else if (size < 0) {
  10851. throw new RangeError('"size" argument must not be negative')
  10852. }
  10853. }
  10854. function alloc (that, size, fill, encoding) {
  10855. assertSize(size)
  10856. if (size <= 0) {
  10857. return createBuffer(that, size)
  10858. }
  10859. if (fill !== undefined) {
  10860. // Only pay attention to encoding if it's a string. This
  10861. // prevents accidentally sending in a number that would
  10862. // be interpretted as a start offset.
  10863. return typeof encoding === 'string'
  10864. ? createBuffer(that, size).fill(fill, encoding)
  10865. : createBuffer(that, size).fill(fill)
  10866. }
  10867. return createBuffer(that, size)
  10868. }
  10869. /**
  10870. * Creates a new filled Buffer instance.
  10871. * alloc(size[, fill[, encoding]])
  10872. **/
  10873. Buffer.alloc = function (size, fill, encoding) {
  10874. return alloc(null, size, fill, encoding)
  10875. }
  10876. function allocUnsafe (that, size) {
  10877. assertSize(size)
  10878. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  10879. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  10880. for (var i = 0; i < size; ++i) {
  10881. that[i] = 0
  10882. }
  10883. }
  10884. return that
  10885. }
  10886. /**
  10887. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  10888. * */
  10889. Buffer.allocUnsafe = function (size) {
  10890. return allocUnsafe(null, size)
  10891. }
  10892. /**
  10893. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  10894. */
  10895. Buffer.allocUnsafeSlow = function (size) {
  10896. return allocUnsafe(null, size)
  10897. }
  10898. function fromString (that, string, encoding) {
  10899. if (typeof encoding !== 'string' || encoding === '') {
  10900. encoding = 'utf8'
  10901. }
  10902. if (!Buffer.isEncoding(encoding)) {
  10903. throw new TypeError('"encoding" must be a valid string encoding')
  10904. }
  10905. var length = byteLength(string, encoding) | 0
  10906. that = createBuffer(that, length)
  10907. var actual = that.write(string, encoding)
  10908. if (actual !== length) {
  10909. // Writing a hex string, for example, that contains invalid characters will
  10910. // cause everything after the first invalid character to be ignored. (e.g.
  10911. // 'abxxcd' will be treated as 'ab')
  10912. that = that.slice(0, actual)
  10913. }
  10914. return that
  10915. }
  10916. function fromArrayLike (that, array) {
  10917. var length = array.length < 0 ? 0 : checked(array.length) | 0
  10918. that = createBuffer(that, length)
  10919. for (var i = 0; i < length; i += 1) {
  10920. that[i] = array[i] & 255
  10921. }
  10922. return that
  10923. }
  10924. function fromArrayBuffer (that, array, byteOffset, length) {
  10925. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  10926. if (byteOffset < 0 || array.byteLength < byteOffset) {
  10927. throw new RangeError('\'offset\' is out of bounds')
  10928. }
  10929. if (array.byteLength < byteOffset + (length || 0)) {
  10930. throw new RangeError('\'length\' is out of bounds')
  10931. }
  10932. if (byteOffset === undefined && length === undefined) {
  10933. array = new Uint8Array(array)
  10934. } else if (length === undefined) {
  10935. array = new Uint8Array(array, byteOffset)
  10936. } else {
  10937. array = new Uint8Array(array, byteOffset, length)
  10938. }
  10939. if (Buffer.TYPED_ARRAY_SUPPORT) {
  10940. // Return an augmented `Uint8Array` instance, for best performance
  10941. that = array
  10942. that.__proto__ = Buffer.prototype
  10943. } else {
  10944. // Fallback: Return an object instance of the Buffer class
  10945. that = fromArrayLike(that, array)
  10946. }
  10947. return that
  10948. }
  10949. function fromObject (that, obj) {
  10950. if (Buffer.isBuffer(obj)) {
  10951. var len = checked(obj.length) | 0
  10952. that = createBuffer(that, len)
  10953. if (that.length === 0) {
  10954. return that
  10955. }
  10956. obj.copy(that, 0, 0, len)
  10957. return that
  10958. }
  10959. if (obj) {
  10960. if ((typeof ArrayBuffer !== 'undefined' &&
  10961. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  10962. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  10963. return createBuffer(that, 0)
  10964. }
  10965. return fromArrayLike(that, obj)
  10966. }
  10967. if (obj.type === 'Buffer' && isArray(obj.data)) {
  10968. return fromArrayLike(that, obj.data)
  10969. }
  10970. }
  10971. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  10972. }
  10973. function checked (length) {
  10974. // Note: cannot use `length < kMaxLength()` here because that fails when
  10975. // length is NaN (which is otherwise coerced to zero.)
  10976. if (length >= kMaxLength()) {
  10977. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  10978. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  10979. }
  10980. return length | 0
  10981. }
  10982. function SlowBuffer (length) {
  10983. if (+length != length) { // eslint-disable-line eqeqeq
  10984. length = 0
  10985. }
  10986. return Buffer.alloc(+length)
  10987. }
  10988. Buffer.isBuffer = function isBuffer (b) {
  10989. return !!(b != null && b._isBuffer)
  10990. }
  10991. Buffer.compare = function compare (a, b) {
  10992. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  10993. throw new TypeError('Arguments must be Buffers')
  10994. }
  10995. if (a === b) return 0
  10996. var x = a.length
  10997. var y = b.length
  10998. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  10999. if (a[i] !== b[i]) {
  11000. x = a[i]
  11001. y = b[i]
  11002. break
  11003. }
  11004. }
  11005. if (x < y) return -1
  11006. if (y < x) return 1
  11007. return 0
  11008. }
  11009. Buffer.isEncoding = function isEncoding (encoding) {
  11010. switch (String(encoding).toLowerCase()) {
  11011. case 'hex':
  11012. case 'utf8':
  11013. case 'utf-8':
  11014. case 'ascii':
  11015. case 'latin1':
  11016. case 'binary':
  11017. case 'base64':
  11018. case 'ucs2':
  11019. case 'ucs-2':
  11020. case 'utf16le':
  11021. case 'utf-16le':
  11022. return true
  11023. default:
  11024. return false
  11025. }
  11026. }
  11027. Buffer.concat = function concat (list, length) {
  11028. if (!isArray(list)) {
  11029. throw new TypeError('"list" argument must be an Array of Buffers')
  11030. }
  11031. if (list.length === 0) {
  11032. return Buffer.alloc(0)
  11033. }
  11034. var i
  11035. if (length === undefined) {
  11036. length = 0
  11037. for (i = 0; i < list.length; ++i) {
  11038. length += list[i].length
  11039. }
  11040. }
  11041. var buffer = Buffer.allocUnsafe(length)
  11042. var pos = 0
  11043. for (i = 0; i < list.length; ++i) {
  11044. var buf = list[i]
  11045. if (!Buffer.isBuffer(buf)) {
  11046. throw new TypeError('"list" argument must be an Array of Buffers')
  11047. }
  11048. buf.copy(buffer, pos)
  11049. pos += buf.length
  11050. }
  11051. return buffer
  11052. }
  11053. function byteLength (string, encoding) {
  11054. if (Buffer.isBuffer(string)) {
  11055. return string.length
  11056. }
  11057. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  11058. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  11059. return string.byteLength
  11060. }
  11061. if (typeof string !== 'string') {
  11062. string = '' + string
  11063. }
  11064. var len = string.length
  11065. if (len === 0) return 0
  11066. // Use a for loop to avoid recursion
  11067. var loweredCase = false
  11068. for (;;) {
  11069. switch (encoding) {
  11070. case 'ascii':
  11071. case 'latin1':
  11072. case 'binary':
  11073. return len
  11074. case 'utf8':
  11075. case 'utf-8':
  11076. case undefined:
  11077. return utf8ToBytes(string).length
  11078. case 'ucs2':
  11079. case 'ucs-2':
  11080. case 'utf16le':
  11081. case 'utf-16le':
  11082. return len * 2
  11083. case 'hex':
  11084. return len >>> 1
  11085. case 'base64':
  11086. return base64ToBytes(string).length
  11087. default:
  11088. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  11089. encoding = ('' + encoding).toLowerCase()
  11090. loweredCase = true
  11091. }
  11092. }
  11093. }
  11094. Buffer.byteLength = byteLength
  11095. function slowToString (encoding, start, end) {
  11096. var loweredCase = false
  11097. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  11098. // property of a typed array.
  11099. // This behaves neither like String nor Uint8Array in that we set start/end
  11100. // to their upper/lower bounds if the value passed is out of range.
  11101. // undefined is handled specially as per ECMA-262 6th Edition,
  11102. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  11103. if (start === undefined || start < 0) {
  11104. start = 0
  11105. }
  11106. // Return early if start > this.length. Done here to prevent potential uint32
  11107. // coercion fail below.
  11108. if (start > this.length) {
  11109. return ''
  11110. }
  11111. if (end === undefined || end > this.length) {
  11112. end = this.length
  11113. }
  11114. if (end <= 0) {
  11115. return ''
  11116. }
  11117. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  11118. end >>>= 0
  11119. start >>>= 0
  11120. if (end <= start) {
  11121. return ''
  11122. }
  11123. if (!encoding) encoding = 'utf8'
  11124. while (true) {
  11125. switch (encoding) {
  11126. case 'hex':
  11127. return hexSlice(this, start, end)
  11128. case 'utf8':
  11129. case 'utf-8':
  11130. return utf8Slice(this, start, end)
  11131. case 'ascii':
  11132. return asciiSlice(this, start, end)
  11133. case 'latin1':
  11134. case 'binary':
  11135. return latin1Slice(this, start, end)
  11136. case 'base64':
  11137. return base64Slice(this, start, end)
  11138. case 'ucs2':
  11139. case 'ucs-2':
  11140. case 'utf16le':
  11141. case 'utf-16le':
  11142. return utf16leSlice(this, start, end)
  11143. default:
  11144. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11145. encoding = (encoding + '').toLowerCase()
  11146. loweredCase = true
  11147. }
  11148. }
  11149. }
  11150. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  11151. // Buffer instances.
  11152. Buffer.prototype._isBuffer = true
  11153. function swap (b, n, m) {
  11154. var i = b[n]
  11155. b[n] = b[m]
  11156. b[m] = i
  11157. }
  11158. Buffer.prototype.swap16 = function swap16 () {
  11159. var len = this.length
  11160. if (len % 2 !== 0) {
  11161. throw new RangeError('Buffer size must be a multiple of 16-bits')
  11162. }
  11163. for (var i = 0; i < len; i += 2) {
  11164. swap(this, i, i + 1)
  11165. }
  11166. return this
  11167. }
  11168. Buffer.prototype.swap32 = function swap32 () {
  11169. var len = this.length
  11170. if (len % 4 !== 0) {
  11171. throw new RangeError('Buffer size must be a multiple of 32-bits')
  11172. }
  11173. for (var i = 0; i < len; i += 4) {
  11174. swap(this, i, i + 3)
  11175. swap(this, i + 1, i + 2)
  11176. }
  11177. return this
  11178. }
  11179. Buffer.prototype.swap64 = function swap64 () {
  11180. var len = this.length
  11181. if (len % 8 !== 0) {
  11182. throw new RangeError('Buffer size must be a multiple of 64-bits')
  11183. }
  11184. for (var i = 0; i < len; i += 8) {
  11185. swap(this, i, i + 7)
  11186. swap(this, i + 1, i + 6)
  11187. swap(this, i + 2, i + 5)
  11188. swap(this, i + 3, i + 4)
  11189. }
  11190. return this
  11191. }
  11192. Buffer.prototype.toString = function toString () {
  11193. var length = this.length | 0
  11194. if (length === 0) return ''
  11195. if (arguments.length === 0) return utf8Slice(this, 0, length)
  11196. return slowToString.apply(this, arguments)
  11197. }
  11198. Buffer.prototype.equals = function equals (b) {
  11199. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  11200. if (this === b) return true
  11201. return Buffer.compare(this, b) === 0
  11202. }
  11203. Buffer.prototype.inspect = function inspect () {
  11204. var str = ''
  11205. var max = exports.INSPECT_MAX_BYTES
  11206. if (this.length > 0) {
  11207. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  11208. if (this.length > max) str += ' ... '
  11209. }
  11210. return '<Buffer ' + str + '>'
  11211. }
  11212. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  11213. if (!Buffer.isBuffer(target)) {
  11214. throw new TypeError('Argument must be a Buffer')
  11215. }
  11216. if (start === undefined) {
  11217. start = 0
  11218. }
  11219. if (end === undefined) {
  11220. end = target ? target.length : 0
  11221. }
  11222. if (thisStart === undefined) {
  11223. thisStart = 0
  11224. }
  11225. if (thisEnd === undefined) {
  11226. thisEnd = this.length
  11227. }
  11228. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  11229. throw new RangeError('out of range index')
  11230. }
  11231. if (thisStart >= thisEnd && start >= end) {
  11232. return 0
  11233. }
  11234. if (thisStart >= thisEnd) {
  11235. return -1
  11236. }
  11237. if (start >= end) {
  11238. return 1
  11239. }
  11240. start >>>= 0
  11241. end >>>= 0
  11242. thisStart >>>= 0
  11243. thisEnd >>>= 0
  11244. if (this === target) return 0
  11245. var x = thisEnd - thisStart
  11246. var y = end - start
  11247. var len = Math.min(x, y)
  11248. var thisCopy = this.slice(thisStart, thisEnd)
  11249. var targetCopy = target.slice(start, end)
  11250. for (var i = 0; i < len; ++i) {
  11251. if (thisCopy[i] !== targetCopy[i]) {
  11252. x = thisCopy[i]
  11253. y = targetCopy[i]
  11254. break
  11255. }
  11256. }
  11257. if (x < y) return -1
  11258. if (y < x) return 1
  11259. return 0
  11260. }
  11261. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  11262. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  11263. //
  11264. // Arguments:
  11265. // - buffer - a Buffer to search
  11266. // - val - a string, Buffer, or number
  11267. // - byteOffset - an index into `buffer`; will be clamped to an int32
  11268. // - encoding - an optional encoding, relevant is val is a string
  11269. // - dir - true for indexOf, false for lastIndexOf
  11270. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  11271. // Empty buffer means no match
  11272. if (buffer.length === 0) return -1
  11273. // Normalize byteOffset
  11274. if (typeof byteOffset === 'string') {
  11275. encoding = byteOffset
  11276. byteOffset = 0
  11277. } else if (byteOffset > 0x7fffffff) {
  11278. byteOffset = 0x7fffffff
  11279. } else if (byteOffset < -0x80000000) {
  11280. byteOffset = -0x80000000
  11281. }
  11282. byteOffset = +byteOffset // Coerce to Number.
  11283. if (isNaN(byteOffset)) {
  11284. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  11285. byteOffset = dir ? 0 : (buffer.length - 1)
  11286. }
  11287. // Normalize byteOffset: negative offsets start from the end of the buffer
  11288. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  11289. if (byteOffset >= buffer.length) {
  11290. if (dir) return -1
  11291. else byteOffset = buffer.length - 1
  11292. } else if (byteOffset < 0) {
  11293. if (dir) byteOffset = 0
  11294. else return -1
  11295. }
  11296. // Normalize val
  11297. if (typeof val === 'string') {
  11298. val = Buffer.from(val, encoding)
  11299. }
  11300. // Finally, search either indexOf (if dir is true) or lastIndexOf
  11301. if (Buffer.isBuffer(val)) {
  11302. // Special case: looking for empty string/buffer always fails
  11303. if (val.length === 0) {
  11304. return -1
  11305. }
  11306. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  11307. } else if (typeof val === 'number') {
  11308. val = val & 0xFF // Search for a byte value [0-255]
  11309. if (Buffer.TYPED_ARRAY_SUPPORT &&
  11310. typeof Uint8Array.prototype.indexOf === 'function') {
  11311. if (dir) {
  11312. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  11313. } else {
  11314. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  11315. }
  11316. }
  11317. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  11318. }
  11319. throw new TypeError('val must be string, number or Buffer')
  11320. }
  11321. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  11322. var indexSize = 1
  11323. var arrLength = arr.length
  11324. var valLength = val.length
  11325. if (encoding !== undefined) {
  11326. encoding = String(encoding).toLowerCase()
  11327. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  11328. encoding === 'utf16le' || encoding === 'utf-16le') {
  11329. if (arr.length < 2 || val.length < 2) {
  11330. return -1
  11331. }
  11332. indexSize = 2
  11333. arrLength /= 2
  11334. valLength /= 2
  11335. byteOffset /= 2
  11336. }
  11337. }
  11338. function read (buf, i) {
  11339. if (indexSize === 1) {
  11340. return buf[i]
  11341. } else {
  11342. return buf.readUInt16BE(i * indexSize)
  11343. }
  11344. }
  11345. var i
  11346. if (dir) {
  11347. var foundIndex = -1
  11348. for (i = byteOffset; i < arrLength; i++) {
  11349. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  11350. if (foundIndex === -1) foundIndex = i
  11351. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  11352. } else {
  11353. if (foundIndex !== -1) i -= i - foundIndex
  11354. foundIndex = -1
  11355. }
  11356. }
  11357. } else {
  11358. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  11359. for (i = byteOffset; i >= 0; i--) {
  11360. var found = true
  11361. for (var j = 0; j < valLength; j++) {
  11362. if (read(arr, i + j) !== read(val, j)) {
  11363. found = false
  11364. break
  11365. }
  11366. }
  11367. if (found) return i
  11368. }
  11369. }
  11370. return -1
  11371. }
  11372. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  11373. return this.indexOf(val, byteOffset, encoding) !== -1
  11374. }
  11375. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  11376. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  11377. }
  11378. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  11379. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  11380. }
  11381. function hexWrite (buf, string, offset, length) {
  11382. offset = Number(offset) || 0
  11383. var remaining = buf.length - offset
  11384. if (!length) {
  11385. length = remaining
  11386. } else {
  11387. length = Number(length)
  11388. if (length > remaining) {
  11389. length = remaining
  11390. }
  11391. }
  11392. // must be an even number of digits
  11393. var strLen = string.length
  11394. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  11395. if (length > strLen / 2) {
  11396. length = strLen / 2
  11397. }
  11398. for (var i = 0; i < length; ++i) {
  11399. var parsed = parseInt(string.substr(i * 2, 2), 16)
  11400. if (isNaN(parsed)) return i
  11401. buf[offset + i] = parsed
  11402. }
  11403. return i
  11404. }
  11405. function utf8Write (buf, string, offset, length) {
  11406. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  11407. }
  11408. function asciiWrite (buf, string, offset, length) {
  11409. return blitBuffer(asciiToBytes(string), buf, offset, length)
  11410. }
  11411. function latin1Write (buf, string, offset, length) {
  11412. return asciiWrite(buf, string, offset, length)
  11413. }
  11414. function base64Write (buf, string, offset, length) {
  11415. return blitBuffer(base64ToBytes(string), buf, offset, length)
  11416. }
  11417. function ucs2Write (buf, string, offset, length) {
  11418. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  11419. }
  11420. Buffer.prototype.write = function write (string, offset, length, encoding) {
  11421. // Buffer#write(string)
  11422. if (offset === undefined) {
  11423. encoding = 'utf8'
  11424. length = this.length
  11425. offset = 0
  11426. // Buffer#write(string, encoding)
  11427. } else if (length === undefined && typeof offset === 'string') {
  11428. encoding = offset
  11429. length = this.length
  11430. offset = 0
  11431. // Buffer#write(string, offset[, length][, encoding])
  11432. } else if (isFinite(offset)) {
  11433. offset = offset | 0
  11434. if (isFinite(length)) {
  11435. length = length | 0
  11436. if (encoding === undefined) encoding = 'utf8'
  11437. } else {
  11438. encoding = length
  11439. length = undefined
  11440. }
  11441. // legacy write(string, encoding, offset, length) - remove in v0.13
  11442. } else {
  11443. throw new Error(
  11444. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  11445. )
  11446. }
  11447. var remaining = this.length - offset
  11448. if (length === undefined || length > remaining) length = remaining
  11449. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  11450. throw new RangeError('Attempt to write outside buffer bounds')
  11451. }
  11452. if (!encoding) encoding = 'utf8'
  11453. var loweredCase = false
  11454. for (;;) {
  11455. switch (encoding) {
  11456. case 'hex':
  11457. return hexWrite(this, string, offset, length)
  11458. case 'utf8':
  11459. case 'utf-8':
  11460. return utf8Write(this, string, offset, length)
  11461. case 'ascii':
  11462. return asciiWrite(this, string, offset, length)
  11463. case 'latin1':
  11464. case 'binary':
  11465. return latin1Write(this, string, offset, length)
  11466. case 'base64':
  11467. // Warning: maxLength not taken into account in base64Write
  11468. return base64Write(this, string, offset, length)
  11469. case 'ucs2':
  11470. case 'ucs-2':
  11471. case 'utf16le':
  11472. case 'utf-16le':
  11473. return ucs2Write(this, string, offset, length)
  11474. default:
  11475. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11476. encoding = ('' + encoding).toLowerCase()
  11477. loweredCase = true
  11478. }
  11479. }
  11480. }
  11481. Buffer.prototype.toJSON = function toJSON () {
  11482. return {
  11483. type: 'Buffer',
  11484. data: Array.prototype.slice.call(this._arr || this, 0)
  11485. }
  11486. }
  11487. function base64Slice (buf, start, end) {
  11488. if (start === 0 && end === buf.length) {
  11489. return base64.fromByteArray(buf)
  11490. } else {
  11491. return base64.fromByteArray(buf.slice(start, end))
  11492. }
  11493. }
  11494. function utf8Slice (buf, start, end) {
  11495. end = Math.min(buf.length, end)
  11496. var res = []
  11497. var i = start
  11498. while (i < end) {
  11499. var firstByte = buf[i]
  11500. var codePoint = null
  11501. var bytesPerSequence = (firstByte > 0xEF) ? 4
  11502. : (firstByte > 0xDF) ? 3
  11503. : (firstByte > 0xBF) ? 2
  11504. : 1
  11505. if (i + bytesPerSequence <= end) {
  11506. var secondByte, thirdByte, fourthByte, tempCodePoint
  11507. switch (bytesPerSequence) {
  11508. case 1:
  11509. if (firstByte < 0x80) {
  11510. codePoint = firstByte
  11511. }
  11512. break
  11513. case 2:
  11514. secondByte = buf[i + 1]
  11515. if ((secondByte & 0xC0) === 0x80) {
  11516. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  11517. if (tempCodePoint > 0x7F) {
  11518. codePoint = tempCodePoint
  11519. }
  11520. }
  11521. break
  11522. case 3:
  11523. secondByte = buf[i + 1]
  11524. thirdByte = buf[i + 2]
  11525. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  11526. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  11527. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  11528. codePoint = tempCodePoint
  11529. }
  11530. }
  11531. break
  11532. case 4:
  11533. secondByte = buf[i + 1]
  11534. thirdByte = buf[i + 2]
  11535. fourthByte = buf[i + 3]
  11536. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  11537. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  11538. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  11539. codePoint = tempCodePoint
  11540. }
  11541. }
  11542. }
  11543. }
  11544. if (codePoint === null) {
  11545. // we did not generate a valid codePoint so insert a
  11546. // replacement char (U+FFFD) and advance only 1 byte
  11547. codePoint = 0xFFFD
  11548. bytesPerSequence = 1
  11549. } else if (codePoint > 0xFFFF) {
  11550. // encode to utf16 (surrogate pair dance)
  11551. codePoint -= 0x10000
  11552. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  11553. codePoint = 0xDC00 | codePoint & 0x3FF
  11554. }
  11555. res.push(codePoint)
  11556. i += bytesPerSequence
  11557. }
  11558. return decodeCodePointsArray(res)
  11559. }
  11560. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  11561. // the lowest limit is Chrome, with 0x10000 args.
  11562. // We go 1 magnitude less, for safety
  11563. var MAX_ARGUMENTS_LENGTH = 0x1000
  11564. function decodeCodePointsArray (codePoints) {
  11565. var len = codePoints.length
  11566. if (len <= MAX_ARGUMENTS_LENGTH) {
  11567. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  11568. }
  11569. // Decode in chunks to avoid "call stack size exceeded".
  11570. var res = ''
  11571. var i = 0
  11572. while (i < len) {
  11573. res += String.fromCharCode.apply(
  11574. String,
  11575. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  11576. )
  11577. }
  11578. return res
  11579. }
  11580. function asciiSlice (buf, start, end) {
  11581. var ret = ''
  11582. end = Math.min(buf.length, end)
  11583. for (var i = start; i < end; ++i) {
  11584. ret += String.fromCharCode(buf[i] & 0x7F)
  11585. }
  11586. return ret
  11587. }
  11588. function latin1Slice (buf, start, end) {
  11589. var ret = ''
  11590. end = Math.min(buf.length, end)
  11591. for (var i = start; i < end; ++i) {
  11592. ret += String.fromCharCode(buf[i])
  11593. }
  11594. return ret
  11595. }
  11596. function hexSlice (buf, start, end) {
  11597. var len = buf.length
  11598. if (!start || start < 0) start = 0
  11599. if (!end || end < 0 || end > len) end = len
  11600. var out = ''
  11601. for (var i = start; i < end; ++i) {
  11602. out += toHex(buf[i])
  11603. }
  11604. return out
  11605. }
  11606. function utf16leSlice (buf, start, end) {
  11607. var bytes = buf.slice(start, end)
  11608. var res = ''
  11609. for (var i = 0; i < bytes.length; i += 2) {
  11610. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  11611. }
  11612. return res
  11613. }
  11614. Buffer.prototype.slice = function slice (start, end) {
  11615. var len = this.length
  11616. start = ~~start
  11617. end = end === undefined ? len : ~~end
  11618. if (start < 0) {
  11619. start += len
  11620. if (start < 0) start = 0
  11621. } else if (start > len) {
  11622. start = len
  11623. }
  11624. if (end < 0) {
  11625. end += len
  11626. if (end < 0) end = 0
  11627. } else if (end > len) {
  11628. end = len
  11629. }
  11630. if (end < start) end = start
  11631. var newBuf
  11632. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11633. newBuf = this.subarray(start, end)
  11634. newBuf.__proto__ = Buffer.prototype
  11635. } else {
  11636. var sliceLen = end - start
  11637. newBuf = new Buffer(sliceLen, undefined)
  11638. for (var i = 0; i < sliceLen; ++i) {
  11639. newBuf[i] = this[i + start]
  11640. }
  11641. }
  11642. return newBuf
  11643. }
  11644. /*
  11645. * Need to make sure that buffer isn't trying to write out of bounds.
  11646. */
  11647. function checkOffset (offset, ext, length) {
  11648. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  11649. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  11650. }
  11651. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  11652. offset = offset | 0
  11653. byteLength = byteLength | 0
  11654. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11655. var val = this[offset]
  11656. var mul = 1
  11657. var i = 0
  11658. while (++i < byteLength && (mul *= 0x100)) {
  11659. val += this[offset + i] * mul
  11660. }
  11661. return val
  11662. }
  11663. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  11664. offset = offset | 0
  11665. byteLength = byteLength | 0
  11666. if (!noAssert) {
  11667. checkOffset(offset, byteLength, this.length)
  11668. }
  11669. var val = this[offset + --byteLength]
  11670. var mul = 1
  11671. while (byteLength > 0 && (mul *= 0x100)) {
  11672. val += this[offset + --byteLength] * mul
  11673. }
  11674. return val
  11675. }
  11676. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  11677. if (!noAssert) checkOffset(offset, 1, this.length)
  11678. return this[offset]
  11679. }
  11680. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  11681. if (!noAssert) checkOffset(offset, 2, this.length)
  11682. return this[offset] | (this[offset + 1] << 8)
  11683. }
  11684. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  11685. if (!noAssert) checkOffset(offset, 2, this.length)
  11686. return (this[offset] << 8) | this[offset + 1]
  11687. }
  11688. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  11689. if (!noAssert) checkOffset(offset, 4, this.length)
  11690. return ((this[offset]) |
  11691. (this[offset + 1] << 8) |
  11692. (this[offset + 2] << 16)) +
  11693. (this[offset + 3] * 0x1000000)
  11694. }
  11695. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  11696. if (!noAssert) checkOffset(offset, 4, this.length)
  11697. return (this[offset] * 0x1000000) +
  11698. ((this[offset + 1] << 16) |
  11699. (this[offset + 2] << 8) |
  11700. this[offset + 3])
  11701. }
  11702. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  11703. offset = offset | 0
  11704. byteLength = byteLength | 0
  11705. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11706. var val = this[offset]
  11707. var mul = 1
  11708. var i = 0
  11709. while (++i < byteLength && (mul *= 0x100)) {
  11710. val += this[offset + i] * mul
  11711. }
  11712. mul *= 0x80
  11713. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11714. return val
  11715. }
  11716. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  11717. offset = offset | 0
  11718. byteLength = byteLength | 0
  11719. if (!noAssert) checkOffset(offset, byteLength, this.length)
  11720. var i = byteLength
  11721. var mul = 1
  11722. var val = this[offset + --i]
  11723. while (i > 0 && (mul *= 0x100)) {
  11724. val += this[offset + --i] * mul
  11725. }
  11726. mul *= 0x80
  11727. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  11728. return val
  11729. }
  11730. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  11731. if (!noAssert) checkOffset(offset, 1, this.length)
  11732. if (!(this[offset] & 0x80)) return (this[offset])
  11733. return ((0xff - this[offset] + 1) * -1)
  11734. }
  11735. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  11736. if (!noAssert) checkOffset(offset, 2, this.length)
  11737. var val = this[offset] | (this[offset + 1] << 8)
  11738. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11739. }
  11740. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  11741. if (!noAssert) checkOffset(offset, 2, this.length)
  11742. var val = this[offset + 1] | (this[offset] << 8)
  11743. return (val & 0x8000) ? val | 0xFFFF0000 : val
  11744. }
  11745. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  11746. if (!noAssert) checkOffset(offset, 4, this.length)
  11747. return (this[offset]) |
  11748. (this[offset + 1] << 8) |
  11749. (this[offset + 2] << 16) |
  11750. (this[offset + 3] << 24)
  11751. }
  11752. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  11753. if (!noAssert) checkOffset(offset, 4, this.length)
  11754. return (this[offset] << 24) |
  11755. (this[offset + 1] << 16) |
  11756. (this[offset + 2] << 8) |
  11757. (this[offset + 3])
  11758. }
  11759. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  11760. if (!noAssert) checkOffset(offset, 4, this.length)
  11761. return ieee754.read(this, offset, true, 23, 4)
  11762. }
  11763. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  11764. if (!noAssert) checkOffset(offset, 4, this.length)
  11765. return ieee754.read(this, offset, false, 23, 4)
  11766. }
  11767. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  11768. if (!noAssert) checkOffset(offset, 8, this.length)
  11769. return ieee754.read(this, offset, true, 52, 8)
  11770. }
  11771. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  11772. if (!noAssert) checkOffset(offset, 8, this.length)
  11773. return ieee754.read(this, offset, false, 52, 8)
  11774. }
  11775. function checkInt (buf, value, offset, ext, max, min) {
  11776. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  11777. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  11778. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11779. }
  11780. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  11781. value = +value
  11782. offset = offset | 0
  11783. byteLength = byteLength | 0
  11784. if (!noAssert) {
  11785. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11786. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11787. }
  11788. var mul = 1
  11789. var i = 0
  11790. this[offset] = value & 0xFF
  11791. while (++i < byteLength && (mul *= 0x100)) {
  11792. this[offset + i] = (value / mul) & 0xFF
  11793. }
  11794. return offset + byteLength
  11795. }
  11796. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  11797. value = +value
  11798. offset = offset | 0
  11799. byteLength = byteLength | 0
  11800. if (!noAssert) {
  11801. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  11802. checkInt(this, value, offset, byteLength, maxBytes, 0)
  11803. }
  11804. var i = byteLength - 1
  11805. var mul = 1
  11806. this[offset + i] = value & 0xFF
  11807. while (--i >= 0 && (mul *= 0x100)) {
  11808. this[offset + i] = (value / mul) & 0xFF
  11809. }
  11810. return offset + byteLength
  11811. }
  11812. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  11813. value = +value
  11814. offset = offset | 0
  11815. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  11816. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11817. this[offset] = (value & 0xff)
  11818. return offset + 1
  11819. }
  11820. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  11821. if (value < 0) value = 0xffff + value + 1
  11822. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  11823. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  11824. (littleEndian ? i : 1 - i) * 8
  11825. }
  11826. }
  11827. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  11828. value = +value
  11829. offset = offset | 0
  11830. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11831. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11832. this[offset] = (value & 0xff)
  11833. this[offset + 1] = (value >>> 8)
  11834. } else {
  11835. objectWriteUInt16(this, value, offset, true)
  11836. }
  11837. return offset + 2
  11838. }
  11839. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  11840. value = +value
  11841. offset = offset | 0
  11842. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  11843. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11844. this[offset] = (value >>> 8)
  11845. this[offset + 1] = (value & 0xff)
  11846. } else {
  11847. objectWriteUInt16(this, value, offset, false)
  11848. }
  11849. return offset + 2
  11850. }
  11851. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  11852. if (value < 0) value = 0xffffffff + value + 1
  11853. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  11854. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  11855. }
  11856. }
  11857. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  11858. value = +value
  11859. offset = offset | 0
  11860. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11861. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11862. this[offset + 3] = (value >>> 24)
  11863. this[offset + 2] = (value >>> 16)
  11864. this[offset + 1] = (value >>> 8)
  11865. this[offset] = (value & 0xff)
  11866. } else {
  11867. objectWriteUInt32(this, value, offset, true)
  11868. }
  11869. return offset + 4
  11870. }
  11871. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  11872. value = +value
  11873. offset = offset | 0
  11874. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  11875. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11876. this[offset] = (value >>> 24)
  11877. this[offset + 1] = (value >>> 16)
  11878. this[offset + 2] = (value >>> 8)
  11879. this[offset + 3] = (value & 0xff)
  11880. } else {
  11881. objectWriteUInt32(this, value, offset, false)
  11882. }
  11883. return offset + 4
  11884. }
  11885. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  11886. value = +value
  11887. offset = offset | 0
  11888. if (!noAssert) {
  11889. var limit = Math.pow(2, 8 * byteLength - 1)
  11890. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11891. }
  11892. var i = 0
  11893. var mul = 1
  11894. var sub = 0
  11895. this[offset] = value & 0xFF
  11896. while (++i < byteLength && (mul *= 0x100)) {
  11897. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  11898. sub = 1
  11899. }
  11900. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11901. }
  11902. return offset + byteLength
  11903. }
  11904. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  11905. value = +value
  11906. offset = offset | 0
  11907. if (!noAssert) {
  11908. var limit = Math.pow(2, 8 * byteLength - 1)
  11909. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  11910. }
  11911. var i = byteLength - 1
  11912. var mul = 1
  11913. var sub = 0
  11914. this[offset + i] = value & 0xFF
  11915. while (--i >= 0 && (mul *= 0x100)) {
  11916. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  11917. sub = 1
  11918. }
  11919. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  11920. }
  11921. return offset + byteLength
  11922. }
  11923. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  11924. value = +value
  11925. offset = offset | 0
  11926. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  11927. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  11928. if (value < 0) value = 0xff + value + 1
  11929. this[offset] = (value & 0xff)
  11930. return offset + 1
  11931. }
  11932. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  11933. value = +value
  11934. offset = offset | 0
  11935. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11936. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11937. this[offset] = (value & 0xff)
  11938. this[offset + 1] = (value >>> 8)
  11939. } else {
  11940. objectWriteUInt16(this, value, offset, true)
  11941. }
  11942. return offset + 2
  11943. }
  11944. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  11945. value = +value
  11946. offset = offset | 0
  11947. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  11948. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11949. this[offset] = (value >>> 8)
  11950. this[offset + 1] = (value & 0xff)
  11951. } else {
  11952. objectWriteUInt16(this, value, offset, false)
  11953. }
  11954. return offset + 2
  11955. }
  11956. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  11957. value = +value
  11958. offset = offset | 0
  11959. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11960. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11961. this[offset] = (value & 0xff)
  11962. this[offset + 1] = (value >>> 8)
  11963. this[offset + 2] = (value >>> 16)
  11964. this[offset + 3] = (value >>> 24)
  11965. } else {
  11966. objectWriteUInt32(this, value, offset, true)
  11967. }
  11968. return offset + 4
  11969. }
  11970. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  11971. value = +value
  11972. offset = offset | 0
  11973. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  11974. if (value < 0) value = 0xffffffff + value + 1
  11975. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11976. this[offset] = (value >>> 24)
  11977. this[offset + 1] = (value >>> 16)
  11978. this[offset + 2] = (value >>> 8)
  11979. this[offset + 3] = (value & 0xff)
  11980. } else {
  11981. objectWriteUInt32(this, value, offset, false)
  11982. }
  11983. return offset + 4
  11984. }
  11985. function checkIEEE754 (buf, value, offset, ext, max, min) {
  11986. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  11987. if (offset < 0) throw new RangeError('Index out of range')
  11988. }
  11989. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  11990. if (!noAssert) {
  11991. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  11992. }
  11993. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  11994. return offset + 4
  11995. }
  11996. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  11997. return writeFloat(this, value, offset, true, noAssert)
  11998. }
  11999. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  12000. return writeFloat(this, value, offset, false, noAssert)
  12001. }
  12002. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  12003. if (!noAssert) {
  12004. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  12005. }
  12006. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  12007. return offset + 8
  12008. }
  12009. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  12010. return writeDouble(this, value, offset, true, noAssert)
  12011. }
  12012. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  12013. return writeDouble(this, value, offset, false, noAssert)
  12014. }
  12015. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  12016. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  12017. if (!start) start = 0
  12018. if (!end && end !== 0) end = this.length
  12019. if (targetStart >= target.length) targetStart = target.length
  12020. if (!targetStart) targetStart = 0
  12021. if (end > 0 && end < start) end = start
  12022. // Copy 0 bytes; we're done
  12023. if (end === start) return 0
  12024. if (target.length === 0 || this.length === 0) return 0
  12025. // Fatal error conditions
  12026. if (targetStart < 0) {
  12027. throw new RangeError('targetStart out of bounds')
  12028. }
  12029. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  12030. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  12031. // Are we oob?
  12032. if (end > this.length) end = this.length
  12033. if (target.length - targetStart < end - start) {
  12034. end = target.length - targetStart + start
  12035. }
  12036. var len = end - start
  12037. var i
  12038. if (this === target && start < targetStart && targetStart < end) {
  12039. // descending copy from end
  12040. for (i = len - 1; i >= 0; --i) {
  12041. target[i + targetStart] = this[i + start]
  12042. }
  12043. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  12044. // ascending copy from start
  12045. for (i = 0; i < len; ++i) {
  12046. target[i + targetStart] = this[i + start]
  12047. }
  12048. } else {
  12049. Uint8Array.prototype.set.call(
  12050. target,
  12051. this.subarray(start, start + len),
  12052. targetStart
  12053. )
  12054. }
  12055. return len
  12056. }
  12057. // Usage:
  12058. // buffer.fill(number[, offset[, end]])
  12059. // buffer.fill(buffer[, offset[, end]])
  12060. // buffer.fill(string[, offset[, end]][, encoding])
  12061. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  12062. // Handle string cases:
  12063. if (typeof val === 'string') {
  12064. if (typeof start === 'string') {
  12065. encoding = start
  12066. start = 0
  12067. end = this.length
  12068. } else if (typeof end === 'string') {
  12069. encoding = end
  12070. end = this.length
  12071. }
  12072. if (val.length === 1) {
  12073. var code = val.charCodeAt(0)
  12074. if (code < 256) {
  12075. val = code
  12076. }
  12077. }
  12078. if (encoding !== undefined && typeof encoding !== 'string') {
  12079. throw new TypeError('encoding must be a string')
  12080. }
  12081. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  12082. throw new TypeError('Unknown encoding: ' + encoding)
  12083. }
  12084. } else if (typeof val === 'number') {
  12085. val = val & 255
  12086. }
  12087. // Invalid ranges are not set to a default, so can range check early.
  12088. if (start < 0 || this.length < start || this.length < end) {
  12089. throw new RangeError('Out of range index')
  12090. }
  12091. if (end <= start) {
  12092. return this
  12093. }
  12094. start = start >>> 0
  12095. end = end === undefined ? this.length : end >>> 0
  12096. if (!val) val = 0
  12097. var i
  12098. if (typeof val === 'number') {
  12099. for (i = start; i < end; ++i) {
  12100. this[i] = val
  12101. }
  12102. } else {
  12103. var bytes = Buffer.isBuffer(val)
  12104. ? val
  12105. : utf8ToBytes(new Buffer(val, encoding).toString())
  12106. var len = bytes.length
  12107. for (i = 0; i < end - start; ++i) {
  12108. this[i + start] = bytes[i % len]
  12109. }
  12110. }
  12111. return this
  12112. }
  12113. // HELPER FUNCTIONS
  12114. // ================
  12115. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  12116. function base64clean (str) {
  12117. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  12118. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  12119. // Node converts strings with length < 2 to ''
  12120. if (str.length < 2) return ''
  12121. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  12122. while (str.length % 4 !== 0) {
  12123. str = str + '='
  12124. }
  12125. return str
  12126. }
  12127. function stringtrim (str) {
  12128. if (str.trim) return str.trim()
  12129. return str.replace(/^\s+|\s+$/g, '')
  12130. }
  12131. function toHex (n) {
  12132. if (n < 16) return '0' + n.toString(16)
  12133. return n.toString(16)
  12134. }
  12135. function utf8ToBytes (string, units) {
  12136. units = units || Infinity
  12137. var codePoint
  12138. var length = string.length
  12139. var leadSurrogate = null
  12140. var bytes = []
  12141. for (var i = 0; i < length; ++i) {
  12142. codePoint = string.charCodeAt(i)
  12143. // is surrogate component
  12144. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  12145. // last char was a lead
  12146. if (!leadSurrogate) {
  12147. // no lead yet
  12148. if (codePoint > 0xDBFF) {
  12149. // unexpected trail
  12150. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12151. continue
  12152. } else if (i + 1 === length) {
  12153. // unpaired lead
  12154. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12155. continue
  12156. }
  12157. // valid lead
  12158. leadSurrogate = codePoint
  12159. continue
  12160. }
  12161. // 2 leads in a row
  12162. if (codePoint < 0xDC00) {
  12163. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12164. leadSurrogate = codePoint
  12165. continue
  12166. }
  12167. // valid surrogate pair
  12168. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  12169. } else if (leadSurrogate) {
  12170. // valid bmp char, but last char was a lead
  12171. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12172. }
  12173. leadSurrogate = null
  12174. // encode utf8
  12175. if (codePoint < 0x80) {
  12176. if ((units -= 1) < 0) break
  12177. bytes.push(codePoint)
  12178. } else if (codePoint < 0x800) {
  12179. if ((units -= 2) < 0) break
  12180. bytes.push(
  12181. codePoint >> 0x6 | 0xC0,
  12182. codePoint & 0x3F | 0x80
  12183. )
  12184. } else if (codePoint < 0x10000) {
  12185. if ((units -= 3) < 0) break
  12186. bytes.push(
  12187. codePoint >> 0xC | 0xE0,
  12188. codePoint >> 0x6 & 0x3F | 0x80,
  12189. codePoint & 0x3F | 0x80
  12190. )
  12191. } else if (codePoint < 0x110000) {
  12192. if ((units -= 4) < 0) break
  12193. bytes.push(
  12194. codePoint >> 0x12 | 0xF0,
  12195. codePoint >> 0xC & 0x3F | 0x80,
  12196. codePoint >> 0x6 & 0x3F | 0x80,
  12197. codePoint & 0x3F | 0x80
  12198. )
  12199. } else {
  12200. throw new Error('Invalid code point')
  12201. }
  12202. }
  12203. return bytes
  12204. }
  12205. function asciiToBytes (str) {
  12206. var byteArray = []
  12207. for (var i = 0; i < str.length; ++i) {
  12208. // Node's code seems to be doing this and not & 0x7F..
  12209. byteArray.push(str.charCodeAt(i) & 0xFF)
  12210. }
  12211. return byteArray
  12212. }
  12213. function utf16leToBytes (str, units) {
  12214. var c, hi, lo
  12215. var byteArray = []
  12216. for (var i = 0; i < str.length; ++i) {
  12217. if ((units -= 2) < 0) break
  12218. c = str.charCodeAt(i)
  12219. hi = c >> 8
  12220. lo = c % 256
  12221. byteArray.push(lo)
  12222. byteArray.push(hi)
  12223. }
  12224. return byteArray
  12225. }
  12226. function base64ToBytes (str) {
  12227. return base64.toByteArray(base64clean(str))
  12228. }
  12229. function blitBuffer (src, dst, offset, length) {
  12230. for (var i = 0; i < length; ++i) {
  12231. if ((i + offset >= dst.length) || (i >= src.length)) break
  12232. dst[i + offset] = src[i]
  12233. }
  12234. return i
  12235. }
  12236. function isnan (val) {
  12237. return val !== val // eslint-disable-line no-self-compare
  12238. }
  12239. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3)))
  12240. /***/ }),
  12241. /* 36 */
  12242. /*!*****************************************!*\
  12243. !*** ./node_modules/base64-js/index.js ***!
  12244. \*****************************************/
  12245. /*! no static exports found */
  12246. /***/ (function(module, exports, __webpack_require__) {
  12247. "use strict";
  12248. exports.byteLength = byteLength
  12249. exports.toByteArray = toByteArray
  12250. exports.fromByteArray = fromByteArray
  12251. var lookup = []
  12252. var revLookup = []
  12253. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  12254. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  12255. for (var i = 0, len = code.length; i < len; ++i) {
  12256. lookup[i] = code[i]
  12257. revLookup[code.charCodeAt(i)] = i
  12258. }
  12259. // Support decoding URL-safe base64 strings, as Node.js does.
  12260. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  12261. revLookup['-'.charCodeAt(0)] = 62
  12262. revLookup['_'.charCodeAt(0)] = 63
  12263. function getLens (b64) {
  12264. var len = b64.length
  12265. if (len % 4 > 0) {
  12266. throw new Error('Invalid string. Length must be a multiple of 4')
  12267. }
  12268. // Trim off extra bytes after placeholder bytes are found
  12269. // See: https://github.com/beatgammit/base64-js/issues/42
  12270. var validLen = b64.indexOf('=')
  12271. if (validLen === -1) validLen = len
  12272. var placeHoldersLen = validLen === len
  12273. ? 0
  12274. : 4 - (validLen % 4)
  12275. return [validLen, placeHoldersLen]
  12276. }
  12277. // base64 is 4/3 + up to two characters of the original data
  12278. function byteLength (b64) {
  12279. var lens = getLens(b64)
  12280. var validLen = lens[0]
  12281. var placeHoldersLen = lens[1]
  12282. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  12283. }
  12284. function _byteLength (b64, validLen, placeHoldersLen) {
  12285. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  12286. }
  12287. function toByteArray (b64) {
  12288. var tmp
  12289. var lens = getLens(b64)
  12290. var validLen = lens[0]
  12291. var placeHoldersLen = lens[1]
  12292. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  12293. var curByte = 0
  12294. // if there are placeholders, only get up to the last complete 4 chars
  12295. var len = placeHoldersLen > 0
  12296. ? validLen - 4
  12297. : validLen
  12298. var i
  12299. for (i = 0; i < len; i += 4) {
  12300. tmp =
  12301. (revLookup[b64.charCodeAt(i)] << 18) |
  12302. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  12303. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  12304. revLookup[b64.charCodeAt(i + 3)]
  12305. arr[curByte++] = (tmp >> 16) & 0xFF
  12306. arr[curByte++] = (tmp >> 8) & 0xFF
  12307. arr[curByte++] = tmp & 0xFF
  12308. }
  12309. if (placeHoldersLen === 2) {
  12310. tmp =
  12311. (revLookup[b64.charCodeAt(i)] << 2) |
  12312. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  12313. arr[curByte++] = tmp & 0xFF
  12314. }
  12315. if (placeHoldersLen === 1) {
  12316. tmp =
  12317. (revLookup[b64.charCodeAt(i)] << 10) |
  12318. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  12319. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  12320. arr[curByte++] = (tmp >> 8) & 0xFF
  12321. arr[curByte++] = tmp & 0xFF
  12322. }
  12323. return arr
  12324. }
  12325. function tripletToBase64 (num) {
  12326. return lookup[num >> 18 & 0x3F] +
  12327. lookup[num >> 12 & 0x3F] +
  12328. lookup[num >> 6 & 0x3F] +
  12329. lookup[num & 0x3F]
  12330. }
  12331. function encodeChunk (uint8, start, end) {
  12332. var tmp
  12333. var output = []
  12334. for (var i = start; i < end; i += 3) {
  12335. tmp =
  12336. ((uint8[i] << 16) & 0xFF0000) +
  12337. ((uint8[i + 1] << 8) & 0xFF00) +
  12338. (uint8[i + 2] & 0xFF)
  12339. output.push(tripletToBase64(tmp))
  12340. }
  12341. return output.join('')
  12342. }
  12343. function fromByteArray (uint8) {
  12344. var tmp
  12345. var len = uint8.length
  12346. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  12347. var parts = []
  12348. var maxChunkLength = 16383 // must be multiple of 3
  12349. // go through the array every three bytes, we'll deal with trailing stuff later
  12350. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  12351. parts.push(encodeChunk(
  12352. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  12353. ))
  12354. }
  12355. // pad the end with zeros, but make sure to not forget the extra bytes
  12356. if (extraBytes === 1) {
  12357. tmp = uint8[len - 1]
  12358. parts.push(
  12359. lookup[tmp >> 2] +
  12360. lookup[(tmp << 4) & 0x3F] +
  12361. '=='
  12362. )
  12363. } else if (extraBytes === 2) {
  12364. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  12365. parts.push(
  12366. lookup[tmp >> 10] +
  12367. lookup[(tmp >> 4) & 0x3F] +
  12368. lookup[(tmp << 2) & 0x3F] +
  12369. '='
  12370. )
  12371. }
  12372. return parts.join('')
  12373. }
  12374. /***/ }),
  12375. /* 37 */
  12376. /*!***************************************!*\
  12377. !*** ./node_modules/ieee754/index.js ***!
  12378. \***************************************/
  12379. /*! no static exports found */
  12380. /***/ (function(module, exports) {
  12381. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  12382. var e, m
  12383. var eLen = (nBytes * 8) - mLen - 1
  12384. var eMax = (1 << eLen) - 1
  12385. var eBias = eMax >> 1
  12386. var nBits = -7
  12387. var i = isLE ? (nBytes - 1) : 0
  12388. var d = isLE ? -1 : 1
  12389. var s = buffer[offset + i]
  12390. i += d
  12391. e = s & ((1 << (-nBits)) - 1)
  12392. s >>= (-nBits)
  12393. nBits += eLen
  12394. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  12395. m = e & ((1 << (-nBits)) - 1)
  12396. e >>= (-nBits)
  12397. nBits += mLen
  12398. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  12399. if (e === 0) {
  12400. e = 1 - eBias
  12401. } else if (e === eMax) {
  12402. return m ? NaN : ((s ? -1 : 1) * Infinity)
  12403. } else {
  12404. m = m + Math.pow(2, mLen)
  12405. e = e - eBias
  12406. }
  12407. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  12408. }
  12409. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  12410. var e, m, c
  12411. var eLen = (nBytes * 8) - mLen - 1
  12412. var eMax = (1 << eLen) - 1
  12413. var eBias = eMax >> 1
  12414. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  12415. var i = isLE ? 0 : (nBytes - 1)
  12416. var d = isLE ? 1 : -1
  12417. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  12418. value = Math.abs(value)
  12419. if (isNaN(value) || value === Infinity) {
  12420. m = isNaN(value) ? 1 : 0
  12421. e = eMax
  12422. } else {
  12423. e = Math.floor(Math.log(value) / Math.LN2)
  12424. if (value * (c = Math.pow(2, -e)) < 1) {
  12425. e--
  12426. c *= 2
  12427. }
  12428. if (e + eBias >= 1) {
  12429. value += rt / c
  12430. } else {
  12431. value += rt * Math.pow(2, 1 - eBias)
  12432. }
  12433. if (value * c >= 2) {
  12434. e++
  12435. c /= 2
  12436. }
  12437. if (e + eBias >= eMax) {
  12438. m = 0
  12439. e = eMax
  12440. } else if (e + eBias >= 1) {
  12441. m = ((value * c) - 1) * Math.pow(2, mLen)
  12442. e = e + eBias
  12443. } else {
  12444. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  12445. e = 0
  12446. }
  12447. }
  12448. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  12449. e = (e << mLen) | m
  12450. eLen += mLen
  12451. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  12452. buffer[offset + i - d] |= s * 128
  12453. }
  12454. /***/ }),
  12455. /* 38 */
  12456. /*!***************************************!*\
  12457. !*** ./node_modules/isarray/index.js ***!
  12458. \***************************************/
  12459. /*! no static exports found */
  12460. /***/ (function(module, exports) {
  12461. var toString = {}.toString;
  12462. module.exports = Array.isArray || function (arr) {
  12463. return toString.call(arr) == '[object Array]';
  12464. };
  12465. /***/ }),
  12466. /* 39 */
  12467. /*!*********************************************!*\
  12468. !*** ./node_modules/create-hash/browser.js ***!
  12469. \*********************************************/
  12470. /*! no static exports found */
  12471. /***/ (function(module, exports, __webpack_require__) {
  12472. "use strict";
  12473. var inherits = __webpack_require__(/*! inherits */ 40)
  12474. var MD5 = __webpack_require__(/*! md5.js */ 41)
  12475. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 59)
  12476. var sha = __webpack_require__(/*! sha.js */ 60)
  12477. var Base = __webpack_require__(/*! cipher-base */ 68)
  12478. function Hash (hash) {
  12479. Base.call(this, 'digest')
  12480. this._hash = hash
  12481. }
  12482. inherits(Hash, Base)
  12483. Hash.prototype._update = function (data) {
  12484. this._hash.update(data)
  12485. }
  12486. Hash.prototype._final = function () {
  12487. return this._hash.digest()
  12488. }
  12489. module.exports = function createHash (alg) {
  12490. alg = alg.toLowerCase()
  12491. if (alg === 'md5') return new MD5()
  12492. if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()
  12493. return new Hash(sha(alg))
  12494. }
  12495. /***/ }),
  12496. /* 40 */
  12497. /*!***************************************************!*\
  12498. !*** ./node_modules/inherits/inherits_browser.js ***!
  12499. \***************************************************/
  12500. /*! no static exports found */
  12501. /***/ (function(module, exports) {
  12502. if (typeof Object.create === 'function') {
  12503. // implementation from standard node.js 'util' module
  12504. module.exports = function inherits(ctor, superCtor) {
  12505. if (superCtor) {
  12506. ctor.super_ = superCtor
  12507. ctor.prototype = Object.create(superCtor.prototype, {
  12508. constructor: {
  12509. value: ctor,
  12510. enumerable: false,
  12511. writable: true,
  12512. configurable: true
  12513. }
  12514. })
  12515. }
  12516. };
  12517. } else {
  12518. // old school shim for old browsers
  12519. module.exports = function inherits(ctor, superCtor) {
  12520. if (superCtor) {
  12521. ctor.super_ = superCtor
  12522. var TempCtor = function () {}
  12523. TempCtor.prototype = superCtor.prototype
  12524. ctor.prototype = new TempCtor()
  12525. ctor.prototype.constructor = ctor
  12526. }
  12527. }
  12528. }
  12529. /***/ }),
  12530. /* 41 */
  12531. /*!**************************************!*\
  12532. !*** ./node_modules/md5.js/index.js ***!
  12533. \**************************************/
  12534. /*! no static exports found */
  12535. /***/ (function(module, exports, __webpack_require__) {
  12536. "use strict";
  12537. var inherits = __webpack_require__(/*! inherits */ 40)
  12538. var HashBase = __webpack_require__(/*! hash-base */ 42)
  12539. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  12540. var ARRAY16 = new Array(16)
  12541. function MD5 () {
  12542. HashBase.call(this, 64)
  12543. // state
  12544. this._a = 0x67452301
  12545. this._b = 0xefcdab89
  12546. this._c = 0x98badcfe
  12547. this._d = 0x10325476
  12548. }
  12549. inherits(MD5, HashBase)
  12550. MD5.prototype._update = function () {
  12551. var M = ARRAY16
  12552. for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)
  12553. var a = this._a
  12554. var b = this._b
  12555. var c = this._c
  12556. var d = this._d
  12557. a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)
  12558. d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)
  12559. c = fnF(c, d, a, b, M[2], 0x242070db, 17)
  12560. b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)
  12561. a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)
  12562. d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)
  12563. c = fnF(c, d, a, b, M[6], 0xa8304613, 17)
  12564. b = fnF(b, c, d, a, M[7], 0xfd469501, 22)
  12565. a = fnF(a, b, c, d, M[8], 0x698098d8, 7)
  12566. d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)
  12567. c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)
  12568. b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)
  12569. a = fnF(a, b, c, d, M[12], 0x6b901122, 7)
  12570. d = fnF(d, a, b, c, M[13], 0xfd987193, 12)
  12571. c = fnF(c, d, a, b, M[14], 0xa679438e, 17)
  12572. b = fnF(b, c, d, a, M[15], 0x49b40821, 22)
  12573. a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)
  12574. d = fnG(d, a, b, c, M[6], 0xc040b340, 9)
  12575. c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)
  12576. b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)
  12577. a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)
  12578. d = fnG(d, a, b, c, M[10], 0x02441453, 9)
  12579. c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)
  12580. b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)
  12581. a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)
  12582. d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)
  12583. c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)
  12584. b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)
  12585. a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)
  12586. d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)
  12587. c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)
  12588. b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)
  12589. a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)
  12590. d = fnH(d, a, b, c, M[8], 0x8771f681, 11)
  12591. c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)
  12592. b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)
  12593. a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)
  12594. d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)
  12595. c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)
  12596. b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)
  12597. a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)
  12598. d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)
  12599. c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)
  12600. b = fnH(b, c, d, a, M[6], 0x04881d05, 23)
  12601. a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)
  12602. d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)
  12603. c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)
  12604. b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)
  12605. a = fnI(a, b, c, d, M[0], 0xf4292244, 6)
  12606. d = fnI(d, a, b, c, M[7], 0x432aff97, 10)
  12607. c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)
  12608. b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)
  12609. a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)
  12610. d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)
  12611. c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)
  12612. b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)
  12613. a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)
  12614. d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)
  12615. c = fnI(c, d, a, b, M[6], 0xa3014314, 15)
  12616. b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)
  12617. a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)
  12618. d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)
  12619. c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)
  12620. b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)
  12621. this._a = (this._a + a) | 0
  12622. this._b = (this._b + b) | 0
  12623. this._c = (this._c + c) | 0
  12624. this._d = (this._d + d) | 0
  12625. }
  12626. MD5.prototype._digest = function () {
  12627. // create padding and handle blocks
  12628. this._block[this._blockOffset++] = 0x80
  12629. if (this._blockOffset > 56) {
  12630. this._block.fill(0, this._blockOffset, 64)
  12631. this._update()
  12632. this._blockOffset = 0
  12633. }
  12634. this._block.fill(0, this._blockOffset, 56)
  12635. this._block.writeUInt32LE(this._length[0], 56)
  12636. this._block.writeUInt32LE(this._length[1], 60)
  12637. this._update()
  12638. // produce result
  12639. var buffer = Buffer.allocUnsafe(16)
  12640. buffer.writeInt32LE(this._a, 0)
  12641. buffer.writeInt32LE(this._b, 4)
  12642. buffer.writeInt32LE(this._c, 8)
  12643. buffer.writeInt32LE(this._d, 12)
  12644. return buffer
  12645. }
  12646. function rotl (x, n) {
  12647. return (x << n) | (x >>> (32 - n))
  12648. }
  12649. function fnF (a, b, c, d, m, k, s) {
  12650. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0
  12651. }
  12652. function fnG (a, b, c, d, m, k, s) {
  12653. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0
  12654. }
  12655. function fnH (a, b, c, d, m, k, s) {
  12656. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0
  12657. }
  12658. function fnI (a, b, c, d, m, k, s) {
  12659. return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0
  12660. }
  12661. module.exports = MD5
  12662. /***/ }),
  12663. /* 42 */
  12664. /*!*****************************************!*\
  12665. !*** ./node_modules/hash-base/index.js ***!
  12666. \*****************************************/
  12667. /*! no static exports found */
  12668. /***/ (function(module, exports, __webpack_require__) {
  12669. "use strict";
  12670. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  12671. var Transform = __webpack_require__(/*! readable-stream */ 43).Transform
  12672. var inherits = __webpack_require__(/*! inherits */ 40)
  12673. function throwIfNotStringOrBuffer (val, prefix) {
  12674. if (!Buffer.isBuffer(val) && typeof val !== 'string') {
  12675. throw new TypeError(prefix + ' must be a string or a buffer')
  12676. }
  12677. }
  12678. function HashBase (blockSize) {
  12679. Transform.call(this)
  12680. this._block = Buffer.allocUnsafe(blockSize)
  12681. this._blockSize = blockSize
  12682. this._blockOffset = 0
  12683. this._length = [0, 0, 0, 0]
  12684. this._finalized = false
  12685. }
  12686. inherits(HashBase, Transform)
  12687. HashBase.prototype._transform = function (chunk, encoding, callback) {
  12688. var error = null
  12689. try {
  12690. this.update(chunk, encoding)
  12691. } catch (err) {
  12692. error = err
  12693. }
  12694. callback(error)
  12695. }
  12696. HashBase.prototype._flush = function (callback) {
  12697. var error = null
  12698. try {
  12699. this.push(this.digest())
  12700. } catch (err) {
  12701. error = err
  12702. }
  12703. callback(error)
  12704. }
  12705. HashBase.prototype.update = function (data, encoding) {
  12706. throwIfNotStringOrBuffer(data, 'Data')
  12707. if (this._finalized) throw new Error('Digest already called')
  12708. if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)
  12709. // consume data
  12710. var block = this._block
  12711. var offset = 0
  12712. while (this._blockOffset + data.length - offset >= this._blockSize) {
  12713. for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]
  12714. this._update()
  12715. this._blockOffset = 0
  12716. }
  12717. while (offset < data.length) block[this._blockOffset++] = data[offset++]
  12718. // update length
  12719. for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
  12720. this._length[j] += carry
  12721. carry = (this._length[j] / 0x0100000000) | 0
  12722. if (carry > 0) this._length[j] -= 0x0100000000 * carry
  12723. }
  12724. return this
  12725. }
  12726. HashBase.prototype._update = function () {
  12727. throw new Error('_update is not implemented')
  12728. }
  12729. HashBase.prototype.digest = function (encoding) {
  12730. if (this._finalized) throw new Error('Digest already called')
  12731. this._finalized = true
  12732. var digest = this._digest()
  12733. if (encoding !== undefined) digest = digest.toString(encoding)
  12734. // reset state
  12735. this._block.fill(0)
  12736. this._blockOffset = 0
  12737. for (var i = 0; i < 4; ++i) this._length[i] = 0
  12738. return digest
  12739. }
  12740. HashBase.prototype._digest = function () {
  12741. throw new Error('_digest is not implemented')
  12742. }
  12743. module.exports = HashBase
  12744. /***/ }),
  12745. /* 43 */
  12746. /*!**********************************************************!*\
  12747. !*** ./node_modules/readable-stream/readable-browser.js ***!
  12748. \**********************************************************/
  12749. /*! no static exports found */
  12750. /***/ (function(module, exports, __webpack_require__) {
  12751. exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ 44);
  12752. exports.Stream = exports;
  12753. exports.Readable = exports;
  12754. exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ 54);
  12755. exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ 53);
  12756. exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ 57);
  12757. exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ 58);
  12758. /***/ }),
  12759. /* 44 */
  12760. /*!**************************************************************!*\
  12761. !*** ./node_modules/readable-stream/lib/_stream_readable.js ***!
  12762. \**************************************************************/
  12763. /*! no static exports found */
  12764. /***/ (function(module, exports, __webpack_require__) {
  12765. "use strict";
  12766. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  12767. //
  12768. // Permission is hereby granted, free of charge, to any person obtaining a
  12769. // copy of this software and associated documentation files (the
  12770. // "Software"), to deal in the Software without restriction, including
  12771. // without limitation the rights to use, copy, modify, merge, publish,
  12772. // distribute, sublicense, and/or sell copies of the Software, and to permit
  12773. // persons to whom the Software is furnished to do so, subject to the
  12774. // following conditions:
  12775. //
  12776. // The above copyright notice and this permission notice shall be included
  12777. // in all copies or substantial portions of the Software.
  12778. //
  12779. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12780. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12781. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12782. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12783. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12784. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12785. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  12786. /*<replacement>*/
  12787. var pna = __webpack_require__(/*! process-nextick-args */ 45);
  12788. /*</replacement>*/
  12789. module.exports = Readable;
  12790. /*<replacement>*/
  12791. var isArray = __webpack_require__(/*! isarray */ 38);
  12792. /*</replacement>*/
  12793. /*<replacement>*/
  12794. var Duplex;
  12795. /*</replacement>*/
  12796. Readable.ReadableState = ReadableState;
  12797. /*<replacement>*/
  12798. var EE = __webpack_require__(/*! events */ 46).EventEmitter;
  12799. var EElistenerCount = function (emitter, type) {
  12800. return emitter.listeners(type).length;
  12801. };
  12802. /*</replacement>*/
  12803. /*<replacement>*/
  12804. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 47);
  12805. /*</replacement>*/
  12806. /*<replacement>*/
  12807. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer;
  12808. var OurUint8Array = global.Uint8Array || function () {};
  12809. function _uint8ArrayToBuffer(chunk) {
  12810. return Buffer.from(chunk);
  12811. }
  12812. function _isUint8Array(obj) {
  12813. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  12814. }
  12815. /*</replacement>*/
  12816. /*<replacement>*/
  12817. var util = Object.create(__webpack_require__(/*! core-util-is */ 48));
  12818. util.inherits = __webpack_require__(/*! inherits */ 40);
  12819. /*</replacement>*/
  12820. /*<replacement>*/
  12821. var debugUtil = __webpack_require__(/*! util */ 49);
  12822. var debug = void 0;
  12823. if (debugUtil && debugUtil.debuglog) {
  12824. debug = debugUtil.debuglog('stream');
  12825. } else {
  12826. debug = function () {};
  12827. }
  12828. /*</replacement>*/
  12829. var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ 50);
  12830. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 52);
  12831. var StringDecoder;
  12832. util.inherits(Readable, Stream);
  12833. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  12834. function prependListener(emitter, event, fn) {
  12835. // Sadly this is not cacheable as some libraries bundle their own
  12836. // event emitter implementation with them.
  12837. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
  12838. // This is a hack to make sure that our error handler is attached before any
  12839. // userland ones. NEVER DO THIS. This is here only because this code needs
  12840. // to continue to work with older versions of Node.js that do not include
  12841. // the prependListener() method. The goal is to eventually remove this hack.
  12842. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  12843. }
  12844. function ReadableState(options, stream) {
  12845. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 53);
  12846. options = options || {};
  12847. // Duplex streams are both readable and writable, but share
  12848. // the same options object.
  12849. // However, some cases require setting options to different
  12850. // values for the readable and the writable sides of the duplex stream.
  12851. // These options can be provided separately as readableXXX and writableXXX.
  12852. var isDuplex = stream instanceof Duplex;
  12853. // object stream flag. Used to make read(n) ignore n and to
  12854. // make all the buffer merging and length checks go away
  12855. this.objectMode = !!options.objectMode;
  12856. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  12857. // the point at which it stops calling _read() to fill the buffer
  12858. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  12859. var hwm = options.highWaterMark;
  12860. var readableHwm = options.readableHighWaterMark;
  12861. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  12862. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
  12863. // cast to ints.
  12864. this.highWaterMark = Math.floor(this.highWaterMark);
  12865. // A linked list is used to store data chunks instead of an array because the
  12866. // linked list can remove elements from the beginning faster than
  12867. // array.shift()
  12868. this.buffer = new BufferList();
  12869. this.length = 0;
  12870. this.pipes = null;
  12871. this.pipesCount = 0;
  12872. this.flowing = null;
  12873. this.ended = false;
  12874. this.endEmitted = false;
  12875. this.reading = false;
  12876. // a flag to be able to tell if the event 'readable'/'data' is emitted
  12877. // immediately, or on a later tick. We set this to true at first, because
  12878. // any actions that shouldn't happen until "later" should generally also
  12879. // not happen before the first read call.
  12880. this.sync = true;
  12881. // whenever we return null, then we set a flag to say
  12882. // that we're awaiting a 'readable' event emission.
  12883. this.needReadable = false;
  12884. this.emittedReadable = false;
  12885. this.readableListening = false;
  12886. this.resumeScheduled = false;
  12887. // has it been destroyed
  12888. this.destroyed = false;
  12889. // Crypto is kind of old and crusty. Historically, its default string
  12890. // encoding is 'binary' so we have to make this configurable.
  12891. // Everything else in the universe uses 'utf8', though.
  12892. this.defaultEncoding = options.defaultEncoding || 'utf8';
  12893. // the number of writers that are awaiting a drain event in .pipe()s
  12894. this.awaitDrain = 0;
  12895. // if true, a maybeReadMore has been scheduled
  12896. this.readingMore = false;
  12897. this.decoder = null;
  12898. this.encoding = null;
  12899. if (options.encoding) {
  12900. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 56).StringDecoder;
  12901. this.decoder = new StringDecoder(options.encoding);
  12902. this.encoding = options.encoding;
  12903. }
  12904. }
  12905. function Readable(options) {
  12906. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 53);
  12907. if (!(this instanceof Readable)) return new Readable(options);
  12908. this._readableState = new ReadableState(options, this);
  12909. // legacy
  12910. this.readable = true;
  12911. if (options) {
  12912. if (typeof options.read === 'function') this._read = options.read;
  12913. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  12914. }
  12915. Stream.call(this);
  12916. }
  12917. Object.defineProperty(Readable.prototype, 'destroyed', {
  12918. get: function () {
  12919. if (this._readableState === undefined) {
  12920. return false;
  12921. }
  12922. return this._readableState.destroyed;
  12923. },
  12924. set: function (value) {
  12925. // we ignore the value if the stream
  12926. // has not been initialized yet
  12927. if (!this._readableState) {
  12928. return;
  12929. }
  12930. // backward compatibility, the user is explicitly
  12931. // managing destroyed
  12932. this._readableState.destroyed = value;
  12933. }
  12934. });
  12935. Readable.prototype.destroy = destroyImpl.destroy;
  12936. Readable.prototype._undestroy = destroyImpl.undestroy;
  12937. Readable.prototype._destroy = function (err, cb) {
  12938. this.push(null);
  12939. cb(err);
  12940. };
  12941. // Manually shove something into the read() buffer.
  12942. // This returns true if the highWaterMark has not been hit yet,
  12943. // similar to how Writable.write() returns true if you should
  12944. // write() some more.
  12945. Readable.prototype.push = function (chunk, encoding) {
  12946. var state = this._readableState;
  12947. var skipChunkCheck;
  12948. if (!state.objectMode) {
  12949. if (typeof chunk === 'string') {
  12950. encoding = encoding || state.defaultEncoding;
  12951. if (encoding !== state.encoding) {
  12952. chunk = Buffer.from(chunk, encoding);
  12953. encoding = '';
  12954. }
  12955. skipChunkCheck = true;
  12956. }
  12957. } else {
  12958. skipChunkCheck = true;
  12959. }
  12960. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  12961. };
  12962. // Unshift should *always* be something directly out of read()
  12963. Readable.prototype.unshift = function (chunk) {
  12964. return readableAddChunk(this, chunk, null, true, false);
  12965. };
  12966. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  12967. var state = stream._readableState;
  12968. if (chunk === null) {
  12969. state.reading = false;
  12970. onEofChunk(stream, state);
  12971. } else {
  12972. var er;
  12973. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  12974. if (er) {
  12975. stream.emit('error', er);
  12976. } else if (state.objectMode || chunk && chunk.length > 0) {
  12977. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  12978. chunk = _uint8ArrayToBuffer(chunk);
  12979. }
  12980. if (addToFront) {
  12981. if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
  12982. } else if (state.ended) {
  12983. stream.emit('error', new Error('stream.push() after EOF'));
  12984. } else {
  12985. state.reading = false;
  12986. if (state.decoder && !encoding) {
  12987. chunk = state.decoder.write(chunk);
  12988. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  12989. } else {
  12990. addChunk(stream, state, chunk, false);
  12991. }
  12992. }
  12993. } else if (!addToFront) {
  12994. state.reading = false;
  12995. }
  12996. }
  12997. return needMoreData(state);
  12998. }
  12999. function addChunk(stream, state, chunk, addToFront) {
  13000. if (state.flowing && state.length === 0 && !state.sync) {
  13001. stream.emit('data', chunk);
  13002. stream.read(0);
  13003. } else {
  13004. // update the buffer info.
  13005. state.length += state.objectMode ? 1 : chunk.length;
  13006. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  13007. if (state.needReadable) emitReadable(stream);
  13008. }
  13009. maybeReadMore(stream, state);
  13010. }
  13011. function chunkInvalid(state, chunk) {
  13012. var er;
  13013. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  13014. er = new TypeError('Invalid non-string/buffer chunk');
  13015. }
  13016. return er;
  13017. }
  13018. // if it's past the high water mark, we can push in some more.
  13019. // Also, if we have no data yet, we can stand some
  13020. // more bytes. This is to work around cases where hwm=0,
  13021. // such as the repl. Also, if the push() triggered a
  13022. // readable event, and the user called read(largeNumber) such that
  13023. // needReadable was set, then we ought to push more, so that another
  13024. // 'readable' event will be triggered.
  13025. function needMoreData(state) {
  13026. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  13027. }
  13028. Readable.prototype.isPaused = function () {
  13029. return this._readableState.flowing === false;
  13030. };
  13031. // backwards compatibility.
  13032. Readable.prototype.setEncoding = function (enc) {
  13033. if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ 56).StringDecoder;
  13034. this._readableState.decoder = new StringDecoder(enc);
  13035. this._readableState.encoding = enc;
  13036. return this;
  13037. };
  13038. // Don't raise the hwm > 8MB
  13039. var MAX_HWM = 0x800000;
  13040. function computeNewHighWaterMark(n) {
  13041. if (n >= MAX_HWM) {
  13042. n = MAX_HWM;
  13043. } else {
  13044. // Get the next highest power of 2 to prevent increasing hwm excessively in
  13045. // tiny amounts
  13046. n--;
  13047. n |= n >>> 1;
  13048. n |= n >>> 2;
  13049. n |= n >>> 4;
  13050. n |= n >>> 8;
  13051. n |= n >>> 16;
  13052. n++;
  13053. }
  13054. return n;
  13055. }
  13056. // This function is designed to be inlinable, so please take care when making
  13057. // changes to the function body.
  13058. function howMuchToRead(n, state) {
  13059. if (n <= 0 || state.length === 0 && state.ended) return 0;
  13060. if (state.objectMode) return 1;
  13061. if (n !== n) {
  13062. // Only flow one buffer at a time
  13063. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  13064. }
  13065. // If we're asking for more than the current hwm, then raise the hwm.
  13066. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  13067. if (n <= state.length) return n;
  13068. // Don't have enough
  13069. if (!state.ended) {
  13070. state.needReadable = true;
  13071. return 0;
  13072. }
  13073. return state.length;
  13074. }
  13075. // you can override either this method, or the async _read(n) below.
  13076. Readable.prototype.read = function (n) {
  13077. debug('read', n);
  13078. n = parseInt(n, 10);
  13079. var state = this._readableState;
  13080. var nOrig = n;
  13081. if (n !== 0) state.emittedReadable = false;
  13082. // if we're doing read(0) to trigger a readable event, but we
  13083. // already have a bunch of data in the buffer, then just trigger
  13084. // the 'readable' event and move on.
  13085. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  13086. debug('read: emitReadable', state.length, state.ended);
  13087. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  13088. return null;
  13089. }
  13090. n = howMuchToRead(n, state);
  13091. // if we've ended, and we're now clear, then finish it up.
  13092. if (n === 0 && state.ended) {
  13093. if (state.length === 0) endReadable(this);
  13094. return null;
  13095. }
  13096. // All the actual chunk generation logic needs to be
  13097. // *below* the call to _read. The reason is that in certain
  13098. // synthetic stream cases, such as passthrough streams, _read
  13099. // may be a completely synchronous operation which may change
  13100. // the state of the read buffer, providing enough data when
  13101. // before there was *not* enough.
  13102. //
  13103. // So, the steps are:
  13104. // 1. Figure out what the state of things will be after we do
  13105. // a read from the buffer.
  13106. //
  13107. // 2. If that resulting state will trigger a _read, then call _read.
  13108. // Note that this may be asynchronous, or synchronous. Yes, it is
  13109. // deeply ugly to write APIs this way, but that still doesn't mean
  13110. // that the Readable class should behave improperly, as streams are
  13111. // designed to be sync/async agnostic.
  13112. // Take note if the _read call is sync or async (ie, if the read call
  13113. // has returned yet), so that we know whether or not it's safe to emit
  13114. // 'readable' etc.
  13115. //
  13116. // 3. Actually pull the requested chunks out of the buffer and return.
  13117. // if we need a readable event, then we need to do some reading.
  13118. var doRead = state.needReadable;
  13119. debug('need readable', doRead);
  13120. // if we currently have less than the highWaterMark, then also read some
  13121. if (state.length === 0 || state.length - n < state.highWaterMark) {
  13122. doRead = true;
  13123. debug('length less than watermark', doRead);
  13124. }
  13125. // however, if we've ended, then there's no point, and if we're already
  13126. // reading, then it's unnecessary.
  13127. if (state.ended || state.reading) {
  13128. doRead = false;
  13129. debug('reading or ended', doRead);
  13130. } else if (doRead) {
  13131. debug('do read');
  13132. state.reading = true;
  13133. state.sync = true;
  13134. // if the length is currently zero, then we *need* a readable event.
  13135. if (state.length === 0) state.needReadable = true;
  13136. // call internal read method
  13137. this._read(state.highWaterMark);
  13138. state.sync = false;
  13139. // If _read pushed data synchronously, then `reading` will be false,
  13140. // and we need to re-evaluate how much data we can return to the user.
  13141. if (!state.reading) n = howMuchToRead(nOrig, state);
  13142. }
  13143. var ret;
  13144. if (n > 0) ret = fromList(n, state);else ret = null;
  13145. if (ret === null) {
  13146. state.needReadable = true;
  13147. n = 0;
  13148. } else {
  13149. state.length -= n;
  13150. }
  13151. if (state.length === 0) {
  13152. // If we have nothing in the buffer, then we want to know
  13153. // as soon as we *do* get something into the buffer.
  13154. if (!state.ended) state.needReadable = true;
  13155. // If we tried to read() past the EOF, then emit end on the next tick.
  13156. if (nOrig !== n && state.ended) endReadable(this);
  13157. }
  13158. if (ret !== null) this.emit('data', ret);
  13159. return ret;
  13160. };
  13161. function onEofChunk(stream, state) {
  13162. if (state.ended) return;
  13163. if (state.decoder) {
  13164. var chunk = state.decoder.end();
  13165. if (chunk && chunk.length) {
  13166. state.buffer.push(chunk);
  13167. state.length += state.objectMode ? 1 : chunk.length;
  13168. }
  13169. }
  13170. state.ended = true;
  13171. // emit 'readable' now to make sure it gets picked up.
  13172. emitReadable(stream);
  13173. }
  13174. // Don't emit readable right away in sync mode, because this can trigger
  13175. // another read() call => stack overflow. This way, it might trigger
  13176. // a nextTick recursion warning, but that's not so bad.
  13177. function emitReadable(stream) {
  13178. var state = stream._readableState;
  13179. state.needReadable = false;
  13180. if (!state.emittedReadable) {
  13181. debug('emitReadable', state.flowing);
  13182. state.emittedReadable = true;
  13183. if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
  13184. }
  13185. }
  13186. function emitReadable_(stream) {
  13187. debug('emit readable');
  13188. stream.emit('readable');
  13189. flow(stream);
  13190. }
  13191. // at this point, the user has presumably seen the 'readable' event,
  13192. // and called read() to consume some data. that may have triggered
  13193. // in turn another _read(n) call, in which case reading = true if
  13194. // it's in progress.
  13195. // However, if we're not ended, or reading, and the length < hwm,
  13196. // then go ahead and try to read some more preemptively.
  13197. function maybeReadMore(stream, state) {
  13198. if (!state.readingMore) {
  13199. state.readingMore = true;
  13200. pna.nextTick(maybeReadMore_, stream, state);
  13201. }
  13202. }
  13203. function maybeReadMore_(stream, state) {
  13204. var len = state.length;
  13205. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  13206. debug('maybeReadMore read 0');
  13207. stream.read(0);
  13208. if (len === state.length)
  13209. // didn't get any data, stop spinning.
  13210. break;else len = state.length;
  13211. }
  13212. state.readingMore = false;
  13213. }
  13214. // abstract method. to be overridden in specific implementation classes.
  13215. // call cb(er, data) where data is <= n in length.
  13216. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  13217. // arbitrary, and perhaps not very meaningful.
  13218. Readable.prototype._read = function (n) {
  13219. this.emit('error', new Error('_read() is not implemented'));
  13220. };
  13221. Readable.prototype.pipe = function (dest, pipeOpts) {
  13222. var src = this;
  13223. var state = this._readableState;
  13224. switch (state.pipesCount) {
  13225. case 0:
  13226. state.pipes = dest;
  13227. break;
  13228. case 1:
  13229. state.pipes = [state.pipes, dest];
  13230. break;
  13231. default:
  13232. state.pipes.push(dest);
  13233. break;
  13234. }
  13235. state.pipesCount += 1;
  13236. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  13237. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  13238. var endFn = doEnd ? onend : unpipe;
  13239. if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
  13240. dest.on('unpipe', onunpipe);
  13241. function onunpipe(readable, unpipeInfo) {
  13242. debug('onunpipe');
  13243. if (readable === src) {
  13244. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  13245. unpipeInfo.hasUnpiped = true;
  13246. cleanup();
  13247. }
  13248. }
  13249. }
  13250. function onend() {
  13251. debug('onend');
  13252. dest.end();
  13253. }
  13254. // when the dest drains, it reduces the awaitDrain counter
  13255. // on the source. This would be more elegant with a .once()
  13256. // handler in flow(), but adding and removing repeatedly is
  13257. // too slow.
  13258. var ondrain = pipeOnDrain(src);
  13259. dest.on('drain', ondrain);
  13260. var cleanedUp = false;
  13261. function cleanup() {
  13262. debug('cleanup');
  13263. // cleanup event handlers once the pipe is broken
  13264. dest.removeListener('close', onclose);
  13265. dest.removeListener('finish', onfinish);
  13266. dest.removeListener('drain', ondrain);
  13267. dest.removeListener('error', onerror);
  13268. dest.removeListener('unpipe', onunpipe);
  13269. src.removeListener('end', onend);
  13270. src.removeListener('end', unpipe);
  13271. src.removeListener('data', ondata);
  13272. cleanedUp = true;
  13273. // if the reader is waiting for a drain event from this
  13274. // specific writer, then it would cause it to never start
  13275. // flowing again.
  13276. // So, if this is awaiting a drain, then we just call it now.
  13277. // If we don't know, then assume that we are waiting for one.
  13278. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  13279. }
  13280. // If the user pushes more data while we're writing to dest then we'll end up
  13281. // in ondata again. However, we only want to increase awaitDrain once because
  13282. // dest will only emit one 'drain' event for the multiple writes.
  13283. // => Introduce a guard on increasing awaitDrain.
  13284. var increasedAwaitDrain = false;
  13285. src.on('data', ondata);
  13286. function ondata(chunk) {
  13287. debug('ondata');
  13288. increasedAwaitDrain = false;
  13289. var ret = dest.write(chunk);
  13290. if (false === ret && !increasedAwaitDrain) {
  13291. // If the user unpiped during `dest.write()`, it is possible
  13292. // to get stuck in a permanently paused state if that write
  13293. // also returned false.
  13294. // => Check whether `dest` is still a piping destination.
  13295. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  13296. debug('false write response, pause', src._readableState.awaitDrain);
  13297. src._readableState.awaitDrain++;
  13298. increasedAwaitDrain = true;
  13299. }
  13300. src.pause();
  13301. }
  13302. }
  13303. // if the dest has an error, then stop piping into it.
  13304. // however, don't suppress the throwing behavior for this.
  13305. function onerror(er) {
  13306. debug('onerror', er);
  13307. unpipe();
  13308. dest.removeListener('error', onerror);
  13309. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  13310. }
  13311. // Make sure our error handler is attached before userland ones.
  13312. prependListener(dest, 'error', onerror);
  13313. // Both close and finish should trigger unpipe, but only once.
  13314. function onclose() {
  13315. dest.removeListener('finish', onfinish);
  13316. unpipe();
  13317. }
  13318. dest.once('close', onclose);
  13319. function onfinish() {
  13320. debug('onfinish');
  13321. dest.removeListener('close', onclose);
  13322. unpipe();
  13323. }
  13324. dest.once('finish', onfinish);
  13325. function unpipe() {
  13326. debug('unpipe');
  13327. src.unpipe(dest);
  13328. }
  13329. // tell the dest that it's being piped to
  13330. dest.emit('pipe', src);
  13331. // start the flow if it hasn't been started already.
  13332. if (!state.flowing) {
  13333. debug('pipe resume');
  13334. src.resume();
  13335. }
  13336. return dest;
  13337. };
  13338. function pipeOnDrain(src) {
  13339. return function () {
  13340. var state = src._readableState;
  13341. debug('pipeOnDrain', state.awaitDrain);
  13342. if (state.awaitDrain) state.awaitDrain--;
  13343. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  13344. state.flowing = true;
  13345. flow(src);
  13346. }
  13347. };
  13348. }
  13349. Readable.prototype.unpipe = function (dest) {
  13350. var state = this._readableState;
  13351. var unpipeInfo = { hasUnpiped: false };
  13352. // if we're not piping anywhere, then do nothing.
  13353. if (state.pipesCount === 0) return this;
  13354. // just one destination. most common case.
  13355. if (state.pipesCount === 1) {
  13356. // passed in one, but it's not the right one.
  13357. if (dest && dest !== state.pipes) return this;
  13358. if (!dest) dest = state.pipes;
  13359. // got a match.
  13360. state.pipes = null;
  13361. state.pipesCount = 0;
  13362. state.flowing = false;
  13363. if (dest) dest.emit('unpipe', this, unpipeInfo);
  13364. return this;
  13365. }
  13366. // slow case. multiple pipe destinations.
  13367. if (!dest) {
  13368. // remove all.
  13369. var dests = state.pipes;
  13370. var len = state.pipesCount;
  13371. state.pipes = null;
  13372. state.pipesCount = 0;
  13373. state.flowing = false;
  13374. for (var i = 0; i < len; i++) {
  13375. dests[i].emit('unpipe', this, unpipeInfo);
  13376. }return this;
  13377. }
  13378. // try to find the right one.
  13379. var index = indexOf(state.pipes, dest);
  13380. if (index === -1) return this;
  13381. state.pipes.splice(index, 1);
  13382. state.pipesCount -= 1;
  13383. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  13384. dest.emit('unpipe', this, unpipeInfo);
  13385. return this;
  13386. };
  13387. // set up data events if they are asked for
  13388. // Ensure readable listeners eventually get something
  13389. Readable.prototype.on = function (ev, fn) {
  13390. var res = Stream.prototype.on.call(this, ev, fn);
  13391. if (ev === 'data') {
  13392. // Start flowing on next tick if stream isn't explicitly paused
  13393. if (this._readableState.flowing !== false) this.resume();
  13394. } else if (ev === 'readable') {
  13395. var state = this._readableState;
  13396. if (!state.endEmitted && !state.readableListening) {
  13397. state.readableListening = state.needReadable = true;
  13398. state.emittedReadable = false;
  13399. if (!state.reading) {
  13400. pna.nextTick(nReadingNextTick, this);
  13401. } else if (state.length) {
  13402. emitReadable(this);
  13403. }
  13404. }
  13405. }
  13406. return res;
  13407. };
  13408. Readable.prototype.addListener = Readable.prototype.on;
  13409. function nReadingNextTick(self) {
  13410. debug('readable nexttick read 0');
  13411. self.read(0);
  13412. }
  13413. // pause() and resume() are remnants of the legacy readable stream API
  13414. // If the user uses them, then switch into old mode.
  13415. Readable.prototype.resume = function () {
  13416. var state = this._readableState;
  13417. if (!state.flowing) {
  13418. debug('resume');
  13419. state.flowing = true;
  13420. resume(this, state);
  13421. }
  13422. return this;
  13423. };
  13424. function resume(stream, state) {
  13425. if (!state.resumeScheduled) {
  13426. state.resumeScheduled = true;
  13427. pna.nextTick(resume_, stream, state);
  13428. }
  13429. }
  13430. function resume_(stream, state) {
  13431. if (!state.reading) {
  13432. debug('resume read 0');
  13433. stream.read(0);
  13434. }
  13435. state.resumeScheduled = false;
  13436. state.awaitDrain = 0;
  13437. stream.emit('resume');
  13438. flow(stream);
  13439. if (state.flowing && !state.reading) stream.read(0);
  13440. }
  13441. Readable.prototype.pause = function () {
  13442. debug('call pause flowing=%j', this._readableState.flowing);
  13443. if (false !== this._readableState.flowing) {
  13444. debug('pause');
  13445. this._readableState.flowing = false;
  13446. this.emit('pause');
  13447. }
  13448. return this;
  13449. };
  13450. function flow(stream) {
  13451. var state = stream._readableState;
  13452. debug('flow', state.flowing);
  13453. while (state.flowing && stream.read() !== null) {}
  13454. }
  13455. // wrap an old-style stream as the async data source.
  13456. // This is *not* part of the readable stream interface.
  13457. // It is an ugly unfortunate mess of history.
  13458. Readable.prototype.wrap = function (stream) {
  13459. var _this = this;
  13460. var state = this._readableState;
  13461. var paused = false;
  13462. stream.on('end', function () {
  13463. debug('wrapped end');
  13464. if (state.decoder && !state.ended) {
  13465. var chunk = state.decoder.end();
  13466. if (chunk && chunk.length) _this.push(chunk);
  13467. }
  13468. _this.push(null);
  13469. });
  13470. stream.on('data', function (chunk) {
  13471. debug('wrapped data');
  13472. if (state.decoder) chunk = state.decoder.write(chunk);
  13473. // don't skip over falsy values in objectMode
  13474. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  13475. var ret = _this.push(chunk);
  13476. if (!ret) {
  13477. paused = true;
  13478. stream.pause();
  13479. }
  13480. });
  13481. // proxy all the other methods.
  13482. // important when wrapping filters and duplexes.
  13483. for (var i in stream) {
  13484. if (this[i] === undefined && typeof stream[i] === 'function') {
  13485. this[i] = function (method) {
  13486. return function () {
  13487. return stream[method].apply(stream, arguments);
  13488. };
  13489. }(i);
  13490. }
  13491. }
  13492. // proxy certain important events.
  13493. for (var n = 0; n < kProxyEvents.length; n++) {
  13494. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  13495. }
  13496. // when we try to consume some more bytes, simply unpause the
  13497. // underlying stream.
  13498. this._read = function (n) {
  13499. debug('wrapped _read', n);
  13500. if (paused) {
  13501. paused = false;
  13502. stream.resume();
  13503. }
  13504. };
  13505. return this;
  13506. };
  13507. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  13508. // making it explicit this property is not enumerable
  13509. // because otherwise some prototype manipulation in
  13510. // userland will fail
  13511. enumerable: false,
  13512. get: function () {
  13513. return this._readableState.highWaterMark;
  13514. }
  13515. });
  13516. // exposed for testing purposes only.
  13517. Readable._fromList = fromList;
  13518. // Pluck off n bytes from an array of buffers.
  13519. // Length is the combined lengths of all the buffers in the list.
  13520. // This function is designed to be inlinable, so please take care when making
  13521. // changes to the function body.
  13522. function fromList(n, state) {
  13523. // nothing buffered
  13524. if (state.length === 0) return null;
  13525. var ret;
  13526. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  13527. // read it all, truncate the list
  13528. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
  13529. state.buffer.clear();
  13530. } else {
  13531. // read part of list
  13532. ret = fromListPartial(n, state.buffer, state.decoder);
  13533. }
  13534. return ret;
  13535. }
  13536. // Extracts only enough buffered data to satisfy the amount requested.
  13537. // This function is designed to be inlinable, so please take care when making
  13538. // changes to the function body.
  13539. function fromListPartial(n, list, hasStrings) {
  13540. var ret;
  13541. if (n < list.head.data.length) {
  13542. // slice is the same for buffers and strings
  13543. ret = list.head.data.slice(0, n);
  13544. list.head.data = list.head.data.slice(n);
  13545. } else if (n === list.head.data.length) {
  13546. // first chunk is a perfect match
  13547. ret = list.shift();
  13548. } else {
  13549. // result spans more than one buffer
  13550. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  13551. }
  13552. return ret;
  13553. }
  13554. // Copies a specified amount of characters from the list of buffered data
  13555. // chunks.
  13556. // This function is designed to be inlinable, so please take care when making
  13557. // changes to the function body.
  13558. function copyFromBufferString(n, list) {
  13559. var p = list.head;
  13560. var c = 1;
  13561. var ret = p.data;
  13562. n -= ret.length;
  13563. while (p = p.next) {
  13564. var str = p.data;
  13565. var nb = n > str.length ? str.length : n;
  13566. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  13567. n -= nb;
  13568. if (n === 0) {
  13569. if (nb === str.length) {
  13570. ++c;
  13571. if (p.next) list.head = p.next;else list.head = list.tail = null;
  13572. } else {
  13573. list.head = p;
  13574. p.data = str.slice(nb);
  13575. }
  13576. break;
  13577. }
  13578. ++c;
  13579. }
  13580. list.length -= c;
  13581. return ret;
  13582. }
  13583. // Copies a specified amount of bytes from the list of buffered data chunks.
  13584. // This function is designed to be inlinable, so please take care when making
  13585. // changes to the function body.
  13586. function copyFromBuffer(n, list) {
  13587. var ret = Buffer.allocUnsafe(n);
  13588. var p = list.head;
  13589. var c = 1;
  13590. p.data.copy(ret);
  13591. n -= p.data.length;
  13592. while (p = p.next) {
  13593. var buf = p.data;
  13594. var nb = n > buf.length ? buf.length : n;
  13595. buf.copy(ret, ret.length - n, 0, nb);
  13596. n -= nb;
  13597. if (n === 0) {
  13598. if (nb === buf.length) {
  13599. ++c;
  13600. if (p.next) list.head = p.next;else list.head = list.tail = null;
  13601. } else {
  13602. list.head = p;
  13603. p.data = buf.slice(nb);
  13604. }
  13605. break;
  13606. }
  13607. ++c;
  13608. }
  13609. list.length -= c;
  13610. return ret;
  13611. }
  13612. function endReadable(stream) {
  13613. var state = stream._readableState;
  13614. // If we get here before consuming all the bytes, then that is a
  13615. // bug in node. Should never happen.
  13616. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  13617. if (!state.endEmitted) {
  13618. state.ended = true;
  13619. pna.nextTick(endReadableNT, state, stream);
  13620. }
  13621. }
  13622. function endReadableNT(state, stream) {
  13623. // Check that we didn't get one last unshift.
  13624. if (!state.endEmitted && state.length === 0) {
  13625. state.endEmitted = true;
  13626. stream.readable = false;
  13627. stream.emit('end');
  13628. }
  13629. }
  13630. function indexOf(xs, x) {
  13631. for (var i = 0, l = xs.length; i < l; i++) {
  13632. if (xs[i] === x) return i;
  13633. }
  13634. return -1;
  13635. }
  13636. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 32)))
  13637. /***/ }),
  13638. /* 45 */
  13639. /*!****************************************************!*\
  13640. !*** ./node_modules/process-nextick-args/index.js ***!
  13641. \****************************************************/
  13642. /*! no static exports found */
  13643. /***/ (function(module, exports, __webpack_require__) {
  13644. "use strict";
  13645. /* WEBPACK VAR INJECTION */(function(process) {
  13646. if (typeof process === 'undefined' ||
  13647. !process.version ||
  13648. process.version.indexOf('v0.') === 0 ||
  13649. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  13650. module.exports = { nextTick: nextTick };
  13651. } else {
  13652. module.exports = process
  13653. }
  13654. function nextTick(fn, arg1, arg2, arg3) {
  13655. if (typeof fn !== 'function') {
  13656. throw new TypeError('"callback" argument must be a function');
  13657. }
  13658. var len = arguments.length;
  13659. var args, i;
  13660. switch (len) {
  13661. case 0:
  13662. case 1:
  13663. return process.nextTick(fn);
  13664. case 2:
  13665. return process.nextTick(function afterTickOne() {
  13666. fn.call(null, arg1);
  13667. });
  13668. case 3:
  13669. return process.nextTick(function afterTickTwo() {
  13670. fn.call(null, arg1, arg2);
  13671. });
  13672. case 4:
  13673. return process.nextTick(function afterTickThree() {
  13674. fn.call(null, arg1, arg2, arg3);
  13675. });
  13676. default:
  13677. args = new Array(len - 1);
  13678. i = 0;
  13679. while (i < args.length) {
  13680. args[i++] = arguments[i];
  13681. }
  13682. return process.nextTick(function afterTick() {
  13683. fn.apply(null, args);
  13684. });
  13685. }
  13686. }
  13687. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 32)))
  13688. /***/ }),
  13689. /* 46 */
  13690. /*!***************************************!*\
  13691. !*** ./node_modules/events/events.js ***!
  13692. \***************************************/
  13693. /*! no static exports found */
  13694. /***/ (function(module, exports, __webpack_require__) {
  13695. "use strict";
  13696. // Copyright Joyent, Inc. and other Node contributors.
  13697. //
  13698. // Permission is hereby granted, free of charge, to any person obtaining a
  13699. // copy of this software and associated documentation files (the
  13700. // "Software"), to deal in the Software without restriction, including
  13701. // without limitation the rights to use, copy, modify, merge, publish,
  13702. // distribute, sublicense, and/or sell copies of the Software, and to permit
  13703. // persons to whom the Software is furnished to do so, subject to the
  13704. // following conditions:
  13705. //
  13706. // The above copyright notice and this permission notice shall be included
  13707. // in all copies or substantial portions of the Software.
  13708. //
  13709. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13710. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13711. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  13712. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13713. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  13714. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  13715. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  13716. var R = typeof Reflect === 'object' ? Reflect : null
  13717. var ReflectApply = R && typeof R.apply === 'function'
  13718. ? R.apply
  13719. : function ReflectApply(target, receiver, args) {
  13720. return Function.prototype.apply.call(target, receiver, args);
  13721. }
  13722. var ReflectOwnKeys
  13723. if (R && typeof R.ownKeys === 'function') {
  13724. ReflectOwnKeys = R.ownKeys
  13725. } else if (Object.getOwnPropertySymbols) {
  13726. ReflectOwnKeys = function ReflectOwnKeys(target) {
  13727. return Object.getOwnPropertyNames(target)
  13728. .concat(Object.getOwnPropertySymbols(target));
  13729. };
  13730. } else {
  13731. ReflectOwnKeys = function ReflectOwnKeys(target) {
  13732. return Object.getOwnPropertyNames(target);
  13733. };
  13734. }
  13735. function ProcessEmitWarning(warning) {
  13736. if (console && console.warn) console.warn(warning);
  13737. }
  13738. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  13739. return value !== value;
  13740. }
  13741. function EventEmitter() {
  13742. EventEmitter.init.call(this);
  13743. }
  13744. module.exports = EventEmitter;
  13745. // Backwards-compat with node 0.10.x
  13746. EventEmitter.EventEmitter = EventEmitter;
  13747. EventEmitter.prototype._events = undefined;
  13748. EventEmitter.prototype._eventsCount = 0;
  13749. EventEmitter.prototype._maxListeners = undefined;
  13750. // By default EventEmitters will print a warning if more than 10 listeners are
  13751. // added to it. This is a useful default which helps finding memory leaks.
  13752. var defaultMaxListeners = 10;
  13753. function checkListener(listener) {
  13754. if (typeof listener !== 'function') {
  13755. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  13756. }
  13757. }
  13758. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  13759. enumerable: true,
  13760. get: function() {
  13761. return defaultMaxListeners;
  13762. },
  13763. set: function(arg) {
  13764. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  13765. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  13766. }
  13767. defaultMaxListeners = arg;
  13768. }
  13769. });
  13770. EventEmitter.init = function() {
  13771. if (this._events === undefined ||
  13772. this._events === Object.getPrototypeOf(this)._events) {
  13773. this._events = Object.create(null);
  13774. this._eventsCount = 0;
  13775. }
  13776. this._maxListeners = this._maxListeners || undefined;
  13777. };
  13778. // Obviously not all Emitters should be limited to 10. This function allows
  13779. // that to be increased. Set to zero for unlimited.
  13780. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  13781. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  13782. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  13783. }
  13784. this._maxListeners = n;
  13785. return this;
  13786. };
  13787. function _getMaxListeners(that) {
  13788. if (that._maxListeners === undefined)
  13789. return EventEmitter.defaultMaxListeners;
  13790. return that._maxListeners;
  13791. }
  13792. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  13793. return _getMaxListeners(this);
  13794. };
  13795. EventEmitter.prototype.emit = function emit(type) {
  13796. var args = [];
  13797. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  13798. var doError = (type === 'error');
  13799. var events = this._events;
  13800. if (events !== undefined)
  13801. doError = (doError && events.error === undefined);
  13802. else if (!doError)
  13803. return false;
  13804. // If there is no 'error' event listener then throw.
  13805. if (doError) {
  13806. var er;
  13807. if (args.length > 0)
  13808. er = args[0];
  13809. if (er instanceof Error) {
  13810. // Note: The comments on the `throw` lines are intentional, they show
  13811. // up in Node's output if this results in an unhandled exception.
  13812. throw er; // Unhandled 'error' event
  13813. }
  13814. // At least give some kind of context to the user
  13815. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  13816. err.context = er;
  13817. throw err; // Unhandled 'error' event
  13818. }
  13819. var handler = events[type];
  13820. if (handler === undefined)
  13821. return false;
  13822. if (typeof handler === 'function') {
  13823. ReflectApply(handler, this, args);
  13824. } else {
  13825. var len = handler.length;
  13826. var listeners = arrayClone(handler, len);
  13827. for (var i = 0; i < len; ++i)
  13828. ReflectApply(listeners[i], this, args);
  13829. }
  13830. return true;
  13831. };
  13832. function _addListener(target, type, listener, prepend) {
  13833. var m;
  13834. var events;
  13835. var existing;
  13836. checkListener(listener);
  13837. events = target._events;
  13838. if (events === undefined) {
  13839. events = target._events = Object.create(null);
  13840. target._eventsCount = 0;
  13841. } else {
  13842. // To avoid recursion in the case that type === "newListener"! Before
  13843. // adding it to the listeners, first emit "newListener".
  13844. if (events.newListener !== undefined) {
  13845. target.emit('newListener', type,
  13846. listener.listener ? listener.listener : listener);
  13847. // Re-assign `events` because a newListener handler could have caused the
  13848. // this._events to be assigned to a new object
  13849. events = target._events;
  13850. }
  13851. existing = events[type];
  13852. }
  13853. if (existing === undefined) {
  13854. // Optimize the case of one listener. Don't need the extra array object.
  13855. existing = events[type] = listener;
  13856. ++target._eventsCount;
  13857. } else {
  13858. if (typeof existing === 'function') {
  13859. // Adding the second element, need to change to array.
  13860. existing = events[type] =
  13861. prepend ? [listener, existing] : [existing, listener];
  13862. // If we've already got an array, just append.
  13863. } else if (prepend) {
  13864. existing.unshift(listener);
  13865. } else {
  13866. existing.push(listener);
  13867. }
  13868. // Check for listener leak
  13869. m = _getMaxListeners(target);
  13870. if (m > 0 && existing.length > m && !existing.warned) {
  13871. existing.warned = true;
  13872. // No error code for this since it is a Warning
  13873. // eslint-disable-next-line no-restricted-syntax
  13874. var w = new Error('Possible EventEmitter memory leak detected. ' +
  13875. existing.length + ' ' + String(type) + ' listeners ' +
  13876. 'added. Use emitter.setMaxListeners() to ' +
  13877. 'increase limit');
  13878. w.name = 'MaxListenersExceededWarning';
  13879. w.emitter = target;
  13880. w.type = type;
  13881. w.count = existing.length;
  13882. ProcessEmitWarning(w);
  13883. }
  13884. }
  13885. return target;
  13886. }
  13887. EventEmitter.prototype.addListener = function addListener(type, listener) {
  13888. return _addListener(this, type, listener, false);
  13889. };
  13890. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  13891. EventEmitter.prototype.prependListener =
  13892. function prependListener(type, listener) {
  13893. return _addListener(this, type, listener, true);
  13894. };
  13895. function onceWrapper() {
  13896. if (!this.fired) {
  13897. this.target.removeListener(this.type, this.wrapFn);
  13898. this.fired = true;
  13899. if (arguments.length === 0)
  13900. return this.listener.call(this.target);
  13901. return this.listener.apply(this.target, arguments);
  13902. }
  13903. }
  13904. function _onceWrap(target, type, listener) {
  13905. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  13906. var wrapped = onceWrapper.bind(state);
  13907. wrapped.listener = listener;
  13908. state.wrapFn = wrapped;
  13909. return wrapped;
  13910. }
  13911. EventEmitter.prototype.once = function once(type, listener) {
  13912. checkListener(listener);
  13913. this.on(type, _onceWrap(this, type, listener));
  13914. return this;
  13915. };
  13916. EventEmitter.prototype.prependOnceListener =
  13917. function prependOnceListener(type, listener) {
  13918. checkListener(listener);
  13919. this.prependListener(type, _onceWrap(this, type, listener));
  13920. return this;
  13921. };
  13922. // Emits a 'removeListener' event if and only if the listener was removed.
  13923. EventEmitter.prototype.removeListener =
  13924. function removeListener(type, listener) {
  13925. var list, events, position, i, originalListener;
  13926. checkListener(listener);
  13927. events = this._events;
  13928. if (events === undefined)
  13929. return this;
  13930. list = events[type];
  13931. if (list === undefined)
  13932. return this;
  13933. if (list === listener || list.listener === listener) {
  13934. if (--this._eventsCount === 0)
  13935. this._events = Object.create(null);
  13936. else {
  13937. delete events[type];
  13938. if (events.removeListener)
  13939. this.emit('removeListener', type, list.listener || listener);
  13940. }
  13941. } else if (typeof list !== 'function') {
  13942. position = -1;
  13943. for (i = list.length - 1; i >= 0; i--) {
  13944. if (list[i] === listener || list[i].listener === listener) {
  13945. originalListener = list[i].listener;
  13946. position = i;
  13947. break;
  13948. }
  13949. }
  13950. if (position < 0)
  13951. return this;
  13952. if (position === 0)
  13953. list.shift();
  13954. else {
  13955. spliceOne(list, position);
  13956. }
  13957. if (list.length === 1)
  13958. events[type] = list[0];
  13959. if (events.removeListener !== undefined)
  13960. this.emit('removeListener', type, originalListener || listener);
  13961. }
  13962. return this;
  13963. };
  13964. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  13965. EventEmitter.prototype.removeAllListeners =
  13966. function removeAllListeners(type) {
  13967. var listeners, events, i;
  13968. events = this._events;
  13969. if (events === undefined)
  13970. return this;
  13971. // not listening for removeListener, no need to emit
  13972. if (events.removeListener === undefined) {
  13973. if (arguments.length === 0) {
  13974. this._events = Object.create(null);
  13975. this._eventsCount = 0;
  13976. } else if (events[type] !== undefined) {
  13977. if (--this._eventsCount === 0)
  13978. this._events = Object.create(null);
  13979. else
  13980. delete events[type];
  13981. }
  13982. return this;
  13983. }
  13984. // emit removeListener for all listeners on all events
  13985. if (arguments.length === 0) {
  13986. var keys = Object.keys(events);
  13987. var key;
  13988. for (i = 0; i < keys.length; ++i) {
  13989. key = keys[i];
  13990. if (key === 'removeListener') continue;
  13991. this.removeAllListeners(key);
  13992. }
  13993. this.removeAllListeners('removeListener');
  13994. this._events = Object.create(null);
  13995. this._eventsCount = 0;
  13996. return this;
  13997. }
  13998. listeners = events[type];
  13999. if (typeof listeners === 'function') {
  14000. this.removeListener(type, listeners);
  14001. } else if (listeners !== undefined) {
  14002. // LIFO order
  14003. for (i = listeners.length - 1; i >= 0; i--) {
  14004. this.removeListener(type, listeners[i]);
  14005. }
  14006. }
  14007. return this;
  14008. };
  14009. function _listeners(target, type, unwrap) {
  14010. var events = target._events;
  14011. if (events === undefined)
  14012. return [];
  14013. var evlistener = events[type];
  14014. if (evlistener === undefined)
  14015. return [];
  14016. if (typeof evlistener === 'function')
  14017. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  14018. return unwrap ?
  14019. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  14020. }
  14021. EventEmitter.prototype.listeners = function listeners(type) {
  14022. return _listeners(this, type, true);
  14023. };
  14024. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  14025. return _listeners(this, type, false);
  14026. };
  14027. EventEmitter.listenerCount = function(emitter, type) {
  14028. if (typeof emitter.listenerCount === 'function') {
  14029. return emitter.listenerCount(type);
  14030. } else {
  14031. return listenerCount.call(emitter, type);
  14032. }
  14033. };
  14034. EventEmitter.prototype.listenerCount = listenerCount;
  14035. function listenerCount(type) {
  14036. var events = this._events;
  14037. if (events !== undefined) {
  14038. var evlistener = events[type];
  14039. if (typeof evlistener === 'function') {
  14040. return 1;
  14041. } else if (evlistener !== undefined) {
  14042. return evlistener.length;
  14043. }
  14044. }
  14045. return 0;
  14046. }
  14047. EventEmitter.prototype.eventNames = function eventNames() {
  14048. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  14049. };
  14050. function arrayClone(arr, n) {
  14051. var copy = new Array(n);
  14052. for (var i = 0; i < n; ++i)
  14053. copy[i] = arr[i];
  14054. return copy;
  14055. }
  14056. function spliceOne(list, index) {
  14057. for (; index + 1 < list.length; index++)
  14058. list[index] = list[index + 1];
  14059. list.pop();
  14060. }
  14061. function unwrapListeners(arr) {
  14062. var ret = new Array(arr.length);
  14063. for (var i = 0; i < ret.length; ++i) {
  14064. ret[i] = arr[i].listener || arr[i];
  14065. }
  14066. return ret;
  14067. }
  14068. /***/ }),
  14069. /* 47 */
  14070. /*!*****************************************************************************!*\
  14071. !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***!
  14072. \*****************************************************************************/
  14073. /*! no static exports found */
  14074. /***/ (function(module, exports, __webpack_require__) {
  14075. module.exports = __webpack_require__(/*! events */ 46).EventEmitter;
  14076. /***/ }),
  14077. /* 48 */
  14078. /*!***********************************************!*\
  14079. !*** ./node_modules/core-util-is/lib/util.js ***!
  14080. \***********************************************/
  14081. /*! no static exports found */
  14082. /***/ (function(module, exports, __webpack_require__) {
  14083. /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
  14084. //
  14085. // Permission is hereby granted, free of charge, to any person obtaining a
  14086. // copy of this software and associated documentation files (the
  14087. // "Software"), to deal in the Software without restriction, including
  14088. // without limitation the rights to use, copy, modify, merge, publish,
  14089. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14090. // persons to whom the Software is furnished to do so, subject to the
  14091. // following conditions:
  14092. //
  14093. // The above copyright notice and this permission notice shall be included
  14094. // in all copies or substantial portions of the Software.
  14095. //
  14096. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14097. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14098. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14099. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14100. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14101. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14102. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14103. // NOTE: These type checking functions intentionally don't use `instanceof`
  14104. // because it is fragile and can be easily faked with `Object.create()`.
  14105. function isArray(arg) {
  14106. if (Array.isArray) {
  14107. return Array.isArray(arg);
  14108. }
  14109. return objectToString(arg) === '[object Array]';
  14110. }
  14111. exports.isArray = isArray;
  14112. function isBoolean(arg) {
  14113. return typeof arg === 'boolean';
  14114. }
  14115. exports.isBoolean = isBoolean;
  14116. function isNull(arg) {
  14117. return arg === null;
  14118. }
  14119. exports.isNull = isNull;
  14120. function isNullOrUndefined(arg) {
  14121. return arg == null;
  14122. }
  14123. exports.isNullOrUndefined = isNullOrUndefined;
  14124. function isNumber(arg) {
  14125. return typeof arg === 'number';
  14126. }
  14127. exports.isNumber = isNumber;
  14128. function isString(arg) {
  14129. return typeof arg === 'string';
  14130. }
  14131. exports.isString = isString;
  14132. function isSymbol(arg) {
  14133. return typeof arg === 'symbol';
  14134. }
  14135. exports.isSymbol = isSymbol;
  14136. function isUndefined(arg) {
  14137. return arg === void 0;
  14138. }
  14139. exports.isUndefined = isUndefined;
  14140. function isRegExp(re) {
  14141. return objectToString(re) === '[object RegExp]';
  14142. }
  14143. exports.isRegExp = isRegExp;
  14144. function isObject(arg) {
  14145. return typeof arg === 'object' && arg !== null;
  14146. }
  14147. exports.isObject = isObject;
  14148. function isDate(d) {
  14149. return objectToString(d) === '[object Date]';
  14150. }
  14151. exports.isDate = isDate;
  14152. function isError(e) {
  14153. return (objectToString(e) === '[object Error]' || e instanceof Error);
  14154. }
  14155. exports.isError = isError;
  14156. function isFunction(arg) {
  14157. return typeof arg === 'function';
  14158. }
  14159. exports.isFunction = isFunction;
  14160. function isPrimitive(arg) {
  14161. return arg === null ||
  14162. typeof arg === 'boolean' ||
  14163. typeof arg === 'number' ||
  14164. typeof arg === 'string' ||
  14165. typeof arg === 'symbol' || // ES6 symbol
  14166. typeof arg === 'undefined';
  14167. }
  14168. exports.isPrimitive = isPrimitive;
  14169. exports.isBuffer = Buffer.isBuffer;
  14170. function objectToString(o) {
  14171. return Object.prototype.toString.call(o);
  14172. }
  14173. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 35).Buffer))
  14174. /***/ }),
  14175. /* 49 */
  14176. /*!**********************!*\
  14177. !*** util (ignored) ***!
  14178. \**********************/
  14179. /*! no static exports found */
  14180. /***/ (function(module, exports) {
  14181. /* (ignored) */
  14182. /***/ }),
  14183. /* 50 */
  14184. /*!*************************************************************************!*\
  14185. !*** ./node_modules/readable-stream/lib/internal/streams/BufferList.js ***!
  14186. \*************************************************************************/
  14187. /*! no static exports found */
  14188. /***/ (function(module, exports, __webpack_require__) {
  14189. "use strict";
  14190. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14191. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer;
  14192. var util = __webpack_require__(/*! util */ 51);
  14193. function copyBuffer(src, target, offset) {
  14194. src.copy(target, offset);
  14195. }
  14196. module.exports = function () {
  14197. function BufferList() {
  14198. _classCallCheck(this, BufferList);
  14199. this.head = null;
  14200. this.tail = null;
  14201. this.length = 0;
  14202. }
  14203. BufferList.prototype.push = function push(v) {
  14204. var entry = { data: v, next: null };
  14205. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  14206. this.tail = entry;
  14207. ++this.length;
  14208. };
  14209. BufferList.prototype.unshift = function unshift(v) {
  14210. var entry = { data: v, next: this.head };
  14211. if (this.length === 0) this.tail = entry;
  14212. this.head = entry;
  14213. ++this.length;
  14214. };
  14215. BufferList.prototype.shift = function shift() {
  14216. if (this.length === 0) return;
  14217. var ret = this.head.data;
  14218. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  14219. --this.length;
  14220. return ret;
  14221. };
  14222. BufferList.prototype.clear = function clear() {
  14223. this.head = this.tail = null;
  14224. this.length = 0;
  14225. };
  14226. BufferList.prototype.join = function join(s) {
  14227. if (this.length === 0) return '';
  14228. var p = this.head;
  14229. var ret = '' + p.data;
  14230. while (p = p.next) {
  14231. ret += s + p.data;
  14232. }return ret;
  14233. };
  14234. BufferList.prototype.concat = function concat(n) {
  14235. if (this.length === 0) return Buffer.alloc(0);
  14236. if (this.length === 1) return this.head.data;
  14237. var ret = Buffer.allocUnsafe(n >>> 0);
  14238. var p = this.head;
  14239. var i = 0;
  14240. while (p) {
  14241. copyBuffer(p.data, ret, i);
  14242. i += p.data.length;
  14243. p = p.next;
  14244. }
  14245. return ret;
  14246. };
  14247. return BufferList;
  14248. }();
  14249. if (util && util.inspect && util.inspect.custom) {
  14250. module.exports.prototype[util.inspect.custom] = function () {
  14251. var obj = util.inspect({ length: this.length });
  14252. return this.constructor.name + ' ' + obj;
  14253. };
  14254. }
  14255. /***/ }),
  14256. /* 51 */
  14257. /*!**********************!*\
  14258. !*** util (ignored) ***!
  14259. \**********************/
  14260. /*! no static exports found */
  14261. /***/ (function(module, exports) {
  14262. /* (ignored) */
  14263. /***/ }),
  14264. /* 52 */
  14265. /*!**********************************************************************!*\
  14266. !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***!
  14267. \**********************************************************************/
  14268. /*! no static exports found */
  14269. /***/ (function(module, exports, __webpack_require__) {
  14270. "use strict";
  14271. /*<replacement>*/
  14272. var pna = __webpack_require__(/*! process-nextick-args */ 45);
  14273. /*</replacement>*/
  14274. // undocumented cb() API, needed for core, not for public API
  14275. function destroy(err, cb) {
  14276. var _this = this;
  14277. var readableDestroyed = this._readableState && this._readableState.destroyed;
  14278. var writableDestroyed = this._writableState && this._writableState.destroyed;
  14279. if (readableDestroyed || writableDestroyed) {
  14280. if (cb) {
  14281. cb(err);
  14282. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  14283. pna.nextTick(emitErrorNT, this, err);
  14284. }
  14285. return this;
  14286. }
  14287. // we set destroyed to true before firing error callbacks in order
  14288. // to make it re-entrance safe in case destroy() is called within callbacks
  14289. if (this._readableState) {
  14290. this._readableState.destroyed = true;
  14291. }
  14292. // if this is a duplex stream mark the writable part as destroyed as well
  14293. if (this._writableState) {
  14294. this._writableState.destroyed = true;
  14295. }
  14296. this._destroy(err || null, function (err) {
  14297. if (!cb && err) {
  14298. pna.nextTick(emitErrorNT, _this, err);
  14299. if (_this._writableState) {
  14300. _this._writableState.errorEmitted = true;
  14301. }
  14302. } else if (cb) {
  14303. cb(err);
  14304. }
  14305. });
  14306. return this;
  14307. }
  14308. function undestroy() {
  14309. if (this._readableState) {
  14310. this._readableState.destroyed = false;
  14311. this._readableState.reading = false;
  14312. this._readableState.ended = false;
  14313. this._readableState.endEmitted = false;
  14314. }
  14315. if (this._writableState) {
  14316. this._writableState.destroyed = false;
  14317. this._writableState.ended = false;
  14318. this._writableState.ending = false;
  14319. this._writableState.finished = false;
  14320. this._writableState.errorEmitted = false;
  14321. }
  14322. }
  14323. function emitErrorNT(self, err) {
  14324. self.emit('error', err);
  14325. }
  14326. module.exports = {
  14327. destroy: destroy,
  14328. undestroy: undestroy
  14329. };
  14330. /***/ }),
  14331. /* 53 */
  14332. /*!************************************************************!*\
  14333. !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***!
  14334. \************************************************************/
  14335. /*! no static exports found */
  14336. /***/ (function(module, exports, __webpack_require__) {
  14337. "use strict";
  14338. // Copyright Joyent, Inc. and other Node contributors.
  14339. //
  14340. // Permission is hereby granted, free of charge, to any person obtaining a
  14341. // copy of this software and associated documentation files (the
  14342. // "Software"), to deal in the Software without restriction, including
  14343. // without limitation the rights to use, copy, modify, merge, publish,
  14344. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14345. // persons to whom the Software is furnished to do so, subject to the
  14346. // following conditions:
  14347. //
  14348. // The above copyright notice and this permission notice shall be included
  14349. // in all copies or substantial portions of the Software.
  14350. //
  14351. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14352. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14353. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14354. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14355. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14356. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14357. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14358. // a duplex stream is just a stream that is both readable and writable.
  14359. // Since JS doesn't have multiple prototypal inheritance, this class
  14360. // prototypally inherits from Readable, and then parasitically from
  14361. // Writable.
  14362. /*<replacement>*/
  14363. var pna = __webpack_require__(/*! process-nextick-args */ 45);
  14364. /*</replacement>*/
  14365. /*<replacement>*/
  14366. var objectKeys = Object.keys || function (obj) {
  14367. var keys = [];
  14368. for (var key in obj) {
  14369. keys.push(key);
  14370. }return keys;
  14371. };
  14372. /*</replacement>*/
  14373. module.exports = Duplex;
  14374. /*<replacement>*/
  14375. var util = Object.create(__webpack_require__(/*! core-util-is */ 48));
  14376. util.inherits = __webpack_require__(/*! inherits */ 40);
  14377. /*</replacement>*/
  14378. var Readable = __webpack_require__(/*! ./_stream_readable */ 44);
  14379. var Writable = __webpack_require__(/*! ./_stream_writable */ 54);
  14380. util.inherits(Duplex, Readable);
  14381. {
  14382. // avoid scope creep, the keys array can then be collected
  14383. var keys = objectKeys(Writable.prototype);
  14384. for (var v = 0; v < keys.length; v++) {
  14385. var method = keys[v];
  14386. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  14387. }
  14388. }
  14389. function Duplex(options) {
  14390. if (!(this instanceof Duplex)) return new Duplex(options);
  14391. Readable.call(this, options);
  14392. Writable.call(this, options);
  14393. if (options && options.readable === false) this.readable = false;
  14394. if (options && options.writable === false) this.writable = false;
  14395. this.allowHalfOpen = true;
  14396. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  14397. this.once('end', onend);
  14398. }
  14399. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  14400. // making it explicit this property is not enumerable
  14401. // because otherwise some prototype manipulation in
  14402. // userland will fail
  14403. enumerable: false,
  14404. get: function () {
  14405. return this._writableState.highWaterMark;
  14406. }
  14407. });
  14408. // the no-half-open enforcer
  14409. function onend() {
  14410. // if we allow half-open state, or if the writable side ended,
  14411. // then we're ok.
  14412. if (this.allowHalfOpen || this._writableState.ended) return;
  14413. // no more data can be written.
  14414. // But allow more writes to happen in this tick.
  14415. pna.nextTick(onEndNT, this);
  14416. }
  14417. function onEndNT(self) {
  14418. self.end();
  14419. }
  14420. Object.defineProperty(Duplex.prototype, 'destroyed', {
  14421. get: function () {
  14422. if (this._readableState === undefined || this._writableState === undefined) {
  14423. return false;
  14424. }
  14425. return this._readableState.destroyed && this._writableState.destroyed;
  14426. },
  14427. set: function (value) {
  14428. // we ignore the value if the stream
  14429. // has not been initialized yet
  14430. if (this._readableState === undefined || this._writableState === undefined) {
  14431. return;
  14432. }
  14433. // backward compatibility, the user is explicitly
  14434. // managing destroyed
  14435. this._readableState.destroyed = value;
  14436. this._writableState.destroyed = value;
  14437. }
  14438. });
  14439. Duplex.prototype._destroy = function (err, cb) {
  14440. this.push(null);
  14441. this.end();
  14442. pna.nextTick(cb, err);
  14443. };
  14444. /***/ }),
  14445. /* 54 */
  14446. /*!**************************************************************!*\
  14447. !*** ./node_modules/readable-stream/lib/_stream_writable.js ***!
  14448. \**************************************************************/
  14449. /*! no static exports found */
  14450. /***/ (function(module, exports, __webpack_require__) {
  14451. "use strict";
  14452. /* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
  14453. //
  14454. // Permission is hereby granted, free of charge, to any person obtaining a
  14455. // copy of this software and associated documentation files (the
  14456. // "Software"), to deal in the Software without restriction, including
  14457. // without limitation the rights to use, copy, modify, merge, publish,
  14458. // distribute, sublicense, and/or sell copies of the Software, and to permit
  14459. // persons to whom the Software is furnished to do so, subject to the
  14460. // following conditions:
  14461. //
  14462. // The above copyright notice and this permission notice shall be included
  14463. // in all copies or substantial portions of the Software.
  14464. //
  14465. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14466. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14467. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14468. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14469. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14470. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14471. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  14472. // A bit simpler than readable streams.
  14473. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  14474. // the drain event emission and buffering.
  14475. /*<replacement>*/
  14476. var pna = __webpack_require__(/*! process-nextick-args */ 45);
  14477. /*</replacement>*/
  14478. module.exports = Writable;
  14479. /* <replacement> */
  14480. function WriteReq(chunk, encoding, cb) {
  14481. this.chunk = chunk;
  14482. this.encoding = encoding;
  14483. this.callback = cb;
  14484. this.next = null;
  14485. }
  14486. // It seems a linked list but it is not
  14487. // there will be only 2 of these for each stream
  14488. function CorkedRequest(state) {
  14489. var _this = this;
  14490. this.next = null;
  14491. this.entry = null;
  14492. this.finish = function () {
  14493. onCorkedFinish(_this, state);
  14494. };
  14495. }
  14496. /* </replacement> */
  14497. /*<replacement>*/
  14498. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  14499. /*</replacement>*/
  14500. /*<replacement>*/
  14501. var Duplex;
  14502. /*</replacement>*/
  14503. Writable.WritableState = WritableState;
  14504. /*<replacement>*/
  14505. var util = Object.create(__webpack_require__(/*! core-util-is */ 48));
  14506. util.inherits = __webpack_require__(/*! inherits */ 40);
  14507. /*</replacement>*/
  14508. /*<replacement>*/
  14509. var internalUtil = {
  14510. deprecate: __webpack_require__(/*! util-deprecate */ 55)
  14511. };
  14512. /*</replacement>*/
  14513. /*<replacement>*/
  14514. var Stream = __webpack_require__(/*! ./internal/streams/stream */ 47);
  14515. /*</replacement>*/
  14516. /*<replacement>*/
  14517. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer;
  14518. var OurUint8Array = global.Uint8Array || function () {};
  14519. function _uint8ArrayToBuffer(chunk) {
  14520. return Buffer.from(chunk);
  14521. }
  14522. function _isUint8Array(obj) {
  14523. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  14524. }
  14525. /*</replacement>*/
  14526. var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ 52);
  14527. util.inherits(Writable, Stream);
  14528. function nop() {}
  14529. function WritableState(options, stream) {
  14530. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 53);
  14531. options = options || {};
  14532. // Duplex streams are both readable and writable, but share
  14533. // the same options object.
  14534. // However, some cases require setting options to different
  14535. // values for the readable and the writable sides of the duplex stream.
  14536. // These options can be provided separately as readableXXX and writableXXX.
  14537. var isDuplex = stream instanceof Duplex;
  14538. // object stream flag to indicate whether or not this stream
  14539. // contains buffers or objects.
  14540. this.objectMode = !!options.objectMode;
  14541. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  14542. // the point at which write() starts returning false
  14543. // Note: 0 is a valid value, means that we always return false if
  14544. // the entire buffer is not flushed immediately on write()
  14545. var hwm = options.highWaterMark;
  14546. var writableHwm = options.writableHighWaterMark;
  14547. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  14548. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
  14549. // cast to ints.
  14550. this.highWaterMark = Math.floor(this.highWaterMark);
  14551. // if _final has been called
  14552. this.finalCalled = false;
  14553. // drain event flag.
  14554. this.needDrain = false;
  14555. // at the start of calling end()
  14556. this.ending = false;
  14557. // when end() has been called, and returned
  14558. this.ended = false;
  14559. // when 'finish' is emitted
  14560. this.finished = false;
  14561. // has it been destroyed
  14562. this.destroyed = false;
  14563. // should we decode strings into buffers before passing to _write?
  14564. // this is here so that some node-core streams can optimize string
  14565. // handling at a lower level.
  14566. var noDecode = options.decodeStrings === false;
  14567. this.decodeStrings = !noDecode;
  14568. // Crypto is kind of old and crusty. Historically, its default string
  14569. // encoding is 'binary' so we have to make this configurable.
  14570. // Everything else in the universe uses 'utf8', though.
  14571. this.defaultEncoding = options.defaultEncoding || 'utf8';
  14572. // not an actual buffer we keep track of, but a measurement
  14573. // of how much we're waiting to get pushed to some underlying
  14574. // socket or file.
  14575. this.length = 0;
  14576. // a flag to see when we're in the middle of a write.
  14577. this.writing = false;
  14578. // when true all writes will be buffered until .uncork() call
  14579. this.corked = 0;
  14580. // a flag to be able to tell if the onwrite cb is called immediately,
  14581. // or on a later tick. We set this to true at first, because any
  14582. // actions that shouldn't happen until "later" should generally also
  14583. // not happen before the first write call.
  14584. this.sync = true;
  14585. // a flag to know if we're processing previously buffered items, which
  14586. // may call the _write() callback in the same tick, so that we don't
  14587. // end up in an overlapped onwrite situation.
  14588. this.bufferProcessing = false;
  14589. // the callback that's passed to _write(chunk,cb)
  14590. this.onwrite = function (er) {
  14591. onwrite(stream, er);
  14592. };
  14593. // the callback that the user supplies to write(chunk,encoding,cb)
  14594. this.writecb = null;
  14595. // the amount that is being written when _write is called.
  14596. this.writelen = 0;
  14597. this.bufferedRequest = null;
  14598. this.lastBufferedRequest = null;
  14599. // number of pending user-supplied write callbacks
  14600. // this must be 0 before 'finish' can be emitted
  14601. this.pendingcb = 0;
  14602. // emit prefinish if the only thing we're waiting for is _write cbs
  14603. // This is relevant for synchronous Transform streams
  14604. this.prefinished = false;
  14605. // True if the error was already emitted and should not be thrown again
  14606. this.errorEmitted = false;
  14607. // count buffered requests
  14608. this.bufferedRequestCount = 0;
  14609. // allocate the first CorkedRequest, there is always
  14610. // one allocated and free to use, and we maintain at most two
  14611. this.corkedRequestsFree = new CorkedRequest(this);
  14612. }
  14613. WritableState.prototype.getBuffer = function getBuffer() {
  14614. var current = this.bufferedRequest;
  14615. var out = [];
  14616. while (current) {
  14617. out.push(current);
  14618. current = current.next;
  14619. }
  14620. return out;
  14621. };
  14622. (function () {
  14623. try {
  14624. Object.defineProperty(WritableState.prototype, 'buffer', {
  14625. get: internalUtil.deprecate(function () {
  14626. return this.getBuffer();
  14627. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  14628. });
  14629. } catch (_) {}
  14630. })();
  14631. // Test _writableState for inheritance to account for Duplex streams,
  14632. // whose prototype chain only points to Readable.
  14633. var realHasInstance;
  14634. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  14635. realHasInstance = Function.prototype[Symbol.hasInstance];
  14636. Object.defineProperty(Writable, Symbol.hasInstance, {
  14637. value: function (object) {
  14638. if (realHasInstance.call(this, object)) return true;
  14639. if (this !== Writable) return false;
  14640. return object && object._writableState instanceof WritableState;
  14641. }
  14642. });
  14643. } else {
  14644. realHasInstance = function (object) {
  14645. return object instanceof this;
  14646. };
  14647. }
  14648. function Writable(options) {
  14649. Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ 53);
  14650. // Writable ctor is applied to Duplexes, too.
  14651. // `realHasInstance` is necessary because using plain `instanceof`
  14652. // would return false, as no `_writableState` property is attached.
  14653. // Trying to use the custom `instanceof` for Writable here will also break the
  14654. // Node.js LazyTransform implementation, which has a non-trivial getter for
  14655. // `_writableState` that would lead to infinite recursion.
  14656. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  14657. return new Writable(options);
  14658. }
  14659. this._writableState = new WritableState(options, this);
  14660. // legacy.
  14661. this.writable = true;
  14662. if (options) {
  14663. if (typeof options.write === 'function') this._write = options.write;
  14664. if (typeof options.writev === 'function') this._writev = options.writev;
  14665. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  14666. if (typeof options.final === 'function') this._final = options.final;
  14667. }
  14668. Stream.call(this);
  14669. }
  14670. // Otherwise people can pipe Writable streams, which is just wrong.
  14671. Writable.prototype.pipe = function () {
  14672. this.emit('error', new Error('Cannot pipe, not readable'));
  14673. };
  14674. function writeAfterEnd(stream, cb) {
  14675. var er = new Error('write after end');
  14676. // TODO: defer error events consistently everywhere, not just the cb
  14677. stream.emit('error', er);
  14678. pna.nextTick(cb, er);
  14679. }
  14680. // Checks that a user-supplied chunk is valid, especially for the particular
  14681. // mode the stream is in. Currently this means that `null` is never accepted
  14682. // and undefined/non-string values are only allowed in object mode.
  14683. function validChunk(stream, state, chunk, cb) {
  14684. var valid = true;
  14685. var er = false;
  14686. if (chunk === null) {
  14687. er = new TypeError('May not write null values to stream');
  14688. } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  14689. er = new TypeError('Invalid non-string/buffer chunk');
  14690. }
  14691. if (er) {
  14692. stream.emit('error', er);
  14693. pna.nextTick(cb, er);
  14694. valid = false;
  14695. }
  14696. return valid;
  14697. }
  14698. Writable.prototype.write = function (chunk, encoding, cb) {
  14699. var state = this._writableState;
  14700. var ret = false;
  14701. var isBuf = !state.objectMode && _isUint8Array(chunk);
  14702. if (isBuf && !Buffer.isBuffer(chunk)) {
  14703. chunk = _uint8ArrayToBuffer(chunk);
  14704. }
  14705. if (typeof encoding === 'function') {
  14706. cb = encoding;
  14707. encoding = null;
  14708. }
  14709. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  14710. if (typeof cb !== 'function') cb = nop;
  14711. if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  14712. state.pendingcb++;
  14713. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  14714. }
  14715. return ret;
  14716. };
  14717. Writable.prototype.cork = function () {
  14718. var state = this._writableState;
  14719. state.corked++;
  14720. };
  14721. Writable.prototype.uncork = function () {
  14722. var state = this._writableState;
  14723. if (state.corked) {
  14724. state.corked--;
  14725. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  14726. }
  14727. };
  14728. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  14729. // node::ParseEncoding() requires lower case.
  14730. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  14731. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
  14732. this._writableState.defaultEncoding = encoding;
  14733. return this;
  14734. };
  14735. function decodeChunk(state, chunk, encoding) {
  14736. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  14737. chunk = Buffer.from(chunk, encoding);
  14738. }
  14739. return chunk;
  14740. }
  14741. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  14742. // making it explicit this property is not enumerable
  14743. // because otherwise some prototype manipulation in
  14744. // userland will fail
  14745. enumerable: false,
  14746. get: function () {
  14747. return this._writableState.highWaterMark;
  14748. }
  14749. });
  14750. // if we're already writing something, then just put this
  14751. // in the queue, and wait our turn. Otherwise, call _write
  14752. // If we return false, then we need a drain event, so set that flag.
  14753. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  14754. if (!isBuf) {
  14755. var newChunk = decodeChunk(state, chunk, encoding);
  14756. if (chunk !== newChunk) {
  14757. isBuf = true;
  14758. encoding = 'buffer';
  14759. chunk = newChunk;
  14760. }
  14761. }
  14762. var len = state.objectMode ? 1 : chunk.length;
  14763. state.length += len;
  14764. var ret = state.length < state.highWaterMark;
  14765. // we must ensure that previous needDrain will not be reset to false.
  14766. if (!ret) state.needDrain = true;
  14767. if (state.writing || state.corked) {
  14768. var last = state.lastBufferedRequest;
  14769. state.lastBufferedRequest = {
  14770. chunk: chunk,
  14771. encoding: encoding,
  14772. isBuf: isBuf,
  14773. callback: cb,
  14774. next: null
  14775. };
  14776. if (last) {
  14777. last.next = state.lastBufferedRequest;
  14778. } else {
  14779. state.bufferedRequest = state.lastBufferedRequest;
  14780. }
  14781. state.bufferedRequestCount += 1;
  14782. } else {
  14783. doWrite(stream, state, false, len, chunk, encoding, cb);
  14784. }
  14785. return ret;
  14786. }
  14787. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  14788. state.writelen = len;
  14789. state.writecb = cb;
  14790. state.writing = true;
  14791. state.sync = true;
  14792. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  14793. state.sync = false;
  14794. }
  14795. function onwriteError(stream, state, sync, er, cb) {
  14796. --state.pendingcb;
  14797. if (sync) {
  14798. // defer the callback if we are being called synchronously
  14799. // to avoid piling up things on the stack
  14800. pna.nextTick(cb, er);
  14801. // this can emit finish, and it will always happen
  14802. // after error
  14803. pna.nextTick(finishMaybe, stream, state);
  14804. stream._writableState.errorEmitted = true;
  14805. stream.emit('error', er);
  14806. } else {
  14807. // the caller expect this to happen before if
  14808. // it is async
  14809. cb(er);
  14810. stream._writableState.errorEmitted = true;
  14811. stream.emit('error', er);
  14812. // this can emit finish, but finish must
  14813. // always follow error
  14814. finishMaybe(stream, state);
  14815. }
  14816. }
  14817. function onwriteStateUpdate(state) {
  14818. state.writing = false;
  14819. state.writecb = null;
  14820. state.length -= state.writelen;
  14821. state.writelen = 0;
  14822. }
  14823. function onwrite(stream, er) {
  14824. var state = stream._writableState;
  14825. var sync = state.sync;
  14826. var cb = state.writecb;
  14827. onwriteStateUpdate(state);
  14828. if (er) onwriteError(stream, state, sync, er, cb);else {
  14829. // Check if we're actually ready to finish, but don't emit yet
  14830. var finished = needFinish(state);
  14831. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  14832. clearBuffer(stream, state);
  14833. }
  14834. if (sync) {
  14835. /*<replacement>*/
  14836. asyncWrite(afterWrite, stream, state, finished, cb);
  14837. /*</replacement>*/
  14838. } else {
  14839. afterWrite(stream, state, finished, cb);
  14840. }
  14841. }
  14842. }
  14843. function afterWrite(stream, state, finished, cb) {
  14844. if (!finished) onwriteDrain(stream, state);
  14845. state.pendingcb--;
  14846. cb();
  14847. finishMaybe(stream, state);
  14848. }
  14849. // Must force callback to be called on nextTick, so that we don't
  14850. // emit 'drain' before the write() consumer gets the 'false' return
  14851. // value, and has a chance to attach a 'drain' listener.
  14852. function onwriteDrain(stream, state) {
  14853. if (state.length === 0 && state.needDrain) {
  14854. state.needDrain = false;
  14855. stream.emit('drain');
  14856. }
  14857. }
  14858. // if there's something in the buffer waiting, then process it
  14859. function clearBuffer(stream, state) {
  14860. state.bufferProcessing = true;
  14861. var entry = state.bufferedRequest;
  14862. if (stream._writev && entry && entry.next) {
  14863. // Fast case, write everything using _writev()
  14864. var l = state.bufferedRequestCount;
  14865. var buffer = new Array(l);
  14866. var holder = state.corkedRequestsFree;
  14867. holder.entry = entry;
  14868. var count = 0;
  14869. var allBuffers = true;
  14870. while (entry) {
  14871. buffer[count] = entry;
  14872. if (!entry.isBuf) allBuffers = false;
  14873. entry = entry.next;
  14874. count += 1;
  14875. }
  14876. buffer.allBuffers = allBuffers;
  14877. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  14878. // doWrite is almost always async, defer these to save a bit of time
  14879. // as the hot path ends with doWrite
  14880. state.pendingcb++;
  14881. state.lastBufferedRequest = null;
  14882. if (holder.next) {
  14883. state.corkedRequestsFree = holder.next;
  14884. holder.next = null;
  14885. } else {
  14886. state.corkedRequestsFree = new CorkedRequest(state);
  14887. }
  14888. state.bufferedRequestCount = 0;
  14889. } else {
  14890. // Slow case, write chunks one-by-one
  14891. while (entry) {
  14892. var chunk = entry.chunk;
  14893. var encoding = entry.encoding;
  14894. var cb = entry.callback;
  14895. var len = state.objectMode ? 1 : chunk.length;
  14896. doWrite(stream, state, false, len, chunk, encoding, cb);
  14897. entry = entry.next;
  14898. state.bufferedRequestCount--;
  14899. // if we didn't call the onwrite immediately, then
  14900. // it means that we need to wait until it does.
  14901. // also, that means that the chunk and cb are currently
  14902. // being processed, so move the buffer counter past them.
  14903. if (state.writing) {
  14904. break;
  14905. }
  14906. }
  14907. if (entry === null) state.lastBufferedRequest = null;
  14908. }
  14909. state.bufferedRequest = entry;
  14910. state.bufferProcessing = false;
  14911. }
  14912. Writable.prototype._write = function (chunk, encoding, cb) {
  14913. cb(new Error('_write() is not implemented'));
  14914. };
  14915. Writable.prototype._writev = null;
  14916. Writable.prototype.end = function (chunk, encoding, cb) {
  14917. var state = this._writableState;
  14918. if (typeof chunk === 'function') {
  14919. cb = chunk;
  14920. chunk = null;
  14921. encoding = null;
  14922. } else if (typeof encoding === 'function') {
  14923. cb = encoding;
  14924. encoding = null;
  14925. }
  14926. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  14927. // .end() fully uncorks
  14928. if (state.corked) {
  14929. state.corked = 1;
  14930. this.uncork();
  14931. }
  14932. // ignore unnecessary end() calls.
  14933. if (!state.ending && !state.finished) endWritable(this, state, cb);
  14934. };
  14935. function needFinish(state) {
  14936. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  14937. }
  14938. function callFinal(stream, state) {
  14939. stream._final(function (err) {
  14940. state.pendingcb--;
  14941. if (err) {
  14942. stream.emit('error', err);
  14943. }
  14944. state.prefinished = true;
  14945. stream.emit('prefinish');
  14946. finishMaybe(stream, state);
  14947. });
  14948. }
  14949. function prefinish(stream, state) {
  14950. if (!state.prefinished && !state.finalCalled) {
  14951. if (typeof stream._final === 'function') {
  14952. state.pendingcb++;
  14953. state.finalCalled = true;
  14954. pna.nextTick(callFinal, stream, state);
  14955. } else {
  14956. state.prefinished = true;
  14957. stream.emit('prefinish');
  14958. }
  14959. }
  14960. }
  14961. function finishMaybe(stream, state) {
  14962. var need = needFinish(state);
  14963. if (need) {
  14964. prefinish(stream, state);
  14965. if (state.pendingcb === 0) {
  14966. state.finished = true;
  14967. stream.emit('finish');
  14968. }
  14969. }
  14970. return need;
  14971. }
  14972. function endWritable(stream, state, cb) {
  14973. state.ending = true;
  14974. finishMaybe(stream, state);
  14975. if (cb) {
  14976. if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
  14977. }
  14978. state.ended = true;
  14979. stream.writable = false;
  14980. }
  14981. function onCorkedFinish(corkReq, state, err) {
  14982. var entry = corkReq.entry;
  14983. corkReq.entry = null;
  14984. while (entry) {
  14985. var cb = entry.callback;
  14986. state.pendingcb--;
  14987. cb(err);
  14988. entry = entry.next;
  14989. }
  14990. if (state.corkedRequestsFree) {
  14991. state.corkedRequestsFree.next = corkReq;
  14992. } else {
  14993. state.corkedRequestsFree = corkReq;
  14994. }
  14995. }
  14996. Object.defineProperty(Writable.prototype, 'destroyed', {
  14997. get: function () {
  14998. if (this._writableState === undefined) {
  14999. return false;
  15000. }
  15001. return this._writableState.destroyed;
  15002. },
  15003. set: function (value) {
  15004. // we ignore the value if the stream
  15005. // has not been initialized yet
  15006. if (!this._writableState) {
  15007. return;
  15008. }
  15009. // backward compatibility, the user is explicitly
  15010. // managing destroyed
  15011. this._writableState.destroyed = value;
  15012. }
  15013. });
  15014. Writable.prototype.destroy = destroyImpl.destroy;
  15015. Writable.prototype._undestroy = destroyImpl.undestroy;
  15016. Writable.prototype._destroy = function (err, cb) {
  15017. this.end();
  15018. cb(err);
  15019. };
  15020. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 32), __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  15021. /***/ }),
  15022. /* 55 */
  15023. /*!************************************************!*\
  15024. !*** ./node_modules/util-deprecate/browser.js ***!
  15025. \************************************************/
  15026. /*! no static exports found */
  15027. /***/ (function(module, exports, __webpack_require__) {
  15028. /* WEBPACK VAR INJECTION */(function(global) {
  15029. /**
  15030. * Module exports.
  15031. */
  15032. module.exports = deprecate;
  15033. /**
  15034. * Mark that a method should not be used.
  15035. * Returns a modified function which warns once by default.
  15036. *
  15037. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  15038. *
  15039. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  15040. * will throw an Error when invoked.
  15041. *
  15042. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  15043. * will invoke `console.trace()` instead of `console.error()`.
  15044. *
  15045. * @param {Function} fn - the function to deprecate
  15046. * @param {String} msg - the string to print to the console when `fn` is invoked
  15047. * @returns {Function} a new "deprecated" version of `fn`
  15048. * @api public
  15049. */
  15050. function deprecate (fn, msg) {
  15051. if (config('noDeprecation')) {
  15052. return fn;
  15053. }
  15054. var warned = false;
  15055. function deprecated() {
  15056. if (!warned) {
  15057. if (config('throwDeprecation')) {
  15058. throw new Error(msg);
  15059. } else if (config('traceDeprecation')) {
  15060. console.trace(msg);
  15061. } else {
  15062. console.warn(msg);
  15063. }
  15064. warned = true;
  15065. }
  15066. return fn.apply(this, arguments);
  15067. }
  15068. return deprecated;
  15069. }
  15070. /**
  15071. * Checks `localStorage` for boolean values for the given `name`.
  15072. *
  15073. * @param {String} name
  15074. * @returns {Boolean}
  15075. * @api private
  15076. */
  15077. function config (name) {
  15078. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  15079. try {
  15080. if (!global.localStorage) return false;
  15081. } catch (_) {
  15082. return false;
  15083. }
  15084. var val = global.localStorage[name];
  15085. if (null == val) return false;
  15086. return String(val).toLowerCase() === 'true';
  15087. }
  15088. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3)))
  15089. /***/ }),
  15090. /* 56 */
  15091. /*!***********************************************************!*\
  15092. !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
  15093. \***********************************************************/
  15094. /*! no static exports found */
  15095. /***/ (function(module, exports, __webpack_require__) {
  15096. "use strict";
  15097. // Copyright Joyent, Inc. and other Node contributors.
  15098. //
  15099. // Permission is hereby granted, free of charge, to any person obtaining a
  15100. // copy of this software and associated documentation files (the
  15101. // "Software"), to deal in the Software without restriction, including
  15102. // without limitation the rights to use, copy, modify, merge, publish,
  15103. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15104. // persons to whom the Software is furnished to do so, subject to the
  15105. // following conditions:
  15106. //
  15107. // The above copyright notice and this permission notice shall be included
  15108. // in all copies or substantial portions of the Software.
  15109. //
  15110. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15111. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15112. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15113. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15114. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15115. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15116. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15117. /*<replacement>*/
  15118. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer;
  15119. /*</replacement>*/
  15120. var isEncoding = Buffer.isEncoding || function (encoding) {
  15121. encoding = '' + encoding;
  15122. switch (encoding && encoding.toLowerCase()) {
  15123. case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
  15124. return true;
  15125. default:
  15126. return false;
  15127. }
  15128. };
  15129. function _normalizeEncoding(enc) {
  15130. if (!enc) return 'utf8';
  15131. var retried;
  15132. while (true) {
  15133. switch (enc) {
  15134. case 'utf8':
  15135. case 'utf-8':
  15136. return 'utf8';
  15137. case 'ucs2':
  15138. case 'ucs-2':
  15139. case 'utf16le':
  15140. case 'utf-16le':
  15141. return 'utf16le';
  15142. case 'latin1':
  15143. case 'binary':
  15144. return 'latin1';
  15145. case 'base64':
  15146. case 'ascii':
  15147. case 'hex':
  15148. return enc;
  15149. default:
  15150. if (retried) return; // undefined
  15151. enc = ('' + enc).toLowerCase();
  15152. retried = true;
  15153. }
  15154. }
  15155. };
  15156. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  15157. // modules monkey-patch it to support additional encodings
  15158. function normalizeEncoding(enc) {
  15159. var nenc = _normalizeEncoding(enc);
  15160. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  15161. return nenc || enc;
  15162. }
  15163. // StringDecoder provides an interface for efficiently splitting a series of
  15164. // buffers into a series of JS strings without breaking apart multi-byte
  15165. // characters.
  15166. exports.StringDecoder = StringDecoder;
  15167. function StringDecoder(encoding) {
  15168. this.encoding = normalizeEncoding(encoding);
  15169. var nb;
  15170. switch (this.encoding) {
  15171. case 'utf16le':
  15172. this.text = utf16Text;
  15173. this.end = utf16End;
  15174. nb = 4;
  15175. break;
  15176. case 'utf8':
  15177. this.fillLast = utf8FillLast;
  15178. nb = 4;
  15179. break;
  15180. case 'base64':
  15181. this.text = base64Text;
  15182. this.end = base64End;
  15183. nb = 3;
  15184. break;
  15185. default:
  15186. this.write = simpleWrite;
  15187. this.end = simpleEnd;
  15188. return;
  15189. }
  15190. this.lastNeed = 0;
  15191. this.lastTotal = 0;
  15192. this.lastChar = Buffer.allocUnsafe(nb);
  15193. }
  15194. StringDecoder.prototype.write = function (buf) {
  15195. if (buf.length === 0) return '';
  15196. var r;
  15197. var i;
  15198. if (this.lastNeed) {
  15199. r = this.fillLast(buf);
  15200. if (r === undefined) return '';
  15201. i = this.lastNeed;
  15202. this.lastNeed = 0;
  15203. } else {
  15204. i = 0;
  15205. }
  15206. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  15207. return r || '';
  15208. };
  15209. StringDecoder.prototype.end = utf8End;
  15210. // Returns only complete characters in a Buffer
  15211. StringDecoder.prototype.text = utf8Text;
  15212. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  15213. StringDecoder.prototype.fillLast = function (buf) {
  15214. if (this.lastNeed <= buf.length) {
  15215. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  15216. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  15217. }
  15218. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  15219. this.lastNeed -= buf.length;
  15220. };
  15221. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  15222. // continuation byte. If an invalid byte is detected, -2 is returned.
  15223. function utf8CheckByte(byte) {
  15224. if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
  15225. return byte >> 6 === 0x02 ? -1 : -2;
  15226. }
  15227. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  15228. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  15229. // needed to complete the UTF-8 character (if applicable) are returned.
  15230. function utf8CheckIncomplete(self, buf, i) {
  15231. var j = buf.length - 1;
  15232. if (j < i) return 0;
  15233. var nb = utf8CheckByte(buf[j]);
  15234. if (nb >= 0) {
  15235. if (nb > 0) self.lastNeed = nb - 1;
  15236. return nb;
  15237. }
  15238. if (--j < i || nb === -2) return 0;
  15239. nb = utf8CheckByte(buf[j]);
  15240. if (nb >= 0) {
  15241. if (nb > 0) self.lastNeed = nb - 2;
  15242. return nb;
  15243. }
  15244. if (--j < i || nb === -2) return 0;
  15245. nb = utf8CheckByte(buf[j]);
  15246. if (nb >= 0) {
  15247. if (nb > 0) {
  15248. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  15249. }
  15250. return nb;
  15251. }
  15252. return 0;
  15253. }
  15254. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  15255. // needed or are available. If we see a non-continuation byte where we expect
  15256. // one, we "replace" the validated continuation bytes we've seen so far with
  15257. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  15258. // behavior. The continuation byte check is included three times in the case
  15259. // where all of the continuation bytes for a character exist in the same buffer.
  15260. // It is also done this way as a slight performance increase instead of using a
  15261. // loop.
  15262. function utf8CheckExtraBytes(self, buf, p) {
  15263. if ((buf[0] & 0xC0) !== 0x80) {
  15264. self.lastNeed = 0;
  15265. return '\ufffd';
  15266. }
  15267. if (self.lastNeed > 1 && buf.length > 1) {
  15268. if ((buf[1] & 0xC0) !== 0x80) {
  15269. self.lastNeed = 1;
  15270. return '\ufffd';
  15271. }
  15272. if (self.lastNeed > 2 && buf.length > 2) {
  15273. if ((buf[2] & 0xC0) !== 0x80) {
  15274. self.lastNeed = 2;
  15275. return '\ufffd';
  15276. }
  15277. }
  15278. }
  15279. }
  15280. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  15281. function utf8FillLast(buf) {
  15282. var p = this.lastTotal - this.lastNeed;
  15283. var r = utf8CheckExtraBytes(this, buf, p);
  15284. if (r !== undefined) return r;
  15285. if (this.lastNeed <= buf.length) {
  15286. buf.copy(this.lastChar, p, 0, this.lastNeed);
  15287. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  15288. }
  15289. buf.copy(this.lastChar, p, 0, buf.length);
  15290. this.lastNeed -= buf.length;
  15291. }
  15292. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  15293. // partial character, the character's bytes are buffered until the required
  15294. // number of bytes are available.
  15295. function utf8Text(buf, i) {
  15296. var total = utf8CheckIncomplete(this, buf, i);
  15297. if (!this.lastNeed) return buf.toString('utf8', i);
  15298. this.lastTotal = total;
  15299. var end = buf.length - (total - this.lastNeed);
  15300. buf.copy(this.lastChar, 0, end);
  15301. return buf.toString('utf8', i, end);
  15302. }
  15303. // For UTF-8, a replacement character is added when ending on a partial
  15304. // character.
  15305. function utf8End(buf) {
  15306. var r = buf && buf.length ? this.write(buf) : '';
  15307. if (this.lastNeed) return r + '\ufffd';
  15308. return r;
  15309. }
  15310. // UTF-16LE typically needs two bytes per character, but even if we have an even
  15311. // number of bytes available, we need to check if we end on a leading/high
  15312. // surrogate. In that case, we need to wait for the next two bytes in order to
  15313. // decode the last character properly.
  15314. function utf16Text(buf, i) {
  15315. if ((buf.length - i) % 2 === 0) {
  15316. var r = buf.toString('utf16le', i);
  15317. if (r) {
  15318. var c = r.charCodeAt(r.length - 1);
  15319. if (c >= 0xD800 && c <= 0xDBFF) {
  15320. this.lastNeed = 2;
  15321. this.lastTotal = 4;
  15322. this.lastChar[0] = buf[buf.length - 2];
  15323. this.lastChar[1] = buf[buf.length - 1];
  15324. return r.slice(0, -1);
  15325. }
  15326. }
  15327. return r;
  15328. }
  15329. this.lastNeed = 1;
  15330. this.lastTotal = 2;
  15331. this.lastChar[0] = buf[buf.length - 1];
  15332. return buf.toString('utf16le', i, buf.length - 1);
  15333. }
  15334. // For UTF-16LE we do not explicitly append special replacement characters if we
  15335. // end on a partial character, we simply let v8 handle that.
  15336. function utf16End(buf) {
  15337. var r = buf && buf.length ? this.write(buf) : '';
  15338. if (this.lastNeed) {
  15339. var end = this.lastTotal - this.lastNeed;
  15340. return r + this.lastChar.toString('utf16le', 0, end);
  15341. }
  15342. return r;
  15343. }
  15344. function base64Text(buf, i) {
  15345. var n = (buf.length - i) % 3;
  15346. if (n === 0) return buf.toString('base64', i);
  15347. this.lastNeed = 3 - n;
  15348. this.lastTotal = 3;
  15349. if (n === 1) {
  15350. this.lastChar[0] = buf[buf.length - 1];
  15351. } else {
  15352. this.lastChar[0] = buf[buf.length - 2];
  15353. this.lastChar[1] = buf[buf.length - 1];
  15354. }
  15355. return buf.toString('base64', i, buf.length - n);
  15356. }
  15357. function base64End(buf) {
  15358. var r = buf && buf.length ? this.write(buf) : '';
  15359. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  15360. return r;
  15361. }
  15362. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  15363. function simpleWrite(buf) {
  15364. return buf.toString(this.encoding);
  15365. }
  15366. function simpleEnd(buf) {
  15367. return buf && buf.length ? this.write(buf) : '';
  15368. }
  15369. /***/ }),
  15370. /* 57 */
  15371. /*!***************************************************************!*\
  15372. !*** ./node_modules/readable-stream/lib/_stream_transform.js ***!
  15373. \***************************************************************/
  15374. /*! no static exports found */
  15375. /***/ (function(module, exports, __webpack_require__) {
  15376. "use strict";
  15377. // Copyright Joyent, Inc. and other Node contributors.
  15378. //
  15379. // Permission is hereby granted, free of charge, to any person obtaining a
  15380. // copy of this software and associated documentation files (the
  15381. // "Software"), to deal in the Software without restriction, including
  15382. // without limitation the rights to use, copy, modify, merge, publish,
  15383. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15384. // persons to whom the Software is furnished to do so, subject to the
  15385. // following conditions:
  15386. //
  15387. // The above copyright notice and this permission notice shall be included
  15388. // in all copies or substantial portions of the Software.
  15389. //
  15390. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15391. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15392. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15393. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15394. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15395. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15396. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15397. // a transform stream is a readable/writable stream where you do
  15398. // something with the data. Sometimes it's called a "filter",
  15399. // but that's not a great name for it, since that implies a thing where
  15400. // some bits pass through, and others are simply ignored. (That would
  15401. // be a valid example of a transform, of course.)
  15402. //
  15403. // While the output is causally related to the input, it's not a
  15404. // necessarily symmetric or synchronous transformation. For example,
  15405. // a zlib stream might take multiple plain-text writes(), and then
  15406. // emit a single compressed chunk some time in the future.
  15407. //
  15408. // Here's how this works:
  15409. //
  15410. // The Transform stream has all the aspects of the readable and writable
  15411. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  15412. // internally, and returns false if there's a lot of pending writes
  15413. // buffered up. When you call read(), that calls _read(n) until
  15414. // there's enough pending readable data buffered up.
  15415. //
  15416. // In a transform stream, the written data is placed in a buffer. When
  15417. // _read(n) is called, it transforms the queued up data, calling the
  15418. // buffered _write cb's as it consumes chunks. If consuming a single
  15419. // written chunk would result in multiple output chunks, then the first
  15420. // outputted bit calls the readcb, and subsequent chunks just go into
  15421. // the read buffer, and will cause it to emit 'readable' if necessary.
  15422. //
  15423. // This way, back-pressure is actually determined by the reading side,
  15424. // since _read has to be called to start processing a new chunk. However,
  15425. // a pathological inflate type of transform can cause excessive buffering
  15426. // here. For example, imagine a stream where every byte of input is
  15427. // interpreted as an integer from 0-255, and then results in that many
  15428. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  15429. // 1kb of data being output. In this case, you could write a very small
  15430. // amount of input, and end up with a very large amount of output. In
  15431. // such a pathological inflating mechanism, there'd be no way to tell
  15432. // the system to stop doing the transform. A single 4MB write could
  15433. // cause the system to run out of memory.
  15434. //
  15435. // However, even in such a pathological case, only a single written chunk
  15436. // would be consumed, and then the rest would wait (un-transformed) until
  15437. // the results of the previous transformed chunk were consumed.
  15438. module.exports = Transform;
  15439. var Duplex = __webpack_require__(/*! ./_stream_duplex */ 53);
  15440. /*<replacement>*/
  15441. var util = Object.create(__webpack_require__(/*! core-util-is */ 48));
  15442. util.inherits = __webpack_require__(/*! inherits */ 40);
  15443. /*</replacement>*/
  15444. util.inherits(Transform, Duplex);
  15445. function afterTransform(er, data) {
  15446. var ts = this._transformState;
  15447. ts.transforming = false;
  15448. var cb = ts.writecb;
  15449. if (!cb) {
  15450. return this.emit('error', new Error('write callback called multiple times'));
  15451. }
  15452. ts.writechunk = null;
  15453. ts.writecb = null;
  15454. if (data != null) // single equals check for both `null` and `undefined`
  15455. this.push(data);
  15456. cb(er);
  15457. var rs = this._readableState;
  15458. rs.reading = false;
  15459. if (rs.needReadable || rs.length < rs.highWaterMark) {
  15460. this._read(rs.highWaterMark);
  15461. }
  15462. }
  15463. function Transform(options) {
  15464. if (!(this instanceof Transform)) return new Transform(options);
  15465. Duplex.call(this, options);
  15466. this._transformState = {
  15467. afterTransform: afterTransform.bind(this),
  15468. needTransform: false,
  15469. transforming: false,
  15470. writecb: null,
  15471. writechunk: null,
  15472. writeencoding: null
  15473. };
  15474. // start out asking for a readable event once data is transformed.
  15475. this._readableState.needReadable = true;
  15476. // we have implemented the _read method, and done the other things
  15477. // that Readable wants before the first _read call, so unset the
  15478. // sync guard flag.
  15479. this._readableState.sync = false;
  15480. if (options) {
  15481. if (typeof options.transform === 'function') this._transform = options.transform;
  15482. if (typeof options.flush === 'function') this._flush = options.flush;
  15483. }
  15484. // When the writable side finishes, then flush out anything remaining.
  15485. this.on('prefinish', prefinish);
  15486. }
  15487. function prefinish() {
  15488. var _this = this;
  15489. if (typeof this._flush === 'function') {
  15490. this._flush(function (er, data) {
  15491. done(_this, er, data);
  15492. });
  15493. } else {
  15494. done(this, null, null);
  15495. }
  15496. }
  15497. Transform.prototype.push = function (chunk, encoding) {
  15498. this._transformState.needTransform = false;
  15499. return Duplex.prototype.push.call(this, chunk, encoding);
  15500. };
  15501. // This is the part where you do stuff!
  15502. // override this function in implementation classes.
  15503. // 'chunk' is an input chunk.
  15504. //
  15505. // Call `push(newChunk)` to pass along transformed output
  15506. // to the readable side. You may call 'push' zero or more times.
  15507. //
  15508. // Call `cb(err)` when you are done with this chunk. If you pass
  15509. // an error, then that'll put the hurt on the whole operation. If you
  15510. // never call cb(), then you'll never get another chunk.
  15511. Transform.prototype._transform = function (chunk, encoding, cb) {
  15512. throw new Error('_transform() is not implemented');
  15513. };
  15514. Transform.prototype._write = function (chunk, encoding, cb) {
  15515. var ts = this._transformState;
  15516. ts.writecb = cb;
  15517. ts.writechunk = chunk;
  15518. ts.writeencoding = encoding;
  15519. if (!ts.transforming) {
  15520. var rs = this._readableState;
  15521. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  15522. }
  15523. };
  15524. // Doesn't matter what the args are here.
  15525. // _transform does all the work.
  15526. // That we got here means that the readable side wants more data.
  15527. Transform.prototype._read = function (n) {
  15528. var ts = this._transformState;
  15529. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  15530. ts.transforming = true;
  15531. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  15532. } else {
  15533. // mark that we need a transform, so that any data that comes in
  15534. // will get processed, now that we've asked for it.
  15535. ts.needTransform = true;
  15536. }
  15537. };
  15538. Transform.prototype._destroy = function (err, cb) {
  15539. var _this2 = this;
  15540. Duplex.prototype._destroy.call(this, err, function (err2) {
  15541. cb(err2);
  15542. _this2.emit('close');
  15543. });
  15544. };
  15545. function done(stream, er, data) {
  15546. if (er) return stream.emit('error', er);
  15547. if (data != null) // single equals check for both `null` and `undefined`
  15548. stream.push(data);
  15549. // if there's nothing in the write buffer, then that means
  15550. // that nothing more will ever be provided
  15551. if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
  15552. if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
  15553. return stream.push(null);
  15554. }
  15555. /***/ }),
  15556. /* 58 */
  15557. /*!*****************************************************************!*\
  15558. !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***!
  15559. \*****************************************************************/
  15560. /*! no static exports found */
  15561. /***/ (function(module, exports, __webpack_require__) {
  15562. "use strict";
  15563. // Copyright Joyent, Inc. and other Node contributors.
  15564. //
  15565. // Permission is hereby granted, free of charge, to any person obtaining a
  15566. // copy of this software and associated documentation files (the
  15567. // "Software"), to deal in the Software without restriction, including
  15568. // without limitation the rights to use, copy, modify, merge, publish,
  15569. // distribute, sublicense, and/or sell copies of the Software, and to permit
  15570. // persons to whom the Software is furnished to do so, subject to the
  15571. // following conditions:
  15572. //
  15573. // The above copyright notice and this permission notice shall be included
  15574. // in all copies or substantial portions of the Software.
  15575. //
  15576. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15577. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15578. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  15579. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  15580. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15581. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  15582. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  15583. // a passthrough stream.
  15584. // basically just the most minimal sort of Transform stream.
  15585. // Every written chunk gets output as-is.
  15586. module.exports = PassThrough;
  15587. var Transform = __webpack_require__(/*! ./_stream_transform */ 57);
  15588. /*<replacement>*/
  15589. var util = Object.create(__webpack_require__(/*! core-util-is */ 48));
  15590. util.inherits = __webpack_require__(/*! inherits */ 40);
  15591. /*</replacement>*/
  15592. util.inherits(PassThrough, Transform);
  15593. function PassThrough(options) {
  15594. if (!(this instanceof PassThrough)) return new PassThrough(options);
  15595. Transform.call(this, options);
  15596. }
  15597. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  15598. cb(null, chunk);
  15599. };
  15600. /***/ }),
  15601. /* 59 */
  15602. /*!*****************************************!*\
  15603. !*** ./node_modules/ripemd160/index.js ***!
  15604. \*****************************************/
  15605. /*! no static exports found */
  15606. /***/ (function(module, exports, __webpack_require__) {
  15607. "use strict";
  15608. var Buffer = __webpack_require__(/*! buffer */ 35).Buffer
  15609. var inherits = __webpack_require__(/*! inherits */ 40)
  15610. var HashBase = __webpack_require__(/*! hash-base */ 42)
  15611. var ARRAY16 = new Array(16)
  15612. var zl = [
  15613. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  15614. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  15615. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  15616. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  15617. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  15618. ]
  15619. var zr = [
  15620. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  15621. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  15622. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  15623. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  15624. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  15625. ]
  15626. var sl = [
  15627. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  15628. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  15629. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  15630. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  15631. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  15632. ]
  15633. var sr = [
  15634. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  15635. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  15636. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  15637. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  15638. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  15639. ]
  15640. var hl = [0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]
  15641. var hr = [0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000]
  15642. function RIPEMD160 () {
  15643. HashBase.call(this, 64)
  15644. // state
  15645. this._a = 0x67452301
  15646. this._b = 0xefcdab89
  15647. this._c = 0x98badcfe
  15648. this._d = 0x10325476
  15649. this._e = 0xc3d2e1f0
  15650. }
  15651. inherits(RIPEMD160, HashBase)
  15652. RIPEMD160.prototype._update = function () {
  15653. var words = ARRAY16
  15654. for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4)
  15655. var al = this._a | 0
  15656. var bl = this._b | 0
  15657. var cl = this._c | 0
  15658. var dl = this._d | 0
  15659. var el = this._e | 0
  15660. var ar = this._a | 0
  15661. var br = this._b | 0
  15662. var cr = this._c | 0
  15663. var dr = this._d | 0
  15664. var er = this._e | 0
  15665. // computation
  15666. for (var i = 0; i < 80; i += 1) {
  15667. var tl
  15668. var tr
  15669. if (i < 16) {
  15670. tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i])
  15671. tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i])
  15672. } else if (i < 32) {
  15673. tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i])
  15674. tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i])
  15675. } else if (i < 48) {
  15676. tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i])
  15677. tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i])
  15678. } else if (i < 64) {
  15679. tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i])
  15680. tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i])
  15681. } else { // if (i<80) {
  15682. tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i])
  15683. tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i])
  15684. }
  15685. al = el
  15686. el = dl
  15687. dl = rotl(cl, 10)
  15688. cl = bl
  15689. bl = tl
  15690. ar = er
  15691. er = dr
  15692. dr = rotl(cr, 10)
  15693. cr = br
  15694. br = tr
  15695. }
  15696. // update state
  15697. var t = (this._b + cl + dr) | 0
  15698. this._b = (this._c + dl + er) | 0
  15699. this._c = (this._d + el + ar) | 0
  15700. this._d = (this._e + al + br) | 0
  15701. this._e = (this._a + bl + cr) | 0
  15702. this._a = t
  15703. }
  15704. RIPEMD160.prototype._digest = function () {
  15705. // create padding and handle blocks
  15706. this._block[this._blockOffset++] = 0x80
  15707. if (this._blockOffset > 56) {
  15708. this._block.fill(0, this._blockOffset, 64)
  15709. this._update()
  15710. this._blockOffset = 0
  15711. }
  15712. this._block.fill(0, this._blockOffset, 56)
  15713. this._block.writeUInt32LE(this._length[0], 56)
  15714. this._block.writeUInt32LE(this._length[1], 60)
  15715. this._update()
  15716. // produce result
  15717. var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20)
  15718. buffer.writeInt32LE(this._a, 0)
  15719. buffer.writeInt32LE(this._b, 4)
  15720. buffer.writeInt32LE(this._c, 8)
  15721. buffer.writeInt32LE(this._d, 12)
  15722. buffer.writeInt32LE(this._e, 16)
  15723. return buffer
  15724. }
  15725. function rotl (x, n) {
  15726. return (x << n) | (x >>> (32 - n))
  15727. }
  15728. function fn1 (a, b, c, d, e, m, k, s) {
  15729. return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0
  15730. }
  15731. function fn2 (a, b, c, d, e, m, k, s) {
  15732. return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0
  15733. }
  15734. function fn3 (a, b, c, d, e, m, k, s) {
  15735. return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0
  15736. }
  15737. function fn4 (a, b, c, d, e, m, k, s) {
  15738. return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0
  15739. }
  15740. function fn5 (a, b, c, d, e, m, k, s) {
  15741. return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0
  15742. }
  15743. module.exports = RIPEMD160
  15744. /***/ }),
  15745. /* 60 */
  15746. /*!**************************************!*\
  15747. !*** ./node_modules/sha.js/index.js ***!
  15748. \**************************************/
  15749. /*! no static exports found */
  15750. /***/ (function(module, exports, __webpack_require__) {
  15751. var exports = module.exports = function SHA (algorithm) {
  15752. algorithm = algorithm.toLowerCase()
  15753. var Algorithm = exports[algorithm]
  15754. if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
  15755. return new Algorithm()
  15756. }
  15757. exports.sha = __webpack_require__(/*! ./sha */ 61)
  15758. exports.sha1 = __webpack_require__(/*! ./sha1 */ 63)
  15759. exports.sha224 = __webpack_require__(/*! ./sha224 */ 64)
  15760. exports.sha256 = __webpack_require__(/*! ./sha256 */ 65)
  15761. exports.sha384 = __webpack_require__(/*! ./sha384 */ 66)
  15762. exports.sha512 = __webpack_require__(/*! ./sha512 */ 67)
  15763. /***/ }),
  15764. /* 61 */
  15765. /*!************************************!*\
  15766. !*** ./node_modules/sha.js/sha.js ***!
  15767. \************************************/
  15768. /*! no static exports found */
  15769. /***/ (function(module, exports, __webpack_require__) {
  15770. /*
  15771. * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
  15772. * in FIPS PUB 180-1
  15773. * This source code is derived from sha1.js of the same repository.
  15774. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
  15775. * operation was added.
  15776. */
  15777. var inherits = __webpack_require__(/*! inherits */ 40)
  15778. var Hash = __webpack_require__(/*! ./hash */ 62)
  15779. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  15780. var K = [
  15781. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  15782. ]
  15783. var W = new Array(80)
  15784. function Sha () {
  15785. this.init()
  15786. this._w = W
  15787. Hash.call(this, 64, 56)
  15788. }
  15789. inherits(Sha, Hash)
  15790. Sha.prototype.init = function () {
  15791. this._a = 0x67452301
  15792. this._b = 0xefcdab89
  15793. this._c = 0x98badcfe
  15794. this._d = 0x10325476
  15795. this._e = 0xc3d2e1f0
  15796. return this
  15797. }
  15798. function rotl5 (num) {
  15799. return (num << 5) | (num >>> 27)
  15800. }
  15801. function rotl30 (num) {
  15802. return (num << 30) | (num >>> 2)
  15803. }
  15804. function ft (s, b, c, d) {
  15805. if (s === 0) return (b & c) | ((~b) & d)
  15806. if (s === 2) return (b & c) | (b & d) | (c & d)
  15807. return b ^ c ^ d
  15808. }
  15809. Sha.prototype._update = function (M) {
  15810. var W = this._w
  15811. var a = this._a | 0
  15812. var b = this._b | 0
  15813. var c = this._c | 0
  15814. var d = this._d | 0
  15815. var e = this._e | 0
  15816. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  15817. for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
  15818. for (var j = 0; j < 80; ++j) {
  15819. var s = ~~(j / 20)
  15820. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  15821. e = d
  15822. d = c
  15823. c = rotl30(b)
  15824. b = a
  15825. a = t
  15826. }
  15827. this._a = (a + this._a) | 0
  15828. this._b = (b + this._b) | 0
  15829. this._c = (c + this._c) | 0
  15830. this._d = (d + this._d) | 0
  15831. this._e = (e + this._e) | 0
  15832. }
  15833. Sha.prototype._hash = function () {
  15834. var H = Buffer.allocUnsafe(20)
  15835. H.writeInt32BE(this._a | 0, 0)
  15836. H.writeInt32BE(this._b | 0, 4)
  15837. H.writeInt32BE(this._c | 0, 8)
  15838. H.writeInt32BE(this._d | 0, 12)
  15839. H.writeInt32BE(this._e | 0, 16)
  15840. return H
  15841. }
  15842. module.exports = Sha
  15843. /***/ }),
  15844. /* 62 */
  15845. /*!*************************************!*\
  15846. !*** ./node_modules/sha.js/hash.js ***!
  15847. \*************************************/
  15848. /*! no static exports found */
  15849. /***/ (function(module, exports, __webpack_require__) {
  15850. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  15851. // prototype class for hash functions
  15852. function Hash (blockSize, finalSize) {
  15853. this._block = Buffer.alloc(blockSize)
  15854. this._finalSize = finalSize
  15855. this._blockSize = blockSize
  15856. this._len = 0
  15857. }
  15858. Hash.prototype.update = function (data, enc) {
  15859. if (typeof data === 'string') {
  15860. enc = enc || 'utf8'
  15861. data = Buffer.from(data, enc)
  15862. }
  15863. var block = this._block
  15864. var blockSize = this._blockSize
  15865. var length = data.length
  15866. var accum = this._len
  15867. for (var offset = 0; offset < length;) {
  15868. var assigned = accum % blockSize
  15869. var remainder = Math.min(length - offset, blockSize - assigned)
  15870. for (var i = 0; i < remainder; i++) {
  15871. block[assigned + i] = data[offset + i]
  15872. }
  15873. accum += remainder
  15874. offset += remainder
  15875. if ((accum % blockSize) === 0) {
  15876. this._update(block)
  15877. }
  15878. }
  15879. this._len += length
  15880. return this
  15881. }
  15882. Hash.prototype.digest = function (enc) {
  15883. var rem = this._len % this._blockSize
  15884. this._block[rem] = 0x80
  15885. // zero (rem + 1) trailing bits, where (rem + 1) is the smallest
  15886. // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize
  15887. this._block.fill(0, rem + 1)
  15888. if (rem >= this._finalSize) {
  15889. this._update(this._block)
  15890. this._block.fill(0)
  15891. }
  15892. var bits = this._len * 8
  15893. // uint32
  15894. if (bits <= 0xffffffff) {
  15895. this._block.writeUInt32BE(bits, this._blockSize - 4)
  15896. // uint64
  15897. } else {
  15898. var lowBits = (bits & 0xffffffff) >>> 0
  15899. var highBits = (bits - lowBits) / 0x100000000
  15900. this._block.writeUInt32BE(highBits, this._blockSize - 8)
  15901. this._block.writeUInt32BE(lowBits, this._blockSize - 4)
  15902. }
  15903. this._update(this._block)
  15904. var hash = this._hash()
  15905. return enc ? hash.toString(enc) : hash
  15906. }
  15907. Hash.prototype._update = function () {
  15908. throw new Error('_update must be implemented by subclass')
  15909. }
  15910. module.exports = Hash
  15911. /***/ }),
  15912. /* 63 */
  15913. /*!*************************************!*\
  15914. !*** ./node_modules/sha.js/sha1.js ***!
  15915. \*************************************/
  15916. /*! no static exports found */
  15917. /***/ (function(module, exports, __webpack_require__) {
  15918. /*
  15919. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  15920. * in FIPS PUB 180-1
  15921. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  15922. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  15923. * Distributed under the BSD License
  15924. * See http://pajhome.org.uk/crypt/md5 for details.
  15925. */
  15926. var inherits = __webpack_require__(/*! inherits */ 40)
  15927. var Hash = __webpack_require__(/*! ./hash */ 62)
  15928. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  15929. var K = [
  15930. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  15931. ]
  15932. var W = new Array(80)
  15933. function Sha1 () {
  15934. this.init()
  15935. this._w = W
  15936. Hash.call(this, 64, 56)
  15937. }
  15938. inherits(Sha1, Hash)
  15939. Sha1.prototype.init = function () {
  15940. this._a = 0x67452301
  15941. this._b = 0xefcdab89
  15942. this._c = 0x98badcfe
  15943. this._d = 0x10325476
  15944. this._e = 0xc3d2e1f0
  15945. return this
  15946. }
  15947. function rotl1 (num) {
  15948. return (num << 1) | (num >>> 31)
  15949. }
  15950. function rotl5 (num) {
  15951. return (num << 5) | (num >>> 27)
  15952. }
  15953. function rotl30 (num) {
  15954. return (num << 30) | (num >>> 2)
  15955. }
  15956. function ft (s, b, c, d) {
  15957. if (s === 0) return (b & c) | ((~b) & d)
  15958. if (s === 2) return (b & c) | (b & d) | (c & d)
  15959. return b ^ c ^ d
  15960. }
  15961. Sha1.prototype._update = function (M) {
  15962. var W = this._w
  15963. var a = this._a | 0
  15964. var b = this._b | 0
  15965. var c = this._c | 0
  15966. var d = this._d | 0
  15967. var e = this._e | 0
  15968. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  15969. for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
  15970. for (var j = 0; j < 80; ++j) {
  15971. var s = ~~(j / 20)
  15972. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  15973. e = d
  15974. d = c
  15975. c = rotl30(b)
  15976. b = a
  15977. a = t
  15978. }
  15979. this._a = (a + this._a) | 0
  15980. this._b = (b + this._b) | 0
  15981. this._c = (c + this._c) | 0
  15982. this._d = (d + this._d) | 0
  15983. this._e = (e + this._e) | 0
  15984. }
  15985. Sha1.prototype._hash = function () {
  15986. var H = Buffer.allocUnsafe(20)
  15987. H.writeInt32BE(this._a | 0, 0)
  15988. H.writeInt32BE(this._b | 0, 4)
  15989. H.writeInt32BE(this._c | 0, 8)
  15990. H.writeInt32BE(this._d | 0, 12)
  15991. H.writeInt32BE(this._e | 0, 16)
  15992. return H
  15993. }
  15994. module.exports = Sha1
  15995. /***/ }),
  15996. /* 64 */
  15997. /*!***************************************!*\
  15998. !*** ./node_modules/sha.js/sha224.js ***!
  15999. \***************************************/
  16000. /*! no static exports found */
  16001. /***/ (function(module, exports, __webpack_require__) {
  16002. /**
  16003. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  16004. * in FIPS 180-2
  16005. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  16006. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  16007. *
  16008. */
  16009. var inherits = __webpack_require__(/*! inherits */ 40)
  16010. var Sha256 = __webpack_require__(/*! ./sha256 */ 65)
  16011. var Hash = __webpack_require__(/*! ./hash */ 62)
  16012. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16013. var W = new Array(64)
  16014. function Sha224 () {
  16015. this.init()
  16016. this._w = W // new Array(64)
  16017. Hash.call(this, 64, 56)
  16018. }
  16019. inherits(Sha224, Sha256)
  16020. Sha224.prototype.init = function () {
  16021. this._a = 0xc1059ed8
  16022. this._b = 0x367cd507
  16023. this._c = 0x3070dd17
  16024. this._d = 0xf70e5939
  16025. this._e = 0xffc00b31
  16026. this._f = 0x68581511
  16027. this._g = 0x64f98fa7
  16028. this._h = 0xbefa4fa4
  16029. return this
  16030. }
  16031. Sha224.prototype._hash = function () {
  16032. var H = Buffer.allocUnsafe(28)
  16033. H.writeInt32BE(this._a, 0)
  16034. H.writeInt32BE(this._b, 4)
  16035. H.writeInt32BE(this._c, 8)
  16036. H.writeInt32BE(this._d, 12)
  16037. H.writeInt32BE(this._e, 16)
  16038. H.writeInt32BE(this._f, 20)
  16039. H.writeInt32BE(this._g, 24)
  16040. return H
  16041. }
  16042. module.exports = Sha224
  16043. /***/ }),
  16044. /* 65 */
  16045. /*!***************************************!*\
  16046. !*** ./node_modules/sha.js/sha256.js ***!
  16047. \***************************************/
  16048. /*! no static exports found */
  16049. /***/ (function(module, exports, __webpack_require__) {
  16050. /**
  16051. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  16052. * in FIPS 180-2
  16053. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  16054. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  16055. *
  16056. */
  16057. var inherits = __webpack_require__(/*! inherits */ 40)
  16058. var Hash = __webpack_require__(/*! ./hash */ 62)
  16059. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16060. var K = [
  16061. 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
  16062. 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
  16063. 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
  16064. 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
  16065. 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
  16066. 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
  16067. 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
  16068. 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
  16069. 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
  16070. 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
  16071. 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
  16072. 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
  16073. 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
  16074. 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
  16075. 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
  16076. 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
  16077. ]
  16078. var W = new Array(64)
  16079. function Sha256 () {
  16080. this.init()
  16081. this._w = W // new Array(64)
  16082. Hash.call(this, 64, 56)
  16083. }
  16084. inherits(Sha256, Hash)
  16085. Sha256.prototype.init = function () {
  16086. this._a = 0x6a09e667
  16087. this._b = 0xbb67ae85
  16088. this._c = 0x3c6ef372
  16089. this._d = 0xa54ff53a
  16090. this._e = 0x510e527f
  16091. this._f = 0x9b05688c
  16092. this._g = 0x1f83d9ab
  16093. this._h = 0x5be0cd19
  16094. return this
  16095. }
  16096. function ch (x, y, z) {
  16097. return z ^ (x & (y ^ z))
  16098. }
  16099. function maj (x, y, z) {
  16100. return (x & y) | (z & (x | y))
  16101. }
  16102. function sigma0 (x) {
  16103. return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
  16104. }
  16105. function sigma1 (x) {
  16106. return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
  16107. }
  16108. function gamma0 (x) {
  16109. return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
  16110. }
  16111. function gamma1 (x) {
  16112. return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
  16113. }
  16114. Sha256.prototype._update = function (M) {
  16115. var W = this._w
  16116. var a = this._a | 0
  16117. var b = this._b | 0
  16118. var c = this._c | 0
  16119. var d = this._d | 0
  16120. var e = this._e | 0
  16121. var f = this._f | 0
  16122. var g = this._g | 0
  16123. var h = this._h | 0
  16124. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  16125. for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
  16126. for (var j = 0; j < 64; ++j) {
  16127. var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
  16128. var T2 = (sigma0(a) + maj(a, b, c)) | 0
  16129. h = g
  16130. g = f
  16131. f = e
  16132. e = (d + T1) | 0
  16133. d = c
  16134. c = b
  16135. b = a
  16136. a = (T1 + T2) | 0
  16137. }
  16138. this._a = (a + this._a) | 0
  16139. this._b = (b + this._b) | 0
  16140. this._c = (c + this._c) | 0
  16141. this._d = (d + this._d) | 0
  16142. this._e = (e + this._e) | 0
  16143. this._f = (f + this._f) | 0
  16144. this._g = (g + this._g) | 0
  16145. this._h = (h + this._h) | 0
  16146. }
  16147. Sha256.prototype._hash = function () {
  16148. var H = Buffer.allocUnsafe(32)
  16149. H.writeInt32BE(this._a, 0)
  16150. H.writeInt32BE(this._b, 4)
  16151. H.writeInt32BE(this._c, 8)
  16152. H.writeInt32BE(this._d, 12)
  16153. H.writeInt32BE(this._e, 16)
  16154. H.writeInt32BE(this._f, 20)
  16155. H.writeInt32BE(this._g, 24)
  16156. H.writeInt32BE(this._h, 28)
  16157. return H
  16158. }
  16159. module.exports = Sha256
  16160. /***/ }),
  16161. /* 66 */
  16162. /*!***************************************!*\
  16163. !*** ./node_modules/sha.js/sha384.js ***!
  16164. \***************************************/
  16165. /*! no static exports found */
  16166. /***/ (function(module, exports, __webpack_require__) {
  16167. var inherits = __webpack_require__(/*! inherits */ 40)
  16168. var SHA512 = __webpack_require__(/*! ./sha512 */ 67)
  16169. var Hash = __webpack_require__(/*! ./hash */ 62)
  16170. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16171. var W = new Array(160)
  16172. function Sha384 () {
  16173. this.init()
  16174. this._w = W
  16175. Hash.call(this, 128, 112)
  16176. }
  16177. inherits(Sha384, SHA512)
  16178. Sha384.prototype.init = function () {
  16179. this._ah = 0xcbbb9d5d
  16180. this._bh = 0x629a292a
  16181. this._ch = 0x9159015a
  16182. this._dh = 0x152fecd8
  16183. this._eh = 0x67332667
  16184. this._fh = 0x8eb44a87
  16185. this._gh = 0xdb0c2e0d
  16186. this._hh = 0x47b5481d
  16187. this._al = 0xc1059ed8
  16188. this._bl = 0x367cd507
  16189. this._cl = 0x3070dd17
  16190. this._dl = 0xf70e5939
  16191. this._el = 0xffc00b31
  16192. this._fl = 0x68581511
  16193. this._gl = 0x64f98fa7
  16194. this._hl = 0xbefa4fa4
  16195. return this
  16196. }
  16197. Sha384.prototype._hash = function () {
  16198. var H = Buffer.allocUnsafe(48)
  16199. function writeInt64BE (h, l, offset) {
  16200. H.writeInt32BE(h, offset)
  16201. H.writeInt32BE(l, offset + 4)
  16202. }
  16203. writeInt64BE(this._ah, this._al, 0)
  16204. writeInt64BE(this._bh, this._bl, 8)
  16205. writeInt64BE(this._ch, this._cl, 16)
  16206. writeInt64BE(this._dh, this._dl, 24)
  16207. writeInt64BE(this._eh, this._el, 32)
  16208. writeInt64BE(this._fh, this._fl, 40)
  16209. return H
  16210. }
  16211. module.exports = Sha384
  16212. /***/ }),
  16213. /* 67 */
  16214. /*!***************************************!*\
  16215. !*** ./node_modules/sha.js/sha512.js ***!
  16216. \***************************************/
  16217. /*! no static exports found */
  16218. /***/ (function(module, exports, __webpack_require__) {
  16219. var inherits = __webpack_require__(/*! inherits */ 40)
  16220. var Hash = __webpack_require__(/*! ./hash */ 62)
  16221. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16222. var K = [
  16223. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  16224. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  16225. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  16226. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  16227. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  16228. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  16229. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  16230. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  16231. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  16232. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  16233. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  16234. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  16235. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  16236. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  16237. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  16238. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  16239. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  16240. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  16241. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  16242. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  16243. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  16244. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  16245. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  16246. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  16247. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  16248. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  16249. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  16250. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  16251. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  16252. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  16253. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  16254. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  16255. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  16256. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  16257. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  16258. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  16259. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  16260. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  16261. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  16262. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  16263. ]
  16264. var W = new Array(160)
  16265. function Sha512 () {
  16266. this.init()
  16267. this._w = W
  16268. Hash.call(this, 128, 112)
  16269. }
  16270. inherits(Sha512, Hash)
  16271. Sha512.prototype.init = function () {
  16272. this._ah = 0x6a09e667
  16273. this._bh = 0xbb67ae85
  16274. this._ch = 0x3c6ef372
  16275. this._dh = 0xa54ff53a
  16276. this._eh = 0x510e527f
  16277. this._fh = 0x9b05688c
  16278. this._gh = 0x1f83d9ab
  16279. this._hh = 0x5be0cd19
  16280. this._al = 0xf3bcc908
  16281. this._bl = 0x84caa73b
  16282. this._cl = 0xfe94f82b
  16283. this._dl = 0x5f1d36f1
  16284. this._el = 0xade682d1
  16285. this._fl = 0x2b3e6c1f
  16286. this._gl = 0xfb41bd6b
  16287. this._hl = 0x137e2179
  16288. return this
  16289. }
  16290. function Ch (x, y, z) {
  16291. return z ^ (x & (y ^ z))
  16292. }
  16293. function maj (x, y, z) {
  16294. return (x & y) | (z & (x | y))
  16295. }
  16296. function sigma0 (x, xl) {
  16297. return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
  16298. }
  16299. function sigma1 (x, xl) {
  16300. return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
  16301. }
  16302. function Gamma0 (x, xl) {
  16303. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
  16304. }
  16305. function Gamma0l (x, xl) {
  16306. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
  16307. }
  16308. function Gamma1 (x, xl) {
  16309. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
  16310. }
  16311. function Gamma1l (x, xl) {
  16312. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
  16313. }
  16314. function getCarry (a, b) {
  16315. return (a >>> 0) < (b >>> 0) ? 1 : 0
  16316. }
  16317. Sha512.prototype._update = function (M) {
  16318. var W = this._w
  16319. var ah = this._ah | 0
  16320. var bh = this._bh | 0
  16321. var ch = this._ch | 0
  16322. var dh = this._dh | 0
  16323. var eh = this._eh | 0
  16324. var fh = this._fh | 0
  16325. var gh = this._gh | 0
  16326. var hh = this._hh | 0
  16327. var al = this._al | 0
  16328. var bl = this._bl | 0
  16329. var cl = this._cl | 0
  16330. var dl = this._dl | 0
  16331. var el = this._el | 0
  16332. var fl = this._fl | 0
  16333. var gl = this._gl | 0
  16334. var hl = this._hl | 0
  16335. for (var i = 0; i < 32; i += 2) {
  16336. W[i] = M.readInt32BE(i * 4)
  16337. W[i + 1] = M.readInt32BE(i * 4 + 4)
  16338. }
  16339. for (; i < 160; i += 2) {
  16340. var xh = W[i - 15 * 2]
  16341. var xl = W[i - 15 * 2 + 1]
  16342. var gamma0 = Gamma0(xh, xl)
  16343. var gamma0l = Gamma0l(xl, xh)
  16344. xh = W[i - 2 * 2]
  16345. xl = W[i - 2 * 2 + 1]
  16346. var gamma1 = Gamma1(xh, xl)
  16347. var gamma1l = Gamma1l(xl, xh)
  16348. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  16349. var Wi7h = W[i - 7 * 2]
  16350. var Wi7l = W[i - 7 * 2 + 1]
  16351. var Wi16h = W[i - 16 * 2]
  16352. var Wi16l = W[i - 16 * 2 + 1]
  16353. var Wil = (gamma0l + Wi7l) | 0
  16354. var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
  16355. Wil = (Wil + gamma1l) | 0
  16356. Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
  16357. Wil = (Wil + Wi16l) | 0
  16358. Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
  16359. W[i] = Wih
  16360. W[i + 1] = Wil
  16361. }
  16362. for (var j = 0; j < 160; j += 2) {
  16363. Wih = W[j]
  16364. Wil = W[j + 1]
  16365. var majh = maj(ah, bh, ch)
  16366. var majl = maj(al, bl, cl)
  16367. var sigma0h = sigma0(ah, al)
  16368. var sigma0l = sigma0(al, ah)
  16369. var sigma1h = sigma1(eh, el)
  16370. var sigma1l = sigma1(el, eh)
  16371. // t1 = h + sigma1 + ch + K[j] + W[j]
  16372. var Kih = K[j]
  16373. var Kil = K[j + 1]
  16374. var chh = Ch(eh, fh, gh)
  16375. var chl = Ch(el, fl, gl)
  16376. var t1l = (hl + sigma1l) | 0
  16377. var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
  16378. t1l = (t1l + chl) | 0
  16379. t1h = (t1h + chh + getCarry(t1l, chl)) | 0
  16380. t1l = (t1l + Kil) | 0
  16381. t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
  16382. t1l = (t1l + Wil) | 0
  16383. t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
  16384. // t2 = sigma0 + maj
  16385. var t2l = (sigma0l + majl) | 0
  16386. var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
  16387. hh = gh
  16388. hl = gl
  16389. gh = fh
  16390. gl = fl
  16391. fh = eh
  16392. fl = el
  16393. el = (dl + t1l) | 0
  16394. eh = (dh + t1h + getCarry(el, dl)) | 0
  16395. dh = ch
  16396. dl = cl
  16397. ch = bh
  16398. cl = bl
  16399. bh = ah
  16400. bl = al
  16401. al = (t1l + t2l) | 0
  16402. ah = (t1h + t2h + getCarry(al, t1l)) | 0
  16403. }
  16404. this._al = (this._al + al) | 0
  16405. this._bl = (this._bl + bl) | 0
  16406. this._cl = (this._cl + cl) | 0
  16407. this._dl = (this._dl + dl) | 0
  16408. this._el = (this._el + el) | 0
  16409. this._fl = (this._fl + fl) | 0
  16410. this._gl = (this._gl + gl) | 0
  16411. this._hl = (this._hl + hl) | 0
  16412. this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
  16413. this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
  16414. this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
  16415. this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
  16416. this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
  16417. this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
  16418. this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
  16419. this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
  16420. }
  16421. Sha512.prototype._hash = function () {
  16422. var H = Buffer.allocUnsafe(64)
  16423. function writeInt64BE (h, l, offset) {
  16424. H.writeInt32BE(h, offset)
  16425. H.writeInt32BE(l, offset + 4)
  16426. }
  16427. writeInt64BE(this._ah, this._al, 0)
  16428. writeInt64BE(this._bh, this._bl, 8)
  16429. writeInt64BE(this._ch, this._cl, 16)
  16430. writeInt64BE(this._dh, this._dl, 24)
  16431. writeInt64BE(this._eh, this._el, 32)
  16432. writeInt64BE(this._fh, this._fl, 40)
  16433. writeInt64BE(this._gh, this._gl, 48)
  16434. writeInt64BE(this._hh, this._hl, 56)
  16435. return H
  16436. }
  16437. module.exports = Sha512
  16438. /***/ }),
  16439. /* 68 */
  16440. /*!*******************************************!*\
  16441. !*** ./node_modules/cipher-base/index.js ***!
  16442. \*******************************************/
  16443. /*! no static exports found */
  16444. /***/ (function(module, exports, __webpack_require__) {
  16445. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16446. var Transform = __webpack_require__(/*! stream */ 69).Transform
  16447. var StringDecoder = __webpack_require__(/*! string_decoder */ 56).StringDecoder
  16448. var inherits = __webpack_require__(/*! inherits */ 40)
  16449. function CipherBase (hashMode) {
  16450. Transform.call(this)
  16451. this.hashMode = typeof hashMode === 'string'
  16452. if (this.hashMode) {
  16453. this[hashMode] = this._finalOrDigest
  16454. } else {
  16455. this.final = this._finalOrDigest
  16456. }
  16457. if (this._final) {
  16458. this.__final = this._final
  16459. this._final = null
  16460. }
  16461. this._decoder = null
  16462. this._encoding = null
  16463. }
  16464. inherits(CipherBase, Transform)
  16465. CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
  16466. if (typeof data === 'string') {
  16467. data = Buffer.from(data, inputEnc)
  16468. }
  16469. var outData = this._update(data)
  16470. if (this.hashMode) return this
  16471. if (outputEnc) {
  16472. outData = this._toString(outData, outputEnc)
  16473. }
  16474. return outData
  16475. }
  16476. CipherBase.prototype.setAutoPadding = function () {}
  16477. CipherBase.prototype.getAuthTag = function () {
  16478. throw new Error('trying to get auth tag in unsupported state')
  16479. }
  16480. CipherBase.prototype.setAuthTag = function () {
  16481. throw new Error('trying to set auth tag in unsupported state')
  16482. }
  16483. CipherBase.prototype.setAAD = function () {
  16484. throw new Error('trying to set aad in unsupported state')
  16485. }
  16486. CipherBase.prototype._transform = function (data, _, next) {
  16487. var err
  16488. try {
  16489. if (this.hashMode) {
  16490. this._update(data)
  16491. } else {
  16492. this.push(this._update(data))
  16493. }
  16494. } catch (e) {
  16495. err = e
  16496. } finally {
  16497. next(err)
  16498. }
  16499. }
  16500. CipherBase.prototype._flush = function (done) {
  16501. var err
  16502. try {
  16503. this.push(this.__final())
  16504. } catch (e) {
  16505. err = e
  16506. }
  16507. done(err)
  16508. }
  16509. CipherBase.prototype._finalOrDigest = function (outputEnc) {
  16510. var outData = this.__final() || Buffer.alloc(0)
  16511. if (outputEnc) {
  16512. outData = this._toString(outData, outputEnc, true)
  16513. }
  16514. return outData
  16515. }
  16516. CipherBase.prototype._toString = function (value, enc, fin) {
  16517. if (!this._decoder) {
  16518. this._decoder = new StringDecoder(enc)
  16519. this._encoding = enc
  16520. }
  16521. if (this._encoding !== enc) throw new Error('can\'t switch encodings')
  16522. var out = this._decoder.write(value)
  16523. if (fin) {
  16524. out += this._decoder.end()
  16525. }
  16526. return out
  16527. }
  16528. module.exports = CipherBase
  16529. /***/ }),
  16530. /* 69 */
  16531. /*!*************************************************!*\
  16532. !*** ./node_modules/stream-browserify/index.js ***!
  16533. \*************************************************/
  16534. /*! no static exports found */
  16535. /***/ (function(module, exports, __webpack_require__) {
  16536. // Copyright Joyent, Inc. and other Node contributors.
  16537. //
  16538. // Permission is hereby granted, free of charge, to any person obtaining a
  16539. // copy of this software and associated documentation files (the
  16540. // "Software"), to deal in the Software without restriction, including
  16541. // without limitation the rights to use, copy, modify, merge, publish,
  16542. // distribute, sublicense, and/or sell copies of the Software, and to permit
  16543. // persons to whom the Software is furnished to do so, subject to the
  16544. // following conditions:
  16545. //
  16546. // The above copyright notice and this permission notice shall be included
  16547. // in all copies or substantial portions of the Software.
  16548. //
  16549. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  16550. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16551. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  16552. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  16553. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16554. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  16555. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  16556. module.exports = Stream;
  16557. var EE = __webpack_require__(/*! events */ 46).EventEmitter;
  16558. var inherits = __webpack_require__(/*! inherits */ 40);
  16559. inherits(Stream, EE);
  16560. Stream.Readable = __webpack_require__(/*! readable-stream/readable.js */ 43);
  16561. Stream.Writable = __webpack_require__(/*! readable-stream/writable.js */ 70);
  16562. Stream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ 71);
  16563. Stream.Transform = __webpack_require__(/*! readable-stream/transform.js */ 72);
  16564. Stream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ 73);
  16565. // Backwards-compat with node 0.4.x
  16566. Stream.Stream = Stream;
  16567. // old-style streams. Note that the pipe method (the only relevant
  16568. // part of this class) is overridden in the Readable class.
  16569. function Stream() {
  16570. EE.call(this);
  16571. }
  16572. Stream.prototype.pipe = function(dest, options) {
  16573. var source = this;
  16574. function ondata(chunk) {
  16575. if (dest.writable) {
  16576. if (false === dest.write(chunk) && source.pause) {
  16577. source.pause();
  16578. }
  16579. }
  16580. }
  16581. source.on('data', ondata);
  16582. function ondrain() {
  16583. if (source.readable && source.resume) {
  16584. source.resume();
  16585. }
  16586. }
  16587. dest.on('drain', ondrain);
  16588. // If the 'end' option is not supplied, dest.end() will be called when
  16589. // source gets the 'end' or 'close' events. Only dest.end() once.
  16590. if (!dest._isStdio && (!options || options.end !== false)) {
  16591. source.on('end', onend);
  16592. source.on('close', onclose);
  16593. }
  16594. var didOnEnd = false;
  16595. function onend() {
  16596. if (didOnEnd) return;
  16597. didOnEnd = true;
  16598. dest.end();
  16599. }
  16600. function onclose() {
  16601. if (didOnEnd) return;
  16602. didOnEnd = true;
  16603. if (typeof dest.destroy === 'function') dest.destroy();
  16604. }
  16605. // don't leave dangling pipes when there are errors.
  16606. function onerror(er) {
  16607. cleanup();
  16608. if (EE.listenerCount(this, 'error') === 0) {
  16609. throw er; // Unhandled stream error in pipe.
  16610. }
  16611. }
  16612. source.on('error', onerror);
  16613. dest.on('error', onerror);
  16614. // remove all the event listeners that were added.
  16615. function cleanup() {
  16616. source.removeListener('data', ondata);
  16617. dest.removeListener('drain', ondrain);
  16618. source.removeListener('end', onend);
  16619. source.removeListener('close', onclose);
  16620. source.removeListener('error', onerror);
  16621. dest.removeListener('error', onerror);
  16622. source.removeListener('end', cleanup);
  16623. source.removeListener('close', cleanup);
  16624. dest.removeListener('close', cleanup);
  16625. }
  16626. source.on('end', cleanup);
  16627. source.on('close', cleanup);
  16628. dest.on('close', cleanup);
  16629. dest.emit('pipe', source);
  16630. // Allow for unix-like usage: A.pipe(B).pipe(C)
  16631. return dest;
  16632. };
  16633. /***/ }),
  16634. /* 70 */
  16635. /*!**********************************************************!*\
  16636. !*** ./node_modules/readable-stream/writable-browser.js ***!
  16637. \**********************************************************/
  16638. /*! no static exports found */
  16639. /***/ (function(module, exports, __webpack_require__) {
  16640. module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ 54);
  16641. /***/ }),
  16642. /* 71 */
  16643. /*!********************************************************!*\
  16644. !*** ./node_modules/readable-stream/duplex-browser.js ***!
  16645. \********************************************************/
  16646. /*! no static exports found */
  16647. /***/ (function(module, exports, __webpack_require__) {
  16648. module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ 53);
  16649. /***/ }),
  16650. /* 72 */
  16651. /*!***************************************************!*\
  16652. !*** ./node_modules/readable-stream/transform.js ***!
  16653. \***************************************************/
  16654. /*! no static exports found */
  16655. /***/ (function(module, exports, __webpack_require__) {
  16656. module.exports = __webpack_require__(/*! ./readable */ 43).Transform
  16657. /***/ }),
  16658. /* 73 */
  16659. /*!*****************************************************!*\
  16660. !*** ./node_modules/readable-stream/passthrough.js ***!
  16661. \*****************************************************/
  16662. /*! no static exports found */
  16663. /***/ (function(module, exports, __webpack_require__) {
  16664. module.exports = __webpack_require__(/*! ./readable */ 43).PassThrough
  16665. /***/ }),
  16666. /* 74 */
  16667. /*!*********************************************!*\
  16668. !*** ./node_modules/create-hmac/browser.js ***!
  16669. \*********************************************/
  16670. /*! no static exports found */
  16671. /***/ (function(module, exports, __webpack_require__) {
  16672. "use strict";
  16673. var inherits = __webpack_require__(/*! inherits */ 40)
  16674. var Legacy = __webpack_require__(/*! ./legacy */ 75)
  16675. var Base = __webpack_require__(/*! cipher-base */ 68)
  16676. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16677. var md5 = __webpack_require__(/*! create-hash/md5 */ 76)
  16678. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 59)
  16679. var sha = __webpack_require__(/*! sha.js */ 60)
  16680. var ZEROS = Buffer.alloc(128)
  16681. function Hmac (alg, key) {
  16682. Base.call(this, 'digest')
  16683. if (typeof key === 'string') {
  16684. key = Buffer.from(key)
  16685. }
  16686. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  16687. this._alg = alg
  16688. this._key = key
  16689. if (key.length > blocksize) {
  16690. var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  16691. key = hash.update(key).digest()
  16692. } else if (key.length < blocksize) {
  16693. key = Buffer.concat([key, ZEROS], blocksize)
  16694. }
  16695. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  16696. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  16697. for (var i = 0; i < blocksize; i++) {
  16698. ipad[i] = key[i] ^ 0x36
  16699. opad[i] = key[i] ^ 0x5C
  16700. }
  16701. this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)
  16702. this._hash.update(ipad)
  16703. }
  16704. inherits(Hmac, Base)
  16705. Hmac.prototype._update = function (data) {
  16706. this._hash.update(data)
  16707. }
  16708. Hmac.prototype._final = function () {
  16709. var h = this._hash.digest()
  16710. var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)
  16711. return hash.update(this._opad).update(h).digest()
  16712. }
  16713. module.exports = function createHmac (alg, key) {
  16714. alg = alg.toLowerCase()
  16715. if (alg === 'rmd160' || alg === 'ripemd160') {
  16716. return new Hmac('rmd160', key)
  16717. }
  16718. if (alg === 'md5') {
  16719. return new Legacy(md5, key)
  16720. }
  16721. return new Hmac(alg, key)
  16722. }
  16723. /***/ }),
  16724. /* 75 */
  16725. /*!********************************************!*\
  16726. !*** ./node_modules/create-hmac/legacy.js ***!
  16727. \********************************************/
  16728. /*! no static exports found */
  16729. /***/ (function(module, exports, __webpack_require__) {
  16730. "use strict";
  16731. var inherits = __webpack_require__(/*! inherits */ 40)
  16732. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16733. var Base = __webpack_require__(/*! cipher-base */ 68)
  16734. var ZEROS = Buffer.alloc(128)
  16735. var blocksize = 64
  16736. function Hmac (alg, key) {
  16737. Base.call(this, 'digest')
  16738. if (typeof key === 'string') {
  16739. key = Buffer.from(key)
  16740. }
  16741. this._alg = alg
  16742. this._key = key
  16743. if (key.length > blocksize) {
  16744. key = alg(key)
  16745. } else if (key.length < blocksize) {
  16746. key = Buffer.concat([key, ZEROS], blocksize)
  16747. }
  16748. var ipad = this._ipad = Buffer.allocUnsafe(blocksize)
  16749. var opad = this._opad = Buffer.allocUnsafe(blocksize)
  16750. for (var i = 0; i < blocksize; i++) {
  16751. ipad[i] = key[i] ^ 0x36
  16752. opad[i] = key[i] ^ 0x5C
  16753. }
  16754. this._hash = [ipad]
  16755. }
  16756. inherits(Hmac, Base)
  16757. Hmac.prototype._update = function (data) {
  16758. this._hash.push(data)
  16759. }
  16760. Hmac.prototype._final = function () {
  16761. var h = this._alg(Buffer.concat(this._hash))
  16762. return this._alg(Buffer.concat([this._opad, h]))
  16763. }
  16764. module.exports = Hmac
  16765. /***/ }),
  16766. /* 76 */
  16767. /*!*****************************************!*\
  16768. !*** ./node_modules/create-hash/md5.js ***!
  16769. \*****************************************/
  16770. /*! no static exports found */
  16771. /***/ (function(module, exports, __webpack_require__) {
  16772. var MD5 = __webpack_require__(/*! md5.js */ 41)
  16773. module.exports = function (buffer) {
  16774. return new MD5().update(buffer).digest()
  16775. }
  16776. /***/ }),
  16777. /* 77 */
  16778. /*!***********************************************!*\
  16779. !*** ./node_modules/browserify-sign/algos.js ***!
  16780. \***********************************************/
  16781. /*! no static exports found */
  16782. /***/ (function(module, exports, __webpack_require__) {
  16783. module.exports = __webpack_require__(/*! ./browser/algorithms.json */ 78)
  16784. /***/ }),
  16785. /* 78 */
  16786. /*!**************************************************************!*\
  16787. !*** ./node_modules/browserify-sign/browser/algorithms.json ***!
  16788. \**************************************************************/
  16789. /*! exports provided: sha224WithRSAEncryption, RSA-SHA224, sha256WithRSAEncryption, RSA-SHA256, sha384WithRSAEncryption, RSA-SHA384, sha512WithRSAEncryption, RSA-SHA512, RSA-SHA1, ecdsa-with-SHA1, sha256, sha224, sha384, sha512, DSA-SHA, DSA-SHA1, DSA, DSA-WITH-SHA224, DSA-SHA224, DSA-WITH-SHA256, DSA-SHA256, DSA-WITH-SHA384, DSA-SHA384, DSA-WITH-SHA512, DSA-SHA512, DSA-RIPEMD160, ripemd160WithRSA, RSA-RIPEMD160, md5WithRSAEncryption, RSA-MD5, default */
  16790. /***/ (function(module) {
  16791. module.exports = JSON.parse("{\"sha224WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"RSA-SHA224\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha224\",\"id\":\"302d300d06096086480165030402040500041c\"},\"sha256WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"RSA-SHA256\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha256\",\"id\":\"3031300d060960864801650304020105000420\"},\"sha384WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"RSA-SHA384\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha384\",\"id\":\"3041300d060960864801650304020205000430\"},\"sha512WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA512\":{\"sign\":\"ecdsa/rsa\",\"hash\":\"sha512\",\"id\":\"3051300d060960864801650304020305000440\"},\"RSA-SHA1\":{\"sign\":\"rsa\",\"hash\":\"sha1\",\"id\":\"3021300906052b0e03021a05000414\"},\"ecdsa-with-SHA1\":{\"sign\":\"ecdsa\",\"hash\":\"sha1\",\"id\":\"\"},\"sha256\":{\"sign\":\"ecdsa\",\"hash\":\"sha256\",\"id\":\"\"},\"sha224\":{\"sign\":\"ecdsa\",\"hash\":\"sha224\",\"id\":\"\"},\"sha384\":{\"sign\":\"ecdsa\",\"hash\":\"sha384\",\"id\":\"\"},\"sha512\":{\"sign\":\"ecdsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-SHA1\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA\":{\"sign\":\"dsa\",\"hash\":\"sha1\",\"id\":\"\"},\"DSA-WITH-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-SHA224\":{\"sign\":\"dsa\",\"hash\":\"sha224\",\"id\":\"\"},\"DSA-WITH-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-SHA256\":{\"sign\":\"dsa\",\"hash\":\"sha256\",\"id\":\"\"},\"DSA-WITH-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-SHA384\":{\"sign\":\"dsa\",\"hash\":\"sha384\",\"id\":\"\"},\"DSA-WITH-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-SHA512\":{\"sign\":\"dsa\",\"hash\":\"sha512\",\"id\":\"\"},\"DSA-RIPEMD160\":{\"sign\":\"dsa\",\"hash\":\"rmd160\",\"id\":\"\"},\"ripemd160WithRSA\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"RSA-RIPEMD160\":{\"sign\":\"rsa\",\"hash\":\"rmd160\",\"id\":\"3021300906052b2403020105000414\"},\"md5WithRSAEncryption\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"},\"RSA-MD5\":{\"sign\":\"rsa\",\"hash\":\"md5\",\"id\":\"3020300c06082a864886f70d020505000410\"}}");
  16792. /***/ }),
  16793. /* 79 */
  16794. /*!****************************************!*\
  16795. !*** ./node_modules/pbkdf2/browser.js ***!
  16796. \****************************************/
  16797. /*! no static exports found */
  16798. /***/ (function(module, exports, __webpack_require__) {
  16799. exports.pbkdf2 = __webpack_require__(/*! ./lib/async */ 80)
  16800. exports.pbkdf2Sync = __webpack_require__(/*! ./lib/sync */ 83)
  16801. /***/ }),
  16802. /* 80 */
  16803. /*!******************************************!*\
  16804. !*** ./node_modules/pbkdf2/lib/async.js ***!
  16805. \******************************************/
  16806. /*! no static exports found */
  16807. /***/ (function(module, exports, __webpack_require__) {
  16808. /* WEBPACK VAR INJECTION */(function(global, process) {var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16809. var checkParameters = __webpack_require__(/*! ./precondition */ 81)
  16810. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 82)
  16811. var sync = __webpack_require__(/*! ./sync */ 83)
  16812. var toBuffer = __webpack_require__(/*! ./to-buffer */ 84)
  16813. var ZERO_BUF
  16814. var subtle = global.crypto && global.crypto.subtle
  16815. var toBrowser = {
  16816. sha: 'SHA-1',
  16817. 'sha-1': 'SHA-1',
  16818. sha1: 'SHA-1',
  16819. sha256: 'SHA-256',
  16820. 'sha-256': 'SHA-256',
  16821. sha384: 'SHA-384',
  16822. 'sha-384': 'SHA-384',
  16823. 'sha-512': 'SHA-512',
  16824. sha512: 'SHA-512'
  16825. }
  16826. var checks = []
  16827. function checkNative (algo) {
  16828. if (global.process && !global.process.browser) {
  16829. return Promise.resolve(false)
  16830. }
  16831. if (!subtle || !subtle.importKey || !subtle.deriveBits) {
  16832. return Promise.resolve(false)
  16833. }
  16834. if (checks[algo] !== undefined) {
  16835. return checks[algo]
  16836. }
  16837. ZERO_BUF = ZERO_BUF || Buffer.alloc(8)
  16838. var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
  16839. .then(function () {
  16840. return true
  16841. }).catch(function () {
  16842. return false
  16843. })
  16844. checks[algo] = prom
  16845. return prom
  16846. }
  16847. function browserPbkdf2 (password, salt, iterations, length, algo) {
  16848. return subtle.importKey(
  16849. 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits']
  16850. ).then(function (key) {
  16851. return subtle.deriveBits({
  16852. name: 'PBKDF2',
  16853. salt: salt,
  16854. iterations: iterations,
  16855. hash: {
  16856. name: algo
  16857. }
  16858. }, key, length << 3)
  16859. }).then(function (res) {
  16860. return Buffer.from(res)
  16861. })
  16862. }
  16863. function resolvePromise (promise, callback) {
  16864. promise.then(function (out) {
  16865. process.nextTick(function () {
  16866. callback(null, out)
  16867. })
  16868. }, function (e) {
  16869. process.nextTick(function () {
  16870. callback(e)
  16871. })
  16872. })
  16873. }
  16874. module.exports = function (password, salt, iterations, keylen, digest, callback) {
  16875. if (typeof digest === 'function') {
  16876. callback = digest
  16877. digest = undefined
  16878. }
  16879. digest = digest || 'sha1'
  16880. var algo = toBrowser[digest.toLowerCase()]
  16881. if (!algo || typeof global.Promise !== 'function') {
  16882. return process.nextTick(function () {
  16883. var out
  16884. try {
  16885. out = sync(password, salt, iterations, keylen, digest)
  16886. } catch (e) {
  16887. return callback(e)
  16888. }
  16889. callback(null, out)
  16890. })
  16891. }
  16892. checkParameters(iterations, keylen)
  16893. password = toBuffer(password, defaultEncoding, 'Password')
  16894. salt = toBuffer(salt, defaultEncoding, 'Salt')
  16895. if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
  16896. resolvePromise(checkNative(algo).then(function (resp) {
  16897. if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)
  16898. return sync(password, salt, iterations, keylen, digest)
  16899. }), callback)
  16900. }
  16901. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 32)))
  16902. /***/ }),
  16903. /* 81 */
  16904. /*!*************************************************!*\
  16905. !*** ./node_modules/pbkdf2/lib/precondition.js ***!
  16906. \*************************************************/
  16907. /*! no static exports found */
  16908. /***/ (function(module, exports) {
  16909. var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
  16910. module.exports = function (iterations, keylen) {
  16911. if (typeof iterations !== 'number') {
  16912. throw new TypeError('Iterations not a number')
  16913. }
  16914. if (iterations < 0) {
  16915. throw new TypeError('Bad iterations')
  16916. }
  16917. if (typeof keylen !== 'number') {
  16918. throw new TypeError('Key length not a number')
  16919. }
  16920. if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
  16921. throw new TypeError('Bad key length')
  16922. }
  16923. }
  16924. /***/ }),
  16925. /* 82 */
  16926. /*!*****************************************************!*\
  16927. !*** ./node_modules/pbkdf2/lib/default-encoding.js ***!
  16928. \*****************************************************/
  16929. /*! no static exports found */
  16930. /***/ (function(module, exports, __webpack_require__) {
  16931. /* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding
  16932. /* istanbul ignore next */
  16933. if (process.browser) {
  16934. defaultEncoding = 'utf-8'
  16935. } else if (process.version) {
  16936. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  16937. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  16938. } else {
  16939. defaultEncoding = 'utf-8'
  16940. }
  16941. module.exports = defaultEncoding
  16942. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ 32)))
  16943. /***/ }),
  16944. /* 83 */
  16945. /*!*************************************************!*\
  16946. !*** ./node_modules/pbkdf2/lib/sync-browser.js ***!
  16947. \*************************************************/
  16948. /*! no static exports found */
  16949. /***/ (function(module, exports, __webpack_require__) {
  16950. var md5 = __webpack_require__(/*! create-hash/md5 */ 76)
  16951. var RIPEMD160 = __webpack_require__(/*! ripemd160 */ 59)
  16952. var sha = __webpack_require__(/*! sha.js */ 60)
  16953. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  16954. var checkParameters = __webpack_require__(/*! ./precondition */ 81)
  16955. var defaultEncoding = __webpack_require__(/*! ./default-encoding */ 82)
  16956. var toBuffer = __webpack_require__(/*! ./to-buffer */ 84)
  16957. var ZEROS = Buffer.alloc(128)
  16958. var sizes = {
  16959. md5: 16,
  16960. sha1: 20,
  16961. sha224: 28,
  16962. sha256: 32,
  16963. sha384: 48,
  16964. sha512: 64,
  16965. rmd160: 20,
  16966. ripemd160: 20
  16967. }
  16968. function Hmac (alg, key, saltLen) {
  16969. var hash = getDigest(alg)
  16970. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  16971. if (key.length > blocksize) {
  16972. key = hash(key)
  16973. } else if (key.length < blocksize) {
  16974. key = Buffer.concat([key, ZEROS], blocksize)
  16975. }
  16976. var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])
  16977. var opad = Buffer.allocUnsafe(blocksize + sizes[alg])
  16978. for (var i = 0; i < blocksize; i++) {
  16979. ipad[i] = key[i] ^ 0x36
  16980. opad[i] = key[i] ^ 0x5C
  16981. }
  16982. var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)
  16983. ipad.copy(ipad1, 0, 0, blocksize)
  16984. this.ipad1 = ipad1
  16985. this.ipad2 = ipad
  16986. this.opad = opad
  16987. this.alg = alg
  16988. this.blocksize = blocksize
  16989. this.hash = hash
  16990. this.size = sizes[alg]
  16991. }
  16992. Hmac.prototype.run = function (data, ipad) {
  16993. data.copy(ipad, this.blocksize)
  16994. var h = this.hash(ipad)
  16995. h.copy(this.opad, this.blocksize)
  16996. return this.hash(this.opad)
  16997. }
  16998. function getDigest (alg) {
  16999. function shaFunc (data) {
  17000. return sha(alg).update(data).digest()
  17001. }
  17002. function rmd160Func (data) {
  17003. return new RIPEMD160().update(data).digest()
  17004. }
  17005. if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func
  17006. if (alg === 'md5') return md5
  17007. return shaFunc
  17008. }
  17009. function pbkdf2 (password, salt, iterations, keylen, digest) {
  17010. checkParameters(iterations, keylen)
  17011. password = toBuffer(password, defaultEncoding, 'Password')
  17012. salt = toBuffer(salt, defaultEncoding, 'Salt')
  17013. digest = digest || 'sha1'
  17014. var hmac = new Hmac(digest, password, salt.length)
  17015. var DK = Buffer.allocUnsafe(keylen)
  17016. var block1 = Buffer.allocUnsafe(salt.length + 4)
  17017. salt.copy(block1, 0, 0, salt.length)
  17018. var destPos = 0
  17019. var hLen = sizes[digest]
  17020. var l = Math.ceil(keylen / hLen)
  17021. for (var i = 1; i <= l; i++) {
  17022. block1.writeUInt32BE(i, salt.length)
  17023. var T = hmac.run(block1, hmac.ipad1)
  17024. var U = T
  17025. for (var j = 1; j < iterations; j++) {
  17026. U = hmac.run(U, hmac.ipad2)
  17027. for (var k = 0; k < hLen; k++) T[k] ^= U[k]
  17028. }
  17029. T.copy(DK, destPos)
  17030. destPos += hLen
  17031. }
  17032. return DK
  17033. }
  17034. module.exports = pbkdf2
  17035. /***/ }),
  17036. /* 84 */
  17037. /*!**********************************************!*\
  17038. !*** ./node_modules/pbkdf2/lib/to-buffer.js ***!
  17039. \**********************************************/
  17040. /*! no static exports found */
  17041. /***/ (function(module, exports, __webpack_require__) {
  17042. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  17043. module.exports = function (thing, encoding, name) {
  17044. if (Buffer.isBuffer(thing)) {
  17045. return thing
  17046. } else if (typeof thing === 'string') {
  17047. return Buffer.from(thing, encoding)
  17048. } else if (ArrayBuffer.isView(thing)) {
  17049. return Buffer.from(thing.buffer)
  17050. } else {
  17051. throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')
  17052. }
  17053. }
  17054. /***/ }),
  17055. /* 85 */
  17056. /*!***************************************************!*\
  17057. !*** ./node_modules/browserify-cipher/browser.js ***!
  17058. \***************************************************/
  17059. /*! no static exports found */
  17060. /***/ (function(module, exports, __webpack_require__) {
  17061. var DES = __webpack_require__(/*! browserify-des */ 86)
  17062. var aes = __webpack_require__(/*! browserify-aes/browser */ 94)
  17063. var aesModes = __webpack_require__(/*! browserify-aes/modes */ 96)
  17064. var desModes = __webpack_require__(/*! browserify-des/modes */ 113)
  17065. var ebtk = __webpack_require__(/*! evp_bytestokey */ 111)
  17066. function createCipher (suite, password) {
  17067. suite = suite.toLowerCase()
  17068. var keyLen, ivLen
  17069. if (aesModes[suite]) {
  17070. keyLen = aesModes[suite].key
  17071. ivLen = aesModes[suite].iv
  17072. } else if (desModes[suite]) {
  17073. keyLen = desModes[suite].key * 8
  17074. ivLen = desModes[suite].iv
  17075. } else {
  17076. throw new TypeError('invalid suite type')
  17077. }
  17078. var keys = ebtk(password, false, keyLen, ivLen)
  17079. return createCipheriv(suite, keys.key, keys.iv)
  17080. }
  17081. function createDecipher (suite, password) {
  17082. suite = suite.toLowerCase()
  17083. var keyLen, ivLen
  17084. if (aesModes[suite]) {
  17085. keyLen = aesModes[suite].key
  17086. ivLen = aesModes[suite].iv
  17087. } else if (desModes[suite]) {
  17088. keyLen = desModes[suite].key * 8
  17089. ivLen = desModes[suite].iv
  17090. } else {
  17091. throw new TypeError('invalid suite type')
  17092. }
  17093. var keys = ebtk(password, false, keyLen, ivLen)
  17094. return createDecipheriv(suite, keys.key, keys.iv)
  17095. }
  17096. function createCipheriv (suite, key, iv) {
  17097. suite = suite.toLowerCase()
  17098. if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)
  17099. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })
  17100. throw new TypeError('invalid suite type')
  17101. }
  17102. function createDecipheriv (suite, key, iv) {
  17103. suite = suite.toLowerCase()
  17104. if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)
  17105. if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })
  17106. throw new TypeError('invalid suite type')
  17107. }
  17108. function getCiphers () {
  17109. return Object.keys(desModes).concat(aes.getCiphers())
  17110. }
  17111. exports.createCipher = exports.Cipher = createCipher
  17112. exports.createCipheriv = exports.Cipheriv = createCipheriv
  17113. exports.createDecipher = exports.Decipher = createDecipher
  17114. exports.createDecipheriv = exports.Decipheriv = createDecipheriv
  17115. exports.listCiphers = exports.getCiphers = getCiphers
  17116. /***/ }),
  17117. /* 86 */
  17118. /*!**********************************************!*\
  17119. !*** ./node_modules/browserify-des/index.js ***!
  17120. \**********************************************/
  17121. /*! no static exports found */
  17122. /***/ (function(module, exports, __webpack_require__) {
  17123. var CipherBase = __webpack_require__(/*! cipher-base */ 68)
  17124. var des = __webpack_require__(/*! des.js */ 87)
  17125. var inherits = __webpack_require__(/*! inherits */ 40)
  17126. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  17127. var modes = {
  17128. 'des-ede3-cbc': des.CBC.instantiate(des.EDE),
  17129. 'des-ede3': des.EDE,
  17130. 'des-ede-cbc': des.CBC.instantiate(des.EDE),
  17131. 'des-ede': des.EDE,
  17132. 'des-cbc': des.CBC.instantiate(des.DES),
  17133. 'des-ecb': des.DES
  17134. }
  17135. modes.des = modes['des-cbc']
  17136. modes.des3 = modes['des-ede3-cbc']
  17137. module.exports = DES
  17138. inherits(DES, CipherBase)
  17139. function DES (opts) {
  17140. CipherBase.call(this)
  17141. var modeName = opts.mode.toLowerCase()
  17142. var mode = modes[modeName]
  17143. var type
  17144. if (opts.decrypt) {
  17145. type = 'decrypt'
  17146. } else {
  17147. type = 'encrypt'
  17148. }
  17149. var key = opts.key
  17150. if (!Buffer.isBuffer(key)) {
  17151. key = Buffer.from(key)
  17152. }
  17153. if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {
  17154. key = Buffer.concat([key, key.slice(0, 8)])
  17155. }
  17156. var iv = opts.iv
  17157. if (!Buffer.isBuffer(iv)) {
  17158. iv = Buffer.from(iv)
  17159. }
  17160. this._des = mode.create({
  17161. key: key,
  17162. iv: iv,
  17163. type: type
  17164. })
  17165. }
  17166. DES.prototype._update = function (data) {
  17167. return Buffer.from(this._des.update(data))
  17168. }
  17169. DES.prototype._final = function () {
  17170. return Buffer.from(this._des.final())
  17171. }
  17172. /***/ }),
  17173. /* 87 */
  17174. /*!****************************************!*\
  17175. !*** ./node_modules/des.js/lib/des.js ***!
  17176. \****************************************/
  17177. /*! no static exports found */
  17178. /***/ (function(module, exports, __webpack_require__) {
  17179. "use strict";
  17180. exports.utils = __webpack_require__(/*! ./des/utils */ 88);
  17181. exports.Cipher = __webpack_require__(/*! ./des/cipher */ 89);
  17182. exports.DES = __webpack_require__(/*! ./des/des */ 91);
  17183. exports.CBC = __webpack_require__(/*! ./des/cbc */ 92);
  17184. exports.EDE = __webpack_require__(/*! ./des/ede */ 93);
  17185. /***/ }),
  17186. /* 88 */
  17187. /*!**********************************************!*\
  17188. !*** ./node_modules/des.js/lib/des/utils.js ***!
  17189. \**********************************************/
  17190. /*! no static exports found */
  17191. /***/ (function(module, exports, __webpack_require__) {
  17192. "use strict";
  17193. exports.readUInt32BE = function readUInt32BE(bytes, off) {
  17194. var res = (bytes[0 + off] << 24) |
  17195. (bytes[1 + off] << 16) |
  17196. (bytes[2 + off] << 8) |
  17197. bytes[3 + off];
  17198. return res >>> 0;
  17199. };
  17200. exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
  17201. bytes[0 + off] = value >>> 24;
  17202. bytes[1 + off] = (value >>> 16) & 0xff;
  17203. bytes[2 + off] = (value >>> 8) & 0xff;
  17204. bytes[3 + off] = value & 0xff;
  17205. };
  17206. exports.ip = function ip(inL, inR, out, off) {
  17207. var outL = 0;
  17208. var outR = 0;
  17209. for (var i = 6; i >= 0; i -= 2) {
  17210. for (var j = 0; j <= 24; j += 8) {
  17211. outL <<= 1;
  17212. outL |= (inR >>> (j + i)) & 1;
  17213. }
  17214. for (var j = 0; j <= 24; j += 8) {
  17215. outL <<= 1;
  17216. outL |= (inL >>> (j + i)) & 1;
  17217. }
  17218. }
  17219. for (var i = 6; i >= 0; i -= 2) {
  17220. for (var j = 1; j <= 25; j += 8) {
  17221. outR <<= 1;
  17222. outR |= (inR >>> (j + i)) & 1;
  17223. }
  17224. for (var j = 1; j <= 25; j += 8) {
  17225. outR <<= 1;
  17226. outR |= (inL >>> (j + i)) & 1;
  17227. }
  17228. }
  17229. out[off + 0] = outL >>> 0;
  17230. out[off + 1] = outR >>> 0;
  17231. };
  17232. exports.rip = function rip(inL, inR, out, off) {
  17233. var outL = 0;
  17234. var outR = 0;
  17235. for (var i = 0; i < 4; i++) {
  17236. for (var j = 24; j >= 0; j -= 8) {
  17237. outL <<= 1;
  17238. outL |= (inR >>> (j + i)) & 1;
  17239. outL <<= 1;
  17240. outL |= (inL >>> (j + i)) & 1;
  17241. }
  17242. }
  17243. for (var i = 4; i < 8; i++) {
  17244. for (var j = 24; j >= 0; j -= 8) {
  17245. outR <<= 1;
  17246. outR |= (inR >>> (j + i)) & 1;
  17247. outR <<= 1;
  17248. outR |= (inL >>> (j + i)) & 1;
  17249. }
  17250. }
  17251. out[off + 0] = outL >>> 0;
  17252. out[off + 1] = outR >>> 0;
  17253. };
  17254. exports.pc1 = function pc1(inL, inR, out, off) {
  17255. var outL = 0;
  17256. var outR = 0;
  17257. // 7, 15, 23, 31, 39, 47, 55, 63
  17258. // 6, 14, 22, 30, 39, 47, 55, 63
  17259. // 5, 13, 21, 29, 39, 47, 55, 63
  17260. // 4, 12, 20, 28
  17261. for (var i = 7; i >= 5; i--) {
  17262. for (var j = 0; j <= 24; j += 8) {
  17263. outL <<= 1;
  17264. outL |= (inR >> (j + i)) & 1;
  17265. }
  17266. for (var j = 0; j <= 24; j += 8) {
  17267. outL <<= 1;
  17268. outL |= (inL >> (j + i)) & 1;
  17269. }
  17270. }
  17271. for (var j = 0; j <= 24; j += 8) {
  17272. outL <<= 1;
  17273. outL |= (inR >> (j + i)) & 1;
  17274. }
  17275. // 1, 9, 17, 25, 33, 41, 49, 57
  17276. // 2, 10, 18, 26, 34, 42, 50, 58
  17277. // 3, 11, 19, 27, 35, 43, 51, 59
  17278. // 36, 44, 52, 60
  17279. for (var i = 1; i <= 3; i++) {
  17280. for (var j = 0; j <= 24; j += 8) {
  17281. outR <<= 1;
  17282. outR |= (inR >> (j + i)) & 1;
  17283. }
  17284. for (var j = 0; j <= 24; j += 8) {
  17285. outR <<= 1;
  17286. outR |= (inL >> (j + i)) & 1;
  17287. }
  17288. }
  17289. for (var j = 0; j <= 24; j += 8) {
  17290. outR <<= 1;
  17291. outR |= (inL >> (j + i)) & 1;
  17292. }
  17293. out[off + 0] = outL >>> 0;
  17294. out[off + 1] = outR >>> 0;
  17295. };
  17296. exports.r28shl = function r28shl(num, shift) {
  17297. return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));
  17298. };
  17299. var pc2table = [
  17300. // inL => outL
  17301. 14, 11, 17, 4, 27, 23, 25, 0,
  17302. 13, 22, 7, 18, 5, 9, 16, 24,
  17303. 2, 20, 12, 21, 1, 8, 15, 26,
  17304. // inR => outR
  17305. 15, 4, 25, 19, 9, 1, 26, 16,
  17306. 5, 11, 23, 8, 12, 7, 17, 0,
  17307. 22, 3, 10, 14, 6, 20, 27, 24
  17308. ];
  17309. exports.pc2 = function pc2(inL, inR, out, off) {
  17310. var outL = 0;
  17311. var outR = 0;
  17312. var len = pc2table.length >>> 1;
  17313. for (var i = 0; i < len; i++) {
  17314. outL <<= 1;
  17315. outL |= (inL >>> pc2table[i]) & 0x1;
  17316. }
  17317. for (var i = len; i < pc2table.length; i++) {
  17318. outR <<= 1;
  17319. outR |= (inR >>> pc2table[i]) & 0x1;
  17320. }
  17321. out[off + 0] = outL >>> 0;
  17322. out[off + 1] = outR >>> 0;
  17323. };
  17324. exports.expand = function expand(r, out, off) {
  17325. var outL = 0;
  17326. var outR = 0;
  17327. outL = ((r & 1) << 5) | (r >>> 27);
  17328. for (var i = 23; i >= 15; i -= 4) {
  17329. outL <<= 6;
  17330. outL |= (r >>> i) & 0x3f;
  17331. }
  17332. for (var i = 11; i >= 3; i -= 4) {
  17333. outR |= (r >>> i) & 0x3f;
  17334. outR <<= 6;
  17335. }
  17336. outR |= ((r & 0x1f) << 1) | (r >>> 31);
  17337. out[off + 0] = outL >>> 0;
  17338. out[off + 1] = outR >>> 0;
  17339. };
  17340. var sTable = [
  17341. 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
  17342. 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
  17343. 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
  17344. 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,
  17345. 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
  17346. 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
  17347. 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
  17348. 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,
  17349. 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
  17350. 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
  17351. 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
  17352. 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,
  17353. 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
  17354. 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
  17355. 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
  17356. 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,
  17357. 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
  17358. 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
  17359. 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
  17360. 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,
  17361. 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
  17362. 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
  17363. 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
  17364. 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,
  17365. 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
  17366. 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
  17367. 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
  17368. 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,
  17369. 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
  17370. 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
  17371. 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
  17372. 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
  17373. ];
  17374. exports.substitute = function substitute(inL, inR) {
  17375. var out = 0;
  17376. for (var i = 0; i < 4; i++) {
  17377. var b = (inL >>> (18 - i * 6)) & 0x3f;
  17378. var sb = sTable[i * 0x40 + b];
  17379. out <<= 4;
  17380. out |= sb;
  17381. }
  17382. for (var i = 0; i < 4; i++) {
  17383. var b = (inR >>> (18 - i * 6)) & 0x3f;
  17384. var sb = sTable[4 * 0x40 + i * 0x40 + b];
  17385. out <<= 4;
  17386. out |= sb;
  17387. }
  17388. return out >>> 0;
  17389. };
  17390. var permuteTable = [
  17391. 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,
  17392. 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7
  17393. ];
  17394. exports.permute = function permute(num) {
  17395. var out = 0;
  17396. for (var i = 0; i < permuteTable.length; i++) {
  17397. out <<= 1;
  17398. out |= (num >>> permuteTable[i]) & 0x1;
  17399. }
  17400. return out >>> 0;
  17401. };
  17402. exports.padSplit = function padSplit(num, size, group) {
  17403. var str = num.toString(2);
  17404. while (str.length < size)
  17405. str = '0' + str;
  17406. var out = [];
  17407. for (var i = 0; i < size; i += group)
  17408. out.push(str.slice(i, i + group));
  17409. return out.join(' ');
  17410. };
  17411. /***/ }),
  17412. /* 89 */
  17413. /*!***********************************************!*\
  17414. !*** ./node_modules/des.js/lib/des/cipher.js ***!
  17415. \***********************************************/
  17416. /*! no static exports found */
  17417. /***/ (function(module, exports, __webpack_require__) {
  17418. "use strict";
  17419. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  17420. function Cipher(options) {
  17421. this.options = options;
  17422. this.type = this.options.type;
  17423. this.blockSize = 8;
  17424. this._init();
  17425. this.buffer = new Array(this.blockSize);
  17426. this.bufferOff = 0;
  17427. }
  17428. module.exports = Cipher;
  17429. Cipher.prototype._init = function _init() {
  17430. // Might be overrided
  17431. };
  17432. Cipher.prototype.update = function update(data) {
  17433. if (data.length === 0)
  17434. return [];
  17435. if (this.type === 'decrypt')
  17436. return this._updateDecrypt(data);
  17437. else
  17438. return this._updateEncrypt(data);
  17439. };
  17440. Cipher.prototype._buffer = function _buffer(data, off) {
  17441. // Append data to buffer
  17442. var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
  17443. for (var i = 0; i < min; i++)
  17444. this.buffer[this.bufferOff + i] = data[off + i];
  17445. this.bufferOff += min;
  17446. // Shift next
  17447. return min;
  17448. };
  17449. Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
  17450. this._update(this.buffer, 0, out, off);
  17451. this.bufferOff = 0;
  17452. return this.blockSize;
  17453. };
  17454. Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
  17455. var inputOff = 0;
  17456. var outputOff = 0;
  17457. var count = ((this.bufferOff + data.length) / this.blockSize) | 0;
  17458. var out = new Array(count * this.blockSize);
  17459. if (this.bufferOff !== 0) {
  17460. inputOff += this._buffer(data, inputOff);
  17461. if (this.bufferOff === this.buffer.length)
  17462. outputOff += this._flushBuffer(out, outputOff);
  17463. }
  17464. // Write blocks
  17465. var max = data.length - ((data.length - inputOff) % this.blockSize);
  17466. for (; inputOff < max; inputOff += this.blockSize) {
  17467. this._update(data, inputOff, out, outputOff);
  17468. outputOff += this.blockSize;
  17469. }
  17470. // Queue rest
  17471. for (; inputOff < data.length; inputOff++, this.bufferOff++)
  17472. this.buffer[this.bufferOff] = data[inputOff];
  17473. return out;
  17474. };
  17475. Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
  17476. var inputOff = 0;
  17477. var outputOff = 0;
  17478. var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
  17479. var out = new Array(count * this.blockSize);
  17480. // TODO(indutny): optimize it, this is far from optimal
  17481. for (; count > 0; count--) {
  17482. inputOff += this._buffer(data, inputOff);
  17483. outputOff += this._flushBuffer(out, outputOff);
  17484. }
  17485. // Buffer rest of the input
  17486. inputOff += this._buffer(data, inputOff);
  17487. return out;
  17488. };
  17489. Cipher.prototype.final = function final(buffer) {
  17490. var first;
  17491. if (buffer)
  17492. first = this.update(buffer);
  17493. var last;
  17494. if (this.type === 'encrypt')
  17495. last = this._finalEncrypt();
  17496. else
  17497. last = this._finalDecrypt();
  17498. if (first)
  17499. return first.concat(last);
  17500. else
  17501. return last;
  17502. };
  17503. Cipher.prototype._pad = function _pad(buffer, off) {
  17504. if (off === 0)
  17505. return false;
  17506. while (off < buffer.length)
  17507. buffer[off++] = 0;
  17508. return true;
  17509. };
  17510. Cipher.prototype._finalEncrypt = function _finalEncrypt() {
  17511. if (!this._pad(this.buffer, this.bufferOff))
  17512. return [];
  17513. var out = new Array(this.blockSize);
  17514. this._update(this.buffer, 0, out, 0);
  17515. return out;
  17516. };
  17517. Cipher.prototype._unpad = function _unpad(buffer) {
  17518. return buffer;
  17519. };
  17520. Cipher.prototype._finalDecrypt = function _finalDecrypt() {
  17521. assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');
  17522. var out = new Array(this.blockSize);
  17523. this._flushBuffer(out, 0);
  17524. return this._unpad(out);
  17525. };
  17526. /***/ }),
  17527. /* 90 */
  17528. /*!***************************************************!*\
  17529. !*** ./node_modules/minimalistic-assert/index.js ***!
  17530. \***************************************************/
  17531. /*! no static exports found */
  17532. /***/ (function(module, exports) {
  17533. module.exports = assert;
  17534. function assert(val, msg) {
  17535. if (!val)
  17536. throw new Error(msg || 'Assertion failed');
  17537. }
  17538. assert.equal = function assertEqual(l, r, msg) {
  17539. if (l != r)
  17540. throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
  17541. };
  17542. /***/ }),
  17543. /* 91 */
  17544. /*!********************************************!*\
  17545. !*** ./node_modules/des.js/lib/des/des.js ***!
  17546. \********************************************/
  17547. /*! no static exports found */
  17548. /***/ (function(module, exports, __webpack_require__) {
  17549. "use strict";
  17550. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  17551. var inherits = __webpack_require__(/*! inherits */ 40);
  17552. var utils = __webpack_require__(/*! ./utils */ 88);
  17553. var Cipher = __webpack_require__(/*! ./cipher */ 89);
  17554. function DESState() {
  17555. this.tmp = new Array(2);
  17556. this.keys = null;
  17557. }
  17558. function DES(options) {
  17559. Cipher.call(this, options);
  17560. var state = new DESState();
  17561. this._desState = state;
  17562. this.deriveKeys(state, options.key);
  17563. }
  17564. inherits(DES, Cipher);
  17565. module.exports = DES;
  17566. DES.create = function create(options) {
  17567. return new DES(options);
  17568. };
  17569. var shiftTable = [
  17570. 1, 1, 2, 2, 2, 2, 2, 2,
  17571. 1, 2, 2, 2, 2, 2, 2, 1
  17572. ];
  17573. DES.prototype.deriveKeys = function deriveKeys(state, key) {
  17574. state.keys = new Array(16 * 2);
  17575. assert.equal(key.length, this.blockSize, 'Invalid key length');
  17576. var kL = utils.readUInt32BE(key, 0);
  17577. var kR = utils.readUInt32BE(key, 4);
  17578. utils.pc1(kL, kR, state.tmp, 0);
  17579. kL = state.tmp[0];
  17580. kR = state.tmp[1];
  17581. for (var i = 0; i < state.keys.length; i += 2) {
  17582. var shift = shiftTable[i >>> 1];
  17583. kL = utils.r28shl(kL, shift);
  17584. kR = utils.r28shl(kR, shift);
  17585. utils.pc2(kL, kR, state.keys, i);
  17586. }
  17587. };
  17588. DES.prototype._update = function _update(inp, inOff, out, outOff) {
  17589. var state = this._desState;
  17590. var l = utils.readUInt32BE(inp, inOff);
  17591. var r = utils.readUInt32BE(inp, inOff + 4);
  17592. // Initial Permutation
  17593. utils.ip(l, r, state.tmp, 0);
  17594. l = state.tmp[0];
  17595. r = state.tmp[1];
  17596. if (this.type === 'encrypt')
  17597. this._encrypt(state, l, r, state.tmp, 0);
  17598. else
  17599. this._decrypt(state, l, r, state.tmp, 0);
  17600. l = state.tmp[0];
  17601. r = state.tmp[1];
  17602. utils.writeUInt32BE(out, l, outOff);
  17603. utils.writeUInt32BE(out, r, outOff + 4);
  17604. };
  17605. DES.prototype._pad = function _pad(buffer, off) {
  17606. var value = buffer.length - off;
  17607. for (var i = off; i < buffer.length; i++)
  17608. buffer[i] = value;
  17609. return true;
  17610. };
  17611. DES.prototype._unpad = function _unpad(buffer) {
  17612. var pad = buffer[buffer.length - 1];
  17613. for (var i = buffer.length - pad; i < buffer.length; i++)
  17614. assert.equal(buffer[i], pad);
  17615. return buffer.slice(0, buffer.length - pad);
  17616. };
  17617. DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
  17618. var l = lStart;
  17619. var r = rStart;
  17620. // Apply f() x16 times
  17621. for (var i = 0; i < state.keys.length; i += 2) {
  17622. var keyL = state.keys[i];
  17623. var keyR = state.keys[i + 1];
  17624. // f(r, k)
  17625. utils.expand(r, state.tmp, 0);
  17626. keyL ^= state.tmp[0];
  17627. keyR ^= state.tmp[1];
  17628. var s = utils.substitute(keyL, keyR);
  17629. var f = utils.permute(s);
  17630. var t = r;
  17631. r = (l ^ f) >>> 0;
  17632. l = t;
  17633. }
  17634. // Reverse Initial Permutation
  17635. utils.rip(r, l, out, off);
  17636. };
  17637. DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
  17638. var l = rStart;
  17639. var r = lStart;
  17640. // Apply f() x16 times
  17641. for (var i = state.keys.length - 2; i >= 0; i -= 2) {
  17642. var keyL = state.keys[i];
  17643. var keyR = state.keys[i + 1];
  17644. // f(r, k)
  17645. utils.expand(l, state.tmp, 0);
  17646. keyL ^= state.tmp[0];
  17647. keyR ^= state.tmp[1];
  17648. var s = utils.substitute(keyL, keyR);
  17649. var f = utils.permute(s);
  17650. var t = l;
  17651. l = (r ^ f) >>> 0;
  17652. r = t;
  17653. }
  17654. // Reverse Initial Permutation
  17655. utils.rip(l, r, out, off);
  17656. };
  17657. /***/ }),
  17658. /* 92 */
  17659. /*!********************************************!*\
  17660. !*** ./node_modules/des.js/lib/des/cbc.js ***!
  17661. \********************************************/
  17662. /*! no static exports found */
  17663. /***/ (function(module, exports, __webpack_require__) {
  17664. "use strict";
  17665. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  17666. var inherits = __webpack_require__(/*! inherits */ 40);
  17667. var proto = {};
  17668. function CBCState(iv) {
  17669. assert.equal(iv.length, 8, 'Invalid IV length');
  17670. this.iv = new Array(8);
  17671. for (var i = 0; i < this.iv.length; i++)
  17672. this.iv[i] = iv[i];
  17673. }
  17674. function instantiate(Base) {
  17675. function CBC(options) {
  17676. Base.call(this, options);
  17677. this._cbcInit();
  17678. }
  17679. inherits(CBC, Base);
  17680. var keys = Object.keys(proto);
  17681. for (var i = 0; i < keys.length; i++) {
  17682. var key = keys[i];
  17683. CBC.prototype[key] = proto[key];
  17684. }
  17685. CBC.create = function create(options) {
  17686. return new CBC(options);
  17687. };
  17688. return CBC;
  17689. }
  17690. exports.instantiate = instantiate;
  17691. proto._cbcInit = function _cbcInit() {
  17692. var state = new CBCState(this.options.iv);
  17693. this._cbcState = state;
  17694. };
  17695. proto._update = function _update(inp, inOff, out, outOff) {
  17696. var state = this._cbcState;
  17697. var superProto = this.constructor.super_.prototype;
  17698. var iv = state.iv;
  17699. if (this.type === 'encrypt') {
  17700. for (var i = 0; i < this.blockSize; i++)
  17701. iv[i] ^= inp[inOff + i];
  17702. superProto._update.call(this, iv, 0, out, outOff);
  17703. for (var i = 0; i < this.blockSize; i++)
  17704. iv[i] = out[outOff + i];
  17705. } else {
  17706. superProto._update.call(this, inp, inOff, out, outOff);
  17707. for (var i = 0; i < this.blockSize; i++)
  17708. out[outOff + i] ^= iv[i];
  17709. for (var i = 0; i < this.blockSize; i++)
  17710. iv[i] = inp[inOff + i];
  17711. }
  17712. };
  17713. /***/ }),
  17714. /* 93 */
  17715. /*!********************************************!*\
  17716. !*** ./node_modules/des.js/lib/des/ede.js ***!
  17717. \********************************************/
  17718. /*! no static exports found */
  17719. /***/ (function(module, exports, __webpack_require__) {
  17720. "use strict";
  17721. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  17722. var inherits = __webpack_require__(/*! inherits */ 40);
  17723. var Cipher = __webpack_require__(/*! ./cipher */ 89);
  17724. var DES = __webpack_require__(/*! ./des */ 91);
  17725. function EDEState(type, key) {
  17726. assert.equal(key.length, 24, 'Invalid key length');
  17727. var k1 = key.slice(0, 8);
  17728. var k2 = key.slice(8, 16);
  17729. var k3 = key.slice(16, 24);
  17730. if (type === 'encrypt') {
  17731. this.ciphers = [
  17732. DES.create({ type: 'encrypt', key: k1 }),
  17733. DES.create({ type: 'decrypt', key: k2 }),
  17734. DES.create({ type: 'encrypt', key: k3 })
  17735. ];
  17736. } else {
  17737. this.ciphers = [
  17738. DES.create({ type: 'decrypt', key: k3 }),
  17739. DES.create({ type: 'encrypt', key: k2 }),
  17740. DES.create({ type: 'decrypt', key: k1 })
  17741. ];
  17742. }
  17743. }
  17744. function EDE(options) {
  17745. Cipher.call(this, options);
  17746. var state = new EDEState(this.type, this.options.key);
  17747. this._edeState = state;
  17748. }
  17749. inherits(EDE, Cipher);
  17750. module.exports = EDE;
  17751. EDE.create = function create(options) {
  17752. return new EDE(options);
  17753. };
  17754. EDE.prototype._update = function _update(inp, inOff, out, outOff) {
  17755. var state = this._edeState;
  17756. state.ciphers[0]._update(inp, inOff, out, outOff);
  17757. state.ciphers[1]._update(out, outOff, out, outOff);
  17758. state.ciphers[2]._update(out, outOff, out, outOff);
  17759. };
  17760. EDE.prototype._pad = DES.prototype._pad;
  17761. EDE.prototype._unpad = DES.prototype._unpad;
  17762. /***/ }),
  17763. /* 94 */
  17764. /*!************************************************!*\
  17765. !*** ./node_modules/browserify-aes/browser.js ***!
  17766. \************************************************/
  17767. /*! no static exports found */
  17768. /***/ (function(module, exports, __webpack_require__) {
  17769. var ciphers = __webpack_require__(/*! ./encrypter */ 95)
  17770. var deciphers = __webpack_require__(/*! ./decrypter */ 112)
  17771. var modes = __webpack_require__(/*! ./modes/list.json */ 106)
  17772. function getCiphers () {
  17773. return Object.keys(modes)
  17774. }
  17775. exports.createCipher = exports.Cipher = ciphers.createCipher
  17776. exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv
  17777. exports.createDecipher = exports.Decipher = deciphers.createDecipher
  17778. exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv
  17779. exports.listCiphers = exports.getCiphers = getCiphers
  17780. /***/ }),
  17781. /* 95 */
  17782. /*!**************************************************!*\
  17783. !*** ./node_modules/browserify-aes/encrypter.js ***!
  17784. \**************************************************/
  17785. /*! no static exports found */
  17786. /***/ (function(module, exports, __webpack_require__) {
  17787. var MODES = __webpack_require__(/*! ./modes */ 96)
  17788. var AuthCipher = __webpack_require__(/*! ./authCipher */ 107)
  17789. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  17790. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 110)
  17791. var Transform = __webpack_require__(/*! cipher-base */ 68)
  17792. var aes = __webpack_require__(/*! ./aes */ 108)
  17793. var ebtk = __webpack_require__(/*! evp_bytestokey */ 111)
  17794. var inherits = __webpack_require__(/*! inherits */ 40)
  17795. function Cipher (mode, key, iv) {
  17796. Transform.call(this)
  17797. this._cache = new Splitter()
  17798. this._cipher = new aes.AES(key)
  17799. this._prev = Buffer.from(iv)
  17800. this._mode = mode
  17801. this._autopadding = true
  17802. }
  17803. inherits(Cipher, Transform)
  17804. Cipher.prototype._update = function (data) {
  17805. this._cache.add(data)
  17806. var chunk
  17807. var thing
  17808. var out = []
  17809. while ((chunk = this._cache.get())) {
  17810. thing = this._mode.encrypt(this, chunk)
  17811. out.push(thing)
  17812. }
  17813. return Buffer.concat(out)
  17814. }
  17815. var PADDING = Buffer.alloc(16, 0x10)
  17816. Cipher.prototype._final = function () {
  17817. var chunk = this._cache.flush()
  17818. if (this._autopadding) {
  17819. chunk = this._mode.encrypt(this, chunk)
  17820. this._cipher.scrub()
  17821. return chunk
  17822. }
  17823. if (!chunk.equals(PADDING)) {
  17824. this._cipher.scrub()
  17825. throw new Error('data not multiple of block length')
  17826. }
  17827. }
  17828. Cipher.prototype.setAutoPadding = function (setTo) {
  17829. this._autopadding = !!setTo
  17830. return this
  17831. }
  17832. function Splitter () {
  17833. this.cache = Buffer.allocUnsafe(0)
  17834. }
  17835. Splitter.prototype.add = function (data) {
  17836. this.cache = Buffer.concat([this.cache, data])
  17837. }
  17838. Splitter.prototype.get = function () {
  17839. if (this.cache.length > 15) {
  17840. var out = this.cache.slice(0, 16)
  17841. this.cache = this.cache.slice(16)
  17842. return out
  17843. }
  17844. return null
  17845. }
  17846. Splitter.prototype.flush = function () {
  17847. var len = 16 - this.cache.length
  17848. var padBuff = Buffer.allocUnsafe(len)
  17849. var i = -1
  17850. while (++i < len) {
  17851. padBuff.writeUInt8(len, i)
  17852. }
  17853. return Buffer.concat([this.cache, padBuff])
  17854. }
  17855. function createCipheriv (suite, password, iv) {
  17856. var config = MODES[suite.toLowerCase()]
  17857. if (!config) throw new TypeError('invalid suite type')
  17858. if (typeof password === 'string') password = Buffer.from(password)
  17859. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  17860. if (typeof iv === 'string') iv = Buffer.from(iv)
  17861. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  17862. if (config.type === 'stream') {
  17863. return new StreamCipher(config.module, password, iv)
  17864. } else if (config.type === 'auth') {
  17865. return new AuthCipher(config.module, password, iv)
  17866. }
  17867. return new Cipher(config.module, password, iv)
  17868. }
  17869. function createCipher (suite, password) {
  17870. var config = MODES[suite.toLowerCase()]
  17871. if (!config) throw new TypeError('invalid suite type')
  17872. var keys = ebtk(password, false, config.key, config.iv)
  17873. return createCipheriv(suite, keys.key, keys.iv)
  17874. }
  17875. exports.createCipheriv = createCipheriv
  17876. exports.createCipher = createCipher
  17877. /***/ }),
  17878. /* 96 */
  17879. /*!****************************************************!*\
  17880. !*** ./node_modules/browserify-aes/modes/index.js ***!
  17881. \****************************************************/
  17882. /*! no static exports found */
  17883. /***/ (function(module, exports, __webpack_require__) {
  17884. var modeModules = {
  17885. ECB: __webpack_require__(/*! ./ecb */ 97),
  17886. CBC: __webpack_require__(/*! ./cbc */ 98),
  17887. CFB: __webpack_require__(/*! ./cfb */ 100),
  17888. CFB8: __webpack_require__(/*! ./cfb8 */ 101),
  17889. CFB1: __webpack_require__(/*! ./cfb1 */ 102),
  17890. OFB: __webpack_require__(/*! ./ofb */ 103),
  17891. CTR: __webpack_require__(/*! ./ctr */ 104),
  17892. GCM: __webpack_require__(/*! ./ctr */ 104)
  17893. }
  17894. var modes = __webpack_require__(/*! ./list.json */ 106)
  17895. for (var key in modes) {
  17896. modes[key].module = modeModules[modes[key].mode]
  17897. }
  17898. module.exports = modes
  17899. /***/ }),
  17900. /* 97 */
  17901. /*!**************************************************!*\
  17902. !*** ./node_modules/browserify-aes/modes/ecb.js ***!
  17903. \**************************************************/
  17904. /*! no static exports found */
  17905. /***/ (function(module, exports) {
  17906. exports.encrypt = function (self, block) {
  17907. return self._cipher.encryptBlock(block)
  17908. }
  17909. exports.decrypt = function (self, block) {
  17910. return self._cipher.decryptBlock(block)
  17911. }
  17912. /***/ }),
  17913. /* 98 */
  17914. /*!**************************************************!*\
  17915. !*** ./node_modules/browserify-aes/modes/cbc.js ***!
  17916. \**************************************************/
  17917. /*! no static exports found */
  17918. /***/ (function(module, exports, __webpack_require__) {
  17919. var xor = __webpack_require__(/*! buffer-xor */ 99)
  17920. exports.encrypt = function (self, block) {
  17921. var data = xor(block, self._prev)
  17922. self._prev = self._cipher.encryptBlock(data)
  17923. return self._prev
  17924. }
  17925. exports.decrypt = function (self, block) {
  17926. var pad = self._prev
  17927. self._prev = block
  17928. var out = self._cipher.decryptBlock(block)
  17929. return xor(out, pad)
  17930. }
  17931. /***/ }),
  17932. /* 99 */
  17933. /*!******************************************!*\
  17934. !*** ./node_modules/buffer-xor/index.js ***!
  17935. \******************************************/
  17936. /*! no static exports found */
  17937. /***/ (function(module, exports, __webpack_require__) {
  17938. /* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {
  17939. var length = Math.min(a.length, b.length)
  17940. var buffer = new Buffer(length)
  17941. for (var i = 0; i < length; ++i) {
  17942. buffer[i] = a[i] ^ b[i]
  17943. }
  17944. return buffer
  17945. }
  17946. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 35).Buffer))
  17947. /***/ }),
  17948. /* 100 */
  17949. /*!**************************************************!*\
  17950. !*** ./node_modules/browserify-aes/modes/cfb.js ***!
  17951. \**************************************************/
  17952. /*! no static exports found */
  17953. /***/ (function(module, exports, __webpack_require__) {
  17954. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  17955. var xor = __webpack_require__(/*! buffer-xor */ 99)
  17956. function encryptStart (self, data, decrypt) {
  17957. var len = data.length
  17958. var out = xor(data, self._cache)
  17959. self._cache = self._cache.slice(len)
  17960. self._prev = Buffer.concat([self._prev, decrypt ? data : out])
  17961. return out
  17962. }
  17963. exports.encrypt = function (self, data, decrypt) {
  17964. var out = Buffer.allocUnsafe(0)
  17965. var len
  17966. while (data.length) {
  17967. if (self._cache.length === 0) {
  17968. self._cache = self._cipher.encryptBlock(self._prev)
  17969. self._prev = Buffer.allocUnsafe(0)
  17970. }
  17971. if (self._cache.length <= data.length) {
  17972. len = self._cache.length
  17973. out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])
  17974. data = data.slice(len)
  17975. } else {
  17976. out = Buffer.concat([out, encryptStart(self, data, decrypt)])
  17977. break
  17978. }
  17979. }
  17980. return out
  17981. }
  17982. /***/ }),
  17983. /* 101 */
  17984. /*!***************************************************!*\
  17985. !*** ./node_modules/browserify-aes/modes/cfb8.js ***!
  17986. \***************************************************/
  17987. /*! no static exports found */
  17988. /***/ (function(module, exports, __webpack_require__) {
  17989. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  17990. function encryptByte (self, byteParam, decrypt) {
  17991. var pad = self._cipher.encryptBlock(self._prev)
  17992. var out = pad[0] ^ byteParam
  17993. self._prev = Buffer.concat([
  17994. self._prev.slice(1),
  17995. Buffer.from([decrypt ? byteParam : out])
  17996. ])
  17997. return out
  17998. }
  17999. exports.encrypt = function (self, chunk, decrypt) {
  18000. var len = chunk.length
  18001. var out = Buffer.allocUnsafe(len)
  18002. var i = -1
  18003. while (++i < len) {
  18004. out[i] = encryptByte(self, chunk[i], decrypt)
  18005. }
  18006. return out
  18007. }
  18008. /***/ }),
  18009. /* 102 */
  18010. /*!***************************************************!*\
  18011. !*** ./node_modules/browserify-aes/modes/cfb1.js ***!
  18012. \***************************************************/
  18013. /*! no static exports found */
  18014. /***/ (function(module, exports, __webpack_require__) {
  18015. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18016. function encryptByte (self, byteParam, decrypt) {
  18017. var pad
  18018. var i = -1
  18019. var len = 8
  18020. var out = 0
  18021. var bit, value
  18022. while (++i < len) {
  18023. pad = self._cipher.encryptBlock(self._prev)
  18024. bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0
  18025. value = pad[0] ^ bit
  18026. out += ((value & 0x80) >> (i % 8))
  18027. self._prev = shiftIn(self._prev, decrypt ? bit : value)
  18028. }
  18029. return out
  18030. }
  18031. function shiftIn (buffer, value) {
  18032. var len = buffer.length
  18033. var i = -1
  18034. var out = Buffer.allocUnsafe(buffer.length)
  18035. buffer = Buffer.concat([buffer, Buffer.from([value])])
  18036. while (++i < len) {
  18037. out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)
  18038. }
  18039. return out
  18040. }
  18041. exports.encrypt = function (self, chunk, decrypt) {
  18042. var len = chunk.length
  18043. var out = Buffer.allocUnsafe(len)
  18044. var i = -1
  18045. while (++i < len) {
  18046. out[i] = encryptByte(self, chunk[i], decrypt)
  18047. }
  18048. return out
  18049. }
  18050. /***/ }),
  18051. /* 103 */
  18052. /*!**************************************************!*\
  18053. !*** ./node_modules/browserify-aes/modes/ofb.js ***!
  18054. \**************************************************/
  18055. /*! no static exports found */
  18056. /***/ (function(module, exports, __webpack_require__) {
  18057. /* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(/*! buffer-xor */ 99)
  18058. function getBlock (self) {
  18059. self._prev = self._cipher.encryptBlock(self._prev)
  18060. return self._prev
  18061. }
  18062. exports.encrypt = function (self, chunk) {
  18063. while (self._cache.length < chunk.length) {
  18064. self._cache = Buffer.concat([self._cache, getBlock(self)])
  18065. }
  18066. var pad = self._cache.slice(0, chunk.length)
  18067. self._cache = self._cache.slice(chunk.length)
  18068. return xor(chunk, pad)
  18069. }
  18070. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 35).Buffer))
  18071. /***/ }),
  18072. /* 104 */
  18073. /*!**************************************************!*\
  18074. !*** ./node_modules/browserify-aes/modes/ctr.js ***!
  18075. \**************************************************/
  18076. /*! no static exports found */
  18077. /***/ (function(module, exports, __webpack_require__) {
  18078. var xor = __webpack_require__(/*! buffer-xor */ 99)
  18079. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18080. var incr32 = __webpack_require__(/*! ../incr32 */ 105)
  18081. function getBlock (self) {
  18082. var out = self._cipher.encryptBlockRaw(self._prev)
  18083. incr32(self._prev)
  18084. return out
  18085. }
  18086. var blockSize = 16
  18087. exports.encrypt = function (self, chunk) {
  18088. var chunkNum = Math.ceil(chunk.length / blockSize)
  18089. var start = self._cache.length
  18090. self._cache = Buffer.concat([
  18091. self._cache,
  18092. Buffer.allocUnsafe(chunkNum * blockSize)
  18093. ])
  18094. for (var i = 0; i < chunkNum; i++) {
  18095. var out = getBlock(self)
  18096. var offset = start + i * blockSize
  18097. self._cache.writeUInt32BE(out[0], offset + 0)
  18098. self._cache.writeUInt32BE(out[1], offset + 4)
  18099. self._cache.writeUInt32BE(out[2], offset + 8)
  18100. self._cache.writeUInt32BE(out[3], offset + 12)
  18101. }
  18102. var pad = self._cache.slice(0, chunk.length)
  18103. self._cache = self._cache.slice(chunk.length)
  18104. return xor(chunk, pad)
  18105. }
  18106. /***/ }),
  18107. /* 105 */
  18108. /*!***********************************************!*\
  18109. !*** ./node_modules/browserify-aes/incr32.js ***!
  18110. \***********************************************/
  18111. /*! no static exports found */
  18112. /***/ (function(module, exports) {
  18113. function incr32 (iv) {
  18114. var len = iv.length
  18115. var item
  18116. while (len--) {
  18117. item = iv.readUInt8(len)
  18118. if (item === 255) {
  18119. iv.writeUInt8(0, len)
  18120. } else {
  18121. item++
  18122. iv.writeUInt8(item, len)
  18123. break
  18124. }
  18125. }
  18126. }
  18127. module.exports = incr32
  18128. /***/ }),
  18129. /* 106 */
  18130. /*!*****************************************************!*\
  18131. !*** ./node_modules/browserify-aes/modes/list.json ***!
  18132. \*****************************************************/
  18133. /*! exports provided: aes-128-ecb, aes-192-ecb, aes-256-ecb, aes-128-cbc, aes-192-cbc, aes-256-cbc, aes128, aes192, aes256, aes-128-cfb, aes-192-cfb, aes-256-cfb, aes-128-cfb8, aes-192-cfb8, aes-256-cfb8, aes-128-cfb1, aes-192-cfb1, aes-256-cfb1, aes-128-ofb, aes-192-ofb, aes-256-ofb, aes-128-ctr, aes-192-ctr, aes-256-ctr, aes-128-gcm, aes-192-gcm, aes-256-gcm, default */
  18134. /***/ (function(module) {
  18135. module.exports = JSON.parse("{\"aes-128-ecb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-192-ecb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-256-ecb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":0,\"mode\":\"ECB\",\"type\":\"block\"},\"aes-128-cbc\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-192-cbc\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-256-cbc\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes128\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes192\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes256\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CBC\",\"type\":\"block\"},\"aes-128-cfb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-192-cfb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-256-cfb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB\",\"type\":\"stream\"},\"aes-128-cfb8\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-192-cfb8\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-256-cfb8\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB8\",\"type\":\"stream\"},\"aes-128-cfb1\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-192-cfb1\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-256-cfb1\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CFB1\",\"type\":\"stream\"},\"aes-128-ofb\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-192-ofb\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-256-ofb\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"OFB\",\"type\":\"stream\"},\"aes-128-ctr\":{\"cipher\":\"AES\",\"key\":128,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-192-ctr\":{\"cipher\":\"AES\",\"key\":192,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-256-ctr\":{\"cipher\":\"AES\",\"key\":256,\"iv\":16,\"mode\":\"CTR\",\"type\":\"stream\"},\"aes-128-gcm\":{\"cipher\":\"AES\",\"key\":128,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-192-gcm\":{\"cipher\":\"AES\",\"key\":192,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"},\"aes-256-gcm\":{\"cipher\":\"AES\",\"key\":256,\"iv\":12,\"mode\":\"GCM\",\"type\":\"auth\"}}");
  18136. /***/ }),
  18137. /* 107 */
  18138. /*!***************************************************!*\
  18139. !*** ./node_modules/browserify-aes/authCipher.js ***!
  18140. \***************************************************/
  18141. /*! no static exports found */
  18142. /***/ (function(module, exports, __webpack_require__) {
  18143. var aes = __webpack_require__(/*! ./aes */ 108)
  18144. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18145. var Transform = __webpack_require__(/*! cipher-base */ 68)
  18146. var inherits = __webpack_require__(/*! inherits */ 40)
  18147. var GHASH = __webpack_require__(/*! ./ghash */ 109)
  18148. var xor = __webpack_require__(/*! buffer-xor */ 99)
  18149. var incr32 = __webpack_require__(/*! ./incr32 */ 105)
  18150. function xorTest (a, b) {
  18151. var out = 0
  18152. if (a.length !== b.length) out++
  18153. var len = Math.min(a.length, b.length)
  18154. for (var i = 0; i < len; ++i) {
  18155. out += (a[i] ^ b[i])
  18156. }
  18157. return out
  18158. }
  18159. function calcIv (self, iv, ck) {
  18160. if (iv.length === 12) {
  18161. self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])
  18162. return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])
  18163. }
  18164. var ghash = new GHASH(ck)
  18165. var len = iv.length
  18166. var toPad = len % 16
  18167. ghash.update(iv)
  18168. if (toPad) {
  18169. toPad = 16 - toPad
  18170. ghash.update(Buffer.alloc(toPad, 0))
  18171. }
  18172. ghash.update(Buffer.alloc(8, 0))
  18173. var ivBits = len * 8
  18174. var tail = Buffer.alloc(8)
  18175. tail.writeUIntBE(ivBits, 0, 8)
  18176. ghash.update(tail)
  18177. self._finID = ghash.state
  18178. var out = Buffer.from(self._finID)
  18179. incr32(out)
  18180. return out
  18181. }
  18182. function StreamCipher (mode, key, iv, decrypt) {
  18183. Transform.call(this)
  18184. var h = Buffer.alloc(4, 0)
  18185. this._cipher = new aes.AES(key)
  18186. var ck = this._cipher.encryptBlock(h)
  18187. this._ghash = new GHASH(ck)
  18188. iv = calcIv(this, iv, ck)
  18189. this._prev = Buffer.from(iv)
  18190. this._cache = Buffer.allocUnsafe(0)
  18191. this._secCache = Buffer.allocUnsafe(0)
  18192. this._decrypt = decrypt
  18193. this._alen = 0
  18194. this._len = 0
  18195. this._mode = mode
  18196. this._authTag = null
  18197. this._called = false
  18198. }
  18199. inherits(StreamCipher, Transform)
  18200. StreamCipher.prototype._update = function (chunk) {
  18201. if (!this._called && this._alen) {
  18202. var rump = 16 - (this._alen % 16)
  18203. if (rump < 16) {
  18204. rump = Buffer.alloc(rump, 0)
  18205. this._ghash.update(rump)
  18206. }
  18207. }
  18208. this._called = true
  18209. var out = this._mode.encrypt(this, chunk)
  18210. if (this._decrypt) {
  18211. this._ghash.update(chunk)
  18212. } else {
  18213. this._ghash.update(out)
  18214. }
  18215. this._len += chunk.length
  18216. return out
  18217. }
  18218. StreamCipher.prototype._final = function () {
  18219. if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')
  18220. var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))
  18221. if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')
  18222. this._authTag = tag
  18223. this._cipher.scrub()
  18224. }
  18225. StreamCipher.prototype.getAuthTag = function getAuthTag () {
  18226. if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')
  18227. return this._authTag
  18228. }
  18229. StreamCipher.prototype.setAuthTag = function setAuthTag (tag) {
  18230. if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')
  18231. this._authTag = tag
  18232. }
  18233. StreamCipher.prototype.setAAD = function setAAD (buf) {
  18234. if (this._called) throw new Error('Attempting to set AAD in unsupported state')
  18235. this._ghash.update(buf)
  18236. this._alen += buf.length
  18237. }
  18238. module.exports = StreamCipher
  18239. /***/ }),
  18240. /* 108 */
  18241. /*!********************************************!*\
  18242. !*** ./node_modules/browserify-aes/aes.js ***!
  18243. \********************************************/
  18244. /*! no static exports found */
  18245. /***/ (function(module, exports, __webpack_require__) {
  18246. // based on the aes implimentation in triple sec
  18247. // https://github.com/keybase/triplesec
  18248. // which is in turn based on the one from crypto-js
  18249. // https://code.google.com/p/crypto-js/
  18250. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18251. function asUInt32Array (buf) {
  18252. if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
  18253. var len = (buf.length / 4) | 0
  18254. var out = new Array(len)
  18255. for (var i = 0; i < len; i++) {
  18256. out[i] = buf.readUInt32BE(i * 4)
  18257. }
  18258. return out
  18259. }
  18260. function scrubVec (v) {
  18261. for (var i = 0; i < v.length; v++) {
  18262. v[i] = 0
  18263. }
  18264. }
  18265. function cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {
  18266. var SUB_MIX0 = SUB_MIX[0]
  18267. var SUB_MIX1 = SUB_MIX[1]
  18268. var SUB_MIX2 = SUB_MIX[2]
  18269. var SUB_MIX3 = SUB_MIX[3]
  18270. var s0 = M[0] ^ keySchedule[0]
  18271. var s1 = M[1] ^ keySchedule[1]
  18272. var s2 = M[2] ^ keySchedule[2]
  18273. var s3 = M[3] ^ keySchedule[3]
  18274. var t0, t1, t2, t3
  18275. var ksRow = 4
  18276. for (var round = 1; round < nRounds; round++) {
  18277. t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]
  18278. t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]
  18279. t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]
  18280. t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]
  18281. s0 = t0
  18282. s1 = t1
  18283. s2 = t2
  18284. s3 = t3
  18285. }
  18286. t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]
  18287. t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]
  18288. t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]
  18289. t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]
  18290. t0 = t0 >>> 0
  18291. t1 = t1 >>> 0
  18292. t2 = t2 >>> 0
  18293. t3 = t3 >>> 0
  18294. return [t0, t1, t2, t3]
  18295. }
  18296. // AES constants
  18297. var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]
  18298. var G = (function () {
  18299. // Compute double table
  18300. var d = new Array(256)
  18301. for (var j = 0; j < 256; j++) {
  18302. if (j < 128) {
  18303. d[j] = j << 1
  18304. } else {
  18305. d[j] = (j << 1) ^ 0x11b
  18306. }
  18307. }
  18308. var SBOX = []
  18309. var INV_SBOX = []
  18310. var SUB_MIX = [[], [], [], []]
  18311. var INV_SUB_MIX = [[], [], [], []]
  18312. // Walk GF(2^8)
  18313. var x = 0
  18314. var xi = 0
  18315. for (var i = 0; i < 256; ++i) {
  18316. // Compute sbox
  18317. var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)
  18318. sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63
  18319. SBOX[x] = sx
  18320. INV_SBOX[sx] = x
  18321. // Compute multiplication
  18322. var x2 = d[x]
  18323. var x4 = d[x2]
  18324. var x8 = d[x4]
  18325. // Compute sub bytes, mix columns tables
  18326. var t = (d[sx] * 0x101) ^ (sx * 0x1010100)
  18327. SUB_MIX[0][x] = (t << 24) | (t >>> 8)
  18328. SUB_MIX[1][x] = (t << 16) | (t >>> 16)
  18329. SUB_MIX[2][x] = (t << 8) | (t >>> 24)
  18330. SUB_MIX[3][x] = t
  18331. // Compute inv sub bytes, inv mix columns tables
  18332. t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)
  18333. INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)
  18334. INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)
  18335. INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)
  18336. INV_SUB_MIX[3][sx] = t
  18337. if (x === 0) {
  18338. x = xi = 1
  18339. } else {
  18340. x = x2 ^ d[d[d[x8 ^ x2]]]
  18341. xi ^= d[d[xi]]
  18342. }
  18343. }
  18344. return {
  18345. SBOX: SBOX,
  18346. INV_SBOX: INV_SBOX,
  18347. SUB_MIX: SUB_MIX,
  18348. INV_SUB_MIX: INV_SUB_MIX
  18349. }
  18350. })()
  18351. function AES (key) {
  18352. this._key = asUInt32Array(key)
  18353. this._reset()
  18354. }
  18355. AES.blockSize = 4 * 4
  18356. AES.keySize = 256 / 8
  18357. AES.prototype.blockSize = AES.blockSize
  18358. AES.prototype.keySize = AES.keySize
  18359. AES.prototype._reset = function () {
  18360. var keyWords = this._key
  18361. var keySize = keyWords.length
  18362. var nRounds = keySize + 6
  18363. var ksRows = (nRounds + 1) * 4
  18364. var keySchedule = []
  18365. for (var k = 0; k < keySize; k++) {
  18366. keySchedule[k] = keyWords[k]
  18367. }
  18368. for (k = keySize; k < ksRows; k++) {
  18369. var t = keySchedule[k - 1]
  18370. if (k % keySize === 0) {
  18371. t = (t << 8) | (t >>> 24)
  18372. t =
  18373. (G.SBOX[t >>> 24] << 24) |
  18374. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  18375. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  18376. (G.SBOX[t & 0xff])
  18377. t ^= RCON[(k / keySize) | 0] << 24
  18378. } else if (keySize > 6 && k % keySize === 4) {
  18379. t =
  18380. (G.SBOX[t >>> 24] << 24) |
  18381. (G.SBOX[(t >>> 16) & 0xff] << 16) |
  18382. (G.SBOX[(t >>> 8) & 0xff] << 8) |
  18383. (G.SBOX[t & 0xff])
  18384. }
  18385. keySchedule[k] = keySchedule[k - keySize] ^ t
  18386. }
  18387. var invKeySchedule = []
  18388. for (var ik = 0; ik < ksRows; ik++) {
  18389. var ksR = ksRows - ik
  18390. var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]
  18391. if (ik < 4 || ksR <= 4) {
  18392. invKeySchedule[ik] = tt
  18393. } else {
  18394. invKeySchedule[ik] =
  18395. G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^
  18396. G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^
  18397. G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^
  18398. G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]
  18399. }
  18400. }
  18401. this._nRounds = nRounds
  18402. this._keySchedule = keySchedule
  18403. this._invKeySchedule = invKeySchedule
  18404. }
  18405. AES.prototype.encryptBlockRaw = function (M) {
  18406. M = asUInt32Array(M)
  18407. return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)
  18408. }
  18409. AES.prototype.encryptBlock = function (M) {
  18410. var out = this.encryptBlockRaw(M)
  18411. var buf = Buffer.allocUnsafe(16)
  18412. buf.writeUInt32BE(out[0], 0)
  18413. buf.writeUInt32BE(out[1], 4)
  18414. buf.writeUInt32BE(out[2], 8)
  18415. buf.writeUInt32BE(out[3], 12)
  18416. return buf
  18417. }
  18418. AES.prototype.decryptBlock = function (M) {
  18419. M = asUInt32Array(M)
  18420. // swap
  18421. var m1 = M[1]
  18422. M[1] = M[3]
  18423. M[3] = m1
  18424. var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)
  18425. var buf = Buffer.allocUnsafe(16)
  18426. buf.writeUInt32BE(out[0], 0)
  18427. buf.writeUInt32BE(out[3], 4)
  18428. buf.writeUInt32BE(out[2], 8)
  18429. buf.writeUInt32BE(out[1], 12)
  18430. return buf
  18431. }
  18432. AES.prototype.scrub = function () {
  18433. scrubVec(this._keySchedule)
  18434. scrubVec(this._invKeySchedule)
  18435. scrubVec(this._key)
  18436. }
  18437. module.exports.AES = AES
  18438. /***/ }),
  18439. /* 109 */
  18440. /*!**********************************************!*\
  18441. !*** ./node_modules/browserify-aes/ghash.js ***!
  18442. \**********************************************/
  18443. /*! no static exports found */
  18444. /***/ (function(module, exports, __webpack_require__) {
  18445. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18446. var ZEROES = Buffer.alloc(16, 0)
  18447. function toArray (buf) {
  18448. return [
  18449. buf.readUInt32BE(0),
  18450. buf.readUInt32BE(4),
  18451. buf.readUInt32BE(8),
  18452. buf.readUInt32BE(12)
  18453. ]
  18454. }
  18455. function fromArray (out) {
  18456. var buf = Buffer.allocUnsafe(16)
  18457. buf.writeUInt32BE(out[0] >>> 0, 0)
  18458. buf.writeUInt32BE(out[1] >>> 0, 4)
  18459. buf.writeUInt32BE(out[2] >>> 0, 8)
  18460. buf.writeUInt32BE(out[3] >>> 0, 12)
  18461. return buf
  18462. }
  18463. function GHASH (key) {
  18464. this.h = key
  18465. this.state = Buffer.alloc(16, 0)
  18466. this.cache = Buffer.allocUnsafe(0)
  18467. }
  18468. // from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html
  18469. // by Juho Vähä-Herttua
  18470. GHASH.prototype.ghash = function (block) {
  18471. var i = -1
  18472. while (++i < block.length) {
  18473. this.state[i] ^= block[i]
  18474. }
  18475. this._multiply()
  18476. }
  18477. GHASH.prototype._multiply = function () {
  18478. var Vi = toArray(this.h)
  18479. var Zi = [0, 0, 0, 0]
  18480. var j, xi, lsbVi
  18481. var i = -1
  18482. while (++i < 128) {
  18483. xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0
  18484. if (xi) {
  18485. // Z_i+1 = Z_i ^ V_i
  18486. Zi[0] ^= Vi[0]
  18487. Zi[1] ^= Vi[1]
  18488. Zi[2] ^= Vi[2]
  18489. Zi[3] ^= Vi[3]
  18490. }
  18491. // Store the value of LSB(V_i)
  18492. lsbVi = (Vi[3] & 1) !== 0
  18493. // V_i+1 = V_i >> 1
  18494. for (j = 3; j > 0; j--) {
  18495. Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)
  18496. }
  18497. Vi[0] = Vi[0] >>> 1
  18498. // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R
  18499. if (lsbVi) {
  18500. Vi[0] = Vi[0] ^ (0xe1 << 24)
  18501. }
  18502. }
  18503. this.state = fromArray(Zi)
  18504. }
  18505. GHASH.prototype.update = function (buf) {
  18506. this.cache = Buffer.concat([this.cache, buf])
  18507. var chunk
  18508. while (this.cache.length >= 16) {
  18509. chunk = this.cache.slice(0, 16)
  18510. this.cache = this.cache.slice(16)
  18511. this.ghash(chunk)
  18512. }
  18513. }
  18514. GHASH.prototype.final = function (abl, bl) {
  18515. if (this.cache.length) {
  18516. this.ghash(Buffer.concat([this.cache, ZEROES], 16))
  18517. }
  18518. this.ghash(fromArray([0, abl, 0, bl]))
  18519. return this.state
  18520. }
  18521. module.exports = GHASH
  18522. /***/ }),
  18523. /* 110 */
  18524. /*!*****************************************************!*\
  18525. !*** ./node_modules/browserify-aes/streamCipher.js ***!
  18526. \*****************************************************/
  18527. /*! no static exports found */
  18528. /***/ (function(module, exports, __webpack_require__) {
  18529. var aes = __webpack_require__(/*! ./aes */ 108)
  18530. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18531. var Transform = __webpack_require__(/*! cipher-base */ 68)
  18532. var inherits = __webpack_require__(/*! inherits */ 40)
  18533. function StreamCipher (mode, key, iv, decrypt) {
  18534. Transform.call(this)
  18535. this._cipher = new aes.AES(key)
  18536. this._prev = Buffer.from(iv)
  18537. this._cache = Buffer.allocUnsafe(0)
  18538. this._secCache = Buffer.allocUnsafe(0)
  18539. this._decrypt = decrypt
  18540. this._mode = mode
  18541. }
  18542. inherits(StreamCipher, Transform)
  18543. StreamCipher.prototype._update = function (chunk) {
  18544. return this._mode.encrypt(this, chunk, this._decrypt)
  18545. }
  18546. StreamCipher.prototype._final = function () {
  18547. this._cipher.scrub()
  18548. }
  18549. module.exports = StreamCipher
  18550. /***/ }),
  18551. /* 111 */
  18552. /*!**********************************************!*\
  18553. !*** ./node_modules/evp_bytestokey/index.js ***!
  18554. \**********************************************/
  18555. /*! no static exports found */
  18556. /***/ (function(module, exports, __webpack_require__) {
  18557. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18558. var MD5 = __webpack_require__(/*! md5.js */ 41)
  18559. /* eslint-disable camelcase */
  18560. function EVP_BytesToKey (password, salt, keyBits, ivLen) {
  18561. if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')
  18562. if (salt) {
  18563. if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')
  18564. if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')
  18565. }
  18566. var keyLen = keyBits / 8
  18567. var key = Buffer.alloc(keyLen)
  18568. var iv = Buffer.alloc(ivLen || 0)
  18569. var tmp = Buffer.alloc(0)
  18570. while (keyLen > 0 || ivLen > 0) {
  18571. var hash = new MD5()
  18572. hash.update(tmp)
  18573. hash.update(password)
  18574. if (salt) hash.update(salt)
  18575. tmp = hash.digest()
  18576. var used = 0
  18577. if (keyLen > 0) {
  18578. var keyStart = key.length - keyLen
  18579. used = Math.min(keyLen, tmp.length)
  18580. tmp.copy(key, keyStart, 0, used)
  18581. keyLen -= used
  18582. }
  18583. if (used < tmp.length && ivLen > 0) {
  18584. var ivStart = iv.length - ivLen
  18585. var length = Math.min(ivLen, tmp.length - used)
  18586. tmp.copy(iv, ivStart, used, used + length)
  18587. ivLen -= length
  18588. }
  18589. }
  18590. tmp.fill(0)
  18591. return { key: key, iv: iv }
  18592. }
  18593. module.exports = EVP_BytesToKey
  18594. /***/ }),
  18595. /* 112 */
  18596. /*!**************************************************!*\
  18597. !*** ./node_modules/browserify-aes/decrypter.js ***!
  18598. \**************************************************/
  18599. /*! no static exports found */
  18600. /***/ (function(module, exports, __webpack_require__) {
  18601. var AuthCipher = __webpack_require__(/*! ./authCipher */ 107)
  18602. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  18603. var MODES = __webpack_require__(/*! ./modes */ 96)
  18604. var StreamCipher = __webpack_require__(/*! ./streamCipher */ 110)
  18605. var Transform = __webpack_require__(/*! cipher-base */ 68)
  18606. var aes = __webpack_require__(/*! ./aes */ 108)
  18607. var ebtk = __webpack_require__(/*! evp_bytestokey */ 111)
  18608. var inherits = __webpack_require__(/*! inherits */ 40)
  18609. function Decipher (mode, key, iv) {
  18610. Transform.call(this)
  18611. this._cache = new Splitter()
  18612. this._last = void 0
  18613. this._cipher = new aes.AES(key)
  18614. this._prev = Buffer.from(iv)
  18615. this._mode = mode
  18616. this._autopadding = true
  18617. }
  18618. inherits(Decipher, Transform)
  18619. Decipher.prototype._update = function (data) {
  18620. this._cache.add(data)
  18621. var chunk
  18622. var thing
  18623. var out = []
  18624. while ((chunk = this._cache.get(this._autopadding))) {
  18625. thing = this._mode.decrypt(this, chunk)
  18626. out.push(thing)
  18627. }
  18628. return Buffer.concat(out)
  18629. }
  18630. Decipher.prototype._final = function () {
  18631. var chunk = this._cache.flush()
  18632. if (this._autopadding) {
  18633. return unpad(this._mode.decrypt(this, chunk))
  18634. } else if (chunk) {
  18635. throw new Error('data not multiple of block length')
  18636. }
  18637. }
  18638. Decipher.prototype.setAutoPadding = function (setTo) {
  18639. this._autopadding = !!setTo
  18640. return this
  18641. }
  18642. function Splitter () {
  18643. this.cache = Buffer.allocUnsafe(0)
  18644. }
  18645. Splitter.prototype.add = function (data) {
  18646. this.cache = Buffer.concat([this.cache, data])
  18647. }
  18648. Splitter.prototype.get = function (autoPadding) {
  18649. var out
  18650. if (autoPadding) {
  18651. if (this.cache.length > 16) {
  18652. out = this.cache.slice(0, 16)
  18653. this.cache = this.cache.slice(16)
  18654. return out
  18655. }
  18656. } else {
  18657. if (this.cache.length >= 16) {
  18658. out = this.cache.slice(0, 16)
  18659. this.cache = this.cache.slice(16)
  18660. return out
  18661. }
  18662. }
  18663. return null
  18664. }
  18665. Splitter.prototype.flush = function () {
  18666. if (this.cache.length) return this.cache
  18667. }
  18668. function unpad (last) {
  18669. var padded = last[15]
  18670. if (padded < 1 || padded > 16) {
  18671. throw new Error('unable to decrypt data')
  18672. }
  18673. var i = -1
  18674. while (++i < padded) {
  18675. if (last[(i + (16 - padded))] !== padded) {
  18676. throw new Error('unable to decrypt data')
  18677. }
  18678. }
  18679. if (padded === 16) return
  18680. return last.slice(0, 16 - padded)
  18681. }
  18682. function createDecipheriv (suite, password, iv) {
  18683. var config = MODES[suite.toLowerCase()]
  18684. if (!config) throw new TypeError('invalid suite type')
  18685. if (typeof iv === 'string') iv = Buffer.from(iv)
  18686. if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)
  18687. if (typeof password === 'string') password = Buffer.from(password)
  18688. if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)
  18689. if (config.type === 'stream') {
  18690. return new StreamCipher(config.module, password, iv, true)
  18691. } else if (config.type === 'auth') {
  18692. return new AuthCipher(config.module, password, iv, true)
  18693. }
  18694. return new Decipher(config.module, password, iv)
  18695. }
  18696. function createDecipher (suite, password) {
  18697. var config = MODES[suite.toLowerCase()]
  18698. if (!config) throw new TypeError('invalid suite type')
  18699. var keys = ebtk(password, false, config.key, config.iv)
  18700. return createDecipheriv(suite, keys.key, keys.iv)
  18701. }
  18702. exports.createDecipher = createDecipher
  18703. exports.createDecipheriv = createDecipheriv
  18704. /***/ }),
  18705. /* 113 */
  18706. /*!**********************************************!*\
  18707. !*** ./node_modules/browserify-des/modes.js ***!
  18708. \**********************************************/
  18709. /*! no static exports found */
  18710. /***/ (function(module, exports) {
  18711. exports['des-ecb'] = {
  18712. key: 8,
  18713. iv: 0
  18714. }
  18715. exports['des-cbc'] = exports.des = {
  18716. key: 8,
  18717. iv: 8
  18718. }
  18719. exports['des-ede3-cbc'] = exports.des3 = {
  18720. key: 24,
  18721. iv: 8
  18722. }
  18723. exports['des-ede3'] = {
  18724. key: 24,
  18725. iv: 0
  18726. }
  18727. exports['des-ede-cbc'] = {
  18728. key: 16,
  18729. iv: 8
  18730. }
  18731. exports['des-ede'] = {
  18732. key: 16,
  18733. iv: 0
  18734. }
  18735. /***/ }),
  18736. /* 114 */
  18737. /*!************************************************!*\
  18738. !*** ./node_modules/diffie-hellman/browser.js ***!
  18739. \************************************************/
  18740. /*! no static exports found */
  18741. /***/ (function(module, exports, __webpack_require__) {
  18742. /* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(/*! ./lib/generatePrime */ 115)
  18743. var primes = __webpack_require__(/*! ./lib/primes.json */ 122)
  18744. var DH = __webpack_require__(/*! ./lib/dh */ 123)
  18745. function getDiffieHellman (mod) {
  18746. var prime = new Buffer(primes[mod].prime, 'hex')
  18747. var gen = new Buffer(primes[mod].gen, 'hex')
  18748. return new DH(prime, gen)
  18749. }
  18750. var ENCODINGS = {
  18751. 'binary': true, 'hex': true, 'base64': true
  18752. }
  18753. function createDiffieHellman (prime, enc, generator, genc) {
  18754. if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
  18755. return createDiffieHellman(prime, 'binary', enc, generator)
  18756. }
  18757. enc = enc || 'binary'
  18758. genc = genc || 'binary'
  18759. generator = generator || new Buffer([2])
  18760. if (!Buffer.isBuffer(generator)) {
  18761. generator = new Buffer(generator, genc)
  18762. }
  18763. if (typeof prime === 'number') {
  18764. return new DH(generatePrime(prime, generator), generator, true)
  18765. }
  18766. if (!Buffer.isBuffer(prime)) {
  18767. prime = new Buffer(prime, enc)
  18768. }
  18769. return new DH(prime, generator, true)
  18770. }
  18771. exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman
  18772. exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman
  18773. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 35).Buffer))
  18774. /***/ }),
  18775. /* 115 */
  18776. /*!**********************************************************!*\
  18777. !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***!
  18778. \**********************************************************/
  18779. /*! no static exports found */
  18780. /***/ (function(module, exports, __webpack_require__) {
  18781. var randomBytes = __webpack_require__(/*! randombytes */ 31);
  18782. module.exports = findPrime;
  18783. findPrime.simpleSieve = simpleSieve;
  18784. findPrime.fermatTest = fermatTest;
  18785. var BN = __webpack_require__(/*! bn.js */ 116);
  18786. var TWENTYFOUR = new BN(24);
  18787. var MillerRabin = __webpack_require__(/*! miller-rabin */ 119);
  18788. var millerRabin = new MillerRabin();
  18789. var ONE = new BN(1);
  18790. var TWO = new BN(2);
  18791. var FIVE = new BN(5);
  18792. var SIXTEEN = new BN(16);
  18793. var EIGHT = new BN(8);
  18794. var TEN = new BN(10);
  18795. var THREE = new BN(3);
  18796. var SEVEN = new BN(7);
  18797. var ELEVEN = new BN(11);
  18798. var FOUR = new BN(4);
  18799. var TWELVE = new BN(12);
  18800. var primes = null;
  18801. function _getPrimes() {
  18802. if (primes !== null)
  18803. return primes;
  18804. var limit = 0x100000;
  18805. var res = [];
  18806. res[0] = 2;
  18807. for (var i = 1, k = 3; k < limit; k += 2) {
  18808. var sqrt = Math.ceil(Math.sqrt(k));
  18809. for (var j = 0; j < i && res[j] <= sqrt; j++)
  18810. if (k % res[j] === 0)
  18811. break;
  18812. if (i !== j && res[j] <= sqrt)
  18813. continue;
  18814. res[i++] = k;
  18815. }
  18816. primes = res;
  18817. return res;
  18818. }
  18819. function simpleSieve(p) {
  18820. var primes = _getPrimes();
  18821. for (var i = 0; i < primes.length; i++)
  18822. if (p.modn(primes[i]) === 0) {
  18823. if (p.cmpn(primes[i]) === 0) {
  18824. return true;
  18825. } else {
  18826. return false;
  18827. }
  18828. }
  18829. return true;
  18830. }
  18831. function fermatTest(p) {
  18832. var red = BN.mont(p);
  18833. return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
  18834. }
  18835. function findPrime(bits, gen) {
  18836. if (bits < 16) {
  18837. // this is what openssl does
  18838. if (gen === 2 || gen === 5) {
  18839. return new BN([0x8c, 0x7b]);
  18840. } else {
  18841. return new BN([0x8c, 0x27]);
  18842. }
  18843. }
  18844. gen = new BN(gen);
  18845. var num, n2;
  18846. while (true) {
  18847. num = new BN(randomBytes(Math.ceil(bits / 8)));
  18848. while (num.bitLength() > bits) {
  18849. num.ishrn(1);
  18850. }
  18851. if (num.isEven()) {
  18852. num.iadd(ONE);
  18853. }
  18854. if (!num.testn(1)) {
  18855. num.iadd(TWO);
  18856. }
  18857. if (!gen.cmp(TWO)) {
  18858. while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
  18859. num.iadd(FOUR);
  18860. }
  18861. } else if (!gen.cmp(FIVE)) {
  18862. while (num.mod(TEN).cmp(THREE)) {
  18863. num.iadd(FOUR);
  18864. }
  18865. }
  18866. n2 = num.shrn(1);
  18867. if (simpleSieve(n2) && simpleSieve(num) &&
  18868. fermatTest(n2) && fermatTest(num) &&
  18869. millerRabin.test(n2) && millerRabin.test(num)) {
  18870. return num;
  18871. }
  18872. }
  18873. }
  18874. /***/ }),
  18875. /* 116 */
  18876. /*!**************************************!*\
  18877. !*** ./node_modules/bn.js/lib/bn.js ***!
  18878. \**************************************/
  18879. /*! no static exports found */
  18880. /***/ (function(module, exports, __webpack_require__) {
  18881. /* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {
  18882. 'use strict';
  18883. // Utils
  18884. function assert (val, msg) {
  18885. if (!val) throw new Error(msg || 'Assertion failed');
  18886. }
  18887. // Could use `inherits` module, but don't want to move from single file
  18888. // architecture yet.
  18889. function inherits (ctor, superCtor) {
  18890. ctor.super_ = superCtor;
  18891. var TempCtor = function () {};
  18892. TempCtor.prototype = superCtor.prototype;
  18893. ctor.prototype = new TempCtor();
  18894. ctor.prototype.constructor = ctor;
  18895. }
  18896. // BN
  18897. function BN (number, base, endian) {
  18898. if (BN.isBN(number)) {
  18899. return number;
  18900. }
  18901. this.negative = 0;
  18902. this.words = null;
  18903. this.length = 0;
  18904. // Reduction context
  18905. this.red = null;
  18906. if (number !== null) {
  18907. if (base === 'le' || base === 'be') {
  18908. endian = base;
  18909. base = 10;
  18910. }
  18911. this._init(number || 0, base || 10, endian || 'be');
  18912. }
  18913. }
  18914. if (typeof module === 'object') {
  18915. module.exports = BN;
  18916. } else {
  18917. exports.BN = BN;
  18918. }
  18919. BN.BN = BN;
  18920. BN.wordSize = 26;
  18921. var Buffer;
  18922. try {
  18923. Buffer = __webpack_require__(/*! buffer */ 118).Buffer;
  18924. } catch (e) {
  18925. }
  18926. BN.isBN = function isBN (num) {
  18927. if (num instanceof BN) {
  18928. return true;
  18929. }
  18930. return num !== null && typeof num === 'object' &&
  18931. num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
  18932. };
  18933. BN.max = function max (left, right) {
  18934. if (left.cmp(right) > 0) return left;
  18935. return right;
  18936. };
  18937. BN.min = function min (left, right) {
  18938. if (left.cmp(right) < 0) return left;
  18939. return right;
  18940. };
  18941. BN.prototype._init = function init (number, base, endian) {
  18942. if (typeof number === 'number') {
  18943. return this._initNumber(number, base, endian);
  18944. }
  18945. if (typeof number === 'object') {
  18946. return this._initArray(number, base, endian);
  18947. }
  18948. if (base === 'hex') {
  18949. base = 16;
  18950. }
  18951. assert(base === (base | 0) && base >= 2 && base <= 36);
  18952. number = number.toString().replace(/\s+/g, '');
  18953. var start = 0;
  18954. if (number[0] === '-') {
  18955. start++;
  18956. }
  18957. if (base === 16) {
  18958. this._parseHex(number, start);
  18959. } else {
  18960. this._parseBase(number, base, start);
  18961. }
  18962. if (number[0] === '-') {
  18963. this.negative = 1;
  18964. }
  18965. this._strip();
  18966. if (endian !== 'le') return;
  18967. this._initArray(this.toArray(), base, endian);
  18968. };
  18969. BN.prototype._initNumber = function _initNumber (number, base, endian) {
  18970. if (number < 0) {
  18971. this.negative = 1;
  18972. number = -number;
  18973. }
  18974. if (number < 0x4000000) {
  18975. this.words = [number & 0x3ffffff];
  18976. this.length = 1;
  18977. } else if (number < 0x10000000000000) {
  18978. this.words = [
  18979. number & 0x3ffffff,
  18980. (number / 0x4000000) & 0x3ffffff
  18981. ];
  18982. this.length = 2;
  18983. } else {
  18984. assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
  18985. this.words = [
  18986. number & 0x3ffffff,
  18987. (number / 0x4000000) & 0x3ffffff,
  18988. 1
  18989. ];
  18990. this.length = 3;
  18991. }
  18992. if (endian !== 'le') return;
  18993. // Reverse the bytes
  18994. this._initArray(this.toArray(), base, endian);
  18995. };
  18996. BN.prototype._initArray = function _initArray (number, base, endian) {
  18997. // Perhaps a Uint8Array
  18998. assert(typeof number.length === 'number');
  18999. if (number.length <= 0) {
  19000. this.words = [0];
  19001. this.length = 1;
  19002. return this;
  19003. }
  19004. this.length = Math.ceil(number.length / 3);
  19005. this.words = new Array(this.length);
  19006. for (var i = 0; i < this.length; i++) {
  19007. this.words[i] = 0;
  19008. }
  19009. var j, w;
  19010. var off = 0;
  19011. if (endian === 'be') {
  19012. for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
  19013. w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
  19014. this.words[j] |= (w << off) & 0x3ffffff;
  19015. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  19016. off += 24;
  19017. if (off >= 26) {
  19018. off -= 26;
  19019. j++;
  19020. }
  19021. }
  19022. } else if (endian === 'le') {
  19023. for (i = 0, j = 0; i < number.length; i += 3) {
  19024. w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
  19025. this.words[j] |= (w << off) & 0x3ffffff;
  19026. this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
  19027. off += 24;
  19028. if (off >= 26) {
  19029. off -= 26;
  19030. j++;
  19031. }
  19032. }
  19033. }
  19034. return this._strip();
  19035. };
  19036. function parseHex (str, start, end) {
  19037. var r = 0;
  19038. var len = Math.min(str.length, end);
  19039. var z = 0;
  19040. for (var i = start; i < len; i++) {
  19041. var c = str.charCodeAt(i) - 48;
  19042. r <<= 4;
  19043. var b;
  19044. // 'a' - 'f'
  19045. if (c >= 49 && c <= 54) {
  19046. b = c - 49 + 0xa;
  19047. // 'A' - 'F'
  19048. } else if (c >= 17 && c <= 22) {
  19049. b = c - 17 + 0xa;
  19050. // '0' - '9'
  19051. } else {
  19052. b = c;
  19053. }
  19054. r |= b;
  19055. z |= b;
  19056. }
  19057. assert(!(z & 0xf0), 'Invalid character in ' + str);
  19058. return r;
  19059. }
  19060. BN.prototype._parseHex = function _parseHex (number, start) {
  19061. // Create possibly bigger array to ensure that it fits the number
  19062. this.length = Math.ceil((number.length - start) / 6);
  19063. this.words = new Array(this.length);
  19064. for (var i = 0; i < this.length; i++) {
  19065. this.words[i] = 0;
  19066. }
  19067. var j, w;
  19068. // Scan 24-bit chunks and add them to the number
  19069. var off = 0;
  19070. for (i = number.length - 6, j = 0; i >= start; i -= 6) {
  19071. w = parseHex(number, i, i + 6);
  19072. this.words[j] |= (w << off) & 0x3ffffff;
  19073. // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb
  19074. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  19075. off += 24;
  19076. if (off >= 26) {
  19077. off -= 26;
  19078. j++;
  19079. }
  19080. }
  19081. if (i + 6 !== start) {
  19082. w = parseHex(number, start, i + 6);
  19083. this.words[j] |= (w << off) & 0x3ffffff;
  19084. this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
  19085. }
  19086. this._strip();
  19087. };
  19088. function parseBase (str, start, end, mul) {
  19089. var r = 0;
  19090. var b = 0;
  19091. var len = Math.min(str.length, end);
  19092. for (var i = start; i < len; i++) {
  19093. var c = str.charCodeAt(i) - 48;
  19094. r *= mul;
  19095. // 'a'
  19096. if (c >= 49) {
  19097. b = c - 49 + 0xa;
  19098. // 'A'
  19099. } else if (c >= 17) {
  19100. b = c - 17 + 0xa;
  19101. // '0' - '9'
  19102. } else {
  19103. b = c;
  19104. }
  19105. assert(c >= 0 && b < mul, 'Invalid character');
  19106. r += b;
  19107. }
  19108. return r;
  19109. }
  19110. BN.prototype._parseBase = function _parseBase (number, base, start) {
  19111. // Initialize as zero
  19112. this.words = [0];
  19113. this.length = 1;
  19114. // Find length of limb in base
  19115. for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
  19116. limbLen++;
  19117. }
  19118. limbLen--;
  19119. limbPow = (limbPow / base) | 0;
  19120. var total = number.length - start;
  19121. var mod = total % limbLen;
  19122. var end = Math.min(total, total - mod) + start;
  19123. var word = 0;
  19124. for (var i = start; i < end; i += limbLen) {
  19125. word = parseBase(number, i, i + limbLen, base);
  19126. this.imuln(limbPow);
  19127. if (this.words[0] + word < 0x4000000) {
  19128. this.words[0] += word;
  19129. } else {
  19130. this._iaddn(word);
  19131. }
  19132. }
  19133. if (mod !== 0) {
  19134. var pow = 1;
  19135. word = parseBase(number, i, number.length, base);
  19136. for (i = 0; i < mod; i++) {
  19137. pow *= base;
  19138. }
  19139. this.imuln(pow);
  19140. if (this.words[0] + word < 0x4000000) {
  19141. this.words[0] += word;
  19142. } else {
  19143. this._iaddn(word);
  19144. }
  19145. }
  19146. };
  19147. BN.prototype.copy = function copy (dest) {
  19148. dest.words = new Array(this.length);
  19149. for (var i = 0; i < this.length; i++) {
  19150. dest.words[i] = this.words[i];
  19151. }
  19152. dest.length = this.length;
  19153. dest.negative = this.negative;
  19154. dest.red = this.red;
  19155. };
  19156. function move (dest, src) {
  19157. dest.words = src.words;
  19158. dest.length = src.length;
  19159. dest.negative = src.negative;
  19160. dest.red = src.red;
  19161. }
  19162. BN.prototype._move = function _move (dest) {
  19163. move(dest, this);
  19164. };
  19165. BN.prototype.clone = function clone () {
  19166. var r = new BN(null);
  19167. this.copy(r);
  19168. return r;
  19169. };
  19170. BN.prototype._expand = function _expand (size) {
  19171. while (this.length < size) {
  19172. this.words[this.length++] = 0;
  19173. }
  19174. return this;
  19175. };
  19176. // Remove leading `0` from `this`
  19177. BN.prototype._strip = function strip () {
  19178. while (this.length > 1 && this.words[this.length - 1] === 0) {
  19179. this.length--;
  19180. }
  19181. return this._normSign();
  19182. };
  19183. BN.prototype._normSign = function _normSign () {
  19184. // -0 = 0
  19185. if (this.length === 1 && this.words[0] === 0) {
  19186. this.negative = 0;
  19187. }
  19188. return this;
  19189. };
  19190. // Check Symbol.for because not everywhere where Symbol defined
  19191. // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility
  19192. if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {
  19193. BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;
  19194. } else {
  19195. BN.prototype.inspect = inspect;
  19196. }
  19197. function inspect () {
  19198. return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
  19199. }
  19200. /*
  19201. var zeros = [];
  19202. var groupSizes = [];
  19203. var groupBases = [];
  19204. var s = '';
  19205. var i = -1;
  19206. while (++i < BN.wordSize) {
  19207. zeros[i] = s;
  19208. s += '0';
  19209. }
  19210. groupSizes[0] = 0;
  19211. groupSizes[1] = 0;
  19212. groupBases[0] = 0;
  19213. groupBases[1] = 0;
  19214. var base = 2 - 1;
  19215. while (++base < 36 + 1) {
  19216. var groupSize = 0;
  19217. var groupBase = 1;
  19218. while (groupBase < (1 << BN.wordSize) / base) {
  19219. groupBase *= base;
  19220. groupSize += 1;
  19221. }
  19222. groupSizes[base] = groupSize;
  19223. groupBases[base] = groupBase;
  19224. }
  19225. */
  19226. var zeros = [
  19227. '',
  19228. '0',
  19229. '00',
  19230. '000',
  19231. '0000',
  19232. '00000',
  19233. '000000',
  19234. '0000000',
  19235. '00000000',
  19236. '000000000',
  19237. '0000000000',
  19238. '00000000000',
  19239. '000000000000',
  19240. '0000000000000',
  19241. '00000000000000',
  19242. '000000000000000',
  19243. '0000000000000000',
  19244. '00000000000000000',
  19245. '000000000000000000',
  19246. '0000000000000000000',
  19247. '00000000000000000000',
  19248. '000000000000000000000',
  19249. '0000000000000000000000',
  19250. '00000000000000000000000',
  19251. '000000000000000000000000',
  19252. '0000000000000000000000000'
  19253. ];
  19254. var groupSizes = [
  19255. 0, 0,
  19256. 25, 16, 12, 11, 10, 9, 8,
  19257. 8, 7, 7, 7, 7, 6, 6,
  19258. 6, 6, 6, 6, 6, 5, 5,
  19259. 5, 5, 5, 5, 5, 5, 5,
  19260. 5, 5, 5, 5, 5, 5, 5
  19261. ];
  19262. var groupBases = [
  19263. 0, 0,
  19264. 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
  19265. 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,
  19266. 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,
  19267. 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,
  19268. 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176
  19269. ];
  19270. BN.prototype.toString = function toString (base, padding) {
  19271. base = base || 10;
  19272. padding = padding | 0 || 1;
  19273. var out;
  19274. if (base === 16 || base === 'hex') {
  19275. out = '';
  19276. var off = 0;
  19277. var carry = 0;
  19278. for (var i = 0; i < this.length; i++) {
  19279. var w = this.words[i];
  19280. var word = (((w << off) | carry) & 0xffffff).toString(16);
  19281. carry = (w >>> (24 - off)) & 0xffffff;
  19282. if (carry !== 0 || i !== this.length - 1) {
  19283. out = zeros[6 - word.length] + word + out;
  19284. } else {
  19285. out = word + out;
  19286. }
  19287. off += 2;
  19288. if (off >= 26) {
  19289. off -= 26;
  19290. i--;
  19291. }
  19292. }
  19293. if (carry !== 0) {
  19294. out = carry.toString(16) + out;
  19295. }
  19296. while (out.length % padding !== 0) {
  19297. out = '0' + out;
  19298. }
  19299. if (this.negative !== 0) {
  19300. out = '-' + out;
  19301. }
  19302. return out;
  19303. }
  19304. if (base === (base | 0) && base >= 2 && base <= 36) {
  19305. // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
  19306. var groupSize = groupSizes[base];
  19307. // var groupBase = Math.pow(base, groupSize);
  19308. var groupBase = groupBases[base];
  19309. out = '';
  19310. var c = this.clone();
  19311. c.negative = 0;
  19312. while (!c.isZero()) {
  19313. var r = c.modrn(groupBase).toString(base);
  19314. c = c.idivn(groupBase);
  19315. if (!c.isZero()) {
  19316. out = zeros[groupSize - r.length] + r + out;
  19317. } else {
  19318. out = r + out;
  19319. }
  19320. }
  19321. if (this.isZero()) {
  19322. out = '0' + out;
  19323. }
  19324. while (out.length % padding !== 0) {
  19325. out = '0' + out;
  19326. }
  19327. if (this.negative !== 0) {
  19328. out = '-' + out;
  19329. }
  19330. return out;
  19331. }
  19332. assert(false, 'Base should be between 2 and 36');
  19333. };
  19334. BN.prototype.toNumber = function toNumber () {
  19335. var ret = this.words[0];
  19336. if (this.length === 2) {
  19337. ret += this.words[1] * 0x4000000;
  19338. } else if (this.length === 3 && this.words[2] === 0x01) {
  19339. // NOTE: at this stage it is known that the top bit is set
  19340. ret += 0x10000000000000 + (this.words[1] * 0x4000000);
  19341. } else if (this.length > 2) {
  19342. assert(false, 'Number can only safely store up to 53 bits');
  19343. }
  19344. return (this.negative !== 0) ? -ret : ret;
  19345. };
  19346. BN.prototype.toJSON = function toJSON () {
  19347. return this.toString(16, 2);
  19348. };
  19349. if (Buffer) {
  19350. BN.prototype.toBuffer = function toBuffer (endian, length) {
  19351. return this.toArrayLike(Buffer, endian, length);
  19352. };
  19353. }
  19354. BN.prototype.toArray = function toArray (endian, length) {
  19355. return this.toArrayLike(Array, endian, length);
  19356. };
  19357. var allocate = function allocate (ArrayType, size) {
  19358. if (ArrayType.allocUnsafe) {
  19359. return ArrayType.allocUnsafe(size);
  19360. }
  19361. return new ArrayType(size);
  19362. };
  19363. BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
  19364. this._strip();
  19365. var byteLength = this.byteLength();
  19366. var reqLength = length || Math.max(1, byteLength);
  19367. assert(byteLength <= reqLength, 'byte array longer than desired length');
  19368. assert(reqLength > 0, 'Requested array length <= 0');
  19369. var res = allocate(ArrayType, reqLength);
  19370. var postfix = endian === 'le' ? 'LE' : 'BE';
  19371. this['_toArrayLike' + postfix](res, byteLength);
  19372. return res;
  19373. };
  19374. BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {
  19375. var position = 0;
  19376. var carry = 0;
  19377. for (var i = 0, shift = 0; i < this.length; i++) {
  19378. var word = (this.words[i] << shift) | carry;
  19379. res[position++] = word & 0xff;
  19380. if (position < res.length) {
  19381. res[position++] = (word >> 8) & 0xff;
  19382. }
  19383. if (position < res.length) {
  19384. res[position++] = (word >> 16) & 0xff;
  19385. }
  19386. if (shift === 6) {
  19387. if (position < res.length) {
  19388. res[position++] = (word >> 24) & 0xff;
  19389. }
  19390. carry = 0;
  19391. shift = 0;
  19392. } else {
  19393. carry = word >>> 24;
  19394. shift += 2;
  19395. }
  19396. }
  19397. if (position < res.length) {
  19398. res[position++] = carry;
  19399. while (position < res.length) {
  19400. res[position++] = 0;
  19401. }
  19402. }
  19403. };
  19404. BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {
  19405. var position = res.length - 1;
  19406. var carry = 0;
  19407. for (var i = 0, shift = 0; i < this.length; i++) {
  19408. var word = (this.words[i] << shift) | carry;
  19409. res[position--] = word & 0xff;
  19410. if (position >= 0) {
  19411. res[position--] = (word >> 8) & 0xff;
  19412. }
  19413. if (position >= 0) {
  19414. res[position--] = (word >> 16) & 0xff;
  19415. }
  19416. if (shift === 6) {
  19417. if (position >= 0) {
  19418. res[position--] = (word >> 24) & 0xff;
  19419. }
  19420. carry = 0;
  19421. shift = 0;
  19422. } else {
  19423. carry = word >>> 24;
  19424. shift += 2;
  19425. }
  19426. }
  19427. if (position >= 0) {
  19428. res[position--] = carry;
  19429. while (position >= 0) {
  19430. res[position--] = 0;
  19431. }
  19432. }
  19433. };
  19434. if (Math.clz32) {
  19435. BN.prototype._countBits = function _countBits (w) {
  19436. return 32 - Math.clz32(w);
  19437. };
  19438. } else {
  19439. BN.prototype._countBits = function _countBits (w) {
  19440. var t = w;
  19441. var r = 0;
  19442. if (t >= 0x1000) {
  19443. r += 13;
  19444. t >>>= 13;
  19445. }
  19446. if (t >= 0x40) {
  19447. r += 7;
  19448. t >>>= 7;
  19449. }
  19450. if (t >= 0x8) {
  19451. r += 4;
  19452. t >>>= 4;
  19453. }
  19454. if (t >= 0x02) {
  19455. r += 2;
  19456. t >>>= 2;
  19457. }
  19458. return r + t;
  19459. };
  19460. }
  19461. BN.prototype._zeroBits = function _zeroBits (w) {
  19462. // Short-cut
  19463. if (w === 0) return 26;
  19464. var t = w;
  19465. var r = 0;
  19466. if ((t & 0x1fff) === 0) {
  19467. r += 13;
  19468. t >>>= 13;
  19469. }
  19470. if ((t & 0x7f) === 0) {
  19471. r += 7;
  19472. t >>>= 7;
  19473. }
  19474. if ((t & 0xf) === 0) {
  19475. r += 4;
  19476. t >>>= 4;
  19477. }
  19478. if ((t & 0x3) === 0) {
  19479. r += 2;
  19480. t >>>= 2;
  19481. }
  19482. if ((t & 0x1) === 0) {
  19483. r++;
  19484. }
  19485. return r;
  19486. };
  19487. // Return number of used bits in a BN
  19488. BN.prototype.bitLength = function bitLength () {
  19489. var w = this.words[this.length - 1];
  19490. var hi = this._countBits(w);
  19491. return (this.length - 1) * 26 + hi;
  19492. };
  19493. function toBitArray (num) {
  19494. var w = new Array(num.bitLength());
  19495. for (var bit = 0; bit < w.length; bit++) {
  19496. var off = (bit / 26) | 0;
  19497. var wbit = bit % 26;
  19498. w[bit] = (num.words[off] >>> wbit) & 0x01;
  19499. }
  19500. return w;
  19501. }
  19502. // Number of trailing zero bits
  19503. BN.prototype.zeroBits = function zeroBits () {
  19504. if (this.isZero()) return 0;
  19505. var r = 0;
  19506. for (var i = 0; i < this.length; i++) {
  19507. var b = this._zeroBits(this.words[i]);
  19508. r += b;
  19509. if (b !== 26) break;
  19510. }
  19511. return r;
  19512. };
  19513. BN.prototype.byteLength = function byteLength () {
  19514. return Math.ceil(this.bitLength() / 8);
  19515. };
  19516. BN.prototype.toTwos = function toTwos (width) {
  19517. if (this.negative !== 0) {
  19518. return this.abs().inotn(width).iaddn(1);
  19519. }
  19520. return this.clone();
  19521. };
  19522. BN.prototype.fromTwos = function fromTwos (width) {
  19523. if (this.testn(width - 1)) {
  19524. return this.notn(width).iaddn(1).ineg();
  19525. }
  19526. return this.clone();
  19527. };
  19528. BN.prototype.isNeg = function isNeg () {
  19529. return this.negative !== 0;
  19530. };
  19531. // Return negative clone of `this`
  19532. BN.prototype.neg = function neg () {
  19533. return this.clone().ineg();
  19534. };
  19535. BN.prototype.ineg = function ineg () {
  19536. if (!this.isZero()) {
  19537. this.negative ^= 1;
  19538. }
  19539. return this;
  19540. };
  19541. // Or `num` with `this` in-place
  19542. BN.prototype.iuor = function iuor (num) {
  19543. while (this.length < num.length) {
  19544. this.words[this.length++] = 0;
  19545. }
  19546. for (var i = 0; i < num.length; i++) {
  19547. this.words[i] = this.words[i] | num.words[i];
  19548. }
  19549. return this._strip();
  19550. };
  19551. BN.prototype.ior = function ior (num) {
  19552. assert((this.negative | num.negative) === 0);
  19553. return this.iuor(num);
  19554. };
  19555. // Or `num` with `this`
  19556. BN.prototype.or = function or (num) {
  19557. if (this.length > num.length) return this.clone().ior(num);
  19558. return num.clone().ior(this);
  19559. };
  19560. BN.prototype.uor = function uor (num) {
  19561. if (this.length > num.length) return this.clone().iuor(num);
  19562. return num.clone().iuor(this);
  19563. };
  19564. // And `num` with `this` in-place
  19565. BN.prototype.iuand = function iuand (num) {
  19566. // b = min-length(num, this)
  19567. var b;
  19568. if (this.length > num.length) {
  19569. b = num;
  19570. } else {
  19571. b = this;
  19572. }
  19573. for (var i = 0; i < b.length; i++) {
  19574. this.words[i] = this.words[i] & num.words[i];
  19575. }
  19576. this.length = b.length;
  19577. return this._strip();
  19578. };
  19579. BN.prototype.iand = function iand (num) {
  19580. assert((this.negative | num.negative) === 0);
  19581. return this.iuand(num);
  19582. };
  19583. // And `num` with `this`
  19584. BN.prototype.and = function and (num) {
  19585. if (this.length > num.length) return this.clone().iand(num);
  19586. return num.clone().iand(this);
  19587. };
  19588. BN.prototype.uand = function uand (num) {
  19589. if (this.length > num.length) return this.clone().iuand(num);
  19590. return num.clone().iuand(this);
  19591. };
  19592. // Xor `num` with `this` in-place
  19593. BN.prototype.iuxor = function iuxor (num) {
  19594. // a.length > b.length
  19595. var a;
  19596. var b;
  19597. if (this.length > num.length) {
  19598. a = this;
  19599. b = num;
  19600. } else {
  19601. a = num;
  19602. b = this;
  19603. }
  19604. for (var i = 0; i < b.length; i++) {
  19605. this.words[i] = a.words[i] ^ b.words[i];
  19606. }
  19607. if (this !== a) {
  19608. for (; i < a.length; i++) {
  19609. this.words[i] = a.words[i];
  19610. }
  19611. }
  19612. this.length = a.length;
  19613. return this._strip();
  19614. };
  19615. BN.prototype.ixor = function ixor (num) {
  19616. assert((this.negative | num.negative) === 0);
  19617. return this.iuxor(num);
  19618. };
  19619. // Xor `num` with `this`
  19620. BN.prototype.xor = function xor (num) {
  19621. if (this.length > num.length) return this.clone().ixor(num);
  19622. return num.clone().ixor(this);
  19623. };
  19624. BN.prototype.uxor = function uxor (num) {
  19625. if (this.length > num.length) return this.clone().iuxor(num);
  19626. return num.clone().iuxor(this);
  19627. };
  19628. // Not ``this`` with ``width`` bitwidth
  19629. BN.prototype.inotn = function inotn (width) {
  19630. assert(typeof width === 'number' && width >= 0);
  19631. var bytesNeeded = Math.ceil(width / 26) | 0;
  19632. var bitsLeft = width % 26;
  19633. // Extend the buffer with leading zeroes
  19634. this._expand(bytesNeeded);
  19635. if (bitsLeft > 0) {
  19636. bytesNeeded--;
  19637. }
  19638. // Handle complete words
  19639. for (var i = 0; i < bytesNeeded; i++) {
  19640. this.words[i] = ~this.words[i] & 0x3ffffff;
  19641. }
  19642. // Handle the residue
  19643. if (bitsLeft > 0) {
  19644. this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
  19645. }
  19646. // And remove leading zeroes
  19647. return this._strip();
  19648. };
  19649. BN.prototype.notn = function notn (width) {
  19650. return this.clone().inotn(width);
  19651. };
  19652. // Set `bit` of `this`
  19653. BN.prototype.setn = function setn (bit, val) {
  19654. assert(typeof bit === 'number' && bit >= 0);
  19655. var off = (bit / 26) | 0;
  19656. var wbit = bit % 26;
  19657. this._expand(off + 1);
  19658. if (val) {
  19659. this.words[off] = this.words[off] | (1 << wbit);
  19660. } else {
  19661. this.words[off] = this.words[off] & ~(1 << wbit);
  19662. }
  19663. return this._strip();
  19664. };
  19665. // Add `num` to `this` in-place
  19666. BN.prototype.iadd = function iadd (num) {
  19667. var r;
  19668. // negative + positive
  19669. if (this.negative !== 0 && num.negative === 0) {
  19670. this.negative = 0;
  19671. r = this.isub(num);
  19672. this.negative ^= 1;
  19673. return this._normSign();
  19674. // positive + negative
  19675. } else if (this.negative === 0 && num.negative !== 0) {
  19676. num.negative = 0;
  19677. r = this.isub(num);
  19678. num.negative = 1;
  19679. return r._normSign();
  19680. }
  19681. // a.length > b.length
  19682. var a, b;
  19683. if (this.length > num.length) {
  19684. a = this;
  19685. b = num;
  19686. } else {
  19687. a = num;
  19688. b = this;
  19689. }
  19690. var carry = 0;
  19691. for (var i = 0; i < b.length; i++) {
  19692. r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
  19693. this.words[i] = r & 0x3ffffff;
  19694. carry = r >>> 26;
  19695. }
  19696. for (; carry !== 0 && i < a.length; i++) {
  19697. r = (a.words[i] | 0) + carry;
  19698. this.words[i] = r & 0x3ffffff;
  19699. carry = r >>> 26;
  19700. }
  19701. this.length = a.length;
  19702. if (carry !== 0) {
  19703. this.words[this.length] = carry;
  19704. this.length++;
  19705. // Copy the rest of the words
  19706. } else if (a !== this) {
  19707. for (; i < a.length; i++) {
  19708. this.words[i] = a.words[i];
  19709. }
  19710. }
  19711. return this;
  19712. };
  19713. // Add `num` to `this`
  19714. BN.prototype.add = function add (num) {
  19715. var res;
  19716. if (num.negative !== 0 && this.negative === 0) {
  19717. num.negative = 0;
  19718. res = this.sub(num);
  19719. num.negative ^= 1;
  19720. return res;
  19721. } else if (num.negative === 0 && this.negative !== 0) {
  19722. this.negative = 0;
  19723. res = num.sub(this);
  19724. this.negative = 1;
  19725. return res;
  19726. }
  19727. if (this.length > num.length) return this.clone().iadd(num);
  19728. return num.clone().iadd(this);
  19729. };
  19730. // Subtract `num` from `this` in-place
  19731. BN.prototype.isub = function isub (num) {
  19732. // this - (-num) = this + num
  19733. if (num.negative !== 0) {
  19734. num.negative = 0;
  19735. var r = this.iadd(num);
  19736. num.negative = 1;
  19737. return r._normSign();
  19738. // -this - num = -(this + num)
  19739. } else if (this.negative !== 0) {
  19740. this.negative = 0;
  19741. this.iadd(num);
  19742. this.negative = 1;
  19743. return this._normSign();
  19744. }
  19745. // At this point both numbers are positive
  19746. var cmp = this.cmp(num);
  19747. // Optimization - zeroify
  19748. if (cmp === 0) {
  19749. this.negative = 0;
  19750. this.length = 1;
  19751. this.words[0] = 0;
  19752. return this;
  19753. }
  19754. // a > b
  19755. var a, b;
  19756. if (cmp > 0) {
  19757. a = this;
  19758. b = num;
  19759. } else {
  19760. a = num;
  19761. b = this;
  19762. }
  19763. var carry = 0;
  19764. for (var i = 0; i < b.length; i++) {
  19765. r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
  19766. carry = r >> 26;
  19767. this.words[i] = r & 0x3ffffff;
  19768. }
  19769. for (; carry !== 0 && i < a.length; i++) {
  19770. r = (a.words[i] | 0) + carry;
  19771. carry = r >> 26;
  19772. this.words[i] = r & 0x3ffffff;
  19773. }
  19774. // Copy rest of the words
  19775. if (carry === 0 && i < a.length && a !== this) {
  19776. for (; i < a.length; i++) {
  19777. this.words[i] = a.words[i];
  19778. }
  19779. }
  19780. this.length = Math.max(this.length, i);
  19781. if (a !== this) {
  19782. this.negative = 1;
  19783. }
  19784. return this._strip();
  19785. };
  19786. // Subtract `num` from `this`
  19787. BN.prototype.sub = function sub (num) {
  19788. return this.clone().isub(num);
  19789. };
  19790. function smallMulTo (self, num, out) {
  19791. out.negative = num.negative ^ self.negative;
  19792. var len = (self.length + num.length) | 0;
  19793. out.length = len;
  19794. len = (len - 1) | 0;
  19795. // Peel one iteration (compiler can't do it, because of code complexity)
  19796. var a = self.words[0] | 0;
  19797. var b = num.words[0] | 0;
  19798. var r = a * b;
  19799. var lo = r & 0x3ffffff;
  19800. var carry = (r / 0x4000000) | 0;
  19801. out.words[0] = lo;
  19802. for (var k = 1; k < len; k++) {
  19803. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  19804. // note that ncarry could be >= 0x3ffffff
  19805. var ncarry = carry >>> 26;
  19806. var rword = carry & 0x3ffffff;
  19807. var maxJ = Math.min(k, num.length - 1);
  19808. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  19809. var i = (k - j) | 0;
  19810. a = self.words[i] | 0;
  19811. b = num.words[j] | 0;
  19812. r = a * b + rword;
  19813. ncarry += (r / 0x4000000) | 0;
  19814. rword = r & 0x3ffffff;
  19815. }
  19816. out.words[k] = rword | 0;
  19817. carry = ncarry | 0;
  19818. }
  19819. if (carry !== 0) {
  19820. out.words[k] = carry | 0;
  19821. } else {
  19822. out.length--;
  19823. }
  19824. return out._strip();
  19825. }
  19826. // TODO(indutny): it may be reasonable to omit it for users who don't need
  19827. // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
  19828. // multiplication (like elliptic secp256k1).
  19829. var comb10MulTo = function comb10MulTo (self, num, out) {
  19830. var a = self.words;
  19831. var b = num.words;
  19832. var o = out.words;
  19833. var c = 0;
  19834. var lo;
  19835. var mid;
  19836. var hi;
  19837. var a0 = a[0] | 0;
  19838. var al0 = a0 & 0x1fff;
  19839. var ah0 = a0 >>> 13;
  19840. var a1 = a[1] | 0;
  19841. var al1 = a1 & 0x1fff;
  19842. var ah1 = a1 >>> 13;
  19843. var a2 = a[2] | 0;
  19844. var al2 = a2 & 0x1fff;
  19845. var ah2 = a2 >>> 13;
  19846. var a3 = a[3] | 0;
  19847. var al3 = a3 & 0x1fff;
  19848. var ah3 = a3 >>> 13;
  19849. var a4 = a[4] | 0;
  19850. var al4 = a4 & 0x1fff;
  19851. var ah4 = a4 >>> 13;
  19852. var a5 = a[5] | 0;
  19853. var al5 = a5 & 0x1fff;
  19854. var ah5 = a5 >>> 13;
  19855. var a6 = a[6] | 0;
  19856. var al6 = a6 & 0x1fff;
  19857. var ah6 = a6 >>> 13;
  19858. var a7 = a[7] | 0;
  19859. var al7 = a7 & 0x1fff;
  19860. var ah7 = a7 >>> 13;
  19861. var a8 = a[8] | 0;
  19862. var al8 = a8 & 0x1fff;
  19863. var ah8 = a8 >>> 13;
  19864. var a9 = a[9] | 0;
  19865. var al9 = a9 & 0x1fff;
  19866. var ah9 = a9 >>> 13;
  19867. var b0 = b[0] | 0;
  19868. var bl0 = b0 & 0x1fff;
  19869. var bh0 = b0 >>> 13;
  19870. var b1 = b[1] | 0;
  19871. var bl1 = b1 & 0x1fff;
  19872. var bh1 = b1 >>> 13;
  19873. var b2 = b[2] | 0;
  19874. var bl2 = b2 & 0x1fff;
  19875. var bh2 = b2 >>> 13;
  19876. var b3 = b[3] | 0;
  19877. var bl3 = b3 & 0x1fff;
  19878. var bh3 = b3 >>> 13;
  19879. var b4 = b[4] | 0;
  19880. var bl4 = b4 & 0x1fff;
  19881. var bh4 = b4 >>> 13;
  19882. var b5 = b[5] | 0;
  19883. var bl5 = b5 & 0x1fff;
  19884. var bh5 = b5 >>> 13;
  19885. var b6 = b[6] | 0;
  19886. var bl6 = b6 & 0x1fff;
  19887. var bh6 = b6 >>> 13;
  19888. var b7 = b[7] | 0;
  19889. var bl7 = b7 & 0x1fff;
  19890. var bh7 = b7 >>> 13;
  19891. var b8 = b[8] | 0;
  19892. var bl8 = b8 & 0x1fff;
  19893. var bh8 = b8 >>> 13;
  19894. var b9 = b[9] | 0;
  19895. var bl9 = b9 & 0x1fff;
  19896. var bh9 = b9 >>> 13;
  19897. out.negative = self.negative ^ num.negative;
  19898. out.length = 19;
  19899. /* k = 0 */
  19900. lo = Math.imul(al0, bl0);
  19901. mid = Math.imul(al0, bh0);
  19902. mid = (mid + Math.imul(ah0, bl0)) | 0;
  19903. hi = Math.imul(ah0, bh0);
  19904. var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19905. c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
  19906. w0 &= 0x3ffffff;
  19907. /* k = 1 */
  19908. lo = Math.imul(al1, bl0);
  19909. mid = Math.imul(al1, bh0);
  19910. mid = (mid + Math.imul(ah1, bl0)) | 0;
  19911. hi = Math.imul(ah1, bh0);
  19912. lo = (lo + Math.imul(al0, bl1)) | 0;
  19913. mid = (mid + Math.imul(al0, bh1)) | 0;
  19914. mid = (mid + Math.imul(ah0, bl1)) | 0;
  19915. hi = (hi + Math.imul(ah0, bh1)) | 0;
  19916. var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19917. c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
  19918. w1 &= 0x3ffffff;
  19919. /* k = 2 */
  19920. lo = Math.imul(al2, bl0);
  19921. mid = Math.imul(al2, bh0);
  19922. mid = (mid + Math.imul(ah2, bl0)) | 0;
  19923. hi = Math.imul(ah2, bh0);
  19924. lo = (lo + Math.imul(al1, bl1)) | 0;
  19925. mid = (mid + Math.imul(al1, bh1)) | 0;
  19926. mid = (mid + Math.imul(ah1, bl1)) | 0;
  19927. hi = (hi + Math.imul(ah1, bh1)) | 0;
  19928. lo = (lo + Math.imul(al0, bl2)) | 0;
  19929. mid = (mid + Math.imul(al0, bh2)) | 0;
  19930. mid = (mid + Math.imul(ah0, bl2)) | 0;
  19931. hi = (hi + Math.imul(ah0, bh2)) | 0;
  19932. var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19933. c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
  19934. w2 &= 0x3ffffff;
  19935. /* k = 3 */
  19936. lo = Math.imul(al3, bl0);
  19937. mid = Math.imul(al3, bh0);
  19938. mid = (mid + Math.imul(ah3, bl0)) | 0;
  19939. hi = Math.imul(ah3, bh0);
  19940. lo = (lo + Math.imul(al2, bl1)) | 0;
  19941. mid = (mid + Math.imul(al2, bh1)) | 0;
  19942. mid = (mid + Math.imul(ah2, bl1)) | 0;
  19943. hi = (hi + Math.imul(ah2, bh1)) | 0;
  19944. lo = (lo + Math.imul(al1, bl2)) | 0;
  19945. mid = (mid + Math.imul(al1, bh2)) | 0;
  19946. mid = (mid + Math.imul(ah1, bl2)) | 0;
  19947. hi = (hi + Math.imul(ah1, bh2)) | 0;
  19948. lo = (lo + Math.imul(al0, bl3)) | 0;
  19949. mid = (mid + Math.imul(al0, bh3)) | 0;
  19950. mid = (mid + Math.imul(ah0, bl3)) | 0;
  19951. hi = (hi + Math.imul(ah0, bh3)) | 0;
  19952. var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19953. c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
  19954. w3 &= 0x3ffffff;
  19955. /* k = 4 */
  19956. lo = Math.imul(al4, bl0);
  19957. mid = Math.imul(al4, bh0);
  19958. mid = (mid + Math.imul(ah4, bl0)) | 0;
  19959. hi = Math.imul(ah4, bh0);
  19960. lo = (lo + Math.imul(al3, bl1)) | 0;
  19961. mid = (mid + Math.imul(al3, bh1)) | 0;
  19962. mid = (mid + Math.imul(ah3, bl1)) | 0;
  19963. hi = (hi + Math.imul(ah3, bh1)) | 0;
  19964. lo = (lo + Math.imul(al2, bl2)) | 0;
  19965. mid = (mid + Math.imul(al2, bh2)) | 0;
  19966. mid = (mid + Math.imul(ah2, bl2)) | 0;
  19967. hi = (hi + Math.imul(ah2, bh2)) | 0;
  19968. lo = (lo + Math.imul(al1, bl3)) | 0;
  19969. mid = (mid + Math.imul(al1, bh3)) | 0;
  19970. mid = (mid + Math.imul(ah1, bl3)) | 0;
  19971. hi = (hi + Math.imul(ah1, bh3)) | 0;
  19972. lo = (lo + Math.imul(al0, bl4)) | 0;
  19973. mid = (mid + Math.imul(al0, bh4)) | 0;
  19974. mid = (mid + Math.imul(ah0, bl4)) | 0;
  19975. hi = (hi + Math.imul(ah0, bh4)) | 0;
  19976. var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  19977. c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
  19978. w4 &= 0x3ffffff;
  19979. /* k = 5 */
  19980. lo = Math.imul(al5, bl0);
  19981. mid = Math.imul(al5, bh0);
  19982. mid = (mid + Math.imul(ah5, bl0)) | 0;
  19983. hi = Math.imul(ah5, bh0);
  19984. lo = (lo + Math.imul(al4, bl1)) | 0;
  19985. mid = (mid + Math.imul(al4, bh1)) | 0;
  19986. mid = (mid + Math.imul(ah4, bl1)) | 0;
  19987. hi = (hi + Math.imul(ah4, bh1)) | 0;
  19988. lo = (lo + Math.imul(al3, bl2)) | 0;
  19989. mid = (mid + Math.imul(al3, bh2)) | 0;
  19990. mid = (mid + Math.imul(ah3, bl2)) | 0;
  19991. hi = (hi + Math.imul(ah3, bh2)) | 0;
  19992. lo = (lo + Math.imul(al2, bl3)) | 0;
  19993. mid = (mid + Math.imul(al2, bh3)) | 0;
  19994. mid = (mid + Math.imul(ah2, bl3)) | 0;
  19995. hi = (hi + Math.imul(ah2, bh3)) | 0;
  19996. lo = (lo + Math.imul(al1, bl4)) | 0;
  19997. mid = (mid + Math.imul(al1, bh4)) | 0;
  19998. mid = (mid + Math.imul(ah1, bl4)) | 0;
  19999. hi = (hi + Math.imul(ah1, bh4)) | 0;
  20000. lo = (lo + Math.imul(al0, bl5)) | 0;
  20001. mid = (mid + Math.imul(al0, bh5)) | 0;
  20002. mid = (mid + Math.imul(ah0, bl5)) | 0;
  20003. hi = (hi + Math.imul(ah0, bh5)) | 0;
  20004. var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20005. c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
  20006. w5 &= 0x3ffffff;
  20007. /* k = 6 */
  20008. lo = Math.imul(al6, bl0);
  20009. mid = Math.imul(al6, bh0);
  20010. mid = (mid + Math.imul(ah6, bl0)) | 0;
  20011. hi = Math.imul(ah6, bh0);
  20012. lo = (lo + Math.imul(al5, bl1)) | 0;
  20013. mid = (mid + Math.imul(al5, bh1)) | 0;
  20014. mid = (mid + Math.imul(ah5, bl1)) | 0;
  20015. hi = (hi + Math.imul(ah5, bh1)) | 0;
  20016. lo = (lo + Math.imul(al4, bl2)) | 0;
  20017. mid = (mid + Math.imul(al4, bh2)) | 0;
  20018. mid = (mid + Math.imul(ah4, bl2)) | 0;
  20019. hi = (hi + Math.imul(ah4, bh2)) | 0;
  20020. lo = (lo + Math.imul(al3, bl3)) | 0;
  20021. mid = (mid + Math.imul(al3, bh3)) | 0;
  20022. mid = (mid + Math.imul(ah3, bl3)) | 0;
  20023. hi = (hi + Math.imul(ah3, bh3)) | 0;
  20024. lo = (lo + Math.imul(al2, bl4)) | 0;
  20025. mid = (mid + Math.imul(al2, bh4)) | 0;
  20026. mid = (mid + Math.imul(ah2, bl4)) | 0;
  20027. hi = (hi + Math.imul(ah2, bh4)) | 0;
  20028. lo = (lo + Math.imul(al1, bl5)) | 0;
  20029. mid = (mid + Math.imul(al1, bh5)) | 0;
  20030. mid = (mid + Math.imul(ah1, bl5)) | 0;
  20031. hi = (hi + Math.imul(ah1, bh5)) | 0;
  20032. lo = (lo + Math.imul(al0, bl6)) | 0;
  20033. mid = (mid + Math.imul(al0, bh6)) | 0;
  20034. mid = (mid + Math.imul(ah0, bl6)) | 0;
  20035. hi = (hi + Math.imul(ah0, bh6)) | 0;
  20036. var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20037. c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
  20038. w6 &= 0x3ffffff;
  20039. /* k = 7 */
  20040. lo = Math.imul(al7, bl0);
  20041. mid = Math.imul(al7, bh0);
  20042. mid = (mid + Math.imul(ah7, bl0)) | 0;
  20043. hi = Math.imul(ah7, bh0);
  20044. lo = (lo + Math.imul(al6, bl1)) | 0;
  20045. mid = (mid + Math.imul(al6, bh1)) | 0;
  20046. mid = (mid + Math.imul(ah6, bl1)) | 0;
  20047. hi = (hi + Math.imul(ah6, bh1)) | 0;
  20048. lo = (lo + Math.imul(al5, bl2)) | 0;
  20049. mid = (mid + Math.imul(al5, bh2)) | 0;
  20050. mid = (mid + Math.imul(ah5, bl2)) | 0;
  20051. hi = (hi + Math.imul(ah5, bh2)) | 0;
  20052. lo = (lo + Math.imul(al4, bl3)) | 0;
  20053. mid = (mid + Math.imul(al4, bh3)) | 0;
  20054. mid = (mid + Math.imul(ah4, bl3)) | 0;
  20055. hi = (hi + Math.imul(ah4, bh3)) | 0;
  20056. lo = (lo + Math.imul(al3, bl4)) | 0;
  20057. mid = (mid + Math.imul(al3, bh4)) | 0;
  20058. mid = (mid + Math.imul(ah3, bl4)) | 0;
  20059. hi = (hi + Math.imul(ah3, bh4)) | 0;
  20060. lo = (lo + Math.imul(al2, bl5)) | 0;
  20061. mid = (mid + Math.imul(al2, bh5)) | 0;
  20062. mid = (mid + Math.imul(ah2, bl5)) | 0;
  20063. hi = (hi + Math.imul(ah2, bh5)) | 0;
  20064. lo = (lo + Math.imul(al1, bl6)) | 0;
  20065. mid = (mid + Math.imul(al1, bh6)) | 0;
  20066. mid = (mid + Math.imul(ah1, bl6)) | 0;
  20067. hi = (hi + Math.imul(ah1, bh6)) | 0;
  20068. lo = (lo + Math.imul(al0, bl7)) | 0;
  20069. mid = (mid + Math.imul(al0, bh7)) | 0;
  20070. mid = (mid + Math.imul(ah0, bl7)) | 0;
  20071. hi = (hi + Math.imul(ah0, bh7)) | 0;
  20072. var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20073. c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
  20074. w7 &= 0x3ffffff;
  20075. /* k = 8 */
  20076. lo = Math.imul(al8, bl0);
  20077. mid = Math.imul(al8, bh0);
  20078. mid = (mid + Math.imul(ah8, bl0)) | 0;
  20079. hi = Math.imul(ah8, bh0);
  20080. lo = (lo + Math.imul(al7, bl1)) | 0;
  20081. mid = (mid + Math.imul(al7, bh1)) | 0;
  20082. mid = (mid + Math.imul(ah7, bl1)) | 0;
  20083. hi = (hi + Math.imul(ah7, bh1)) | 0;
  20084. lo = (lo + Math.imul(al6, bl2)) | 0;
  20085. mid = (mid + Math.imul(al6, bh2)) | 0;
  20086. mid = (mid + Math.imul(ah6, bl2)) | 0;
  20087. hi = (hi + Math.imul(ah6, bh2)) | 0;
  20088. lo = (lo + Math.imul(al5, bl3)) | 0;
  20089. mid = (mid + Math.imul(al5, bh3)) | 0;
  20090. mid = (mid + Math.imul(ah5, bl3)) | 0;
  20091. hi = (hi + Math.imul(ah5, bh3)) | 0;
  20092. lo = (lo + Math.imul(al4, bl4)) | 0;
  20093. mid = (mid + Math.imul(al4, bh4)) | 0;
  20094. mid = (mid + Math.imul(ah4, bl4)) | 0;
  20095. hi = (hi + Math.imul(ah4, bh4)) | 0;
  20096. lo = (lo + Math.imul(al3, bl5)) | 0;
  20097. mid = (mid + Math.imul(al3, bh5)) | 0;
  20098. mid = (mid + Math.imul(ah3, bl5)) | 0;
  20099. hi = (hi + Math.imul(ah3, bh5)) | 0;
  20100. lo = (lo + Math.imul(al2, bl6)) | 0;
  20101. mid = (mid + Math.imul(al2, bh6)) | 0;
  20102. mid = (mid + Math.imul(ah2, bl6)) | 0;
  20103. hi = (hi + Math.imul(ah2, bh6)) | 0;
  20104. lo = (lo + Math.imul(al1, bl7)) | 0;
  20105. mid = (mid + Math.imul(al1, bh7)) | 0;
  20106. mid = (mid + Math.imul(ah1, bl7)) | 0;
  20107. hi = (hi + Math.imul(ah1, bh7)) | 0;
  20108. lo = (lo + Math.imul(al0, bl8)) | 0;
  20109. mid = (mid + Math.imul(al0, bh8)) | 0;
  20110. mid = (mid + Math.imul(ah0, bl8)) | 0;
  20111. hi = (hi + Math.imul(ah0, bh8)) | 0;
  20112. var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20113. c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
  20114. w8 &= 0x3ffffff;
  20115. /* k = 9 */
  20116. lo = Math.imul(al9, bl0);
  20117. mid = Math.imul(al9, bh0);
  20118. mid = (mid + Math.imul(ah9, bl0)) | 0;
  20119. hi = Math.imul(ah9, bh0);
  20120. lo = (lo + Math.imul(al8, bl1)) | 0;
  20121. mid = (mid + Math.imul(al8, bh1)) | 0;
  20122. mid = (mid + Math.imul(ah8, bl1)) | 0;
  20123. hi = (hi + Math.imul(ah8, bh1)) | 0;
  20124. lo = (lo + Math.imul(al7, bl2)) | 0;
  20125. mid = (mid + Math.imul(al7, bh2)) | 0;
  20126. mid = (mid + Math.imul(ah7, bl2)) | 0;
  20127. hi = (hi + Math.imul(ah7, bh2)) | 0;
  20128. lo = (lo + Math.imul(al6, bl3)) | 0;
  20129. mid = (mid + Math.imul(al6, bh3)) | 0;
  20130. mid = (mid + Math.imul(ah6, bl3)) | 0;
  20131. hi = (hi + Math.imul(ah6, bh3)) | 0;
  20132. lo = (lo + Math.imul(al5, bl4)) | 0;
  20133. mid = (mid + Math.imul(al5, bh4)) | 0;
  20134. mid = (mid + Math.imul(ah5, bl4)) | 0;
  20135. hi = (hi + Math.imul(ah5, bh4)) | 0;
  20136. lo = (lo + Math.imul(al4, bl5)) | 0;
  20137. mid = (mid + Math.imul(al4, bh5)) | 0;
  20138. mid = (mid + Math.imul(ah4, bl5)) | 0;
  20139. hi = (hi + Math.imul(ah4, bh5)) | 0;
  20140. lo = (lo + Math.imul(al3, bl6)) | 0;
  20141. mid = (mid + Math.imul(al3, bh6)) | 0;
  20142. mid = (mid + Math.imul(ah3, bl6)) | 0;
  20143. hi = (hi + Math.imul(ah3, bh6)) | 0;
  20144. lo = (lo + Math.imul(al2, bl7)) | 0;
  20145. mid = (mid + Math.imul(al2, bh7)) | 0;
  20146. mid = (mid + Math.imul(ah2, bl7)) | 0;
  20147. hi = (hi + Math.imul(ah2, bh7)) | 0;
  20148. lo = (lo + Math.imul(al1, bl8)) | 0;
  20149. mid = (mid + Math.imul(al1, bh8)) | 0;
  20150. mid = (mid + Math.imul(ah1, bl8)) | 0;
  20151. hi = (hi + Math.imul(ah1, bh8)) | 0;
  20152. lo = (lo + Math.imul(al0, bl9)) | 0;
  20153. mid = (mid + Math.imul(al0, bh9)) | 0;
  20154. mid = (mid + Math.imul(ah0, bl9)) | 0;
  20155. hi = (hi + Math.imul(ah0, bh9)) | 0;
  20156. var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20157. c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
  20158. w9 &= 0x3ffffff;
  20159. /* k = 10 */
  20160. lo = Math.imul(al9, bl1);
  20161. mid = Math.imul(al9, bh1);
  20162. mid = (mid + Math.imul(ah9, bl1)) | 0;
  20163. hi = Math.imul(ah9, bh1);
  20164. lo = (lo + Math.imul(al8, bl2)) | 0;
  20165. mid = (mid + Math.imul(al8, bh2)) | 0;
  20166. mid = (mid + Math.imul(ah8, bl2)) | 0;
  20167. hi = (hi + Math.imul(ah8, bh2)) | 0;
  20168. lo = (lo + Math.imul(al7, bl3)) | 0;
  20169. mid = (mid + Math.imul(al7, bh3)) | 0;
  20170. mid = (mid + Math.imul(ah7, bl3)) | 0;
  20171. hi = (hi + Math.imul(ah7, bh3)) | 0;
  20172. lo = (lo + Math.imul(al6, bl4)) | 0;
  20173. mid = (mid + Math.imul(al6, bh4)) | 0;
  20174. mid = (mid + Math.imul(ah6, bl4)) | 0;
  20175. hi = (hi + Math.imul(ah6, bh4)) | 0;
  20176. lo = (lo + Math.imul(al5, bl5)) | 0;
  20177. mid = (mid + Math.imul(al5, bh5)) | 0;
  20178. mid = (mid + Math.imul(ah5, bl5)) | 0;
  20179. hi = (hi + Math.imul(ah5, bh5)) | 0;
  20180. lo = (lo + Math.imul(al4, bl6)) | 0;
  20181. mid = (mid + Math.imul(al4, bh6)) | 0;
  20182. mid = (mid + Math.imul(ah4, bl6)) | 0;
  20183. hi = (hi + Math.imul(ah4, bh6)) | 0;
  20184. lo = (lo + Math.imul(al3, bl7)) | 0;
  20185. mid = (mid + Math.imul(al3, bh7)) | 0;
  20186. mid = (mid + Math.imul(ah3, bl7)) | 0;
  20187. hi = (hi + Math.imul(ah3, bh7)) | 0;
  20188. lo = (lo + Math.imul(al2, bl8)) | 0;
  20189. mid = (mid + Math.imul(al2, bh8)) | 0;
  20190. mid = (mid + Math.imul(ah2, bl8)) | 0;
  20191. hi = (hi + Math.imul(ah2, bh8)) | 0;
  20192. lo = (lo + Math.imul(al1, bl9)) | 0;
  20193. mid = (mid + Math.imul(al1, bh9)) | 0;
  20194. mid = (mid + Math.imul(ah1, bl9)) | 0;
  20195. hi = (hi + Math.imul(ah1, bh9)) | 0;
  20196. var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20197. c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
  20198. w10 &= 0x3ffffff;
  20199. /* k = 11 */
  20200. lo = Math.imul(al9, bl2);
  20201. mid = Math.imul(al9, bh2);
  20202. mid = (mid + Math.imul(ah9, bl2)) | 0;
  20203. hi = Math.imul(ah9, bh2);
  20204. lo = (lo + Math.imul(al8, bl3)) | 0;
  20205. mid = (mid + Math.imul(al8, bh3)) | 0;
  20206. mid = (mid + Math.imul(ah8, bl3)) | 0;
  20207. hi = (hi + Math.imul(ah8, bh3)) | 0;
  20208. lo = (lo + Math.imul(al7, bl4)) | 0;
  20209. mid = (mid + Math.imul(al7, bh4)) | 0;
  20210. mid = (mid + Math.imul(ah7, bl4)) | 0;
  20211. hi = (hi + Math.imul(ah7, bh4)) | 0;
  20212. lo = (lo + Math.imul(al6, bl5)) | 0;
  20213. mid = (mid + Math.imul(al6, bh5)) | 0;
  20214. mid = (mid + Math.imul(ah6, bl5)) | 0;
  20215. hi = (hi + Math.imul(ah6, bh5)) | 0;
  20216. lo = (lo + Math.imul(al5, bl6)) | 0;
  20217. mid = (mid + Math.imul(al5, bh6)) | 0;
  20218. mid = (mid + Math.imul(ah5, bl6)) | 0;
  20219. hi = (hi + Math.imul(ah5, bh6)) | 0;
  20220. lo = (lo + Math.imul(al4, bl7)) | 0;
  20221. mid = (mid + Math.imul(al4, bh7)) | 0;
  20222. mid = (mid + Math.imul(ah4, bl7)) | 0;
  20223. hi = (hi + Math.imul(ah4, bh7)) | 0;
  20224. lo = (lo + Math.imul(al3, bl8)) | 0;
  20225. mid = (mid + Math.imul(al3, bh8)) | 0;
  20226. mid = (mid + Math.imul(ah3, bl8)) | 0;
  20227. hi = (hi + Math.imul(ah3, bh8)) | 0;
  20228. lo = (lo + Math.imul(al2, bl9)) | 0;
  20229. mid = (mid + Math.imul(al2, bh9)) | 0;
  20230. mid = (mid + Math.imul(ah2, bl9)) | 0;
  20231. hi = (hi + Math.imul(ah2, bh9)) | 0;
  20232. var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20233. c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
  20234. w11 &= 0x3ffffff;
  20235. /* k = 12 */
  20236. lo = Math.imul(al9, bl3);
  20237. mid = Math.imul(al9, bh3);
  20238. mid = (mid + Math.imul(ah9, bl3)) | 0;
  20239. hi = Math.imul(ah9, bh3);
  20240. lo = (lo + Math.imul(al8, bl4)) | 0;
  20241. mid = (mid + Math.imul(al8, bh4)) | 0;
  20242. mid = (mid + Math.imul(ah8, bl4)) | 0;
  20243. hi = (hi + Math.imul(ah8, bh4)) | 0;
  20244. lo = (lo + Math.imul(al7, bl5)) | 0;
  20245. mid = (mid + Math.imul(al7, bh5)) | 0;
  20246. mid = (mid + Math.imul(ah7, bl5)) | 0;
  20247. hi = (hi + Math.imul(ah7, bh5)) | 0;
  20248. lo = (lo + Math.imul(al6, bl6)) | 0;
  20249. mid = (mid + Math.imul(al6, bh6)) | 0;
  20250. mid = (mid + Math.imul(ah6, bl6)) | 0;
  20251. hi = (hi + Math.imul(ah6, bh6)) | 0;
  20252. lo = (lo + Math.imul(al5, bl7)) | 0;
  20253. mid = (mid + Math.imul(al5, bh7)) | 0;
  20254. mid = (mid + Math.imul(ah5, bl7)) | 0;
  20255. hi = (hi + Math.imul(ah5, bh7)) | 0;
  20256. lo = (lo + Math.imul(al4, bl8)) | 0;
  20257. mid = (mid + Math.imul(al4, bh8)) | 0;
  20258. mid = (mid + Math.imul(ah4, bl8)) | 0;
  20259. hi = (hi + Math.imul(ah4, bh8)) | 0;
  20260. lo = (lo + Math.imul(al3, bl9)) | 0;
  20261. mid = (mid + Math.imul(al3, bh9)) | 0;
  20262. mid = (mid + Math.imul(ah3, bl9)) | 0;
  20263. hi = (hi + Math.imul(ah3, bh9)) | 0;
  20264. var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20265. c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
  20266. w12 &= 0x3ffffff;
  20267. /* k = 13 */
  20268. lo = Math.imul(al9, bl4);
  20269. mid = Math.imul(al9, bh4);
  20270. mid = (mid + Math.imul(ah9, bl4)) | 0;
  20271. hi = Math.imul(ah9, bh4);
  20272. lo = (lo + Math.imul(al8, bl5)) | 0;
  20273. mid = (mid + Math.imul(al8, bh5)) | 0;
  20274. mid = (mid + Math.imul(ah8, bl5)) | 0;
  20275. hi = (hi + Math.imul(ah8, bh5)) | 0;
  20276. lo = (lo + Math.imul(al7, bl6)) | 0;
  20277. mid = (mid + Math.imul(al7, bh6)) | 0;
  20278. mid = (mid + Math.imul(ah7, bl6)) | 0;
  20279. hi = (hi + Math.imul(ah7, bh6)) | 0;
  20280. lo = (lo + Math.imul(al6, bl7)) | 0;
  20281. mid = (mid + Math.imul(al6, bh7)) | 0;
  20282. mid = (mid + Math.imul(ah6, bl7)) | 0;
  20283. hi = (hi + Math.imul(ah6, bh7)) | 0;
  20284. lo = (lo + Math.imul(al5, bl8)) | 0;
  20285. mid = (mid + Math.imul(al5, bh8)) | 0;
  20286. mid = (mid + Math.imul(ah5, bl8)) | 0;
  20287. hi = (hi + Math.imul(ah5, bh8)) | 0;
  20288. lo = (lo + Math.imul(al4, bl9)) | 0;
  20289. mid = (mid + Math.imul(al4, bh9)) | 0;
  20290. mid = (mid + Math.imul(ah4, bl9)) | 0;
  20291. hi = (hi + Math.imul(ah4, bh9)) | 0;
  20292. var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20293. c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
  20294. w13 &= 0x3ffffff;
  20295. /* k = 14 */
  20296. lo = Math.imul(al9, bl5);
  20297. mid = Math.imul(al9, bh5);
  20298. mid = (mid + Math.imul(ah9, bl5)) | 0;
  20299. hi = Math.imul(ah9, bh5);
  20300. lo = (lo + Math.imul(al8, bl6)) | 0;
  20301. mid = (mid + Math.imul(al8, bh6)) | 0;
  20302. mid = (mid + Math.imul(ah8, bl6)) | 0;
  20303. hi = (hi + Math.imul(ah8, bh6)) | 0;
  20304. lo = (lo + Math.imul(al7, bl7)) | 0;
  20305. mid = (mid + Math.imul(al7, bh7)) | 0;
  20306. mid = (mid + Math.imul(ah7, bl7)) | 0;
  20307. hi = (hi + Math.imul(ah7, bh7)) | 0;
  20308. lo = (lo + Math.imul(al6, bl8)) | 0;
  20309. mid = (mid + Math.imul(al6, bh8)) | 0;
  20310. mid = (mid + Math.imul(ah6, bl8)) | 0;
  20311. hi = (hi + Math.imul(ah6, bh8)) | 0;
  20312. lo = (lo + Math.imul(al5, bl9)) | 0;
  20313. mid = (mid + Math.imul(al5, bh9)) | 0;
  20314. mid = (mid + Math.imul(ah5, bl9)) | 0;
  20315. hi = (hi + Math.imul(ah5, bh9)) | 0;
  20316. var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20317. c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
  20318. w14 &= 0x3ffffff;
  20319. /* k = 15 */
  20320. lo = Math.imul(al9, bl6);
  20321. mid = Math.imul(al9, bh6);
  20322. mid = (mid + Math.imul(ah9, bl6)) | 0;
  20323. hi = Math.imul(ah9, bh6);
  20324. lo = (lo + Math.imul(al8, bl7)) | 0;
  20325. mid = (mid + Math.imul(al8, bh7)) | 0;
  20326. mid = (mid + Math.imul(ah8, bl7)) | 0;
  20327. hi = (hi + Math.imul(ah8, bh7)) | 0;
  20328. lo = (lo + Math.imul(al7, bl8)) | 0;
  20329. mid = (mid + Math.imul(al7, bh8)) | 0;
  20330. mid = (mid + Math.imul(ah7, bl8)) | 0;
  20331. hi = (hi + Math.imul(ah7, bh8)) | 0;
  20332. lo = (lo + Math.imul(al6, bl9)) | 0;
  20333. mid = (mid + Math.imul(al6, bh9)) | 0;
  20334. mid = (mid + Math.imul(ah6, bl9)) | 0;
  20335. hi = (hi + Math.imul(ah6, bh9)) | 0;
  20336. var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20337. c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
  20338. w15 &= 0x3ffffff;
  20339. /* k = 16 */
  20340. lo = Math.imul(al9, bl7);
  20341. mid = Math.imul(al9, bh7);
  20342. mid = (mid + Math.imul(ah9, bl7)) | 0;
  20343. hi = Math.imul(ah9, bh7);
  20344. lo = (lo + Math.imul(al8, bl8)) | 0;
  20345. mid = (mid + Math.imul(al8, bh8)) | 0;
  20346. mid = (mid + Math.imul(ah8, bl8)) | 0;
  20347. hi = (hi + Math.imul(ah8, bh8)) | 0;
  20348. lo = (lo + Math.imul(al7, bl9)) | 0;
  20349. mid = (mid + Math.imul(al7, bh9)) | 0;
  20350. mid = (mid + Math.imul(ah7, bl9)) | 0;
  20351. hi = (hi + Math.imul(ah7, bh9)) | 0;
  20352. var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20353. c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
  20354. w16 &= 0x3ffffff;
  20355. /* k = 17 */
  20356. lo = Math.imul(al9, bl8);
  20357. mid = Math.imul(al9, bh8);
  20358. mid = (mid + Math.imul(ah9, bl8)) | 0;
  20359. hi = Math.imul(ah9, bh8);
  20360. lo = (lo + Math.imul(al8, bl9)) | 0;
  20361. mid = (mid + Math.imul(al8, bh9)) | 0;
  20362. mid = (mid + Math.imul(ah8, bl9)) | 0;
  20363. hi = (hi + Math.imul(ah8, bh9)) | 0;
  20364. var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20365. c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
  20366. w17 &= 0x3ffffff;
  20367. /* k = 18 */
  20368. lo = Math.imul(al9, bl9);
  20369. mid = Math.imul(al9, bh9);
  20370. mid = (mid + Math.imul(ah9, bl9)) | 0;
  20371. hi = Math.imul(ah9, bh9);
  20372. var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
  20373. c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
  20374. w18 &= 0x3ffffff;
  20375. o[0] = w0;
  20376. o[1] = w1;
  20377. o[2] = w2;
  20378. o[3] = w3;
  20379. o[4] = w4;
  20380. o[5] = w5;
  20381. o[6] = w6;
  20382. o[7] = w7;
  20383. o[8] = w8;
  20384. o[9] = w9;
  20385. o[10] = w10;
  20386. o[11] = w11;
  20387. o[12] = w12;
  20388. o[13] = w13;
  20389. o[14] = w14;
  20390. o[15] = w15;
  20391. o[16] = w16;
  20392. o[17] = w17;
  20393. o[18] = w18;
  20394. if (c !== 0) {
  20395. o[19] = c;
  20396. out.length++;
  20397. }
  20398. return out;
  20399. };
  20400. // Polyfill comb
  20401. if (!Math.imul) {
  20402. comb10MulTo = smallMulTo;
  20403. }
  20404. function bigMulTo (self, num, out) {
  20405. out.negative = num.negative ^ self.negative;
  20406. out.length = self.length + num.length;
  20407. var carry = 0;
  20408. var hncarry = 0;
  20409. for (var k = 0; k < out.length - 1; k++) {
  20410. // Sum all words with the same `i + j = k` and accumulate `ncarry`,
  20411. // note that ncarry could be >= 0x3ffffff
  20412. var ncarry = hncarry;
  20413. hncarry = 0;
  20414. var rword = carry & 0x3ffffff;
  20415. var maxJ = Math.min(k, num.length - 1);
  20416. for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
  20417. var i = k - j;
  20418. var a = self.words[i] | 0;
  20419. var b = num.words[j] | 0;
  20420. var r = a * b;
  20421. var lo = r & 0x3ffffff;
  20422. ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
  20423. lo = (lo + rword) | 0;
  20424. rword = lo & 0x3ffffff;
  20425. ncarry = (ncarry + (lo >>> 26)) | 0;
  20426. hncarry += ncarry >>> 26;
  20427. ncarry &= 0x3ffffff;
  20428. }
  20429. out.words[k] = rword;
  20430. carry = ncarry;
  20431. ncarry = hncarry;
  20432. }
  20433. if (carry !== 0) {
  20434. out.words[k] = carry;
  20435. } else {
  20436. out.length--;
  20437. }
  20438. return out._strip();
  20439. }
  20440. function jumboMulTo (self, num, out) {
  20441. // Temporary disable, see https://github.com/indutny/bn.js/issues/211
  20442. // var fftm = new FFTM();
  20443. // return fftm.mulp(self, num, out);
  20444. return bigMulTo(self, num, out);
  20445. }
  20446. BN.prototype.mulTo = function mulTo (num, out) {
  20447. var res;
  20448. var len = this.length + num.length;
  20449. if (this.length === 10 && num.length === 10) {
  20450. res = comb10MulTo(this, num, out);
  20451. } else if (len < 63) {
  20452. res = smallMulTo(this, num, out);
  20453. } else if (len < 1024) {
  20454. res = bigMulTo(this, num, out);
  20455. } else {
  20456. res = jumboMulTo(this, num, out);
  20457. }
  20458. return res;
  20459. };
  20460. // Cooley-Tukey algorithm for FFT
  20461. // slightly revisited to rely on looping instead of recursion
  20462. function FFTM (x, y) {
  20463. this.x = x;
  20464. this.y = y;
  20465. }
  20466. FFTM.prototype.makeRBT = function makeRBT (N) {
  20467. var t = new Array(N);
  20468. var l = BN.prototype._countBits(N) - 1;
  20469. for (var i = 0; i < N; i++) {
  20470. t[i] = this.revBin(i, l, N);
  20471. }
  20472. return t;
  20473. };
  20474. // Returns binary-reversed representation of `x`
  20475. FFTM.prototype.revBin = function revBin (x, l, N) {
  20476. if (x === 0 || x === N - 1) return x;
  20477. var rb = 0;
  20478. for (var i = 0; i < l; i++) {
  20479. rb |= (x & 1) << (l - i - 1);
  20480. x >>= 1;
  20481. }
  20482. return rb;
  20483. };
  20484. // Performs "tweedling" phase, therefore 'emulating'
  20485. // behaviour of the recursive algorithm
  20486. FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
  20487. for (var i = 0; i < N; i++) {
  20488. rtws[i] = rws[rbt[i]];
  20489. itws[i] = iws[rbt[i]];
  20490. }
  20491. };
  20492. FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
  20493. this.permute(rbt, rws, iws, rtws, itws, N);
  20494. for (var s = 1; s < N; s <<= 1) {
  20495. var l = s << 1;
  20496. var rtwdf = Math.cos(2 * Math.PI / l);
  20497. var itwdf = Math.sin(2 * Math.PI / l);
  20498. for (var p = 0; p < N; p += l) {
  20499. var rtwdf_ = rtwdf;
  20500. var itwdf_ = itwdf;
  20501. for (var j = 0; j < s; j++) {
  20502. var re = rtws[p + j];
  20503. var ie = itws[p + j];
  20504. var ro = rtws[p + j + s];
  20505. var io = itws[p + j + s];
  20506. var rx = rtwdf_ * ro - itwdf_ * io;
  20507. io = rtwdf_ * io + itwdf_ * ro;
  20508. ro = rx;
  20509. rtws[p + j] = re + ro;
  20510. itws[p + j] = ie + io;
  20511. rtws[p + j + s] = re - ro;
  20512. itws[p + j + s] = ie - io;
  20513. /* jshint maxdepth : false */
  20514. if (j !== l) {
  20515. rx = rtwdf * rtwdf_ - itwdf * itwdf_;
  20516. itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
  20517. rtwdf_ = rx;
  20518. }
  20519. }
  20520. }
  20521. }
  20522. };
  20523. FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
  20524. var N = Math.max(m, n) | 1;
  20525. var odd = N & 1;
  20526. var i = 0;
  20527. for (N = N / 2 | 0; N; N = N >>> 1) {
  20528. i++;
  20529. }
  20530. return 1 << i + 1 + odd;
  20531. };
  20532. FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
  20533. if (N <= 1) return;
  20534. for (var i = 0; i < N / 2; i++) {
  20535. var t = rws[i];
  20536. rws[i] = rws[N - i - 1];
  20537. rws[N - i - 1] = t;
  20538. t = iws[i];
  20539. iws[i] = -iws[N - i - 1];
  20540. iws[N - i - 1] = -t;
  20541. }
  20542. };
  20543. FFTM.prototype.normalize13b = function normalize13b (ws, N) {
  20544. var carry = 0;
  20545. for (var i = 0; i < N / 2; i++) {
  20546. var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
  20547. Math.round(ws[2 * i] / N) +
  20548. carry;
  20549. ws[i] = w & 0x3ffffff;
  20550. if (w < 0x4000000) {
  20551. carry = 0;
  20552. } else {
  20553. carry = w / 0x4000000 | 0;
  20554. }
  20555. }
  20556. return ws;
  20557. };
  20558. FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
  20559. var carry = 0;
  20560. for (var i = 0; i < len; i++) {
  20561. carry = carry + (ws[i] | 0);
  20562. rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
  20563. rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
  20564. }
  20565. // Pad with zeroes
  20566. for (i = 2 * len; i < N; ++i) {
  20567. rws[i] = 0;
  20568. }
  20569. assert(carry === 0);
  20570. assert((carry & ~0x1fff) === 0);
  20571. };
  20572. FFTM.prototype.stub = function stub (N) {
  20573. var ph = new Array(N);
  20574. for (var i = 0; i < N; i++) {
  20575. ph[i] = 0;
  20576. }
  20577. return ph;
  20578. };
  20579. FFTM.prototype.mulp = function mulp (x, y, out) {
  20580. var N = 2 * this.guessLen13b(x.length, y.length);
  20581. var rbt = this.makeRBT(N);
  20582. var _ = this.stub(N);
  20583. var rws = new Array(N);
  20584. var rwst = new Array(N);
  20585. var iwst = new Array(N);
  20586. var nrws = new Array(N);
  20587. var nrwst = new Array(N);
  20588. var niwst = new Array(N);
  20589. var rmws = out.words;
  20590. rmws.length = N;
  20591. this.convert13b(x.words, x.length, rws, N);
  20592. this.convert13b(y.words, y.length, nrws, N);
  20593. this.transform(rws, _, rwst, iwst, N, rbt);
  20594. this.transform(nrws, _, nrwst, niwst, N, rbt);
  20595. for (var i = 0; i < N; i++) {
  20596. var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
  20597. iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
  20598. rwst[i] = rx;
  20599. }
  20600. this.conjugate(rwst, iwst, N);
  20601. this.transform(rwst, iwst, rmws, _, N, rbt);
  20602. this.conjugate(rmws, _, N);
  20603. this.normalize13b(rmws, N);
  20604. out.negative = x.negative ^ y.negative;
  20605. out.length = x.length + y.length;
  20606. return out._strip();
  20607. };
  20608. // Multiply `this` by `num`
  20609. BN.prototype.mul = function mul (num) {
  20610. var out = new BN(null);
  20611. out.words = new Array(this.length + num.length);
  20612. return this.mulTo(num, out);
  20613. };
  20614. // Multiply employing FFT
  20615. BN.prototype.mulf = function mulf (num) {
  20616. var out = new BN(null);
  20617. out.words = new Array(this.length + num.length);
  20618. return jumboMulTo(this, num, out);
  20619. };
  20620. // In-place Multiplication
  20621. BN.prototype.imul = function imul (num) {
  20622. return this.clone().mulTo(num, this);
  20623. };
  20624. BN.prototype.imuln = function imuln (num) {
  20625. var isNegNum = num < 0;
  20626. if (isNegNum) num = -num;
  20627. assert(typeof num === 'number');
  20628. assert(num < 0x4000000);
  20629. // Carry
  20630. var carry = 0;
  20631. for (var i = 0; i < this.length; i++) {
  20632. var w = (this.words[i] | 0) * num;
  20633. var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
  20634. carry >>= 26;
  20635. carry += (w / 0x4000000) | 0;
  20636. // NOTE: lo is 27bit maximum
  20637. carry += lo >>> 26;
  20638. this.words[i] = lo & 0x3ffffff;
  20639. }
  20640. if (carry !== 0) {
  20641. this.words[i] = carry;
  20642. this.length++;
  20643. }
  20644. return isNegNum ? this.ineg() : this;
  20645. };
  20646. BN.prototype.muln = function muln (num) {
  20647. return this.clone().imuln(num);
  20648. };
  20649. // `this` * `this`
  20650. BN.prototype.sqr = function sqr () {
  20651. return this.mul(this);
  20652. };
  20653. // `this` * `this` in-place
  20654. BN.prototype.isqr = function isqr () {
  20655. return this.imul(this.clone());
  20656. };
  20657. // Math.pow(`this`, `num`)
  20658. BN.prototype.pow = function pow (num) {
  20659. var w = toBitArray(num);
  20660. if (w.length === 0) return new BN(1);
  20661. // Skip leading zeroes
  20662. var res = this;
  20663. for (var i = 0; i < w.length; i++, res = res.sqr()) {
  20664. if (w[i] !== 0) break;
  20665. }
  20666. if (++i < w.length) {
  20667. for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
  20668. if (w[i] === 0) continue;
  20669. res = res.mul(q);
  20670. }
  20671. }
  20672. return res;
  20673. };
  20674. // Shift-left in-place
  20675. BN.prototype.iushln = function iushln (bits) {
  20676. assert(typeof bits === 'number' && bits >= 0);
  20677. var r = bits % 26;
  20678. var s = (bits - r) / 26;
  20679. var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
  20680. var i;
  20681. if (r !== 0) {
  20682. var carry = 0;
  20683. for (i = 0; i < this.length; i++) {
  20684. var newCarry = this.words[i] & carryMask;
  20685. var c = ((this.words[i] | 0) - newCarry) << r;
  20686. this.words[i] = c | carry;
  20687. carry = newCarry >>> (26 - r);
  20688. }
  20689. if (carry) {
  20690. this.words[i] = carry;
  20691. this.length++;
  20692. }
  20693. }
  20694. if (s !== 0) {
  20695. for (i = this.length - 1; i >= 0; i--) {
  20696. this.words[i + s] = this.words[i];
  20697. }
  20698. for (i = 0; i < s; i++) {
  20699. this.words[i] = 0;
  20700. }
  20701. this.length += s;
  20702. }
  20703. return this._strip();
  20704. };
  20705. BN.prototype.ishln = function ishln (bits) {
  20706. // TODO(indutny): implement me
  20707. assert(this.negative === 0);
  20708. return this.iushln(bits);
  20709. };
  20710. // Shift-right in-place
  20711. // NOTE: `hint` is a lowest bit before trailing zeroes
  20712. // NOTE: if `extended` is present - it will be filled with destroyed bits
  20713. BN.prototype.iushrn = function iushrn (bits, hint, extended) {
  20714. assert(typeof bits === 'number' && bits >= 0);
  20715. var h;
  20716. if (hint) {
  20717. h = (hint - (hint % 26)) / 26;
  20718. } else {
  20719. h = 0;
  20720. }
  20721. var r = bits % 26;
  20722. var s = Math.min((bits - r) / 26, this.length);
  20723. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  20724. var maskedWords = extended;
  20725. h -= s;
  20726. h = Math.max(0, h);
  20727. // Extended mode, copy masked part
  20728. if (maskedWords) {
  20729. for (var i = 0; i < s; i++) {
  20730. maskedWords.words[i] = this.words[i];
  20731. }
  20732. maskedWords.length = s;
  20733. }
  20734. if (s === 0) {
  20735. // No-op, we should not move anything at all
  20736. } else if (this.length > s) {
  20737. this.length -= s;
  20738. for (i = 0; i < this.length; i++) {
  20739. this.words[i] = this.words[i + s];
  20740. }
  20741. } else {
  20742. this.words[0] = 0;
  20743. this.length = 1;
  20744. }
  20745. var carry = 0;
  20746. for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
  20747. var word = this.words[i] | 0;
  20748. this.words[i] = (carry << (26 - r)) | (word >>> r);
  20749. carry = word & mask;
  20750. }
  20751. // Push carried bits as a mask
  20752. if (maskedWords && carry !== 0) {
  20753. maskedWords.words[maskedWords.length++] = carry;
  20754. }
  20755. if (this.length === 0) {
  20756. this.words[0] = 0;
  20757. this.length = 1;
  20758. }
  20759. return this._strip();
  20760. };
  20761. BN.prototype.ishrn = function ishrn (bits, hint, extended) {
  20762. // TODO(indutny): implement me
  20763. assert(this.negative === 0);
  20764. return this.iushrn(bits, hint, extended);
  20765. };
  20766. // Shift-left
  20767. BN.prototype.shln = function shln (bits) {
  20768. return this.clone().ishln(bits);
  20769. };
  20770. BN.prototype.ushln = function ushln (bits) {
  20771. return this.clone().iushln(bits);
  20772. };
  20773. // Shift-right
  20774. BN.prototype.shrn = function shrn (bits) {
  20775. return this.clone().ishrn(bits);
  20776. };
  20777. BN.prototype.ushrn = function ushrn (bits) {
  20778. return this.clone().iushrn(bits);
  20779. };
  20780. // Test if n bit is set
  20781. BN.prototype.testn = function testn (bit) {
  20782. assert(typeof bit === 'number' && bit >= 0);
  20783. var r = bit % 26;
  20784. var s = (bit - r) / 26;
  20785. var q = 1 << r;
  20786. // Fast case: bit is much higher than all existing words
  20787. if (this.length <= s) return false;
  20788. // Check bit and return
  20789. var w = this.words[s];
  20790. return !!(w & q);
  20791. };
  20792. // Return only lowers bits of number (in-place)
  20793. BN.prototype.imaskn = function imaskn (bits) {
  20794. assert(typeof bits === 'number' && bits >= 0);
  20795. var r = bits % 26;
  20796. var s = (bits - r) / 26;
  20797. assert(this.negative === 0, 'imaskn works only with positive numbers');
  20798. if (this.length <= s) {
  20799. return this;
  20800. }
  20801. if (r !== 0) {
  20802. s++;
  20803. }
  20804. this.length = Math.min(s, this.length);
  20805. if (r !== 0) {
  20806. var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
  20807. this.words[this.length - 1] &= mask;
  20808. }
  20809. return this._strip();
  20810. };
  20811. // Return only lowers bits of number
  20812. BN.prototype.maskn = function maskn (bits) {
  20813. return this.clone().imaskn(bits);
  20814. };
  20815. // Add plain number `num` to `this`
  20816. BN.prototype.iaddn = function iaddn (num) {
  20817. assert(typeof num === 'number');
  20818. assert(num < 0x4000000);
  20819. if (num < 0) return this.isubn(-num);
  20820. // Possible sign change
  20821. if (this.negative !== 0) {
  20822. if (this.length === 1 && (this.words[0] | 0) <= num) {
  20823. this.words[0] = num - (this.words[0] | 0);
  20824. this.negative = 0;
  20825. return this;
  20826. }
  20827. this.negative = 0;
  20828. this.isubn(num);
  20829. this.negative = 1;
  20830. return this;
  20831. }
  20832. // Add without checks
  20833. return this._iaddn(num);
  20834. };
  20835. BN.prototype._iaddn = function _iaddn (num) {
  20836. this.words[0] += num;
  20837. // Carry
  20838. for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
  20839. this.words[i] -= 0x4000000;
  20840. if (i === this.length - 1) {
  20841. this.words[i + 1] = 1;
  20842. } else {
  20843. this.words[i + 1]++;
  20844. }
  20845. }
  20846. this.length = Math.max(this.length, i + 1);
  20847. return this;
  20848. };
  20849. // Subtract plain number `num` from `this`
  20850. BN.prototype.isubn = function isubn (num) {
  20851. assert(typeof num === 'number');
  20852. assert(num < 0x4000000);
  20853. if (num < 0) return this.iaddn(-num);
  20854. if (this.negative !== 0) {
  20855. this.negative = 0;
  20856. this.iaddn(num);
  20857. this.negative = 1;
  20858. return this;
  20859. }
  20860. this.words[0] -= num;
  20861. if (this.length === 1 && this.words[0] < 0) {
  20862. this.words[0] = -this.words[0];
  20863. this.negative = 1;
  20864. } else {
  20865. // Carry
  20866. for (var i = 0; i < this.length && this.words[i] < 0; i++) {
  20867. this.words[i] += 0x4000000;
  20868. this.words[i + 1] -= 1;
  20869. }
  20870. }
  20871. return this._strip();
  20872. };
  20873. BN.prototype.addn = function addn (num) {
  20874. return this.clone().iaddn(num);
  20875. };
  20876. BN.prototype.subn = function subn (num) {
  20877. return this.clone().isubn(num);
  20878. };
  20879. BN.prototype.iabs = function iabs () {
  20880. this.negative = 0;
  20881. return this;
  20882. };
  20883. BN.prototype.abs = function abs () {
  20884. return this.clone().iabs();
  20885. };
  20886. BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
  20887. var len = num.length + shift;
  20888. var i;
  20889. this._expand(len);
  20890. var w;
  20891. var carry = 0;
  20892. for (i = 0; i < num.length; i++) {
  20893. w = (this.words[i + shift] | 0) + carry;
  20894. var right = (num.words[i] | 0) * mul;
  20895. w -= right & 0x3ffffff;
  20896. carry = (w >> 26) - ((right / 0x4000000) | 0);
  20897. this.words[i + shift] = w & 0x3ffffff;
  20898. }
  20899. for (; i < this.length - shift; i++) {
  20900. w = (this.words[i + shift] | 0) + carry;
  20901. carry = w >> 26;
  20902. this.words[i + shift] = w & 0x3ffffff;
  20903. }
  20904. if (carry === 0) return this._strip();
  20905. // Subtraction overflow
  20906. assert(carry === -1);
  20907. carry = 0;
  20908. for (i = 0; i < this.length; i++) {
  20909. w = -(this.words[i] | 0) + carry;
  20910. carry = w >> 26;
  20911. this.words[i] = w & 0x3ffffff;
  20912. }
  20913. this.negative = 1;
  20914. return this._strip();
  20915. };
  20916. BN.prototype._wordDiv = function _wordDiv (num, mode) {
  20917. var shift = this.length - num.length;
  20918. var a = this.clone();
  20919. var b = num;
  20920. // Normalize
  20921. var bhi = b.words[b.length - 1] | 0;
  20922. var bhiBits = this._countBits(bhi);
  20923. shift = 26 - bhiBits;
  20924. if (shift !== 0) {
  20925. b = b.ushln(shift);
  20926. a.iushln(shift);
  20927. bhi = b.words[b.length - 1] | 0;
  20928. }
  20929. // Initialize quotient
  20930. var m = a.length - b.length;
  20931. var q;
  20932. if (mode !== 'mod') {
  20933. q = new BN(null);
  20934. q.length = m + 1;
  20935. q.words = new Array(q.length);
  20936. for (var i = 0; i < q.length; i++) {
  20937. q.words[i] = 0;
  20938. }
  20939. }
  20940. var diff = a.clone()._ishlnsubmul(b, 1, m);
  20941. if (diff.negative === 0) {
  20942. a = diff;
  20943. if (q) {
  20944. q.words[m] = 1;
  20945. }
  20946. }
  20947. for (var j = m - 1; j >= 0; j--) {
  20948. var qj = (a.words[b.length + j] | 0) * 0x4000000 +
  20949. (a.words[b.length + j - 1] | 0);
  20950. // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
  20951. // (0x7ffffff)
  20952. qj = Math.min((qj / bhi) | 0, 0x3ffffff);
  20953. a._ishlnsubmul(b, qj, j);
  20954. while (a.negative !== 0) {
  20955. qj--;
  20956. a.negative = 0;
  20957. a._ishlnsubmul(b, 1, j);
  20958. if (!a.isZero()) {
  20959. a.negative ^= 1;
  20960. }
  20961. }
  20962. if (q) {
  20963. q.words[j] = qj;
  20964. }
  20965. }
  20966. if (q) {
  20967. q._strip();
  20968. }
  20969. a._strip();
  20970. // Denormalize
  20971. if (mode !== 'div' && shift !== 0) {
  20972. a.iushrn(shift);
  20973. }
  20974. return {
  20975. div: q || null,
  20976. mod: a
  20977. };
  20978. };
  20979. // NOTE: 1) `mode` can be set to `mod` to request mod only,
  20980. // to `div` to request div only, or be absent to
  20981. // request both div & mod
  20982. // 2) `positive` is true if unsigned mod is requested
  20983. BN.prototype.divmod = function divmod (num, mode, positive) {
  20984. assert(!num.isZero());
  20985. if (this.isZero()) {
  20986. return {
  20987. div: new BN(0),
  20988. mod: new BN(0)
  20989. };
  20990. }
  20991. var div, mod, res;
  20992. if (this.negative !== 0 && num.negative === 0) {
  20993. res = this.neg().divmod(num, mode);
  20994. if (mode !== 'mod') {
  20995. div = res.div.neg();
  20996. }
  20997. if (mode !== 'div') {
  20998. mod = res.mod.neg();
  20999. if (positive && mod.negative !== 0) {
  21000. mod.iadd(num);
  21001. }
  21002. }
  21003. return {
  21004. div: div,
  21005. mod: mod
  21006. };
  21007. }
  21008. if (this.negative === 0 && num.negative !== 0) {
  21009. res = this.divmod(num.neg(), mode);
  21010. if (mode !== 'mod') {
  21011. div = res.div.neg();
  21012. }
  21013. return {
  21014. div: div,
  21015. mod: res.mod
  21016. };
  21017. }
  21018. if ((this.negative & num.negative) !== 0) {
  21019. res = this.neg().divmod(num.neg(), mode);
  21020. if (mode !== 'div') {
  21021. mod = res.mod.neg();
  21022. if (positive && mod.negative !== 0) {
  21023. mod.isub(num);
  21024. }
  21025. }
  21026. return {
  21027. div: res.div,
  21028. mod: mod
  21029. };
  21030. }
  21031. // Both numbers are positive at this point
  21032. // Strip both numbers to approximate shift value
  21033. if (num.length > this.length || this.cmp(num) < 0) {
  21034. return {
  21035. div: new BN(0),
  21036. mod: this
  21037. };
  21038. }
  21039. // Very short reduction
  21040. if (num.length === 1) {
  21041. if (mode === 'div') {
  21042. return {
  21043. div: this.divn(num.words[0]),
  21044. mod: null
  21045. };
  21046. }
  21047. if (mode === 'mod') {
  21048. return {
  21049. div: null,
  21050. mod: new BN(this.modrn(num.words[0]))
  21051. };
  21052. }
  21053. return {
  21054. div: this.divn(num.words[0]),
  21055. mod: new BN(this.modrn(num.words[0]))
  21056. };
  21057. }
  21058. return this._wordDiv(num, mode);
  21059. };
  21060. // Find `this` / `num`
  21061. BN.prototype.div = function div (num) {
  21062. return this.divmod(num, 'div', false).div;
  21063. };
  21064. // Find `this` % `num`
  21065. BN.prototype.mod = function mod (num) {
  21066. return this.divmod(num, 'mod', false).mod;
  21067. };
  21068. BN.prototype.umod = function umod (num) {
  21069. return this.divmod(num, 'mod', true).mod;
  21070. };
  21071. // Find Round(`this` / `num`)
  21072. BN.prototype.divRound = function divRound (num) {
  21073. var dm = this.divmod(num);
  21074. // Fast case - exact division
  21075. if (dm.mod.isZero()) return dm.div;
  21076. var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
  21077. var half = num.ushrn(1);
  21078. var r2 = num.andln(1);
  21079. var cmp = mod.cmp(half);
  21080. // Round down
  21081. if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;
  21082. // Round up
  21083. return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
  21084. };
  21085. BN.prototype.modrn = function modrn (num) {
  21086. var isNegNum = num < 0;
  21087. if (isNegNum) num = -num;
  21088. assert(num <= 0x3ffffff);
  21089. var p = (1 << 26) % num;
  21090. var acc = 0;
  21091. for (var i = this.length - 1; i >= 0; i--) {
  21092. acc = (p * acc + (this.words[i] | 0)) % num;
  21093. }
  21094. return isNegNum ? -acc : acc;
  21095. };
  21096. // WARNING: DEPRECATED
  21097. BN.prototype.modn = function modn (num) {
  21098. return this.modrn(num);
  21099. };
  21100. // In-place division by number
  21101. BN.prototype.idivn = function idivn (num) {
  21102. var isNegNum = num < 0;
  21103. if (isNegNum) num = -num;
  21104. assert(num <= 0x3ffffff);
  21105. var carry = 0;
  21106. for (var i = this.length - 1; i >= 0; i--) {
  21107. var w = (this.words[i] | 0) + carry * 0x4000000;
  21108. this.words[i] = (w / num) | 0;
  21109. carry = w % num;
  21110. }
  21111. this._strip();
  21112. return isNegNum ? this.ineg() : this;
  21113. };
  21114. BN.prototype.divn = function divn (num) {
  21115. return this.clone().idivn(num);
  21116. };
  21117. BN.prototype.egcd = function egcd (p) {
  21118. assert(p.negative === 0);
  21119. assert(!p.isZero());
  21120. var x = this;
  21121. var y = p.clone();
  21122. if (x.negative !== 0) {
  21123. x = x.umod(p);
  21124. } else {
  21125. x = x.clone();
  21126. }
  21127. // A * x + B * y = x
  21128. var A = new BN(1);
  21129. var B = new BN(0);
  21130. // C * x + D * y = y
  21131. var C = new BN(0);
  21132. var D = new BN(1);
  21133. var g = 0;
  21134. while (x.isEven() && y.isEven()) {
  21135. x.iushrn(1);
  21136. y.iushrn(1);
  21137. ++g;
  21138. }
  21139. var yp = y.clone();
  21140. var xp = x.clone();
  21141. while (!x.isZero()) {
  21142. for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  21143. if (i > 0) {
  21144. x.iushrn(i);
  21145. while (i-- > 0) {
  21146. if (A.isOdd() || B.isOdd()) {
  21147. A.iadd(yp);
  21148. B.isub(xp);
  21149. }
  21150. A.iushrn(1);
  21151. B.iushrn(1);
  21152. }
  21153. }
  21154. for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  21155. if (j > 0) {
  21156. y.iushrn(j);
  21157. while (j-- > 0) {
  21158. if (C.isOdd() || D.isOdd()) {
  21159. C.iadd(yp);
  21160. D.isub(xp);
  21161. }
  21162. C.iushrn(1);
  21163. D.iushrn(1);
  21164. }
  21165. }
  21166. if (x.cmp(y) >= 0) {
  21167. x.isub(y);
  21168. A.isub(C);
  21169. B.isub(D);
  21170. } else {
  21171. y.isub(x);
  21172. C.isub(A);
  21173. D.isub(B);
  21174. }
  21175. }
  21176. return {
  21177. a: C,
  21178. b: D,
  21179. gcd: y.iushln(g)
  21180. };
  21181. };
  21182. // This is reduced incarnation of the binary EEA
  21183. // above, designated to invert members of the
  21184. // _prime_ fields F(p) at a maximal speed
  21185. BN.prototype._invmp = function _invmp (p) {
  21186. assert(p.negative === 0);
  21187. assert(!p.isZero());
  21188. var a = this;
  21189. var b = p.clone();
  21190. if (a.negative !== 0) {
  21191. a = a.umod(p);
  21192. } else {
  21193. a = a.clone();
  21194. }
  21195. var x1 = new BN(1);
  21196. var x2 = new BN(0);
  21197. var delta = b.clone();
  21198. while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
  21199. for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
  21200. if (i > 0) {
  21201. a.iushrn(i);
  21202. while (i-- > 0) {
  21203. if (x1.isOdd()) {
  21204. x1.iadd(delta);
  21205. }
  21206. x1.iushrn(1);
  21207. }
  21208. }
  21209. for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
  21210. if (j > 0) {
  21211. b.iushrn(j);
  21212. while (j-- > 0) {
  21213. if (x2.isOdd()) {
  21214. x2.iadd(delta);
  21215. }
  21216. x2.iushrn(1);
  21217. }
  21218. }
  21219. if (a.cmp(b) >= 0) {
  21220. a.isub(b);
  21221. x1.isub(x2);
  21222. } else {
  21223. b.isub(a);
  21224. x2.isub(x1);
  21225. }
  21226. }
  21227. var res;
  21228. if (a.cmpn(1) === 0) {
  21229. res = x1;
  21230. } else {
  21231. res = x2;
  21232. }
  21233. if (res.cmpn(0) < 0) {
  21234. res.iadd(p);
  21235. }
  21236. return res;
  21237. };
  21238. BN.prototype.gcd = function gcd (num) {
  21239. if (this.isZero()) return num.abs();
  21240. if (num.isZero()) return this.abs();
  21241. var a = this.clone();
  21242. var b = num.clone();
  21243. a.negative = 0;
  21244. b.negative = 0;
  21245. // Remove common factor of two
  21246. for (var shift = 0; a.isEven() && b.isEven(); shift++) {
  21247. a.iushrn(1);
  21248. b.iushrn(1);
  21249. }
  21250. do {
  21251. while (a.isEven()) {
  21252. a.iushrn(1);
  21253. }
  21254. while (b.isEven()) {
  21255. b.iushrn(1);
  21256. }
  21257. var r = a.cmp(b);
  21258. if (r < 0) {
  21259. // Swap `a` and `b` to make `a` always bigger than `b`
  21260. var t = a;
  21261. a = b;
  21262. b = t;
  21263. } else if (r === 0 || b.cmpn(1) === 0) {
  21264. break;
  21265. }
  21266. a.isub(b);
  21267. } while (true);
  21268. return b.iushln(shift);
  21269. };
  21270. // Invert number in the field F(num)
  21271. BN.prototype.invm = function invm (num) {
  21272. return this.egcd(num).a.umod(num);
  21273. };
  21274. BN.prototype.isEven = function isEven () {
  21275. return (this.words[0] & 1) === 0;
  21276. };
  21277. BN.prototype.isOdd = function isOdd () {
  21278. return (this.words[0] & 1) === 1;
  21279. };
  21280. // And first word and num
  21281. BN.prototype.andln = function andln (num) {
  21282. return this.words[0] & num;
  21283. };
  21284. // Increment at the bit position in-line
  21285. BN.prototype.bincn = function bincn (bit) {
  21286. assert(typeof bit === 'number');
  21287. var r = bit % 26;
  21288. var s = (bit - r) / 26;
  21289. var q = 1 << r;
  21290. // Fast case: bit is much higher than all existing words
  21291. if (this.length <= s) {
  21292. this._expand(s + 1);
  21293. this.words[s] |= q;
  21294. return this;
  21295. }
  21296. // Add bit and propagate, if needed
  21297. var carry = q;
  21298. for (var i = s; carry !== 0 && i < this.length; i++) {
  21299. var w = this.words[i] | 0;
  21300. w += carry;
  21301. carry = w >>> 26;
  21302. w &= 0x3ffffff;
  21303. this.words[i] = w;
  21304. }
  21305. if (carry !== 0) {
  21306. this.words[i] = carry;
  21307. this.length++;
  21308. }
  21309. return this;
  21310. };
  21311. BN.prototype.isZero = function isZero () {
  21312. return this.length === 1 && this.words[0] === 0;
  21313. };
  21314. BN.prototype.cmpn = function cmpn (num) {
  21315. var negative = num < 0;
  21316. if (this.negative !== 0 && !negative) return -1;
  21317. if (this.negative === 0 && negative) return 1;
  21318. this._strip();
  21319. var res;
  21320. if (this.length > 1) {
  21321. res = 1;
  21322. } else {
  21323. if (negative) {
  21324. num = -num;
  21325. }
  21326. assert(num <= 0x3ffffff, 'Number is too big');
  21327. var w = this.words[0] | 0;
  21328. res = w === num ? 0 : w < num ? -1 : 1;
  21329. }
  21330. if (this.negative !== 0) return -res | 0;
  21331. return res;
  21332. };
  21333. // Compare two numbers and return:
  21334. // 1 - if `this` > `num`
  21335. // 0 - if `this` == `num`
  21336. // -1 - if `this` < `num`
  21337. BN.prototype.cmp = function cmp (num) {
  21338. if (this.negative !== 0 && num.negative === 0) return -1;
  21339. if (this.negative === 0 && num.negative !== 0) return 1;
  21340. var res = this.ucmp(num);
  21341. if (this.negative !== 0) return -res | 0;
  21342. return res;
  21343. };
  21344. // Unsigned comparison
  21345. BN.prototype.ucmp = function ucmp (num) {
  21346. // At this point both numbers have the same sign
  21347. if (this.length > num.length) return 1;
  21348. if (this.length < num.length) return -1;
  21349. var res = 0;
  21350. for (var i = this.length - 1; i >= 0; i--) {
  21351. var a = this.words[i] | 0;
  21352. var b = num.words[i] | 0;
  21353. if (a === b) continue;
  21354. if (a < b) {
  21355. res = -1;
  21356. } else if (a > b) {
  21357. res = 1;
  21358. }
  21359. break;
  21360. }
  21361. return res;
  21362. };
  21363. BN.prototype.gtn = function gtn (num) {
  21364. return this.cmpn(num) === 1;
  21365. };
  21366. BN.prototype.gt = function gt (num) {
  21367. return this.cmp(num) === 1;
  21368. };
  21369. BN.prototype.gten = function gten (num) {
  21370. return this.cmpn(num) >= 0;
  21371. };
  21372. BN.prototype.gte = function gte (num) {
  21373. return this.cmp(num) >= 0;
  21374. };
  21375. BN.prototype.ltn = function ltn (num) {
  21376. return this.cmpn(num) === -1;
  21377. };
  21378. BN.prototype.lt = function lt (num) {
  21379. return this.cmp(num) === -1;
  21380. };
  21381. BN.prototype.lten = function lten (num) {
  21382. return this.cmpn(num) <= 0;
  21383. };
  21384. BN.prototype.lte = function lte (num) {
  21385. return this.cmp(num) <= 0;
  21386. };
  21387. BN.prototype.eqn = function eqn (num) {
  21388. return this.cmpn(num) === 0;
  21389. };
  21390. BN.prototype.eq = function eq (num) {
  21391. return this.cmp(num) === 0;
  21392. };
  21393. //
  21394. // A reduce context, could be using montgomery or something better, depending
  21395. // on the `m` itself.
  21396. //
  21397. BN.red = function red (num) {
  21398. return new Red(num);
  21399. };
  21400. BN.prototype.toRed = function toRed (ctx) {
  21401. assert(!this.red, 'Already a number in reduction context');
  21402. assert(this.negative === 0, 'red works only with positives');
  21403. return ctx.convertTo(this)._forceRed(ctx);
  21404. };
  21405. BN.prototype.fromRed = function fromRed () {
  21406. assert(this.red, 'fromRed works only with numbers in reduction context');
  21407. return this.red.convertFrom(this);
  21408. };
  21409. BN.prototype._forceRed = function _forceRed (ctx) {
  21410. this.red = ctx;
  21411. return this;
  21412. };
  21413. BN.prototype.forceRed = function forceRed (ctx) {
  21414. assert(!this.red, 'Already a number in reduction context');
  21415. return this._forceRed(ctx);
  21416. };
  21417. BN.prototype.redAdd = function redAdd (num) {
  21418. assert(this.red, 'redAdd works only with red numbers');
  21419. return this.red.add(this, num);
  21420. };
  21421. BN.prototype.redIAdd = function redIAdd (num) {
  21422. assert(this.red, 'redIAdd works only with red numbers');
  21423. return this.red.iadd(this, num);
  21424. };
  21425. BN.prototype.redSub = function redSub (num) {
  21426. assert(this.red, 'redSub works only with red numbers');
  21427. return this.red.sub(this, num);
  21428. };
  21429. BN.prototype.redISub = function redISub (num) {
  21430. assert(this.red, 'redISub works only with red numbers');
  21431. return this.red.isub(this, num);
  21432. };
  21433. BN.prototype.redShl = function redShl (num) {
  21434. assert(this.red, 'redShl works only with red numbers');
  21435. return this.red.shl(this, num);
  21436. };
  21437. BN.prototype.redMul = function redMul (num) {
  21438. assert(this.red, 'redMul works only with red numbers');
  21439. this.red._verify2(this, num);
  21440. return this.red.mul(this, num);
  21441. };
  21442. BN.prototype.redIMul = function redIMul (num) {
  21443. assert(this.red, 'redMul works only with red numbers');
  21444. this.red._verify2(this, num);
  21445. return this.red.imul(this, num);
  21446. };
  21447. BN.prototype.redSqr = function redSqr () {
  21448. assert(this.red, 'redSqr works only with red numbers');
  21449. this.red._verify1(this);
  21450. return this.red.sqr(this);
  21451. };
  21452. BN.prototype.redISqr = function redISqr () {
  21453. assert(this.red, 'redISqr works only with red numbers');
  21454. this.red._verify1(this);
  21455. return this.red.isqr(this);
  21456. };
  21457. // Square root over p
  21458. BN.prototype.redSqrt = function redSqrt () {
  21459. assert(this.red, 'redSqrt works only with red numbers');
  21460. this.red._verify1(this);
  21461. return this.red.sqrt(this);
  21462. };
  21463. BN.prototype.redInvm = function redInvm () {
  21464. assert(this.red, 'redInvm works only with red numbers');
  21465. this.red._verify1(this);
  21466. return this.red.invm(this);
  21467. };
  21468. // Return negative clone of `this` % `red modulo`
  21469. BN.prototype.redNeg = function redNeg () {
  21470. assert(this.red, 'redNeg works only with red numbers');
  21471. this.red._verify1(this);
  21472. return this.red.neg(this);
  21473. };
  21474. BN.prototype.redPow = function redPow (num) {
  21475. assert(this.red && !num.red, 'redPow(normalNum)');
  21476. this.red._verify1(this);
  21477. return this.red.pow(this, num);
  21478. };
  21479. // Prime numbers with efficient reduction
  21480. var primes = {
  21481. k256: null,
  21482. p224: null,
  21483. p192: null,
  21484. p25519: null
  21485. };
  21486. // Pseudo-Mersenne prime
  21487. function MPrime (name, p) {
  21488. // P = 2 ^ N - K
  21489. this.name = name;
  21490. this.p = new BN(p, 16);
  21491. this.n = this.p.bitLength();
  21492. this.k = new BN(1).iushln(this.n).isub(this.p);
  21493. this.tmp = this._tmp();
  21494. }
  21495. MPrime.prototype._tmp = function _tmp () {
  21496. var tmp = new BN(null);
  21497. tmp.words = new Array(Math.ceil(this.n / 13));
  21498. return tmp;
  21499. };
  21500. MPrime.prototype.ireduce = function ireduce (num) {
  21501. // Assumes that `num` is less than `P^2`
  21502. // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
  21503. var r = num;
  21504. var rlen;
  21505. do {
  21506. this.split(r, this.tmp);
  21507. r = this.imulK(r);
  21508. r = r.iadd(this.tmp);
  21509. rlen = r.bitLength();
  21510. } while (rlen > this.n);
  21511. var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
  21512. if (cmp === 0) {
  21513. r.words[0] = 0;
  21514. r.length = 1;
  21515. } else if (cmp > 0) {
  21516. r.isub(this.p);
  21517. } else {
  21518. if (r.strip !== undefined) {
  21519. // r is a BN v4 instance
  21520. r.strip();
  21521. } else {
  21522. // r is a BN v5 instance
  21523. r._strip();
  21524. }
  21525. }
  21526. return r;
  21527. };
  21528. MPrime.prototype.split = function split (input, out) {
  21529. input.iushrn(this.n, 0, out);
  21530. };
  21531. MPrime.prototype.imulK = function imulK (num) {
  21532. return num.imul(this.k);
  21533. };
  21534. function K256 () {
  21535. MPrime.call(
  21536. this,
  21537. 'k256',
  21538. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
  21539. }
  21540. inherits(K256, MPrime);
  21541. K256.prototype.split = function split (input, output) {
  21542. // 256 = 9 * 26 + 22
  21543. var mask = 0x3fffff;
  21544. var outLen = Math.min(input.length, 9);
  21545. for (var i = 0; i < outLen; i++) {
  21546. output.words[i] = input.words[i];
  21547. }
  21548. output.length = outLen;
  21549. if (input.length <= 9) {
  21550. input.words[0] = 0;
  21551. input.length = 1;
  21552. return;
  21553. }
  21554. // Shift by 9 limbs
  21555. var prev = input.words[9];
  21556. output.words[output.length++] = prev & mask;
  21557. for (i = 10; i < input.length; i++) {
  21558. var next = input.words[i] | 0;
  21559. input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
  21560. prev = next;
  21561. }
  21562. prev >>>= 22;
  21563. input.words[i - 10] = prev;
  21564. if (prev === 0 && input.length > 10) {
  21565. input.length -= 10;
  21566. } else {
  21567. input.length -= 9;
  21568. }
  21569. };
  21570. K256.prototype.imulK = function imulK (num) {
  21571. // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
  21572. num.words[num.length] = 0;
  21573. num.words[num.length + 1] = 0;
  21574. num.length += 2;
  21575. // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
  21576. var lo = 0;
  21577. for (var i = 0; i < num.length; i++) {
  21578. var w = num.words[i] | 0;
  21579. lo += w * 0x3d1;
  21580. num.words[i] = lo & 0x3ffffff;
  21581. lo = w * 0x40 + ((lo / 0x4000000) | 0);
  21582. }
  21583. // Fast length reduction
  21584. if (num.words[num.length - 1] === 0) {
  21585. num.length--;
  21586. if (num.words[num.length - 1] === 0) {
  21587. num.length--;
  21588. }
  21589. }
  21590. return num;
  21591. };
  21592. function P224 () {
  21593. MPrime.call(
  21594. this,
  21595. 'p224',
  21596. 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
  21597. }
  21598. inherits(P224, MPrime);
  21599. function P192 () {
  21600. MPrime.call(
  21601. this,
  21602. 'p192',
  21603. 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
  21604. }
  21605. inherits(P192, MPrime);
  21606. function P25519 () {
  21607. // 2 ^ 255 - 19
  21608. MPrime.call(
  21609. this,
  21610. '25519',
  21611. '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
  21612. }
  21613. inherits(P25519, MPrime);
  21614. P25519.prototype.imulK = function imulK (num) {
  21615. // K = 0x13
  21616. var carry = 0;
  21617. for (var i = 0; i < num.length; i++) {
  21618. var hi = (num.words[i] | 0) * 0x13 + carry;
  21619. var lo = hi & 0x3ffffff;
  21620. hi >>>= 26;
  21621. num.words[i] = lo;
  21622. carry = hi;
  21623. }
  21624. if (carry !== 0) {
  21625. num.words[num.length++] = carry;
  21626. }
  21627. return num;
  21628. };
  21629. // Exported mostly for testing purposes, use plain name instead
  21630. BN._prime = function prime (name) {
  21631. // Cached version of prime
  21632. if (primes[name]) return primes[name];
  21633. var prime;
  21634. if (name === 'k256') {
  21635. prime = new K256();
  21636. } else if (name === 'p224') {
  21637. prime = new P224();
  21638. } else if (name === 'p192') {
  21639. prime = new P192();
  21640. } else if (name === 'p25519') {
  21641. prime = new P25519();
  21642. } else {
  21643. throw new Error('Unknown prime ' + name);
  21644. }
  21645. primes[name] = prime;
  21646. return prime;
  21647. };
  21648. //
  21649. // Base reduction engine
  21650. //
  21651. function Red (m) {
  21652. if (typeof m === 'string') {
  21653. var prime = BN._prime(m);
  21654. this.m = prime.p;
  21655. this.prime = prime;
  21656. } else {
  21657. assert(m.gtn(1), 'modulus must be greater than 1');
  21658. this.m = m;
  21659. this.prime = null;
  21660. }
  21661. }
  21662. Red.prototype._verify1 = function _verify1 (a) {
  21663. assert(a.negative === 0, 'red works only with positives');
  21664. assert(a.red, 'red works only with red numbers');
  21665. };
  21666. Red.prototype._verify2 = function _verify2 (a, b) {
  21667. assert((a.negative | b.negative) === 0, 'red works only with positives');
  21668. assert(a.red && a.red === b.red,
  21669. 'red works only with red numbers');
  21670. };
  21671. Red.prototype.imod = function imod (a) {
  21672. if (this.prime) return this.prime.ireduce(a)._forceRed(this);
  21673. move(a, a.umod(this.m)._forceRed(this));
  21674. return a;
  21675. };
  21676. Red.prototype.neg = function neg (a) {
  21677. if (a.isZero()) {
  21678. return a.clone();
  21679. }
  21680. return this.m.sub(a)._forceRed(this);
  21681. };
  21682. Red.prototype.add = function add (a, b) {
  21683. this._verify2(a, b);
  21684. var res = a.add(b);
  21685. if (res.cmp(this.m) >= 0) {
  21686. res.isub(this.m);
  21687. }
  21688. return res._forceRed(this);
  21689. };
  21690. Red.prototype.iadd = function iadd (a, b) {
  21691. this._verify2(a, b);
  21692. var res = a.iadd(b);
  21693. if (res.cmp(this.m) >= 0) {
  21694. res.isub(this.m);
  21695. }
  21696. return res;
  21697. };
  21698. Red.prototype.sub = function sub (a, b) {
  21699. this._verify2(a, b);
  21700. var res = a.sub(b);
  21701. if (res.cmpn(0) < 0) {
  21702. res.iadd(this.m);
  21703. }
  21704. return res._forceRed(this);
  21705. };
  21706. Red.prototype.isub = function isub (a, b) {
  21707. this._verify2(a, b);
  21708. var res = a.isub(b);
  21709. if (res.cmpn(0) < 0) {
  21710. res.iadd(this.m);
  21711. }
  21712. return res;
  21713. };
  21714. Red.prototype.shl = function shl (a, num) {
  21715. this._verify1(a);
  21716. return this.imod(a.ushln(num));
  21717. };
  21718. Red.prototype.imul = function imul (a, b) {
  21719. this._verify2(a, b);
  21720. return this.imod(a.imul(b));
  21721. };
  21722. Red.prototype.mul = function mul (a, b) {
  21723. this._verify2(a, b);
  21724. return this.imod(a.mul(b));
  21725. };
  21726. Red.prototype.isqr = function isqr (a) {
  21727. return this.imul(a, a.clone());
  21728. };
  21729. Red.prototype.sqr = function sqr (a) {
  21730. return this.mul(a, a);
  21731. };
  21732. Red.prototype.sqrt = function sqrt (a) {
  21733. if (a.isZero()) return a.clone();
  21734. var mod3 = this.m.andln(3);
  21735. assert(mod3 % 2 === 1);
  21736. // Fast case
  21737. if (mod3 === 3) {
  21738. var pow = this.m.add(new BN(1)).iushrn(2);
  21739. return this.pow(a, pow);
  21740. }
  21741. // Tonelli-Shanks algorithm (Totally unoptimized and slow)
  21742. //
  21743. // Find Q and S, that Q * 2 ^ S = (P - 1)
  21744. var q = this.m.subn(1);
  21745. var s = 0;
  21746. while (!q.isZero() && q.andln(1) === 0) {
  21747. s++;
  21748. q.iushrn(1);
  21749. }
  21750. assert(!q.isZero());
  21751. var one = new BN(1).toRed(this);
  21752. var nOne = one.redNeg();
  21753. // Find quadratic non-residue
  21754. // NOTE: Max is such because of generalized Riemann hypothesis.
  21755. var lpow = this.m.subn(1).iushrn(1);
  21756. var z = this.m.bitLength();
  21757. z = new BN(2 * z * z).toRed(this);
  21758. while (this.pow(z, lpow).cmp(nOne) !== 0) {
  21759. z.redIAdd(nOne);
  21760. }
  21761. var c = this.pow(z, q);
  21762. var r = this.pow(a, q.addn(1).iushrn(1));
  21763. var t = this.pow(a, q);
  21764. var m = s;
  21765. while (t.cmp(one) !== 0) {
  21766. var tmp = t;
  21767. for (var i = 0; tmp.cmp(one) !== 0; i++) {
  21768. tmp = tmp.redSqr();
  21769. }
  21770. assert(i < m);
  21771. var b = this.pow(c, new BN(1).iushln(m - i - 1));
  21772. r = r.redMul(b);
  21773. c = b.redSqr();
  21774. t = t.redMul(c);
  21775. m = i;
  21776. }
  21777. return r;
  21778. };
  21779. Red.prototype.invm = function invm (a) {
  21780. var inv = a._invmp(this.m);
  21781. if (inv.negative !== 0) {
  21782. inv.negative = 0;
  21783. return this.imod(inv).redNeg();
  21784. } else {
  21785. return this.imod(inv);
  21786. }
  21787. };
  21788. Red.prototype.pow = function pow (a, num) {
  21789. if (num.isZero()) return new BN(1).toRed(this);
  21790. if (num.cmpn(1) === 0) return a.clone();
  21791. var windowSize = 4;
  21792. var wnd = new Array(1 << windowSize);
  21793. wnd[0] = new BN(1).toRed(this);
  21794. wnd[1] = a;
  21795. for (var i = 2; i < wnd.length; i++) {
  21796. wnd[i] = this.mul(wnd[i - 1], a);
  21797. }
  21798. var res = wnd[0];
  21799. var current = 0;
  21800. var currentLen = 0;
  21801. var start = num.bitLength() % 26;
  21802. if (start === 0) {
  21803. start = 26;
  21804. }
  21805. for (i = num.length - 1; i >= 0; i--) {
  21806. var word = num.words[i];
  21807. for (var j = start - 1; j >= 0; j--) {
  21808. var bit = (word >> j) & 1;
  21809. if (res !== wnd[0]) {
  21810. res = this.sqr(res);
  21811. }
  21812. if (bit === 0 && current === 0) {
  21813. currentLen = 0;
  21814. continue;
  21815. }
  21816. current <<= 1;
  21817. current |= bit;
  21818. currentLen++;
  21819. if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
  21820. res = this.mul(res, wnd[current]);
  21821. currentLen = 0;
  21822. current = 0;
  21823. }
  21824. start = 26;
  21825. }
  21826. return res;
  21827. };
  21828. Red.prototype.convertTo = function convertTo (num) {
  21829. var r = num.umod(this.m);
  21830. return r === num ? r.clone() : r;
  21831. };
  21832. Red.prototype.convertFrom = function convertFrom (num) {
  21833. var res = num.clone();
  21834. res.red = null;
  21835. return res;
  21836. };
  21837. //
  21838. // Montgomery method engine
  21839. //
  21840. BN.mont = function mont (num) {
  21841. return new Mont(num);
  21842. };
  21843. function Mont (m) {
  21844. Red.call(this, m);
  21845. this.shift = this.m.bitLength();
  21846. if (this.shift % 26 !== 0) {
  21847. this.shift += 26 - (this.shift % 26);
  21848. }
  21849. this.r = new BN(1).iushln(this.shift);
  21850. this.r2 = this.imod(this.r.sqr());
  21851. this.rinv = this.r._invmp(this.m);
  21852. this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
  21853. this.minv = this.minv.umod(this.r);
  21854. this.minv = this.r.sub(this.minv);
  21855. }
  21856. inherits(Mont, Red);
  21857. Mont.prototype.convertTo = function convertTo (num) {
  21858. return this.imod(num.ushln(this.shift));
  21859. };
  21860. Mont.prototype.convertFrom = function convertFrom (num) {
  21861. var r = this.imod(num.mul(this.rinv));
  21862. r.red = null;
  21863. return r;
  21864. };
  21865. Mont.prototype.imul = function imul (a, b) {
  21866. if (a.isZero() || b.isZero()) {
  21867. a.words[0] = 0;
  21868. a.length = 1;
  21869. return a;
  21870. }
  21871. var t = a.imul(b);
  21872. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  21873. var u = t.isub(c).iushrn(this.shift);
  21874. var res = u;
  21875. if (u.cmp(this.m) >= 0) {
  21876. res = u.isub(this.m);
  21877. } else if (u.cmpn(0) < 0) {
  21878. res = u.iadd(this.m);
  21879. }
  21880. return res._forceRed(this);
  21881. };
  21882. Mont.prototype.mul = function mul (a, b) {
  21883. if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
  21884. var t = a.mul(b);
  21885. var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
  21886. var u = t.isub(c).iushrn(this.shift);
  21887. var res = u;
  21888. if (u.cmp(this.m) >= 0) {
  21889. res = u.isub(this.m);
  21890. } else if (u.cmpn(0) < 0) {
  21891. res = u.iadd(this.m);
  21892. }
  21893. return res._forceRed(this);
  21894. };
  21895. Mont.prototype.invm = function invm (a) {
  21896. // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
  21897. var res = this.imod(a._invmp(this.m).mul(this.r2));
  21898. return res._forceRed(this);
  21899. };
  21900. })( false || module, this);
  21901. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ 117)(module)))
  21902. /***/ }),
  21903. /* 117 */
  21904. /*!***********************************!*\
  21905. !*** (webpack)/buildin/module.js ***!
  21906. \***********************************/
  21907. /*! no static exports found */
  21908. /***/ (function(module, exports) {
  21909. module.exports = function(module) {
  21910. if (!module.webpackPolyfill) {
  21911. module.deprecate = function() {};
  21912. module.paths = [];
  21913. // module.parent = undefined by default
  21914. if (!module.children) module.children = [];
  21915. Object.defineProperty(module, "loaded", {
  21916. enumerable: true,
  21917. get: function() {
  21918. return module.l;
  21919. }
  21920. });
  21921. Object.defineProperty(module, "id", {
  21922. enumerable: true,
  21923. get: function() {
  21924. return module.i;
  21925. }
  21926. });
  21927. module.webpackPolyfill = 1;
  21928. }
  21929. return module;
  21930. };
  21931. /***/ }),
  21932. /* 118 */
  21933. /*!************************!*\
  21934. !*** buffer (ignored) ***!
  21935. \************************/
  21936. /*! no static exports found */
  21937. /***/ (function(module, exports) {
  21938. /* (ignored) */
  21939. /***/ }),
  21940. /* 119 */
  21941. /*!*********************************************!*\
  21942. !*** ./node_modules/miller-rabin/lib/mr.js ***!
  21943. \*********************************************/
  21944. /*! no static exports found */
  21945. /***/ (function(module, exports, __webpack_require__) {
  21946. var bn = __webpack_require__(/*! bn.js */ 116);
  21947. var brorand = __webpack_require__(/*! brorand */ 120);
  21948. function MillerRabin(rand) {
  21949. this.rand = rand || new brorand.Rand();
  21950. }
  21951. module.exports = MillerRabin;
  21952. MillerRabin.create = function create(rand) {
  21953. return new MillerRabin(rand);
  21954. };
  21955. MillerRabin.prototype._randbelow = function _randbelow(n) {
  21956. var len = n.bitLength();
  21957. var min_bytes = Math.ceil(len / 8);
  21958. // Generage random bytes until a number less than n is found.
  21959. // This ensures that 0..n-1 have an equal probability of being selected.
  21960. do
  21961. var a = new bn(this.rand.generate(min_bytes));
  21962. while (a.cmp(n) >= 0);
  21963. return a;
  21964. };
  21965. MillerRabin.prototype._randrange = function _randrange(start, stop) {
  21966. // Generate a random number greater than or equal to start and less than stop.
  21967. var size = stop.sub(start);
  21968. return start.add(this._randbelow(size));
  21969. };
  21970. MillerRabin.prototype.test = function test(n, k, cb) {
  21971. var len = n.bitLength();
  21972. var red = bn.mont(n);
  21973. var rone = new bn(1).toRed(red);
  21974. if (!k)
  21975. k = Math.max(1, (len / 48) | 0);
  21976. // Find d and s, (n - 1) = (2 ^ s) * d;
  21977. var n1 = n.subn(1);
  21978. for (var s = 0; !n1.testn(s); s++) {}
  21979. var d = n.shrn(s);
  21980. var rn1 = n1.toRed(red);
  21981. var prime = true;
  21982. for (; k > 0; k--) {
  21983. var a = this._randrange(new bn(2), n1);
  21984. if (cb)
  21985. cb(a);
  21986. var x = a.toRed(red).redPow(d);
  21987. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  21988. continue;
  21989. for (var i = 1; i < s; i++) {
  21990. x = x.redSqr();
  21991. if (x.cmp(rone) === 0)
  21992. return false;
  21993. if (x.cmp(rn1) === 0)
  21994. break;
  21995. }
  21996. if (i === s)
  21997. return false;
  21998. }
  21999. return prime;
  22000. };
  22001. MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
  22002. var len = n.bitLength();
  22003. var red = bn.mont(n);
  22004. var rone = new bn(1).toRed(red);
  22005. if (!k)
  22006. k = Math.max(1, (len / 48) | 0);
  22007. // Find d and s, (n - 1) = (2 ^ s) * d;
  22008. var n1 = n.subn(1);
  22009. for (var s = 0; !n1.testn(s); s++) {}
  22010. var d = n.shrn(s);
  22011. var rn1 = n1.toRed(red);
  22012. for (; k > 0; k--) {
  22013. var a = this._randrange(new bn(2), n1);
  22014. var g = n.gcd(a);
  22015. if (g.cmpn(1) !== 0)
  22016. return g;
  22017. var x = a.toRed(red).redPow(d);
  22018. if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)
  22019. continue;
  22020. for (var i = 1; i < s; i++) {
  22021. x = x.redSqr();
  22022. if (x.cmp(rone) === 0)
  22023. return x.fromRed().subn(1).gcd(n);
  22024. if (x.cmp(rn1) === 0)
  22025. break;
  22026. }
  22027. if (i === s) {
  22028. x = x.redSqr();
  22029. return x.fromRed().subn(1).gcd(n);
  22030. }
  22031. }
  22032. return false;
  22033. };
  22034. /***/ }),
  22035. /* 120 */
  22036. /*!***************************************!*\
  22037. !*** ./node_modules/brorand/index.js ***!
  22038. \***************************************/
  22039. /*! no static exports found */
  22040. /***/ (function(module, exports, __webpack_require__) {
  22041. var r;
  22042. module.exports = function rand(len) {
  22043. if (!r)
  22044. r = new Rand(null);
  22045. return r.generate(len);
  22046. };
  22047. function Rand(rand) {
  22048. this.rand = rand;
  22049. }
  22050. module.exports.Rand = Rand;
  22051. Rand.prototype.generate = function generate(len) {
  22052. return this._rand(len);
  22053. };
  22054. // Emulate crypto API using randy
  22055. Rand.prototype._rand = function _rand(n) {
  22056. if (this.rand.getBytes)
  22057. return this.rand.getBytes(n);
  22058. var res = new Uint8Array(n);
  22059. for (var i = 0; i < res.length; i++)
  22060. res[i] = this.rand.getByte();
  22061. return res;
  22062. };
  22063. if (typeof self === 'object') {
  22064. if (self.crypto && self.crypto.getRandomValues) {
  22065. // Modern browsers
  22066. Rand.prototype._rand = function _rand(n) {
  22067. var arr = new Uint8Array(n);
  22068. self.crypto.getRandomValues(arr);
  22069. return arr;
  22070. };
  22071. } else if (self.msCrypto && self.msCrypto.getRandomValues) {
  22072. // IE
  22073. Rand.prototype._rand = function _rand(n) {
  22074. var arr = new Uint8Array(n);
  22075. self.msCrypto.getRandomValues(arr);
  22076. return arr;
  22077. };
  22078. // Safari's WebWorkers do not have `crypto`
  22079. } else if (typeof window === 'object') {
  22080. // Old junk
  22081. Rand.prototype._rand = function() {
  22082. throw new Error('Not implemented yet');
  22083. };
  22084. }
  22085. } else {
  22086. // Node.js or Web worker with no crypto support
  22087. try {
  22088. var crypto = __webpack_require__(/*! crypto */ 121);
  22089. if (typeof crypto.randomBytes !== 'function')
  22090. throw new Error('Not supported');
  22091. Rand.prototype._rand = function _rand(n) {
  22092. return crypto.randomBytes(n);
  22093. };
  22094. } catch (e) {
  22095. }
  22096. }
  22097. /***/ }),
  22098. /* 121 */
  22099. /*!************************!*\
  22100. !*** crypto (ignored) ***!
  22101. \************************/
  22102. /*! no static exports found */
  22103. /***/ (function(module, exports) {
  22104. /* (ignored) */
  22105. /***/ }),
  22106. /* 122 */
  22107. /*!*****************************************************!*\
  22108. !*** ./node_modules/diffie-hellman/lib/primes.json ***!
  22109. \*****************************************************/
  22110. /*! exports provided: modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, default */
  22111. /***/ (function(module) {
  22112. module.exports = JSON.parse("{\"modp1\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\"},\"modp2\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\"},\"modp5\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\"},\"modp14\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\"},\"modp15\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\"},\"modp16\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\"},\"modp17\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\"},\"modp18\":{\"gen\":\"02\",\"prime\":\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\"}}");
  22113. /***/ }),
  22114. /* 123 */
  22115. /*!***********************************************!*\
  22116. !*** ./node_modules/diffie-hellman/lib/dh.js ***!
  22117. \***********************************************/
  22118. /*! no static exports found */
  22119. /***/ (function(module, exports, __webpack_require__) {
  22120. /* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(/*! bn.js */ 116);
  22121. var MillerRabin = __webpack_require__(/*! miller-rabin */ 119);
  22122. var millerRabin = new MillerRabin();
  22123. var TWENTYFOUR = new BN(24);
  22124. var ELEVEN = new BN(11);
  22125. var TEN = new BN(10);
  22126. var THREE = new BN(3);
  22127. var SEVEN = new BN(7);
  22128. var primes = __webpack_require__(/*! ./generatePrime */ 115);
  22129. var randomBytes = __webpack_require__(/*! randombytes */ 31);
  22130. module.exports = DH;
  22131. function setPublicKey(pub, enc) {
  22132. enc = enc || 'utf8';
  22133. if (!Buffer.isBuffer(pub)) {
  22134. pub = new Buffer(pub, enc);
  22135. }
  22136. this._pub = new BN(pub);
  22137. return this;
  22138. }
  22139. function setPrivateKey(priv, enc) {
  22140. enc = enc || 'utf8';
  22141. if (!Buffer.isBuffer(priv)) {
  22142. priv = new Buffer(priv, enc);
  22143. }
  22144. this._priv = new BN(priv);
  22145. return this;
  22146. }
  22147. var primeCache = {};
  22148. function checkPrime(prime, generator) {
  22149. var gen = generator.toString('hex');
  22150. var hex = [gen, prime.toString(16)].join('_');
  22151. if (hex in primeCache) {
  22152. return primeCache[hex];
  22153. }
  22154. var error = 0;
  22155. if (prime.isEven() ||
  22156. !primes.simpleSieve ||
  22157. !primes.fermatTest(prime) ||
  22158. !millerRabin.test(prime)) {
  22159. //not a prime so +1
  22160. error += 1;
  22161. if (gen === '02' || gen === '05') {
  22162. // we'd be able to check the generator
  22163. // it would fail so +8
  22164. error += 8;
  22165. } else {
  22166. //we wouldn't be able to test the generator
  22167. // so +4
  22168. error += 4;
  22169. }
  22170. primeCache[hex] = error;
  22171. return error;
  22172. }
  22173. if (!millerRabin.test(prime.shrn(1))) {
  22174. //not a safe prime
  22175. error += 2;
  22176. }
  22177. var rem;
  22178. switch (gen) {
  22179. case '02':
  22180. if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
  22181. // unsuidable generator
  22182. error += 8;
  22183. }
  22184. break;
  22185. case '05':
  22186. rem = prime.mod(TEN);
  22187. if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
  22188. // prime mod 10 needs to equal 3 or 7
  22189. error += 8;
  22190. }
  22191. break;
  22192. default:
  22193. error += 4;
  22194. }
  22195. primeCache[hex] = error;
  22196. return error;
  22197. }
  22198. function DH(prime, generator, malleable) {
  22199. this.setGenerator(generator);
  22200. this.__prime = new BN(prime);
  22201. this._prime = BN.mont(this.__prime);
  22202. this._primeLen = prime.length;
  22203. this._pub = undefined;
  22204. this._priv = undefined;
  22205. this._primeCode = undefined;
  22206. if (malleable) {
  22207. this.setPublicKey = setPublicKey;
  22208. this.setPrivateKey = setPrivateKey;
  22209. } else {
  22210. this._primeCode = 8;
  22211. }
  22212. }
  22213. Object.defineProperty(DH.prototype, 'verifyError', {
  22214. enumerable: true,
  22215. get: function () {
  22216. if (typeof this._primeCode !== 'number') {
  22217. this._primeCode = checkPrime(this.__prime, this.__gen);
  22218. }
  22219. return this._primeCode;
  22220. }
  22221. });
  22222. DH.prototype.generateKeys = function () {
  22223. if (!this._priv) {
  22224. this._priv = new BN(randomBytes(this._primeLen));
  22225. }
  22226. this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
  22227. return this.getPublicKey();
  22228. };
  22229. DH.prototype.computeSecret = function (other) {
  22230. other = new BN(other);
  22231. other = other.toRed(this._prime);
  22232. var secret = other.redPow(this._priv).fromRed();
  22233. var out = new Buffer(secret.toArray());
  22234. var prime = this.getPrime();
  22235. if (out.length < prime.length) {
  22236. var front = new Buffer(prime.length - out.length);
  22237. front.fill(0);
  22238. out = Buffer.concat([front, out]);
  22239. }
  22240. return out;
  22241. };
  22242. DH.prototype.getPublicKey = function getPublicKey(enc) {
  22243. return formatReturnValue(this._pub, enc);
  22244. };
  22245. DH.prototype.getPrivateKey = function getPrivateKey(enc) {
  22246. return formatReturnValue(this._priv, enc);
  22247. };
  22248. DH.prototype.getPrime = function (enc) {
  22249. return formatReturnValue(this.__prime, enc);
  22250. };
  22251. DH.prototype.getGenerator = function (enc) {
  22252. return formatReturnValue(this._gen, enc);
  22253. };
  22254. DH.prototype.setGenerator = function (gen, enc) {
  22255. enc = enc || 'utf8';
  22256. if (!Buffer.isBuffer(gen)) {
  22257. gen = new Buffer(gen, enc);
  22258. }
  22259. this.__gen = gen;
  22260. this._gen = new BN(gen);
  22261. return this;
  22262. };
  22263. function formatReturnValue(bn, enc) {
  22264. var buf = new Buffer(bn.toArray());
  22265. if (!enc) {
  22266. return buf;
  22267. } else {
  22268. return buf.toString(enc);
  22269. }
  22270. }
  22271. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ 35).Buffer))
  22272. /***/ }),
  22273. /* 124 */
  22274. /*!*******************************************************!*\
  22275. !*** ./node_modules/browserify-sign/browser/index.js ***!
  22276. \*******************************************************/
  22277. /*! no static exports found */
  22278. /***/ (function(module, exports, __webpack_require__) {
  22279. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  22280. var createHash = __webpack_require__(/*! create-hash */ 39)
  22281. var stream = __webpack_require__(/*! readable-stream */ 43)
  22282. var inherits = __webpack_require__(/*! inherits */ 40)
  22283. var sign = __webpack_require__(/*! ./sign */ 125)
  22284. var verify = __webpack_require__(/*! ./verify */ 178)
  22285. var algorithms = __webpack_require__(/*! ./algorithms.json */ 78)
  22286. Object.keys(algorithms).forEach(function (key) {
  22287. algorithms[key].id = Buffer.from(algorithms[key].id, 'hex')
  22288. algorithms[key.toLowerCase()] = algorithms[key]
  22289. })
  22290. function Sign (algorithm) {
  22291. stream.Writable.call(this)
  22292. var data = algorithms[algorithm]
  22293. if (!data) throw new Error('Unknown message digest')
  22294. this._hashType = data.hash
  22295. this._hash = createHash(data.hash)
  22296. this._tag = data.id
  22297. this._signType = data.sign
  22298. }
  22299. inherits(Sign, stream.Writable)
  22300. Sign.prototype._write = function _write (data, _, done) {
  22301. this._hash.update(data)
  22302. done()
  22303. }
  22304. Sign.prototype.update = function update (data, enc) {
  22305. if (typeof data === 'string') data = Buffer.from(data, enc)
  22306. this._hash.update(data)
  22307. return this
  22308. }
  22309. Sign.prototype.sign = function signMethod (key, enc) {
  22310. this.end()
  22311. var hash = this._hash.digest()
  22312. var sig = sign(hash, key, this._hashType, this._signType, this._tag)
  22313. return enc ? sig.toString(enc) : sig
  22314. }
  22315. function Verify (algorithm) {
  22316. stream.Writable.call(this)
  22317. var data = algorithms[algorithm]
  22318. if (!data) throw new Error('Unknown message digest')
  22319. this._hash = createHash(data.hash)
  22320. this._tag = data.id
  22321. this._signType = data.sign
  22322. }
  22323. inherits(Verify, stream.Writable)
  22324. Verify.prototype._write = function _write (data, _, done) {
  22325. this._hash.update(data)
  22326. done()
  22327. }
  22328. Verify.prototype.update = function update (data, enc) {
  22329. if (typeof data === 'string') data = Buffer.from(data, enc)
  22330. this._hash.update(data)
  22331. return this
  22332. }
  22333. Verify.prototype.verify = function verifyMethod (key, sig, enc) {
  22334. if (typeof sig === 'string') sig = Buffer.from(sig, enc)
  22335. this.end()
  22336. var hash = this._hash.digest()
  22337. return verify(sig, hash, key, this._signType, this._tag)
  22338. }
  22339. function createSign (algorithm) {
  22340. return new Sign(algorithm)
  22341. }
  22342. function createVerify (algorithm) {
  22343. return new Verify(algorithm)
  22344. }
  22345. module.exports = {
  22346. Sign: createSign,
  22347. Verify: createVerify,
  22348. createSign: createSign,
  22349. createVerify: createVerify
  22350. }
  22351. /***/ }),
  22352. /* 125 */
  22353. /*!******************************************************!*\
  22354. !*** ./node_modules/browserify-sign/browser/sign.js ***!
  22355. \******************************************************/
  22356. /*! no static exports found */
  22357. /***/ (function(module, exports, __webpack_require__) {
  22358. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  22359. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  22360. var createHmac = __webpack_require__(/*! create-hmac */ 74)
  22361. var crt = __webpack_require__(/*! browserify-rsa */ 126)
  22362. var EC = __webpack_require__(/*! elliptic */ 127).ec
  22363. var BN = __webpack_require__(/*! bn.js */ 116)
  22364. var parseKeys = __webpack_require__(/*! parse-asn1 */ 157)
  22365. var curves = __webpack_require__(/*! ./curves.json */ 177)
  22366. function sign (hash, key, hashType, signType, tag) {
  22367. var priv = parseKeys(key)
  22368. if (priv.curve) {
  22369. // rsa keys can be interpreted as ecdsa ones in openssl
  22370. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  22371. return ecSign(hash, priv)
  22372. } else if (priv.type === 'dsa') {
  22373. if (signType !== 'dsa') throw new Error('wrong private key type')
  22374. return dsaSign(hash, priv, hashType)
  22375. } else {
  22376. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')
  22377. }
  22378. hash = Buffer.concat([tag, hash])
  22379. var len = priv.modulus.byteLength()
  22380. var pad = [0, 1]
  22381. while (hash.length + pad.length + 1 < len) pad.push(0xff)
  22382. pad.push(0x00)
  22383. var i = -1
  22384. while (++i < hash.length) pad.push(hash[i])
  22385. var out = crt(pad, priv)
  22386. return out
  22387. }
  22388. function ecSign (hash, priv) {
  22389. var curveId = curves[priv.curve.join('.')]
  22390. if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))
  22391. var curve = new EC(curveId)
  22392. var key = curve.keyFromPrivate(priv.privateKey)
  22393. var out = key.sign(hash)
  22394. return Buffer.from(out.toDER())
  22395. }
  22396. function dsaSign (hash, priv, algo) {
  22397. var x = priv.params.priv_key
  22398. var p = priv.params.p
  22399. var q = priv.params.q
  22400. var g = priv.params.g
  22401. var r = new BN(0)
  22402. var k
  22403. var H = bits2int(hash, q).mod(q)
  22404. var s = false
  22405. var kv = getKey(x, q, hash, algo)
  22406. while (s === false) {
  22407. k = makeKey(q, kv, algo)
  22408. r = makeR(g, k, p, q)
  22409. s = k.invm(q).imul(H.add(x.mul(r))).mod(q)
  22410. if (s.cmpn(0) === 0) {
  22411. s = false
  22412. r = new BN(0)
  22413. }
  22414. }
  22415. return toDER(r, s)
  22416. }
  22417. function toDER (r, s) {
  22418. r = r.toArray()
  22419. s = s.toArray()
  22420. // Pad values
  22421. if (r[0] & 0x80) r = [0].concat(r)
  22422. if (s[0] & 0x80) s = [0].concat(s)
  22423. var total = r.length + s.length + 4
  22424. var res = [0x30, total, 0x02, r.length]
  22425. res = res.concat(r, [0x02, s.length], s)
  22426. return Buffer.from(res)
  22427. }
  22428. function getKey (x, q, hash, algo) {
  22429. x = Buffer.from(x.toArray())
  22430. if (x.length < q.byteLength()) {
  22431. var zeros = Buffer.alloc(q.byteLength() - x.length)
  22432. x = Buffer.concat([zeros, x])
  22433. }
  22434. var hlen = hash.length
  22435. var hbits = bits2octets(hash, q)
  22436. var v = Buffer.alloc(hlen)
  22437. v.fill(1)
  22438. var k = Buffer.alloc(hlen)
  22439. k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest()
  22440. v = createHmac(algo, k).update(v).digest()
  22441. k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest()
  22442. v = createHmac(algo, k).update(v).digest()
  22443. return { k: k, v: v }
  22444. }
  22445. function bits2int (obits, q) {
  22446. var bits = new BN(obits)
  22447. var shift = (obits.length << 3) - q.bitLength()
  22448. if (shift > 0) bits.ishrn(shift)
  22449. return bits
  22450. }
  22451. function bits2octets (bits, q) {
  22452. bits = bits2int(bits, q)
  22453. bits = bits.mod(q)
  22454. var out = Buffer.from(bits.toArray())
  22455. if (out.length < q.byteLength()) {
  22456. var zeros = Buffer.alloc(q.byteLength() - out.length)
  22457. out = Buffer.concat([zeros, out])
  22458. }
  22459. return out
  22460. }
  22461. function makeKey (q, kv, algo) {
  22462. var t
  22463. var k
  22464. do {
  22465. t = Buffer.alloc(0)
  22466. while (t.length * 8 < q.bitLength()) {
  22467. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  22468. t = Buffer.concat([t, kv.v])
  22469. }
  22470. k = bits2int(t, q)
  22471. kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest()
  22472. kv.v = createHmac(algo, kv.k).update(kv.v).digest()
  22473. } while (k.cmp(q) !== -1)
  22474. return k
  22475. }
  22476. function makeR (g, k, p, q) {
  22477. return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)
  22478. }
  22479. module.exports = sign
  22480. module.exports.getKey = getKey
  22481. module.exports.makeKey = makeKey
  22482. /***/ }),
  22483. /* 126 */
  22484. /*!**********************************************!*\
  22485. !*** ./node_modules/browserify-rsa/index.js ***!
  22486. \**********************************************/
  22487. /*! no static exports found */
  22488. /***/ (function(module, exports, __webpack_require__) {
  22489. /* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(/*! bn.js */ 116);
  22490. var randomBytes = __webpack_require__(/*! randombytes */ 31);
  22491. module.exports = crt;
  22492. function blind(priv) {
  22493. var r = getr(priv);
  22494. var blinder = r.toRed(bn.mont(priv.modulus))
  22495. .redPow(new bn(priv.publicExponent)).fromRed();
  22496. return {
  22497. blinder: blinder,
  22498. unblinder:r.invm(priv.modulus)
  22499. };
  22500. }
  22501. function crt(msg, priv) {
  22502. var blinds = blind(priv);
  22503. var len = priv.modulus.byteLength();
  22504. var mod = bn.mont(priv.modulus);
  22505. var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);
  22506. var c1 = blinded.toRed(bn.mont(priv.prime1));
  22507. var c2 = blinded.toRed(bn.mont(priv.prime2));
  22508. var qinv = priv.coefficient;
  22509. var p = priv.prime1;
  22510. var q = priv.prime2;
  22511. var m1 = c1.redPow(priv.exponent1);
  22512. var m2 = c2.redPow(priv.exponent2);
  22513. m1 = m1.fromRed();
  22514. m2 = m2.fromRed();
  22515. var h = m1.isub(m2).imul(qinv).umod(p);
  22516. h.imul(q);
  22517. m2.iadd(h);
  22518. return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));
  22519. }
  22520. crt.getr = getr;
  22521. function getr(priv) {
  22522. var len = priv.modulus.byteLength();
  22523. var r = new bn(randomBytes(len));
  22524. while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {
  22525. r = new bn(randomBytes(len));
  22526. }
  22527. return r;
  22528. }
  22529. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 35).Buffer))
  22530. /***/ }),
  22531. /* 127 */
  22532. /*!***********************************************!*\
  22533. !*** ./node_modules/elliptic/lib/elliptic.js ***!
  22534. \***********************************************/
  22535. /*! no static exports found */
  22536. /***/ (function(module, exports, __webpack_require__) {
  22537. "use strict";
  22538. var elliptic = exports;
  22539. elliptic.version = __webpack_require__(/*! ../package.json */ 128).version;
  22540. elliptic.utils = __webpack_require__(/*! ./elliptic/utils */ 129);
  22541. elliptic.rand = __webpack_require__(/*! brorand */ 120);
  22542. elliptic.curve = __webpack_require__(/*! ./elliptic/curve */ 131);
  22543. elliptic.curves = __webpack_require__(/*! ./elliptic/curves */ 136);
  22544. // Protocols
  22545. elliptic.ec = __webpack_require__(/*! ./elliptic/ec */ 150);
  22546. elliptic.eddsa = __webpack_require__(/*! ./elliptic/eddsa */ 154);
  22547. /***/ }),
  22548. /* 128 */
  22549. /*!********************************************!*\
  22550. !*** ./node_modules/elliptic/package.json ***!
  22551. \********************************************/
  22552. /*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, dependencies, deprecated, description, devDependencies, files, homepage, keywords, license, main, name, repository, scripts, version, default */
  22553. /***/ (function(module) {
  22554. module.exports = JSON.parse("{\"_from\":\"elliptic@^6.5.2\",\"_id\":\"elliptic@6.5.2\",\"_inBundle\":false,\"_integrity\":\"sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==\",\"_location\":\"/elliptic\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"range\",\"registry\":true,\"raw\":\"elliptic@^6.5.2\",\"name\":\"elliptic\",\"escapedName\":\"elliptic\",\"rawSpec\":\"^6.5.2\",\"saveSpec\":null,\"fetchSpec\":\"^6.5.2\"},\"_requiredBy\":[\"/browserify-sign\",\"/create-ecdh\"],\"_resolved\":\"https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz\",\"_shasum\":\"05c5678d7173c049d8ca433552224a495d0e3762\",\"_spec\":\"elliptic@^6.5.2\",\"_where\":\"/Users/fxy/Documents/DCloud/HbuilderX-plugins/alpha/uniapp-cli/node_modules/browserify-sign\",\"author\":{\"name\":\"Fedor Indutny\",\"email\":\"fedor@indutny.com\"},\"bugs\":{\"url\":\"https://github.com/indutny/elliptic/issues\"},\"bundleDependencies\":false,\"dependencies\":{\"bn.js\":\"^4.4.0\",\"brorand\":\"^1.0.1\",\"hash.js\":\"^1.0.0\",\"hmac-drbg\":\"^1.0.0\",\"inherits\":\"^2.0.1\",\"minimalistic-assert\":\"^1.0.0\",\"minimalistic-crypto-utils\":\"^1.0.0\"},\"deprecated\":false,\"description\":\"EC cryptography\",\"devDependencies\":{\"brfs\":\"^1.4.3\",\"coveralls\":\"^3.0.8\",\"grunt\":\"^1.0.4\",\"grunt-browserify\":\"^5.0.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-connect\":\"^1.0.0\",\"grunt-contrib-copy\":\"^1.0.0\",\"grunt-contrib-uglify\":\"^1.0.1\",\"grunt-mocha-istanbul\":\"^3.0.1\",\"grunt-saucelabs\":\"^9.0.1\",\"istanbul\":\"^0.4.2\",\"jscs\":\"^3.0.7\",\"jshint\":\"^2.10.3\",\"mocha\":\"^6.2.2\"},\"files\":[\"lib\"],\"homepage\":\"https://github.com/indutny/elliptic\",\"keywords\":[\"EC\",\"Elliptic\",\"curve\",\"Cryptography\"],\"license\":\"MIT\",\"main\":\"lib/elliptic.js\",\"name\":\"elliptic\",\"repository\":{\"type\":\"git\",\"url\":\"git+ssh://git@github.com/indutny/elliptic.git\"},\"scripts\":{\"jscs\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"jshint\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"lint\":\"npm run jscs && npm run jshint\",\"test\":\"npm run lint && npm run unit\",\"unit\":\"istanbul test _mocha --reporter=spec test/index.js\",\"version\":\"grunt dist && git add dist/\"},\"version\":\"6.5.2\"}");
  22555. /***/ }),
  22556. /* 129 */
  22557. /*!*****************************************************!*\
  22558. !*** ./node_modules/elliptic/lib/elliptic/utils.js ***!
  22559. \*****************************************************/
  22560. /*! no static exports found */
  22561. /***/ (function(module, exports, __webpack_require__) {
  22562. "use strict";
  22563. var utils = exports;
  22564. var BN = __webpack_require__(/*! bn.js */ 116);
  22565. var minAssert = __webpack_require__(/*! minimalistic-assert */ 90);
  22566. var minUtils = __webpack_require__(/*! minimalistic-crypto-utils */ 130);
  22567. utils.assert = minAssert;
  22568. utils.toArray = minUtils.toArray;
  22569. utils.zero2 = minUtils.zero2;
  22570. utils.toHex = minUtils.toHex;
  22571. utils.encode = minUtils.encode;
  22572. // Represent num in a w-NAF form
  22573. function getNAF(num, w, bits) {
  22574. var naf = new Array(Math.max(num.bitLength(), bits) + 1);
  22575. naf.fill(0);
  22576. var ws = 1 << (w + 1);
  22577. var k = num.clone();
  22578. for (var i = 0; i < naf.length; i++) {
  22579. var z;
  22580. var mod = k.andln(ws - 1);
  22581. if (k.isOdd()) {
  22582. if (mod > (ws >> 1) - 1)
  22583. z = (ws >> 1) - mod;
  22584. else
  22585. z = mod;
  22586. k.isubn(z);
  22587. } else {
  22588. z = 0;
  22589. }
  22590. naf[i] = z;
  22591. k.iushrn(1);
  22592. }
  22593. return naf;
  22594. }
  22595. utils.getNAF = getNAF;
  22596. // Represent k1, k2 in a Joint Sparse Form
  22597. function getJSF(k1, k2) {
  22598. var jsf = [
  22599. [],
  22600. []
  22601. ];
  22602. k1 = k1.clone();
  22603. k2 = k2.clone();
  22604. var d1 = 0;
  22605. var d2 = 0;
  22606. while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
  22607. // First phase
  22608. var m14 = (k1.andln(3) + d1) & 3;
  22609. var m24 = (k2.andln(3) + d2) & 3;
  22610. if (m14 === 3)
  22611. m14 = -1;
  22612. if (m24 === 3)
  22613. m24 = -1;
  22614. var u1;
  22615. if ((m14 & 1) === 0) {
  22616. u1 = 0;
  22617. } else {
  22618. var m8 = (k1.andln(7) + d1) & 7;
  22619. if ((m8 === 3 || m8 === 5) && m24 === 2)
  22620. u1 = -m14;
  22621. else
  22622. u1 = m14;
  22623. }
  22624. jsf[0].push(u1);
  22625. var u2;
  22626. if ((m24 & 1) === 0) {
  22627. u2 = 0;
  22628. } else {
  22629. var m8 = (k2.andln(7) + d2) & 7;
  22630. if ((m8 === 3 || m8 === 5) && m14 === 2)
  22631. u2 = -m24;
  22632. else
  22633. u2 = m24;
  22634. }
  22635. jsf[1].push(u2);
  22636. // Second phase
  22637. if (2 * d1 === u1 + 1)
  22638. d1 = 1 - d1;
  22639. if (2 * d2 === u2 + 1)
  22640. d2 = 1 - d2;
  22641. k1.iushrn(1);
  22642. k2.iushrn(1);
  22643. }
  22644. return jsf;
  22645. }
  22646. utils.getJSF = getJSF;
  22647. function cachedProperty(obj, name, computer) {
  22648. var key = '_' + name;
  22649. obj.prototype[name] = function cachedProperty() {
  22650. return this[key] !== undefined ? this[key] :
  22651. this[key] = computer.call(this);
  22652. };
  22653. }
  22654. utils.cachedProperty = cachedProperty;
  22655. function parseBytes(bytes) {
  22656. return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :
  22657. bytes;
  22658. }
  22659. utils.parseBytes = parseBytes;
  22660. function intFromLE(bytes) {
  22661. return new BN(bytes, 'hex', 'le');
  22662. }
  22663. utils.intFromLE = intFromLE;
  22664. /***/ }),
  22665. /* 130 */
  22666. /*!*************************************************************!*\
  22667. !*** ./node_modules/minimalistic-crypto-utils/lib/utils.js ***!
  22668. \*************************************************************/
  22669. /*! no static exports found */
  22670. /***/ (function(module, exports, __webpack_require__) {
  22671. "use strict";
  22672. var utils = exports;
  22673. function toArray(msg, enc) {
  22674. if (Array.isArray(msg))
  22675. return msg.slice();
  22676. if (!msg)
  22677. return [];
  22678. var res = [];
  22679. if (typeof msg !== 'string') {
  22680. for (var i = 0; i < msg.length; i++)
  22681. res[i] = msg[i] | 0;
  22682. return res;
  22683. }
  22684. if (enc === 'hex') {
  22685. msg = msg.replace(/[^a-z0-9]+/ig, '');
  22686. if (msg.length % 2 !== 0)
  22687. msg = '0' + msg;
  22688. for (var i = 0; i < msg.length; i += 2)
  22689. res.push(parseInt(msg[i] + msg[i + 1], 16));
  22690. } else {
  22691. for (var i = 0; i < msg.length; i++) {
  22692. var c = msg.charCodeAt(i);
  22693. var hi = c >> 8;
  22694. var lo = c & 0xff;
  22695. if (hi)
  22696. res.push(hi, lo);
  22697. else
  22698. res.push(lo);
  22699. }
  22700. }
  22701. return res;
  22702. }
  22703. utils.toArray = toArray;
  22704. function zero2(word) {
  22705. if (word.length === 1)
  22706. return '0' + word;
  22707. else
  22708. return word;
  22709. }
  22710. utils.zero2 = zero2;
  22711. function toHex(msg) {
  22712. var res = '';
  22713. for (var i = 0; i < msg.length; i++)
  22714. res += zero2(msg[i].toString(16));
  22715. return res;
  22716. }
  22717. utils.toHex = toHex;
  22718. utils.encode = function encode(arr, enc) {
  22719. if (enc === 'hex')
  22720. return toHex(arr);
  22721. else
  22722. return arr;
  22723. };
  22724. /***/ }),
  22725. /* 131 */
  22726. /*!***********************************************************!*\
  22727. !*** ./node_modules/elliptic/lib/elliptic/curve/index.js ***!
  22728. \***********************************************************/
  22729. /*! no static exports found */
  22730. /***/ (function(module, exports, __webpack_require__) {
  22731. "use strict";
  22732. var curve = exports;
  22733. curve.base = __webpack_require__(/*! ./base */ 132);
  22734. curve.short = __webpack_require__(/*! ./short */ 133);
  22735. curve.mont = __webpack_require__(/*! ./mont */ 134);
  22736. curve.edwards = __webpack_require__(/*! ./edwards */ 135);
  22737. /***/ }),
  22738. /* 132 */
  22739. /*!**********************************************************!*\
  22740. !*** ./node_modules/elliptic/lib/elliptic/curve/base.js ***!
  22741. \**********************************************************/
  22742. /*! no static exports found */
  22743. /***/ (function(module, exports, __webpack_require__) {
  22744. "use strict";
  22745. var BN = __webpack_require__(/*! bn.js */ 116);
  22746. var utils = __webpack_require__(/*! ../utils */ 129);
  22747. var getNAF = utils.getNAF;
  22748. var getJSF = utils.getJSF;
  22749. var assert = utils.assert;
  22750. function BaseCurve(type, conf) {
  22751. this.type = type;
  22752. this.p = new BN(conf.p, 16);
  22753. // Use Montgomery, when there is no fast reduction for the prime
  22754. this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
  22755. // Useful for many curves
  22756. this.zero = new BN(0).toRed(this.red);
  22757. this.one = new BN(1).toRed(this.red);
  22758. this.two = new BN(2).toRed(this.red);
  22759. // Curve configuration, optional
  22760. this.n = conf.n && new BN(conf.n, 16);
  22761. this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
  22762. // Temporary arrays
  22763. this._wnafT1 = new Array(4);
  22764. this._wnafT2 = new Array(4);
  22765. this._wnafT3 = new Array(4);
  22766. this._wnafT4 = new Array(4);
  22767. this._bitLength = this.n ? this.n.bitLength() : 0;
  22768. // Generalized Greg Maxwell's trick
  22769. var adjustCount = this.n && this.p.div(this.n);
  22770. if (!adjustCount || adjustCount.cmpn(100) > 0) {
  22771. this.redN = null;
  22772. } else {
  22773. this._maxwellTrick = true;
  22774. this.redN = this.n.toRed(this.red);
  22775. }
  22776. }
  22777. module.exports = BaseCurve;
  22778. BaseCurve.prototype.point = function point() {
  22779. throw new Error('Not implemented');
  22780. };
  22781. BaseCurve.prototype.validate = function validate() {
  22782. throw new Error('Not implemented');
  22783. };
  22784. BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
  22785. assert(p.precomputed);
  22786. var doubles = p._getDoubles();
  22787. var naf = getNAF(k, 1, this._bitLength);
  22788. var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
  22789. I /= 3;
  22790. // Translate into more windowed form
  22791. var repr = [];
  22792. for (var j = 0; j < naf.length; j += doubles.step) {
  22793. var nafW = 0;
  22794. for (var k = j + doubles.step - 1; k >= j; k--)
  22795. nafW = (nafW << 1) + naf[k];
  22796. repr.push(nafW);
  22797. }
  22798. var a = this.jpoint(null, null, null);
  22799. var b = this.jpoint(null, null, null);
  22800. for (var i = I; i > 0; i--) {
  22801. for (var j = 0; j < repr.length; j++) {
  22802. var nafW = repr[j];
  22803. if (nafW === i)
  22804. b = b.mixedAdd(doubles.points[j]);
  22805. else if (nafW === -i)
  22806. b = b.mixedAdd(doubles.points[j].neg());
  22807. }
  22808. a = a.add(b);
  22809. }
  22810. return a.toP();
  22811. };
  22812. BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
  22813. var w = 4;
  22814. // Precompute window
  22815. var nafPoints = p._getNAFPoints(w);
  22816. w = nafPoints.wnd;
  22817. var wnd = nafPoints.points;
  22818. // Get NAF form
  22819. var naf = getNAF(k, w, this._bitLength);
  22820. // Add `this`*(N+1) for every w-NAF index
  22821. var acc = this.jpoint(null, null, null);
  22822. for (var i = naf.length - 1; i >= 0; i--) {
  22823. // Count zeroes
  22824. for (var k = 0; i >= 0 && naf[i] === 0; i--)
  22825. k++;
  22826. if (i >= 0)
  22827. k++;
  22828. acc = acc.dblp(k);
  22829. if (i < 0)
  22830. break;
  22831. var z = naf[i];
  22832. assert(z !== 0);
  22833. if (p.type === 'affine') {
  22834. // J +- P
  22835. if (z > 0)
  22836. acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
  22837. else
  22838. acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
  22839. } else {
  22840. // J +- J
  22841. if (z > 0)
  22842. acc = acc.add(wnd[(z - 1) >> 1]);
  22843. else
  22844. acc = acc.add(wnd[(-z - 1) >> 1].neg());
  22845. }
  22846. }
  22847. return p.type === 'affine' ? acc.toP() : acc;
  22848. };
  22849. BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
  22850. points,
  22851. coeffs,
  22852. len,
  22853. jacobianResult) {
  22854. var wndWidth = this._wnafT1;
  22855. var wnd = this._wnafT2;
  22856. var naf = this._wnafT3;
  22857. // Fill all arrays
  22858. var max = 0;
  22859. for (var i = 0; i < len; i++) {
  22860. var p = points[i];
  22861. var nafPoints = p._getNAFPoints(defW);
  22862. wndWidth[i] = nafPoints.wnd;
  22863. wnd[i] = nafPoints.points;
  22864. }
  22865. // Comb small window NAFs
  22866. for (var i = len - 1; i >= 1; i -= 2) {
  22867. var a = i - 1;
  22868. var b = i;
  22869. if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
  22870. naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
  22871. naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
  22872. max = Math.max(naf[a].length, max);
  22873. max = Math.max(naf[b].length, max);
  22874. continue;
  22875. }
  22876. var comb = [
  22877. points[a], /* 1 */
  22878. null, /* 3 */
  22879. null, /* 5 */
  22880. points[b] /* 7 */
  22881. ];
  22882. // Try to avoid Projective points, if possible
  22883. if (points[a].y.cmp(points[b].y) === 0) {
  22884. comb[1] = points[a].add(points[b]);
  22885. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  22886. } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
  22887. comb[1] = points[a].toJ().mixedAdd(points[b]);
  22888. comb[2] = points[a].add(points[b].neg());
  22889. } else {
  22890. comb[1] = points[a].toJ().mixedAdd(points[b]);
  22891. comb[2] = points[a].toJ().mixedAdd(points[b].neg());
  22892. }
  22893. var index = [
  22894. -3, /* -1 -1 */
  22895. -1, /* -1 0 */
  22896. -5, /* -1 1 */
  22897. -7, /* 0 -1 */
  22898. 0, /* 0 0 */
  22899. 7, /* 0 1 */
  22900. 5, /* 1 -1 */
  22901. 1, /* 1 0 */
  22902. 3 /* 1 1 */
  22903. ];
  22904. var jsf = getJSF(coeffs[a], coeffs[b]);
  22905. max = Math.max(jsf[0].length, max);
  22906. naf[a] = new Array(max);
  22907. naf[b] = new Array(max);
  22908. for (var j = 0; j < max; j++) {
  22909. var ja = jsf[0][j] | 0;
  22910. var jb = jsf[1][j] | 0;
  22911. naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
  22912. naf[b][j] = 0;
  22913. wnd[a] = comb;
  22914. }
  22915. }
  22916. var acc = this.jpoint(null, null, null);
  22917. var tmp = this._wnafT4;
  22918. for (var i = max; i >= 0; i--) {
  22919. var k = 0;
  22920. while (i >= 0) {
  22921. var zero = true;
  22922. for (var j = 0; j < len; j++) {
  22923. tmp[j] = naf[j][i] | 0;
  22924. if (tmp[j] !== 0)
  22925. zero = false;
  22926. }
  22927. if (!zero)
  22928. break;
  22929. k++;
  22930. i--;
  22931. }
  22932. if (i >= 0)
  22933. k++;
  22934. acc = acc.dblp(k);
  22935. if (i < 0)
  22936. break;
  22937. for (var j = 0; j < len; j++) {
  22938. var z = tmp[j];
  22939. var p;
  22940. if (z === 0)
  22941. continue;
  22942. else if (z > 0)
  22943. p = wnd[j][(z - 1) >> 1];
  22944. else if (z < 0)
  22945. p = wnd[j][(-z - 1) >> 1].neg();
  22946. if (p.type === 'affine')
  22947. acc = acc.mixedAdd(p);
  22948. else
  22949. acc = acc.add(p);
  22950. }
  22951. }
  22952. // Zeroify references
  22953. for (var i = 0; i < len; i++)
  22954. wnd[i] = null;
  22955. if (jacobianResult)
  22956. return acc;
  22957. else
  22958. return acc.toP();
  22959. };
  22960. function BasePoint(curve, type) {
  22961. this.curve = curve;
  22962. this.type = type;
  22963. this.precomputed = null;
  22964. }
  22965. BaseCurve.BasePoint = BasePoint;
  22966. BasePoint.prototype.eq = function eq(/*other*/) {
  22967. throw new Error('Not implemented');
  22968. };
  22969. BasePoint.prototype.validate = function validate() {
  22970. return this.curve.validate(this);
  22971. };
  22972. BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  22973. bytes = utils.toArray(bytes, enc);
  22974. var len = this.p.byteLength();
  22975. // uncompressed, hybrid-odd, hybrid-even
  22976. if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
  22977. bytes.length - 1 === 2 * len) {
  22978. if (bytes[0] === 0x06)
  22979. assert(bytes[bytes.length - 1] % 2 === 0);
  22980. else if (bytes[0] === 0x07)
  22981. assert(bytes[bytes.length - 1] % 2 === 1);
  22982. var res = this.point(bytes.slice(1, 1 + len),
  22983. bytes.slice(1 + len, 1 + 2 * len));
  22984. return res;
  22985. } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
  22986. bytes.length - 1 === len) {
  22987. return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
  22988. }
  22989. throw new Error('Unknown point format');
  22990. };
  22991. BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
  22992. return this.encode(enc, true);
  22993. };
  22994. BasePoint.prototype._encode = function _encode(compact) {
  22995. var len = this.curve.p.byteLength();
  22996. var x = this.getX().toArray('be', len);
  22997. if (compact)
  22998. return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
  22999. return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;
  23000. };
  23001. BasePoint.prototype.encode = function encode(enc, compact) {
  23002. return utils.encode(this._encode(compact), enc);
  23003. };
  23004. BasePoint.prototype.precompute = function precompute(power) {
  23005. if (this.precomputed)
  23006. return this;
  23007. var precomputed = {
  23008. doubles: null,
  23009. naf: null,
  23010. beta: null
  23011. };
  23012. precomputed.naf = this._getNAFPoints(8);
  23013. precomputed.doubles = this._getDoubles(4, power);
  23014. precomputed.beta = this._getBeta();
  23015. this.precomputed = precomputed;
  23016. return this;
  23017. };
  23018. BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
  23019. if (!this.precomputed)
  23020. return false;
  23021. var doubles = this.precomputed.doubles;
  23022. if (!doubles)
  23023. return false;
  23024. return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
  23025. };
  23026. BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
  23027. if (this.precomputed && this.precomputed.doubles)
  23028. return this.precomputed.doubles;
  23029. var doubles = [ this ];
  23030. var acc = this;
  23031. for (var i = 0; i < power; i += step) {
  23032. for (var j = 0; j < step; j++)
  23033. acc = acc.dbl();
  23034. doubles.push(acc);
  23035. }
  23036. return {
  23037. step: step,
  23038. points: doubles
  23039. };
  23040. };
  23041. BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
  23042. if (this.precomputed && this.precomputed.naf)
  23043. return this.precomputed.naf;
  23044. var res = [ this ];
  23045. var max = (1 << wnd) - 1;
  23046. var dbl = max === 1 ? null : this.dbl();
  23047. for (var i = 1; i < max; i++)
  23048. res[i] = res[i - 1].add(dbl);
  23049. return {
  23050. wnd: wnd,
  23051. points: res
  23052. };
  23053. };
  23054. BasePoint.prototype._getBeta = function _getBeta() {
  23055. return null;
  23056. };
  23057. BasePoint.prototype.dblp = function dblp(k) {
  23058. var r = this;
  23059. for (var i = 0; i < k; i++)
  23060. r = r.dbl();
  23061. return r;
  23062. };
  23063. /***/ }),
  23064. /* 133 */
  23065. /*!***********************************************************!*\
  23066. !*** ./node_modules/elliptic/lib/elliptic/curve/short.js ***!
  23067. \***********************************************************/
  23068. /*! no static exports found */
  23069. /***/ (function(module, exports, __webpack_require__) {
  23070. "use strict";
  23071. var utils = __webpack_require__(/*! ../utils */ 129);
  23072. var BN = __webpack_require__(/*! bn.js */ 116);
  23073. var inherits = __webpack_require__(/*! inherits */ 40);
  23074. var Base = __webpack_require__(/*! ./base */ 132);
  23075. var assert = utils.assert;
  23076. function ShortCurve(conf) {
  23077. Base.call(this, 'short', conf);
  23078. this.a = new BN(conf.a, 16).toRed(this.red);
  23079. this.b = new BN(conf.b, 16).toRed(this.red);
  23080. this.tinv = this.two.redInvm();
  23081. this.zeroA = this.a.fromRed().cmpn(0) === 0;
  23082. this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
  23083. // If the curve is endomorphic, precalculate beta and lambda
  23084. this.endo = this._getEndomorphism(conf);
  23085. this._endoWnafT1 = new Array(4);
  23086. this._endoWnafT2 = new Array(4);
  23087. }
  23088. inherits(ShortCurve, Base);
  23089. module.exports = ShortCurve;
  23090. ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
  23091. // No efficient endomorphism
  23092. if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)
  23093. return;
  23094. // Compute beta and lambda, that lambda * P = (beta * Px; Py)
  23095. var beta;
  23096. var lambda;
  23097. if (conf.beta) {
  23098. beta = new BN(conf.beta, 16).toRed(this.red);
  23099. } else {
  23100. var betas = this._getEndoRoots(this.p);
  23101. // Choose the smallest beta
  23102. beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
  23103. beta = beta.toRed(this.red);
  23104. }
  23105. if (conf.lambda) {
  23106. lambda = new BN(conf.lambda, 16);
  23107. } else {
  23108. // Choose the lambda that is matching selected beta
  23109. var lambdas = this._getEndoRoots(this.n);
  23110. if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
  23111. lambda = lambdas[0];
  23112. } else {
  23113. lambda = lambdas[1];
  23114. assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
  23115. }
  23116. }
  23117. // Get basis vectors, used for balanced length-two representation
  23118. var basis;
  23119. if (conf.basis) {
  23120. basis = conf.basis.map(function(vec) {
  23121. return {
  23122. a: new BN(vec.a, 16),
  23123. b: new BN(vec.b, 16)
  23124. };
  23125. });
  23126. } else {
  23127. basis = this._getEndoBasis(lambda);
  23128. }
  23129. return {
  23130. beta: beta,
  23131. lambda: lambda,
  23132. basis: basis
  23133. };
  23134. };
  23135. ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
  23136. // Find roots of for x^2 + x + 1 in F
  23137. // Root = (-1 +- Sqrt(-3)) / 2
  23138. //
  23139. var red = num === this.p ? this.red : BN.mont(num);
  23140. var tinv = new BN(2).toRed(red).redInvm();
  23141. var ntinv = tinv.redNeg();
  23142. var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
  23143. var l1 = ntinv.redAdd(s).fromRed();
  23144. var l2 = ntinv.redSub(s).fromRed();
  23145. return [ l1, l2 ];
  23146. };
  23147. ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
  23148. // aprxSqrt >= sqrt(this.n)
  23149. var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
  23150. // 3.74
  23151. // Run EGCD, until r(L + 1) < aprxSqrt
  23152. var u = lambda;
  23153. var v = this.n.clone();
  23154. var x1 = new BN(1);
  23155. var y1 = new BN(0);
  23156. var x2 = new BN(0);
  23157. var y2 = new BN(1);
  23158. // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
  23159. var a0;
  23160. var b0;
  23161. // First vector
  23162. var a1;
  23163. var b1;
  23164. // Second vector
  23165. var a2;
  23166. var b2;
  23167. var prevR;
  23168. var i = 0;
  23169. var r;
  23170. var x;
  23171. while (u.cmpn(0) !== 0) {
  23172. var q = v.div(u);
  23173. r = v.sub(q.mul(u));
  23174. x = x2.sub(q.mul(x1));
  23175. var y = y2.sub(q.mul(y1));
  23176. if (!a1 && r.cmp(aprxSqrt) < 0) {
  23177. a0 = prevR.neg();
  23178. b0 = x1;
  23179. a1 = r.neg();
  23180. b1 = x;
  23181. } else if (a1 && ++i === 2) {
  23182. break;
  23183. }
  23184. prevR = r;
  23185. v = u;
  23186. u = r;
  23187. x2 = x1;
  23188. x1 = x;
  23189. y2 = y1;
  23190. y1 = y;
  23191. }
  23192. a2 = r.neg();
  23193. b2 = x;
  23194. var len1 = a1.sqr().add(b1.sqr());
  23195. var len2 = a2.sqr().add(b2.sqr());
  23196. if (len2.cmp(len1) >= 0) {
  23197. a2 = a0;
  23198. b2 = b0;
  23199. }
  23200. // Normalize signs
  23201. if (a1.negative) {
  23202. a1 = a1.neg();
  23203. b1 = b1.neg();
  23204. }
  23205. if (a2.negative) {
  23206. a2 = a2.neg();
  23207. b2 = b2.neg();
  23208. }
  23209. return [
  23210. { a: a1, b: b1 },
  23211. { a: a2, b: b2 }
  23212. ];
  23213. };
  23214. ShortCurve.prototype._endoSplit = function _endoSplit(k) {
  23215. var basis = this.endo.basis;
  23216. var v1 = basis[0];
  23217. var v2 = basis[1];
  23218. var c1 = v2.b.mul(k).divRound(this.n);
  23219. var c2 = v1.b.neg().mul(k).divRound(this.n);
  23220. var p1 = c1.mul(v1.a);
  23221. var p2 = c2.mul(v2.a);
  23222. var q1 = c1.mul(v1.b);
  23223. var q2 = c2.mul(v2.b);
  23224. // Calculate answer
  23225. var k1 = k.sub(p1).sub(p2);
  23226. var k2 = q1.add(q2).neg();
  23227. return { k1: k1, k2: k2 };
  23228. };
  23229. ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
  23230. x = new BN(x, 16);
  23231. if (!x.red)
  23232. x = x.toRed(this.red);
  23233. var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
  23234. var y = y2.redSqrt();
  23235. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  23236. throw new Error('invalid point');
  23237. // XXX Is there any way to tell if the number is odd without converting it
  23238. // to non-red form?
  23239. var isOdd = y.fromRed().isOdd();
  23240. if (odd && !isOdd || !odd && isOdd)
  23241. y = y.redNeg();
  23242. return this.point(x, y);
  23243. };
  23244. ShortCurve.prototype.validate = function validate(point) {
  23245. if (point.inf)
  23246. return true;
  23247. var x = point.x;
  23248. var y = point.y;
  23249. var ax = this.a.redMul(x);
  23250. var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
  23251. return y.redSqr().redISub(rhs).cmpn(0) === 0;
  23252. };
  23253. ShortCurve.prototype._endoWnafMulAdd =
  23254. function _endoWnafMulAdd(points, coeffs, jacobianResult) {
  23255. var npoints = this._endoWnafT1;
  23256. var ncoeffs = this._endoWnafT2;
  23257. for (var i = 0; i < points.length; i++) {
  23258. var split = this._endoSplit(coeffs[i]);
  23259. var p = points[i];
  23260. var beta = p._getBeta();
  23261. if (split.k1.negative) {
  23262. split.k1.ineg();
  23263. p = p.neg(true);
  23264. }
  23265. if (split.k2.negative) {
  23266. split.k2.ineg();
  23267. beta = beta.neg(true);
  23268. }
  23269. npoints[i * 2] = p;
  23270. npoints[i * 2 + 1] = beta;
  23271. ncoeffs[i * 2] = split.k1;
  23272. ncoeffs[i * 2 + 1] = split.k2;
  23273. }
  23274. var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
  23275. // Clean-up references to points and coefficients
  23276. for (var j = 0; j < i * 2; j++) {
  23277. npoints[j] = null;
  23278. ncoeffs[j] = null;
  23279. }
  23280. return res;
  23281. };
  23282. function Point(curve, x, y, isRed) {
  23283. Base.BasePoint.call(this, curve, 'affine');
  23284. if (x === null && y === null) {
  23285. this.x = null;
  23286. this.y = null;
  23287. this.inf = true;
  23288. } else {
  23289. this.x = new BN(x, 16);
  23290. this.y = new BN(y, 16);
  23291. // Force redgomery representation when loading from JSON
  23292. if (isRed) {
  23293. this.x.forceRed(this.curve.red);
  23294. this.y.forceRed(this.curve.red);
  23295. }
  23296. if (!this.x.red)
  23297. this.x = this.x.toRed(this.curve.red);
  23298. if (!this.y.red)
  23299. this.y = this.y.toRed(this.curve.red);
  23300. this.inf = false;
  23301. }
  23302. }
  23303. inherits(Point, Base.BasePoint);
  23304. ShortCurve.prototype.point = function point(x, y, isRed) {
  23305. return new Point(this, x, y, isRed);
  23306. };
  23307. ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
  23308. return Point.fromJSON(this, obj, red);
  23309. };
  23310. Point.prototype._getBeta = function _getBeta() {
  23311. if (!this.curve.endo)
  23312. return;
  23313. var pre = this.precomputed;
  23314. if (pre && pre.beta)
  23315. return pre.beta;
  23316. var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
  23317. if (pre) {
  23318. var curve = this.curve;
  23319. var endoMul = function(p) {
  23320. return curve.point(p.x.redMul(curve.endo.beta), p.y);
  23321. };
  23322. pre.beta = beta;
  23323. beta.precomputed = {
  23324. beta: null,
  23325. naf: pre.naf && {
  23326. wnd: pre.naf.wnd,
  23327. points: pre.naf.points.map(endoMul)
  23328. },
  23329. doubles: pre.doubles && {
  23330. step: pre.doubles.step,
  23331. points: pre.doubles.points.map(endoMul)
  23332. }
  23333. };
  23334. }
  23335. return beta;
  23336. };
  23337. Point.prototype.toJSON = function toJSON() {
  23338. if (!this.precomputed)
  23339. return [ this.x, this.y ];
  23340. return [ this.x, this.y, this.precomputed && {
  23341. doubles: this.precomputed.doubles && {
  23342. step: this.precomputed.doubles.step,
  23343. points: this.precomputed.doubles.points.slice(1)
  23344. },
  23345. naf: this.precomputed.naf && {
  23346. wnd: this.precomputed.naf.wnd,
  23347. points: this.precomputed.naf.points.slice(1)
  23348. }
  23349. } ];
  23350. };
  23351. Point.fromJSON = function fromJSON(curve, obj, red) {
  23352. if (typeof obj === 'string')
  23353. obj = JSON.parse(obj);
  23354. var res = curve.point(obj[0], obj[1], red);
  23355. if (!obj[2])
  23356. return res;
  23357. function obj2point(obj) {
  23358. return curve.point(obj[0], obj[1], red);
  23359. }
  23360. var pre = obj[2];
  23361. res.precomputed = {
  23362. beta: null,
  23363. doubles: pre.doubles && {
  23364. step: pre.doubles.step,
  23365. points: [ res ].concat(pre.doubles.points.map(obj2point))
  23366. },
  23367. naf: pre.naf && {
  23368. wnd: pre.naf.wnd,
  23369. points: [ res ].concat(pre.naf.points.map(obj2point))
  23370. }
  23371. };
  23372. return res;
  23373. };
  23374. Point.prototype.inspect = function inspect() {
  23375. if (this.isInfinity())
  23376. return '<EC Point Infinity>';
  23377. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  23378. ' y: ' + this.y.fromRed().toString(16, 2) + '>';
  23379. };
  23380. Point.prototype.isInfinity = function isInfinity() {
  23381. return this.inf;
  23382. };
  23383. Point.prototype.add = function add(p) {
  23384. // O + P = P
  23385. if (this.inf)
  23386. return p;
  23387. // P + O = P
  23388. if (p.inf)
  23389. return this;
  23390. // P + P = 2P
  23391. if (this.eq(p))
  23392. return this.dbl();
  23393. // P + (-P) = O
  23394. if (this.neg().eq(p))
  23395. return this.curve.point(null, null);
  23396. // P + Q = O
  23397. if (this.x.cmp(p.x) === 0)
  23398. return this.curve.point(null, null);
  23399. var c = this.y.redSub(p.y);
  23400. if (c.cmpn(0) !== 0)
  23401. c = c.redMul(this.x.redSub(p.x).redInvm());
  23402. var nx = c.redSqr().redISub(this.x).redISub(p.x);
  23403. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  23404. return this.curve.point(nx, ny);
  23405. };
  23406. Point.prototype.dbl = function dbl() {
  23407. if (this.inf)
  23408. return this;
  23409. // 2P = O
  23410. var ys1 = this.y.redAdd(this.y);
  23411. if (ys1.cmpn(0) === 0)
  23412. return this.curve.point(null, null);
  23413. var a = this.curve.a;
  23414. var x2 = this.x.redSqr();
  23415. var dyinv = ys1.redInvm();
  23416. var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
  23417. var nx = c.redSqr().redISub(this.x.redAdd(this.x));
  23418. var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
  23419. return this.curve.point(nx, ny);
  23420. };
  23421. Point.prototype.getX = function getX() {
  23422. return this.x.fromRed();
  23423. };
  23424. Point.prototype.getY = function getY() {
  23425. return this.y.fromRed();
  23426. };
  23427. Point.prototype.mul = function mul(k) {
  23428. k = new BN(k, 16);
  23429. if (this.isInfinity())
  23430. return this;
  23431. else if (this._hasDoubles(k))
  23432. return this.curve._fixedNafMul(this, k);
  23433. else if (this.curve.endo)
  23434. return this.curve._endoWnafMulAdd([ this ], [ k ]);
  23435. else
  23436. return this.curve._wnafMul(this, k);
  23437. };
  23438. Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
  23439. var points = [ this, p2 ];
  23440. var coeffs = [ k1, k2 ];
  23441. if (this.curve.endo)
  23442. return this.curve._endoWnafMulAdd(points, coeffs);
  23443. else
  23444. return this.curve._wnafMulAdd(1, points, coeffs, 2);
  23445. };
  23446. Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
  23447. var points = [ this, p2 ];
  23448. var coeffs = [ k1, k2 ];
  23449. if (this.curve.endo)
  23450. return this.curve._endoWnafMulAdd(points, coeffs, true);
  23451. else
  23452. return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
  23453. };
  23454. Point.prototype.eq = function eq(p) {
  23455. return this === p ||
  23456. this.inf === p.inf &&
  23457. (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
  23458. };
  23459. Point.prototype.neg = function neg(_precompute) {
  23460. if (this.inf)
  23461. return this;
  23462. var res = this.curve.point(this.x, this.y.redNeg());
  23463. if (_precompute && this.precomputed) {
  23464. var pre = this.precomputed;
  23465. var negate = function(p) {
  23466. return p.neg();
  23467. };
  23468. res.precomputed = {
  23469. naf: pre.naf && {
  23470. wnd: pre.naf.wnd,
  23471. points: pre.naf.points.map(negate)
  23472. },
  23473. doubles: pre.doubles && {
  23474. step: pre.doubles.step,
  23475. points: pre.doubles.points.map(negate)
  23476. }
  23477. };
  23478. }
  23479. return res;
  23480. };
  23481. Point.prototype.toJ = function toJ() {
  23482. if (this.inf)
  23483. return this.curve.jpoint(null, null, null);
  23484. var res = this.curve.jpoint(this.x, this.y, this.curve.one);
  23485. return res;
  23486. };
  23487. function JPoint(curve, x, y, z) {
  23488. Base.BasePoint.call(this, curve, 'jacobian');
  23489. if (x === null && y === null && z === null) {
  23490. this.x = this.curve.one;
  23491. this.y = this.curve.one;
  23492. this.z = new BN(0);
  23493. } else {
  23494. this.x = new BN(x, 16);
  23495. this.y = new BN(y, 16);
  23496. this.z = new BN(z, 16);
  23497. }
  23498. if (!this.x.red)
  23499. this.x = this.x.toRed(this.curve.red);
  23500. if (!this.y.red)
  23501. this.y = this.y.toRed(this.curve.red);
  23502. if (!this.z.red)
  23503. this.z = this.z.toRed(this.curve.red);
  23504. this.zOne = this.z === this.curve.one;
  23505. }
  23506. inherits(JPoint, Base.BasePoint);
  23507. ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
  23508. return new JPoint(this, x, y, z);
  23509. };
  23510. JPoint.prototype.toP = function toP() {
  23511. if (this.isInfinity())
  23512. return this.curve.point(null, null);
  23513. var zinv = this.z.redInvm();
  23514. var zinv2 = zinv.redSqr();
  23515. var ax = this.x.redMul(zinv2);
  23516. var ay = this.y.redMul(zinv2).redMul(zinv);
  23517. return this.curve.point(ax, ay);
  23518. };
  23519. JPoint.prototype.neg = function neg() {
  23520. return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
  23521. };
  23522. JPoint.prototype.add = function add(p) {
  23523. // O + P = P
  23524. if (this.isInfinity())
  23525. return p;
  23526. // P + O = P
  23527. if (p.isInfinity())
  23528. return this;
  23529. // 12M + 4S + 7A
  23530. var pz2 = p.z.redSqr();
  23531. var z2 = this.z.redSqr();
  23532. var u1 = this.x.redMul(pz2);
  23533. var u2 = p.x.redMul(z2);
  23534. var s1 = this.y.redMul(pz2.redMul(p.z));
  23535. var s2 = p.y.redMul(z2.redMul(this.z));
  23536. var h = u1.redSub(u2);
  23537. var r = s1.redSub(s2);
  23538. if (h.cmpn(0) === 0) {
  23539. if (r.cmpn(0) !== 0)
  23540. return this.curve.jpoint(null, null, null);
  23541. else
  23542. return this.dbl();
  23543. }
  23544. var h2 = h.redSqr();
  23545. var h3 = h2.redMul(h);
  23546. var v = u1.redMul(h2);
  23547. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  23548. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  23549. var nz = this.z.redMul(p.z).redMul(h);
  23550. return this.curve.jpoint(nx, ny, nz);
  23551. };
  23552. JPoint.prototype.mixedAdd = function mixedAdd(p) {
  23553. // O + P = P
  23554. if (this.isInfinity())
  23555. return p.toJ();
  23556. // P + O = P
  23557. if (p.isInfinity())
  23558. return this;
  23559. // 8M + 3S + 7A
  23560. var z2 = this.z.redSqr();
  23561. var u1 = this.x;
  23562. var u2 = p.x.redMul(z2);
  23563. var s1 = this.y;
  23564. var s2 = p.y.redMul(z2).redMul(this.z);
  23565. var h = u1.redSub(u2);
  23566. var r = s1.redSub(s2);
  23567. if (h.cmpn(0) === 0) {
  23568. if (r.cmpn(0) !== 0)
  23569. return this.curve.jpoint(null, null, null);
  23570. else
  23571. return this.dbl();
  23572. }
  23573. var h2 = h.redSqr();
  23574. var h3 = h2.redMul(h);
  23575. var v = u1.redMul(h2);
  23576. var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
  23577. var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
  23578. var nz = this.z.redMul(h);
  23579. return this.curve.jpoint(nx, ny, nz);
  23580. };
  23581. JPoint.prototype.dblp = function dblp(pow) {
  23582. if (pow === 0)
  23583. return this;
  23584. if (this.isInfinity())
  23585. return this;
  23586. if (!pow)
  23587. return this.dbl();
  23588. if (this.curve.zeroA || this.curve.threeA) {
  23589. var r = this;
  23590. for (var i = 0; i < pow; i++)
  23591. r = r.dbl();
  23592. return r;
  23593. }
  23594. // 1M + 2S + 1A + N * (4S + 5M + 8A)
  23595. // N = 1 => 6M + 6S + 9A
  23596. var a = this.curve.a;
  23597. var tinv = this.curve.tinv;
  23598. var jx = this.x;
  23599. var jy = this.y;
  23600. var jz = this.z;
  23601. var jz4 = jz.redSqr().redSqr();
  23602. // Reuse results
  23603. var jyd = jy.redAdd(jy);
  23604. for (var i = 0; i < pow; i++) {
  23605. var jx2 = jx.redSqr();
  23606. var jyd2 = jyd.redSqr();
  23607. var jyd4 = jyd2.redSqr();
  23608. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  23609. var t1 = jx.redMul(jyd2);
  23610. var nx = c.redSqr().redISub(t1.redAdd(t1));
  23611. var t2 = t1.redISub(nx);
  23612. var dny = c.redMul(t2);
  23613. dny = dny.redIAdd(dny).redISub(jyd4);
  23614. var nz = jyd.redMul(jz);
  23615. if (i + 1 < pow)
  23616. jz4 = jz4.redMul(jyd4);
  23617. jx = nx;
  23618. jz = nz;
  23619. jyd = dny;
  23620. }
  23621. return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
  23622. };
  23623. JPoint.prototype.dbl = function dbl() {
  23624. if (this.isInfinity())
  23625. return this;
  23626. if (this.curve.zeroA)
  23627. return this._zeroDbl();
  23628. else if (this.curve.threeA)
  23629. return this._threeDbl();
  23630. else
  23631. return this._dbl();
  23632. };
  23633. JPoint.prototype._zeroDbl = function _zeroDbl() {
  23634. var nx;
  23635. var ny;
  23636. var nz;
  23637. // Z = 1
  23638. if (this.zOne) {
  23639. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  23640. // #doubling-mdbl-2007-bl
  23641. // 1M + 5S + 14A
  23642. // XX = X1^2
  23643. var xx = this.x.redSqr();
  23644. // YY = Y1^2
  23645. var yy = this.y.redSqr();
  23646. // YYYY = YY^2
  23647. var yyyy = yy.redSqr();
  23648. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  23649. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23650. s = s.redIAdd(s);
  23651. // M = 3 * XX + a; a = 0
  23652. var m = xx.redAdd(xx).redIAdd(xx);
  23653. // T = M ^ 2 - 2*S
  23654. var t = m.redSqr().redISub(s).redISub(s);
  23655. // 8 * YYYY
  23656. var yyyy8 = yyyy.redIAdd(yyyy);
  23657. yyyy8 = yyyy8.redIAdd(yyyy8);
  23658. yyyy8 = yyyy8.redIAdd(yyyy8);
  23659. // X3 = T
  23660. nx = t;
  23661. // Y3 = M * (S - T) - 8 * YYYY
  23662. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  23663. // Z3 = 2*Y1
  23664. nz = this.y.redAdd(this.y);
  23665. } else {
  23666. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html
  23667. // #doubling-dbl-2009-l
  23668. // 2M + 5S + 13A
  23669. // A = X1^2
  23670. var a = this.x.redSqr();
  23671. // B = Y1^2
  23672. var b = this.y.redSqr();
  23673. // C = B^2
  23674. var c = b.redSqr();
  23675. // D = 2 * ((X1 + B)^2 - A - C)
  23676. var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
  23677. d = d.redIAdd(d);
  23678. // E = 3 * A
  23679. var e = a.redAdd(a).redIAdd(a);
  23680. // F = E^2
  23681. var f = e.redSqr();
  23682. // 8 * C
  23683. var c8 = c.redIAdd(c);
  23684. c8 = c8.redIAdd(c8);
  23685. c8 = c8.redIAdd(c8);
  23686. // X3 = F - 2 * D
  23687. nx = f.redISub(d).redISub(d);
  23688. // Y3 = E * (D - X3) - 8 * C
  23689. ny = e.redMul(d.redISub(nx)).redISub(c8);
  23690. // Z3 = 2 * Y1 * Z1
  23691. nz = this.y.redMul(this.z);
  23692. nz = nz.redIAdd(nz);
  23693. }
  23694. return this.curve.jpoint(nx, ny, nz);
  23695. };
  23696. JPoint.prototype._threeDbl = function _threeDbl() {
  23697. var nx;
  23698. var ny;
  23699. var nz;
  23700. // Z = 1
  23701. if (this.zOne) {
  23702. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html
  23703. // #doubling-mdbl-2007-bl
  23704. // 1M + 5S + 15A
  23705. // XX = X1^2
  23706. var xx = this.x.redSqr();
  23707. // YY = Y1^2
  23708. var yy = this.y.redSqr();
  23709. // YYYY = YY^2
  23710. var yyyy = yy.redSqr();
  23711. // S = 2 * ((X1 + YY)^2 - XX - YYYY)
  23712. var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23713. s = s.redIAdd(s);
  23714. // M = 3 * XX + a
  23715. var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
  23716. // T = M^2 - 2 * S
  23717. var t = m.redSqr().redISub(s).redISub(s);
  23718. // X3 = T
  23719. nx = t;
  23720. // Y3 = M * (S - T) - 8 * YYYY
  23721. var yyyy8 = yyyy.redIAdd(yyyy);
  23722. yyyy8 = yyyy8.redIAdd(yyyy8);
  23723. yyyy8 = yyyy8.redIAdd(yyyy8);
  23724. ny = m.redMul(s.redISub(t)).redISub(yyyy8);
  23725. // Z3 = 2 * Y1
  23726. nz = this.y.redAdd(this.y);
  23727. } else {
  23728. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
  23729. // 3M + 5S
  23730. // delta = Z1^2
  23731. var delta = this.z.redSqr();
  23732. // gamma = Y1^2
  23733. var gamma = this.y.redSqr();
  23734. // beta = X1 * gamma
  23735. var beta = this.x.redMul(gamma);
  23736. // alpha = 3 * (X1 - delta) * (X1 + delta)
  23737. var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
  23738. alpha = alpha.redAdd(alpha).redIAdd(alpha);
  23739. // X3 = alpha^2 - 8 * beta
  23740. var beta4 = beta.redIAdd(beta);
  23741. beta4 = beta4.redIAdd(beta4);
  23742. var beta8 = beta4.redAdd(beta4);
  23743. nx = alpha.redSqr().redISub(beta8);
  23744. // Z3 = (Y1 + Z1)^2 - gamma - delta
  23745. nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
  23746. // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2
  23747. var ggamma8 = gamma.redSqr();
  23748. ggamma8 = ggamma8.redIAdd(ggamma8);
  23749. ggamma8 = ggamma8.redIAdd(ggamma8);
  23750. ggamma8 = ggamma8.redIAdd(ggamma8);
  23751. ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
  23752. }
  23753. return this.curve.jpoint(nx, ny, nz);
  23754. };
  23755. JPoint.prototype._dbl = function _dbl() {
  23756. var a = this.curve.a;
  23757. // 4M + 6S + 10A
  23758. var jx = this.x;
  23759. var jy = this.y;
  23760. var jz = this.z;
  23761. var jz4 = jz.redSqr().redSqr();
  23762. var jx2 = jx.redSqr();
  23763. var jy2 = jy.redSqr();
  23764. var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
  23765. var jxd4 = jx.redAdd(jx);
  23766. jxd4 = jxd4.redIAdd(jxd4);
  23767. var t1 = jxd4.redMul(jy2);
  23768. var nx = c.redSqr().redISub(t1.redAdd(t1));
  23769. var t2 = t1.redISub(nx);
  23770. var jyd8 = jy2.redSqr();
  23771. jyd8 = jyd8.redIAdd(jyd8);
  23772. jyd8 = jyd8.redIAdd(jyd8);
  23773. jyd8 = jyd8.redIAdd(jyd8);
  23774. var ny = c.redMul(t2).redISub(jyd8);
  23775. var nz = jy.redAdd(jy).redMul(jz);
  23776. return this.curve.jpoint(nx, ny, nz);
  23777. };
  23778. JPoint.prototype.trpl = function trpl() {
  23779. if (!this.curve.zeroA)
  23780. return this.dbl().add(this);
  23781. // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl
  23782. // 5M + 10S + ...
  23783. // XX = X1^2
  23784. var xx = this.x.redSqr();
  23785. // YY = Y1^2
  23786. var yy = this.y.redSqr();
  23787. // ZZ = Z1^2
  23788. var zz = this.z.redSqr();
  23789. // YYYY = YY^2
  23790. var yyyy = yy.redSqr();
  23791. // M = 3 * XX + a * ZZ2; a = 0
  23792. var m = xx.redAdd(xx).redIAdd(xx);
  23793. // MM = M^2
  23794. var mm = m.redSqr();
  23795. // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM
  23796. var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
  23797. e = e.redIAdd(e);
  23798. e = e.redAdd(e).redIAdd(e);
  23799. e = e.redISub(mm);
  23800. // EE = E^2
  23801. var ee = e.redSqr();
  23802. // T = 16*YYYY
  23803. var t = yyyy.redIAdd(yyyy);
  23804. t = t.redIAdd(t);
  23805. t = t.redIAdd(t);
  23806. t = t.redIAdd(t);
  23807. // U = (M + E)^2 - MM - EE - T
  23808. var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
  23809. // X3 = 4 * (X1 * EE - 4 * YY * U)
  23810. var yyu4 = yy.redMul(u);
  23811. yyu4 = yyu4.redIAdd(yyu4);
  23812. yyu4 = yyu4.redIAdd(yyu4);
  23813. var nx = this.x.redMul(ee).redISub(yyu4);
  23814. nx = nx.redIAdd(nx);
  23815. nx = nx.redIAdd(nx);
  23816. // Y3 = 8 * Y1 * (U * (T - U) - E * EE)
  23817. var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
  23818. ny = ny.redIAdd(ny);
  23819. ny = ny.redIAdd(ny);
  23820. ny = ny.redIAdd(ny);
  23821. // Z3 = (Z1 + E)^2 - ZZ - EE
  23822. var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
  23823. return this.curve.jpoint(nx, ny, nz);
  23824. };
  23825. JPoint.prototype.mul = function mul(k, kbase) {
  23826. k = new BN(k, kbase);
  23827. return this.curve._wnafMul(this, k);
  23828. };
  23829. JPoint.prototype.eq = function eq(p) {
  23830. if (p.type === 'affine')
  23831. return this.eq(p.toJ());
  23832. if (this === p)
  23833. return true;
  23834. // x1 * z2^2 == x2 * z1^2
  23835. var z2 = this.z.redSqr();
  23836. var pz2 = p.z.redSqr();
  23837. if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)
  23838. return false;
  23839. // y1 * z2^3 == y2 * z1^3
  23840. var z3 = z2.redMul(this.z);
  23841. var pz3 = pz2.redMul(p.z);
  23842. return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
  23843. };
  23844. JPoint.prototype.eqXToP = function eqXToP(x) {
  23845. var zs = this.z.redSqr();
  23846. var rx = x.toRed(this.curve.red).redMul(zs);
  23847. if (this.x.cmp(rx) === 0)
  23848. return true;
  23849. var xc = x.clone();
  23850. var t = this.curve.redN.redMul(zs);
  23851. for (;;) {
  23852. xc.iadd(this.curve.n);
  23853. if (xc.cmp(this.curve.p) >= 0)
  23854. return false;
  23855. rx.redIAdd(t);
  23856. if (this.x.cmp(rx) === 0)
  23857. return true;
  23858. }
  23859. };
  23860. JPoint.prototype.inspect = function inspect() {
  23861. if (this.isInfinity())
  23862. return '<EC JPoint Infinity>';
  23863. return '<EC JPoint x: ' + this.x.toString(16, 2) +
  23864. ' y: ' + this.y.toString(16, 2) +
  23865. ' z: ' + this.z.toString(16, 2) + '>';
  23866. };
  23867. JPoint.prototype.isInfinity = function isInfinity() {
  23868. // XXX This code assumes that zero is always zero in red
  23869. return this.z.cmpn(0) === 0;
  23870. };
  23871. /***/ }),
  23872. /* 134 */
  23873. /*!**********************************************************!*\
  23874. !*** ./node_modules/elliptic/lib/elliptic/curve/mont.js ***!
  23875. \**********************************************************/
  23876. /*! no static exports found */
  23877. /***/ (function(module, exports, __webpack_require__) {
  23878. "use strict";
  23879. var BN = __webpack_require__(/*! bn.js */ 116);
  23880. var inherits = __webpack_require__(/*! inherits */ 40);
  23881. var Base = __webpack_require__(/*! ./base */ 132);
  23882. var utils = __webpack_require__(/*! ../utils */ 129);
  23883. function MontCurve(conf) {
  23884. Base.call(this, 'mont', conf);
  23885. this.a = new BN(conf.a, 16).toRed(this.red);
  23886. this.b = new BN(conf.b, 16).toRed(this.red);
  23887. this.i4 = new BN(4).toRed(this.red).redInvm();
  23888. this.two = new BN(2).toRed(this.red);
  23889. this.a24 = this.i4.redMul(this.a.redAdd(this.two));
  23890. }
  23891. inherits(MontCurve, Base);
  23892. module.exports = MontCurve;
  23893. MontCurve.prototype.validate = function validate(point) {
  23894. var x = point.normalize().x;
  23895. var x2 = x.redSqr();
  23896. var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
  23897. var y = rhs.redSqrt();
  23898. return y.redSqr().cmp(rhs) === 0;
  23899. };
  23900. function Point(curve, x, z) {
  23901. Base.BasePoint.call(this, curve, 'projective');
  23902. if (x === null && z === null) {
  23903. this.x = this.curve.one;
  23904. this.z = this.curve.zero;
  23905. } else {
  23906. this.x = new BN(x, 16);
  23907. this.z = new BN(z, 16);
  23908. if (!this.x.red)
  23909. this.x = this.x.toRed(this.curve.red);
  23910. if (!this.z.red)
  23911. this.z = this.z.toRed(this.curve.red);
  23912. }
  23913. }
  23914. inherits(Point, Base.BasePoint);
  23915. MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
  23916. return this.point(utils.toArray(bytes, enc), 1);
  23917. };
  23918. MontCurve.prototype.point = function point(x, z) {
  23919. return new Point(this, x, z);
  23920. };
  23921. MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  23922. return Point.fromJSON(this, obj);
  23923. };
  23924. Point.prototype.precompute = function precompute() {
  23925. // No-op
  23926. };
  23927. Point.prototype._encode = function _encode() {
  23928. return this.getX().toArray('be', this.curve.p.byteLength());
  23929. };
  23930. Point.fromJSON = function fromJSON(curve, obj) {
  23931. return new Point(curve, obj[0], obj[1] || curve.one);
  23932. };
  23933. Point.prototype.inspect = function inspect() {
  23934. if (this.isInfinity())
  23935. return '<EC Point Infinity>';
  23936. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  23937. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  23938. };
  23939. Point.prototype.isInfinity = function isInfinity() {
  23940. // XXX This code assumes that zero is always zero in red
  23941. return this.z.cmpn(0) === 0;
  23942. };
  23943. Point.prototype.dbl = function dbl() {
  23944. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3
  23945. // 2M + 2S + 4A
  23946. // A = X1 + Z1
  23947. var a = this.x.redAdd(this.z);
  23948. // AA = A^2
  23949. var aa = a.redSqr();
  23950. // B = X1 - Z1
  23951. var b = this.x.redSub(this.z);
  23952. // BB = B^2
  23953. var bb = b.redSqr();
  23954. // C = AA - BB
  23955. var c = aa.redSub(bb);
  23956. // X3 = AA * BB
  23957. var nx = aa.redMul(bb);
  23958. // Z3 = C * (BB + A24 * C)
  23959. var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
  23960. return this.curve.point(nx, nz);
  23961. };
  23962. Point.prototype.add = function add() {
  23963. throw new Error('Not supported on Montgomery curve');
  23964. };
  23965. Point.prototype.diffAdd = function diffAdd(p, diff) {
  23966. // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3
  23967. // 4M + 2S + 6A
  23968. // A = X2 + Z2
  23969. var a = this.x.redAdd(this.z);
  23970. // B = X2 - Z2
  23971. var b = this.x.redSub(this.z);
  23972. // C = X3 + Z3
  23973. var c = p.x.redAdd(p.z);
  23974. // D = X3 - Z3
  23975. var d = p.x.redSub(p.z);
  23976. // DA = D * A
  23977. var da = d.redMul(a);
  23978. // CB = C * B
  23979. var cb = c.redMul(b);
  23980. // X5 = Z1 * (DA + CB)^2
  23981. var nx = diff.z.redMul(da.redAdd(cb).redSqr());
  23982. // Z5 = X1 * (DA - CB)^2
  23983. var nz = diff.x.redMul(da.redISub(cb).redSqr());
  23984. return this.curve.point(nx, nz);
  23985. };
  23986. Point.prototype.mul = function mul(k) {
  23987. var t = k.clone();
  23988. var a = this; // (N / 2) * Q + Q
  23989. var b = this.curve.point(null, null); // (N / 2) * Q
  23990. var c = this; // Q
  23991. for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))
  23992. bits.push(t.andln(1));
  23993. for (var i = bits.length - 1; i >= 0; i--) {
  23994. if (bits[i] === 0) {
  23995. // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q
  23996. a = a.diffAdd(b, c);
  23997. // N * Q = 2 * ((N / 2) * Q + Q))
  23998. b = b.dbl();
  23999. } else {
  24000. // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)
  24001. b = a.diffAdd(b, c);
  24002. // N * Q + Q = 2 * ((N / 2) * Q + Q)
  24003. a = a.dbl();
  24004. }
  24005. }
  24006. return b;
  24007. };
  24008. Point.prototype.mulAdd = function mulAdd() {
  24009. throw new Error('Not supported on Montgomery curve');
  24010. };
  24011. Point.prototype.jumlAdd = function jumlAdd() {
  24012. throw new Error('Not supported on Montgomery curve');
  24013. };
  24014. Point.prototype.eq = function eq(other) {
  24015. return this.getX().cmp(other.getX()) === 0;
  24016. };
  24017. Point.prototype.normalize = function normalize() {
  24018. this.x = this.x.redMul(this.z.redInvm());
  24019. this.z = this.curve.one;
  24020. return this;
  24021. };
  24022. Point.prototype.getX = function getX() {
  24023. // Normalize coordinates
  24024. this.normalize();
  24025. return this.x.fromRed();
  24026. };
  24027. /***/ }),
  24028. /* 135 */
  24029. /*!*************************************************************!*\
  24030. !*** ./node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
  24031. \*************************************************************/
  24032. /*! no static exports found */
  24033. /***/ (function(module, exports, __webpack_require__) {
  24034. "use strict";
  24035. var utils = __webpack_require__(/*! ../utils */ 129);
  24036. var BN = __webpack_require__(/*! bn.js */ 116);
  24037. var inherits = __webpack_require__(/*! inherits */ 40);
  24038. var Base = __webpack_require__(/*! ./base */ 132);
  24039. var assert = utils.assert;
  24040. function EdwardsCurve(conf) {
  24041. // NOTE: Important as we are creating point in Base.call()
  24042. this.twisted = (conf.a | 0) !== 1;
  24043. this.mOneA = this.twisted && (conf.a | 0) === -1;
  24044. this.extended = this.mOneA;
  24045. Base.call(this, 'edwards', conf);
  24046. this.a = new BN(conf.a, 16).umod(this.red.m);
  24047. this.a = this.a.toRed(this.red);
  24048. this.c = new BN(conf.c, 16).toRed(this.red);
  24049. this.c2 = this.c.redSqr();
  24050. this.d = new BN(conf.d, 16).toRed(this.red);
  24051. this.dd = this.d.redAdd(this.d);
  24052. assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
  24053. this.oneC = (conf.c | 0) === 1;
  24054. }
  24055. inherits(EdwardsCurve, Base);
  24056. module.exports = EdwardsCurve;
  24057. EdwardsCurve.prototype._mulA = function _mulA(num) {
  24058. if (this.mOneA)
  24059. return num.redNeg();
  24060. else
  24061. return this.a.redMul(num);
  24062. };
  24063. EdwardsCurve.prototype._mulC = function _mulC(num) {
  24064. if (this.oneC)
  24065. return num;
  24066. else
  24067. return this.c.redMul(num);
  24068. };
  24069. // Just for compatibility with Short curve
  24070. EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
  24071. return this.point(x, y, z, t);
  24072. };
  24073. EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
  24074. x = new BN(x, 16);
  24075. if (!x.red)
  24076. x = x.toRed(this.red);
  24077. var x2 = x.redSqr();
  24078. var rhs = this.c2.redSub(this.a.redMul(x2));
  24079. var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
  24080. var y2 = rhs.redMul(lhs.redInvm());
  24081. var y = y2.redSqrt();
  24082. if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
  24083. throw new Error('invalid point');
  24084. var isOdd = y.fromRed().isOdd();
  24085. if (odd && !isOdd || !odd && isOdd)
  24086. y = y.redNeg();
  24087. return this.point(x, y);
  24088. };
  24089. EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
  24090. y = new BN(y, 16);
  24091. if (!y.red)
  24092. y = y.toRed(this.red);
  24093. // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
  24094. var y2 = y.redSqr();
  24095. var lhs = y2.redSub(this.c2);
  24096. var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
  24097. var x2 = lhs.redMul(rhs.redInvm());
  24098. if (x2.cmp(this.zero) === 0) {
  24099. if (odd)
  24100. throw new Error('invalid point');
  24101. else
  24102. return this.point(this.zero, y);
  24103. }
  24104. var x = x2.redSqrt();
  24105. if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
  24106. throw new Error('invalid point');
  24107. if (x.fromRed().isOdd() !== odd)
  24108. x = x.redNeg();
  24109. return this.point(x, y);
  24110. };
  24111. EdwardsCurve.prototype.validate = function validate(point) {
  24112. if (point.isInfinity())
  24113. return true;
  24114. // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
  24115. point.normalize();
  24116. var x2 = point.x.redSqr();
  24117. var y2 = point.y.redSqr();
  24118. var lhs = x2.redMul(this.a).redAdd(y2);
  24119. var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
  24120. return lhs.cmp(rhs) === 0;
  24121. };
  24122. function Point(curve, x, y, z, t) {
  24123. Base.BasePoint.call(this, curve, 'projective');
  24124. if (x === null && y === null && z === null) {
  24125. this.x = this.curve.zero;
  24126. this.y = this.curve.one;
  24127. this.z = this.curve.one;
  24128. this.t = this.curve.zero;
  24129. this.zOne = true;
  24130. } else {
  24131. this.x = new BN(x, 16);
  24132. this.y = new BN(y, 16);
  24133. this.z = z ? new BN(z, 16) : this.curve.one;
  24134. this.t = t && new BN(t, 16);
  24135. if (!this.x.red)
  24136. this.x = this.x.toRed(this.curve.red);
  24137. if (!this.y.red)
  24138. this.y = this.y.toRed(this.curve.red);
  24139. if (!this.z.red)
  24140. this.z = this.z.toRed(this.curve.red);
  24141. if (this.t && !this.t.red)
  24142. this.t = this.t.toRed(this.curve.red);
  24143. this.zOne = this.z === this.curve.one;
  24144. // Use extended coordinates
  24145. if (this.curve.extended && !this.t) {
  24146. this.t = this.x.redMul(this.y);
  24147. if (!this.zOne)
  24148. this.t = this.t.redMul(this.z.redInvm());
  24149. }
  24150. }
  24151. }
  24152. inherits(Point, Base.BasePoint);
  24153. EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
  24154. return Point.fromJSON(this, obj);
  24155. };
  24156. EdwardsCurve.prototype.point = function point(x, y, z, t) {
  24157. return new Point(this, x, y, z, t);
  24158. };
  24159. Point.fromJSON = function fromJSON(curve, obj) {
  24160. return new Point(curve, obj[0], obj[1], obj[2]);
  24161. };
  24162. Point.prototype.inspect = function inspect() {
  24163. if (this.isInfinity())
  24164. return '<EC Point Infinity>';
  24165. return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
  24166. ' y: ' + this.y.fromRed().toString(16, 2) +
  24167. ' z: ' + this.z.fromRed().toString(16, 2) + '>';
  24168. };
  24169. Point.prototype.isInfinity = function isInfinity() {
  24170. // XXX This code assumes that zero is always zero in red
  24171. return this.x.cmpn(0) === 0 &&
  24172. (this.y.cmp(this.z) === 0 ||
  24173. (this.zOne && this.y.cmp(this.curve.c) === 0));
  24174. };
  24175. Point.prototype._extDbl = function _extDbl() {
  24176. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  24177. // #doubling-dbl-2008-hwcd
  24178. // 4M + 4S
  24179. // A = X1^2
  24180. var a = this.x.redSqr();
  24181. // B = Y1^2
  24182. var b = this.y.redSqr();
  24183. // C = 2 * Z1^2
  24184. var c = this.z.redSqr();
  24185. c = c.redIAdd(c);
  24186. // D = a * A
  24187. var d = this.curve._mulA(a);
  24188. // E = (X1 + Y1)^2 - A - B
  24189. var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
  24190. // G = D + B
  24191. var g = d.redAdd(b);
  24192. // F = G - C
  24193. var f = g.redSub(c);
  24194. // H = D - B
  24195. var h = d.redSub(b);
  24196. // X3 = E * F
  24197. var nx = e.redMul(f);
  24198. // Y3 = G * H
  24199. var ny = g.redMul(h);
  24200. // T3 = E * H
  24201. var nt = e.redMul(h);
  24202. // Z3 = F * G
  24203. var nz = f.redMul(g);
  24204. return this.curve.point(nx, ny, nz, nt);
  24205. };
  24206. Point.prototype._projDbl = function _projDbl() {
  24207. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  24208. // #doubling-dbl-2008-bbjlp
  24209. // #doubling-dbl-2007-bl
  24210. // and others
  24211. // Generally 3M + 4S or 2M + 4S
  24212. // B = (X1 + Y1)^2
  24213. var b = this.x.redAdd(this.y).redSqr();
  24214. // C = X1^2
  24215. var c = this.x.redSqr();
  24216. // D = Y1^2
  24217. var d = this.y.redSqr();
  24218. var nx;
  24219. var ny;
  24220. var nz;
  24221. if (this.curve.twisted) {
  24222. // E = a * C
  24223. var e = this.curve._mulA(c);
  24224. // F = E + D
  24225. var f = e.redAdd(d);
  24226. if (this.zOne) {
  24227. // X3 = (B - C - D) * (F - 2)
  24228. nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
  24229. // Y3 = F * (E - D)
  24230. ny = f.redMul(e.redSub(d));
  24231. // Z3 = F^2 - 2 * F
  24232. nz = f.redSqr().redSub(f).redSub(f);
  24233. } else {
  24234. // H = Z1^2
  24235. var h = this.z.redSqr();
  24236. // J = F - 2 * H
  24237. var j = f.redSub(h).redISub(h);
  24238. // X3 = (B-C-D)*J
  24239. nx = b.redSub(c).redISub(d).redMul(j);
  24240. // Y3 = F * (E - D)
  24241. ny = f.redMul(e.redSub(d));
  24242. // Z3 = F * J
  24243. nz = f.redMul(j);
  24244. }
  24245. } else {
  24246. // E = C + D
  24247. var e = c.redAdd(d);
  24248. // H = (c * Z1)^2
  24249. var h = this.curve._mulC(this.z).redSqr();
  24250. // J = E - 2 * H
  24251. var j = e.redSub(h).redSub(h);
  24252. // X3 = c * (B - E) * J
  24253. nx = this.curve._mulC(b.redISub(e)).redMul(j);
  24254. // Y3 = c * E * (C - D)
  24255. ny = this.curve._mulC(e).redMul(c.redISub(d));
  24256. // Z3 = E * J
  24257. nz = e.redMul(j);
  24258. }
  24259. return this.curve.point(nx, ny, nz);
  24260. };
  24261. Point.prototype.dbl = function dbl() {
  24262. if (this.isInfinity())
  24263. return this;
  24264. // Double in extended coordinates
  24265. if (this.curve.extended)
  24266. return this._extDbl();
  24267. else
  24268. return this._projDbl();
  24269. };
  24270. Point.prototype._extAdd = function _extAdd(p) {
  24271. // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
  24272. // #addition-add-2008-hwcd-3
  24273. // 8M
  24274. // A = (Y1 - X1) * (Y2 - X2)
  24275. var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
  24276. // B = (Y1 + X1) * (Y2 + X2)
  24277. var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
  24278. // C = T1 * k * T2
  24279. var c = this.t.redMul(this.curve.dd).redMul(p.t);
  24280. // D = Z1 * 2 * Z2
  24281. var d = this.z.redMul(p.z.redAdd(p.z));
  24282. // E = B - A
  24283. var e = b.redSub(a);
  24284. // F = D - C
  24285. var f = d.redSub(c);
  24286. // G = D + C
  24287. var g = d.redAdd(c);
  24288. // H = B + A
  24289. var h = b.redAdd(a);
  24290. // X3 = E * F
  24291. var nx = e.redMul(f);
  24292. // Y3 = G * H
  24293. var ny = g.redMul(h);
  24294. // T3 = E * H
  24295. var nt = e.redMul(h);
  24296. // Z3 = F * G
  24297. var nz = f.redMul(g);
  24298. return this.curve.point(nx, ny, nz, nt);
  24299. };
  24300. Point.prototype._projAdd = function _projAdd(p) {
  24301. // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
  24302. // #addition-add-2008-bbjlp
  24303. // #addition-add-2007-bl
  24304. // 10M + 1S
  24305. // A = Z1 * Z2
  24306. var a = this.z.redMul(p.z);
  24307. // B = A^2
  24308. var b = a.redSqr();
  24309. // C = X1 * X2
  24310. var c = this.x.redMul(p.x);
  24311. // D = Y1 * Y2
  24312. var d = this.y.redMul(p.y);
  24313. // E = d * C * D
  24314. var e = this.curve.d.redMul(c).redMul(d);
  24315. // F = B - E
  24316. var f = b.redSub(e);
  24317. // G = B + E
  24318. var g = b.redAdd(e);
  24319. // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)
  24320. var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
  24321. var nx = a.redMul(f).redMul(tmp);
  24322. var ny;
  24323. var nz;
  24324. if (this.curve.twisted) {
  24325. // Y3 = A * G * (D - a * C)
  24326. ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
  24327. // Z3 = F * G
  24328. nz = f.redMul(g);
  24329. } else {
  24330. // Y3 = A * G * (D - C)
  24331. ny = a.redMul(g).redMul(d.redSub(c));
  24332. // Z3 = c * F * G
  24333. nz = this.curve._mulC(f).redMul(g);
  24334. }
  24335. return this.curve.point(nx, ny, nz);
  24336. };
  24337. Point.prototype.add = function add(p) {
  24338. if (this.isInfinity())
  24339. return p;
  24340. if (p.isInfinity())
  24341. return this;
  24342. if (this.curve.extended)
  24343. return this._extAdd(p);
  24344. else
  24345. return this._projAdd(p);
  24346. };
  24347. Point.prototype.mul = function mul(k) {
  24348. if (this._hasDoubles(k))
  24349. return this.curve._fixedNafMul(this, k);
  24350. else
  24351. return this.curve._wnafMul(this, k);
  24352. };
  24353. Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
  24354. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
  24355. };
  24356. Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
  24357. return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
  24358. };
  24359. Point.prototype.normalize = function normalize() {
  24360. if (this.zOne)
  24361. return this;
  24362. // Normalize coordinates
  24363. var zi = this.z.redInvm();
  24364. this.x = this.x.redMul(zi);
  24365. this.y = this.y.redMul(zi);
  24366. if (this.t)
  24367. this.t = this.t.redMul(zi);
  24368. this.z = this.curve.one;
  24369. this.zOne = true;
  24370. return this;
  24371. };
  24372. Point.prototype.neg = function neg() {
  24373. return this.curve.point(this.x.redNeg(),
  24374. this.y,
  24375. this.z,
  24376. this.t && this.t.redNeg());
  24377. };
  24378. Point.prototype.getX = function getX() {
  24379. this.normalize();
  24380. return this.x.fromRed();
  24381. };
  24382. Point.prototype.getY = function getY() {
  24383. this.normalize();
  24384. return this.y.fromRed();
  24385. };
  24386. Point.prototype.eq = function eq(other) {
  24387. return this === other ||
  24388. this.getX().cmp(other.getX()) === 0 &&
  24389. this.getY().cmp(other.getY()) === 0;
  24390. };
  24391. Point.prototype.eqXToP = function eqXToP(x) {
  24392. var rx = x.toRed(this.curve.red).redMul(this.z);
  24393. if (this.x.cmp(rx) === 0)
  24394. return true;
  24395. var xc = x.clone();
  24396. var t = this.curve.redN.redMul(this.z);
  24397. for (;;) {
  24398. xc.iadd(this.curve.n);
  24399. if (xc.cmp(this.curve.p) >= 0)
  24400. return false;
  24401. rx.redIAdd(t);
  24402. if (this.x.cmp(rx) === 0)
  24403. return true;
  24404. }
  24405. };
  24406. // Compatibility with BaseCurve
  24407. Point.prototype.toP = Point.prototype.normalize;
  24408. Point.prototype.mixedAdd = Point.prototype.add;
  24409. /***/ }),
  24410. /* 136 */
  24411. /*!******************************************************!*\
  24412. !*** ./node_modules/elliptic/lib/elliptic/curves.js ***!
  24413. \******************************************************/
  24414. /*! no static exports found */
  24415. /***/ (function(module, exports, __webpack_require__) {
  24416. "use strict";
  24417. var curves = exports;
  24418. var hash = __webpack_require__(/*! hash.js */ 137);
  24419. var curve = __webpack_require__(/*! ./curve */ 131);
  24420. var utils = __webpack_require__(/*! ./utils */ 129);
  24421. var assert = utils.assert;
  24422. function PresetCurve(options) {
  24423. if (options.type === 'short')
  24424. this.curve = new curve.short(options);
  24425. else if (options.type === 'edwards')
  24426. this.curve = new curve.edwards(options);
  24427. else
  24428. this.curve = new curve.mont(options);
  24429. this.g = this.curve.g;
  24430. this.n = this.curve.n;
  24431. this.hash = options.hash;
  24432. assert(this.g.validate(), 'Invalid curve');
  24433. assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');
  24434. }
  24435. curves.PresetCurve = PresetCurve;
  24436. function defineCurve(name, options) {
  24437. Object.defineProperty(curves, name, {
  24438. configurable: true,
  24439. enumerable: true,
  24440. get: function() {
  24441. var curve = new PresetCurve(options);
  24442. Object.defineProperty(curves, name, {
  24443. configurable: true,
  24444. enumerable: true,
  24445. value: curve
  24446. });
  24447. return curve;
  24448. }
  24449. });
  24450. }
  24451. defineCurve('p192', {
  24452. type: 'short',
  24453. prime: 'p192',
  24454. p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',
  24455. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',
  24456. b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',
  24457. n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',
  24458. hash: hash.sha256,
  24459. gRed: false,
  24460. g: [
  24461. '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',
  24462. '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'
  24463. ]
  24464. });
  24465. defineCurve('p224', {
  24466. type: 'short',
  24467. prime: 'p224',
  24468. p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',
  24469. a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',
  24470. b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',
  24471. n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',
  24472. hash: hash.sha256,
  24473. gRed: false,
  24474. g: [
  24475. 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',
  24476. 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'
  24477. ]
  24478. });
  24479. defineCurve('p256', {
  24480. type: 'short',
  24481. prime: null,
  24482. p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',
  24483. a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',
  24484. b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',
  24485. n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',
  24486. hash: hash.sha256,
  24487. gRed: false,
  24488. g: [
  24489. '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',
  24490. '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'
  24491. ]
  24492. });
  24493. defineCurve('p384', {
  24494. type: 'short',
  24495. prime: null,
  24496. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24497. 'fffffffe ffffffff 00000000 00000000 ffffffff',
  24498. a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24499. 'fffffffe ffffffff 00000000 00000000 fffffffc',
  24500. b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +
  24501. '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',
  24502. n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +
  24503. 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',
  24504. hash: hash.sha384,
  24505. gRed: false,
  24506. g: [
  24507. 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +
  24508. '5502f25d bf55296c 3a545e38 72760ab7',
  24509. '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +
  24510. '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'
  24511. ]
  24512. });
  24513. defineCurve('p521', {
  24514. type: 'short',
  24515. prime: null,
  24516. p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24517. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24518. 'ffffffff ffffffff ffffffff ffffffff ffffffff',
  24519. a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24520. 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24521. 'ffffffff ffffffff ffffffff ffffffff fffffffc',
  24522. b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +
  24523. '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +
  24524. '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',
  24525. n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +
  24526. 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +
  24527. 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',
  24528. hash: hash.sha512,
  24529. gRed: false,
  24530. g: [
  24531. '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +
  24532. '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +
  24533. 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',
  24534. '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +
  24535. '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +
  24536. '3fad0761 353c7086 a272c240 88be9476 9fd16650'
  24537. ]
  24538. });
  24539. defineCurve('curve25519', {
  24540. type: 'mont',
  24541. prime: 'p25519',
  24542. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  24543. a: '76d06',
  24544. b: '1',
  24545. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  24546. hash: hash.sha256,
  24547. gRed: false,
  24548. g: [
  24549. '9'
  24550. ]
  24551. });
  24552. defineCurve('ed25519', {
  24553. type: 'edwards',
  24554. prime: 'p25519',
  24555. p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',
  24556. a: '-1',
  24557. c: '1',
  24558. // -121665 * (121666^(-1)) (mod P)
  24559. d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',
  24560. n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',
  24561. hash: hash.sha256,
  24562. gRed: false,
  24563. g: [
  24564. '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',
  24565. // 4/5
  24566. '6666666666666666666666666666666666666666666666666666666666666658'
  24567. ]
  24568. });
  24569. var pre;
  24570. try {
  24571. pre = __webpack_require__(/*! ./precomputed/secp256k1 */ 149);
  24572. } catch (e) {
  24573. pre = undefined;
  24574. }
  24575. defineCurve('secp256k1', {
  24576. type: 'short',
  24577. prime: 'k256',
  24578. p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',
  24579. a: '0',
  24580. b: '7',
  24581. n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',
  24582. h: '1',
  24583. hash: hash.sha256,
  24584. // Precomputed endomorphism
  24585. beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',
  24586. lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',
  24587. basis: [
  24588. {
  24589. a: '3086d221a7d46bcde86c90e49284eb15',
  24590. b: '-e4437ed6010e88286f547fa90abfe4c3'
  24591. },
  24592. {
  24593. a: '114ca50f7a8e2f3f657c1108d9d44cfd8',
  24594. b: '3086d221a7d46bcde86c90e49284eb15'
  24595. }
  24596. ],
  24597. gRed: false,
  24598. g: [
  24599. '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
  24600. '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
  24601. pre
  24602. ]
  24603. });
  24604. /***/ }),
  24605. /* 137 */
  24606. /*!******************************************!*\
  24607. !*** ./node_modules/hash.js/lib/hash.js ***!
  24608. \******************************************/
  24609. /*! no static exports found */
  24610. /***/ (function(module, exports, __webpack_require__) {
  24611. var hash = exports;
  24612. hash.utils = __webpack_require__(/*! ./hash/utils */ 138);
  24613. hash.common = __webpack_require__(/*! ./hash/common */ 139);
  24614. hash.sha = __webpack_require__(/*! ./hash/sha */ 140);
  24615. hash.ripemd = __webpack_require__(/*! ./hash/ripemd */ 147);
  24616. hash.hmac = __webpack_require__(/*! ./hash/hmac */ 148);
  24617. // Proxy hash functions to the main object
  24618. hash.sha1 = hash.sha.sha1;
  24619. hash.sha256 = hash.sha.sha256;
  24620. hash.sha224 = hash.sha.sha224;
  24621. hash.sha384 = hash.sha.sha384;
  24622. hash.sha512 = hash.sha.sha512;
  24623. hash.ripemd160 = hash.ripemd.ripemd160;
  24624. /***/ }),
  24625. /* 138 */
  24626. /*!************************************************!*\
  24627. !*** ./node_modules/hash.js/lib/hash/utils.js ***!
  24628. \************************************************/
  24629. /*! no static exports found */
  24630. /***/ (function(module, exports, __webpack_require__) {
  24631. "use strict";
  24632. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  24633. var inherits = __webpack_require__(/*! inherits */ 40);
  24634. exports.inherits = inherits;
  24635. function isSurrogatePair(msg, i) {
  24636. if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
  24637. return false;
  24638. }
  24639. if (i < 0 || i + 1 >= msg.length) {
  24640. return false;
  24641. }
  24642. return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
  24643. }
  24644. function toArray(msg, enc) {
  24645. if (Array.isArray(msg))
  24646. return msg.slice();
  24647. if (!msg)
  24648. return [];
  24649. var res = [];
  24650. if (typeof msg === 'string') {
  24651. if (!enc) {
  24652. // Inspired by stringToUtf8ByteArray() in closure-library by Google
  24653. // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
  24654. // Apache License 2.0
  24655. // https://github.com/google/closure-library/blob/master/LICENSE
  24656. var p = 0;
  24657. for (var i = 0; i < msg.length; i++) {
  24658. var c = msg.charCodeAt(i);
  24659. if (c < 128) {
  24660. res[p++] = c;
  24661. } else if (c < 2048) {
  24662. res[p++] = (c >> 6) | 192;
  24663. res[p++] = (c & 63) | 128;
  24664. } else if (isSurrogatePair(msg, i)) {
  24665. c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
  24666. res[p++] = (c >> 18) | 240;
  24667. res[p++] = ((c >> 12) & 63) | 128;
  24668. res[p++] = ((c >> 6) & 63) | 128;
  24669. res[p++] = (c & 63) | 128;
  24670. } else {
  24671. res[p++] = (c >> 12) | 224;
  24672. res[p++] = ((c >> 6) & 63) | 128;
  24673. res[p++] = (c & 63) | 128;
  24674. }
  24675. }
  24676. } else if (enc === 'hex') {
  24677. msg = msg.replace(/[^a-z0-9]+/ig, '');
  24678. if (msg.length % 2 !== 0)
  24679. msg = '0' + msg;
  24680. for (i = 0; i < msg.length; i += 2)
  24681. res.push(parseInt(msg[i] + msg[i + 1], 16));
  24682. }
  24683. } else {
  24684. for (i = 0; i < msg.length; i++)
  24685. res[i] = msg[i] | 0;
  24686. }
  24687. return res;
  24688. }
  24689. exports.toArray = toArray;
  24690. function toHex(msg) {
  24691. var res = '';
  24692. for (var i = 0; i < msg.length; i++)
  24693. res += zero2(msg[i].toString(16));
  24694. return res;
  24695. }
  24696. exports.toHex = toHex;
  24697. function htonl(w) {
  24698. var res = (w >>> 24) |
  24699. ((w >>> 8) & 0xff00) |
  24700. ((w << 8) & 0xff0000) |
  24701. ((w & 0xff) << 24);
  24702. return res >>> 0;
  24703. }
  24704. exports.htonl = htonl;
  24705. function toHex32(msg, endian) {
  24706. var res = '';
  24707. for (var i = 0; i < msg.length; i++) {
  24708. var w = msg[i];
  24709. if (endian === 'little')
  24710. w = htonl(w);
  24711. res += zero8(w.toString(16));
  24712. }
  24713. return res;
  24714. }
  24715. exports.toHex32 = toHex32;
  24716. function zero2(word) {
  24717. if (word.length === 1)
  24718. return '0' + word;
  24719. else
  24720. return word;
  24721. }
  24722. exports.zero2 = zero2;
  24723. function zero8(word) {
  24724. if (word.length === 7)
  24725. return '0' + word;
  24726. else if (word.length === 6)
  24727. return '00' + word;
  24728. else if (word.length === 5)
  24729. return '000' + word;
  24730. else if (word.length === 4)
  24731. return '0000' + word;
  24732. else if (word.length === 3)
  24733. return '00000' + word;
  24734. else if (word.length === 2)
  24735. return '000000' + word;
  24736. else if (word.length === 1)
  24737. return '0000000' + word;
  24738. else
  24739. return word;
  24740. }
  24741. exports.zero8 = zero8;
  24742. function join32(msg, start, end, endian) {
  24743. var len = end - start;
  24744. assert(len % 4 === 0);
  24745. var res = new Array(len / 4);
  24746. for (var i = 0, k = start; i < res.length; i++, k += 4) {
  24747. var w;
  24748. if (endian === 'big')
  24749. w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
  24750. else
  24751. w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
  24752. res[i] = w >>> 0;
  24753. }
  24754. return res;
  24755. }
  24756. exports.join32 = join32;
  24757. function split32(msg, endian) {
  24758. var res = new Array(msg.length * 4);
  24759. for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
  24760. var m = msg[i];
  24761. if (endian === 'big') {
  24762. res[k] = m >>> 24;
  24763. res[k + 1] = (m >>> 16) & 0xff;
  24764. res[k + 2] = (m >>> 8) & 0xff;
  24765. res[k + 3] = m & 0xff;
  24766. } else {
  24767. res[k + 3] = m >>> 24;
  24768. res[k + 2] = (m >>> 16) & 0xff;
  24769. res[k + 1] = (m >>> 8) & 0xff;
  24770. res[k] = m & 0xff;
  24771. }
  24772. }
  24773. return res;
  24774. }
  24775. exports.split32 = split32;
  24776. function rotr32(w, b) {
  24777. return (w >>> b) | (w << (32 - b));
  24778. }
  24779. exports.rotr32 = rotr32;
  24780. function rotl32(w, b) {
  24781. return (w << b) | (w >>> (32 - b));
  24782. }
  24783. exports.rotl32 = rotl32;
  24784. function sum32(a, b) {
  24785. return (a + b) >>> 0;
  24786. }
  24787. exports.sum32 = sum32;
  24788. function sum32_3(a, b, c) {
  24789. return (a + b + c) >>> 0;
  24790. }
  24791. exports.sum32_3 = sum32_3;
  24792. function sum32_4(a, b, c, d) {
  24793. return (a + b + c + d) >>> 0;
  24794. }
  24795. exports.sum32_4 = sum32_4;
  24796. function sum32_5(a, b, c, d, e) {
  24797. return (a + b + c + d + e) >>> 0;
  24798. }
  24799. exports.sum32_5 = sum32_5;
  24800. function sum64(buf, pos, ah, al) {
  24801. var bh = buf[pos];
  24802. var bl = buf[pos + 1];
  24803. var lo = (al + bl) >>> 0;
  24804. var hi = (lo < al ? 1 : 0) + ah + bh;
  24805. buf[pos] = hi >>> 0;
  24806. buf[pos + 1] = lo;
  24807. }
  24808. exports.sum64 = sum64;
  24809. function sum64_hi(ah, al, bh, bl) {
  24810. var lo = (al + bl) >>> 0;
  24811. var hi = (lo < al ? 1 : 0) + ah + bh;
  24812. return hi >>> 0;
  24813. }
  24814. exports.sum64_hi = sum64_hi;
  24815. function sum64_lo(ah, al, bh, bl) {
  24816. var lo = al + bl;
  24817. return lo >>> 0;
  24818. }
  24819. exports.sum64_lo = sum64_lo;
  24820. function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
  24821. var carry = 0;
  24822. var lo = al;
  24823. lo = (lo + bl) >>> 0;
  24824. carry += lo < al ? 1 : 0;
  24825. lo = (lo + cl) >>> 0;
  24826. carry += lo < cl ? 1 : 0;
  24827. lo = (lo + dl) >>> 0;
  24828. carry += lo < dl ? 1 : 0;
  24829. var hi = ah + bh + ch + dh + carry;
  24830. return hi >>> 0;
  24831. }
  24832. exports.sum64_4_hi = sum64_4_hi;
  24833. function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
  24834. var lo = al + bl + cl + dl;
  24835. return lo >>> 0;
  24836. }
  24837. exports.sum64_4_lo = sum64_4_lo;
  24838. function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  24839. var carry = 0;
  24840. var lo = al;
  24841. lo = (lo + bl) >>> 0;
  24842. carry += lo < al ? 1 : 0;
  24843. lo = (lo + cl) >>> 0;
  24844. carry += lo < cl ? 1 : 0;
  24845. lo = (lo + dl) >>> 0;
  24846. carry += lo < dl ? 1 : 0;
  24847. lo = (lo + el) >>> 0;
  24848. carry += lo < el ? 1 : 0;
  24849. var hi = ah + bh + ch + dh + eh + carry;
  24850. return hi >>> 0;
  24851. }
  24852. exports.sum64_5_hi = sum64_5_hi;
  24853. function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  24854. var lo = al + bl + cl + dl + el;
  24855. return lo >>> 0;
  24856. }
  24857. exports.sum64_5_lo = sum64_5_lo;
  24858. function rotr64_hi(ah, al, num) {
  24859. var r = (al << (32 - num)) | (ah >>> num);
  24860. return r >>> 0;
  24861. }
  24862. exports.rotr64_hi = rotr64_hi;
  24863. function rotr64_lo(ah, al, num) {
  24864. var r = (ah << (32 - num)) | (al >>> num);
  24865. return r >>> 0;
  24866. }
  24867. exports.rotr64_lo = rotr64_lo;
  24868. function shr64_hi(ah, al, num) {
  24869. return ah >>> num;
  24870. }
  24871. exports.shr64_hi = shr64_hi;
  24872. function shr64_lo(ah, al, num) {
  24873. var r = (ah << (32 - num)) | (al >>> num);
  24874. return r >>> 0;
  24875. }
  24876. exports.shr64_lo = shr64_lo;
  24877. /***/ }),
  24878. /* 139 */
  24879. /*!*************************************************!*\
  24880. !*** ./node_modules/hash.js/lib/hash/common.js ***!
  24881. \*************************************************/
  24882. /*! no static exports found */
  24883. /***/ (function(module, exports, __webpack_require__) {
  24884. "use strict";
  24885. var utils = __webpack_require__(/*! ./utils */ 138);
  24886. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  24887. function BlockHash() {
  24888. this.pending = null;
  24889. this.pendingTotal = 0;
  24890. this.blockSize = this.constructor.blockSize;
  24891. this.outSize = this.constructor.outSize;
  24892. this.hmacStrength = this.constructor.hmacStrength;
  24893. this.padLength = this.constructor.padLength / 8;
  24894. this.endian = 'big';
  24895. this._delta8 = this.blockSize / 8;
  24896. this._delta32 = this.blockSize / 32;
  24897. }
  24898. exports.BlockHash = BlockHash;
  24899. BlockHash.prototype.update = function update(msg, enc) {
  24900. // Convert message to array, pad it, and join into 32bit blocks
  24901. msg = utils.toArray(msg, enc);
  24902. if (!this.pending)
  24903. this.pending = msg;
  24904. else
  24905. this.pending = this.pending.concat(msg);
  24906. this.pendingTotal += msg.length;
  24907. // Enough data, try updating
  24908. if (this.pending.length >= this._delta8) {
  24909. msg = this.pending;
  24910. // Process pending data in blocks
  24911. var r = msg.length % this._delta8;
  24912. this.pending = msg.slice(msg.length - r, msg.length);
  24913. if (this.pending.length === 0)
  24914. this.pending = null;
  24915. msg = utils.join32(msg, 0, msg.length - r, this.endian);
  24916. for (var i = 0; i < msg.length; i += this._delta32)
  24917. this._update(msg, i, i + this._delta32);
  24918. }
  24919. return this;
  24920. };
  24921. BlockHash.prototype.digest = function digest(enc) {
  24922. this.update(this._pad());
  24923. assert(this.pending === null);
  24924. return this._digest(enc);
  24925. };
  24926. BlockHash.prototype._pad = function pad() {
  24927. var len = this.pendingTotal;
  24928. var bytes = this._delta8;
  24929. var k = bytes - ((len + this.padLength) % bytes);
  24930. var res = new Array(k + this.padLength);
  24931. res[0] = 0x80;
  24932. for (var i = 1; i < k; i++)
  24933. res[i] = 0;
  24934. // Append length
  24935. len <<= 3;
  24936. if (this.endian === 'big') {
  24937. for (var t = 8; t < this.padLength; t++)
  24938. res[i++] = 0;
  24939. res[i++] = 0;
  24940. res[i++] = 0;
  24941. res[i++] = 0;
  24942. res[i++] = 0;
  24943. res[i++] = (len >>> 24) & 0xff;
  24944. res[i++] = (len >>> 16) & 0xff;
  24945. res[i++] = (len >>> 8) & 0xff;
  24946. res[i++] = len & 0xff;
  24947. } else {
  24948. res[i++] = len & 0xff;
  24949. res[i++] = (len >>> 8) & 0xff;
  24950. res[i++] = (len >>> 16) & 0xff;
  24951. res[i++] = (len >>> 24) & 0xff;
  24952. res[i++] = 0;
  24953. res[i++] = 0;
  24954. res[i++] = 0;
  24955. res[i++] = 0;
  24956. for (t = 8; t < this.padLength; t++)
  24957. res[i++] = 0;
  24958. }
  24959. return res;
  24960. };
  24961. /***/ }),
  24962. /* 140 */
  24963. /*!**********************************************!*\
  24964. !*** ./node_modules/hash.js/lib/hash/sha.js ***!
  24965. \**********************************************/
  24966. /*! no static exports found */
  24967. /***/ (function(module, exports, __webpack_require__) {
  24968. "use strict";
  24969. exports.sha1 = __webpack_require__(/*! ./sha/1 */ 141);
  24970. exports.sha224 = __webpack_require__(/*! ./sha/224 */ 143);
  24971. exports.sha256 = __webpack_require__(/*! ./sha/256 */ 144);
  24972. exports.sha384 = __webpack_require__(/*! ./sha/384 */ 145);
  24973. exports.sha512 = __webpack_require__(/*! ./sha/512 */ 146);
  24974. /***/ }),
  24975. /* 141 */
  24976. /*!************************************************!*\
  24977. !*** ./node_modules/hash.js/lib/hash/sha/1.js ***!
  24978. \************************************************/
  24979. /*! no static exports found */
  24980. /***/ (function(module, exports, __webpack_require__) {
  24981. "use strict";
  24982. var utils = __webpack_require__(/*! ../utils */ 138);
  24983. var common = __webpack_require__(/*! ../common */ 139);
  24984. var shaCommon = __webpack_require__(/*! ./common */ 142);
  24985. var rotl32 = utils.rotl32;
  24986. var sum32 = utils.sum32;
  24987. var sum32_5 = utils.sum32_5;
  24988. var ft_1 = shaCommon.ft_1;
  24989. var BlockHash = common.BlockHash;
  24990. var sha1_K = [
  24991. 0x5A827999, 0x6ED9EBA1,
  24992. 0x8F1BBCDC, 0xCA62C1D6
  24993. ];
  24994. function SHA1() {
  24995. if (!(this instanceof SHA1))
  24996. return new SHA1();
  24997. BlockHash.call(this);
  24998. this.h = [
  24999. 0x67452301, 0xefcdab89, 0x98badcfe,
  25000. 0x10325476, 0xc3d2e1f0 ];
  25001. this.W = new Array(80);
  25002. }
  25003. utils.inherits(SHA1, BlockHash);
  25004. module.exports = SHA1;
  25005. SHA1.blockSize = 512;
  25006. SHA1.outSize = 160;
  25007. SHA1.hmacStrength = 80;
  25008. SHA1.padLength = 64;
  25009. SHA1.prototype._update = function _update(msg, start) {
  25010. var W = this.W;
  25011. for (var i = 0; i < 16; i++)
  25012. W[i] = msg[start + i];
  25013. for(; i < W.length; i++)
  25014. W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
  25015. var a = this.h[0];
  25016. var b = this.h[1];
  25017. var c = this.h[2];
  25018. var d = this.h[3];
  25019. var e = this.h[4];
  25020. for (i = 0; i < W.length; i++) {
  25021. var s = ~~(i / 20);
  25022. var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
  25023. e = d;
  25024. d = c;
  25025. c = rotl32(b, 30);
  25026. b = a;
  25027. a = t;
  25028. }
  25029. this.h[0] = sum32(this.h[0], a);
  25030. this.h[1] = sum32(this.h[1], b);
  25031. this.h[2] = sum32(this.h[2], c);
  25032. this.h[3] = sum32(this.h[3], d);
  25033. this.h[4] = sum32(this.h[4], e);
  25034. };
  25035. SHA1.prototype._digest = function digest(enc) {
  25036. if (enc === 'hex')
  25037. return utils.toHex32(this.h, 'big');
  25038. else
  25039. return utils.split32(this.h, 'big');
  25040. };
  25041. /***/ }),
  25042. /* 142 */
  25043. /*!*****************************************************!*\
  25044. !*** ./node_modules/hash.js/lib/hash/sha/common.js ***!
  25045. \*****************************************************/
  25046. /*! no static exports found */
  25047. /***/ (function(module, exports, __webpack_require__) {
  25048. "use strict";
  25049. var utils = __webpack_require__(/*! ../utils */ 138);
  25050. var rotr32 = utils.rotr32;
  25051. function ft_1(s, x, y, z) {
  25052. if (s === 0)
  25053. return ch32(x, y, z);
  25054. if (s === 1 || s === 3)
  25055. return p32(x, y, z);
  25056. if (s === 2)
  25057. return maj32(x, y, z);
  25058. }
  25059. exports.ft_1 = ft_1;
  25060. function ch32(x, y, z) {
  25061. return (x & y) ^ ((~x) & z);
  25062. }
  25063. exports.ch32 = ch32;
  25064. function maj32(x, y, z) {
  25065. return (x & y) ^ (x & z) ^ (y & z);
  25066. }
  25067. exports.maj32 = maj32;
  25068. function p32(x, y, z) {
  25069. return x ^ y ^ z;
  25070. }
  25071. exports.p32 = p32;
  25072. function s0_256(x) {
  25073. return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
  25074. }
  25075. exports.s0_256 = s0_256;
  25076. function s1_256(x) {
  25077. return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
  25078. }
  25079. exports.s1_256 = s1_256;
  25080. function g0_256(x) {
  25081. return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
  25082. }
  25083. exports.g0_256 = g0_256;
  25084. function g1_256(x) {
  25085. return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
  25086. }
  25087. exports.g1_256 = g1_256;
  25088. /***/ }),
  25089. /* 143 */
  25090. /*!**************************************************!*\
  25091. !*** ./node_modules/hash.js/lib/hash/sha/224.js ***!
  25092. \**************************************************/
  25093. /*! no static exports found */
  25094. /***/ (function(module, exports, __webpack_require__) {
  25095. "use strict";
  25096. var utils = __webpack_require__(/*! ../utils */ 138);
  25097. var SHA256 = __webpack_require__(/*! ./256 */ 144);
  25098. function SHA224() {
  25099. if (!(this instanceof SHA224))
  25100. return new SHA224();
  25101. SHA256.call(this);
  25102. this.h = [
  25103. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
  25104. 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
  25105. }
  25106. utils.inherits(SHA224, SHA256);
  25107. module.exports = SHA224;
  25108. SHA224.blockSize = 512;
  25109. SHA224.outSize = 224;
  25110. SHA224.hmacStrength = 192;
  25111. SHA224.padLength = 64;
  25112. SHA224.prototype._digest = function digest(enc) {
  25113. // Just truncate output
  25114. if (enc === 'hex')
  25115. return utils.toHex32(this.h.slice(0, 7), 'big');
  25116. else
  25117. return utils.split32(this.h.slice(0, 7), 'big');
  25118. };
  25119. /***/ }),
  25120. /* 144 */
  25121. /*!**************************************************!*\
  25122. !*** ./node_modules/hash.js/lib/hash/sha/256.js ***!
  25123. \**************************************************/
  25124. /*! no static exports found */
  25125. /***/ (function(module, exports, __webpack_require__) {
  25126. "use strict";
  25127. var utils = __webpack_require__(/*! ../utils */ 138);
  25128. var common = __webpack_require__(/*! ../common */ 139);
  25129. var shaCommon = __webpack_require__(/*! ./common */ 142);
  25130. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  25131. var sum32 = utils.sum32;
  25132. var sum32_4 = utils.sum32_4;
  25133. var sum32_5 = utils.sum32_5;
  25134. var ch32 = shaCommon.ch32;
  25135. var maj32 = shaCommon.maj32;
  25136. var s0_256 = shaCommon.s0_256;
  25137. var s1_256 = shaCommon.s1_256;
  25138. var g0_256 = shaCommon.g0_256;
  25139. var g1_256 = shaCommon.g1_256;
  25140. var BlockHash = common.BlockHash;
  25141. var sha256_K = [
  25142. 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  25143. 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  25144. 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  25145. 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  25146. 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  25147. 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  25148. 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  25149. 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  25150. 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  25151. 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  25152. 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  25153. 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  25154. 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  25155. 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  25156. 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  25157. 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
  25158. ];
  25159. function SHA256() {
  25160. if (!(this instanceof SHA256))
  25161. return new SHA256();
  25162. BlockHash.call(this);
  25163. this.h = [
  25164. 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
  25165. 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
  25166. ];
  25167. this.k = sha256_K;
  25168. this.W = new Array(64);
  25169. }
  25170. utils.inherits(SHA256, BlockHash);
  25171. module.exports = SHA256;
  25172. SHA256.blockSize = 512;
  25173. SHA256.outSize = 256;
  25174. SHA256.hmacStrength = 192;
  25175. SHA256.padLength = 64;
  25176. SHA256.prototype._update = function _update(msg, start) {
  25177. var W = this.W;
  25178. for (var i = 0; i < 16; i++)
  25179. W[i] = msg[start + i];
  25180. for (; i < W.length; i++)
  25181. W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
  25182. var a = this.h[0];
  25183. var b = this.h[1];
  25184. var c = this.h[2];
  25185. var d = this.h[3];
  25186. var e = this.h[4];
  25187. var f = this.h[5];
  25188. var g = this.h[6];
  25189. var h = this.h[7];
  25190. assert(this.k.length === W.length);
  25191. for (i = 0; i < W.length; i++) {
  25192. var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
  25193. var T2 = sum32(s0_256(a), maj32(a, b, c));
  25194. h = g;
  25195. g = f;
  25196. f = e;
  25197. e = sum32(d, T1);
  25198. d = c;
  25199. c = b;
  25200. b = a;
  25201. a = sum32(T1, T2);
  25202. }
  25203. this.h[0] = sum32(this.h[0], a);
  25204. this.h[1] = sum32(this.h[1], b);
  25205. this.h[2] = sum32(this.h[2], c);
  25206. this.h[3] = sum32(this.h[3], d);
  25207. this.h[4] = sum32(this.h[4], e);
  25208. this.h[5] = sum32(this.h[5], f);
  25209. this.h[6] = sum32(this.h[6], g);
  25210. this.h[7] = sum32(this.h[7], h);
  25211. };
  25212. SHA256.prototype._digest = function digest(enc) {
  25213. if (enc === 'hex')
  25214. return utils.toHex32(this.h, 'big');
  25215. else
  25216. return utils.split32(this.h, 'big');
  25217. };
  25218. /***/ }),
  25219. /* 145 */
  25220. /*!**************************************************!*\
  25221. !*** ./node_modules/hash.js/lib/hash/sha/384.js ***!
  25222. \**************************************************/
  25223. /*! no static exports found */
  25224. /***/ (function(module, exports, __webpack_require__) {
  25225. "use strict";
  25226. var utils = __webpack_require__(/*! ../utils */ 138);
  25227. var SHA512 = __webpack_require__(/*! ./512 */ 146);
  25228. function SHA384() {
  25229. if (!(this instanceof SHA384))
  25230. return new SHA384();
  25231. SHA512.call(this);
  25232. this.h = [
  25233. 0xcbbb9d5d, 0xc1059ed8,
  25234. 0x629a292a, 0x367cd507,
  25235. 0x9159015a, 0x3070dd17,
  25236. 0x152fecd8, 0xf70e5939,
  25237. 0x67332667, 0xffc00b31,
  25238. 0x8eb44a87, 0x68581511,
  25239. 0xdb0c2e0d, 0x64f98fa7,
  25240. 0x47b5481d, 0xbefa4fa4 ];
  25241. }
  25242. utils.inherits(SHA384, SHA512);
  25243. module.exports = SHA384;
  25244. SHA384.blockSize = 1024;
  25245. SHA384.outSize = 384;
  25246. SHA384.hmacStrength = 192;
  25247. SHA384.padLength = 128;
  25248. SHA384.prototype._digest = function digest(enc) {
  25249. if (enc === 'hex')
  25250. return utils.toHex32(this.h.slice(0, 12), 'big');
  25251. else
  25252. return utils.split32(this.h.slice(0, 12), 'big');
  25253. };
  25254. /***/ }),
  25255. /* 146 */
  25256. /*!**************************************************!*\
  25257. !*** ./node_modules/hash.js/lib/hash/sha/512.js ***!
  25258. \**************************************************/
  25259. /*! no static exports found */
  25260. /***/ (function(module, exports, __webpack_require__) {
  25261. "use strict";
  25262. var utils = __webpack_require__(/*! ../utils */ 138);
  25263. var common = __webpack_require__(/*! ../common */ 139);
  25264. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  25265. var rotr64_hi = utils.rotr64_hi;
  25266. var rotr64_lo = utils.rotr64_lo;
  25267. var shr64_hi = utils.shr64_hi;
  25268. var shr64_lo = utils.shr64_lo;
  25269. var sum64 = utils.sum64;
  25270. var sum64_hi = utils.sum64_hi;
  25271. var sum64_lo = utils.sum64_lo;
  25272. var sum64_4_hi = utils.sum64_4_hi;
  25273. var sum64_4_lo = utils.sum64_4_lo;
  25274. var sum64_5_hi = utils.sum64_5_hi;
  25275. var sum64_5_lo = utils.sum64_5_lo;
  25276. var BlockHash = common.BlockHash;
  25277. var sha512_K = [
  25278. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  25279. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  25280. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  25281. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  25282. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  25283. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  25284. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  25285. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  25286. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  25287. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  25288. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  25289. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  25290. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  25291. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  25292. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  25293. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  25294. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  25295. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  25296. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  25297. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  25298. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  25299. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  25300. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  25301. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  25302. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  25303. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  25304. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  25305. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  25306. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  25307. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  25308. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  25309. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  25310. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  25311. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  25312. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  25313. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  25314. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  25315. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  25316. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  25317. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  25318. ];
  25319. function SHA512() {
  25320. if (!(this instanceof SHA512))
  25321. return new SHA512();
  25322. BlockHash.call(this);
  25323. this.h = [
  25324. 0x6a09e667, 0xf3bcc908,
  25325. 0xbb67ae85, 0x84caa73b,
  25326. 0x3c6ef372, 0xfe94f82b,
  25327. 0xa54ff53a, 0x5f1d36f1,
  25328. 0x510e527f, 0xade682d1,
  25329. 0x9b05688c, 0x2b3e6c1f,
  25330. 0x1f83d9ab, 0xfb41bd6b,
  25331. 0x5be0cd19, 0x137e2179 ];
  25332. this.k = sha512_K;
  25333. this.W = new Array(160);
  25334. }
  25335. utils.inherits(SHA512, BlockHash);
  25336. module.exports = SHA512;
  25337. SHA512.blockSize = 1024;
  25338. SHA512.outSize = 512;
  25339. SHA512.hmacStrength = 192;
  25340. SHA512.padLength = 128;
  25341. SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
  25342. var W = this.W;
  25343. // 32 x 32bit words
  25344. for (var i = 0; i < 32; i++)
  25345. W[i] = msg[start + i];
  25346. for (; i < W.length; i += 2) {
  25347. var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2
  25348. var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
  25349. var c1_hi = W[i - 14]; // i - 7
  25350. var c1_lo = W[i - 13];
  25351. var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15
  25352. var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
  25353. var c3_hi = W[i - 32]; // i - 16
  25354. var c3_lo = W[i - 31];
  25355. W[i] = sum64_4_hi(
  25356. c0_hi, c0_lo,
  25357. c1_hi, c1_lo,
  25358. c2_hi, c2_lo,
  25359. c3_hi, c3_lo);
  25360. W[i + 1] = sum64_4_lo(
  25361. c0_hi, c0_lo,
  25362. c1_hi, c1_lo,
  25363. c2_hi, c2_lo,
  25364. c3_hi, c3_lo);
  25365. }
  25366. };
  25367. SHA512.prototype._update = function _update(msg, start) {
  25368. this._prepareBlock(msg, start);
  25369. var W = this.W;
  25370. var ah = this.h[0];
  25371. var al = this.h[1];
  25372. var bh = this.h[2];
  25373. var bl = this.h[3];
  25374. var ch = this.h[4];
  25375. var cl = this.h[5];
  25376. var dh = this.h[6];
  25377. var dl = this.h[7];
  25378. var eh = this.h[8];
  25379. var el = this.h[9];
  25380. var fh = this.h[10];
  25381. var fl = this.h[11];
  25382. var gh = this.h[12];
  25383. var gl = this.h[13];
  25384. var hh = this.h[14];
  25385. var hl = this.h[15];
  25386. assert(this.k.length === W.length);
  25387. for (var i = 0; i < W.length; i += 2) {
  25388. var c0_hi = hh;
  25389. var c0_lo = hl;
  25390. var c1_hi = s1_512_hi(eh, el);
  25391. var c1_lo = s1_512_lo(eh, el);
  25392. var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
  25393. var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
  25394. var c3_hi = this.k[i];
  25395. var c3_lo = this.k[i + 1];
  25396. var c4_hi = W[i];
  25397. var c4_lo = W[i + 1];
  25398. var T1_hi = sum64_5_hi(
  25399. c0_hi, c0_lo,
  25400. c1_hi, c1_lo,
  25401. c2_hi, c2_lo,
  25402. c3_hi, c3_lo,
  25403. c4_hi, c4_lo);
  25404. var T1_lo = sum64_5_lo(
  25405. c0_hi, c0_lo,
  25406. c1_hi, c1_lo,
  25407. c2_hi, c2_lo,
  25408. c3_hi, c3_lo,
  25409. c4_hi, c4_lo);
  25410. c0_hi = s0_512_hi(ah, al);
  25411. c0_lo = s0_512_lo(ah, al);
  25412. c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
  25413. c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
  25414. var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
  25415. var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
  25416. hh = gh;
  25417. hl = gl;
  25418. gh = fh;
  25419. gl = fl;
  25420. fh = eh;
  25421. fl = el;
  25422. eh = sum64_hi(dh, dl, T1_hi, T1_lo);
  25423. el = sum64_lo(dl, dl, T1_hi, T1_lo);
  25424. dh = ch;
  25425. dl = cl;
  25426. ch = bh;
  25427. cl = bl;
  25428. bh = ah;
  25429. bl = al;
  25430. ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
  25431. al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
  25432. }
  25433. sum64(this.h, 0, ah, al);
  25434. sum64(this.h, 2, bh, bl);
  25435. sum64(this.h, 4, ch, cl);
  25436. sum64(this.h, 6, dh, dl);
  25437. sum64(this.h, 8, eh, el);
  25438. sum64(this.h, 10, fh, fl);
  25439. sum64(this.h, 12, gh, gl);
  25440. sum64(this.h, 14, hh, hl);
  25441. };
  25442. SHA512.prototype._digest = function digest(enc) {
  25443. if (enc === 'hex')
  25444. return utils.toHex32(this.h, 'big');
  25445. else
  25446. return utils.split32(this.h, 'big');
  25447. };
  25448. function ch64_hi(xh, xl, yh, yl, zh) {
  25449. var r = (xh & yh) ^ ((~xh) & zh);
  25450. if (r < 0)
  25451. r += 0x100000000;
  25452. return r;
  25453. }
  25454. function ch64_lo(xh, xl, yh, yl, zh, zl) {
  25455. var r = (xl & yl) ^ ((~xl) & zl);
  25456. if (r < 0)
  25457. r += 0x100000000;
  25458. return r;
  25459. }
  25460. function maj64_hi(xh, xl, yh, yl, zh) {
  25461. var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);
  25462. if (r < 0)
  25463. r += 0x100000000;
  25464. return r;
  25465. }
  25466. function maj64_lo(xh, xl, yh, yl, zh, zl) {
  25467. var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);
  25468. if (r < 0)
  25469. r += 0x100000000;
  25470. return r;
  25471. }
  25472. function s0_512_hi(xh, xl) {
  25473. var c0_hi = rotr64_hi(xh, xl, 28);
  25474. var c1_hi = rotr64_hi(xl, xh, 2); // 34
  25475. var c2_hi = rotr64_hi(xl, xh, 7); // 39
  25476. var r = c0_hi ^ c1_hi ^ c2_hi;
  25477. if (r < 0)
  25478. r += 0x100000000;
  25479. return r;
  25480. }
  25481. function s0_512_lo(xh, xl) {
  25482. var c0_lo = rotr64_lo(xh, xl, 28);
  25483. var c1_lo = rotr64_lo(xl, xh, 2); // 34
  25484. var c2_lo = rotr64_lo(xl, xh, 7); // 39
  25485. var r = c0_lo ^ c1_lo ^ c2_lo;
  25486. if (r < 0)
  25487. r += 0x100000000;
  25488. return r;
  25489. }
  25490. function s1_512_hi(xh, xl) {
  25491. var c0_hi = rotr64_hi(xh, xl, 14);
  25492. var c1_hi = rotr64_hi(xh, xl, 18);
  25493. var c2_hi = rotr64_hi(xl, xh, 9); // 41
  25494. var r = c0_hi ^ c1_hi ^ c2_hi;
  25495. if (r < 0)
  25496. r += 0x100000000;
  25497. return r;
  25498. }
  25499. function s1_512_lo(xh, xl) {
  25500. var c0_lo = rotr64_lo(xh, xl, 14);
  25501. var c1_lo = rotr64_lo(xh, xl, 18);
  25502. var c2_lo = rotr64_lo(xl, xh, 9); // 41
  25503. var r = c0_lo ^ c1_lo ^ c2_lo;
  25504. if (r < 0)
  25505. r += 0x100000000;
  25506. return r;
  25507. }
  25508. function g0_512_hi(xh, xl) {
  25509. var c0_hi = rotr64_hi(xh, xl, 1);
  25510. var c1_hi = rotr64_hi(xh, xl, 8);
  25511. var c2_hi = shr64_hi(xh, xl, 7);
  25512. var r = c0_hi ^ c1_hi ^ c2_hi;
  25513. if (r < 0)
  25514. r += 0x100000000;
  25515. return r;
  25516. }
  25517. function g0_512_lo(xh, xl) {
  25518. var c0_lo = rotr64_lo(xh, xl, 1);
  25519. var c1_lo = rotr64_lo(xh, xl, 8);
  25520. var c2_lo = shr64_lo(xh, xl, 7);
  25521. var r = c0_lo ^ c1_lo ^ c2_lo;
  25522. if (r < 0)
  25523. r += 0x100000000;
  25524. return r;
  25525. }
  25526. function g1_512_hi(xh, xl) {
  25527. var c0_hi = rotr64_hi(xh, xl, 19);
  25528. var c1_hi = rotr64_hi(xl, xh, 29); // 61
  25529. var c2_hi = shr64_hi(xh, xl, 6);
  25530. var r = c0_hi ^ c1_hi ^ c2_hi;
  25531. if (r < 0)
  25532. r += 0x100000000;
  25533. return r;
  25534. }
  25535. function g1_512_lo(xh, xl) {
  25536. var c0_lo = rotr64_lo(xh, xl, 19);
  25537. var c1_lo = rotr64_lo(xl, xh, 29); // 61
  25538. var c2_lo = shr64_lo(xh, xl, 6);
  25539. var r = c0_lo ^ c1_lo ^ c2_lo;
  25540. if (r < 0)
  25541. r += 0x100000000;
  25542. return r;
  25543. }
  25544. /***/ }),
  25545. /* 147 */
  25546. /*!*************************************************!*\
  25547. !*** ./node_modules/hash.js/lib/hash/ripemd.js ***!
  25548. \*************************************************/
  25549. /*! no static exports found */
  25550. /***/ (function(module, exports, __webpack_require__) {
  25551. "use strict";
  25552. var utils = __webpack_require__(/*! ./utils */ 138);
  25553. var common = __webpack_require__(/*! ./common */ 139);
  25554. var rotl32 = utils.rotl32;
  25555. var sum32 = utils.sum32;
  25556. var sum32_3 = utils.sum32_3;
  25557. var sum32_4 = utils.sum32_4;
  25558. var BlockHash = common.BlockHash;
  25559. function RIPEMD160() {
  25560. if (!(this instanceof RIPEMD160))
  25561. return new RIPEMD160();
  25562. BlockHash.call(this);
  25563. this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
  25564. this.endian = 'little';
  25565. }
  25566. utils.inherits(RIPEMD160, BlockHash);
  25567. exports.ripemd160 = RIPEMD160;
  25568. RIPEMD160.blockSize = 512;
  25569. RIPEMD160.outSize = 160;
  25570. RIPEMD160.hmacStrength = 192;
  25571. RIPEMD160.padLength = 64;
  25572. RIPEMD160.prototype._update = function update(msg, start) {
  25573. var A = this.h[0];
  25574. var B = this.h[1];
  25575. var C = this.h[2];
  25576. var D = this.h[3];
  25577. var E = this.h[4];
  25578. var Ah = A;
  25579. var Bh = B;
  25580. var Ch = C;
  25581. var Dh = D;
  25582. var Eh = E;
  25583. for (var j = 0; j < 80; j++) {
  25584. var T = sum32(
  25585. rotl32(
  25586. sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
  25587. s[j]),
  25588. E);
  25589. A = E;
  25590. E = D;
  25591. D = rotl32(C, 10);
  25592. C = B;
  25593. B = T;
  25594. T = sum32(
  25595. rotl32(
  25596. sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
  25597. sh[j]),
  25598. Eh);
  25599. Ah = Eh;
  25600. Eh = Dh;
  25601. Dh = rotl32(Ch, 10);
  25602. Ch = Bh;
  25603. Bh = T;
  25604. }
  25605. T = sum32_3(this.h[1], C, Dh);
  25606. this.h[1] = sum32_3(this.h[2], D, Eh);
  25607. this.h[2] = sum32_3(this.h[3], E, Ah);
  25608. this.h[3] = sum32_3(this.h[4], A, Bh);
  25609. this.h[4] = sum32_3(this.h[0], B, Ch);
  25610. this.h[0] = T;
  25611. };
  25612. RIPEMD160.prototype._digest = function digest(enc) {
  25613. if (enc === 'hex')
  25614. return utils.toHex32(this.h, 'little');
  25615. else
  25616. return utils.split32(this.h, 'little');
  25617. };
  25618. function f(j, x, y, z) {
  25619. if (j <= 15)
  25620. return x ^ y ^ z;
  25621. else if (j <= 31)
  25622. return (x & y) | ((~x) & z);
  25623. else if (j <= 47)
  25624. return (x | (~y)) ^ z;
  25625. else if (j <= 63)
  25626. return (x & z) | (y & (~z));
  25627. else
  25628. return x ^ (y | (~z));
  25629. }
  25630. function K(j) {
  25631. if (j <= 15)
  25632. return 0x00000000;
  25633. else if (j <= 31)
  25634. return 0x5a827999;
  25635. else if (j <= 47)
  25636. return 0x6ed9eba1;
  25637. else if (j <= 63)
  25638. return 0x8f1bbcdc;
  25639. else
  25640. return 0xa953fd4e;
  25641. }
  25642. function Kh(j) {
  25643. if (j <= 15)
  25644. return 0x50a28be6;
  25645. else if (j <= 31)
  25646. return 0x5c4dd124;
  25647. else if (j <= 47)
  25648. return 0x6d703ef3;
  25649. else if (j <= 63)
  25650. return 0x7a6d76e9;
  25651. else
  25652. return 0x00000000;
  25653. }
  25654. var r = [
  25655. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  25656. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  25657. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  25658. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  25659. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  25660. ];
  25661. var rh = [
  25662. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  25663. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  25664. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  25665. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  25666. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  25667. ];
  25668. var s = [
  25669. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  25670. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  25671. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  25672. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  25673. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  25674. ];
  25675. var sh = [
  25676. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  25677. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  25678. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  25679. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  25680. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  25681. ];
  25682. /***/ }),
  25683. /* 148 */
  25684. /*!***********************************************!*\
  25685. !*** ./node_modules/hash.js/lib/hash/hmac.js ***!
  25686. \***********************************************/
  25687. /*! no static exports found */
  25688. /***/ (function(module, exports, __webpack_require__) {
  25689. "use strict";
  25690. var utils = __webpack_require__(/*! ./utils */ 138);
  25691. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  25692. function Hmac(hash, key, enc) {
  25693. if (!(this instanceof Hmac))
  25694. return new Hmac(hash, key, enc);
  25695. this.Hash = hash;
  25696. this.blockSize = hash.blockSize / 8;
  25697. this.outSize = hash.outSize / 8;
  25698. this.inner = null;
  25699. this.outer = null;
  25700. this._init(utils.toArray(key, enc));
  25701. }
  25702. module.exports = Hmac;
  25703. Hmac.prototype._init = function init(key) {
  25704. // Shorten key, if needed
  25705. if (key.length > this.blockSize)
  25706. key = new this.Hash().update(key).digest();
  25707. assert(key.length <= this.blockSize);
  25708. // Add padding to key
  25709. for (var i = key.length; i < this.blockSize; i++)
  25710. key.push(0);
  25711. for (i = 0; i < key.length; i++)
  25712. key[i] ^= 0x36;
  25713. this.inner = new this.Hash().update(key);
  25714. // 0x36 ^ 0x5c = 0x6a
  25715. for (i = 0; i < key.length; i++)
  25716. key[i] ^= 0x6a;
  25717. this.outer = new this.Hash().update(key);
  25718. };
  25719. Hmac.prototype.update = function update(msg, enc) {
  25720. this.inner.update(msg, enc);
  25721. return this;
  25722. };
  25723. Hmac.prototype.digest = function digest(enc) {
  25724. this.outer.update(this.inner.digest());
  25725. return this.outer.digest(enc);
  25726. };
  25727. /***/ }),
  25728. /* 149 */
  25729. /*!*********************************************************************!*\
  25730. !*** ./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
  25731. \*********************************************************************/
  25732. /*! no static exports found */
  25733. /***/ (function(module, exports) {
  25734. module.exports = {
  25735. doubles: {
  25736. step: 4,
  25737. points: [
  25738. [
  25739. 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',
  25740. 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'
  25741. ],
  25742. [
  25743. '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',
  25744. '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'
  25745. ],
  25746. [
  25747. '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',
  25748. 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'
  25749. ],
  25750. [
  25751. '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',
  25752. '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'
  25753. ],
  25754. [
  25755. '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',
  25756. '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'
  25757. ],
  25758. [
  25759. '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',
  25760. '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'
  25761. ],
  25762. [
  25763. 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',
  25764. '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'
  25765. ],
  25766. [
  25767. '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',
  25768. 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'
  25769. ],
  25770. [
  25771. 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',
  25772. '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'
  25773. ],
  25774. [
  25775. 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',
  25776. 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'
  25777. ],
  25778. [
  25779. 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',
  25780. '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'
  25781. ],
  25782. [
  25783. '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',
  25784. '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'
  25785. ],
  25786. [
  25787. '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',
  25788. '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'
  25789. ],
  25790. [
  25791. '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',
  25792. '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'
  25793. ],
  25794. [
  25795. '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',
  25796. '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'
  25797. ],
  25798. [
  25799. '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',
  25800. '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'
  25801. ],
  25802. [
  25803. '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',
  25804. '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'
  25805. ],
  25806. [
  25807. '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',
  25808. '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'
  25809. ],
  25810. [
  25811. '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',
  25812. 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'
  25813. ],
  25814. [
  25815. 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',
  25816. '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'
  25817. ],
  25818. [
  25819. 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',
  25820. '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'
  25821. ],
  25822. [
  25823. '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',
  25824. '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'
  25825. ],
  25826. [
  25827. '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',
  25828. '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'
  25829. ],
  25830. [
  25831. 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',
  25832. '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'
  25833. ],
  25834. [
  25835. '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',
  25836. 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'
  25837. ],
  25838. [
  25839. 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',
  25840. '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'
  25841. ],
  25842. [
  25843. 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',
  25844. 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'
  25845. ],
  25846. [
  25847. 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',
  25848. '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'
  25849. ],
  25850. [
  25851. 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',
  25852. 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'
  25853. ],
  25854. [
  25855. 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',
  25856. '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'
  25857. ],
  25858. [
  25859. '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',
  25860. 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'
  25861. ],
  25862. [
  25863. '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',
  25864. '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'
  25865. ],
  25866. [
  25867. 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',
  25868. '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'
  25869. ],
  25870. [
  25871. '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',
  25872. 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'
  25873. ],
  25874. [
  25875. 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',
  25876. '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'
  25877. ],
  25878. [
  25879. 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',
  25880. '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'
  25881. ],
  25882. [
  25883. 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',
  25884. 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'
  25885. ],
  25886. [
  25887. '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',
  25888. '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'
  25889. ],
  25890. [
  25891. '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',
  25892. '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'
  25893. ],
  25894. [
  25895. '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',
  25896. 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'
  25897. ],
  25898. [
  25899. '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',
  25900. '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'
  25901. ],
  25902. [
  25903. 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',
  25904. '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'
  25905. ],
  25906. [
  25907. '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',
  25908. '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'
  25909. ],
  25910. [
  25911. '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',
  25912. 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'
  25913. ],
  25914. [
  25915. '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',
  25916. '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'
  25917. ],
  25918. [
  25919. 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',
  25920. '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'
  25921. ],
  25922. [
  25923. '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',
  25924. 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'
  25925. ],
  25926. [
  25927. 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',
  25928. 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'
  25929. ],
  25930. [
  25931. 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',
  25932. '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'
  25933. ],
  25934. [
  25935. '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',
  25936. 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'
  25937. ],
  25938. [
  25939. '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',
  25940. 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'
  25941. ],
  25942. [
  25943. 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',
  25944. '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'
  25945. ],
  25946. [
  25947. 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',
  25948. '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'
  25949. ],
  25950. [
  25951. 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',
  25952. '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'
  25953. ],
  25954. [
  25955. '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',
  25956. 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'
  25957. ],
  25958. [
  25959. '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',
  25960. '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'
  25961. ],
  25962. [
  25963. 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',
  25964. 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'
  25965. ],
  25966. [
  25967. '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',
  25968. 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'
  25969. ],
  25970. [
  25971. '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',
  25972. '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'
  25973. ],
  25974. [
  25975. '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',
  25976. '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'
  25977. ],
  25978. [
  25979. 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',
  25980. 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'
  25981. ],
  25982. [
  25983. '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',
  25984. '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'
  25985. ],
  25986. [
  25987. '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',
  25988. '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'
  25989. ],
  25990. [
  25991. 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',
  25992. '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'
  25993. ],
  25994. [
  25995. 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',
  25996. 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'
  25997. ]
  25998. ]
  25999. },
  26000. naf: {
  26001. wnd: 7,
  26002. points: [
  26003. [
  26004. 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',
  26005. '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'
  26006. ],
  26007. [
  26008. '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',
  26009. 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'
  26010. ],
  26011. [
  26012. '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',
  26013. '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'
  26014. ],
  26015. [
  26016. 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',
  26017. 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'
  26018. ],
  26019. [
  26020. '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',
  26021. 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'
  26022. ],
  26023. [
  26024. 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',
  26025. 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'
  26026. ],
  26027. [
  26028. 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',
  26029. '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'
  26030. ],
  26031. [
  26032. 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',
  26033. '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'
  26034. ],
  26035. [
  26036. '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',
  26037. '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'
  26038. ],
  26039. [
  26040. '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',
  26041. '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'
  26042. ],
  26043. [
  26044. '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',
  26045. '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'
  26046. ],
  26047. [
  26048. '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',
  26049. '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'
  26050. ],
  26051. [
  26052. 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',
  26053. 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'
  26054. ],
  26055. [
  26056. 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',
  26057. '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'
  26058. ],
  26059. [
  26060. '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',
  26061. 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'
  26062. ],
  26063. [
  26064. '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',
  26065. 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'
  26066. ],
  26067. [
  26068. '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',
  26069. '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'
  26070. ],
  26071. [
  26072. '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',
  26073. '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'
  26074. ],
  26075. [
  26076. '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',
  26077. '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'
  26078. ],
  26079. [
  26080. '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',
  26081. 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'
  26082. ],
  26083. [
  26084. 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',
  26085. 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'
  26086. ],
  26087. [
  26088. '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',
  26089. '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'
  26090. ],
  26091. [
  26092. '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',
  26093. '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'
  26094. ],
  26095. [
  26096. 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',
  26097. 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'
  26098. ],
  26099. [
  26100. '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',
  26101. '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'
  26102. ],
  26103. [
  26104. 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',
  26105. 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'
  26106. ],
  26107. [
  26108. 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',
  26109. 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'
  26110. ],
  26111. [
  26112. '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',
  26113. '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'
  26114. ],
  26115. [
  26116. '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',
  26117. '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'
  26118. ],
  26119. [
  26120. '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',
  26121. '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'
  26122. ],
  26123. [
  26124. 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',
  26125. '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'
  26126. ],
  26127. [
  26128. '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',
  26129. '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'
  26130. ],
  26131. [
  26132. 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',
  26133. '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'
  26134. ],
  26135. [
  26136. '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',
  26137. 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'
  26138. ],
  26139. [
  26140. '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',
  26141. 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'
  26142. ],
  26143. [
  26144. 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',
  26145. 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'
  26146. ],
  26147. [
  26148. '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',
  26149. '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'
  26150. ],
  26151. [
  26152. '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',
  26153. 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'
  26154. ],
  26155. [
  26156. 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',
  26157. 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'
  26158. ],
  26159. [
  26160. '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',
  26161. '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'
  26162. ],
  26163. [
  26164. '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',
  26165. 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'
  26166. ],
  26167. [
  26168. '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',
  26169. '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'
  26170. ],
  26171. [
  26172. '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',
  26173. 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'
  26174. ],
  26175. [
  26176. 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',
  26177. '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'
  26178. ],
  26179. [
  26180. '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',
  26181. '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'
  26182. ],
  26183. [
  26184. '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',
  26185. 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'
  26186. ],
  26187. [
  26188. '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',
  26189. 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'
  26190. ],
  26191. [
  26192. 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',
  26193. 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'
  26194. ],
  26195. [
  26196. 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',
  26197. 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'
  26198. ],
  26199. [
  26200. '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',
  26201. '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'
  26202. ],
  26203. [
  26204. '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',
  26205. '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'
  26206. ],
  26207. [
  26208. 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',
  26209. '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'
  26210. ],
  26211. [
  26212. 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',
  26213. 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'
  26214. ],
  26215. [
  26216. '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',
  26217. '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'
  26218. ],
  26219. [
  26220. '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',
  26221. '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'
  26222. ],
  26223. [
  26224. 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',
  26225. '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'
  26226. ],
  26227. [
  26228. '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',
  26229. '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'
  26230. ],
  26231. [
  26232. 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',
  26233. 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'
  26234. ],
  26235. [
  26236. '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',
  26237. 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'
  26238. ],
  26239. [
  26240. '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',
  26241. '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'
  26242. ],
  26243. [
  26244. 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',
  26245. '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'
  26246. ],
  26247. [
  26248. 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',
  26249. '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'
  26250. ],
  26251. [
  26252. '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',
  26253. '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'
  26254. ],
  26255. [
  26256. '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',
  26257. '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'
  26258. ],
  26259. [
  26260. '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',
  26261. 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'
  26262. ],
  26263. [
  26264. '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',
  26265. 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'
  26266. ],
  26267. [
  26268. '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',
  26269. '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'
  26270. ],
  26271. [
  26272. '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',
  26273. '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'
  26274. ],
  26275. [
  26276. '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',
  26277. '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'
  26278. ],
  26279. [
  26280. '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',
  26281. 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'
  26282. ],
  26283. [
  26284. 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',
  26285. 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'
  26286. ],
  26287. [
  26288. '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',
  26289. 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'
  26290. ],
  26291. [
  26292. 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',
  26293. '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'
  26294. ],
  26295. [
  26296. 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',
  26297. '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'
  26298. ],
  26299. [
  26300. 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',
  26301. '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'
  26302. ],
  26303. [
  26304. 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',
  26305. '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'
  26306. ],
  26307. [
  26308. '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',
  26309. 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'
  26310. ],
  26311. [
  26312. '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',
  26313. '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'
  26314. ],
  26315. [
  26316. '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',
  26317. 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'
  26318. ],
  26319. [
  26320. 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',
  26321. 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'
  26322. ],
  26323. [
  26324. 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',
  26325. '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'
  26326. ],
  26327. [
  26328. 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',
  26329. 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'
  26330. ],
  26331. [
  26332. 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',
  26333. '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'
  26334. ],
  26335. [
  26336. '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',
  26337. '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'
  26338. ],
  26339. [
  26340. 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',
  26341. '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'
  26342. ],
  26343. [
  26344. 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',
  26345. '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'
  26346. ],
  26347. [
  26348. '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',
  26349. '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'
  26350. ],
  26351. [
  26352. '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',
  26353. 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'
  26354. ],
  26355. [
  26356. 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',
  26357. '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'
  26358. ],
  26359. [
  26360. 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',
  26361. '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'
  26362. ],
  26363. [
  26364. 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',
  26365. '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'
  26366. ],
  26367. [
  26368. '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',
  26369. '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'
  26370. ],
  26371. [
  26372. 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',
  26373. 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'
  26374. ],
  26375. [
  26376. '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',
  26377. 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'
  26378. ],
  26379. [
  26380. 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',
  26381. 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'
  26382. ],
  26383. [
  26384. 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',
  26385. '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'
  26386. ],
  26387. [
  26388. '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',
  26389. 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'
  26390. ],
  26391. [
  26392. 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',
  26393. '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'
  26394. ],
  26395. [
  26396. 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',
  26397. '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'
  26398. ],
  26399. [
  26400. 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',
  26401. '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'
  26402. ],
  26403. [
  26404. '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',
  26405. 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'
  26406. ],
  26407. [
  26408. '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',
  26409. 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'
  26410. ],
  26411. [
  26412. 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',
  26413. '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'
  26414. ],
  26415. [
  26416. '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',
  26417. 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'
  26418. ],
  26419. [
  26420. '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',
  26421. '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'
  26422. ],
  26423. [
  26424. '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',
  26425. 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'
  26426. ],
  26427. [
  26428. 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',
  26429. 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'
  26430. ],
  26431. [
  26432. '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',
  26433. 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'
  26434. ],
  26435. [
  26436. '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',
  26437. '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'
  26438. ],
  26439. [
  26440. '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',
  26441. 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'
  26442. ],
  26443. [
  26444. '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',
  26445. '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'
  26446. ],
  26447. [
  26448. 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',
  26449. 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'
  26450. ],
  26451. [
  26452. '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',
  26453. '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'
  26454. ],
  26455. [
  26456. 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',
  26457. '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'
  26458. ],
  26459. [
  26460. '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',
  26461. '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'
  26462. ],
  26463. [
  26464. 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',
  26465. 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'
  26466. ],
  26467. [
  26468. 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',
  26469. '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'
  26470. ],
  26471. [
  26472. 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',
  26473. 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'
  26474. ],
  26475. [
  26476. '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',
  26477. 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'
  26478. ],
  26479. [
  26480. '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',
  26481. '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'
  26482. ],
  26483. [
  26484. '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',
  26485. 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'
  26486. ],
  26487. [
  26488. '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',
  26489. '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'
  26490. ],
  26491. [
  26492. '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',
  26493. '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'
  26494. ],
  26495. [
  26496. '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',
  26497. 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'
  26498. ],
  26499. [
  26500. '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',
  26501. '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'
  26502. ],
  26503. [
  26504. '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',
  26505. '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'
  26506. ],
  26507. [
  26508. '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',
  26509. '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'
  26510. ]
  26511. ]
  26512. }
  26513. };
  26514. /***/ }),
  26515. /* 150 */
  26516. /*!********************************************************!*\
  26517. !*** ./node_modules/elliptic/lib/elliptic/ec/index.js ***!
  26518. \********************************************************/
  26519. /*! no static exports found */
  26520. /***/ (function(module, exports, __webpack_require__) {
  26521. "use strict";
  26522. var BN = __webpack_require__(/*! bn.js */ 116);
  26523. var HmacDRBG = __webpack_require__(/*! hmac-drbg */ 151);
  26524. var utils = __webpack_require__(/*! ../utils */ 129);
  26525. var curves = __webpack_require__(/*! ../curves */ 136);
  26526. var rand = __webpack_require__(/*! brorand */ 120);
  26527. var assert = utils.assert;
  26528. var KeyPair = __webpack_require__(/*! ./key */ 152);
  26529. var Signature = __webpack_require__(/*! ./signature */ 153);
  26530. function EC(options) {
  26531. if (!(this instanceof EC))
  26532. return new EC(options);
  26533. // Shortcut `elliptic.ec(curve-name)`
  26534. if (typeof options === 'string') {
  26535. assert(curves.hasOwnProperty(options), 'Unknown curve ' + options);
  26536. options = curves[options];
  26537. }
  26538. // Shortcut for `elliptic.ec(elliptic.curves.curveName)`
  26539. if (options instanceof curves.PresetCurve)
  26540. options = { curve: options };
  26541. this.curve = options.curve.curve;
  26542. this.n = this.curve.n;
  26543. this.nh = this.n.ushrn(1);
  26544. this.g = this.curve.g;
  26545. // Point on curve
  26546. this.g = options.curve.g;
  26547. this.g.precompute(options.curve.n.bitLength() + 1);
  26548. // Hash for function for DRBG
  26549. this.hash = options.hash || options.curve.hash;
  26550. }
  26551. module.exports = EC;
  26552. EC.prototype.keyPair = function keyPair(options) {
  26553. return new KeyPair(this, options);
  26554. };
  26555. EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
  26556. return KeyPair.fromPrivate(this, priv, enc);
  26557. };
  26558. EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
  26559. return KeyPair.fromPublic(this, pub, enc);
  26560. };
  26561. EC.prototype.genKeyPair = function genKeyPair(options) {
  26562. if (!options)
  26563. options = {};
  26564. // Instantiate Hmac_DRBG
  26565. var drbg = new HmacDRBG({
  26566. hash: this.hash,
  26567. pers: options.pers,
  26568. persEnc: options.persEnc || 'utf8',
  26569. entropy: options.entropy || rand(this.hash.hmacStrength),
  26570. entropyEnc: options.entropy && options.entropyEnc || 'utf8',
  26571. nonce: this.n.toArray()
  26572. });
  26573. var bytes = this.n.byteLength();
  26574. var ns2 = this.n.sub(new BN(2));
  26575. do {
  26576. var priv = new BN(drbg.generate(bytes));
  26577. if (priv.cmp(ns2) > 0)
  26578. continue;
  26579. priv.iaddn(1);
  26580. return this.keyFromPrivate(priv);
  26581. } while (true);
  26582. };
  26583. EC.prototype._truncateToN = function truncateToN(msg, truncOnly) {
  26584. var delta = msg.byteLength() * 8 - this.n.bitLength();
  26585. if (delta > 0)
  26586. msg = msg.ushrn(delta);
  26587. if (!truncOnly && msg.cmp(this.n) >= 0)
  26588. return msg.sub(this.n);
  26589. else
  26590. return msg;
  26591. };
  26592. EC.prototype.sign = function sign(msg, key, enc, options) {
  26593. if (typeof enc === 'object') {
  26594. options = enc;
  26595. enc = null;
  26596. }
  26597. if (!options)
  26598. options = {};
  26599. key = this.keyFromPrivate(key, enc);
  26600. msg = this._truncateToN(new BN(msg, 16));
  26601. // Zero-extend key to provide enough entropy
  26602. var bytes = this.n.byteLength();
  26603. var bkey = key.getPrivate().toArray('be', bytes);
  26604. // Zero-extend nonce to have the same byte size as N
  26605. var nonce = msg.toArray('be', bytes);
  26606. // Instantiate Hmac_DRBG
  26607. var drbg = new HmacDRBG({
  26608. hash: this.hash,
  26609. entropy: bkey,
  26610. nonce: nonce,
  26611. pers: options.pers,
  26612. persEnc: options.persEnc || 'utf8'
  26613. });
  26614. // Number of bytes to generate
  26615. var ns1 = this.n.sub(new BN(1));
  26616. for (var iter = 0; true; iter++) {
  26617. var k = options.k ?
  26618. options.k(iter) :
  26619. new BN(drbg.generate(this.n.byteLength()));
  26620. k = this._truncateToN(k, true);
  26621. if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
  26622. continue;
  26623. var kp = this.g.mul(k);
  26624. if (kp.isInfinity())
  26625. continue;
  26626. var kpX = kp.getX();
  26627. var r = kpX.umod(this.n);
  26628. if (r.cmpn(0) === 0)
  26629. continue;
  26630. var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
  26631. s = s.umod(this.n);
  26632. if (s.cmpn(0) === 0)
  26633. continue;
  26634. var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |
  26635. (kpX.cmp(r) !== 0 ? 2 : 0);
  26636. // Use complement of `s`, if it is > `n / 2`
  26637. if (options.canonical && s.cmp(this.nh) > 0) {
  26638. s = this.n.sub(s);
  26639. recoveryParam ^= 1;
  26640. }
  26641. return new Signature({ r: r, s: s, recoveryParam: recoveryParam });
  26642. }
  26643. };
  26644. EC.prototype.verify = function verify(msg, signature, key, enc) {
  26645. msg = this._truncateToN(new BN(msg, 16));
  26646. key = this.keyFromPublic(key, enc);
  26647. signature = new Signature(signature, 'hex');
  26648. // Perform primitive values validation
  26649. var r = signature.r;
  26650. var s = signature.s;
  26651. if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)
  26652. return false;
  26653. if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)
  26654. return false;
  26655. // Validate signature
  26656. var sinv = s.invm(this.n);
  26657. var u1 = sinv.mul(msg).umod(this.n);
  26658. var u2 = sinv.mul(r).umod(this.n);
  26659. if (!this.curve._maxwellTrick) {
  26660. var p = this.g.mulAdd(u1, key.getPublic(), u2);
  26661. if (p.isInfinity())
  26662. return false;
  26663. return p.getX().umod(this.n).cmp(r) === 0;
  26664. }
  26665. // NOTE: Greg Maxwell's trick, inspired by:
  26666. // https://git.io/vad3K
  26667. var p = this.g.jmulAdd(u1, key.getPublic(), u2);
  26668. if (p.isInfinity())
  26669. return false;
  26670. // Compare `p.x` of Jacobian point with `r`,
  26671. // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the
  26672. // inverse of `p.z^2`
  26673. return p.eqXToP(r);
  26674. };
  26675. EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
  26676. assert((3 & j) === j, 'The recovery param is more than two bits');
  26677. signature = new Signature(signature, enc);
  26678. var n = this.n;
  26679. var e = new BN(msg);
  26680. var r = signature.r;
  26681. var s = signature.s;
  26682. // A set LSB signifies that the y-coordinate is odd
  26683. var isYOdd = j & 1;
  26684. var isSecondKey = j >> 1;
  26685. if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)
  26686. throw new Error('Unable to find sencond key candinate');
  26687. // 1.1. Let x = r + jn.
  26688. if (isSecondKey)
  26689. r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
  26690. else
  26691. r = this.curve.pointFromX(r, isYOdd);
  26692. var rInv = signature.r.invm(n);
  26693. var s1 = n.sub(e).mul(rInv).umod(n);
  26694. var s2 = s.mul(rInv).umod(n);
  26695. // 1.6.1 Compute Q = r^-1 (sR - eG)
  26696. // Q = r^-1 (sR + -eG)
  26697. return this.g.mulAdd(s1, r, s2);
  26698. };
  26699. EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
  26700. signature = new Signature(signature, enc);
  26701. if (signature.recoveryParam !== null)
  26702. return signature.recoveryParam;
  26703. for (var i = 0; i < 4; i++) {
  26704. var Qprime;
  26705. try {
  26706. Qprime = this.recoverPubKey(e, signature, i);
  26707. } catch (e) {
  26708. continue;
  26709. }
  26710. if (Qprime.eq(Q))
  26711. return i;
  26712. }
  26713. throw new Error('Unable to find valid recovery factor');
  26714. };
  26715. /***/ }),
  26716. /* 151 */
  26717. /*!*************************************************!*\
  26718. !*** ./node_modules/hmac-drbg/lib/hmac-drbg.js ***!
  26719. \*************************************************/
  26720. /*! no static exports found */
  26721. /***/ (function(module, exports, __webpack_require__) {
  26722. "use strict";
  26723. var hash = __webpack_require__(/*! hash.js */ 137);
  26724. var utils = __webpack_require__(/*! minimalistic-crypto-utils */ 130);
  26725. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  26726. function HmacDRBG(options) {
  26727. if (!(this instanceof HmacDRBG))
  26728. return new HmacDRBG(options);
  26729. this.hash = options.hash;
  26730. this.predResist = !!options.predResist;
  26731. this.outLen = this.hash.outSize;
  26732. this.minEntropy = options.minEntropy || this.hash.hmacStrength;
  26733. this._reseed = null;
  26734. this.reseedInterval = null;
  26735. this.K = null;
  26736. this.V = null;
  26737. var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');
  26738. var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');
  26739. var pers = utils.toArray(options.pers, options.persEnc || 'hex');
  26740. assert(entropy.length >= (this.minEntropy / 8),
  26741. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  26742. this._init(entropy, nonce, pers);
  26743. }
  26744. module.exports = HmacDRBG;
  26745. HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
  26746. var seed = entropy.concat(nonce).concat(pers);
  26747. this.K = new Array(this.outLen / 8);
  26748. this.V = new Array(this.outLen / 8);
  26749. for (var i = 0; i < this.V.length; i++) {
  26750. this.K[i] = 0x00;
  26751. this.V[i] = 0x01;
  26752. }
  26753. this._update(seed);
  26754. this._reseed = 1;
  26755. this.reseedInterval = 0x1000000000000; // 2^48
  26756. };
  26757. HmacDRBG.prototype._hmac = function hmac() {
  26758. return new hash.hmac(this.hash, this.K);
  26759. };
  26760. HmacDRBG.prototype._update = function update(seed) {
  26761. var kmac = this._hmac()
  26762. .update(this.V)
  26763. .update([ 0x00 ]);
  26764. if (seed)
  26765. kmac = kmac.update(seed);
  26766. this.K = kmac.digest();
  26767. this.V = this._hmac().update(this.V).digest();
  26768. if (!seed)
  26769. return;
  26770. this.K = this._hmac()
  26771. .update(this.V)
  26772. .update([ 0x01 ])
  26773. .update(seed)
  26774. .digest();
  26775. this.V = this._hmac().update(this.V).digest();
  26776. };
  26777. HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
  26778. // Optional entropy enc
  26779. if (typeof entropyEnc !== 'string') {
  26780. addEnc = add;
  26781. add = entropyEnc;
  26782. entropyEnc = null;
  26783. }
  26784. entropy = utils.toArray(entropy, entropyEnc);
  26785. add = utils.toArray(add, addEnc);
  26786. assert(entropy.length >= (this.minEntropy / 8),
  26787. 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');
  26788. this._update(entropy.concat(add || []));
  26789. this._reseed = 1;
  26790. };
  26791. HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
  26792. if (this._reseed > this.reseedInterval)
  26793. throw new Error('Reseed is required');
  26794. // Optional encoding
  26795. if (typeof enc !== 'string') {
  26796. addEnc = add;
  26797. add = enc;
  26798. enc = null;
  26799. }
  26800. // Optional additional data
  26801. if (add) {
  26802. add = utils.toArray(add, addEnc || 'hex');
  26803. this._update(add);
  26804. }
  26805. var temp = [];
  26806. while (temp.length < len) {
  26807. this.V = this._hmac().update(this.V).digest();
  26808. temp = temp.concat(this.V);
  26809. }
  26810. var res = temp.slice(0, len);
  26811. this._update(add);
  26812. this._reseed++;
  26813. return utils.encode(res, enc);
  26814. };
  26815. /***/ }),
  26816. /* 152 */
  26817. /*!******************************************************!*\
  26818. !*** ./node_modules/elliptic/lib/elliptic/ec/key.js ***!
  26819. \******************************************************/
  26820. /*! no static exports found */
  26821. /***/ (function(module, exports, __webpack_require__) {
  26822. "use strict";
  26823. var BN = __webpack_require__(/*! bn.js */ 116);
  26824. var utils = __webpack_require__(/*! ../utils */ 129);
  26825. var assert = utils.assert;
  26826. function KeyPair(ec, options) {
  26827. this.ec = ec;
  26828. this.priv = null;
  26829. this.pub = null;
  26830. // KeyPair(ec, { priv: ..., pub: ... })
  26831. if (options.priv)
  26832. this._importPrivate(options.priv, options.privEnc);
  26833. if (options.pub)
  26834. this._importPublic(options.pub, options.pubEnc);
  26835. }
  26836. module.exports = KeyPair;
  26837. KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
  26838. if (pub instanceof KeyPair)
  26839. return pub;
  26840. return new KeyPair(ec, {
  26841. pub: pub,
  26842. pubEnc: enc
  26843. });
  26844. };
  26845. KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
  26846. if (priv instanceof KeyPair)
  26847. return priv;
  26848. return new KeyPair(ec, {
  26849. priv: priv,
  26850. privEnc: enc
  26851. });
  26852. };
  26853. KeyPair.prototype.validate = function validate() {
  26854. var pub = this.getPublic();
  26855. if (pub.isInfinity())
  26856. return { result: false, reason: 'Invalid public key' };
  26857. if (!pub.validate())
  26858. return { result: false, reason: 'Public key is not a point' };
  26859. if (!pub.mul(this.ec.curve.n).isInfinity())
  26860. return { result: false, reason: 'Public key * N != O' };
  26861. return { result: true, reason: null };
  26862. };
  26863. KeyPair.prototype.getPublic = function getPublic(compact, enc) {
  26864. // compact is optional argument
  26865. if (typeof compact === 'string') {
  26866. enc = compact;
  26867. compact = null;
  26868. }
  26869. if (!this.pub)
  26870. this.pub = this.ec.g.mul(this.priv);
  26871. if (!enc)
  26872. return this.pub;
  26873. return this.pub.encode(enc, compact);
  26874. };
  26875. KeyPair.prototype.getPrivate = function getPrivate(enc) {
  26876. if (enc === 'hex')
  26877. return this.priv.toString(16, 2);
  26878. else
  26879. return this.priv;
  26880. };
  26881. KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
  26882. this.priv = new BN(key, enc || 16);
  26883. // Ensure that the priv won't be bigger than n, otherwise we may fail
  26884. // in fixed multiplication method
  26885. this.priv = this.priv.umod(this.ec.curve.n);
  26886. };
  26887. KeyPair.prototype._importPublic = function _importPublic(key, enc) {
  26888. if (key.x || key.y) {
  26889. // Montgomery points only have an `x` coordinate.
  26890. // Weierstrass/Edwards points on the other hand have both `x` and
  26891. // `y` coordinates.
  26892. if (this.ec.curve.type === 'mont') {
  26893. assert(key.x, 'Need x coordinate');
  26894. } else if (this.ec.curve.type === 'short' ||
  26895. this.ec.curve.type === 'edwards') {
  26896. assert(key.x && key.y, 'Need both x and y coordinate');
  26897. }
  26898. this.pub = this.ec.curve.point(key.x, key.y);
  26899. return;
  26900. }
  26901. this.pub = this.ec.curve.decodePoint(key, enc);
  26902. };
  26903. // ECDH
  26904. KeyPair.prototype.derive = function derive(pub) {
  26905. return pub.mul(this.priv).getX();
  26906. };
  26907. // ECDSA
  26908. KeyPair.prototype.sign = function sign(msg, enc, options) {
  26909. return this.ec.sign(msg, this, enc, options);
  26910. };
  26911. KeyPair.prototype.verify = function verify(msg, signature) {
  26912. return this.ec.verify(msg, signature, this);
  26913. };
  26914. KeyPair.prototype.inspect = function inspect() {
  26915. return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +
  26916. ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
  26917. };
  26918. /***/ }),
  26919. /* 153 */
  26920. /*!************************************************************!*\
  26921. !*** ./node_modules/elliptic/lib/elliptic/ec/signature.js ***!
  26922. \************************************************************/
  26923. /*! no static exports found */
  26924. /***/ (function(module, exports, __webpack_require__) {
  26925. "use strict";
  26926. var BN = __webpack_require__(/*! bn.js */ 116);
  26927. var utils = __webpack_require__(/*! ../utils */ 129);
  26928. var assert = utils.assert;
  26929. function Signature(options, enc) {
  26930. if (options instanceof Signature)
  26931. return options;
  26932. if (this._importDER(options, enc))
  26933. return;
  26934. assert(options.r && options.s, 'Signature without r or s');
  26935. this.r = new BN(options.r, 16);
  26936. this.s = new BN(options.s, 16);
  26937. if (options.recoveryParam === undefined)
  26938. this.recoveryParam = null;
  26939. else
  26940. this.recoveryParam = options.recoveryParam;
  26941. }
  26942. module.exports = Signature;
  26943. function Position() {
  26944. this.place = 0;
  26945. }
  26946. function getLength(buf, p) {
  26947. var initial = buf[p.place++];
  26948. if (!(initial & 0x80)) {
  26949. return initial;
  26950. }
  26951. var octetLen = initial & 0xf;
  26952. var val = 0;
  26953. for (var i = 0, off = p.place; i < octetLen; i++, off++) {
  26954. val <<= 8;
  26955. val |= buf[off];
  26956. }
  26957. p.place = off;
  26958. return val;
  26959. }
  26960. function rmPadding(buf) {
  26961. var i = 0;
  26962. var len = buf.length - 1;
  26963. while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
  26964. i++;
  26965. }
  26966. if (i === 0) {
  26967. return buf;
  26968. }
  26969. return buf.slice(i);
  26970. }
  26971. Signature.prototype._importDER = function _importDER(data, enc) {
  26972. data = utils.toArray(data, enc);
  26973. var p = new Position();
  26974. if (data[p.place++] !== 0x30) {
  26975. return false;
  26976. }
  26977. var len = getLength(data, p);
  26978. if ((len + p.place) !== data.length) {
  26979. return false;
  26980. }
  26981. if (data[p.place++] !== 0x02) {
  26982. return false;
  26983. }
  26984. var rlen = getLength(data, p);
  26985. var r = data.slice(p.place, rlen + p.place);
  26986. p.place += rlen;
  26987. if (data[p.place++] !== 0x02) {
  26988. return false;
  26989. }
  26990. var slen = getLength(data, p);
  26991. if (data.length !== slen + p.place) {
  26992. return false;
  26993. }
  26994. var s = data.slice(p.place, slen + p.place);
  26995. if (r[0] === 0 && (r[1] & 0x80)) {
  26996. r = r.slice(1);
  26997. }
  26998. if (s[0] === 0 && (s[1] & 0x80)) {
  26999. s = s.slice(1);
  27000. }
  27001. this.r = new BN(r);
  27002. this.s = new BN(s);
  27003. this.recoveryParam = null;
  27004. return true;
  27005. };
  27006. function constructLength(arr, len) {
  27007. if (len < 0x80) {
  27008. arr.push(len);
  27009. return;
  27010. }
  27011. var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
  27012. arr.push(octets | 0x80);
  27013. while (--octets) {
  27014. arr.push((len >>> (octets << 3)) & 0xff);
  27015. }
  27016. arr.push(len);
  27017. }
  27018. Signature.prototype.toDER = function toDER(enc) {
  27019. var r = this.r.toArray();
  27020. var s = this.s.toArray();
  27021. // Pad values
  27022. if (r[0] & 0x80)
  27023. r = [ 0 ].concat(r);
  27024. // Pad values
  27025. if (s[0] & 0x80)
  27026. s = [ 0 ].concat(s);
  27027. r = rmPadding(r);
  27028. s = rmPadding(s);
  27029. while (!s[0] && !(s[1] & 0x80)) {
  27030. s = s.slice(1);
  27031. }
  27032. var arr = [ 0x02 ];
  27033. constructLength(arr, r.length);
  27034. arr = arr.concat(r);
  27035. arr.push(0x02);
  27036. constructLength(arr, s.length);
  27037. var backHalf = arr.concat(s);
  27038. var res = [ 0x30 ];
  27039. constructLength(res, backHalf.length);
  27040. res = res.concat(backHalf);
  27041. return utils.encode(res, enc);
  27042. };
  27043. /***/ }),
  27044. /* 154 */
  27045. /*!***********************************************************!*\
  27046. !*** ./node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
  27047. \***********************************************************/
  27048. /*! no static exports found */
  27049. /***/ (function(module, exports, __webpack_require__) {
  27050. "use strict";
  27051. var hash = __webpack_require__(/*! hash.js */ 137);
  27052. var curves = __webpack_require__(/*! ../curves */ 136);
  27053. var utils = __webpack_require__(/*! ../utils */ 129);
  27054. var assert = utils.assert;
  27055. var parseBytes = utils.parseBytes;
  27056. var KeyPair = __webpack_require__(/*! ./key */ 155);
  27057. var Signature = __webpack_require__(/*! ./signature */ 156);
  27058. function EDDSA(curve) {
  27059. assert(curve === 'ed25519', 'only tested with ed25519 so far');
  27060. if (!(this instanceof EDDSA))
  27061. return new EDDSA(curve);
  27062. var curve = curves[curve].curve;
  27063. this.curve = curve;
  27064. this.g = curve.g;
  27065. this.g.precompute(curve.n.bitLength() + 1);
  27066. this.pointClass = curve.point().constructor;
  27067. this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
  27068. this.hash = hash.sha512;
  27069. }
  27070. module.exports = EDDSA;
  27071. /**
  27072. * @param {Array|String} message - message bytes
  27073. * @param {Array|String|KeyPair} secret - secret bytes or a keypair
  27074. * @returns {Signature} - signature
  27075. */
  27076. EDDSA.prototype.sign = function sign(message, secret) {
  27077. message = parseBytes(message);
  27078. var key = this.keyFromSecret(secret);
  27079. var r = this.hashInt(key.messagePrefix(), message);
  27080. var R = this.g.mul(r);
  27081. var Rencoded = this.encodePoint(R);
  27082. var s_ = this.hashInt(Rencoded, key.pubBytes(), message)
  27083. .mul(key.priv());
  27084. var S = r.add(s_).umod(this.curve.n);
  27085. return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });
  27086. };
  27087. /**
  27088. * @param {Array} message - message bytes
  27089. * @param {Array|String|Signature} sig - sig bytes
  27090. * @param {Array|String|Point|KeyPair} pub - public key
  27091. * @returns {Boolean} - true if public key matches sig of message
  27092. */
  27093. EDDSA.prototype.verify = function verify(message, sig, pub) {
  27094. message = parseBytes(message);
  27095. sig = this.makeSignature(sig);
  27096. var key = this.keyFromPublic(pub);
  27097. var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
  27098. var SG = this.g.mul(sig.S());
  27099. var RplusAh = sig.R().add(key.pub().mul(h));
  27100. return RplusAh.eq(SG);
  27101. };
  27102. EDDSA.prototype.hashInt = function hashInt() {
  27103. var hash = this.hash();
  27104. for (var i = 0; i < arguments.length; i++)
  27105. hash.update(arguments[i]);
  27106. return utils.intFromLE(hash.digest()).umod(this.curve.n);
  27107. };
  27108. EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
  27109. return KeyPair.fromPublic(this, pub);
  27110. };
  27111. EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
  27112. return KeyPair.fromSecret(this, secret);
  27113. };
  27114. EDDSA.prototype.makeSignature = function makeSignature(sig) {
  27115. if (sig instanceof Signature)
  27116. return sig;
  27117. return new Signature(this, sig);
  27118. };
  27119. /**
  27120. * * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
  27121. *
  27122. * EDDSA defines methods for encoding and decoding points and integers. These are
  27123. * helper convenience methods, that pass along to utility functions implied
  27124. * parameters.
  27125. *
  27126. */
  27127. EDDSA.prototype.encodePoint = function encodePoint(point) {
  27128. var enc = point.getY().toArray('le', this.encodingLength);
  27129. enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;
  27130. return enc;
  27131. };
  27132. EDDSA.prototype.decodePoint = function decodePoint(bytes) {
  27133. bytes = utils.parseBytes(bytes);
  27134. var lastIx = bytes.length - 1;
  27135. var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);
  27136. var xIsOdd = (bytes[lastIx] & 0x80) !== 0;
  27137. var y = utils.intFromLE(normed);
  27138. return this.curve.pointFromY(y, xIsOdd);
  27139. };
  27140. EDDSA.prototype.encodeInt = function encodeInt(num) {
  27141. return num.toArray('le', this.encodingLength);
  27142. };
  27143. EDDSA.prototype.decodeInt = function decodeInt(bytes) {
  27144. return utils.intFromLE(bytes);
  27145. };
  27146. EDDSA.prototype.isPoint = function isPoint(val) {
  27147. return val instanceof this.pointClass;
  27148. };
  27149. /***/ }),
  27150. /* 155 */
  27151. /*!*********************************************************!*\
  27152. !*** ./node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
  27153. \*********************************************************/
  27154. /*! no static exports found */
  27155. /***/ (function(module, exports, __webpack_require__) {
  27156. "use strict";
  27157. var utils = __webpack_require__(/*! ../utils */ 129);
  27158. var assert = utils.assert;
  27159. var parseBytes = utils.parseBytes;
  27160. var cachedProperty = utils.cachedProperty;
  27161. /**
  27162. * @param {EDDSA} eddsa - instance
  27163. * @param {Object} params - public/private key parameters
  27164. *
  27165. * @param {Array<Byte>} [params.secret] - secret seed bytes
  27166. * @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
  27167. * @param {Array<Byte>} [params.pub] - public key point encoded as bytes
  27168. *
  27169. */
  27170. function KeyPair(eddsa, params) {
  27171. this.eddsa = eddsa;
  27172. this._secret = parseBytes(params.secret);
  27173. if (eddsa.isPoint(params.pub))
  27174. this._pub = params.pub;
  27175. else
  27176. this._pubBytes = parseBytes(params.pub);
  27177. }
  27178. KeyPair.fromPublic = function fromPublic(eddsa, pub) {
  27179. if (pub instanceof KeyPair)
  27180. return pub;
  27181. return new KeyPair(eddsa, { pub: pub });
  27182. };
  27183. KeyPair.fromSecret = function fromSecret(eddsa, secret) {
  27184. if (secret instanceof KeyPair)
  27185. return secret;
  27186. return new KeyPair(eddsa, { secret: secret });
  27187. };
  27188. KeyPair.prototype.secret = function secret() {
  27189. return this._secret;
  27190. };
  27191. cachedProperty(KeyPair, 'pubBytes', function pubBytes() {
  27192. return this.eddsa.encodePoint(this.pub());
  27193. });
  27194. cachedProperty(KeyPair, 'pub', function pub() {
  27195. if (this._pubBytes)
  27196. return this.eddsa.decodePoint(this._pubBytes);
  27197. return this.eddsa.g.mul(this.priv());
  27198. });
  27199. cachedProperty(KeyPair, 'privBytes', function privBytes() {
  27200. var eddsa = this.eddsa;
  27201. var hash = this.hash();
  27202. var lastIx = eddsa.encodingLength - 1;
  27203. var a = hash.slice(0, eddsa.encodingLength);
  27204. a[0] &= 248;
  27205. a[lastIx] &= 127;
  27206. a[lastIx] |= 64;
  27207. return a;
  27208. });
  27209. cachedProperty(KeyPair, 'priv', function priv() {
  27210. return this.eddsa.decodeInt(this.privBytes());
  27211. });
  27212. cachedProperty(KeyPair, 'hash', function hash() {
  27213. return this.eddsa.hash().update(this.secret()).digest();
  27214. });
  27215. cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {
  27216. return this.hash().slice(this.eddsa.encodingLength);
  27217. });
  27218. KeyPair.prototype.sign = function sign(message) {
  27219. assert(this._secret, 'KeyPair can only verify');
  27220. return this.eddsa.sign(message, this);
  27221. };
  27222. KeyPair.prototype.verify = function verify(message, sig) {
  27223. return this.eddsa.verify(message, sig, this);
  27224. };
  27225. KeyPair.prototype.getSecret = function getSecret(enc) {
  27226. assert(this._secret, 'KeyPair is public only');
  27227. return utils.encode(this.secret(), enc);
  27228. };
  27229. KeyPair.prototype.getPublic = function getPublic(enc) {
  27230. return utils.encode(this.pubBytes(), enc);
  27231. };
  27232. module.exports = KeyPair;
  27233. /***/ }),
  27234. /* 156 */
  27235. /*!***************************************************************!*\
  27236. !*** ./node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
  27237. \***************************************************************/
  27238. /*! no static exports found */
  27239. /***/ (function(module, exports, __webpack_require__) {
  27240. "use strict";
  27241. var BN = __webpack_require__(/*! bn.js */ 116);
  27242. var utils = __webpack_require__(/*! ../utils */ 129);
  27243. var assert = utils.assert;
  27244. var cachedProperty = utils.cachedProperty;
  27245. var parseBytes = utils.parseBytes;
  27246. /**
  27247. * @param {EDDSA} eddsa - eddsa instance
  27248. * @param {Array<Bytes>|Object} sig -
  27249. * @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
  27250. * @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
  27251. * @param {Array<Bytes>} [sig.Rencoded] - R point encoded
  27252. * @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
  27253. */
  27254. function Signature(eddsa, sig) {
  27255. this.eddsa = eddsa;
  27256. if (typeof sig !== 'object')
  27257. sig = parseBytes(sig);
  27258. if (Array.isArray(sig)) {
  27259. sig = {
  27260. R: sig.slice(0, eddsa.encodingLength),
  27261. S: sig.slice(eddsa.encodingLength)
  27262. };
  27263. }
  27264. assert(sig.R && sig.S, 'Signature without R or S');
  27265. if (eddsa.isPoint(sig.R))
  27266. this._R = sig.R;
  27267. if (sig.S instanceof BN)
  27268. this._S = sig.S;
  27269. this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
  27270. this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
  27271. }
  27272. cachedProperty(Signature, 'S', function S() {
  27273. return this.eddsa.decodeInt(this.Sencoded());
  27274. });
  27275. cachedProperty(Signature, 'R', function R() {
  27276. return this.eddsa.decodePoint(this.Rencoded());
  27277. });
  27278. cachedProperty(Signature, 'Rencoded', function Rencoded() {
  27279. return this.eddsa.encodePoint(this.R());
  27280. });
  27281. cachedProperty(Signature, 'Sencoded', function Sencoded() {
  27282. return this.eddsa.encodeInt(this.S());
  27283. });
  27284. Signature.prototype.toBytes = function toBytes() {
  27285. return this.Rencoded().concat(this.Sencoded());
  27286. };
  27287. Signature.prototype.toHex = function toHex() {
  27288. return utils.encode(this.toBytes(), 'hex').toUpperCase();
  27289. };
  27290. module.exports = Signature;
  27291. /***/ }),
  27292. /* 157 */
  27293. /*!******************************************!*\
  27294. !*** ./node_modules/parse-asn1/index.js ***!
  27295. \******************************************/
  27296. /*! no static exports found */
  27297. /***/ (function(module, exports, __webpack_require__) {
  27298. var asn1 = __webpack_require__(/*! ./asn1 */ 158)
  27299. var aesid = __webpack_require__(/*! ./aesid.json */ 175)
  27300. var fixProc = __webpack_require__(/*! ./fixProc */ 176)
  27301. var ciphers = __webpack_require__(/*! browserify-aes */ 94)
  27302. var compat = __webpack_require__(/*! pbkdf2 */ 79)
  27303. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  27304. module.exports = parseKeys
  27305. function parseKeys (buffer) {
  27306. var password
  27307. if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
  27308. password = buffer.passphrase
  27309. buffer = buffer.key
  27310. }
  27311. if (typeof buffer === 'string') {
  27312. buffer = Buffer.from(buffer)
  27313. }
  27314. var stripped = fixProc(buffer, password)
  27315. var type = stripped.tag
  27316. var data = stripped.data
  27317. var subtype, ndata
  27318. switch (type) {
  27319. case 'CERTIFICATE':
  27320. ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo
  27321. // falls through
  27322. case 'PUBLIC KEY':
  27323. if (!ndata) {
  27324. ndata = asn1.PublicKey.decode(data, 'der')
  27325. }
  27326. subtype = ndata.algorithm.algorithm.join('.')
  27327. switch (subtype) {
  27328. case '1.2.840.113549.1.1.1':
  27329. return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')
  27330. case '1.2.840.10045.2.1':
  27331. ndata.subjectPrivateKey = ndata.subjectPublicKey
  27332. return {
  27333. type: 'ec',
  27334. data: ndata
  27335. }
  27336. case '1.2.840.10040.4.1':
  27337. ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')
  27338. return {
  27339. type: 'dsa',
  27340. data: ndata.algorithm.params
  27341. }
  27342. default: throw new Error('unknown key id ' + subtype)
  27343. }
  27344. throw new Error('unknown key type ' + type)
  27345. case 'ENCRYPTED PRIVATE KEY':
  27346. data = asn1.EncryptedPrivateKey.decode(data, 'der')
  27347. data = decrypt(data, password)
  27348. // falls through
  27349. case 'PRIVATE KEY':
  27350. ndata = asn1.PrivateKey.decode(data, 'der')
  27351. subtype = ndata.algorithm.algorithm.join('.')
  27352. switch (subtype) {
  27353. case '1.2.840.113549.1.1.1':
  27354. return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')
  27355. case '1.2.840.10045.2.1':
  27356. return {
  27357. curve: ndata.algorithm.curve,
  27358. privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
  27359. }
  27360. case '1.2.840.10040.4.1':
  27361. ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')
  27362. return {
  27363. type: 'dsa',
  27364. params: ndata.algorithm.params
  27365. }
  27366. default: throw new Error('unknown key id ' + subtype)
  27367. }
  27368. throw new Error('unknown key type ' + type)
  27369. case 'RSA PUBLIC KEY':
  27370. return asn1.RSAPublicKey.decode(data, 'der')
  27371. case 'RSA PRIVATE KEY':
  27372. return asn1.RSAPrivateKey.decode(data, 'der')
  27373. case 'DSA PRIVATE KEY':
  27374. return {
  27375. type: 'dsa',
  27376. params: asn1.DSAPrivateKey.decode(data, 'der')
  27377. }
  27378. case 'EC PRIVATE KEY':
  27379. data = asn1.ECPrivateKey.decode(data, 'der')
  27380. return {
  27381. curve: data.parameters.value,
  27382. privateKey: data.privateKey
  27383. }
  27384. default: throw new Error('unknown key type ' + type)
  27385. }
  27386. }
  27387. parseKeys.signature = asn1.signature
  27388. function decrypt (data, password) {
  27389. var salt = data.algorithm.decrypt.kde.kdeparams.salt
  27390. var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)
  27391. var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]
  27392. var iv = data.algorithm.decrypt.cipher.iv
  27393. var cipherText = data.subjectPrivateKey
  27394. var keylen = parseInt(algo.split('-')[1], 10) / 8
  27395. var key = compat.pbkdf2Sync(password, salt, iters, keylen, 'sha1')
  27396. var cipher = ciphers.createDecipheriv(algo, key, iv)
  27397. var out = []
  27398. out.push(cipher.update(cipherText))
  27399. out.push(cipher.final())
  27400. return Buffer.concat(out)
  27401. }
  27402. /***/ }),
  27403. /* 158 */
  27404. /*!*****************************************!*\
  27405. !*** ./node_modules/parse-asn1/asn1.js ***!
  27406. \*****************************************/
  27407. /*! no static exports found */
  27408. /***/ (function(module, exports, __webpack_require__) {
  27409. "use strict";
  27410. // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
  27411. // Fedor, you are amazing.
  27412. var asn1 = __webpack_require__(/*! asn1.js */ 159)
  27413. exports.certificate = __webpack_require__(/*! ./certificate */ 174)
  27414. var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
  27415. this.seq().obj(
  27416. this.key('version').int(),
  27417. this.key('modulus').int(),
  27418. this.key('publicExponent').int(),
  27419. this.key('privateExponent').int(),
  27420. this.key('prime1').int(),
  27421. this.key('prime2').int(),
  27422. this.key('exponent1').int(),
  27423. this.key('exponent2').int(),
  27424. this.key('coefficient').int()
  27425. )
  27426. })
  27427. exports.RSAPrivateKey = RSAPrivateKey
  27428. var RSAPublicKey = asn1.define('RSAPublicKey', function () {
  27429. this.seq().obj(
  27430. this.key('modulus').int(),
  27431. this.key('publicExponent').int()
  27432. )
  27433. })
  27434. exports.RSAPublicKey = RSAPublicKey
  27435. var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
  27436. this.seq().obj(
  27437. this.key('algorithm').use(AlgorithmIdentifier),
  27438. this.key('subjectPublicKey').bitstr()
  27439. )
  27440. })
  27441. exports.PublicKey = PublicKey
  27442. var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
  27443. this.seq().obj(
  27444. this.key('algorithm').objid(),
  27445. this.key('none').null_().optional(),
  27446. this.key('curve').objid().optional(),
  27447. this.key('params').seq().obj(
  27448. this.key('p').int(),
  27449. this.key('q').int(),
  27450. this.key('g').int()
  27451. ).optional()
  27452. )
  27453. })
  27454. var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
  27455. this.seq().obj(
  27456. this.key('version').int(),
  27457. this.key('algorithm').use(AlgorithmIdentifier),
  27458. this.key('subjectPrivateKey').octstr()
  27459. )
  27460. })
  27461. exports.PrivateKey = PrivateKeyInfo
  27462. var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
  27463. this.seq().obj(
  27464. this.key('algorithm').seq().obj(
  27465. this.key('id').objid(),
  27466. this.key('decrypt').seq().obj(
  27467. this.key('kde').seq().obj(
  27468. this.key('id').objid(),
  27469. this.key('kdeparams').seq().obj(
  27470. this.key('salt').octstr(),
  27471. this.key('iters').int()
  27472. )
  27473. ),
  27474. this.key('cipher').seq().obj(
  27475. this.key('algo').objid(),
  27476. this.key('iv').octstr()
  27477. )
  27478. )
  27479. ),
  27480. this.key('subjectPrivateKey').octstr()
  27481. )
  27482. })
  27483. exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo
  27484. var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
  27485. this.seq().obj(
  27486. this.key('version').int(),
  27487. this.key('p').int(),
  27488. this.key('q').int(),
  27489. this.key('g').int(),
  27490. this.key('pub_key').int(),
  27491. this.key('priv_key').int()
  27492. )
  27493. })
  27494. exports.DSAPrivateKey = DSAPrivateKey
  27495. exports.DSAparam = asn1.define('DSAparam', function () {
  27496. this.int()
  27497. })
  27498. var ECPrivateKey = asn1.define('ECPrivateKey', function () {
  27499. this.seq().obj(
  27500. this.key('version').int(),
  27501. this.key('privateKey').octstr(),
  27502. this.key('parameters').optional().explicit(0).use(ECParameters),
  27503. this.key('publicKey').optional().explicit(1).bitstr()
  27504. )
  27505. })
  27506. exports.ECPrivateKey = ECPrivateKey
  27507. var ECParameters = asn1.define('ECParameters', function () {
  27508. this.choice({
  27509. namedCurve: this.objid()
  27510. })
  27511. })
  27512. exports.signature = asn1.define('signature', function () {
  27513. this.seq().obj(
  27514. this.key('r').int(),
  27515. this.key('s').int()
  27516. )
  27517. })
  27518. /***/ }),
  27519. /* 159 */
  27520. /*!******************************************!*\
  27521. !*** ./node_modules/asn1.js/lib/asn1.js ***!
  27522. \******************************************/
  27523. /*! no static exports found */
  27524. /***/ (function(module, exports, __webpack_require__) {
  27525. var asn1 = exports;
  27526. asn1.bignum = __webpack_require__(/*! bn.js */ 116);
  27527. asn1.define = __webpack_require__(/*! ./asn1/api */ 160).define;
  27528. asn1.base = __webpack_require__(/*! ./asn1/base */ 162);
  27529. asn1.constants = __webpack_require__(/*! ./asn1/constants */ 166);
  27530. asn1.decoders = __webpack_require__(/*! ./asn1/decoders */ 168);
  27531. asn1.encoders = __webpack_require__(/*! ./asn1/encoders */ 171);
  27532. /***/ }),
  27533. /* 160 */
  27534. /*!**********************************************!*\
  27535. !*** ./node_modules/asn1.js/lib/asn1/api.js ***!
  27536. \**********************************************/
  27537. /*! no static exports found */
  27538. /***/ (function(module, exports, __webpack_require__) {
  27539. var asn1 = __webpack_require__(/*! ../asn1 */ 159);
  27540. var inherits = __webpack_require__(/*! inherits */ 40);
  27541. var api = exports;
  27542. api.define = function define(name, body) {
  27543. return new Entity(name, body);
  27544. };
  27545. function Entity(name, body) {
  27546. this.name = name;
  27547. this.body = body;
  27548. this.decoders = {};
  27549. this.encoders = {};
  27550. };
  27551. Entity.prototype._createNamed = function createNamed(base) {
  27552. var named;
  27553. try {
  27554. named = __webpack_require__(/*! vm */ 161).runInThisContext(
  27555. '(function ' + this.name + '(entity) {\n' +
  27556. ' this._initNamed(entity);\n' +
  27557. '})'
  27558. );
  27559. } catch (e) {
  27560. named = function (entity) {
  27561. this._initNamed(entity);
  27562. };
  27563. }
  27564. inherits(named, base);
  27565. named.prototype._initNamed = function initnamed(entity) {
  27566. base.call(this, entity);
  27567. };
  27568. return new named(this);
  27569. };
  27570. Entity.prototype._getDecoder = function _getDecoder(enc) {
  27571. enc = enc || 'der';
  27572. // Lazily create decoder
  27573. if (!this.decoders.hasOwnProperty(enc))
  27574. this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
  27575. return this.decoders[enc];
  27576. };
  27577. Entity.prototype.decode = function decode(data, enc, options) {
  27578. return this._getDecoder(enc).decode(data, options);
  27579. };
  27580. Entity.prototype._getEncoder = function _getEncoder(enc) {
  27581. enc = enc || 'der';
  27582. // Lazily create encoder
  27583. if (!this.encoders.hasOwnProperty(enc))
  27584. this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
  27585. return this.encoders[enc];
  27586. };
  27587. Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) {
  27588. return this._getEncoder(enc).encode(data, reporter);
  27589. };
  27590. /***/ }),
  27591. /* 161 */
  27592. /*!*********************************************!*\
  27593. !*** ./node_modules/vm-browserify/index.js ***!
  27594. \*********************************************/
  27595. /*! no static exports found */
  27596. /***/ (function(module, exports) {
  27597. var indexOf = function (xs, item) {
  27598. if (xs.indexOf) return xs.indexOf(item);
  27599. else for (var i = 0; i < xs.length; i++) {
  27600. if (xs[i] === item) return i;
  27601. }
  27602. return -1;
  27603. };
  27604. var Object_keys = function (obj) {
  27605. if (Object.keys) return Object.keys(obj)
  27606. else {
  27607. var res = [];
  27608. for (var key in obj) res.push(key)
  27609. return res;
  27610. }
  27611. };
  27612. var forEach = function (xs, fn) {
  27613. if (xs.forEach) return xs.forEach(fn)
  27614. else for (var i = 0; i < xs.length; i++) {
  27615. fn(xs[i], i, xs);
  27616. }
  27617. };
  27618. var defineProp = (function() {
  27619. try {
  27620. Object.defineProperty({}, '_', {});
  27621. return function(obj, name, value) {
  27622. Object.defineProperty(obj, name, {
  27623. writable: true,
  27624. enumerable: false,
  27625. configurable: true,
  27626. value: value
  27627. })
  27628. };
  27629. } catch(e) {
  27630. return function(obj, name, value) {
  27631. obj[name] = value;
  27632. };
  27633. }
  27634. }());
  27635. var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',
  27636. 'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',
  27637. 'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',
  27638. 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',
  27639. 'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];
  27640. function Context() {}
  27641. Context.prototype = {};
  27642. var Script = exports.Script = function NodeScript (code) {
  27643. if (!(this instanceof Script)) return new Script(code);
  27644. this.code = code;
  27645. };
  27646. Script.prototype.runInContext = function (context) {
  27647. if (!(context instanceof Context)) {
  27648. throw new TypeError("needs a 'context' argument.");
  27649. }
  27650. var iframe = document.createElement('iframe');
  27651. if (!iframe.style) iframe.style = {};
  27652. iframe.style.display = 'none';
  27653. document.body.appendChild(iframe);
  27654. var win = iframe.contentWindow;
  27655. var wEval = win.eval, wExecScript = win.execScript;
  27656. if (!wEval && wExecScript) {
  27657. // win.eval() magically appears when this is called in IE:
  27658. wExecScript.call(win, 'null');
  27659. wEval = win.eval;
  27660. }
  27661. forEach(Object_keys(context), function (key) {
  27662. win[key] = context[key];
  27663. });
  27664. forEach(globals, function (key) {
  27665. if (context[key]) {
  27666. win[key] = context[key];
  27667. }
  27668. });
  27669. var winKeys = Object_keys(win);
  27670. var res = wEval.call(win, this.code);
  27671. forEach(Object_keys(win), function (key) {
  27672. // Avoid copying circular objects like `top` and `window` by only
  27673. // updating existing context properties or new properties in the `win`
  27674. // that was only introduced after the eval.
  27675. if (key in context || indexOf(winKeys, key) === -1) {
  27676. context[key] = win[key];
  27677. }
  27678. });
  27679. forEach(globals, function (key) {
  27680. if (!(key in context)) {
  27681. defineProp(context, key, win[key]);
  27682. }
  27683. });
  27684. document.body.removeChild(iframe);
  27685. return res;
  27686. };
  27687. Script.prototype.runInThisContext = function () {
  27688. return eval(this.code); // maybe...
  27689. };
  27690. Script.prototype.runInNewContext = function (context) {
  27691. var ctx = Script.createContext(context);
  27692. var res = this.runInContext(ctx);
  27693. if (context) {
  27694. forEach(Object_keys(ctx), function (key) {
  27695. context[key] = ctx[key];
  27696. });
  27697. }
  27698. return res;
  27699. };
  27700. forEach(Object_keys(Script.prototype), function (name) {
  27701. exports[name] = Script[name] = function (code) {
  27702. var s = Script(code);
  27703. return s[name].apply(s, [].slice.call(arguments, 1));
  27704. };
  27705. });
  27706. exports.isContext = function (context) {
  27707. return context instanceof Context;
  27708. };
  27709. exports.createScript = function (code) {
  27710. return exports.Script(code);
  27711. };
  27712. exports.createContext = Script.createContext = function (context) {
  27713. var copy = new Context();
  27714. if(typeof context === 'object') {
  27715. forEach(Object_keys(context), function (key) {
  27716. copy[key] = context[key];
  27717. });
  27718. }
  27719. return copy;
  27720. };
  27721. /***/ }),
  27722. /* 162 */
  27723. /*!*****************************************************!*\
  27724. !*** ./node_modules/asn1.js/lib/asn1/base/index.js ***!
  27725. \*****************************************************/
  27726. /*! no static exports found */
  27727. /***/ (function(module, exports, __webpack_require__) {
  27728. var base = exports;
  27729. base.Reporter = __webpack_require__(/*! ./reporter */ 163).Reporter;
  27730. base.DecoderBuffer = __webpack_require__(/*! ./buffer */ 164).DecoderBuffer;
  27731. base.EncoderBuffer = __webpack_require__(/*! ./buffer */ 164).EncoderBuffer;
  27732. base.Node = __webpack_require__(/*! ./node */ 165);
  27733. /***/ }),
  27734. /* 163 */
  27735. /*!********************************************************!*\
  27736. !*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***!
  27737. \********************************************************/
  27738. /*! no static exports found */
  27739. /***/ (function(module, exports, __webpack_require__) {
  27740. var inherits = __webpack_require__(/*! inherits */ 40);
  27741. function Reporter(options) {
  27742. this._reporterState = {
  27743. obj: null,
  27744. path: [],
  27745. options: options || {},
  27746. errors: []
  27747. };
  27748. }
  27749. exports.Reporter = Reporter;
  27750. Reporter.prototype.isError = function isError(obj) {
  27751. return obj instanceof ReporterError;
  27752. };
  27753. Reporter.prototype.save = function save() {
  27754. var state = this._reporterState;
  27755. return { obj: state.obj, pathLen: state.path.length };
  27756. };
  27757. Reporter.prototype.restore = function restore(data) {
  27758. var state = this._reporterState;
  27759. state.obj = data.obj;
  27760. state.path = state.path.slice(0, data.pathLen);
  27761. };
  27762. Reporter.prototype.enterKey = function enterKey(key) {
  27763. return this._reporterState.path.push(key);
  27764. };
  27765. Reporter.prototype.exitKey = function exitKey(index) {
  27766. var state = this._reporterState;
  27767. state.path = state.path.slice(0, index - 1);
  27768. };
  27769. Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
  27770. var state = this._reporterState;
  27771. this.exitKey(index);
  27772. if (state.obj !== null)
  27773. state.obj[key] = value;
  27774. };
  27775. Reporter.prototype.path = function path() {
  27776. return this._reporterState.path.join('/');
  27777. };
  27778. Reporter.prototype.enterObject = function enterObject() {
  27779. var state = this._reporterState;
  27780. var prev = state.obj;
  27781. state.obj = {};
  27782. return prev;
  27783. };
  27784. Reporter.prototype.leaveObject = function leaveObject(prev) {
  27785. var state = this._reporterState;
  27786. var now = state.obj;
  27787. state.obj = prev;
  27788. return now;
  27789. };
  27790. Reporter.prototype.error = function error(msg) {
  27791. var err;
  27792. var state = this._reporterState;
  27793. var inherited = msg instanceof ReporterError;
  27794. if (inherited) {
  27795. err = msg;
  27796. } else {
  27797. err = new ReporterError(state.path.map(function(elem) {
  27798. return '[' + JSON.stringify(elem) + ']';
  27799. }).join(''), msg.message || msg, msg.stack);
  27800. }
  27801. if (!state.options.partial)
  27802. throw err;
  27803. if (!inherited)
  27804. state.errors.push(err);
  27805. return err;
  27806. };
  27807. Reporter.prototype.wrapResult = function wrapResult(result) {
  27808. var state = this._reporterState;
  27809. if (!state.options.partial)
  27810. return result;
  27811. return {
  27812. result: this.isError(result) ? null : result,
  27813. errors: state.errors
  27814. };
  27815. };
  27816. function ReporterError(path, msg) {
  27817. this.path = path;
  27818. this.rethrow(msg);
  27819. };
  27820. inherits(ReporterError, Error);
  27821. ReporterError.prototype.rethrow = function rethrow(msg) {
  27822. this.message = msg + ' at: ' + (this.path || '(shallow)');
  27823. if (Error.captureStackTrace)
  27824. Error.captureStackTrace(this, ReporterError);
  27825. if (!this.stack) {
  27826. try {
  27827. // IE only adds stack when thrown
  27828. throw new Error(this.message);
  27829. } catch (e) {
  27830. this.stack = e.stack;
  27831. }
  27832. }
  27833. return this;
  27834. };
  27835. /***/ }),
  27836. /* 164 */
  27837. /*!******************************************************!*\
  27838. !*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***!
  27839. \******************************************************/
  27840. /*! no static exports found */
  27841. /***/ (function(module, exports, __webpack_require__) {
  27842. var inherits = __webpack_require__(/*! inherits */ 40);
  27843. var Reporter = __webpack_require__(/*! ../base */ 162).Reporter;
  27844. var Buffer = __webpack_require__(/*! buffer */ 35).Buffer;
  27845. function DecoderBuffer(base, options) {
  27846. Reporter.call(this, options);
  27847. if (!Buffer.isBuffer(base)) {
  27848. this.error('Input not Buffer');
  27849. return;
  27850. }
  27851. this.base = base;
  27852. this.offset = 0;
  27853. this.length = base.length;
  27854. }
  27855. inherits(DecoderBuffer, Reporter);
  27856. exports.DecoderBuffer = DecoderBuffer;
  27857. DecoderBuffer.prototype.save = function save() {
  27858. return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };
  27859. };
  27860. DecoderBuffer.prototype.restore = function restore(save) {
  27861. // Return skipped data
  27862. var res = new DecoderBuffer(this.base);
  27863. res.offset = save.offset;
  27864. res.length = this.offset;
  27865. this.offset = save.offset;
  27866. Reporter.prototype.restore.call(this, save.reporter);
  27867. return res;
  27868. };
  27869. DecoderBuffer.prototype.isEmpty = function isEmpty() {
  27870. return this.offset === this.length;
  27871. };
  27872. DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
  27873. if (this.offset + 1 <= this.length)
  27874. return this.base.readUInt8(this.offset++, true);
  27875. else
  27876. return this.error(fail || 'DecoderBuffer overrun');
  27877. }
  27878. DecoderBuffer.prototype.skip = function skip(bytes, fail) {
  27879. if (!(this.offset + bytes <= this.length))
  27880. return this.error(fail || 'DecoderBuffer overrun');
  27881. var res = new DecoderBuffer(this.base);
  27882. // Share reporter state
  27883. res._reporterState = this._reporterState;
  27884. res.offset = this.offset;
  27885. res.length = this.offset + bytes;
  27886. this.offset += bytes;
  27887. return res;
  27888. }
  27889. DecoderBuffer.prototype.raw = function raw(save) {
  27890. return this.base.slice(save ? save.offset : this.offset, this.length);
  27891. }
  27892. function EncoderBuffer(value, reporter) {
  27893. if (Array.isArray(value)) {
  27894. this.length = 0;
  27895. this.value = value.map(function(item) {
  27896. if (!(item instanceof EncoderBuffer))
  27897. item = new EncoderBuffer(item, reporter);
  27898. this.length += item.length;
  27899. return item;
  27900. }, this);
  27901. } else if (typeof value === 'number') {
  27902. if (!(0 <= value && value <= 0xff))
  27903. return reporter.error('non-byte EncoderBuffer value');
  27904. this.value = value;
  27905. this.length = 1;
  27906. } else if (typeof value === 'string') {
  27907. this.value = value;
  27908. this.length = Buffer.byteLength(value);
  27909. } else if (Buffer.isBuffer(value)) {
  27910. this.value = value;
  27911. this.length = value.length;
  27912. } else {
  27913. return reporter.error('Unsupported type: ' + typeof value);
  27914. }
  27915. }
  27916. exports.EncoderBuffer = EncoderBuffer;
  27917. EncoderBuffer.prototype.join = function join(out, offset) {
  27918. if (!out)
  27919. out = new Buffer(this.length);
  27920. if (!offset)
  27921. offset = 0;
  27922. if (this.length === 0)
  27923. return out;
  27924. if (Array.isArray(this.value)) {
  27925. this.value.forEach(function(item) {
  27926. item.join(out, offset);
  27927. offset += item.length;
  27928. });
  27929. } else {
  27930. if (typeof this.value === 'number')
  27931. out[offset] = this.value;
  27932. else if (typeof this.value === 'string')
  27933. out.write(this.value, offset);
  27934. else if (Buffer.isBuffer(this.value))
  27935. this.value.copy(out, offset);
  27936. offset += this.length;
  27937. }
  27938. return out;
  27939. };
  27940. /***/ }),
  27941. /* 165 */
  27942. /*!****************************************************!*\
  27943. !*** ./node_modules/asn1.js/lib/asn1/base/node.js ***!
  27944. \****************************************************/
  27945. /*! no static exports found */
  27946. /***/ (function(module, exports, __webpack_require__) {
  27947. var Reporter = __webpack_require__(/*! ../base */ 162).Reporter;
  27948. var EncoderBuffer = __webpack_require__(/*! ../base */ 162).EncoderBuffer;
  27949. var DecoderBuffer = __webpack_require__(/*! ../base */ 162).DecoderBuffer;
  27950. var assert = __webpack_require__(/*! minimalistic-assert */ 90);
  27951. // Supported tags
  27952. var tags = [
  27953. 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',
  27954. 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',
  27955. 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',
  27956. 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'
  27957. ];
  27958. // Public methods list
  27959. var methods = [
  27960. 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',
  27961. 'any', 'contains'
  27962. ].concat(tags);
  27963. // Overrided methods list
  27964. var overrided = [
  27965. '_peekTag', '_decodeTag', '_use',
  27966. '_decodeStr', '_decodeObjid', '_decodeTime',
  27967. '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',
  27968. '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',
  27969. '_encodeNull', '_encodeInt', '_encodeBool'
  27970. ];
  27971. function Node(enc, parent) {
  27972. var state = {};
  27973. this._baseState = state;
  27974. state.enc = enc;
  27975. state.parent = parent || null;
  27976. state.children = null;
  27977. // State
  27978. state.tag = null;
  27979. state.args = null;
  27980. state.reverseArgs = null;
  27981. state.choice = null;
  27982. state.optional = false;
  27983. state.any = false;
  27984. state.obj = false;
  27985. state.use = null;
  27986. state.useDecoder = null;
  27987. state.key = null;
  27988. state['default'] = null;
  27989. state.explicit = null;
  27990. state.implicit = null;
  27991. state.contains = null;
  27992. // Should create new instance on each method
  27993. if (!state.parent) {
  27994. state.children = [];
  27995. this._wrap();
  27996. }
  27997. }
  27998. module.exports = Node;
  27999. var stateProps = [
  28000. 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',
  28001. 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',
  28002. 'implicit', 'contains'
  28003. ];
  28004. Node.prototype.clone = function clone() {
  28005. var state = this._baseState;
  28006. var cstate = {};
  28007. stateProps.forEach(function(prop) {
  28008. cstate[prop] = state[prop];
  28009. });
  28010. var res = new this.constructor(cstate.parent);
  28011. res._baseState = cstate;
  28012. return res;
  28013. };
  28014. Node.prototype._wrap = function wrap() {
  28015. var state = this._baseState;
  28016. methods.forEach(function(method) {
  28017. this[method] = function _wrappedMethod() {
  28018. var clone = new this.constructor(this);
  28019. state.children.push(clone);
  28020. return clone[method].apply(clone, arguments);
  28021. };
  28022. }, this);
  28023. };
  28024. Node.prototype._init = function init(body) {
  28025. var state = this._baseState;
  28026. assert(state.parent === null);
  28027. body.call(this);
  28028. // Filter children
  28029. state.children = state.children.filter(function(child) {
  28030. return child._baseState.parent === this;
  28031. }, this);
  28032. assert.equal(state.children.length, 1, 'Root node can have only one child');
  28033. };
  28034. Node.prototype._useArgs = function useArgs(args) {
  28035. var state = this._baseState;
  28036. // Filter children and args
  28037. var children = args.filter(function(arg) {
  28038. return arg instanceof this.constructor;
  28039. }, this);
  28040. args = args.filter(function(arg) {
  28041. return !(arg instanceof this.constructor);
  28042. }, this);
  28043. if (children.length !== 0) {
  28044. assert(state.children === null);
  28045. state.children = children;
  28046. // Replace parent to maintain backward link
  28047. children.forEach(function(child) {
  28048. child._baseState.parent = this;
  28049. }, this);
  28050. }
  28051. if (args.length !== 0) {
  28052. assert(state.args === null);
  28053. state.args = args;
  28054. state.reverseArgs = args.map(function(arg) {
  28055. if (typeof arg !== 'object' || arg.constructor !== Object)
  28056. return arg;
  28057. var res = {};
  28058. Object.keys(arg).forEach(function(key) {
  28059. if (key == (key | 0))
  28060. key |= 0;
  28061. var value = arg[key];
  28062. res[value] = key;
  28063. });
  28064. return res;
  28065. });
  28066. }
  28067. };
  28068. //
  28069. // Overrided methods
  28070. //
  28071. overrided.forEach(function(method) {
  28072. Node.prototype[method] = function _overrided() {
  28073. var state = this._baseState;
  28074. throw new Error(method + ' not implemented for encoding: ' + state.enc);
  28075. };
  28076. });
  28077. //
  28078. // Public methods
  28079. //
  28080. tags.forEach(function(tag) {
  28081. Node.prototype[tag] = function _tagMethod() {
  28082. var state = this._baseState;
  28083. var args = Array.prototype.slice.call(arguments);
  28084. assert(state.tag === null);
  28085. state.tag = tag;
  28086. this._useArgs(args);
  28087. return this;
  28088. };
  28089. });
  28090. Node.prototype.use = function use(item) {
  28091. assert(item);
  28092. var state = this._baseState;
  28093. assert(state.use === null);
  28094. state.use = item;
  28095. return this;
  28096. };
  28097. Node.prototype.optional = function optional() {
  28098. var state = this._baseState;
  28099. state.optional = true;
  28100. return this;
  28101. };
  28102. Node.prototype.def = function def(val) {
  28103. var state = this._baseState;
  28104. assert(state['default'] === null);
  28105. state['default'] = val;
  28106. state.optional = true;
  28107. return this;
  28108. };
  28109. Node.prototype.explicit = function explicit(num) {
  28110. var state = this._baseState;
  28111. assert(state.explicit === null && state.implicit === null);
  28112. state.explicit = num;
  28113. return this;
  28114. };
  28115. Node.prototype.implicit = function implicit(num) {
  28116. var state = this._baseState;
  28117. assert(state.explicit === null && state.implicit === null);
  28118. state.implicit = num;
  28119. return this;
  28120. };
  28121. Node.prototype.obj = function obj() {
  28122. var state = this._baseState;
  28123. var args = Array.prototype.slice.call(arguments);
  28124. state.obj = true;
  28125. if (args.length !== 0)
  28126. this._useArgs(args);
  28127. return this;
  28128. };
  28129. Node.prototype.key = function key(newKey) {
  28130. var state = this._baseState;
  28131. assert(state.key === null);
  28132. state.key = newKey;
  28133. return this;
  28134. };
  28135. Node.prototype.any = function any() {
  28136. var state = this._baseState;
  28137. state.any = true;
  28138. return this;
  28139. };
  28140. Node.prototype.choice = function choice(obj) {
  28141. var state = this._baseState;
  28142. assert(state.choice === null);
  28143. state.choice = obj;
  28144. this._useArgs(Object.keys(obj).map(function(key) {
  28145. return obj[key];
  28146. }));
  28147. return this;
  28148. };
  28149. Node.prototype.contains = function contains(item) {
  28150. var state = this._baseState;
  28151. assert(state.use === null);
  28152. state.contains = item;
  28153. return this;
  28154. };
  28155. //
  28156. // Decoding
  28157. //
  28158. Node.prototype._decode = function decode(input, options) {
  28159. var state = this._baseState;
  28160. // Decode root node
  28161. if (state.parent === null)
  28162. return input.wrapResult(state.children[0]._decode(input, options));
  28163. var result = state['default'];
  28164. var present = true;
  28165. var prevKey = null;
  28166. if (state.key !== null)
  28167. prevKey = input.enterKey(state.key);
  28168. // Check if tag is there
  28169. if (state.optional) {
  28170. var tag = null;
  28171. if (state.explicit !== null)
  28172. tag = state.explicit;
  28173. else if (state.implicit !== null)
  28174. tag = state.implicit;
  28175. else if (state.tag !== null)
  28176. tag = state.tag;
  28177. if (tag === null && !state.any) {
  28178. // Trial and Error
  28179. var save = input.save();
  28180. try {
  28181. if (state.choice === null)
  28182. this._decodeGeneric(state.tag, input, options);
  28183. else
  28184. this._decodeChoice(input, options);
  28185. present = true;
  28186. } catch (e) {
  28187. present = false;
  28188. }
  28189. input.restore(save);
  28190. } else {
  28191. present = this._peekTag(input, tag, state.any);
  28192. if (input.isError(present))
  28193. return present;
  28194. }
  28195. }
  28196. // Push object on stack
  28197. var prevObj;
  28198. if (state.obj && present)
  28199. prevObj = input.enterObject();
  28200. if (present) {
  28201. // Unwrap explicit values
  28202. if (state.explicit !== null) {
  28203. var explicit = this._decodeTag(input, state.explicit);
  28204. if (input.isError(explicit))
  28205. return explicit;
  28206. input = explicit;
  28207. }
  28208. var start = input.offset;
  28209. // Unwrap implicit and normal values
  28210. if (state.use === null && state.choice === null) {
  28211. if (state.any)
  28212. var save = input.save();
  28213. var body = this._decodeTag(
  28214. input,
  28215. state.implicit !== null ? state.implicit : state.tag,
  28216. state.any
  28217. );
  28218. if (input.isError(body))
  28219. return body;
  28220. if (state.any)
  28221. result = input.raw(save);
  28222. else
  28223. input = body;
  28224. }
  28225. if (options && options.track && state.tag !== null)
  28226. options.track(input.path(), start, input.length, 'tagged');
  28227. if (options && options.track && state.tag !== null)
  28228. options.track(input.path(), input.offset, input.length, 'content');
  28229. // Select proper method for tag
  28230. if (state.any)
  28231. result = result;
  28232. else if (state.choice === null)
  28233. result = this._decodeGeneric(state.tag, input, options);
  28234. else
  28235. result = this._decodeChoice(input, options);
  28236. if (input.isError(result))
  28237. return result;
  28238. // Decode children
  28239. if (!state.any && state.choice === null && state.children !== null) {
  28240. state.children.forEach(function decodeChildren(child) {
  28241. // NOTE: We are ignoring errors here, to let parser continue with other
  28242. // parts of encoded data
  28243. child._decode(input, options);
  28244. });
  28245. }
  28246. // Decode contained/encoded by schema, only in bit or octet strings
  28247. if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {
  28248. var data = new DecoderBuffer(result);
  28249. result = this._getUse(state.contains, input._reporterState.obj)
  28250. ._decode(data, options);
  28251. }
  28252. }
  28253. // Pop object
  28254. if (state.obj && present)
  28255. result = input.leaveObject(prevObj);
  28256. // Set key
  28257. if (state.key !== null && (result !== null || present === true))
  28258. input.leaveKey(prevKey, state.key, result);
  28259. else if (prevKey !== null)
  28260. input.exitKey(prevKey);
  28261. return result;
  28262. };
  28263. Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
  28264. var state = this._baseState;
  28265. if (tag === 'seq' || tag === 'set')
  28266. return null;
  28267. if (tag === 'seqof' || tag === 'setof')
  28268. return this._decodeList(input, tag, state.args[0], options);
  28269. else if (/str$/.test(tag))
  28270. return this._decodeStr(input, tag, options);
  28271. else if (tag === 'objid' && state.args)
  28272. return this._decodeObjid(input, state.args[0], state.args[1], options);
  28273. else if (tag === 'objid')
  28274. return this._decodeObjid(input, null, null, options);
  28275. else if (tag === 'gentime' || tag === 'utctime')
  28276. return this._decodeTime(input, tag, options);
  28277. else if (tag === 'null_')
  28278. return this._decodeNull(input, options);
  28279. else if (tag === 'bool')
  28280. return this._decodeBool(input, options);
  28281. else if (tag === 'objDesc')
  28282. return this._decodeStr(input, tag, options);
  28283. else if (tag === 'int' || tag === 'enum')
  28284. return this._decodeInt(input, state.args && state.args[0], options);
  28285. if (state.use !== null) {
  28286. return this._getUse(state.use, input._reporterState.obj)
  28287. ._decode(input, options);
  28288. } else {
  28289. return input.error('unknown tag: ' + tag);
  28290. }
  28291. };
  28292. Node.prototype._getUse = function _getUse(entity, obj) {
  28293. var state = this._baseState;
  28294. // Create altered use decoder if implicit is set
  28295. state.useDecoder = this._use(entity, obj);
  28296. assert(state.useDecoder._baseState.parent === null);
  28297. state.useDecoder = state.useDecoder._baseState.children[0];
  28298. if (state.implicit !== state.useDecoder._baseState.implicit) {
  28299. state.useDecoder = state.useDecoder.clone();
  28300. state.useDecoder._baseState.implicit = state.implicit;
  28301. }
  28302. return state.useDecoder;
  28303. };
  28304. Node.prototype._decodeChoice = function decodeChoice(input, options) {
  28305. var state = this._baseState;
  28306. var result = null;
  28307. var match = false;
  28308. Object.keys(state.choice).some(function(key) {
  28309. var save = input.save();
  28310. var node = state.choice[key];
  28311. try {
  28312. var value = node._decode(input, options);
  28313. if (input.isError(value))
  28314. return false;
  28315. result = { type: key, value: value };
  28316. match = true;
  28317. } catch (e) {
  28318. input.restore(save);
  28319. return false;
  28320. }
  28321. return true;
  28322. }, this);
  28323. if (!match)
  28324. return input.error('Choice not matched');
  28325. return result;
  28326. };
  28327. //
  28328. // Encoding
  28329. //
  28330. Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
  28331. return new EncoderBuffer(data, this.reporter);
  28332. };
  28333. Node.prototype._encode = function encode(data, reporter, parent) {
  28334. var state = this._baseState;
  28335. if (state['default'] !== null && state['default'] === data)
  28336. return;
  28337. var result = this._encodeValue(data, reporter, parent);
  28338. if (result === undefined)
  28339. return;
  28340. if (this._skipDefault(result, reporter, parent))
  28341. return;
  28342. return result;
  28343. };
  28344. Node.prototype._encodeValue = function encode(data, reporter, parent) {
  28345. var state = this._baseState;
  28346. // Decode root node
  28347. if (state.parent === null)
  28348. return state.children[0]._encode(data, reporter || new Reporter());
  28349. var result = null;
  28350. // Set reporter to share it with a child class
  28351. this.reporter = reporter;
  28352. // Check if data is there
  28353. if (state.optional && data === undefined) {
  28354. if (state['default'] !== null)
  28355. data = state['default']
  28356. else
  28357. return;
  28358. }
  28359. // Encode children first
  28360. var content = null;
  28361. var primitive = false;
  28362. if (state.any) {
  28363. // Anything that was given is translated to buffer
  28364. result = this._createEncoderBuffer(data);
  28365. } else if (state.choice) {
  28366. result = this._encodeChoice(data, reporter);
  28367. } else if (state.contains) {
  28368. content = this._getUse(state.contains, parent)._encode(data, reporter);
  28369. primitive = true;
  28370. } else if (state.children) {
  28371. content = state.children.map(function(child) {
  28372. if (child._baseState.tag === 'null_')
  28373. return child._encode(null, reporter, data);
  28374. if (child._baseState.key === null)
  28375. return reporter.error('Child should have a key');
  28376. var prevKey = reporter.enterKey(child._baseState.key);
  28377. if (typeof data !== 'object')
  28378. return reporter.error('Child expected, but input is not object');
  28379. var res = child._encode(data[child._baseState.key], reporter, data);
  28380. reporter.leaveKey(prevKey);
  28381. return res;
  28382. }, this).filter(function(child) {
  28383. return child;
  28384. });
  28385. content = this._createEncoderBuffer(content);
  28386. } else {
  28387. if (state.tag === 'seqof' || state.tag === 'setof') {
  28388. // TODO(indutny): this should be thrown on DSL level
  28389. if (!(state.args && state.args.length === 1))
  28390. return reporter.error('Too many args for : ' + state.tag);
  28391. if (!Array.isArray(data))
  28392. return reporter.error('seqof/setof, but data is not Array');
  28393. var child = this.clone();
  28394. child._baseState.implicit = null;
  28395. content = this._createEncoderBuffer(data.map(function(item) {
  28396. var state = this._baseState;
  28397. return this._getUse(state.args[0], data)._encode(item, reporter);
  28398. }, child));
  28399. } else if (state.use !== null) {
  28400. result = this._getUse(state.use, parent)._encode(data, reporter);
  28401. } else {
  28402. content = this._encodePrimitive(state.tag, data);
  28403. primitive = true;
  28404. }
  28405. }
  28406. // Encode data itself
  28407. var result;
  28408. if (!state.any && state.choice === null) {
  28409. var tag = state.implicit !== null ? state.implicit : state.tag;
  28410. var cls = state.implicit === null ? 'universal' : 'context';
  28411. if (tag === null) {
  28412. if (state.use === null)
  28413. reporter.error('Tag could be omitted only for .use()');
  28414. } else {
  28415. if (state.use === null)
  28416. result = this._encodeComposite(tag, primitive, cls, content);
  28417. }
  28418. }
  28419. // Wrap in explicit
  28420. if (state.explicit !== null)
  28421. result = this._encodeComposite(state.explicit, false, 'context', result);
  28422. return result;
  28423. };
  28424. Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
  28425. var state = this._baseState;
  28426. var node = state.choice[data.type];
  28427. if (!node) {
  28428. assert(
  28429. false,
  28430. data.type + ' not found in ' +
  28431. JSON.stringify(Object.keys(state.choice)));
  28432. }
  28433. return node._encode(data.value, reporter);
  28434. };
  28435. Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
  28436. var state = this._baseState;
  28437. if (/str$/.test(tag))
  28438. return this._encodeStr(data, tag);
  28439. else if (tag === 'objid' && state.args)
  28440. return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
  28441. else if (tag === 'objid')
  28442. return this._encodeObjid(data, null, null);
  28443. else if (tag === 'gentime' || tag === 'utctime')
  28444. return this._encodeTime(data, tag);
  28445. else if (tag === 'null_')
  28446. return this._encodeNull();
  28447. else if (tag === 'int' || tag === 'enum')
  28448. return this._encodeInt(data, state.args && state.reverseArgs[0]);
  28449. else if (tag === 'bool')
  28450. return this._encodeBool(data);
  28451. else if (tag === 'objDesc')
  28452. return this._encodeStr(data, tag);
  28453. else
  28454. throw new Error('Unsupported tag: ' + tag);
  28455. };
  28456. Node.prototype._isNumstr = function isNumstr(str) {
  28457. return /^[0-9 ]*$/.test(str);
  28458. };
  28459. Node.prototype._isPrintstr = function isPrintstr(str) {
  28460. return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
  28461. };
  28462. /***/ }),
  28463. /* 166 */
  28464. /*!**********************************************************!*\
  28465. !*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***!
  28466. \**********************************************************/
  28467. /*! no static exports found */
  28468. /***/ (function(module, exports, __webpack_require__) {
  28469. var constants = exports;
  28470. // Helper
  28471. constants._reverse = function reverse(map) {
  28472. var res = {};
  28473. Object.keys(map).forEach(function(key) {
  28474. // Convert key to integer if it is stringified
  28475. if ((key | 0) == key)
  28476. key = key | 0;
  28477. var value = map[key];
  28478. res[value] = key;
  28479. });
  28480. return res;
  28481. };
  28482. constants.der = __webpack_require__(/*! ./der */ 167);
  28483. /***/ }),
  28484. /* 167 */
  28485. /*!********************************************************!*\
  28486. !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***!
  28487. \********************************************************/
  28488. /*! no static exports found */
  28489. /***/ (function(module, exports, __webpack_require__) {
  28490. var constants = __webpack_require__(/*! ../constants */ 166);
  28491. exports.tagClass = {
  28492. 0: 'universal',
  28493. 1: 'application',
  28494. 2: 'context',
  28495. 3: 'private'
  28496. };
  28497. exports.tagClassByName = constants._reverse(exports.tagClass);
  28498. exports.tag = {
  28499. 0x00: 'end',
  28500. 0x01: 'bool',
  28501. 0x02: 'int',
  28502. 0x03: 'bitstr',
  28503. 0x04: 'octstr',
  28504. 0x05: 'null_',
  28505. 0x06: 'objid',
  28506. 0x07: 'objDesc',
  28507. 0x08: 'external',
  28508. 0x09: 'real',
  28509. 0x0a: 'enum',
  28510. 0x0b: 'embed',
  28511. 0x0c: 'utf8str',
  28512. 0x0d: 'relativeOid',
  28513. 0x10: 'seq',
  28514. 0x11: 'set',
  28515. 0x12: 'numstr',
  28516. 0x13: 'printstr',
  28517. 0x14: 't61str',
  28518. 0x15: 'videostr',
  28519. 0x16: 'ia5str',
  28520. 0x17: 'utctime',
  28521. 0x18: 'gentime',
  28522. 0x19: 'graphstr',
  28523. 0x1a: 'iso646str',
  28524. 0x1b: 'genstr',
  28525. 0x1c: 'unistr',
  28526. 0x1d: 'charstr',
  28527. 0x1e: 'bmpstr'
  28528. };
  28529. exports.tagByName = constants._reverse(exports.tag);
  28530. /***/ }),
  28531. /* 168 */
  28532. /*!*********************************************************!*\
  28533. !*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***!
  28534. \*********************************************************/
  28535. /*! no static exports found */
  28536. /***/ (function(module, exports, __webpack_require__) {
  28537. var decoders = exports;
  28538. decoders.der = __webpack_require__(/*! ./der */ 169);
  28539. decoders.pem = __webpack_require__(/*! ./pem */ 170);
  28540. /***/ }),
  28541. /* 169 */
  28542. /*!*******************************************************!*\
  28543. !*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***!
  28544. \*******************************************************/
  28545. /*! no static exports found */
  28546. /***/ (function(module, exports, __webpack_require__) {
  28547. var inherits = __webpack_require__(/*! inherits */ 40);
  28548. var asn1 = __webpack_require__(/*! ../../asn1 */ 159);
  28549. var base = asn1.base;
  28550. var bignum = asn1.bignum;
  28551. // Import DER constants
  28552. var der = asn1.constants.der;
  28553. function DERDecoder(entity) {
  28554. this.enc = 'der';
  28555. this.name = entity.name;
  28556. this.entity = entity;
  28557. // Construct base tree
  28558. this.tree = new DERNode();
  28559. this.tree._init(entity.body);
  28560. };
  28561. module.exports = DERDecoder;
  28562. DERDecoder.prototype.decode = function decode(data, options) {
  28563. if (!(data instanceof base.DecoderBuffer))
  28564. data = new base.DecoderBuffer(data, options);
  28565. return this.tree._decode(data, options);
  28566. };
  28567. // Tree methods
  28568. function DERNode(parent) {
  28569. base.Node.call(this, 'der', parent);
  28570. }
  28571. inherits(DERNode, base.Node);
  28572. DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
  28573. if (buffer.isEmpty())
  28574. return false;
  28575. var state = buffer.save();
  28576. var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
  28577. if (buffer.isError(decodedTag))
  28578. return decodedTag;
  28579. buffer.restore(state);
  28580. return decodedTag.tag === tag || decodedTag.tagStr === tag ||
  28581. (decodedTag.tagStr + 'of') === tag || any;
  28582. };
  28583. DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
  28584. var decodedTag = derDecodeTag(buffer,
  28585. 'Failed to decode tag of "' + tag + '"');
  28586. if (buffer.isError(decodedTag))
  28587. return decodedTag;
  28588. var len = derDecodeLen(buffer,
  28589. decodedTag.primitive,
  28590. 'Failed to get length of "' + tag + '"');
  28591. // Failure
  28592. if (buffer.isError(len))
  28593. return len;
  28594. if (!any &&
  28595. decodedTag.tag !== tag &&
  28596. decodedTag.tagStr !== tag &&
  28597. decodedTag.tagStr + 'of' !== tag) {
  28598. return buffer.error('Failed to match tag: "' + tag + '"');
  28599. }
  28600. if (decodedTag.primitive || len !== null)
  28601. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  28602. // Indefinite length... find END tag
  28603. var state = buffer.save();
  28604. var res = this._skipUntilEnd(
  28605. buffer,
  28606. 'Failed to skip indefinite length body: "' + this.tag + '"');
  28607. if (buffer.isError(res))
  28608. return res;
  28609. len = buffer.offset - state.offset;
  28610. buffer.restore(state);
  28611. return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
  28612. };
  28613. DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
  28614. while (true) {
  28615. var tag = derDecodeTag(buffer, fail);
  28616. if (buffer.isError(tag))
  28617. return tag;
  28618. var len = derDecodeLen(buffer, tag.primitive, fail);
  28619. if (buffer.isError(len))
  28620. return len;
  28621. var res;
  28622. if (tag.primitive || len !== null)
  28623. res = buffer.skip(len)
  28624. else
  28625. res = this._skipUntilEnd(buffer, fail);
  28626. // Failure
  28627. if (buffer.isError(res))
  28628. return res;
  28629. if (tag.tagStr === 'end')
  28630. break;
  28631. }
  28632. };
  28633. DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,
  28634. options) {
  28635. var result = [];
  28636. while (!buffer.isEmpty()) {
  28637. var possibleEnd = this._peekTag(buffer, 'end');
  28638. if (buffer.isError(possibleEnd))
  28639. return possibleEnd;
  28640. var res = decoder.decode(buffer, 'der', options);
  28641. if (buffer.isError(res) && possibleEnd)
  28642. break;
  28643. result.push(res);
  28644. }
  28645. return result;
  28646. };
  28647. DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
  28648. if (tag === 'bitstr') {
  28649. var unused = buffer.readUInt8();
  28650. if (buffer.isError(unused))
  28651. return unused;
  28652. return { unused: unused, data: buffer.raw() };
  28653. } else if (tag === 'bmpstr') {
  28654. var raw = buffer.raw();
  28655. if (raw.length % 2 === 1)
  28656. return buffer.error('Decoding of string type: bmpstr length mismatch');
  28657. var str = '';
  28658. for (var i = 0; i < raw.length / 2; i++) {
  28659. str += String.fromCharCode(raw.readUInt16BE(i * 2));
  28660. }
  28661. return str;
  28662. } else if (tag === 'numstr') {
  28663. var numstr = buffer.raw().toString('ascii');
  28664. if (!this._isNumstr(numstr)) {
  28665. return buffer.error('Decoding of string type: ' +
  28666. 'numstr unsupported characters');
  28667. }
  28668. return numstr;
  28669. } else if (tag === 'octstr') {
  28670. return buffer.raw();
  28671. } else if (tag === 'objDesc') {
  28672. return buffer.raw();
  28673. } else if (tag === 'printstr') {
  28674. var printstr = buffer.raw().toString('ascii');
  28675. if (!this._isPrintstr(printstr)) {
  28676. return buffer.error('Decoding of string type: ' +
  28677. 'printstr unsupported characters');
  28678. }
  28679. return printstr;
  28680. } else if (/str$/.test(tag)) {
  28681. return buffer.raw().toString();
  28682. } else {
  28683. return buffer.error('Decoding of string type: ' + tag + ' unsupported');
  28684. }
  28685. };
  28686. DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
  28687. var result;
  28688. var identifiers = [];
  28689. var ident = 0;
  28690. while (!buffer.isEmpty()) {
  28691. var subident = buffer.readUInt8();
  28692. ident <<= 7;
  28693. ident |= subident & 0x7f;
  28694. if ((subident & 0x80) === 0) {
  28695. identifiers.push(ident);
  28696. ident = 0;
  28697. }
  28698. }
  28699. if (subident & 0x80)
  28700. identifiers.push(ident);
  28701. var first = (identifiers[0] / 40) | 0;
  28702. var second = identifiers[0] % 40;
  28703. if (relative)
  28704. result = identifiers;
  28705. else
  28706. result = [first, second].concat(identifiers.slice(1));
  28707. if (values) {
  28708. var tmp = values[result.join(' ')];
  28709. if (tmp === undefined)
  28710. tmp = values[result.join('.')];
  28711. if (tmp !== undefined)
  28712. result = tmp;
  28713. }
  28714. return result;
  28715. };
  28716. DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
  28717. var str = buffer.raw().toString();
  28718. if (tag === 'gentime') {
  28719. var year = str.slice(0, 4) | 0;
  28720. var mon = str.slice(4, 6) | 0;
  28721. var day = str.slice(6, 8) | 0;
  28722. var hour = str.slice(8, 10) | 0;
  28723. var min = str.slice(10, 12) | 0;
  28724. var sec = str.slice(12, 14) | 0;
  28725. } else if (tag === 'utctime') {
  28726. var year = str.slice(0, 2) | 0;
  28727. var mon = str.slice(2, 4) | 0;
  28728. var day = str.slice(4, 6) | 0;
  28729. var hour = str.slice(6, 8) | 0;
  28730. var min = str.slice(8, 10) | 0;
  28731. var sec = str.slice(10, 12) | 0;
  28732. if (year < 70)
  28733. year = 2000 + year;
  28734. else
  28735. year = 1900 + year;
  28736. } else {
  28737. return buffer.error('Decoding ' + tag + ' time is not supported yet');
  28738. }
  28739. return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
  28740. };
  28741. DERNode.prototype._decodeNull = function decodeNull(buffer) {
  28742. return null;
  28743. };
  28744. DERNode.prototype._decodeBool = function decodeBool(buffer) {
  28745. var res = buffer.readUInt8();
  28746. if (buffer.isError(res))
  28747. return res;
  28748. else
  28749. return res !== 0;
  28750. };
  28751. DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
  28752. // Bigint, return as it is (assume big endian)
  28753. var raw = buffer.raw();
  28754. var res = new bignum(raw);
  28755. if (values)
  28756. res = values[res.toString(10)] || res;
  28757. return res;
  28758. };
  28759. DERNode.prototype._use = function use(entity, obj) {
  28760. if (typeof entity === 'function')
  28761. entity = entity(obj);
  28762. return entity._getDecoder('der').tree;
  28763. };
  28764. // Utility methods
  28765. function derDecodeTag(buf, fail) {
  28766. var tag = buf.readUInt8(fail);
  28767. if (buf.isError(tag))
  28768. return tag;
  28769. var cls = der.tagClass[tag >> 6];
  28770. var primitive = (tag & 0x20) === 0;
  28771. // Multi-octet tag - load
  28772. if ((tag & 0x1f) === 0x1f) {
  28773. var oct = tag;
  28774. tag = 0;
  28775. while ((oct & 0x80) === 0x80) {
  28776. oct = buf.readUInt8(fail);
  28777. if (buf.isError(oct))
  28778. return oct;
  28779. tag <<= 7;
  28780. tag |= oct & 0x7f;
  28781. }
  28782. } else {
  28783. tag &= 0x1f;
  28784. }
  28785. var tagStr = der.tag[tag];
  28786. return {
  28787. cls: cls,
  28788. primitive: primitive,
  28789. tag: tag,
  28790. tagStr: tagStr
  28791. };
  28792. }
  28793. function derDecodeLen(buf, primitive, fail) {
  28794. var len = buf.readUInt8(fail);
  28795. if (buf.isError(len))
  28796. return len;
  28797. // Indefinite form
  28798. if (!primitive && len === 0x80)
  28799. return null;
  28800. // Definite form
  28801. if ((len & 0x80) === 0) {
  28802. // Short form
  28803. return len;
  28804. }
  28805. // Long form
  28806. var num = len & 0x7f;
  28807. if (num > 4)
  28808. return buf.error('length octect is too long');
  28809. len = 0;
  28810. for (var i = 0; i < num; i++) {
  28811. len <<= 8;
  28812. var j = buf.readUInt8(fail);
  28813. if (buf.isError(j))
  28814. return j;
  28815. len |= j;
  28816. }
  28817. return len;
  28818. }
  28819. /***/ }),
  28820. /* 170 */
  28821. /*!*******************************************************!*\
  28822. !*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***!
  28823. \*******************************************************/
  28824. /*! no static exports found */
  28825. /***/ (function(module, exports, __webpack_require__) {
  28826. var inherits = __webpack_require__(/*! inherits */ 40);
  28827. var Buffer = __webpack_require__(/*! buffer */ 35).Buffer;
  28828. var DERDecoder = __webpack_require__(/*! ./der */ 169);
  28829. function PEMDecoder(entity) {
  28830. DERDecoder.call(this, entity);
  28831. this.enc = 'pem';
  28832. };
  28833. inherits(PEMDecoder, DERDecoder);
  28834. module.exports = PEMDecoder;
  28835. PEMDecoder.prototype.decode = function decode(data, options) {
  28836. var lines = data.toString().split(/[\r\n]+/g);
  28837. var label = options.label.toUpperCase();
  28838. var re = /^-----(BEGIN|END) ([^-]+)-----$/;
  28839. var start = -1;
  28840. var end = -1;
  28841. for (var i = 0; i < lines.length; i++) {
  28842. var match = lines[i].match(re);
  28843. if (match === null)
  28844. continue;
  28845. if (match[2] !== label)
  28846. continue;
  28847. if (start === -1) {
  28848. if (match[1] !== 'BEGIN')
  28849. break;
  28850. start = i;
  28851. } else {
  28852. if (match[1] !== 'END')
  28853. break;
  28854. end = i;
  28855. break;
  28856. }
  28857. }
  28858. if (start === -1 || end === -1)
  28859. throw new Error('PEM section not found for: ' + label);
  28860. var base64 = lines.slice(start + 1, end).join('');
  28861. // Remove excessive symbols
  28862. base64.replace(/[^a-z0-9\+\/=]+/gi, '');
  28863. var input = new Buffer(base64, 'base64');
  28864. return DERDecoder.prototype.decode.call(this, input, options);
  28865. };
  28866. /***/ }),
  28867. /* 171 */
  28868. /*!*********************************************************!*\
  28869. !*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***!
  28870. \*********************************************************/
  28871. /*! no static exports found */
  28872. /***/ (function(module, exports, __webpack_require__) {
  28873. var encoders = exports;
  28874. encoders.der = __webpack_require__(/*! ./der */ 172);
  28875. encoders.pem = __webpack_require__(/*! ./pem */ 173);
  28876. /***/ }),
  28877. /* 172 */
  28878. /*!*******************************************************!*\
  28879. !*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***!
  28880. \*******************************************************/
  28881. /*! no static exports found */
  28882. /***/ (function(module, exports, __webpack_require__) {
  28883. var inherits = __webpack_require__(/*! inherits */ 40);
  28884. var Buffer = __webpack_require__(/*! buffer */ 35).Buffer;
  28885. var asn1 = __webpack_require__(/*! ../../asn1 */ 159);
  28886. var base = asn1.base;
  28887. // Import DER constants
  28888. var der = asn1.constants.der;
  28889. function DEREncoder(entity) {
  28890. this.enc = 'der';
  28891. this.name = entity.name;
  28892. this.entity = entity;
  28893. // Construct base tree
  28894. this.tree = new DERNode();
  28895. this.tree._init(entity.body);
  28896. };
  28897. module.exports = DEREncoder;
  28898. DEREncoder.prototype.encode = function encode(data, reporter) {
  28899. return this.tree._encode(data, reporter).join();
  28900. };
  28901. // Tree methods
  28902. function DERNode(parent) {
  28903. base.Node.call(this, 'der', parent);
  28904. }
  28905. inherits(DERNode, base.Node);
  28906. DERNode.prototype._encodeComposite = function encodeComposite(tag,
  28907. primitive,
  28908. cls,
  28909. content) {
  28910. var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
  28911. // Short form
  28912. if (content.length < 0x80) {
  28913. var header = new Buffer(2);
  28914. header[0] = encodedTag;
  28915. header[1] = content.length;
  28916. return this._createEncoderBuffer([ header, content ]);
  28917. }
  28918. // Long form
  28919. // Count octets required to store length
  28920. var lenOctets = 1;
  28921. for (var i = content.length; i >= 0x100; i >>= 8)
  28922. lenOctets++;
  28923. var header = new Buffer(1 + 1 + lenOctets);
  28924. header[0] = encodedTag;
  28925. header[1] = 0x80 | lenOctets;
  28926. for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)
  28927. header[i] = j & 0xff;
  28928. return this._createEncoderBuffer([ header, content ]);
  28929. };
  28930. DERNode.prototype._encodeStr = function encodeStr(str, tag) {
  28931. if (tag === 'bitstr') {
  28932. return this._createEncoderBuffer([ str.unused | 0, str.data ]);
  28933. } else if (tag === 'bmpstr') {
  28934. var buf = new Buffer(str.length * 2);
  28935. for (var i = 0; i < str.length; i++) {
  28936. buf.writeUInt16BE(str.charCodeAt(i), i * 2);
  28937. }
  28938. return this._createEncoderBuffer(buf);
  28939. } else if (tag === 'numstr') {
  28940. if (!this._isNumstr(str)) {
  28941. return this.reporter.error('Encoding of string type: numstr supports ' +
  28942. 'only digits and space');
  28943. }
  28944. return this._createEncoderBuffer(str);
  28945. } else if (tag === 'printstr') {
  28946. if (!this._isPrintstr(str)) {
  28947. return this.reporter.error('Encoding of string type: printstr supports ' +
  28948. 'only latin upper and lower case letters, ' +
  28949. 'digits, space, apostrophe, left and rigth ' +
  28950. 'parenthesis, plus sign, comma, hyphen, ' +
  28951. 'dot, slash, colon, equal sign, ' +
  28952. 'question mark');
  28953. }
  28954. return this._createEncoderBuffer(str);
  28955. } else if (/str$/.test(tag)) {
  28956. return this._createEncoderBuffer(str);
  28957. } else if (tag === 'objDesc') {
  28958. return this._createEncoderBuffer(str);
  28959. } else {
  28960. return this.reporter.error('Encoding of string type: ' + tag +
  28961. ' unsupported');
  28962. }
  28963. };
  28964. DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
  28965. if (typeof id === 'string') {
  28966. if (!values)
  28967. return this.reporter.error('string objid given, but no values map found');
  28968. if (!values.hasOwnProperty(id))
  28969. return this.reporter.error('objid not found in values map');
  28970. id = values[id].split(/[\s\.]+/g);
  28971. for (var i = 0; i < id.length; i++)
  28972. id[i] |= 0;
  28973. } else if (Array.isArray(id)) {
  28974. id = id.slice();
  28975. for (var i = 0; i < id.length; i++)
  28976. id[i] |= 0;
  28977. }
  28978. if (!Array.isArray(id)) {
  28979. return this.reporter.error('objid() should be either array or string, ' +
  28980. 'got: ' + JSON.stringify(id));
  28981. }
  28982. if (!relative) {
  28983. if (id[1] >= 40)
  28984. return this.reporter.error('Second objid identifier OOB');
  28985. id.splice(0, 2, id[0] * 40 + id[1]);
  28986. }
  28987. // Count number of octets
  28988. var size = 0;
  28989. for (var i = 0; i < id.length; i++) {
  28990. var ident = id[i];
  28991. for (size++; ident >= 0x80; ident >>= 7)
  28992. size++;
  28993. }
  28994. var objid = new Buffer(size);
  28995. var offset = objid.length - 1;
  28996. for (var i = id.length - 1; i >= 0; i--) {
  28997. var ident = id[i];
  28998. objid[offset--] = ident & 0x7f;
  28999. while ((ident >>= 7) > 0)
  29000. objid[offset--] = 0x80 | (ident & 0x7f);
  29001. }
  29002. return this._createEncoderBuffer(objid);
  29003. };
  29004. function two(num) {
  29005. if (num < 10)
  29006. return '0' + num;
  29007. else
  29008. return num;
  29009. }
  29010. DERNode.prototype._encodeTime = function encodeTime(time, tag) {
  29011. var str;
  29012. var date = new Date(time);
  29013. if (tag === 'gentime') {
  29014. str = [
  29015. two(date.getFullYear()),
  29016. two(date.getUTCMonth() + 1),
  29017. two(date.getUTCDate()),
  29018. two(date.getUTCHours()),
  29019. two(date.getUTCMinutes()),
  29020. two(date.getUTCSeconds()),
  29021. 'Z'
  29022. ].join('');
  29023. } else if (tag === 'utctime') {
  29024. str = [
  29025. two(date.getFullYear() % 100),
  29026. two(date.getUTCMonth() + 1),
  29027. two(date.getUTCDate()),
  29028. two(date.getUTCHours()),
  29029. two(date.getUTCMinutes()),
  29030. two(date.getUTCSeconds()),
  29031. 'Z'
  29032. ].join('');
  29033. } else {
  29034. this.reporter.error('Encoding ' + tag + ' time is not supported yet');
  29035. }
  29036. return this._encodeStr(str, 'octstr');
  29037. };
  29038. DERNode.prototype._encodeNull = function encodeNull() {
  29039. return this._createEncoderBuffer('');
  29040. };
  29041. DERNode.prototype._encodeInt = function encodeInt(num, values) {
  29042. if (typeof num === 'string') {
  29043. if (!values)
  29044. return this.reporter.error('String int or enum given, but no values map');
  29045. if (!values.hasOwnProperty(num)) {
  29046. return this.reporter.error('Values map doesn\'t contain: ' +
  29047. JSON.stringify(num));
  29048. }
  29049. num = values[num];
  29050. }
  29051. // Bignum, assume big endian
  29052. if (typeof num !== 'number' && !Buffer.isBuffer(num)) {
  29053. var numArray = num.toArray();
  29054. if (!num.sign && numArray[0] & 0x80) {
  29055. numArray.unshift(0);
  29056. }
  29057. num = new Buffer(numArray);
  29058. }
  29059. if (Buffer.isBuffer(num)) {
  29060. var size = num.length;
  29061. if (num.length === 0)
  29062. size++;
  29063. var out = new Buffer(size);
  29064. num.copy(out);
  29065. if (num.length === 0)
  29066. out[0] = 0
  29067. return this._createEncoderBuffer(out);
  29068. }
  29069. if (num < 0x80)
  29070. return this._createEncoderBuffer(num);
  29071. if (num < 0x100)
  29072. return this._createEncoderBuffer([0, num]);
  29073. var size = 1;
  29074. for (var i = num; i >= 0x100; i >>= 8)
  29075. size++;
  29076. var out = new Array(size);
  29077. for (var i = out.length - 1; i >= 0; i--) {
  29078. out[i] = num & 0xff;
  29079. num >>= 8;
  29080. }
  29081. if(out[0] & 0x80) {
  29082. out.unshift(0);
  29083. }
  29084. return this._createEncoderBuffer(new Buffer(out));
  29085. };
  29086. DERNode.prototype._encodeBool = function encodeBool(value) {
  29087. return this._createEncoderBuffer(value ? 0xff : 0);
  29088. };
  29089. DERNode.prototype._use = function use(entity, obj) {
  29090. if (typeof entity === 'function')
  29091. entity = entity(obj);
  29092. return entity._getEncoder('der').tree;
  29093. };
  29094. DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
  29095. var state = this._baseState;
  29096. var i;
  29097. if (state['default'] === null)
  29098. return false;
  29099. var data = dataBuffer.join();
  29100. if (state.defaultBuffer === undefined)
  29101. state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();
  29102. if (data.length !== state.defaultBuffer.length)
  29103. return false;
  29104. for (i=0; i < data.length; i++)
  29105. if (data[i] !== state.defaultBuffer[i])
  29106. return false;
  29107. return true;
  29108. };
  29109. // Utility methods
  29110. function encodeTag(tag, primitive, cls, reporter) {
  29111. var res;
  29112. if (tag === 'seqof')
  29113. tag = 'seq';
  29114. else if (tag === 'setof')
  29115. tag = 'set';
  29116. if (der.tagByName.hasOwnProperty(tag))
  29117. res = der.tagByName[tag];
  29118. else if (typeof tag === 'number' && (tag | 0) === tag)
  29119. res = tag;
  29120. else
  29121. return reporter.error('Unknown tag: ' + tag);
  29122. if (res >= 0x1f)
  29123. return reporter.error('Multi-octet tag encoding unsupported');
  29124. if (!primitive)
  29125. res |= 0x20;
  29126. res |= (der.tagClassByName[cls || 'universal'] << 6);
  29127. return res;
  29128. }
  29129. /***/ }),
  29130. /* 173 */
  29131. /*!*******************************************************!*\
  29132. !*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***!
  29133. \*******************************************************/
  29134. /*! no static exports found */
  29135. /***/ (function(module, exports, __webpack_require__) {
  29136. var inherits = __webpack_require__(/*! inherits */ 40);
  29137. var DEREncoder = __webpack_require__(/*! ./der */ 172);
  29138. function PEMEncoder(entity) {
  29139. DEREncoder.call(this, entity);
  29140. this.enc = 'pem';
  29141. };
  29142. inherits(PEMEncoder, DEREncoder);
  29143. module.exports = PEMEncoder;
  29144. PEMEncoder.prototype.encode = function encode(data, options) {
  29145. var buf = DEREncoder.prototype.encode.call(this, data);
  29146. var p = buf.toString('base64');
  29147. var out = [ '-----BEGIN ' + options.label + '-----' ];
  29148. for (var i = 0; i < p.length; i += 64)
  29149. out.push(p.slice(i, i + 64));
  29150. out.push('-----END ' + options.label + '-----');
  29151. return out.join('\n');
  29152. };
  29153. /***/ }),
  29154. /* 174 */
  29155. /*!************************************************!*\
  29156. !*** ./node_modules/parse-asn1/certificate.js ***!
  29157. \************************************************/
  29158. /*! no static exports found */
  29159. /***/ (function(module, exports, __webpack_require__) {
  29160. "use strict";
  29161. // from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
  29162. // thanks to @Rantanen
  29163. var asn = __webpack_require__(/*! asn1.js */ 159)
  29164. var Time = asn.define('Time', function () {
  29165. this.choice({
  29166. utcTime: this.utctime(),
  29167. generalTime: this.gentime()
  29168. })
  29169. })
  29170. var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
  29171. this.seq().obj(
  29172. this.key('type').objid(),
  29173. this.key('value').any()
  29174. )
  29175. })
  29176. var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
  29177. this.seq().obj(
  29178. this.key('algorithm').objid(),
  29179. this.key('parameters').optional(),
  29180. this.key('curve').objid().optional()
  29181. )
  29182. })
  29183. var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
  29184. this.seq().obj(
  29185. this.key('algorithm').use(AlgorithmIdentifier),
  29186. this.key('subjectPublicKey').bitstr()
  29187. )
  29188. })
  29189. var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
  29190. this.setof(AttributeTypeValue)
  29191. })
  29192. var RDNSequence = asn.define('RDNSequence', function () {
  29193. this.seqof(RelativeDistinguishedName)
  29194. })
  29195. var Name = asn.define('Name', function () {
  29196. this.choice({
  29197. rdnSequence: this.use(RDNSequence)
  29198. })
  29199. })
  29200. var Validity = asn.define('Validity', function () {
  29201. this.seq().obj(
  29202. this.key('notBefore').use(Time),
  29203. this.key('notAfter').use(Time)
  29204. )
  29205. })
  29206. var Extension = asn.define('Extension', function () {
  29207. this.seq().obj(
  29208. this.key('extnID').objid(),
  29209. this.key('critical').bool().def(false),
  29210. this.key('extnValue').octstr()
  29211. )
  29212. })
  29213. var TBSCertificate = asn.define('TBSCertificate', function () {
  29214. this.seq().obj(
  29215. this.key('version').explicit(0).int().optional(),
  29216. this.key('serialNumber').int(),
  29217. this.key('signature').use(AlgorithmIdentifier),
  29218. this.key('issuer').use(Name),
  29219. this.key('validity').use(Validity),
  29220. this.key('subject').use(Name),
  29221. this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
  29222. this.key('issuerUniqueID').implicit(1).bitstr().optional(),
  29223. this.key('subjectUniqueID').implicit(2).bitstr().optional(),
  29224. this.key('extensions').explicit(3).seqof(Extension).optional()
  29225. )
  29226. })
  29227. var X509Certificate = asn.define('X509Certificate', function () {
  29228. this.seq().obj(
  29229. this.key('tbsCertificate').use(TBSCertificate),
  29230. this.key('signatureAlgorithm').use(AlgorithmIdentifier),
  29231. this.key('signatureValue').bitstr()
  29232. )
  29233. })
  29234. module.exports = X509Certificate
  29235. /***/ }),
  29236. /* 175 */
  29237. /*!********************************************!*\
  29238. !*** ./node_modules/parse-asn1/aesid.json ***!
  29239. \********************************************/
  29240. /*! exports provided: 2.16.840.1.101.3.4.1.1, 2.16.840.1.101.3.4.1.2, 2.16.840.1.101.3.4.1.3, 2.16.840.1.101.3.4.1.4, 2.16.840.1.101.3.4.1.21, 2.16.840.1.101.3.4.1.22, 2.16.840.1.101.3.4.1.23, 2.16.840.1.101.3.4.1.24, 2.16.840.1.101.3.4.1.41, 2.16.840.1.101.3.4.1.42, 2.16.840.1.101.3.4.1.43, 2.16.840.1.101.3.4.1.44, default */
  29241. /***/ (function(module) {
  29242. module.exports = JSON.parse("{\"2.16.840.1.101.3.4.1.1\":\"aes-128-ecb\",\"2.16.840.1.101.3.4.1.2\":\"aes-128-cbc\",\"2.16.840.1.101.3.4.1.3\":\"aes-128-ofb\",\"2.16.840.1.101.3.4.1.4\":\"aes-128-cfb\",\"2.16.840.1.101.3.4.1.21\":\"aes-192-ecb\",\"2.16.840.1.101.3.4.1.22\":\"aes-192-cbc\",\"2.16.840.1.101.3.4.1.23\":\"aes-192-ofb\",\"2.16.840.1.101.3.4.1.24\":\"aes-192-cfb\",\"2.16.840.1.101.3.4.1.41\":\"aes-256-ecb\",\"2.16.840.1.101.3.4.1.42\":\"aes-256-cbc\",\"2.16.840.1.101.3.4.1.43\":\"aes-256-ofb\",\"2.16.840.1.101.3.4.1.44\":\"aes-256-cfb\"}");
  29243. /***/ }),
  29244. /* 176 */
  29245. /*!********************************************!*\
  29246. !*** ./node_modules/parse-asn1/fixProc.js ***!
  29247. \********************************************/
  29248. /*! no static exports found */
  29249. /***/ (function(module, exports, __webpack_require__) {
  29250. // adapted from https://github.com/apatil/pemstrip
  29251. var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m
  29252. var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m
  29253. var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m
  29254. var evp = __webpack_require__(/*! evp_bytestokey */ 111)
  29255. var ciphers = __webpack_require__(/*! browserify-aes */ 94)
  29256. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  29257. module.exports = function (okey, password) {
  29258. var key = okey.toString()
  29259. var match = key.match(findProc)
  29260. var decrypted
  29261. if (!match) {
  29262. var match2 = key.match(fullRegex)
  29263. decrypted = new Buffer(match2[2].replace(/[\r\n]/g, ''), 'base64')
  29264. } else {
  29265. var suite = 'aes' + match[1]
  29266. var iv = Buffer.from(match[2], 'hex')
  29267. var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64')
  29268. var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key
  29269. var out = []
  29270. var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)
  29271. out.push(cipher.update(cipherText))
  29272. out.push(cipher.final())
  29273. decrypted = Buffer.concat(out)
  29274. }
  29275. var tag = key.match(startRegex)[1]
  29276. return {
  29277. tag: tag,
  29278. data: decrypted
  29279. }
  29280. }
  29281. /***/ }),
  29282. /* 177 */
  29283. /*!**********************************************************!*\
  29284. !*** ./node_modules/browserify-sign/browser/curves.json ***!
  29285. \**********************************************************/
  29286. /*! exports provided: 1.3.132.0.10, 1.3.132.0.33, 1.2.840.10045.3.1.1, 1.2.840.10045.3.1.7, 1.3.132.0.34, 1.3.132.0.35, default */
  29287. /***/ (function(module) {
  29288. module.exports = JSON.parse("{\"1.3.132.0.10\":\"secp256k1\",\"1.3.132.0.33\":\"p224\",\"1.2.840.10045.3.1.1\":\"p192\",\"1.2.840.10045.3.1.7\":\"p256\",\"1.3.132.0.34\":\"p384\",\"1.3.132.0.35\":\"p521\"}");
  29289. /***/ }),
  29290. /* 178 */
  29291. /*!********************************************************!*\
  29292. !*** ./node_modules/browserify-sign/browser/verify.js ***!
  29293. \********************************************************/
  29294. /*! no static exports found */
  29295. /***/ (function(module, exports, __webpack_require__) {
  29296. // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js
  29297. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  29298. var BN = __webpack_require__(/*! bn.js */ 116)
  29299. var EC = __webpack_require__(/*! elliptic */ 127).ec
  29300. var parseKeys = __webpack_require__(/*! parse-asn1 */ 157)
  29301. var curves = __webpack_require__(/*! ./curves.json */ 177)
  29302. function verify (sig, hash, key, signType, tag) {
  29303. var pub = parseKeys(key)
  29304. if (pub.type === 'ec') {
  29305. // rsa keys can be interpreted as ecdsa ones in openssl
  29306. if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  29307. return ecVerify(sig, hash, pub)
  29308. } else if (pub.type === 'dsa') {
  29309. if (signType !== 'dsa') throw new Error('wrong public key type')
  29310. return dsaVerify(sig, hash, pub)
  29311. } else {
  29312. if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')
  29313. }
  29314. hash = Buffer.concat([tag, hash])
  29315. var len = pub.modulus.byteLength()
  29316. var pad = [1]
  29317. var padNum = 0
  29318. while (hash.length + pad.length + 2 < len) {
  29319. pad.push(0xff)
  29320. padNum++
  29321. }
  29322. pad.push(0x00)
  29323. var i = -1
  29324. while (++i < hash.length) {
  29325. pad.push(hash[i])
  29326. }
  29327. pad = Buffer.from(pad)
  29328. var red = BN.mont(pub.modulus)
  29329. sig = new BN(sig).toRed(red)
  29330. sig = sig.redPow(new BN(pub.publicExponent))
  29331. sig = Buffer.from(sig.fromRed().toArray())
  29332. var out = padNum < 8 ? 1 : 0
  29333. len = Math.min(sig.length, pad.length)
  29334. if (sig.length !== pad.length) out = 1
  29335. i = -1
  29336. while (++i < len) out |= sig[i] ^ pad[i]
  29337. return out === 0
  29338. }
  29339. function ecVerify (sig, hash, pub) {
  29340. var curveId = curves[pub.data.algorithm.curve.join('.')]
  29341. if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))
  29342. var curve = new EC(curveId)
  29343. var pubkey = pub.data.subjectPrivateKey.data
  29344. return curve.verify(hash, sig, pubkey)
  29345. }
  29346. function dsaVerify (sig, hash, pub) {
  29347. var p = pub.data.p
  29348. var q = pub.data.q
  29349. var g = pub.data.g
  29350. var y = pub.data.pub_key
  29351. var unpacked = parseKeys.signature.decode(sig, 'der')
  29352. var s = unpacked.s
  29353. var r = unpacked.r
  29354. checkValue(s, q)
  29355. checkValue(r, q)
  29356. var montp = BN.mont(p)
  29357. var w = s.invm(q)
  29358. var v = g.toRed(montp)
  29359. .redPow(new BN(hash).mul(w).mod(q))
  29360. .fromRed()
  29361. .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())
  29362. .mod(p)
  29363. .mod(q)
  29364. return v.cmp(r) === 0
  29365. }
  29366. function checkValue (b, q) {
  29367. if (b.cmpn(0) <= 0) throw new Error('invalid sig')
  29368. if (b.cmp(q) >= q) throw new Error('invalid sig')
  29369. }
  29370. module.exports = verify
  29371. /***/ }),
  29372. /* 179 */
  29373. /*!*********************************************!*\
  29374. !*** ./node_modules/create-ecdh/browser.js ***!
  29375. \*********************************************/
  29376. /*! no static exports found */
  29377. /***/ (function(module, exports, __webpack_require__) {
  29378. /* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(/*! elliptic */ 127)
  29379. var BN = __webpack_require__(/*! bn.js */ 116)
  29380. module.exports = function createECDH (curve) {
  29381. return new ECDH(curve)
  29382. }
  29383. var aliases = {
  29384. secp256k1: {
  29385. name: 'secp256k1',
  29386. byteLength: 32
  29387. },
  29388. secp224r1: {
  29389. name: 'p224',
  29390. byteLength: 28
  29391. },
  29392. prime256v1: {
  29393. name: 'p256',
  29394. byteLength: 32
  29395. },
  29396. prime192v1: {
  29397. name: 'p192',
  29398. byteLength: 24
  29399. },
  29400. ed25519: {
  29401. name: 'ed25519',
  29402. byteLength: 32
  29403. },
  29404. secp384r1: {
  29405. name: 'p384',
  29406. byteLength: 48
  29407. },
  29408. secp521r1: {
  29409. name: 'p521',
  29410. byteLength: 66
  29411. }
  29412. }
  29413. aliases.p224 = aliases.secp224r1
  29414. aliases.p256 = aliases.secp256r1 = aliases.prime256v1
  29415. aliases.p192 = aliases.secp192r1 = aliases.prime192v1
  29416. aliases.p384 = aliases.secp384r1
  29417. aliases.p521 = aliases.secp521r1
  29418. function ECDH (curve) {
  29419. this.curveType = aliases[curve]
  29420. if (!this.curveType) {
  29421. this.curveType = {
  29422. name: curve
  29423. }
  29424. }
  29425. this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap
  29426. this.keys = void 0
  29427. }
  29428. ECDH.prototype.generateKeys = function (enc, format) {
  29429. this.keys = this.curve.genKeyPair()
  29430. return this.getPublicKey(enc, format)
  29431. }
  29432. ECDH.prototype.computeSecret = function (other, inenc, enc) {
  29433. inenc = inenc || 'utf8'
  29434. if (!Buffer.isBuffer(other)) {
  29435. other = new Buffer(other, inenc)
  29436. }
  29437. var otherPub = this.curve.keyFromPublic(other).getPublic()
  29438. var out = otherPub.mul(this.keys.getPrivate()).getX()
  29439. return formatReturnValue(out, enc, this.curveType.byteLength)
  29440. }
  29441. ECDH.prototype.getPublicKey = function (enc, format) {
  29442. var key = this.keys.getPublic(format === 'compressed', true)
  29443. if (format === 'hybrid') {
  29444. if (key[key.length - 1] % 2) {
  29445. key[0] = 7
  29446. } else {
  29447. key[0] = 6
  29448. }
  29449. }
  29450. return formatReturnValue(key, enc)
  29451. }
  29452. ECDH.prototype.getPrivateKey = function (enc) {
  29453. return formatReturnValue(this.keys.getPrivate(), enc)
  29454. }
  29455. ECDH.prototype.setPublicKey = function (pub, enc) {
  29456. enc = enc || 'utf8'
  29457. if (!Buffer.isBuffer(pub)) {
  29458. pub = new Buffer(pub, enc)
  29459. }
  29460. this.keys._importPublic(pub)
  29461. return this
  29462. }
  29463. ECDH.prototype.setPrivateKey = function (priv, enc) {
  29464. enc = enc || 'utf8'
  29465. if (!Buffer.isBuffer(priv)) {
  29466. priv = new Buffer(priv, enc)
  29467. }
  29468. var _priv = new BN(priv)
  29469. _priv = _priv.toString(16)
  29470. this.keys = this.curve.genKeyPair()
  29471. this.keys._importPrivate(_priv)
  29472. return this
  29473. }
  29474. function formatReturnValue (bn, enc, len) {
  29475. if (!Array.isArray(bn)) {
  29476. bn = bn.toArray()
  29477. }
  29478. var buf = new Buffer(bn)
  29479. if (len && buf.length < len) {
  29480. var zeros = new Buffer(len - buf.length)
  29481. zeros.fill(0)
  29482. buf = Buffer.concat([zeros, buf])
  29483. }
  29484. if (!enc) {
  29485. return buf
  29486. } else {
  29487. return buf.toString(enc)
  29488. }
  29489. }
  29490. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ 35).Buffer))
  29491. /***/ }),
  29492. /* 180 */
  29493. /*!************************************************!*\
  29494. !*** ./node_modules/public-encrypt/browser.js ***!
  29495. \************************************************/
  29496. /*! no static exports found */
  29497. /***/ (function(module, exports, __webpack_require__) {
  29498. exports.publicEncrypt = __webpack_require__(/*! ./publicEncrypt */ 181)
  29499. exports.privateDecrypt = __webpack_require__(/*! ./privateDecrypt */ 185)
  29500. exports.privateEncrypt = function privateEncrypt (key, buf) {
  29501. return exports.publicEncrypt(key, buf, true)
  29502. }
  29503. exports.publicDecrypt = function publicDecrypt (key, buf) {
  29504. return exports.privateDecrypt(key, buf, true)
  29505. }
  29506. /***/ }),
  29507. /* 181 */
  29508. /*!******************************************************!*\
  29509. !*** ./node_modules/public-encrypt/publicEncrypt.js ***!
  29510. \******************************************************/
  29511. /*! no static exports found */
  29512. /***/ (function(module, exports, __webpack_require__) {
  29513. var parseKeys = __webpack_require__(/*! parse-asn1 */ 157)
  29514. var randomBytes = __webpack_require__(/*! randombytes */ 31)
  29515. var createHash = __webpack_require__(/*! create-hash */ 39)
  29516. var mgf = __webpack_require__(/*! ./mgf */ 182)
  29517. var xor = __webpack_require__(/*! ./xor */ 183)
  29518. var BN = __webpack_require__(/*! bn.js */ 116)
  29519. var withPublic = __webpack_require__(/*! ./withPublic */ 184)
  29520. var crt = __webpack_require__(/*! browserify-rsa */ 126)
  29521. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  29522. module.exports = function publicEncrypt (publicKey, msg, reverse) {
  29523. var padding
  29524. if (publicKey.padding) {
  29525. padding = publicKey.padding
  29526. } else if (reverse) {
  29527. padding = 1
  29528. } else {
  29529. padding = 4
  29530. }
  29531. var key = parseKeys(publicKey)
  29532. var paddedMsg
  29533. if (padding === 4) {
  29534. paddedMsg = oaep(key, msg)
  29535. } else if (padding === 1) {
  29536. paddedMsg = pkcs1(key, msg, reverse)
  29537. } else if (padding === 3) {
  29538. paddedMsg = new BN(msg)
  29539. if (paddedMsg.cmp(key.modulus) >= 0) {
  29540. throw new Error('data too long for modulus')
  29541. }
  29542. } else {
  29543. throw new Error('unknown padding')
  29544. }
  29545. if (reverse) {
  29546. return crt(paddedMsg, key)
  29547. } else {
  29548. return withPublic(paddedMsg, key)
  29549. }
  29550. }
  29551. function oaep (key, msg) {
  29552. var k = key.modulus.byteLength()
  29553. var mLen = msg.length
  29554. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  29555. var hLen = iHash.length
  29556. var hLen2 = 2 * hLen
  29557. if (mLen > k - hLen2 - 2) {
  29558. throw new Error('message too long')
  29559. }
  29560. var ps = Buffer.alloc(k - mLen - hLen2 - 2)
  29561. var dblen = k - hLen - 1
  29562. var seed = randomBytes(hLen)
  29563. var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen))
  29564. var maskedSeed = xor(seed, mgf(maskedDb, hLen))
  29565. return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k))
  29566. }
  29567. function pkcs1 (key, msg, reverse) {
  29568. var mLen = msg.length
  29569. var k = key.modulus.byteLength()
  29570. if (mLen > k - 11) {
  29571. throw new Error('message too long')
  29572. }
  29573. var ps
  29574. if (reverse) {
  29575. ps = Buffer.alloc(k - mLen - 3, 0xff)
  29576. } else {
  29577. ps = nonZero(k - mLen - 3)
  29578. }
  29579. return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k))
  29580. }
  29581. function nonZero (len) {
  29582. var out = Buffer.allocUnsafe(len)
  29583. var i = 0
  29584. var cache = randomBytes(len * 2)
  29585. var cur = 0
  29586. var num
  29587. while (i < len) {
  29588. if (cur === cache.length) {
  29589. cache = randomBytes(len * 2)
  29590. cur = 0
  29591. }
  29592. num = cache[cur++]
  29593. if (num) {
  29594. out[i++] = num
  29595. }
  29596. }
  29597. return out
  29598. }
  29599. /***/ }),
  29600. /* 182 */
  29601. /*!********************************************!*\
  29602. !*** ./node_modules/public-encrypt/mgf.js ***!
  29603. \********************************************/
  29604. /*! no static exports found */
  29605. /***/ (function(module, exports, __webpack_require__) {
  29606. var createHash = __webpack_require__(/*! create-hash */ 39)
  29607. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  29608. module.exports = function (seed, len) {
  29609. var t = Buffer.alloc(0)
  29610. var i = 0
  29611. var c
  29612. while (t.length < len) {
  29613. c = i2ops(i++)
  29614. t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()])
  29615. }
  29616. return t.slice(0, len)
  29617. }
  29618. function i2ops (c) {
  29619. var out = Buffer.allocUnsafe(4)
  29620. out.writeUInt32BE(c, 0)
  29621. return out
  29622. }
  29623. /***/ }),
  29624. /* 183 */
  29625. /*!********************************************!*\
  29626. !*** ./node_modules/public-encrypt/xor.js ***!
  29627. \********************************************/
  29628. /*! no static exports found */
  29629. /***/ (function(module, exports) {
  29630. module.exports = function xor (a, b) {
  29631. var len = a.length
  29632. var i = -1
  29633. while (++i < len) {
  29634. a[i] ^= b[i]
  29635. }
  29636. return a
  29637. }
  29638. /***/ }),
  29639. /* 184 */
  29640. /*!***************************************************!*\
  29641. !*** ./node_modules/public-encrypt/withPublic.js ***!
  29642. \***************************************************/
  29643. /*! no static exports found */
  29644. /***/ (function(module, exports, __webpack_require__) {
  29645. var BN = __webpack_require__(/*! bn.js */ 116)
  29646. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  29647. function withPublic (paddedMsg, key) {
  29648. return Buffer.from(paddedMsg
  29649. .toRed(BN.mont(key.modulus))
  29650. .redPow(new BN(key.publicExponent))
  29651. .fromRed()
  29652. .toArray())
  29653. }
  29654. module.exports = withPublic
  29655. /***/ }),
  29656. /* 185 */
  29657. /*!*******************************************************!*\
  29658. !*** ./node_modules/public-encrypt/privateDecrypt.js ***!
  29659. \*******************************************************/
  29660. /*! no static exports found */
  29661. /***/ (function(module, exports, __webpack_require__) {
  29662. var parseKeys = __webpack_require__(/*! parse-asn1 */ 157)
  29663. var mgf = __webpack_require__(/*! ./mgf */ 182)
  29664. var xor = __webpack_require__(/*! ./xor */ 183)
  29665. var BN = __webpack_require__(/*! bn.js */ 116)
  29666. var crt = __webpack_require__(/*! browserify-rsa */ 126)
  29667. var createHash = __webpack_require__(/*! create-hash */ 39)
  29668. var withPublic = __webpack_require__(/*! ./withPublic */ 184)
  29669. var Buffer = __webpack_require__(/*! safe-buffer */ 34).Buffer
  29670. module.exports = function privateDecrypt (privateKey, enc, reverse) {
  29671. var padding
  29672. if (privateKey.padding) {
  29673. padding = privateKey.padding
  29674. } else if (reverse) {
  29675. padding = 1
  29676. } else {
  29677. padding = 4
  29678. }
  29679. var key = parseKeys(privateKey)
  29680. var k = key.modulus.byteLength()
  29681. if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {
  29682. throw new Error('decryption error')
  29683. }
  29684. var msg
  29685. if (reverse) {
  29686. msg = withPublic(new BN(enc), key)
  29687. } else {
  29688. msg = crt(enc, key)
  29689. }
  29690. var zBuffer = Buffer.alloc(k - msg.length)
  29691. msg = Buffer.concat([zBuffer, msg], k)
  29692. if (padding === 4) {
  29693. return oaep(key, msg)
  29694. } else if (padding === 1) {
  29695. return pkcs1(key, msg, reverse)
  29696. } else if (padding === 3) {
  29697. return msg
  29698. } else {
  29699. throw new Error('unknown padding')
  29700. }
  29701. }
  29702. function oaep (key, msg) {
  29703. var k = key.modulus.byteLength()
  29704. var iHash = createHash('sha1').update(Buffer.alloc(0)).digest()
  29705. var hLen = iHash.length
  29706. if (msg[0] !== 0) {
  29707. throw new Error('decryption error')
  29708. }
  29709. var maskedSeed = msg.slice(1, hLen + 1)
  29710. var maskedDb = msg.slice(hLen + 1)
  29711. var seed = xor(maskedSeed, mgf(maskedDb, hLen))
  29712. var db = xor(maskedDb, mgf(seed, k - hLen - 1))
  29713. if (compare(iHash, db.slice(0, hLen))) {
  29714. throw new Error('decryption error')
  29715. }
  29716. var i = hLen
  29717. while (db[i] === 0) {
  29718. i++
  29719. }
  29720. if (db[i++] !== 1) {
  29721. throw new Error('decryption error')
  29722. }
  29723. return db.slice(i)
  29724. }
  29725. function pkcs1 (key, msg, reverse) {
  29726. var p1 = msg.slice(0, 2)
  29727. var i = 2
  29728. var status = 0
  29729. while (msg[i++] !== 0) {
  29730. if (i >= msg.length) {
  29731. status++
  29732. break
  29733. }
  29734. }
  29735. var ps = msg.slice(2, i - 1)
  29736. if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) {
  29737. status++
  29738. }
  29739. if (ps.length < 8) {
  29740. status++
  29741. }
  29742. if (status) {
  29743. throw new Error('decryption error')
  29744. }
  29745. return msg.slice(i)
  29746. }
  29747. function compare (a, b) {
  29748. a = Buffer.from(a)
  29749. b = Buffer.from(b)
  29750. var dif = 0
  29751. var len = a.length
  29752. if (a.length !== b.length) {
  29753. dif++
  29754. len = Math.min(a.length, b.length)
  29755. }
  29756. var i = -1
  29757. while (++i < len) {
  29758. dif += (a[i] ^ b[i])
  29759. }
  29760. return dif
  29761. }
  29762. /***/ }),
  29763. /* 186 */
  29764. /*!********************************************!*\
  29765. !*** ./node_modules/randomfill/browser.js ***!
  29766. \********************************************/
  29767. /*! no static exports found */
  29768. /***/ (function(module, exports, __webpack_require__) {
  29769. "use strict";
  29770. /* WEBPACK VAR INJECTION */(function(global, process) {
  29771. function oldBrowser () {
  29772. throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11')
  29773. }
  29774. var safeBuffer = __webpack_require__(/*! safe-buffer */ 34)
  29775. var randombytes = __webpack_require__(/*! randombytes */ 31)
  29776. var Buffer = safeBuffer.Buffer
  29777. var kBufferMaxLength = safeBuffer.kMaxLength
  29778. var crypto = global.crypto || global.msCrypto
  29779. var kMaxUint32 = Math.pow(2, 32) - 1
  29780. function assertOffset (offset, length) {
  29781. if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare
  29782. throw new TypeError('offset must be a number')
  29783. }
  29784. if (offset > kMaxUint32 || offset < 0) {
  29785. throw new TypeError('offset must be a uint32')
  29786. }
  29787. if (offset > kBufferMaxLength || offset > length) {
  29788. throw new RangeError('offset out of range')
  29789. }
  29790. }
  29791. function assertSize (size, offset, length) {
  29792. if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare
  29793. throw new TypeError('size must be a number')
  29794. }
  29795. if (size > kMaxUint32 || size < 0) {
  29796. throw new TypeError('size must be a uint32')
  29797. }
  29798. if (size + offset > length || size > kBufferMaxLength) {
  29799. throw new RangeError('buffer too small')
  29800. }
  29801. }
  29802. if ((crypto && crypto.getRandomValues) || !process.browser) {
  29803. exports.randomFill = randomFill
  29804. exports.randomFillSync = randomFillSync
  29805. } else {
  29806. exports.randomFill = oldBrowser
  29807. exports.randomFillSync = oldBrowser
  29808. }
  29809. function randomFill (buf, offset, size, cb) {
  29810. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  29811. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  29812. }
  29813. if (typeof offset === 'function') {
  29814. cb = offset
  29815. offset = 0
  29816. size = buf.length
  29817. } else if (typeof size === 'function') {
  29818. cb = size
  29819. size = buf.length - offset
  29820. } else if (typeof cb !== 'function') {
  29821. throw new TypeError('"cb" argument must be a function')
  29822. }
  29823. assertOffset(offset, buf.length)
  29824. assertSize(size, offset, buf.length)
  29825. return actualFill(buf, offset, size, cb)
  29826. }
  29827. function actualFill (buf, offset, size, cb) {
  29828. if (process.browser) {
  29829. var ourBuf = buf.buffer
  29830. var uint = new Uint8Array(ourBuf, offset, size)
  29831. crypto.getRandomValues(uint)
  29832. if (cb) {
  29833. process.nextTick(function () {
  29834. cb(null, buf)
  29835. })
  29836. return
  29837. }
  29838. return buf
  29839. }
  29840. if (cb) {
  29841. randombytes(size, function (err, bytes) {
  29842. if (err) {
  29843. return cb(err)
  29844. }
  29845. bytes.copy(buf, offset)
  29846. cb(null, buf)
  29847. })
  29848. return
  29849. }
  29850. var bytes = randombytes(size)
  29851. bytes.copy(buf, offset)
  29852. return buf
  29853. }
  29854. function randomFillSync (buf, offset, size) {
  29855. if (typeof offset === 'undefined') {
  29856. offset = 0
  29857. }
  29858. if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
  29859. throw new TypeError('"buf" argument must be a Buffer or Uint8Array')
  29860. }
  29861. assertOffset(offset, buf.length)
  29862. if (size === undefined) size = buf.length - offset
  29863. assertSize(size, offset, buf.length)
  29864. return actualFill(buf, offset, size)
  29865. }
  29866. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 32)))
  29867. /***/ }),
  29868. /* 187 */,
  29869. /* 188 */,
  29870. /* 189 */,
  29871. /* 190 */,
  29872. /* 191 */,
  29873. /* 192 */,
  29874. /* 193 */,
  29875. /* 194 */,
  29876. /* 195 */,
  29877. /* 196 */,
  29878. /* 197 */,
  29879. /* 198 */,
  29880. /* 199 */
  29881. /*!***********************************************************!*\
  29882. !*** F:/uniapp/sqxp-uniapp/node_modules/crypto-js/md5.js ***!
  29883. \***********************************************************/
  29884. /*! no static exports found */
  29885. /***/ (function(module, exports, __webpack_require__) {
  29886. ;(function (root, factory) {
  29887. if (true) {
  29888. // CommonJS
  29889. module.exports = exports = factory(__webpack_require__(/*! ./core */ 29));
  29890. } else
  29891. {}
  29892. })(this, function (CryptoJS) {
  29893. (function (Math) {
  29894. // Shortcuts
  29895. var C = CryptoJS;
  29896. var C_lib = C.lib;
  29897. var WordArray = C_lib.WordArray;
  29898. var Hasher = C_lib.Hasher;
  29899. var C_algo = C.algo;
  29900. // Constants table
  29901. var T = [];
  29902. // Compute constants
  29903. (function () {
  29904. for (var i = 0; i < 64; i++) {
  29905. T[i] = Math.abs(Math.sin(i + 1)) * 0x100000000 | 0;
  29906. }
  29907. })();
  29908. /**
  29909. * MD5 hash algorithm.
  29910. */
  29911. var MD5 = C_algo.MD5 = Hasher.extend({
  29912. _doReset: function _doReset() {
  29913. this._hash = new WordArray.init([
  29914. 0x67452301, 0xefcdab89,
  29915. 0x98badcfe, 0x10325476]);
  29916. },
  29917. _doProcessBlock: function _doProcessBlock(M, offset) {
  29918. // Swap endian
  29919. for (var i = 0; i < 16; i++) {
  29920. // Shortcuts
  29921. var offset_i = offset + i;
  29922. var M_offset_i = M[offset_i];
  29923. M[offset_i] =
  29924. (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff |
  29925. (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00;
  29926. }
  29927. // Shortcuts
  29928. var H = this._hash.words;
  29929. var M_offset_0 = M[offset + 0];
  29930. var M_offset_1 = M[offset + 1];
  29931. var M_offset_2 = M[offset + 2];
  29932. var M_offset_3 = M[offset + 3];
  29933. var M_offset_4 = M[offset + 4];
  29934. var M_offset_5 = M[offset + 5];
  29935. var M_offset_6 = M[offset + 6];
  29936. var M_offset_7 = M[offset + 7];
  29937. var M_offset_8 = M[offset + 8];
  29938. var M_offset_9 = M[offset + 9];
  29939. var M_offset_10 = M[offset + 10];
  29940. var M_offset_11 = M[offset + 11];
  29941. var M_offset_12 = M[offset + 12];
  29942. var M_offset_13 = M[offset + 13];
  29943. var M_offset_14 = M[offset + 14];
  29944. var M_offset_15 = M[offset + 15];
  29945. // Working varialbes
  29946. var a = H[0];
  29947. var b = H[1];
  29948. var c = H[2];
  29949. var d = H[3];
  29950. // Computation
  29951. a = FF(a, b, c, d, M_offset_0, 7, T[0]);
  29952. d = FF(d, a, b, c, M_offset_1, 12, T[1]);
  29953. c = FF(c, d, a, b, M_offset_2, 17, T[2]);
  29954. b = FF(b, c, d, a, M_offset_3, 22, T[3]);
  29955. a = FF(a, b, c, d, M_offset_4, 7, T[4]);
  29956. d = FF(d, a, b, c, M_offset_5, 12, T[5]);
  29957. c = FF(c, d, a, b, M_offset_6, 17, T[6]);
  29958. b = FF(b, c, d, a, M_offset_7, 22, T[7]);
  29959. a = FF(a, b, c, d, M_offset_8, 7, T[8]);
  29960. d = FF(d, a, b, c, M_offset_9, 12, T[9]);
  29961. c = FF(c, d, a, b, M_offset_10, 17, T[10]);
  29962. b = FF(b, c, d, a, M_offset_11, 22, T[11]);
  29963. a = FF(a, b, c, d, M_offset_12, 7, T[12]);
  29964. d = FF(d, a, b, c, M_offset_13, 12, T[13]);
  29965. c = FF(c, d, a, b, M_offset_14, 17, T[14]);
  29966. b = FF(b, c, d, a, M_offset_15, 22, T[15]);
  29967. a = GG(a, b, c, d, M_offset_1, 5, T[16]);
  29968. d = GG(d, a, b, c, M_offset_6, 9, T[17]);
  29969. c = GG(c, d, a, b, M_offset_11, 14, T[18]);
  29970. b = GG(b, c, d, a, M_offset_0, 20, T[19]);
  29971. a = GG(a, b, c, d, M_offset_5, 5, T[20]);
  29972. d = GG(d, a, b, c, M_offset_10, 9, T[21]);
  29973. c = GG(c, d, a, b, M_offset_15, 14, T[22]);
  29974. b = GG(b, c, d, a, M_offset_4, 20, T[23]);
  29975. a = GG(a, b, c, d, M_offset_9, 5, T[24]);
  29976. d = GG(d, a, b, c, M_offset_14, 9, T[25]);
  29977. c = GG(c, d, a, b, M_offset_3, 14, T[26]);
  29978. b = GG(b, c, d, a, M_offset_8, 20, T[27]);
  29979. a = GG(a, b, c, d, M_offset_13, 5, T[28]);
  29980. d = GG(d, a, b, c, M_offset_2, 9, T[29]);
  29981. c = GG(c, d, a, b, M_offset_7, 14, T[30]);
  29982. b = GG(b, c, d, a, M_offset_12, 20, T[31]);
  29983. a = HH(a, b, c, d, M_offset_5, 4, T[32]);
  29984. d = HH(d, a, b, c, M_offset_8, 11, T[33]);
  29985. c = HH(c, d, a, b, M_offset_11, 16, T[34]);
  29986. b = HH(b, c, d, a, M_offset_14, 23, T[35]);
  29987. a = HH(a, b, c, d, M_offset_1, 4, T[36]);
  29988. d = HH(d, a, b, c, M_offset_4, 11, T[37]);
  29989. c = HH(c, d, a, b, M_offset_7, 16, T[38]);
  29990. b = HH(b, c, d, a, M_offset_10, 23, T[39]);
  29991. a = HH(a, b, c, d, M_offset_13, 4, T[40]);
  29992. d = HH(d, a, b, c, M_offset_0, 11, T[41]);
  29993. c = HH(c, d, a, b, M_offset_3, 16, T[42]);
  29994. b = HH(b, c, d, a, M_offset_6, 23, T[43]);
  29995. a = HH(a, b, c, d, M_offset_9, 4, T[44]);
  29996. d = HH(d, a, b, c, M_offset_12, 11, T[45]);
  29997. c = HH(c, d, a, b, M_offset_15, 16, T[46]);
  29998. b = HH(b, c, d, a, M_offset_2, 23, T[47]);
  29999. a = II(a, b, c, d, M_offset_0, 6, T[48]);
  30000. d = II(d, a, b, c, M_offset_7, 10, T[49]);
  30001. c = II(c, d, a, b, M_offset_14, 15, T[50]);
  30002. b = II(b, c, d, a, M_offset_5, 21, T[51]);
  30003. a = II(a, b, c, d, M_offset_12, 6, T[52]);
  30004. d = II(d, a, b, c, M_offset_3, 10, T[53]);
  30005. c = II(c, d, a, b, M_offset_10, 15, T[54]);
  30006. b = II(b, c, d, a, M_offset_1, 21, T[55]);
  30007. a = II(a, b, c, d, M_offset_8, 6, T[56]);
  30008. d = II(d, a, b, c, M_offset_15, 10, T[57]);
  30009. c = II(c, d, a, b, M_offset_6, 15, T[58]);
  30010. b = II(b, c, d, a, M_offset_13, 21, T[59]);
  30011. a = II(a, b, c, d, M_offset_4, 6, T[60]);
  30012. d = II(d, a, b, c, M_offset_11, 10, T[61]);
  30013. c = II(c, d, a, b, M_offset_2, 15, T[62]);
  30014. b = II(b, c, d, a, M_offset_9, 21, T[63]);
  30015. // Intermediate hash value
  30016. H[0] = H[0] + a | 0;
  30017. H[1] = H[1] + b | 0;
  30018. H[2] = H[2] + c | 0;
  30019. H[3] = H[3] + d | 0;
  30020. },
  30021. _doFinalize: function _doFinalize() {
  30022. // Shortcuts
  30023. var data = this._data;
  30024. var dataWords = data.words;
  30025. var nBitsTotal = this._nDataBytes * 8;
  30026. var nBitsLeft = data.sigBytes * 8;
  30027. // Add padding
  30028. dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;
  30029. var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
  30030. var nBitsTotalL = nBitsTotal;
  30031. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] =
  30032. (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 0x00ff00ff |
  30033. (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 0xff00ff00;
  30034. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] =
  30035. (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 0x00ff00ff |
  30036. (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 0xff00ff00;
  30037. data.sigBytes = (dataWords.length + 1) * 4;
  30038. // Hash final blocks
  30039. this._process();
  30040. // Shortcuts
  30041. var hash = this._hash;
  30042. var H = hash.words;
  30043. // Swap endian
  30044. for (var i = 0; i < 4; i++) {
  30045. // Shortcut
  30046. var H_i = H[i];
  30047. H[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff |
  30048. (H_i << 24 | H_i >>> 8) & 0xff00ff00;
  30049. }
  30050. // Return final computed hash
  30051. return hash;
  30052. },
  30053. clone: function clone() {
  30054. var clone = Hasher.clone.call(this);
  30055. clone._hash = this._hash.clone();
  30056. return clone;
  30057. } });
  30058. function FF(a, b, c, d, x, s, t) {
  30059. var n = a + (b & c | ~b & d) + x + t;
  30060. return (n << s | n >>> 32 - s) + b;
  30061. }
  30062. function GG(a, b, c, d, x, s, t) {
  30063. var n = a + (b & d | c & ~d) + x + t;
  30064. return (n << s | n >>> 32 - s) + b;
  30065. }
  30066. function HH(a, b, c, d, x, s, t) {
  30067. var n = a + (b ^ c ^ d) + x + t;
  30068. return (n << s | n >>> 32 - s) + b;
  30069. }
  30070. function II(a, b, c, d, x, s, t) {
  30071. var n = a + (c ^ (b | ~d)) + x + t;
  30072. return (n << s | n >>> 32 - s) + b;
  30073. }
  30074. /**
  30075. * Shortcut function to the hasher's object interface.
  30076. *
  30077. * @param {WordArray|string} message The message to hash.
  30078. *
  30079. * @return {WordArray} The hash.
  30080. *
  30081. * @static
  30082. *
  30083. * @example
  30084. *
  30085. * var hash = CryptoJS.MD5('message');
  30086. * var hash = CryptoJS.MD5(wordArray);
  30087. */
  30088. C.MD5 = Hasher._createHelper(MD5);
  30089. /**
  30090. * Shortcut function to the HMAC's object interface.
  30091. *
  30092. * @param {WordArray|string} message The message to hash.
  30093. * @param {WordArray|string} key The secret key.
  30094. *
  30095. * @return {WordArray} The HMAC.
  30096. *
  30097. * @static
  30098. *
  30099. * @example
  30100. *
  30101. * var hmac = CryptoJS.HmacMD5(message, key);
  30102. */
  30103. C.HmacMD5 = Hasher._createHmacHelper(MD5);
  30104. })(Math);
  30105. return CryptoJS.MD5;
  30106. });
  30107. /***/ }),
  30108. /* 200 */,
  30109. /* 201 */,
  30110. /* 202 */,
  30111. /* 203 */,
  30112. /* 204 */,
  30113. /* 205 */,
  30114. /* 206 */,
  30115. /* 207 */,
  30116. /* 208 */,
  30117. /* 209 */,
  30118. /* 210 */,
  30119. /* 211 */,
  30120. /* 212 */,
  30121. /* 213 */,
  30122. /* 214 */,
  30123. /* 215 */,
  30124. /* 216 */,
  30125. /* 217 */,
  30126. /* 218 */,
  30127. /* 219 */,
  30128. /* 220 */,
  30129. /* 221 */,
  30130. /* 222 */,
  30131. /* 223 */,
  30132. /* 224 */
  30133. /*!*******************************************!*\
  30134. !*** F:/uniapp/sqxp-uniapp/api/answer.js ***!
  30135. \*******************************************/
  30136. /*! no static exports found */
  30137. /***/ (function(module, exports, __webpack_require__) {
  30138. "use strict";
  30139. Object.defineProperty(exports, "__esModule", { value: true });exports.questionList = questionList;exports.questionListRandom = questionListRandom;exports.questionErrorList = questionErrorList;exports.questionErrorAdd = questionErrorAdd;exports.questionErrorDel = questionErrorDel;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  30140. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  30141. // 获取题库列表
  30142. function questionList(params) {
  30143. return (0, _request.default)({
  30144. url: _baseurl.baseUrl + '/student/question/info/getQuestionInfoList',
  30145. method: 'get',
  30146. params: params });
  30147. }
  30148. // 获取随机题库列表
  30149. function questionListRandom(params) {
  30150. return (0, _request.default)({
  30151. url: _baseurl.baseUrl + '/student/question/info/getRandQuestionInfoList',
  30152. method: 'get',
  30153. params: params });
  30154. }
  30155. // 获取错题收藏列表
  30156. function questionErrorList(params) {
  30157. return (0, _request.default)({
  30158. url: _baseurl.baseUrl + '/student/question/error/getQuestionErrorList',
  30159. method: 'get',
  30160. params: params });
  30161. }
  30162. // 新增错题
  30163. function questionErrorAdd(id) {
  30164. return (0, _request.default)({
  30165. url: _baseurl.baseUrl + '/student/question/error',
  30166. method: 'post',
  30167. data: {
  30168. questionId: id } });
  30169. }
  30170. // 删除错题
  30171. function questionErrorDel(ids) {
  30172. return (0, _request.default)({
  30173. url: _baseurl.baseUrl + "/student/question/error/".concat(ids),
  30174. method: 'delete' });
  30175. }
  30176. /***/ }),
  30177. /* 225 */,
  30178. /* 226 */,
  30179. /* 227 */,
  30180. /* 228 */,
  30181. /* 229 */,
  30182. /* 230 */,
  30183. /* 231 */,
  30184. /* 232 */,
  30185. /* 233 */,
  30186. /* 234 */,
  30187. /* 235 */,
  30188. /* 236 */,
  30189. /* 237 */,
  30190. /* 238 */,
  30191. /* 239 */,
  30192. /* 240 */,
  30193. /* 241 */,
  30194. /* 242 */,
  30195. /* 243 */,
  30196. /* 244 */,
  30197. /* 245 */,
  30198. /* 246 */,
  30199. /* 247 */,
  30200. /* 248 */,
  30201. /* 249 */
  30202. /*!****************************************************************!*\
  30203. !*** F:/uniapp/sqxp-uniapp/wxcomponents/vant/dialog/dialog.js ***!
  30204. \****************************************************************/
  30205. /*! no static exports found */
  30206. /***/ (function(module, exports, __webpack_require__) {
  30207. "use strict";
  30208. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var queue = [];
  30209. var defaultOptions = {
  30210. show: false,
  30211. title: '',
  30212. width: null,
  30213. theme: 'default',
  30214. message: '',
  30215. zIndex: 100,
  30216. overlay: true,
  30217. selector: '#van-dialog',
  30218. className: '',
  30219. asyncClose: false,
  30220. beforeClose: null,
  30221. transition: 'scale',
  30222. customStyle: '',
  30223. messageAlign: '',
  30224. overlayStyle: '',
  30225. confirmButtonText: '确认',
  30226. cancelButtonText: '取消',
  30227. showConfirmButton: true,
  30228. showCancelButton: false,
  30229. closeOnClickOverlay: false,
  30230. confirmButtonOpenType: '' };
  30231. var currentOptions = Object.assign({}, defaultOptions);
  30232. function getContext() {
  30233. var pages = getCurrentPages();
  30234. return pages[pages.length - 1];
  30235. }
  30236. var Dialog = function Dialog(options) {
  30237. options = Object.assign(Object.assign({}, currentOptions), options);
  30238. return new Promise(function (resolve, reject) {
  30239. var context = options.context || getContext();
  30240. var dialog = context.selectComponent(options.selector);
  30241. delete options.context;
  30242. delete options.selector;
  30243. if (dialog) {
  30244. dialog.setData(
  30245. Object.assign(
  30246. {
  30247. callback: function callback(action, instance) {
  30248. action === 'confirm' ? resolve(instance) : reject(instance);
  30249. } },
  30250. options));
  30251. wx.nextTick(function () {
  30252. dialog.setData({ show: true });
  30253. });
  30254. queue.push(dialog);
  30255. } else {
  30256. console.warn(
  30257. '未找到 van-dialog 节点,请确认 selector 及 context 是否正确');
  30258. }
  30259. });
  30260. };
  30261. Dialog.alert = function (options) {return Dialog(options);};
  30262. Dialog.confirm = function (options) {return (
  30263. Dialog(Object.assign({ showCancelButton: true }, options)));};
  30264. Dialog.close = function () {
  30265. queue.forEach(function (dialog) {
  30266. dialog.close();
  30267. });
  30268. queue = [];
  30269. };
  30270. Dialog.stopLoading = function () {
  30271. queue.forEach(function (dialog) {
  30272. dialog.stopLoading();
  30273. });
  30274. };
  30275. Dialog.currentOptions = currentOptions;
  30276. Dialog.defaultOptions = defaultOptions;
  30277. Dialog.setDefaultOptions = function (options) {
  30278. currentOptions = Object.assign(Object.assign({}, currentOptions), options);
  30279. Dialog.currentOptions = currentOptions;
  30280. };
  30281. Dialog.resetDefaultOptions = function () {
  30282. currentOptions = Object.assign({}, defaultOptions);
  30283. Dialog.currentOptions = currentOptions;
  30284. };
  30285. Dialog.resetDefaultOptions();var _default =
  30286. Dialog;exports.default = _default;
  30287. /***/ }),
  30288. /* 250 */,
  30289. /* 251 */,
  30290. /* 252 */,
  30291. /* 253 */,
  30292. /* 254 */,
  30293. /* 255 */,
  30294. /* 256 */,
  30295. /* 257 */,
  30296. /* 258 */,
  30297. /* 259 */,
  30298. /* 260 */,
  30299. /* 261 */,
  30300. /* 262 */,
  30301. /* 263 */,
  30302. /* 264 */,
  30303. /* 265 */,
  30304. /* 266 */,
  30305. /* 267 */,
  30306. /* 268 */,
  30307. /* 269 */,
  30308. /* 270 */,
  30309. /* 271 */,
  30310. /* 272 */
  30311. /*!*******************************************!*\
  30312. !*** F:/uniapp/sqxp-uniapp/api/cinema.js ***!
  30313. \*******************************************/
  30314. /*! no static exports found */
  30315. /***/ (function(module, exports, __webpack_require__) {
  30316. "use strict";
  30317. Object.defineProperty(exports, "__esModule", { value: true });exports.getFilmDiscount = getFilmDiscount;exports.getSoonList = getSoonList;exports.getHotList = getHotList;exports.getCityList = getCityList;exports.getCinemaList = getCinemaList;exports.getShowList = getShowList;exports.getScheduleList = getScheduleList;exports.getInfo = getInfo;exports.getSeat = getSeat;exports.prepareOrder = prepareOrder;exports.getfilmInfo = getfilmInfo;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  30318. var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ 273));
  30319. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  30320. // 获取电影后台折扣参数
  30321. function getFilmDiscount(data) {
  30322. return (0, _request.default)({
  30323. url: _baseurl.baseUrl + "/system/config/configKey/film_discount" });
  30324. }
  30325. // 获取即将上映电影列表
  30326. function getSoonList(data) {
  30327. return (0, _request.default)({
  30328. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30329. method: 'post',
  30330. data: {
  30331. url: 'movieapi/movie-info/get-soon-list',
  30332. paramData: _qs.default.stringify(data) } });
  30333. }
  30334. // 获取正在热映电影列表
  30335. function getHotList(data) {
  30336. return (0, _request.default)({
  30337. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30338. method: 'post',
  30339. data: {
  30340. url: 'movieapi/movie-info/get-hot-list',
  30341. paramData: _qs.default.stringify(data) } });
  30342. }
  30343. // 获取城市列表
  30344. function getCityList(data) {
  30345. return (0, _request.default)({
  30346. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30347. method: 'post',
  30348. data: {
  30349. url: 'movieapi/movie-info/get-city-list',
  30350. paramData: _qs.default.stringify(data) } });
  30351. }
  30352. // 获取影院列表
  30353. function getCinemaList(data) {
  30354. return (0, _request.default)({
  30355. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30356. method: 'post',
  30357. data: {
  30358. url: 'movieapi/movie-info/get-cinema-list',
  30359. paramData: _qs.default.stringify(data) } });
  30360. }
  30361. // 包含某电影的影院
  30362. function getShowList(data) {
  30363. return (0, _request.default)({
  30364. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30365. method: 'post',
  30366. data: {
  30367. url: 'movieapi/movie-info/get-show-list',
  30368. paramData: _qs.default.stringify(data) } });
  30369. }
  30370. // 某电影在某影院的场次排期
  30371. function getScheduleList(data) {
  30372. return (0, _request.default)({
  30373. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30374. method: 'post',
  30375. data: {
  30376. url: 'movieapi/movie-info/get-schedule-list',
  30377. paramData: _qs.default.stringify(data) } });
  30378. }
  30379. // 查账户余额
  30380. function getInfo(data) {
  30381. return (0, _request.default)({
  30382. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30383. method: 'post',
  30384. data: {
  30385. url: 'api/user/info',
  30386. paramData: _qs.default.stringify(data) } });
  30387. }
  30388. // 某次电影的座位
  30389. function getSeat(data) {
  30390. return (0, _request.default)({
  30391. url: _baseurl.baseUrl + '/student/film/wxpay/fileCommonApi',
  30392. method: 'post',
  30393. data: {
  30394. url: 'movieapi/movie-info/get-seat',
  30395. paramData: _qs.default.stringify(data) } });
  30396. }
  30397. // 某次电影的座位
  30398. function prepareOrder(data) {
  30399. return (0, _request.default)({
  30400. url: _baseurl.baseUrl + '/student/film/wxpay/prepareOrder',
  30401. method: 'post',
  30402. data: data });
  30403. }
  30404. // 查某电影详情
  30405. function getfilmInfo(data) {
  30406. return (0, _request.default)({
  30407. url: 'https://yp-api.taototo.cn/yp-api/movie/film/detail',
  30408. method: 'post',
  30409. header: {
  30410. 'content-type': 'application/x-www-form-urlencoded' },
  30411. data: _objectSpread({
  30412. ci: 98 },
  30413. data) });
  30414. }
  30415. /***/ }),
  30416. /* 273 */
  30417. /*!**************************************!*\
  30418. !*** ./node_modules/qs/lib/index.js ***!
  30419. \**************************************/
  30420. /*! no static exports found */
  30421. /***/ (function(module, exports, __webpack_require__) {
  30422. "use strict";
  30423. var stringify = __webpack_require__(/*! ./stringify */ 274);
  30424. var parse = __webpack_require__(/*! ./parse */ 277);
  30425. var formats = __webpack_require__(/*! ./formats */ 276);
  30426. module.exports = {
  30427. formats: formats,
  30428. parse: parse,
  30429. stringify: stringify
  30430. };
  30431. /***/ }),
  30432. /* 274 */
  30433. /*!******************************************!*\
  30434. !*** ./node_modules/qs/lib/stringify.js ***!
  30435. \******************************************/
  30436. /*! no static exports found */
  30437. /***/ (function(module, exports, __webpack_require__) {
  30438. "use strict";
  30439. var utils = __webpack_require__(/*! ./utils */ 275);
  30440. var formats = __webpack_require__(/*! ./formats */ 276);
  30441. var arrayPrefixGenerators = {
  30442. brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
  30443. return prefix + '[]';
  30444. },
  30445. indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
  30446. return prefix + '[' + key + ']';
  30447. },
  30448. repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
  30449. return prefix;
  30450. }
  30451. };
  30452. var toISO = Date.prototype.toISOString;
  30453. var defaults = {
  30454. delimiter: '&',
  30455. encode: true,
  30456. encoder: utils.encode,
  30457. encodeValuesOnly: false,
  30458. serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
  30459. return toISO.call(date);
  30460. },
  30461. skipNulls: false,
  30462. strictNullHandling: false
  30463. };
  30464. var stringify = function stringify( // eslint-disable-line func-name-matching
  30465. object,
  30466. prefix,
  30467. generateArrayPrefix,
  30468. strictNullHandling,
  30469. skipNulls,
  30470. encoder,
  30471. filter,
  30472. sort,
  30473. allowDots,
  30474. serializeDate,
  30475. formatter,
  30476. encodeValuesOnly
  30477. ) {
  30478. var obj = object;
  30479. if (typeof filter === 'function') {
  30480. obj = filter(prefix, obj);
  30481. } else if (obj instanceof Date) {
  30482. obj = serializeDate(obj);
  30483. } else if (obj === null) {
  30484. if (strictNullHandling) {
  30485. return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
  30486. }
  30487. obj = '';
  30488. }
  30489. if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
  30490. if (encoder) {
  30491. var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
  30492. return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
  30493. }
  30494. return [formatter(prefix) + '=' + formatter(String(obj))];
  30495. }
  30496. var values = [];
  30497. if (typeof obj === 'undefined') {
  30498. return values;
  30499. }
  30500. var objKeys;
  30501. if (Array.isArray(filter)) {
  30502. objKeys = filter;
  30503. } else {
  30504. var keys = Object.keys(obj);
  30505. objKeys = sort ? keys.sort(sort) : keys;
  30506. }
  30507. for (var i = 0; i < objKeys.length; ++i) {
  30508. var key = objKeys[i];
  30509. if (skipNulls && obj[key] === null) {
  30510. continue;
  30511. }
  30512. if (Array.isArray(obj)) {
  30513. values = values.concat(stringify(
  30514. obj[key],
  30515. generateArrayPrefix(prefix, key),
  30516. generateArrayPrefix,
  30517. strictNullHandling,
  30518. skipNulls,
  30519. encoder,
  30520. filter,
  30521. sort,
  30522. allowDots,
  30523. serializeDate,
  30524. formatter,
  30525. encodeValuesOnly
  30526. ));
  30527. } else {
  30528. values = values.concat(stringify(
  30529. obj[key],
  30530. prefix + (allowDots ? '.' + key : '[' + key + ']'),
  30531. generateArrayPrefix,
  30532. strictNullHandling,
  30533. skipNulls,
  30534. encoder,
  30535. filter,
  30536. sort,
  30537. allowDots,
  30538. serializeDate,
  30539. formatter,
  30540. encodeValuesOnly
  30541. ));
  30542. }
  30543. }
  30544. return values;
  30545. };
  30546. module.exports = function (object, opts) {
  30547. var obj = object;
  30548. var options = opts ? utils.assign({}, opts) : {};
  30549. if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
  30550. throw new TypeError('Encoder has to be a function.');
  30551. }
  30552. var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
  30553. var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
  30554. var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
  30555. var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
  30556. var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
  30557. var sort = typeof options.sort === 'function' ? options.sort : null;
  30558. var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
  30559. var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
  30560. var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
  30561. if (typeof options.format === 'undefined') {
  30562. options.format = formats['default'];
  30563. } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
  30564. throw new TypeError('Unknown format option provided.');
  30565. }
  30566. var formatter = formats.formatters[options.format];
  30567. var objKeys;
  30568. var filter;
  30569. if (typeof options.filter === 'function') {
  30570. filter = options.filter;
  30571. obj = filter('', obj);
  30572. } else if (Array.isArray(options.filter)) {
  30573. filter = options.filter;
  30574. objKeys = filter;
  30575. }
  30576. var keys = [];
  30577. if (typeof obj !== 'object' || obj === null) {
  30578. return '';
  30579. }
  30580. var arrayFormat;
  30581. if (options.arrayFormat in arrayPrefixGenerators) {
  30582. arrayFormat = options.arrayFormat;
  30583. } else if ('indices' in options) {
  30584. arrayFormat = options.indices ? 'indices' : 'repeat';
  30585. } else {
  30586. arrayFormat = 'indices';
  30587. }
  30588. var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
  30589. if (!objKeys) {
  30590. objKeys = Object.keys(obj);
  30591. }
  30592. if (sort) {
  30593. objKeys.sort(sort);
  30594. }
  30595. for (var i = 0; i < objKeys.length; ++i) {
  30596. var key = objKeys[i];
  30597. if (skipNulls && obj[key] === null) {
  30598. continue;
  30599. }
  30600. keys = keys.concat(stringify(
  30601. obj[key],
  30602. key,
  30603. generateArrayPrefix,
  30604. strictNullHandling,
  30605. skipNulls,
  30606. encode ? encoder : null,
  30607. filter,
  30608. sort,
  30609. allowDots,
  30610. serializeDate,
  30611. formatter,
  30612. encodeValuesOnly
  30613. ));
  30614. }
  30615. var joined = keys.join(delimiter);
  30616. var prefix = options.addQueryPrefix === true ? '?' : '';
  30617. return joined.length > 0 ? prefix + joined : '';
  30618. };
  30619. /***/ }),
  30620. /* 275 */
  30621. /*!**************************************!*\
  30622. !*** ./node_modules/qs/lib/utils.js ***!
  30623. \**************************************/
  30624. /*! no static exports found */
  30625. /***/ (function(module, exports, __webpack_require__) {
  30626. "use strict";
  30627. var has = Object.prototype.hasOwnProperty;
  30628. var hexTable = (function () {
  30629. var array = [];
  30630. for (var i = 0; i < 256; ++i) {
  30631. array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
  30632. }
  30633. return array;
  30634. }());
  30635. var compactQueue = function compactQueue(queue) {
  30636. var obj;
  30637. while (queue.length) {
  30638. var item = queue.pop();
  30639. obj = item.obj[item.prop];
  30640. if (Array.isArray(obj)) {
  30641. var compacted = [];
  30642. for (var j = 0; j < obj.length; ++j) {
  30643. if (typeof obj[j] !== 'undefined') {
  30644. compacted.push(obj[j]);
  30645. }
  30646. }
  30647. item.obj[item.prop] = compacted;
  30648. }
  30649. }
  30650. return obj;
  30651. };
  30652. var arrayToObject = function arrayToObject(source, options) {
  30653. var obj = options && options.plainObjects ? Object.create(null) : {};
  30654. for (var i = 0; i < source.length; ++i) {
  30655. if (typeof source[i] !== 'undefined') {
  30656. obj[i] = source[i];
  30657. }
  30658. }
  30659. return obj;
  30660. };
  30661. var merge = function merge(target, source, options) {
  30662. if (!source) {
  30663. return target;
  30664. }
  30665. if (typeof source !== 'object') {
  30666. if (Array.isArray(target)) {
  30667. target.push(source);
  30668. } else if (typeof target === 'object') {
  30669. if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
  30670. target[source] = true;
  30671. }
  30672. } else {
  30673. return [target, source];
  30674. }
  30675. return target;
  30676. }
  30677. if (typeof target !== 'object') {
  30678. return [target].concat(source);
  30679. }
  30680. var mergeTarget = target;
  30681. if (Array.isArray(target) && !Array.isArray(source)) {
  30682. mergeTarget = arrayToObject(target, options);
  30683. }
  30684. if (Array.isArray(target) && Array.isArray(source)) {
  30685. source.forEach(function (item, i) {
  30686. if (has.call(target, i)) {
  30687. if (target[i] && typeof target[i] === 'object') {
  30688. target[i] = merge(target[i], item, options);
  30689. } else {
  30690. target.push(item);
  30691. }
  30692. } else {
  30693. target[i] = item;
  30694. }
  30695. });
  30696. return target;
  30697. }
  30698. return Object.keys(source).reduce(function (acc, key) {
  30699. var value = source[key];
  30700. if (has.call(acc, key)) {
  30701. acc[key] = merge(acc[key], value, options);
  30702. } else {
  30703. acc[key] = value;
  30704. }
  30705. return acc;
  30706. }, mergeTarget);
  30707. };
  30708. var assign = function assignSingleSource(target, source) {
  30709. return Object.keys(source).reduce(function (acc, key) {
  30710. acc[key] = source[key];
  30711. return acc;
  30712. }, target);
  30713. };
  30714. var decode = function (str) {
  30715. try {
  30716. return decodeURIComponent(str.replace(/\+/g, ' '));
  30717. } catch (e) {
  30718. return str;
  30719. }
  30720. };
  30721. var encode = function encode(str) {
  30722. // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
  30723. // It has been adapted here for stricter adherence to RFC 3986
  30724. if (str.length === 0) {
  30725. return str;
  30726. }
  30727. var string = typeof str === 'string' ? str : String(str);
  30728. var out = '';
  30729. for (var i = 0; i < string.length; ++i) {
  30730. var c = string.charCodeAt(i);
  30731. if (
  30732. c === 0x2D // -
  30733. || c === 0x2E // .
  30734. || c === 0x5F // _
  30735. || c === 0x7E // ~
  30736. || (c >= 0x30 && c <= 0x39) // 0-9
  30737. || (c >= 0x41 && c <= 0x5A) // a-z
  30738. || (c >= 0x61 && c <= 0x7A) // A-Z
  30739. ) {
  30740. out += string.charAt(i);
  30741. continue;
  30742. }
  30743. if (c < 0x80) {
  30744. out = out + hexTable[c];
  30745. continue;
  30746. }
  30747. if (c < 0x800) {
  30748. out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
  30749. continue;
  30750. }
  30751. if (c < 0xD800 || c >= 0xE000) {
  30752. out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
  30753. continue;
  30754. }
  30755. i += 1;
  30756. c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
  30757. out += hexTable[0xF0 | (c >> 18)]
  30758. + hexTable[0x80 | ((c >> 12) & 0x3F)]
  30759. + hexTable[0x80 | ((c >> 6) & 0x3F)]
  30760. + hexTable[0x80 | (c & 0x3F)];
  30761. }
  30762. return out;
  30763. };
  30764. var compact = function compact(value) {
  30765. var queue = [{ obj: { o: value }, prop: 'o' }];
  30766. var refs = [];
  30767. for (var i = 0; i < queue.length; ++i) {
  30768. var item = queue[i];
  30769. var obj = item.obj[item.prop];
  30770. var keys = Object.keys(obj);
  30771. for (var j = 0; j < keys.length; ++j) {
  30772. var key = keys[j];
  30773. var val = obj[key];
  30774. if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
  30775. queue.push({ obj: obj, prop: key });
  30776. refs.push(val);
  30777. }
  30778. }
  30779. }
  30780. return compactQueue(queue);
  30781. };
  30782. var isRegExp = function isRegExp(obj) {
  30783. return Object.prototype.toString.call(obj) === '[object RegExp]';
  30784. };
  30785. var isBuffer = function isBuffer(obj) {
  30786. if (obj === null || typeof obj === 'undefined') {
  30787. return false;
  30788. }
  30789. return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
  30790. };
  30791. module.exports = {
  30792. arrayToObject: arrayToObject,
  30793. assign: assign,
  30794. compact: compact,
  30795. decode: decode,
  30796. encode: encode,
  30797. isBuffer: isBuffer,
  30798. isRegExp: isRegExp,
  30799. merge: merge
  30800. };
  30801. /***/ }),
  30802. /* 276 */
  30803. /*!****************************************!*\
  30804. !*** ./node_modules/qs/lib/formats.js ***!
  30805. \****************************************/
  30806. /*! no static exports found */
  30807. /***/ (function(module, exports, __webpack_require__) {
  30808. "use strict";
  30809. var replace = String.prototype.replace;
  30810. var percentTwenties = /%20/g;
  30811. module.exports = {
  30812. 'default': 'RFC3986',
  30813. formatters: {
  30814. RFC1738: function (value) {
  30815. return replace.call(value, percentTwenties, '+');
  30816. },
  30817. RFC3986: function (value) {
  30818. return value;
  30819. }
  30820. },
  30821. RFC1738: 'RFC1738',
  30822. RFC3986: 'RFC3986'
  30823. };
  30824. /***/ }),
  30825. /* 277 */
  30826. /*!**************************************!*\
  30827. !*** ./node_modules/qs/lib/parse.js ***!
  30828. \**************************************/
  30829. /*! no static exports found */
  30830. /***/ (function(module, exports, __webpack_require__) {
  30831. "use strict";
  30832. var utils = __webpack_require__(/*! ./utils */ 275);
  30833. var has = Object.prototype.hasOwnProperty;
  30834. var defaults = {
  30835. allowDots: false,
  30836. allowPrototypes: false,
  30837. arrayLimit: 20,
  30838. decoder: utils.decode,
  30839. delimiter: '&',
  30840. depth: 5,
  30841. parameterLimit: 1000,
  30842. plainObjects: false,
  30843. strictNullHandling: false
  30844. };
  30845. var parseValues = function parseQueryStringValues(str, options) {
  30846. var obj = {};
  30847. var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
  30848. var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
  30849. var parts = cleanStr.split(options.delimiter, limit);
  30850. for (var i = 0; i < parts.length; ++i) {
  30851. var part = parts[i];
  30852. var bracketEqualsPos = part.indexOf(']=');
  30853. var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
  30854. var key, val;
  30855. if (pos === -1) {
  30856. key = options.decoder(part, defaults.decoder);
  30857. val = options.strictNullHandling ? null : '';
  30858. } else {
  30859. key = options.decoder(part.slice(0, pos), defaults.decoder);
  30860. val = options.decoder(part.slice(pos + 1), defaults.decoder);
  30861. }
  30862. if (has.call(obj, key)) {
  30863. obj[key] = [].concat(obj[key]).concat(val);
  30864. } else {
  30865. obj[key] = val;
  30866. }
  30867. }
  30868. return obj;
  30869. };
  30870. var parseObject = function (chain, val, options) {
  30871. var leaf = val;
  30872. for (var i = chain.length - 1; i >= 0; --i) {
  30873. var obj;
  30874. var root = chain[i];
  30875. if (root === '[]') {
  30876. obj = [];
  30877. obj = obj.concat(leaf);
  30878. } else {
  30879. obj = options.plainObjects ? Object.create(null) : {};
  30880. var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
  30881. var index = parseInt(cleanRoot, 10);
  30882. if (
  30883. !isNaN(index)
  30884. && root !== cleanRoot
  30885. && String(index) === cleanRoot
  30886. && index >= 0
  30887. && (options.parseArrays && index <= options.arrayLimit)
  30888. ) {
  30889. obj = [];
  30890. obj[index] = leaf;
  30891. } else {
  30892. obj[cleanRoot] = leaf;
  30893. }
  30894. }
  30895. leaf = obj;
  30896. }
  30897. return leaf;
  30898. };
  30899. var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
  30900. if (!givenKey) {
  30901. return;
  30902. }
  30903. // Transform dot notation to bracket notation
  30904. var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
  30905. // The regex chunks
  30906. var brackets = /(\[[^[\]]*])/;
  30907. var child = /(\[[^[\]]*])/g;
  30908. // Get the parent
  30909. var segment = brackets.exec(key);
  30910. var parent = segment ? key.slice(0, segment.index) : key;
  30911. // Stash the parent if it exists
  30912. var keys = [];
  30913. if (parent) {
  30914. // If we aren't using plain objects, optionally prefix keys
  30915. // that would overwrite object prototype properties
  30916. if (!options.plainObjects && has.call(Object.prototype, parent)) {
  30917. if (!options.allowPrototypes) {
  30918. return;
  30919. }
  30920. }
  30921. keys.push(parent);
  30922. }
  30923. // Loop through children appending to the array until we hit depth
  30924. var i = 0;
  30925. while ((segment = child.exec(key)) !== null && i < options.depth) {
  30926. i += 1;
  30927. if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
  30928. if (!options.allowPrototypes) {
  30929. return;
  30930. }
  30931. }
  30932. keys.push(segment[1]);
  30933. }
  30934. // If there's a remainder, just add whatever is left
  30935. if (segment) {
  30936. keys.push('[' + key.slice(segment.index) + ']');
  30937. }
  30938. return parseObject(keys, val, options);
  30939. };
  30940. module.exports = function (str, opts) {
  30941. var options = opts ? utils.assign({}, opts) : {};
  30942. if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
  30943. throw new TypeError('Decoder has to be a function.');
  30944. }
  30945. options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
  30946. options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
  30947. options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
  30948. options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
  30949. options.parseArrays = options.parseArrays !== false;
  30950. options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
  30951. options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
  30952. options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
  30953. options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
  30954. options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
  30955. options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
  30956. if (str === '' || str === null || typeof str === 'undefined') {
  30957. return options.plainObjects ? Object.create(null) : {};
  30958. }
  30959. var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
  30960. var obj = options.plainObjects ? Object.create(null) : {};
  30961. // Iterate over the keys and setup the new object
  30962. var keys = Object.keys(tempObj);
  30963. for (var i = 0; i < keys.length; ++i) {
  30964. var key = keys[i];
  30965. var newObj = parseKeys(key, tempObj[key], options);
  30966. obj = utils.merge(obj, newObj, options);
  30967. }
  30968. return utils.compact(obj);
  30969. };
  30970. /***/ }),
  30971. /* 278 */,
  30972. /* 279 */,
  30973. /* 280 */,
  30974. /* 281 */,
  30975. /* 282 */,
  30976. /* 283 */,
  30977. /* 284 */,
  30978. /* 285 */,
  30979. /* 286 */,
  30980. /* 287 */,
  30981. /* 288 */,
  30982. /* 289 */,
  30983. /* 290 */,
  30984. /* 291 */,
  30985. /* 292 */,
  30986. /* 293 */,
  30987. /* 294 */,
  30988. /* 295 */,
  30989. /* 296 */,
  30990. /* 297 */,
  30991. /* 298 */,
  30992. /* 299 */,
  30993. /* 300 */,
  30994. /* 301 */,
  30995. /* 302 */,
  30996. /* 303 */,
  30997. /* 304 */,
  30998. /* 305 */,
  30999. /* 306 */,
  31000. /* 307 */,
  31001. /* 308 */,
  31002. /* 309 */,
  31003. /* 310 */
  31004. /*!******************************************!*\
  31005. !*** F:/uniapp/sqxp-uniapp/api/order.js ***!
  31006. \******************************************/
  31007. /*! no static exports found */
  31008. /***/ (function(module, exports, __webpack_require__) {
  31009. "use strict";
  31010. Object.defineProperty(exports, "__esModule", { value: true });exports.getOrderList = getOrderList;exports.getWxOrder = getWxOrder;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  31011. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  31012. // 查询订单列表
  31013. function getOrderList(params) {
  31014. return (0, _request.default)({
  31015. url: _baseurl.baseUrl + '/student/film/wxpay/order/list',
  31016. params: params });
  31017. }
  31018. // 查询订单列表
  31019. function getWxOrder(path) {
  31020. return (0, _request.default)({
  31021. url: _baseurl.baseUrl + "/student/film/wxpay/".concat(path) });
  31022. }
  31023. /***/ }),
  31024. /* 311 */,
  31025. /* 312 */,
  31026. /* 313 */,
  31027. /* 314 */,
  31028. /* 315 */,
  31029. /* 316 */,
  31030. /* 317 */,
  31031. /* 318 */,
  31032. /* 319 */,
  31033. /* 320 */,
  31034. /* 321 */,
  31035. /* 322 */,
  31036. /* 323 */,
  31037. /* 324 */,
  31038. /* 325 */,
  31039. /* 326 */,
  31040. /* 327 */,
  31041. /* 328 */,
  31042. /* 329 */,
  31043. /* 330 */,
  31044. /* 331 */,
  31045. /* 332 */,
  31046. /* 333 */,
  31047. /* 334 */,
  31048. /* 335 */,
  31049. /* 336 */,
  31050. /* 337 */,
  31051. /* 338 */,
  31052. /* 339 */,
  31053. /* 340 */,
  31054. /* 341 */,
  31055. /* 342 */,
  31056. /* 343 */,
  31057. /* 344 */,
  31058. /* 345 */,
  31059. /* 346 */,
  31060. /* 347 */
  31061. /*!**********************************************!*\
  31062. !*** F:/uniapp/sqxp-uniapp/api/studytime.js ***!
  31063. \**********************************************/
  31064. /*! no static exports found */
  31065. /***/ (function(module, exports, __webpack_require__) {
  31066. "use strict";
  31067. Object.defineProperty(exports, "__esModule", { value: true });exports.addTime = addTime;exports.getTime = getTime;exports.getTimeInfo = getTimeInfo;exports.getStudentInfo = getStudentInfo;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  31068. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  31069. // 上传学时
  31070. function addTime(data) {
  31071. return (0, _request.default)({
  31072. url: _baseurl.baseUrl + '/student/gzpt-train-record',
  31073. method: 'post',
  31074. data: data });
  31075. }
  31076. // 查询已完成科目学时
  31077. function getTime(data) {
  31078. return (0, _request.default)({
  31079. url: _baseurl.baseUrl + '/student/gzpt-train-record/getTrainFinishKm',
  31080. method: 'get' });
  31081. }
  31082. // 查询额定学时
  31083. function getTimeInfo(data) {
  31084. return (0, _request.default)({
  31085. url: _baseurl.baseUrl + '/student/gzpt-train-record/getTrainSubjectCredit',
  31086. method: 'get' });
  31087. }
  31088. // 获取学员详细信息
  31089. function getStudentInfo(data) {
  31090. return (0, _request.default)({
  31091. url: _baseurl.baseUrl + '/student/gzpt/userInfo',
  31092. method: 'get' });
  31093. }
  31094. /***/ }),
  31095. /* 348 */,
  31096. /* 349 */,
  31097. /* 350 */,
  31098. /* 351 */,
  31099. /* 352 */,
  31100. /* 353 */,
  31101. /* 354 */,
  31102. /* 355 */,
  31103. /* 356 */,
  31104. /* 357 */,
  31105. /* 358 */,
  31106. /* 359 */,
  31107. /* 360 */,
  31108. /* 361 */,
  31109. /* 362 */,
  31110. /* 363 */,
  31111. /* 364 */,
  31112. /* 365 */,
  31113. /* 366 */,
  31114. /* 367 */,
  31115. /* 368 */,
  31116. /* 369 */
  31117. /*!*****************************************!*\
  31118. !*** F:/uniapp/sqxp-uniapp/api/home.js ***!
  31119. \*****************************************/
  31120. /*! no static exports found */
  31121. /***/ (function(module, exports, __webpack_require__) {
  31122. "use strict";
  31123. Object.defineProperty(exports, "__esModule", { value: true });exports.getHomePageDataList = getHomePageDataList;exports.getPDD = getPDD;exports.getPddWxData = getPddWxData;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 15));var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  31124. var _md = _interopRequireDefault(__webpack_require__(/*! crypto-js/md5 */ 199));
  31125. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  31126. // 查询轮播图列表
  31127. function getHomePageDataList() {
  31128. return (0, _request.default)({
  31129. url: _baseurl.baseUrl + "/student/applet/homePage/getHomePageDataList",
  31130. method: 'get' });
  31131. }
  31132. //拼多多密钥计算
  31133. function calcAuth(params, client_secret) {
  31134. var arr = [];
  31135. Object.keys(params).sort().forEach(function (key) {
  31136. arr.push(key + params[key]);
  31137. });
  31138. arr[0] = client_secret + arr[0];
  31139. arr[arr.length - 1] += client_secret;
  31140. return (0, _md.default)(arr.join('')).toString().toUpperCase();
  31141. }
  31142. // 查询轮播图列表
  31143. function getPDD() {
  31144. var params = {
  31145. type: 'pdd.ddk.goods.recommend.get',
  31146. data_type: 'JSON',
  31147. client_id: 'fa0f2debb5b0444b9719919d7b8204d1',
  31148. pid: '1642187_203462988',
  31149. timestamp: new Date().getTime().toString().slice(0, 10),
  31150. limit: 6 };
  31151. var client_secret = '3305b6bb37252495848e67fd991134651e308495';
  31152. params.sign = calcAuth(params, client_secret);
  31153. return (0, _request.default)({
  31154. url: "https://gw-api.pinduoduo.com/api/router",
  31155. method: 'get',
  31156. params: params });
  31157. }
  31158. // 查询小程序跳转参数
  31159. function getPddWxData() {return _getPddWxData.apply(this, arguments);}function _getPddWxData() {_getPddWxData = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var params, getPDDRes, arr, client_secret, wxDataRes, dataArr;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  31160. params = {
  31161. type: 'pdd.ddk.goods.promotion.url.generate',
  31162. data_type: 'JSON',
  31163. client_id: 'fa0f2debb5b0444b9719919d7b8204d1',
  31164. p_id: '1642187_203462988',
  31165. timestamp: new Date().getTime().toString().slice(0, 10),
  31166. generate_we_app: true };_context.next = 3;return (
  31167. getPDD());case 3:getPDDRes = _context.sent;
  31168. params.search_id = getPDDRes.goods_basic_detail_response.list[0].search_id;
  31169. arr = '[';
  31170. getPDDRes.goods_basic_detail_response.list.map(function (val) {
  31171. arr += '"' + val.goods_sign + '",';
  31172. });
  31173. params.goods_sign_list = arr.slice(0, -1) + ']';
  31174. client_secret = '3305b6bb37252495848e67fd991134651e308495';
  31175. params.sign = calcAuth(params, client_secret);_context.next = 12;return (
  31176. (0, _request.default)({
  31177. url: "https://gw-api.pinduoduo.com/api/router",
  31178. method: 'get',
  31179. params: params }));case 12:wxDataRes = _context.sent;
  31180. dataArr = [];
  31181. getPDDRes.goods_basic_detail_response.list.map(function (val, index) {
  31182. val.we_app_info = wxDataRes.goods_promotion_url_generate_response.goods_promotion_url_list[index].we_app_info;
  31183. });return _context.abrupt("return",
  31184. getPDDRes.goods_basic_detail_response.list);case 16:case "end":return _context.stop();}}}, _callee);}));return _getPddWxData.apply(this, arguments);}
  31185. /***/ }),
  31186. /* 370 */,
  31187. /* 371 */,
  31188. /* 372 */,
  31189. /* 373 */,
  31190. /* 374 */,
  31191. /* 375 */,
  31192. /* 376 */,
  31193. /* 377 */
  31194. /*!****************************************!*\
  31195. !*** F:/uniapp/sqxp-uniapp/api/pay.js ***!
  31196. \****************************************/
  31197. /*! no static exports found */
  31198. /***/ (function(module, exports, __webpack_require__) {
  31199. "use strict";
  31200. Object.defineProperty(exports, "__esModule", { value: true });exports.getPayData = getPayData;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));
  31201. var _baseurl = __webpack_require__(/*! @/api/baseurl */ 21);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  31202. // 微信支付获取订单接口
  31203. function getPayData(data) {
  31204. return (0, _request.default)({
  31205. url: _baseurl.baseUrl + '/student/film/wxpay/prepareOrder',
  31206. method: 'post',
  31207. data: data });
  31208. }
  31209. /***/ }),
  31210. /* 378 */
  31211. /*!*****************************************!*\
  31212. !*** F:/uniapp/sqxp-uniapp/api/amap.js ***!
  31213. \*****************************************/
  31214. /*! no static exports found */
  31215. /***/ (function(module, exports, __webpack_require__) {
  31216. "use strict";
  31217. Object.defineProperty(exports, "__esModule", { value: true });exports.amapRegeo = amapRegeo;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 18));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  31218. // 高德逆地理编码
  31219. function amapRegeo(params) {
  31220. return (0, _request.default)({
  31221. url: 'https://restapi.amap.com/v3/geocode/regeo',
  31222. method: 'get',
  31223. params: _objectSpread({
  31224. key: '6476cd358ddea091d7da6d59e92b0659' },
  31225. params) });
  31226. }
  31227. /***/ })
  31228. ]]);
  31229. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map